@helia/verified-fetch 0.0.0-f243de2 → 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,20 +1,20 @@
1
1
  (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.HeliaVerifiedFetch = factory()}(typeof self !== 'undefined' ? self : this, function () {
2
- "use strict";var HeliaVerifiedFetch=(()=>{var p8=Object.create;var Xc=Object.defineProperty;var d8=Object.getOwnPropertyDescriptor;var f8=Object.getOwnPropertyNames;var h8=Object.getPrototypeOf,m8=Object.prototype.hasOwnProperty;var re=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),$=(r,e)=>{for(var t in e)Xc(r,t,{get:e[t],enumerable:!0})},Bx=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of f8(e))!m8.call(r,i)&&i!==t&&Xc(r,i,{get:()=>e[i],enumerable:!(n=d8(e,i))||n.enumerable});return r};var Q=(r,e,t)=>(t=r!=null?p8(h8(r)):{},Bx(e||!r||!r.__esModule?Xc(t,"default",{value:r,enumerable:!0}):t,r)),g8=r=>Bx(Xc({},"__esModule",{value:!0}),r);var Ld=re((r7,$x)=>{var Uo=1e3,No=Uo*60,Do=No*60,ji=Do*24,sA=ji*7,aA=ji*365.25;$x.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return cA(r);if(t==="number"&&isFinite(r))return e.long?uA(r):lA(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function cA(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*aA;case"weeks":case"week":case"w":return t*sA;case"days":case"day":case"d":return t*ji;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Do;case"minutes":case"minute":case"mins":case"min":case"m":return t*No;case"seconds":case"second":case"secs":case"sec":case"s":return t*Uo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function lA(r){var e=Math.abs(r);return e>=ji?Math.round(r/ji)+"d":e>=Do?Math.round(r/Do)+"h":e>=No?Math.round(r/No)+"m":e>=Uo?Math.round(r/Uo)+"s":r+"ms"}function uA(r){var e=Math.abs(r);return e>=ji?el(r,e,ji,"day"):e>=Do?el(r,e,Do,"hour"):e>=No?el(r,e,No,"minute"):e>=Uo?el(r,e,Uo,"second"):r+" ms"}function el(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var Hx=re((n7,jx)=>{function pA(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=s,t.humanize=Ld(),t.destroy=u,Object.keys(r).forEach(l=>{t[l]=r[l]}),t.names=[],t.skips=[],t.formatters={};function e(l){let p=0;for(let m=0;m<l.length;m++)p=(p<<5)-p+l.charCodeAt(m),p|=0;return t.colors[Math.abs(p)%t.colors.length]}t.selectColor=e;function t(l){let p,m=null,d,f;function h(...x){if(!h.enabled)return;let g=h,y=Number(new Date),w=y-(p||y);g.diff=w,g.prev=p,g.curr=y,p=y,x[0]=t.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");let E=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,(S,b)=>{if(S==="%%")return"%";E++;let v=t.formatters[b];if(typeof v=="function"){let k=x[E];S=v.call(g,k),x.splice(E,1),E--}return S}),t.formatArgs.call(g,x),(g.log||t.log).apply(g,x)}return h.namespace=l,h.useColors=t.useColors(),h.color=t.selectColor(l),h.extend=n,h.destroy=t.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(d!==t.namespaces&&(d=t.namespaces,f=t.enabled(l)),f),set:x=>{m=x}}),typeof t.init=="function"&&t.init(h),h}function n(l,p){let m=t(this.namespace+(typeof p>"u"?":":p)+l);return m.log=this.log,m}function i(l){t.save(l),t.namespaces=l,t.names=[],t.skips=[];let p,m=(typeof l=="string"?l:"").split(/[\s,]+/),d=m.length;for(p=0;p<d;p++)m[p]&&(l=m[p].replace(/\*/g,".*?"),l[0]==="-"?t.skips.push(new RegExp("^"+l.slice(1)+"$")):t.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...t.names.map(a),...t.skips.map(a).map(p=>"-"+p)].join(",");return t.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let p,m;for(p=0,m=t.skips.length;p<m;p++)if(t.skips[p].test(l))return!1;for(p=0,m=t.names.length;p<m;p++)if(t.names[p].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}jx.exports=pA});var Pd=re((Ft,tl)=>{Ft.formatArgs=fA;Ft.save=hA;Ft.load=mA;Ft.useColors=dA;Ft.storage=gA();Ft.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ft.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function dA(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function fA(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+tl.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(n=t))}),r.splice(n,0,e)}Ft.log=console.debug||console.log||(()=>{});function hA(r){try{r?Ft.storage.setItem("debug",r):Ft.storage.removeItem("debug")}catch{}}function mA(){let r;try{r=Ft.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function gA(){try{return localStorage}catch{}}tl.exports=Hx()(Ft);var{formatters:xA}=tl.exports;xA.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Yx=re((u7,Wx)=>{Wx.exports=Fd;var Gx=128,vA=127,EA=~vA,AA=Math.pow(2,31);function Fd(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw Fd.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=AA;)e[t++]=r&255|Gx,r/=128;for(;r&EA;)e[t++]=r&255|Gx,r>>>=7;return e[t]=r|0,Fd.bytes=t-n+1,e}});var Zx=re((p7,Jx)=>{Jx.exports=zd;var SA=128,Xx=127;function zd(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a||i>49)throw zd.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&Xx)<<i:(s&Xx)*Math.pow(2,i),i+=7}while(s>=SA);return zd.bytes=o-n,t}});var e1=re((d7,Qx)=>{var BA=Math.pow(2,7),kA=Math.pow(2,14),IA=Math.pow(2,21),_A=Math.pow(2,28),TA=Math.pow(2,35),CA=Math.pow(2,42),RA=Math.pow(2,49),UA=Math.pow(2,56),NA=Math.pow(2,63);Qx.exports=function(r){return r<BA?1:r<kA?2:r<IA?3:r<_A?4:r<TA?5:r<CA?6:r<RA?7:r<UA?8:r<NA?9:10}});var rl=re((f7,t1)=>{t1.exports={encode:Yx(),decode:Zx(),encodingLength:e1()}});var ke=re((CO,b1)=>{"use strict";function w1(r,e){for(let t in e)Object.defineProperty(r,t,{value:e[t],enumerable:!0,configurable:!0});return r}function h5(r,e,t){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=""),e&&(t.code=e);try{return w1(r,t)}catch{t.message=r.message,t.stack=r.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(r)),w1(new i,t)}}b1.exports=h5});var fy=re(rs=>{"use strict";var oB="[object ArrayBuffer]",gn=class r{static isArrayBuffer(e){return Object.prototype.toString.call(e)===oB}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=r.toUint8Array(e),i=r.toUint8Array(t);if(n.length!==i.byteLength)return!1;for(let o=0;o<n.length;o++)if(n[o]!==i[o])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let s of t)n+=s.byteLength;let i=new Uint8Array(n),o=0;for(let s of t){let a=this.toUint8Array(s);i.set(a,o),o+=a.length}return e[e.length-1]instanceof Function?this.toView(i,e[e.length-1]):i.buffer}},Zf="string",sB=/^[0-9a-f]+$/i,aB=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,cB=/^[a-zA-Z0-9-_]+$/,Ul=class{static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n.buffer}static toString(e){let t=gn.toUint8Array(e),n="";for(let o=0;o<t.length;o++)n+=String.fromCharCode(t[o]);return decodeURIComponent(escape(n))}},sr=class{static toString(e,t=!1){let n=gn.toArrayBuffer(e),i=new DataView(n),o="";for(let s=0;s<n.byteLength;s+=2){let a=i.getUint16(s,t);o+=String.fromCharCode(a)}return o}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),i=new DataView(n);for(let o=0;o<e.length;o++)i.setUint16(o*2,e.charCodeAt(o),t);return n}},Nl=class r{static isHex(e){return typeof e===Zf&&sB.test(e)}static isBase64(e){return typeof e===Zf&&aB.test(e)}static isBase64Url(e){return typeof e===Zf&&cB.test(e)}static ToString(e,t="utf8"){let n=gn.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return sr.toString(n,!0);case"utf16":case"utf16be":return sr.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return sr.fromString(e,!0);case"utf16":case"utf16be":return sr.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=gn.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return Ul.fromString(e);case"utf16":case"utf16be":return sr.fromString(e);case"utf16le":case"usc2":return sr.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return Ul.toString(e);case"utf16":case"utf16be":return sr.toString(e);case"utf16le":case"usc2":return sr.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);return n.buffer}static ToBinary(e){let t=gn.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return n}static ToHex(e){let t=gn.toUint8Array(e),n="",i=t.length;for(let o=0;o<i;o++){let s=t[o];s<16&&(n+="0"),n+=s.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i=i+2){let o=t.slice(i,i+2);n[i/2]=parseInt(o,16)}return n.buffer}static ToUtf16String(e,t=!1){return sr.toString(e,t)}static FromUtf16String(e,t=!1){return sr.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Nl.DEFAULT_UTF8_ENCODING="utf8";function lB(r,...e){let t=arguments[0];for(let n=1;n<arguments.length;n++){let i=arguments[n];for(let o in i)t[o]=i[o]}return t}function uB(...r){let e=r.map(i=>i.byteLength).reduce((i,o)=>i+o),t=new Uint8Array(e),n=0;return r.map(i=>new Uint8Array(i)).forEach(i=>{for(let o of i)t[n++]=o}),t.buffer}function pB(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<r.byteLength;i++)if(t[i]!==n[i])return!1;return!0}rs.BufferSourceConverter=gn;rs.Convert=Nl;rs.assign=lB;rs.combine=uB;rs.isEqual=pB});var Eu=re((GV,fh)=>{var KV=function(){typeof fh<"u"&&(fh.exports=h);var r=86400,e=3200,t=146097*e/400,n=r*t,i=1e3*n,o=864e13,s=4294967296,a=1e6,c="000000000",u=Math.trunc||function(v){var k=v-v%1;return k==0&&(v<0||v===0&&1/v!=1/0)?-0:k},l=h.prototype,p=(h.fromDate=function(v){return new h(+v)},h.fromInt64BE=E(0,1,2,3,0,4),h.fromInt64LE=E(3,2,1,0,4,0),h.fromString=function(R){var k,U=new h,R=(R+="").replace(/^\s*[+\-]?\d+/,function(L){var L=+L,ce=1970+(L-1970)%400;return U.year=L-ce,ce}).replace(/(?:Z|([+\-]\d{2}):?(\d{2}))$/,function(M,L,ce){return L<0&&(ce*=-1),k=6e4*(60*+L+ +ce),""}).replace(/\.\d+$/,function(M){return U.nano=+(M+c).substr(1,9),""}).split(/\D+/);if(1<R.length?R[1]--:R[1]=0,U.time=k=Date.UTC.apply(Date,R)-(k||0),isNaN(k))throw new TypeError("Invalid Date");return x(U)},h.fromTimeT=function(v){return y(v,0)},l.year=0,l.time=0,l.nano=0,l.addNano=function(v){return this.nano+=+v||0,this},l.getNano=function(){var v=x(this);return(v.time%1e3*a+ +v.nano+1e9)%1e9},l.getTimeT=function(){var k=x(this),v=Math.floor(k.time/1e3),k=k.year;return k&&(v+=k*t*r/e),v},l.getYear=function(){return this.toDate().getUTCFullYear()+this.year},l.toDate=function(){return g(x(this).time)},l.toJSON=function(){return this.toString().replace(/0{1,6}Z$/,"Z")},l.toString=function(v){var k=this,U=k.toDate(),R={H:function(){return S(U.getUTCHours())},L:function(){return b(U.getUTCMilliseconds(),3)},M:function(){return S(U.getUTCMinutes())},N:function(){return b(k.getNano(),9)},S:function(){return S(U.getUTCSeconds())},Y:function(){var M=k.getYear();return 999999<M?"+"+M:9999<M?"+"+b(M,6):0<=M?b(M,4):-999999<=M?"-"+b(-M,6):M},a:function(){return d[U.getUTCDay()]},b:function(){return m[U.getUTCMonth()]},d:function(){return S(U.getUTCDate())},e:function(){return function(M){return(9<M?"":" ")+(0|M)}(U.getUTCDate())},m:function(){return S(U.getUTCMonth()+1)}};return function M(L){return L.replace(/%./g,function(ce){var D=ce[1],_=f[D],D=R[D];return _?M(_):D?D():ce})}(v||p)},l.writeInt64BE=w(0,1,2,3,0,4),l.writeInt64LE=w(3,2,1,0,4,0),"%Y-%m-%dT%H:%M:%S.%NZ"),m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],d=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],f={"%":"%",F:"%Y-%m-%d",n:`
3
- `,R:"%H:%M",T:"%H:%M:%S",t:" ",X:"%T",Z:"GMT",z:"+0000"};return h;function h(v,k,U){var R=this;if(!(R instanceof h))return new h(v,k,U);R.time=+v||0,R.nano=+k||0,R.year=+U||0,x(R)}function x(v){var k,U,R,M=v.year,L=v.time,ce=v.nano,_=((ce<0||a<=ce)&&(ce-=(U=Math.floor(ce/a))*a,L+=U,U=1),M%e);return(L<-o||o<L||_)&&((k=u(L/i))&&(M+=k*e,L-=k*i),(R=g(L)).setUTCFullYear(_+R.getUTCFullYear()),R=(L=+R)+(k=u((M-=_)/e))*i,k&&-o<=R&&R<=o&&(M-=k*e,L=R),U=1),U&&(v.year=M,v.time=L,v.nano=ce),v}function g(v){var k=new Date(0);return k.setTime(v),k}function y(M,R){M=+M||0;var U=u((R=(R|0)*s)/n)+u(M/n),R=R%n+M%n,M=u(R/n);return M&&(U+=M,R-=M*n),new h(1e3*R,0,U*e)}function w(v,k,U,R,M,L){return function(_,D){var N=x(this);_=_||new Array(8),B(_,D|=0);var T=Math.floor(N.time/1e3),N=N.year*(t*r/e),J=u(N/s)+u(T/s),N=N%s+T%s,T=Math.floor(N/s);return T&&(J+=T,N-=T*s),ce(_,D+M,J),ce(_,D+L,N),_};function ce(_,D,J){_[D+v]=J>>24&255,_[D+k]=J>>16&255,_[D+U]=J>>8&255,_[D+R]=255&J}}function E(v,k,U,R,M,L){return function(_,D){B(_,D|=0);var J=ce(_,D+M);return y(ce(_,D+L),J)};function ce(_,D){return 16777216*_[D+v]+(_[D+k]<<16|_[D+U]<<8|_[D+R])}}function B(v,k){if(v=v&&v.length,v==null)throw new TypeError("Invalid Buffer");if(v<k+8)throw new RangeError("Out of range")}function S(v){return(9<v?"":"0")+(0|v)}function b(v,k){return(c+(0|v)).substr(-k)}}()});var $b=re((C$,Ih)=>{"use strict";var Rk=Object.prototype.hasOwnProperty,bt="~";function qa(){}Object.create&&(qa.prototype=Object.create(null),new qa().__proto__||(bt=!1));function Uk(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function Mb(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var o=new Uk(t,n||r,i),s=bt?bt+e:e;return r._events[s]?r._events[s].fn?r._events[s]=[r._events[s],o]:r._events[s].push(o):(r._events[s]=o,r._eventsCount++),r}function zu(r,e){--r._eventsCount===0?r._events=new qa:delete r._events[e]}function ht(){this._events=new qa,this._eventsCount=0}ht.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)Rk.call(t,n)&&e.push(bt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};ht.prototype.listeners=function(e){var t=bt?bt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s};ht.prototype.listenerCount=function(e){var t=bt?bt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};ht.prototype.emit=function(e,t,n,i,o,s){var a=bt?bt+e:e;if(!this._events[a])return!1;var c=this._events[a],u=arguments.length,l,p;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,o),!0;case 6:return c.fn.call(c.context,t,n,i,o,s),!0}for(p=1,l=new Array(u-1);p<u;p++)l[p-1]=arguments[p];c.fn.apply(c.context,l)}else{var m=c.length,d;for(p=0;p<m;p++)switch(c[p].once&&this.removeListener(e,c[p].fn,void 0,!0),u){case 1:c[p].fn.call(c[p].context);break;case 2:c[p].fn.call(c[p].context,t);break;case 3:c[p].fn.call(c[p].context,t,n);break;case 4:c[p].fn.call(c[p].context,t,n,i);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[p].fn.apply(c[p].context,l)}}return!0};ht.prototype.on=function(e,t,n){return Mb(this,e,t,n,!1)};ht.prototype.once=function(e,t,n){return Mb(this,e,t,n,!0)};ht.prototype.removeListener=function(e,t,n,i){var o=bt?bt+e:e;if(!this._events[o])return this;if(!t)return zu(this,o),this;var s=this._events[o];if(s.fn)s.fn===t&&(!i||s.once)&&(!n||s.context===n)&&zu(this,o);else{for(var a=0,c=[],u=s.length;a<u;a++)(s[a].fn!==t||i&&!s[a].once||n&&s[a].context!==n)&&c.push(s[a]);c.length?this._events[o]=c.length===1?c[0]:c:zu(this,o)}return this};ht.prototype.removeAllListeners=function(e){var t;return e?(t=bt?bt+e:e,this._events[t]&&zu(this,t)):(this._events=new qa,this._eventsCount=0),this};ht.prototype.off=ht.prototype.removeListener;ht.prototype.addListener=ht.prototype.on;ht.prefixed=bt;ht.EventEmitter=ht;typeof Ih<"u"&&(Ih.exports=ht)});var V0=re((XX,SE)=>{"use strict";var jR=typeof navigator<"u"&&navigator.product==="ReactNative";function HR(){return jR?"http://localhost":self.location?self.location.protocol+"//"+self.location.host:""}var Ac=self.URL,AE=HR(),z0=class{constructor(e="",t=AE){this.super=new Ac(e,t),this.path=this.pathname+this.search,this.auth=this.username&&this.password?this.username+":"+this.password:null,this.query=this.search&&this.search.startsWith("?")?this.search.slice(1):null}get hash(){return this.super.hash}get host(){return this.super.host}get hostname(){return this.super.hostname}get href(){return this.super.href}get origin(){return this.super.origin}get password(){return this.super.password}get pathname(){return this.super.pathname}get port(){return this.super.port}get protocol(){return this.super.protocol}get search(){return this.super.search}get searchParams(){return this.super.searchParams}get username(){return this.super.username}set hash(e){this.super.hash=e}set host(e){this.super.host=e}set hostname(e){this.super.hostname=e}set href(e){this.super.href=e}set password(e){this.super.password=e}set pathname(e){this.super.pathname=e}set port(e){this.super.port=e}set protocol(e){this.super.protocol=e}set search(e){this.super.search=e}set username(e){this.super.username=e}static createObjectURL(e){return Ac.createObjectURL(e)}static revokeObjectURL(e){Ac.revokeObjectURL(e)}toJSON(){return this.super.toJSON()}toString(){return this.super.toString()}format(){return this.toString()}};function qR(r){if(typeof r=="string")return new Ac(r).toString();if(!(r instanceof Ac)){let e=r.username&&r.password?`${r.username}:${r.password}@`:"",t=r.auth?r.auth+"@":"",n=r.port?":"+r.port:"",i=r.protocol?r.protocol+"//":"",o=r.host||"",s=r.hostname||"",a=r.search||(r.query?"?"+r.query:""),c=r.hash||"",u=r.pathname||"",l=r.path||u+a;return`${i}${e||t}${o||s+n}${l}${c}`}}SE.exports={URLWithLegacySupport:z0,URLSearchParams:self.URLSearchParams,defaultBase:AE,format:qR}});var IE=re((JX,kE)=>{"use strict";var{URLWithLegacySupport:BE,format:KR}=V0();kE.exports=(r,e={},t={},n)=>{let i=e.protocol?e.protocol.replace(":",""):"http";i=(t[i]||n||i)+":";let o;try{o=new BE(r)}catch{o={}}let s=Object.assign({},e,{protocol:i||o.protocol,host:e.host||o.host});return new BE(r,KR(s)).toString()}});var TE=re((ZX,_E)=>{"use strict";var{URLWithLegacySupport:GR,format:WR,URLSearchParams:YR,defaultBase:XR}=V0(),JR=IE();_E.exports={URL:GR,URLSearchParams:YR,format:WR,relative:JR,defaultBase:XR}});var DE=re((aJ,NE)=>{"use strict";NE.exports=UE;var iU=Ld(),Ci=UE.prototype,oU=new Date%1e9;function sU(){return(Math.random()*1e9>>>0)+oU++}function UE(r){r=r||{},this.id=r.id||sU(),this.max=r.max||1/0,this.items=r.items||[],this._lookup={},this.size=this.items.length,this.lastModified=new Date(r.lastModified||new Date);for(var e,t,n=this.items.length;n--;)e=this.items[n],t=new Date(e.expires)-new Date,this._lookup[e.key]=e,t>0?this.expire(e.key,t):t<=0&&this.delete(e.key)}Ci.has=function(r){return r in this._lookup};Ci.get=function(r){if(!this.has(r))return null;var e=this._lookup[r];return e.refresh&&this.expire(r,e.refresh),this.items.splice(this.items.indexOf(e),1),this.items.push(e),e.value};Ci.meta=function(r){if(!this.has(r))return null;var e=this._lookup[r];return"meta"in e?e.meta:null};Ci.set=function(r,e,t){var n=this._lookup[r],i=this._lookup[r]={key:r,value:e};return this.lastModified=new Date,n?(clearTimeout(n.timeout),this.items.splice(this.items.indexOf(n),1,i)):(this.size>=this.max&&this.delete(this.items[0].key),this.items.push(i),this.size++),t&&("ttl"in t&&this.expire(r,t.ttl),"meta"in t&&(i.meta=t.meta),t.refresh&&(i.refresh=t.ttl)),this};Ci.delete=function(r){var e=this._lookup[r];return e?(this.lastModified=new Date,this.items.splice(this.items.indexOf(e),1),clearTimeout(e.timeout),delete this._lookup[r],this.size--,this):!1};Ci.expire=function(r,e){var t=e||0,n=this._lookup[r];if(!n)return this;if(typeof t=="string"&&(t=iU(e)),typeof t!="number")throw new TypeError("Expiration time must be a string or number.");return clearTimeout(n.timeout),n.timeout=setTimeout(this.delete.bind(this,n.key),t),n.expires=Number(new Date)+t,this};Ci.clear=function(){for(var r=this.items.length;r--;)this.delete(this.items[r].key);return this};Ci.toJSON=function(){for(var r=new Array(this.items.length),e,t=r.length;t--;)e=this.items[t],r[t]={key:e.key,meta:e.meta,value:e.value,expires:e.expires,refresh:e.refresh};return{id:this.id,max:isFinite(this.max)?this.max:void 0,lastModified:this.lastModified,items:r}}});var K0=re((lJ,OE)=>{OE.exports=function(r){if(!r)throw Error("hashlru must have a max value, of type number, greater than 0");var e=0,t=Object.create(null),n=Object.create(null);function i(o,s){t[o]=s,e++,e>=r&&(e=0,n=t,t=Object.create(null))}return{has:function(o){return t[o]!==void 0||n[o]!==void 0},remove:function(o){t[o]!==void 0&&(t[o]=void 0),n[o]!==void 0&&(n[o]=void 0)},get:function(o){var s=t[o];if(s!==void 0)return s;if((s=n[o])!==void 0)return i(o,s),s},set:function(o,s){t[o]!==void 0?t[o]=s:i(o,s)},clear:function(){t=Object.create(null),n=Object.create(null)}}}});var JE=re(Bp=>{"use strict";Bp.byteLength=mU;Bp.toByteArray=xU;Bp.fromByteArray=bU;var Gr=[],pr=[],hU=typeof Uint8Array<"u"?Uint8Array:Array,Z0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(xo=0,YE=Z0.length;xo<YE;++xo)Gr[xo]=Z0[xo],pr[Z0.charCodeAt(xo)]=xo;var xo,YE;pr[45]=62;pr[95]=63;function XE(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function mU(r){var e=XE(r),t=e[0],n=e[1];return(t+n)*3/4-n}function gU(r,e,t){return(e+t)*3/4-t}function xU(r){var e,t=XE(r),n=t[0],i=t[1],o=new hU(gU(r,n,i)),s=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=pr[r.charCodeAt(c)]<<18|pr[r.charCodeAt(c+1)]<<12|pr[r.charCodeAt(c+2)]<<6|pr[r.charCodeAt(c+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=pr[r.charCodeAt(c)]<<2|pr[r.charCodeAt(c+1)]>>4,o[s++]=e&255),i===1&&(e=pr[r.charCodeAt(c)]<<10|pr[r.charCodeAt(c+1)]<<4|pr[r.charCodeAt(c+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function yU(r){return Gr[r>>18&63]+Gr[r>>12&63]+Gr[r>>6&63]+Gr[r&63]}function wU(r,e,t){for(var n,i=[],o=e;o<t;o+=3)n=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),i.push(yU(n));return i.join("")}function bU(r){for(var e,t=r.length,n=t%3,i=[],o=16383,s=0,a=t-n;s<a;s+=o)i.push(wU(r,s,s+o>a?a:s+o));return n===1?(e=r[t-1],i.push(Gr[e>>2]+Gr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(Gr[e>>10]+Gr[e>>4&63]+Gr[e<<2&63]+"=")),i.join("")}});var ZE=re(Q0=>{Q0.read=function(r,e,t,n,i){var o,s,a=i*8-n-1,c=(1<<a)-1,u=c>>1,l=-7,p=t?i-1:0,m=t?-1:1,d=r[e+p];for(p+=m,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=o*256+r[e+p],p+=m,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=s*256+r[e+p],p+=m,l-=8);if(o===0)o=1-u;else{if(o===c)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-u}return(d?-1:1)*s*Math.pow(2,o-n)};Q0.write=function(r,e,t,n,i,o){var s,a,c,u=o*8-i-1,l=(1<<u)-1,p=l>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,h=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+p>=1?e+=m/c:e+=m*Math.pow(2,1-p),e*c>=2&&(s++,c/=2),s+p>=l?(a=0,s=l):s+p>=1?(a=(e*c-1)*Math.pow(2,i),s=s+p):(a=e*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;r[t+d]=a&255,d+=f,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;r[t+d]=s&255,d+=f,s/=256,u-=8);r[t+d-f]|=h*128}});var cg=re(js=>{"use strict";var eg=JE(),Ms=ZE(),QE=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;js.Buffer=I;js.SlowBuffer=kU;js.INSPECT_MAX_BYTES=50;var kp=2147483647;js.kMaxLength=kp;I.TYPED_ARRAY_SUPPORT=vU();!I.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 vU(){try{let r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(I.prototype,"parent",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.buffer}});Object.defineProperty(I.prototype,"offset",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.byteOffset}});function Pn(r){if(r>kp)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,I.prototype),e}function I(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ig(r)}return n3(r,e,t)}I.poolSize=8192;function n3(r,e,t){if(typeof r=="string")return AU(r,e);if(ArrayBuffer.isView(r))return SU(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Wr(r,ArrayBuffer)||r&&Wr(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Wr(r,SharedArrayBuffer)||r&&Wr(r.buffer,SharedArrayBuffer)))return rg(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return I.from(n,e,t);let i=BU(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return I.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}I.from=function(r,e,t){return n3(r,e,t)};Object.setPrototypeOf(I.prototype,Uint8Array.prototype);Object.setPrototypeOf(I,Uint8Array);function i3(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function EU(r,e,t){return i3(r),r<=0?Pn(r):e!==void 0?typeof t=="string"?Pn(r).fill(e,t):Pn(r).fill(e):Pn(r)}I.alloc=function(r,e,t){return EU(r,e,t)};function ig(r){return i3(r),Pn(r<0?0:og(r)|0)}I.allocUnsafe=function(r){return ig(r)};I.allocUnsafeSlow=function(r){return ig(r)};function AU(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!I.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=o3(r,e)|0,n=Pn(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}function tg(r){let e=r.length<0?0:og(r.length)|0,t=Pn(e);for(let n=0;n<e;n+=1)t[n]=r[n]&255;return t}function SU(r){if(Wr(r,Uint8Array)){let e=new Uint8Array(r);return rg(e.buffer,e.byteOffset,e.byteLength)}return tg(r)}function rg(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,I.prototype),n}function BU(r){if(I.isBuffer(r)){let e=og(r.length)|0,t=Pn(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||ag(r.length)?Pn(0):tg(r);if(r.type==="Buffer"&&Array.isArray(r.data))return tg(r.data)}function og(r){if(r>=kp)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kp.toString(16)+" bytes");return r|0}function kU(r){return+r!=r&&(r=0),I.alloc(+r)}I.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==I.prototype};I.compare=function(e,t){if(Wr(e,Uint8Array)&&(e=I.from(e,e.offset,e.byteLength)),Wr(t,Uint8Array)&&(t=I.from(t,t.offset,t.byteLength)),!I.isBuffer(e)||!I.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t.length;for(let o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==t[o]){n=e[o],i=t[o];break}return n<i?-1:i<n?1:0};I.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}};I.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return I.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let i=I.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){let s=e[n];if(Wr(s,Uint8Array))o+s.length>i.length?(I.isBuffer(s)||(s=I.from(s)),s.copy(i,o)):Uint8Array.prototype.set.call(i,s,o);else if(I.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i};function o3(r,e){if(I.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Wr(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return ng(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return h3(r).length;default:if(i)return n?-1:ng(r).length;e=(""+e).toLowerCase(),i=!0}}I.byteLength=o3;function IU(r,e,t){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return OU(this,e,t);case"utf8":case"utf-8":return a3(this,e,t);case"ascii":return LU(this,e,t);case"latin1":case"binary":return PU(this,e,t);case"base64":return NU(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return FU(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}I.prototype._isBuffer=!0;function yo(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}I.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 t=0;t<e;t+=2)yo(this,t,t+1);return this};I.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 t=0;t<e;t+=4)yo(this,t,t+3),yo(this,t+1,t+2);return this};I.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 t=0;t<e;t+=8)yo(this,t,t+7),yo(this,t+1,t+6),yo(this,t+2,t+5),yo(this,t+3,t+4);return this};I.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?a3(this,0,e):IU.apply(this,arguments)};I.prototype.toLocaleString=I.prototype.toString;I.prototype.equals=function(e){if(!I.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:I.compare(this,e)===0};I.prototype.inspect=function(){let e="",t=js.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};QE&&(I.prototype[QE]=I.prototype.inspect);I.prototype.compare=function(e,t,n,i,o){if(Wr(e,Uint8Array)&&(e=I.from(e,e.offset,e.byteLength)),!I.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;let s=o-i,a=n-t,c=Math.min(s,a),u=this.slice(i,o),l=e.slice(t,n);for(let p=0;p<c;++p)if(u[p]!==l[p]){s=u[p],a=l[p];break}return s<a?-1:a<s?1:0};function s3(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,ag(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=I.from(e,n)),I.isBuffer(e))return e.length===0?-1:e3(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):e3(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function e3(r,e,t,n,i){let o=1,s=r.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;o=2,s/=2,a/=2,t/=2}function c(l,p){return o===1?l[p]:l.readUInt16BE(p*o)}let u;if(i){let l=-1;for(u=t;u<s;u++)if(c(r,u)===c(e,l===-1?0:u-l)){if(l===-1&&(l=u),u-l+1===a)return l*o}else l!==-1&&(u-=u-l),l=-1}else for(t+a>s&&(t=s-a),u=t;u>=0;u--){let l=!0;for(let p=0;p<a;p++)if(c(r,u+p)!==c(e,p)){l=!1;break}if(l)return u}return-1}I.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1};I.prototype.indexOf=function(e,t,n){return s3(this,e,t,n,!0)};I.prototype.lastIndexOf=function(e,t,n){return s3(this,e,t,n,!1)};function _U(r,e,t,n){t=Number(t)||0;let i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let s;for(s=0;s<n;++s){let a=parseInt(e.substr(s*2,2),16);if(ag(a))return s;r[t+s]=a}return s}function TU(r,e,t,n){return Ip(ng(e,r.length-t),r,t,n)}function CU(r,e,t,n){return Ip($U(e),r,t,n)}function RU(r,e,t,n){return Ip(h3(e),r,t,n)}function UU(r,e,t,n){return Ip(jU(e,r.length-t),r,t,n)}I.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>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-t;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return _U(this,e,t,n);case"utf8":case"utf-8":return TU(this,e,t,n);case"ascii":case"latin1":case"binary":return CU(this,e,t,n);case"base64":return RU(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return UU(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};I.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function NU(r,e,t){return e===0&&t===r.length?eg.fromByteArray(r):eg.fromByteArray(r.slice(e,t))}function a3(r,e,t){t=Math.min(r.length,t);let n=[],i=e;for(;i<t;){let o=r[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=t){let c,u,l,p;switch(a){case 1:o<128&&(s=o);break;case 2:c=r[i+1],(c&192)===128&&(p=(o&31)<<6|c&63,p>127&&(s=p));break;case 3:c=r[i+1],u=r[i+2],(c&192)===128&&(u&192)===128&&(p=(o&15)<<12|(c&63)<<6|u&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:c=r[i+1],u=r[i+2],l=r[i+3],(c&192)===128&&(u&192)===128&&(l&192)===128&&(p=(o&15)<<18|(c&63)<<12|(u&63)<<6|l&63,p>65535&&p<1114112&&(s=p))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return DU(n)}var t3=4096;function DU(r){let e=r.length;if(e<=t3)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=t3));return t}function LU(r,e,t){let n="";t=Math.min(r.length,t);for(let i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function PU(r,e,t){let n="";t=Math.min(r.length,t);for(let i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function OU(r,e,t){let n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);let i="";for(let o=e;o<t;++o)i+=HU[r[o]];return i}function FU(r,e,t){let n=r.slice(e,t),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}I.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let i=this.subarray(e,t);return Object.setPrototypeOf(i,I.prototype),i};function Qe(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}I.prototype.readUintLE=I.prototype.readUIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||Qe(e,t,this.length);let i=this[e],o=1,s=0;for(;++s<t&&(o*=256);)i+=this[e+s]*o;return i};I.prototype.readUintBE=I.prototype.readUIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||Qe(e,t,this.length);let i=this[e+--t],o=1;for(;t>0&&(o*=256);)i+=this[e+--t]*o;return i};I.prototype.readUint8=I.prototype.readUInt8=function(e,t){return e=e>>>0,t||Qe(e,1,this.length),this[e]};I.prototype.readUint16LE=I.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||Qe(e,2,this.length),this[e]|this[e+1]<<8};I.prototype.readUint16BE=I.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||Qe(e,2,this.length),this[e]<<8|this[e+1]};I.prototype.readUint32LE=I.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};I.prototype.readUint32BE=I.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};I.prototype.readBigUInt64LE=Ui(function(e){e=e>>>0,$s(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&kc(e,this.length-8);let i=t+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))});I.prototype.readBigUInt64BE=Ui(function(e){e=e>>>0,$s(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&kc(e,this.length-8);let i=t*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)});I.prototype.readIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||Qe(e,t,this.length);let i=this[e],o=1,s=0;for(;++s<t&&(o*=256);)i+=this[e+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i};I.prototype.readIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||Qe(e,t,this.length);let i=t,o=1,s=this[e+--i];for(;i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*t)),s};I.prototype.readInt8=function(e,t){return e=e>>>0,t||Qe(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};I.prototype.readInt16LE=function(e,t){e=e>>>0,t||Qe(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};I.prototype.readInt16BE=function(e,t){e=e>>>0,t||Qe(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};I.prototype.readInt32LE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};I.prototype.readInt32BE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};I.prototype.readBigInt64LE=Ui(function(e){e=e>>>0,$s(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&kc(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(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});I.prototype.readBigInt64BE=Ui(function(e){e=e>>>0,$s(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&kc(e,this.length-8);let i=(t<<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)});I.prototype.readFloatLE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),Ms.read(this,e,!0,23,4)};I.prototype.readFloatBE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),Ms.read(this,e,!1,23,4)};I.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||Qe(e,8,this.length),Ms.read(this,e,!0,52,8)};I.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||Qe(e,8,this.length),Ms.read(this,e,!1,52,8)};function Dt(r,e,t,n,i,o){if(!I.isBuffer(r))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(t+n>r.length)throw new RangeError("Index out of range")}I.prototype.writeUintLE=I.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;Dt(this,e,t,n,a,0)}let o=1,s=0;for(this[t]=e&255;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n};I.prototype.writeUintBE=I.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;Dt(this,e,t,n,a,0)}let o=n-1,s=1;for(this[t+o]=e&255;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n};I.prototype.writeUint8=I.prototype.writeUInt8=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,1,255,0),this[t]=e&255,t+1};I.prototype.writeUint16LE=I.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};I.prototype.writeUint16BE=I.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};I.prototype.writeUint32LE=I.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};I.prototype.writeUint32BE=I.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function c3(r,e,t,n,i){f3(e,n,i,r,t,7);let o=Number(e&BigInt(4294967295));r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s,t}function l3(r,e,t,n,i){f3(e,n,i,r,t,7);let o=Number(e&BigInt(4294967295));r[t+7]=o,o=o>>8,r[t+6]=o,o=o>>8,r[t+5]=o,o=o>>8,r[t+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=s,s=s>>8,r[t+2]=s,s=s>>8,r[t+1]=s,s=s>>8,r[t]=s,t+8}I.prototype.writeBigUInt64LE=Ui(function(e,t=0){return c3(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});I.prototype.writeBigUInt64BE=Ui(function(e,t=0){return l3(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});I.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);Dt(this,e,t,n,c-1,-c)}let o=0,s=1,a=0;for(this[t]=e&255;++o<n&&(s*=256);)e<0&&a===0&&this[t+o-1]!==0&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n};I.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);Dt(this,e,t,n,c-1,-c)}let o=n-1,s=1,a=0;for(this[t+o]=e&255;--o>=0&&(s*=256);)e<0&&a===0&&this[t+o+1]!==0&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n};I.prototype.writeInt8=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};I.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};I.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};I.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};I.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};I.prototype.writeBigInt64LE=Ui(function(e,t=0){return c3(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});I.prototype.writeBigInt64BE=Ui(function(e,t=0){return l3(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function u3(r,e,t,n,i,o){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function p3(r,e,t,n,i){return e=+e,t=t>>>0,i||u3(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ms.write(r,e,t,n,23,4),t+4}I.prototype.writeFloatLE=function(e,t,n){return p3(this,e,t,!0,n)};I.prototype.writeFloatBE=function(e,t,n){return p3(this,e,t,!1,n)};function d3(r,e,t,n,i){return e=+e,t=t>>>0,i||u3(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ms.write(r,e,t,n,52,8),t+8}I.prototype.writeDoubleLE=function(e,t,n){return d3(this,e,t,!0,n)};I.prototype.writeDoubleBE=function(e,t,n){return d3(this,e,t,!1,n)};I.prototype.copy=function(e,t,n,i){if(!I.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<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-t<i-n&&(i=e.length-t+n);let o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),o};I.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=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"&&!I.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let s=e.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{let s=I.isBuffer(e)?e:I.from(e,i),a=s.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var Vs={};function sg(r,e,t){Vs[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}sg("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);sg("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError);sg("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out of range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=r3(String(t)):typeof t=="bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=r3(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function r3(r){let e="",t=r.length,n=r[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function zU(r,e,t){$s(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&kc(e,r.length-(t+1))}function f3(r,e,t,n,i,o){if(r>t||r<e){let s=typeof e=="bigint"?"n":"",a;throw o>3?e===0||e===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${e}${s} and <= ${t}${s}`,new Vs.ERR_OUT_OF_RANGE("value",a,r)}zU(n,i,o)}function $s(r,e){if(typeof r!="number")throw new Vs.ERR_INVALID_ARG_TYPE(e,"number",r)}function kc(r,e,t){throw Math.floor(r)!==r?($s(r,t),new Vs.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Vs.ERR_BUFFER_OUT_OF_BOUNDS:new Vs.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}var VU=/[^+/0-9A-Za-z-_]/g;function MU(r){if(r=r.split("=")[0],r=r.trim().replace(VU,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function ng(r,e){e=e||1/0;let t,n=r.length,i=null,o=[];for(let s=0;s<n;++s){if(t=r.charCodeAt(s),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&o.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;o.push(t)}else if(t<2048){if((e-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function $U(r){let e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function jU(r,e){let t,n,i,o=[];for(let s=0;s<r.length&&!((e-=2)<0);++s)t=r.charCodeAt(s),n=t>>8,i=t%256,o.push(i),o.push(n);return o}function h3(r){return eg.toByteArray(MU(r))}function Ip(r,e,t,n){let i;for(i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function Wr(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function ag(r){return r!==r}var HU=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i<16;++i)e[n+i]=r[t]+r[i]}return e}();function Ui(r){return typeof BigInt>"u"?qU:r}function qU(){throw new Error("BigInt not supported")}});var m3=re(lg=>{"use strict";lg.toString=function(r){switch(r){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+r};lg.toType=function(r){switch(r.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return r.toUpperCase().startsWith("UNKNOWN_")?parseInt(r.slice(8)):0}});var g3=re(ug=>{"use strict";ug.toString=function(r){switch(r){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+r};ug.toRcode=function(r){switch(r.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var x3=re(pg=>{"use strict";pg.toString=function(r){switch(r){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+r};pg.toOpcode=function(r){switch(r.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var y3=re(dg=>{"use strict";dg.toString=function(r){switch(r){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+r};dg.toClass=function(r){switch(r.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var w3=re(fg=>{"use strict";fg.toString=function(r){switch(r){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return r<0?null:`OPTION_${r}`};fg.toCode=function(r){if(typeof r=="number")return r;if(!r)return-1;switch(r.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let e=r.match(/_(\d+)$/);return e?parseInt(e[1],10):-1}});var E3=re((v3,hg)=>{var b3=function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.decode=p,r.encode=l,r.familyOf=u,r.name=void 0,r.sizeOf=c,r.v6=r.v4=void 0;let e=/^(\d{1,3}\.){3,3}\d{1,3}$/,t=4,n=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,i=16,o={name:"v4",size:t,isFormat:m=>e.test(m),encode(m,d,f){f=~~f,d=d||new Uint8Array(f+t);let h=m.length,x=0;for(let g=0;g<h;){let y=m.charCodeAt(g++);y===46?(d[f++]=x,x=0):x=x*10+(y-48)}return d[f]=x,d},decode(m,d){return d=~~d,`${m[d++]}.${m[d++]}.${m[d++]}.${m[d]}`}};r.v4=o;let s={name:"v6",size:i,isFormat:m=>m.length>0&&n.test(m),encode(m,d,f){f=~~f;let h=f+i,x=-1,g=0,y=0,w=!0,E=!1;d=d||new Uint8Array(f+i);for(let B=0;B<m.length;B++){let S=m.charCodeAt(B);S===58?(w?x!==-1?(f<h&&(d[f]=0),f<h-1&&(d[f+1]=0),f+=2):f<h&&(x=f):(E===!0?(f<h&&(d[f]=y),f++):(f<h&&(d[f]=g>>8),f<h-1&&(d[f+1]=g&255),f+=2),g=0,y=0),w=!0,E=!1):S===46?(f<h&&(d[f]=y),f++,y=0,g=0,w=!1,E=!0):(w=!1,S>=97?S-=87:S>=65?S-=55:(S-=48,y=y*10+S),g=(g<<4)+S)}if(w===!1)E===!0?(f<h&&(d[f]=y),f++):(f<h&&(d[f]=g>>8),f<h-1&&(d[f+1]=g&255),f+=2);else if(x===0)f<h&&(d[f]=0),f<h-1&&(d[f+1]=0),f+=2;else if(x!==-1){f+=2;for(let B=Math.min(f-1,h-1);B>=x+2;B--)d[B]=d[B-2];d[x]=0,d[x+1]=0,x=f}if(x!==f&&x!==-1)for(f>h-2&&(f=h-2);h>x;)d[--h]=f<h&&f>x?d[--f]:0;else for(;f<h;)d[f++]=0;return d},decode(m,d){d=~~d;let f="";for(let h=0;h<i;h+=2)h!==0&&(f+=":"),f+=(m[d+h]<<8|m[d+h+1]).toString(16);return f.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};r.v6=s;let a="ip";r.name=a;function c(m){if(o.isFormat(m))return o.size;if(s.isFormat(m))return s.size;throw Error(`Invalid ip address: ${m}`)}function u(m){return c(m)===o.size?1:2}function l(m,d,f){f=~~f;let h=c(m);return typeof d=="function"&&(d=d(f+h)),h===o.size?o.encode(m,d,f):s.encode(m,d,f)}function p(m,d,f){if(d=~~d,f=f||m.length-d,f===o.size)return o.decode(m,d,f);if(f===s.size)return s.decode(m,d,f);throw Error(`Invalid buffer size needs to be ${o.size} for v4 or ${s.size} for v6.`)}return"default"in r?r.default:r}({});typeof define=="function"&&define.amd?define([],function(){return b3}):typeof hg=="object"&&typeof v3=="object"&&(hg.exports=b3)});var B3=re(G=>{"use strict";var W=cg().Buffer,Kn=m3(),KU=g3(),GU=x3(),Tp=y3(),mg=w3(),wo=E3(),WU=0,A3=32768,gg=32768,YU=~gg,S3=32768,XU=~S3,V=G.name={};V.encode=function(r,e,t,{mail:n=!1}={}){e||(e=W.alloc(V.encodingLength(r))),t||(t=0);let i=t,o=r.replace(/^\.|\.$/gm,"");if(o.length){let s=[];if(n){let a="";o.split(".").forEach(c=>{c.endsWith("\\")?a+=(a.length?".":"")+c.slice(0,-1):s.length===0&&a.length?s.push(a+"."+c):s.push(c)})}else s=o.split(".");for(let a=0;a<s.length;a++){let c=e.write(s[a],t+1);e[t]=c,t+=c+1}}return e[t++]=0,V.encode.bytes=t-i,e};V.encode.bytes=0;V.decode=function(r,e,{mail:t=!1}={}){e||(e=0);let n=[],i=e,o=0,s=0,a=!1;for(;;){if(e>=r.length)throw new Error("Cannot decode name (buffer overflow)");let c=r[e++];if(s+=a?0:1,c===0)break;if(c&192)if((c&192)===192){if(e+1>r.length)throw new Error("Cannot decode name (buffer overflow)");let u=r.readUInt16BE(e-1)-49152;if(u>=i)throw new Error("Cannot decode name (bad pointer)");e=u,i=u,s+=a?0:1,a=!0}else throw new Error("Cannot decode name (bad label)");else{if(e+c>r.length)throw new Error("Cannot decode name (buffer overflow)");if(o+=c+1,o>254)throw new Error("Cannot decode name (name too long)");let u=r.toString("utf-8",e,e+c);t&&(u=u.replace(/\./g,"\\.")),n.push(u),e+=c,s+=a?0:c}}return V.decode.bytes=s,n.length===0?".":n.join(".")};V.decode.bytes=0;V.encodingLength=function(r){return r==="."||r===".."?1:W.byteLength(r.replace(/^\.|\.$/gm,""))+2};var oe={};oe.encode=function(r,e,t){e||(e=W.alloc(oe.encodingLength(r))),t||(t=0);let n=e.write(r,t+1);return e[t]=n,oe.encode.bytes=n+1,e};oe.encode.bytes=0;oe.decode=function(r,e){e||(e=0);let t=r[e],n=r.toString("utf-8",e+1,e+1+t);return oe.decode.bytes=t+1,n};oe.decode.bytes=0;oe.encodingLength=function(r){return W.byteLength(r)+1};var Ir={};Ir.encode=function(r,e,t){e||(e=Ir.encodingLength(r)),t||(t=0);let n=(r.flags||0)&32767,i=r.type==="response"?A3:WU;return e.writeUInt16BE(r.id||0,t),e.writeUInt16BE(n|i,t+2),e.writeUInt16BE(r.questions.length,t+4),e.writeUInt16BE(r.answers.length,t+6),e.writeUInt16BE(r.authorities.length,t+8),e.writeUInt16BE(r.additionals.length,t+10),e};Ir.encode.bytes=12;Ir.decode=function(r,e){if(e||(e=0),r.length<12)throw new Error("Header must be 12 bytes");let t=r.readUInt16BE(e+2);return{id:r.readUInt16BE(e),type:t&A3?"response":"query",flags:t&32767,flag_qr:(t>>15&1)===1,opcode:GU.toString(t>>11&15),flag_aa:(t>>10&1)===1,flag_tc:(t>>9&1)===1,flag_rd:(t>>8&1)===1,flag_ra:(t>>7&1)===1,flag_z:(t>>6&1)===1,flag_ad:(t>>5&1)===1,flag_cd:(t>>4&1)===1,rcode:KU.toString(t&15),questions:new Array(r.readUInt16BE(e+4)),answers:new Array(r.readUInt16BE(e+6)),authorities:new Array(r.readUInt16BE(e+8)),additionals:new Array(r.readUInt16BE(e+10))}};Ir.decode.bytes=12;Ir.encodingLength=function(){return 12};var On=G.unknown={};On.encode=function(r,e,t){return e||(e=W.alloc(On.encodingLength(r))),t||(t=0),e.writeUInt16BE(r.length,t),r.copy(e,t+2),On.encode.bytes=r.length+2,e};On.encode.bytes=0;On.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n=r.slice(e+2,e+2+t);return On.decode.bytes=t+2,n};On.decode.bytes=0;On.encodingLength=function(r){return r.length+2};var Fn=G.ns={};Fn.encode=function(r,e,t){return e||(e=W.alloc(Fn.encodingLength(r))),t||(t=0),V.encode(r,e,t+2),e.writeUInt16BE(V.encode.bytes,t),Fn.encode.bytes=V.encode.bytes+2,e};Fn.encode.bytes=0;Fn.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n=V.decode(r,e+2);return Fn.decode.bytes=t+2,n};Fn.decode.bytes=0;Fn.encodingLength=function(r){return V.encodingLength(r)+2};var zn=G.soa={};zn.encode=function(r,e,t){e||(e=W.alloc(zn.encodingLength(r))),t||(t=0);let n=t;return t+=2,V.encode(r.mname,e,t),t+=V.encode.bytes,V.encode(r.rname,e,t,{mail:!0}),t+=V.encode.bytes,e.writeUInt32BE(r.serial||0,t),t+=4,e.writeUInt32BE(r.refresh||0,t),t+=4,e.writeUInt32BE(r.retry||0,t),t+=4,e.writeUInt32BE(r.expire||0,t),t+=4,e.writeUInt32BE(r.minimum||0,t),t+=4,e.writeUInt16BE(t-n-2,n),zn.encode.bytes=t-n,e};zn.encode.bytes=0;zn.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.mname=V.decode(r,e),e+=V.decode.bytes,n.rname=V.decode(r,e,{mail:!0}),e+=V.decode.bytes,n.serial=r.readUInt32BE(e),e+=4,n.refresh=r.readUInt32BE(e),e+=4,n.retry=r.readUInt32BE(e),e+=4,n.expire=r.readUInt32BE(e),e+=4,n.minimum=r.readUInt32BE(e),e+=4,zn.decode.bytes=e-t,n};zn.decode.bytes=0;zn.encodingLength=function(r){return 22+V.encodingLength(r.mname)+V.encodingLength(r.rname)};var Vn=G.txt={};Vn.encode=function(r,e,t){Array.isArray(r)||(r=[r]);for(let i=0;i<r.length;i++)if(typeof r[i]=="string"&&(r[i]=W.from(r[i])),!W.isBuffer(r[i]))throw new Error("Must be a Buffer");e||(e=W.alloc(Vn.encodingLength(r))),t||(t=0);let n=t;return t+=2,r.forEach(function(i){e[t++]=i.length,i.copy(e,t,0,i.length),t+=i.length}),e.writeUInt16BE(t-n-2,n),Vn.encode.bytes=t-n,e};Vn.encode.bytes=0;Vn.decode=function(r,e){e||(e=0);let t=e,n=r.readUInt16BE(e);e+=2;let i=[];for(;n>0;){let o=r[e++];if(--n,n<o)throw new Error("Buffer overflow");i.push(r.slice(e,e+o)),e+=o,n-=o}return Vn.decode.bytes=e-t,i};Vn.decode.bytes=0;Vn.encodingLength=function(r){Array.isArray(r)||(r=[r]);let e=2;return r.forEach(function(t){typeof t=="string"?e+=W.byteLength(t)+1:e+=t.length+1}),e};var Mn=G.null={};Mn.encode=function(r,e,t){e||(e=W.alloc(Mn.encodingLength(r))),t||(t=0),typeof r=="string"&&(r=W.from(r)),r||(r=W.alloc(0));let n=t;t+=2;let i=r.length;return r.copy(e,t,0,i),t+=i,e.writeUInt16BE(t-n-2,n),Mn.encode.bytes=t-n,e};Mn.encode.bytes=0;Mn.decode=function(r,e){e||(e=0);let t=e,n=r.readUInt16BE(e);e+=2;let i=r.slice(e,e+n);return e+=n,Mn.decode.bytes=e-t,i};Mn.decode.bytes=0;Mn.encodingLength=function(r){return r?(W.isBuffer(r)?r.length:W.byteLength(r))+2:2};var $n=G.hinfo={};$n.encode=function(r,e,t){e||(e=W.alloc($n.encodingLength(r))),t||(t=0);let n=t;return t+=2,oe.encode(r.cpu,e,t),t+=oe.encode.bytes,oe.encode(r.os,e,t),t+=oe.encode.bytes,e.writeUInt16BE(t-n-2,n),$n.encode.bytes=t-n,e};$n.encode.bytes=0;$n.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.cpu=oe.decode(r,e),e+=oe.decode.bytes,n.os=oe.decode(r,e),e+=oe.decode.bytes,$n.decode.bytes=e-t,n};$n.decode.bytes=0;$n.encodingLength=function(r){return oe.encodingLength(r.cpu)+oe.encodingLength(r.os)+2};var Br=G.ptr={},JU=G.cname=Br,ZU=G.dname=Br;Br.encode=function(r,e,t){return e||(e=W.alloc(Br.encodingLength(r))),t||(t=0),V.encode(r,e,t+2),e.writeUInt16BE(V.encode.bytes,t),Br.encode.bytes=V.encode.bytes+2,e};Br.encode.bytes=0;Br.decode=function(r,e){e||(e=0);let t=V.decode(r,e+2);return Br.decode.bytes=V.decode.bytes+2,t};Br.decode.bytes=0;Br.encodingLength=function(r){return V.encodingLength(r)+2};var jn=G.srv={};jn.encode=function(r,e,t){e||(e=W.alloc(jn.encodingLength(r))),t||(t=0),e.writeUInt16BE(r.priority||0,t+2),e.writeUInt16BE(r.weight||0,t+4),e.writeUInt16BE(r.port||0,t+6),V.encode(r.target,e,t+8);let n=V.encode.bytes+6;return e.writeUInt16BE(n,t),jn.encode.bytes=n+2,e};jn.encode.bytes=0;jn.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n={};return n.priority=r.readUInt16BE(e+2),n.weight=r.readUInt16BE(e+4),n.port=r.readUInt16BE(e+6),n.target=V.decode(r,e+8),jn.decode.bytes=t+2,n};jn.decode.bytes=0;jn.encodingLength=function(r){return 8+V.encodingLength(r.target)};var Wt=G.caa={};Wt.ISSUER_CRITICAL=128;Wt.encode=function(r,e,t){let n=Wt.encodingLength(r);return e||(e=W.alloc(Wt.encodingLength(r))),t||(t=0),r.issuerCritical&&(r.flags=Wt.ISSUER_CRITICAL),e.writeUInt16BE(n-2,t),t+=2,e.writeUInt8(r.flags||0,t),t+=1,oe.encode(r.tag,e,t),t+=oe.encode.bytes,e.write(r.value,t),t+=W.byteLength(r.value),Wt.encode.bytes=n,e};Wt.encode.bytes=0;Wt.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e);e+=2;let n=e,i={};return i.flags=r.readUInt8(e),e+=1,i.tag=oe.decode(r,e),e+=oe.decode.bytes,i.value=r.toString("utf-8",e,n+t),i.issuerCritical=!!(i.flags&Wt.ISSUER_CRITICAL),Wt.decode.bytes=t+2,i};Wt.decode.bytes=0;Wt.encodingLength=function(r){return oe.encodingLength(r.tag)+oe.encodingLength(r.value)+2};var Ni=G.mx={};Ni.encode=function(r,e,t){e||(e=W.alloc(Ni.encodingLength(r))),t||(t=0);let n=t;return t+=2,e.writeUInt16BE(r.preference||0,t),t+=2,V.encode(r.exchange,e,t),t+=V.encode.bytes,e.writeUInt16BE(t-n-2,n),Ni.encode.bytes=t-n,e};Ni.encode.bytes=0;Ni.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.preference=r.readUInt16BE(e),e+=2,n.exchange=V.decode(r,e),e+=V.decode.bytes,Ni.decode.bytes=e-t,n};Ni.encodingLength=function(r){return 4+V.encodingLength(r.exchange)};var Hn=G.a={};Hn.encode=function(r,e,t){return e||(e=W.alloc(Hn.encodingLength(r))),t||(t=0),e.writeUInt16BE(4,t),t+=2,wo.v4.encode(r,e,t),Hn.encode.bytes=6,e};Hn.encode.bytes=0;Hn.decode=function(r,e){e||(e=0),e+=2;let t=wo.v4.decode(r,e);return Hn.decode.bytes=6,t};Hn.decode.bytes=0;Hn.encodingLength=function(){return 6};var qn=G.aaaa={};qn.encode=function(r,e,t){return e||(e=W.alloc(qn.encodingLength(r))),t||(t=0),e.writeUInt16BE(16,t),t+=2,wo.v6.encode(r,e,t),qn.encode.bytes=18,e};qn.encode.bytes=0;qn.decode=function(r,e){e||(e=0),e+=2;let t=wo.v6.decode(r,e);return qn.decode.bytes=18,t};qn.decode.bytes=0;qn.encodingLength=function(){return 18};var Lt=G.option={};Lt.encode=function(r,e,t){e||(e=W.alloc(Lt.encodingLength(r))),t||(t=0);let n=t,i=mg.toCode(r.code);if(e.writeUInt16BE(i,t),t+=2,r.data)e.writeUInt16BE(r.data.length,t),t+=2,r.data.copy(e,t),t+=r.data.length;else switch(i){case 8:let o=r.sourcePrefixLength||0,s=r.family||wo.familyOf(r.ip),a=wo.encode(r.ip,W.alloc),c=Math.ceil(o/8);e.writeUInt16BE(c+4,t),t+=2,e.writeUInt16BE(s,t),t+=2,e.writeUInt8(o,t++),e.writeUInt8(r.scopePrefixLength||0,t++),a.copy(e,t,0,c),t+=c;break;case 11:r.timeout?(e.writeUInt16BE(2,t),t+=2,e.writeUInt16BE(r.timeout,t),t+=2):(e.writeUInt16BE(0,t),t+=2);break;case 12:let u=r.length||0;e.writeUInt16BE(u,t),t+=2,e.fill(0,t,t+u),t+=u;break;case 14:let l=r.tags.length*2;e.writeUInt16BE(l,t),t+=2;for(let p of r.tags)e.writeUInt16BE(p,t),t+=2;break;default:throw new Error(`Unknown roption code: ${r.code}`)}return Lt.encode.bytes=t-n,e};Lt.encode.bytes=0;Lt.decode=function(r,e){e||(e=0);let t={};t.code=r.readUInt16BE(e),t.type=mg.toString(t.code),e+=2;let n=r.readUInt16BE(e);switch(e+=2,t.data=r.slice(e,e+n),t.code){case 8:t.family=r.readUInt16BE(e),e+=2,t.sourcePrefixLength=r.readUInt8(e++),t.scopePrefixLength=r.readUInt8(e++);let i=W.alloc(t.family===1?4:16);r.copy(i,0,e,e+n-4),t.ip=wo.decode(i);break;case 11:n>0&&(t.timeout=r.readUInt16BE(e),e+=2);break;case 14:t.tags=[];for(let o=0;o<n;o+=2)t.tags.push(r.readUInt16BE(e)),e+=2}return Lt.decode.bytes=n+4,t};Lt.decode.bytes=0;Lt.encodingLength=function(r){if(r.data)return r.data.length+4;switch(mg.toCode(r.code)){case 8:let t=r.sourcePrefixLength||0;return Math.ceil(t/8)+8;case 11:return typeof r.timeout=="number"?6:4;case 12:return r.length+4;case 14:return 4+r.tags.length*2}throw new Error(`Unknown roption code: ${r.code}`)};var Xt=G.opt={};Xt.encode=function(r,e,t){e||(e=W.alloc(Xt.encodingLength(r))),t||(t=0);let n=t,i=Hs(r,Lt);return e.writeUInt16BE(i,t),t=Ic(r,Lt,e,t+2),Xt.encode.bytes=t-n,e};Xt.encode.bytes=0;Xt.decode=function(r,e){e||(e=0);let t=e,n=[],i=r.readUInt16BE(e);e+=2;let o=0;for(;i>0;)n[o++]=Lt.decode(r,e),e+=Lt.decode.bytes,i-=Lt.decode.bytes;return Xt.decode.bytes=e-t,n};Xt.decode.bytes=0;Xt.encodingLength=function(r){return 2+Hs(r||[],Lt)};var At=G.dnskey={};At.PROTOCOL_DNSSEC=3;At.ZONE_KEY=128;At.SECURE_ENTRYPOINT=32768;At.encode=function(r,e,t){e||(e=W.alloc(At.encodingLength(r))),t||(t=0);let n=t,i=r.key;if(!W.isBuffer(i))throw new Error("Key must be a Buffer");return t+=2,e.writeUInt16BE(r.flags,t),t+=2,e.writeUInt8(At.PROTOCOL_DNSSEC,t),t+=1,e.writeUInt8(r.algorithm,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,At.encode.bytes=t-n,e.writeUInt16BE(At.encode.bytes-2,n),e};At.encode.bytes=0;At.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);if(e+=2,n.flags=r.readUInt16BE(e),e+=2,r.readUInt8(e)!==At.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return e+=1,n.algorithm=r.readUInt8(e),e+=1,n.key=r.slice(e,t+i+2),e+=n.key.length,At.decode.bytes=e-t,n};At.decode.bytes=0;At.encodingLength=function(r){return 6+W.byteLength(r.key)};var Yr=G.rrsig={};Yr.encode=function(r,e,t){e||(e=W.alloc(Yr.encodingLength(r))),t||(t=0);let n=t,i=r.signature;if(!W.isBuffer(i))throw new Error("Signature must be a Buffer");return t+=2,e.writeUInt16BE(Kn.toType(r.typeCovered),t),t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.labels,t),t+=1,e.writeUInt32BE(r.originalTTL,t),t+=4,e.writeUInt32BE(r.expiration,t),t+=4,e.writeUInt32BE(r.inception,t),t+=4,e.writeUInt16BE(r.keyTag,t),t+=2,V.encode(r.signersName,e,t),t+=V.encode.bytes,i.copy(e,t,0,i.length),t+=i.length,Yr.encode.bytes=t-n,e.writeUInt16BE(Yr.encode.bytes-2,n),e};Yr.encode.bytes=0;Yr.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.typeCovered=Kn.toString(r.readUInt16BE(e)),e+=2,n.algorithm=r.readUInt8(e),e+=1,n.labels=r.readUInt8(e),e+=1,n.originalTTL=r.readUInt32BE(e),e+=4,n.expiration=r.readUInt32BE(e),e+=4,n.inception=r.readUInt32BE(e),e+=4,n.keyTag=r.readUInt16BE(e),e+=2,n.signersName=V.decode(r,e),e+=V.decode.bytes,n.signature=r.slice(e,t+i+2),e+=n.signature.length,Yr.decode.bytes=e-t,n};Yr.decode.bytes=0;Yr.encodingLength=function(r){return 20+V.encodingLength(r.signersName)+W.byteLength(r.signature)};var Xr=G.rp={};Xr.encode=function(r,e,t){e||(e=W.alloc(Xr.encodingLength(r))),t||(t=0);let n=t;return t+=2,V.encode(r.mbox||".",e,t,{mail:!0}),t+=V.encode.bytes,V.encode(r.txt||".",e,t),t+=V.encode.bytes,Xr.encode.bytes=t-n,e.writeUInt16BE(Xr.encode.bytes-2,n),e};Xr.encode.bytes=0;Xr.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.mbox=V.decode(r,e,{mail:!0})||".",e+=V.decode.bytes,n.txt=V.decode(r,e)||".",e+=V.decode.bytes,Xr.decode.bytes=e-t,n};Xr.decode.bytes=0;Xr.encodingLength=function(r){return 2+V.encodingLength(r.mbox||".")+V.encodingLength(r.txt||".")};var et={};et.encode=function(r,e,t){e||(e=W.alloc(et.encodingLength(r))),t||(t=0);let n=t;for(var i=[],o=0;o<r.length;o++){var s=Kn.toType(r[o]);i[s>>8]===void 0&&(i[s>>8]=[]),i[s>>8][s>>3&31]|=1<<7-(s&7)}for(o=0;o<i.length;o++)if(i[o]!==void 0){var a=W.from(i[o]);e.writeUInt8(o,t),t+=1,e.writeUInt8(a.length,t),t+=1,a.copy(e,t),t+=a.length}return et.encode.bytes=t-n,e};et.encode.bytes=0;et.decode=function(r,e,t){e||(e=0);let n=e;for(var i=[];e-n<t;){var o=r.readUInt8(e);e+=1;var s=r.readUInt8(e);e+=1;for(var a=0;a<s;a++)for(var c=r.readUInt8(e+a),u=0;u<8;u++)if(c&1<<7-u){var l=Kn.toString(o<<8|a<<3|u);i.push(l)}e+=s}return et.decode.bytes=e-n,i};et.decode.bytes=0;et.encodingLength=function(r){for(var e=[],t=0;t<r.length;t++){var n=Kn.toType(r[t]);e[n>>8]=Math.max(e[n>>8]||0,n&255)}var i=0;for(t=0;t<e.length;t++)e[t]!==void 0&&(i+=2+Math.ceil((e[t]+1)/8));return i};var Jr=G.nsec={};Jr.encode=function(r,e,t){e||(e=W.alloc(Jr.encodingLength(r))),t||(t=0);let n=t;return t+=2,V.encode(r.nextDomain,e,t),t+=V.encode.bytes,et.encode(r.rrtypes,e,t),t+=et.encode.bytes,Jr.encode.bytes=t-n,e.writeUInt16BE(Jr.encode.bytes-2,n),e};Jr.encode.bytes=0;Jr.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.nextDomain=V.decode(r,e),e+=V.decode.bytes,n.rrtypes=et.decode(r,e,i-(e-t)),e+=et.decode.bytes,Jr.decode.bytes=e-t,n};Jr.decode.bytes=0;Jr.encodingLength=function(r){return 2+V.encodingLength(r.nextDomain)+et.encodingLength(r.rrtypes)};var Zr=G.nsec3={};Zr.encode=function(r,e,t){e||(e=W.alloc(Zr.encodingLength(r))),t||(t=0);let n=t,i=r.salt;if(!W.isBuffer(i))throw new Error("salt must be a Buffer");let o=r.nextDomain;if(!W.isBuffer(o))throw new Error("nextDomain must be a Buffer");return t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.flags,t),t+=1,e.writeUInt16BE(r.iterations,t),t+=2,e.writeUInt8(i.length,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,e.writeUInt8(o.length,t),t+=1,o.copy(e,t,0,o.length),t+=o.length,et.encode(r.rrtypes,e,t),t+=et.encode.bytes,Zr.encode.bytes=t-n,e.writeUInt16BE(Zr.encode.bytes-2,n),e};Zr.encode.bytes=0;Zr.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);e+=2,n.algorithm=r.readUInt8(e),e+=1,n.flags=r.readUInt8(e),e+=1,n.iterations=r.readUInt16BE(e),e+=2;let o=r.readUInt8(e);e+=1,n.salt=r.slice(e,e+o),e+=o;let s=r.readUInt8(e);return e+=1,n.nextDomain=r.slice(e,e+s),e+=s,n.rrtypes=et.decode(r,e,i-(e-t)),e+=et.decode.bytes,Zr.decode.bytes=e-t,n};Zr.decode.bytes=0;Zr.encodingLength=function(r){return 8+r.salt.length+r.nextDomain.length+et.encodingLength(r.rrtypes)};var Qr=G.ds={};Qr.encode=function(r,e,t){e||(e=W.alloc(Qr.encodingLength(r))),t||(t=0);let n=t,i=r.digest;if(!W.isBuffer(i))throw new Error("Digest must be a Buffer");return t+=2,e.writeUInt16BE(r.keyTag,t),t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.digestType,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,Qr.encode.bytes=t-n,e.writeUInt16BE(Qr.encode.bytes-2,n),e};Qr.encode.bytes=0;Qr.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.keyTag=r.readUInt16BE(e),e+=2,n.algorithm=r.readUInt8(e),e+=1,n.digestType=r.readUInt8(e),e+=1,n.digest=r.slice(e,t+i+2),e+=n.digest.length,Qr.decode.bytes=e-t,n};Qr.decode.bytes=0;Qr.encodingLength=function(r){return 6+W.byteLength(r.digest)};var Yt=G.sshfp={};Yt.getFingerprintLengthForHashType=function(e){switch(e){case 1:return 20;case 2:return 32}};Yt.encode=function(e,t,n){t||(t=W.alloc(Yt.encodingLength(e))),n||(n=0);let i=n;n+=2,t[n]=e.algorithm,n+=1,t[n]=e.hash,n+=1;let o=W.from(e.fingerprint.toUpperCase(),"hex");if(o.length!==Yt.getFingerprintLengthForHashType(e.hash))throw new Error("Invalid fingerprint length");return o.copy(t,n),n+=o.byteLength,Yt.encode.bytes=n-i,t.writeUInt16BE(Yt.encode.bytes-2,i),t};Yt.encode.bytes=0;Yt.decode=function(e,t){t||(t=0);let n=t,i={};t+=2,i.algorithm=e[t],t+=1,i.hash=e[t],t+=1;let o=Yt.getFingerprintLengthForHashType(i.hash);return i.fingerprint=e.slice(t,t+o).toString("hex").toUpperCase(),t+=o,Yt.decode.bytes=t-n,i};Yt.decode.bytes=0;Yt.encodingLength=function(r){return 4+W.from(r.fingerprint,"hex").byteLength};var en=G.naptr={};en.encode=function(r,e,t){e||(e=W.alloc(en.encodingLength(r))),t||(t=0);let n=t;return t+=2,e.writeUInt16BE(r.order||0,t),t+=2,e.writeUInt16BE(r.preference||0,t),t+=2,oe.encode(r.flags,e,t),t+=oe.encode.bytes,oe.encode(r.services,e,t),t+=oe.encode.bytes,oe.encode(r.regexp,e,t),t+=oe.encode.bytes,V.encode(r.replacement,e,t),t+=V.encode.bytes,en.encode.bytes=t-n,e.writeUInt16BE(en.encode.bytes-2,n),e};en.encode.bytes=0;en.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.order=r.readUInt16BE(e),e+=2,n.preference=r.readUInt16BE(e),e+=2,n.flags=oe.decode(r,e),e+=oe.decode.bytes,n.services=oe.decode(r,e),e+=oe.decode.bytes,n.regexp=oe.decode(r,e),e+=oe.decode.bytes,n.replacement=V.decode(r,e),e+=V.decode.bytes,en.decode.bytes=e-t,n};en.decode.bytes=0;en.encodingLength=function(r){return oe.encodingLength(r.flags)+oe.encodingLength(r.services)+oe.encodingLength(r.regexp)+V.encodingLength(r.replacement)+6};var tn=G.tlsa={};tn.encode=function(r,e,t){e||(e=W.alloc(tn.encodingLength(r))),t||(t=0);let n=t,i=r.certificate;if(!W.isBuffer(i))throw new Error("Certificate must be a Buffer");return t+=2,e.writeUInt8(r.usage,t),t+=1,e.writeUInt8(r.selector,t),t+=1,e.writeUInt8(r.matchingType,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,tn.encode.bytes=t-n,e.writeUInt16BE(tn.encode.bytes-2,n),e};tn.encode.bytes=0;tn.decode=function(r,e){e||(e=0);let t=e,n={},i=r.readUInt16BE(e);return e+=2,n.usage=r.readUInt8(e),e+=1,n.selector=r.readUInt8(e),e+=1,n.matchingType=r.readUInt8(e),e+=1,n.certificate=r.slice(e,t+i+2),e+=n.certificate.length,tn.decode.bytes=e-t,n};tn.decode.bytes=0;tn.encodingLength=function(r){return 5+W.byteLength(r.certificate)};var xg=G.record=function(r){switch(r.toUpperCase()){case"A":return Hn;case"PTR":return Br;case"CNAME":return JU;case"DNAME":return ZU;case"TXT":return Vn;case"NULL":return Mn;case"AAAA":return qn;case"SRV":return jn;case"HINFO":return $n;case"CAA":return Wt;case"NS":return Fn;case"SOA":return zn;case"MX":return Ni;case"OPT":return Xt;case"DNSKEY":return At;case"RRSIG":return Yr;case"RP":return Xr;case"NSEC":return Jr;case"NSEC3":return Zr;case"SSHFP":return Yt;case"DS":return Qr;case"NAPTR":return en;case"TLSA":return tn}return On},ct=G.answer={};ct.encode=function(r,e,t){e||(e=W.alloc(ct.encodingLength(r))),t||(t=0);let n=t;if(V.encode(r.name,e,t),t+=V.encode.bytes,e.writeUInt16BE(Kn.toType(r.type),t),r.type.toUpperCase()==="OPT"){if(r.name!==".")throw new Error("OPT name must be root.");e.writeUInt16BE(r.udpPayloadSize||4096,t+2),e.writeUInt8(r.extendedRcode||0,t+4),e.writeUInt8(r.ednsVersion||0,t+5),e.writeUInt16BE(r.flags||0,t+6),t+=8,Xt.encode(r.options||[],e,t),t+=Xt.encode.bytes}else{let i=Tp.toClass(r.class===void 0?"IN":r.class);r.flush&&(i|=gg),e.writeUInt16BE(i,t+2),e.writeUInt32BE(r.ttl||0,t+4),t+=8;let o=xg(r.type);o.encode(r.data,e,t),t+=o.encode.bytes}return ct.encode.bytes=t-n,e};ct.encode.bytes=0;ct.decode=function(r,e){e||(e=0);let t={},n=e;if(t.name=V.decode(r,e),e+=V.decode.bytes,t.type=Kn.toString(r.readUInt16BE(e)),t.type==="OPT")t.udpPayloadSize=r.readUInt16BE(e+2),t.extendedRcode=r.readUInt8(e+4),t.ednsVersion=r.readUInt8(e+5),t.flags=r.readUInt16BE(e+6),t.flag_do=(t.flags>>15&1)===1,t.options=Xt.decode(r,e+8),e+=8+Xt.decode.bytes;else{let i=r.readUInt16BE(e+2);t.ttl=r.readUInt32BE(e+4),t.class=Tp.toString(i&YU),t.flush=!!(i&gg);let o=xg(t.type);t.data=o.decode(r,e+8),e+=8+o.decode.bytes}return ct.decode.bytes=e-n,t};ct.decode.bytes=0;ct.encodingLength=function(r){let e=r.data!==null&&r.data!==void 0?r.data:r.options;return V.encodingLength(r.name)+8+xg(r.type).encodingLength(e)};var kr=G.question={};kr.encode=function(r,e,t){e||(e=W.alloc(kr.encodingLength(r))),t||(t=0);let n=t;return V.encode(r.name,e,t),t+=V.encode.bytes,e.writeUInt16BE(Kn.toType(r.type),t),t+=2,e.writeUInt16BE(Tp.toClass(r.class===void 0?"IN":r.class),t),t+=2,kr.encode.bytes=t-n,r};kr.encode.bytes=0;kr.decode=function(r,e){e||(e=0);let t=e,n={};return n.name=V.decode(r,e),e+=V.decode.bytes,n.type=Kn.toString(r.readUInt16BE(e)),e+=2,n.class=Tp.toString(r.readUInt16BE(e)),e+=2,!!(n.class&S3)&&(n.class&=XU),kr.decode.bytes=e-t,n};kr.decode.bytes=0;kr.encodingLength=function(r){return V.encodingLength(r.name)+4};G.AUTHORITATIVE_ANSWER=1024;G.TRUNCATED_RESPONSE=512;G.RECURSION_DESIRED=256;G.RECURSION_AVAILABLE=128;G.AUTHENTIC_DATA=32;G.CHECKING_DISABLED=16;G.DNSSEC_OK=32768;G.encode=function(r,e,t){let n=!e;n&&(e=W.alloc(G.encodingLength(r))),t||(t=0);let i=t;return r.questions||(r.questions=[]),r.answers||(r.answers=[]),r.authorities||(r.authorities=[]),r.additionals||(r.additionals=[]),Ir.encode(r,e,t),t+=Ir.encode.bytes,t=Ic(r.questions,kr,e,t),t=Ic(r.answers,ct,e,t),t=Ic(r.authorities,ct,e,t),t=Ic(r.additionals,ct,e,t),G.encode.bytes=t-i,n&&G.encode.bytes!==e.length?e.slice(0,G.encode.bytes):e};G.encode.bytes=0;G.decode=function(r,e){e||(e=0);let t=e,n=Ir.decode(r,e);return e+=Ir.decode.bytes,e=_p(n.questions,kr,r,e),e=_p(n.answers,ct,r,e),e=_p(n.authorities,ct,r,e),e=_p(n.additionals,ct,r,e),G.decode.bytes=e-t,n};G.decode.bytes=0;G.encodingLength=function(r){return Ir.encodingLength(r)+Hs(r.questions||[],kr)+Hs(r.answers||[],ct)+Hs(r.authorities||[],ct)+Hs(r.additionals||[],ct)};G.streamEncode=function(r){let e=G.encode(r),t=W.alloc(2);t.writeUInt16BE(e.byteLength);let n=W.concat([t,e]);return G.streamEncode.bytes=n.byteLength,n};G.streamEncode.bytes=0;G.streamDecode=function(r){let e=r.readUInt16BE(0);if(r.byteLength<e+2)return null;let t=G.decode(r.slice(2));return G.streamDecode.bytes=G.decode.bytes,t};G.streamDecode.bytes=0;function Hs(r,e){let t=0;for(let n=0;n<r.length;n++)t+=e.encodingLength(r[n]);return t}function Ic(r,e,t,n){for(let i=0;i<r.length;i++)e.encode(r[i],t,n),n+=e.encode.bytes;return n}function _p(r,e,t,n){for(let i=0;i<r.length;i++)r[i]=e.decode(t,n),n+=e.decode.bytes;return n}});var O3=re((Dc,Up)=>{(function(r,e){"use strict";var t={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function n(d){if(!Array.isArray(d)&&!ArrayBuffer.isView(d))return!1;for(var f=0;f<d.length;f++)if(!Number.isInteger(d[f])||d[f]<0||d[f]>255)return!1;return!0}function i(d,f){return(d&65535)*f+(((d>>>16)*f&65535)<<16)}function o(d,f){return d<<f|d>>>32-f}function s(d){return d^=d>>>16,d=i(d,2246822507),d^=d>>>13,d=i(d,3266489909),d^=d>>>16,d}function a(d,f){d=[d[0]>>>16,d[0]&65535,d[1]>>>16,d[1]&65535],f=[f[0]>>>16,f[0]&65535,f[1]>>>16,f[1]&65535];var h=[0,0,0,0];return h[3]+=d[3]+f[3],h[2]+=h[3]>>>16,h[3]&=65535,h[2]+=d[2]+f[2],h[1]+=h[2]>>>16,h[2]&=65535,h[1]+=d[1]+f[1],h[0]+=h[1]>>>16,h[1]&=65535,h[0]+=d[0]+f[0],h[0]&=65535,[h[0]<<16|h[1],h[2]<<16|h[3]]}function c(d,f){d=[d[0]>>>16,d[0]&65535,d[1]>>>16,d[1]&65535],f=[f[0]>>>16,f[0]&65535,f[1]>>>16,f[1]&65535];var h=[0,0,0,0];return h[3]+=d[3]*f[3],h[2]+=h[3]>>>16,h[3]&=65535,h[2]+=d[2]*f[3],h[1]+=h[2]>>>16,h[2]&=65535,h[2]+=d[3]*f[2],h[1]+=h[2]>>>16,h[2]&=65535,h[1]+=d[1]*f[3],h[0]+=h[1]>>>16,h[1]&=65535,h[1]+=d[2]*f[2],h[0]+=h[1]>>>16,h[1]&=65535,h[1]+=d[3]*f[1],h[0]+=h[1]>>>16,h[1]&=65535,h[0]+=d[0]*f[3]+d[1]*f[2]+d[2]*f[1]+d[3]*f[0],h[0]&=65535,[h[0]<<16|h[1],h[2]<<16|h[3]]}function u(d,f){return f%=64,f===32?[d[1],d[0]]:f<32?[d[0]<<f|d[1]>>>32-f,d[1]<<f|d[0]>>>32-f]:(f-=32,[d[1]<<f|d[0]>>>32-f,d[0]<<f|d[1]>>>32-f])}function l(d,f){return f%=64,f===0?d:f<32?[d[0]<<f|d[1]>>>32-f,d[1]<<f]:[d[1]<<f-32,0]}function p(d,f){return[d[0]^f[0],d[1]^f[1]]}function m(d){return d=p(d,[0,d[0]>>>1]),d=c(d,[4283543511,3981806797]),d=p(d,[0,d[0]>>>1]),d=c(d,[3301882366,444984403]),d=p(d,[0,d[0]>>>1]),d}t.x86.hash32=function(d,f){if(t.inputValidation&&!n(d))return e;f=f||0;for(var h=d.length%4,x=d.length-h,g=f,y=0,w=3432918353,E=461845907,B=0;B<x;B=B+4)y=d[B]|d[B+1]<<8|d[B+2]<<16|d[B+3]<<24,y=i(y,w),y=o(y,15),y=i(y,E),g^=y,g=o(g,13),g=i(g,5)+3864292196;switch(y=0,h){case 3:y^=d[B+2]<<16;case 2:y^=d[B+1]<<8;case 1:y^=d[B],y=i(y,w),y=o(y,15),y=i(y,E),g^=y}return g^=d.length,g=s(g),g>>>0},t.x86.hash128=function(d,f){if(t.inputValidation&&!n(d))return e;f=f||0;for(var h=d.length%16,x=d.length-h,g=f,y=f,w=f,E=f,B=0,S=0,b=0,v=0,k=597399067,U=2869860233,R=951274213,M=2716044179,L=0;L<x;L=L+16)B=d[L]|d[L+1]<<8|d[L+2]<<16|d[L+3]<<24,S=d[L+4]|d[L+5]<<8|d[L+6]<<16|d[L+7]<<24,b=d[L+8]|d[L+9]<<8|d[L+10]<<16|d[L+11]<<24,v=d[L+12]|d[L+13]<<8|d[L+14]<<16|d[L+15]<<24,B=i(B,k),B=o(B,15),B=i(B,U),g^=B,g=o(g,19),g+=y,g=i(g,5)+1444728091,S=i(S,U),S=o(S,16),S=i(S,R),y^=S,y=o(y,17),y+=w,y=i(y,5)+197830471,b=i(b,R),b=o(b,17),b=i(b,M),w^=b,w=o(w,15),w+=E,w=i(w,5)+2530024501,v=i(v,M),v=o(v,18),v=i(v,k),E^=v,E=o(E,13),E+=g,E=i(E,5)+850148119;switch(B=0,S=0,b=0,v=0,h){case 15:v^=d[L+14]<<16;case 14:v^=d[L+13]<<8;case 13:v^=d[L+12],v=i(v,M),v=o(v,18),v=i(v,k),E^=v;case 12:b^=d[L+11]<<24;case 11:b^=d[L+10]<<16;case 10:b^=d[L+9]<<8;case 9:b^=d[L+8],b=i(b,R),b=o(b,17),b=i(b,M),w^=b;case 8:S^=d[L+7]<<24;case 7:S^=d[L+6]<<16;case 6:S^=d[L+5]<<8;case 5:S^=d[L+4],S=i(S,U),S=o(S,16),S=i(S,R),y^=S;case 4:B^=d[L+3]<<24;case 3:B^=d[L+2]<<16;case 2:B^=d[L+1]<<8;case 1:B^=d[L],B=i(B,k),B=o(B,15),B=i(B,U),g^=B}return g^=d.length,y^=d.length,w^=d.length,E^=d.length,g+=y,g+=w,g+=E,y+=g,w+=g,E+=g,g=s(g),y=s(y),w=s(w),E=s(E),g+=y,g+=w,g+=E,y+=g,w+=g,E+=g,("00000000"+(g>>>0).toString(16)).slice(-8)+("00000000"+(y>>>0).toString(16)).slice(-8)+("00000000"+(w>>>0).toString(16)).slice(-8)+("00000000"+(E>>>0).toString(16)).slice(-8)},t.x64.hash128=function(d,f){if(t.inputValidation&&!n(d))return e;f=f||0;for(var h=d.length%16,x=d.length-h,g=[0,f],y=[0,f],w=[0,0],E=[0,0],B=[2277735313,289559509],S=[1291169091,658871167],b=0;b<x;b=b+16)w=[d[b+4]|d[b+5]<<8|d[b+6]<<16|d[b+7]<<24,d[b]|d[b+1]<<8|d[b+2]<<16|d[b+3]<<24],E=[d[b+12]|d[b+13]<<8|d[b+14]<<16|d[b+15]<<24,d[b+8]|d[b+9]<<8|d[b+10]<<16|d[b+11]<<24],w=c(w,B),w=u(w,31),w=c(w,S),g=p(g,w),g=u(g,27),g=a(g,y),g=a(c(g,[0,5]),[0,1390208809]),E=c(E,S),E=u(E,33),E=c(E,B),y=p(y,E),y=u(y,31),y=a(y,g),y=a(c(y,[0,5]),[0,944331445]);switch(w=[0,0],E=[0,0],h){case 15:E=p(E,l([0,d[b+14]],48));case 14:E=p(E,l([0,d[b+13]],40));case 13:E=p(E,l([0,d[b+12]],32));case 12:E=p(E,l([0,d[b+11]],24));case 11:E=p(E,l([0,d[b+10]],16));case 10:E=p(E,l([0,d[b+9]],8));case 9:E=p(E,[0,d[b+8]]),E=c(E,S),E=u(E,33),E=c(E,B),y=p(y,E);case 8:w=p(w,l([0,d[b+7]],56));case 7:w=p(w,l([0,d[b+6]],48));case 6:w=p(w,l([0,d[b+5]],40));case 5:w=p(w,l([0,d[b+4]],32));case 4:w=p(w,l([0,d[b+3]],24));case 3:w=p(w,l([0,d[b+2]],16));case 2:w=p(w,l([0,d[b+1]],8));case 1:w=p(w,[0,d[b]]),w=c(w,B),w=u(w,31),w=c(w,S),g=p(g,w)}return g=p(g,[0,d.length]),y=p(y,[0,d.length]),g=a(g,y),y=a(y,g),g=m(g),y=m(y),g=a(g,y),y=a(y,g),("00000000"+(g[0]>>>0).toString(16)).slice(-8)+("00000000"+(g[1]>>>0).toString(16)).slice(-8)+("00000000"+(y[0]>>>0).toString(16)).slice(-8)+("00000000"+(y[1]>>>0).toString(16)).slice(-8)},typeof Dc<"u"?(typeof Up<"u"&&Up.exports&&(Dc=Up.exports=t),Dc.murmurHash3=t):typeof define=="function"&&define.amd?define([],function(){return t}):(t._murmurHash3=r.murmurHash3,t.noConflict=function(){return r.murmurHash3=t._murmurHash3,t._murmurHash3=e,t.noConflict=e,t},r.murmurHash3=t)})(Dc)});var z3=re((bQ,F3)=>{F3.exports=O3()});var Dp=re((IQ,M3)=>{"use strict";M3.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(e,t){let n=this._internalPositionFor(e,!1);if(t===void 0)n!==-1&&(this._unsetInternalPos(n),this._unsetBit(e),this._changedLength=!0,this._changedData=!0);else{let i=!1;n===-1?(n=this._data.length,this._setBit(e),this._changedData=!0):i=!0,this._setInternalPos(n,e,t,i),this._changedLength=!0}}unset(e){this.set(e,void 0)}get(e){this._sortData();let t=this._internalPositionFor(e,!0);if(t!==-1)return this._data[t][1]}push(e){return this.set(this.length,e),this.length}get length(){if(this._sortData(),this._changedLength){let e=this._data[this._data.length-1];this._length=e?e[0]+1:0,this._changedLength=!1}return this._length}forEach(e){let t=0;for(;t<this.length;)e(this.get(t),t,this),t++}map(e){let t=0,n=new Array(this.length);for(;t<this.length;)n[t]=e(this.get(t),t,this),t++;return n}reduce(e,t){let n=0,i=t;for(;n<this.length;){let o=this.get(n);i=e(i,o,n),n++}return i}find(e){let t=0,n,i;for(;t<this.length&&!n;)i=this.get(t),n=e(i),t++;return n?i:void 0}_internalPositionFor(e,t){let n=this._bytePosFor(e,t);if(n>=this._bitArrays.length)return-1;let i=this._bitArrays[n],o=e-n*7;if(!((i&1<<o)>0))return-1;let a=this._bitArrays.slice(0,n).reduce(hN,0),c=~(4294967295<<o+1),u=V3(i&c);return a+u-1}_bytePosFor(e,t){let n=Math.floor(e/7),i=n+1;for(;!t&&this._bitArrays.length<i;)this._bitArrays.push(0);return n}_setBit(e){let t=this._bytePosFor(e,!1);this._bitArrays[t]|=1<<e-t*7}_unsetBit(e){let t=this._bytePosFor(e,!1);this._bitArrays[t]&=~(1<<e-t*7)}_setInternalPos(e,t,n,i){let o=this._data,s=[t,n];if(i)this._sortData(),o[e]=s;else{if(o.length)if(o[o.length-1][0]>=t)o.push(s);else if(o[0][0]<=t)o.unshift(s);else{let a=Math.round(o.length/2);this._data=o.slice(0,a).concat(s).concat(o.slice(a))}else this._data.push(s);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(e){this._data.splice(e,1)}_sortData(){this._changedData&&this._data.sort(mN),this._changedData=!1}bitField(){let e=[],t=8,n=0,i=0,o,s=this._bitArrays.slice();for(;s.length||n;){n===0&&(o=s.shift(),n=7);let c=Math.min(n,t),u=~(255<<c),l=o&u;i|=l<<8-t,o=o>>>c,n-=c,t-=c,(!t||!n&&!s.length)&&(e.push(i),i=0,t=8)}for(var a=e.length-1;a>0&&e[a]===0;a--)e.pop();return e}compactArray(){return this._sortData(),this._data.map(gN)}};function hN(r,e){return r+V3(e)}function V3(r){let e=r;return e=e-(e>>1&1431655765),e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}function mN(r,e){return r[0]-e[0]}function gN(r){return r[1]}});var k6=re((tte,B6)=>{var Wg=class{constructor(e,t=12,n=8*1024,i=32*1024,o=64,s){this.bits=t,this.min=n,this.max=i,this.asModule=e,this.rabin=new e.Rabin(t,n,i,o,s),this.polynomial=s}fingerprint(e){let{__retain:t,__release:n,__allocArray:i,__getInt32Array:o,Int32Array_ID:s,Uint8Array_ID:a}=this.asModule,c=new Int32Array(Math.ceil(e.length/this.min)),u=t(i(s,c)),l=t(i(a,e)),p=this.rabin.fingerprint(l,u),m=o(p);n(l),n(u);let d=m.indexOf(0);return d>=0?m.subarray(0,d):m}};B6.exports=Wg});var U6=re(Mc=>{"use strict";var OD=typeof BigUint64Array<"u",zc=Symbol(),Vc=1024;function I6(r,e){let t=new Uint32Array(r),n=new Uint16Array(r);var i=t[e+-4>>>2]>>>1,o=e>>>1;if(i<=Vc)return String.fromCharCode.apply(String,n.subarray(o,o+i));let s=[];do{let a=n[o+Vc-1],c=a>=55296&&a<56320?Vc-1:Vc;s.push(String.fromCharCode.apply(String,n.subarray(o,o+=c))),i-=c}while(i>Vc);return s.join("")+String.fromCharCode.apply(String,n.subarray(o,o+i))}function Yg(r){let e={};function t(i,o){return i?I6(i.buffer,o):"<yet unknown>"}let n=r.env=r.env||{};return n.abort=n.abort||function(o,s,a,c){let u=e.memory||n.memory;throw Error("abort: "+t(u,o)+" at "+t(u,s)+":"+a+":"+c)},n.trace=n.trace||function(o,s){let a=e.memory||n.memory;console.log("trace: "+t(a,o)+(s?" ":"")+Array.prototype.slice.call(arguments,2,2+s).join(", "))},r.Math=r.Math||Math,r.Date=r.Date||Date,e}function Xg(r,e){let t=e.exports,n=t.memory,i=t.table,o=t.__alloc,s=t.__retain,a=t.__rtti_base||-1;function c(S){let b=new Uint32Array(n.buffer),v=b[a>>>2];if((S>>>=0)>=v)throw Error("invalid id: "+S);return b[(a+4>>>2)+S*2]}function u(S){let b=new Uint32Array(n.buffer),v=b[a>>>2];if((S>>>=0)>=v)throw Error("invalid id: "+S);return b[(a+4>>>2)+S*2+1]}function l(S){return 31-Math.clz32(S>>>5&31)}function p(S){return 31-Math.clz32(S>>>14&31)}function m(S){let b=S.length,v=o(b<<1,1),k=new Uint16Array(n.buffer);for(var U=0,R=v>>>1;U<b;++U)k[R+U]=S.charCodeAt(U);return v}r.__allocString=m;function d(S){let b=n.buffer;if(new Uint32Array(b)[S+-8>>>2]!==1)throw Error("not a string: "+S);return I6(b,S)}r.__getString=d;function f(S,b,v){let k=n.buffer;if(v)switch(S){case 2:return new Float32Array(k);case 3:return new Float64Array(k)}else switch(S){case 0:return new(b?Int8Array:Uint8Array)(k);case 1:return new(b?Int16Array:Uint16Array)(k);case 2:return new(b?Int32Array:Uint32Array)(k);case 3:return new(b?BigInt64Array:BigUint64Array)(k)}throw Error("unsupported align: "+S)}function h(S,b){let v=c(S);if(!(v&3))throw Error("not an array: "+S+" @ "+v);let k=l(v),U=b.length,R=o(U<<k,0),M=o(v&2?16:12,S),L=new Uint32Array(n.buffer);L[M+0>>>2]=s(R),L[M+4>>>2]=R,L[M+8>>>2]=U<<k,v&2&&(L[M+12>>>2]=U);let ce=f(k,v&1024,v&2048);if(v&8192)for(let _=0;_<U;++_)ce[(R>>>k)+_]=s(b[_]);else ce.set(b,R>>>k);return M}r.__allocArray=h;function x(S){let b=new Uint32Array(n.buffer),v=b[S+-8>>>2],k=c(v);if(!(k&1))throw Error("not an array: "+v);let U=l(k);var R=b[S+4>>>2];let M=k&2?b[S+12>>>2]:b[R+-4>>>2]>>>U;return f(U,k&1024,k&2048).subarray(R>>>=U,R+M)}r.__getArrayView=x;function g(S){let b=x(S),v=b.length,k=new Array(v);for(let U=0;U<v;U++)k[U]=b[U];return k}r.__getArray=g;function y(S){let b=n.buffer,v=new Uint32Array(b)[S+-4>>>2];return b.slice(S,S+v)}r.__getArrayBuffer=y;function w(S,b,v){return new S(E(S,b,v))}function E(S,b,v){let k=n.buffer,U=new Uint32Array(k),R=U[v+4>>>2];return new S(k,R,U[R+-4>>>2]>>>b)}r.__getInt8Array=w.bind(null,Int8Array,0),r.__getInt8ArrayView=E.bind(null,Int8Array,0),r.__getUint8Array=w.bind(null,Uint8Array,0),r.__getUint8ArrayView=E.bind(null,Uint8Array,0),r.__getUint8ClampedArray=w.bind(null,Uint8ClampedArray,0),r.__getUint8ClampedArrayView=E.bind(null,Uint8ClampedArray,0),r.__getInt16Array=w.bind(null,Int16Array,1),r.__getInt16ArrayView=E.bind(null,Int16Array,1),r.__getUint16Array=w.bind(null,Uint16Array,1),r.__getUint16ArrayView=E.bind(null,Uint16Array,1),r.__getInt32Array=w.bind(null,Int32Array,2),r.__getInt32ArrayView=E.bind(null,Int32Array,2),r.__getUint32Array=w.bind(null,Uint32Array,2),r.__getUint32ArrayView=E.bind(null,Uint32Array,2),OD&&(r.__getInt64Array=w.bind(null,BigInt64Array,3),r.__getInt64ArrayView=E.bind(null,BigInt64Array,3),r.__getUint64Array=w.bind(null,BigUint64Array,3),r.__getUint64ArrayView=E.bind(null,BigUint64Array,3)),r.__getFloat32Array=w.bind(null,Float32Array,2),r.__getFloat32ArrayView=E.bind(null,Float32Array,2),r.__getFloat64Array=w.bind(null,Float64Array,3),r.__getFloat64ArrayView=E.bind(null,Float64Array,3);function B(S,b){let v=new Uint32Array(n.buffer);var k=v[S+-8>>>2];if(k<=v[a>>>2])do if(k==b)return!0;while(k=u(k));return!1}return r.__instanceof=B,r.memory=r.memory||n,r.table=r.table||i,R6(t,r)}function _6(r){return typeof Response<"u"&&r instanceof Response}async function T6(r,e){return _6(r=await r)?C6(r,e):Xg(Yg(e||(e={})),await WebAssembly.instantiate(r instanceof WebAssembly.Module?r:await WebAssembly.compile(r),e))}Mc.instantiate=T6;function FD(r,e){return Xg(Yg(e||(e={})),new WebAssembly.Instance(r instanceof WebAssembly.Module?r:new WebAssembly.Module(r),e))}Mc.instantiateSync=FD;async function C6(r,e){return WebAssembly.instantiateStreaming?Xg(Yg(e||(e={})),(await WebAssembly.instantiateStreaming(r,e)).instance):T6(_6(r=await r)?r.arrayBuffer():r,e)}Mc.instantiateStreaming=C6;function R6(r,e){var t=e?Object.create(e):{},n=r.__argumentsLength?function(i){r.__argumentsLength.value=i}:r.__setArgumentsLength||r.__setargc||function(){};for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let o=r[i],s=i.split("."),a=t;for(;s.length>1;){let l=s.shift();Object.prototype.hasOwnProperty.call(a,l)||(a[l]={}),a=a[l]}let c=s[0],u=c.indexOf("#");if(u>=0){let l=c.substring(0,u),p=a[l];if(typeof p>"u"||!p.prototype){let m=function(...d){return m.wrap(m.prototype.constructor(0,...d))};m.prototype={valueOf:function(){return this[zc]}},m.wrap=function(d){return Object.create(m.prototype,{[zc]:{value:d,writable:!1}})},p&&Object.getOwnPropertyNames(p).forEach(d=>Object.defineProperty(m,d,Object.getOwnPropertyDescriptor(p,d))),a[l]=m}if(c=c.substring(u+1),a=a[l].prototype,/^(get|set):/.test(c)){if(!Object.prototype.hasOwnProperty.call(a,c=c.substring(4))){let m=r[i.replace("set:","get:")],d=r[i.replace("get:","set:")];Object.defineProperty(a,c,{get:function(){return m(this[zc])},set:function(f){d(this[zc],f)},enumerable:!0})}}else c==="constructor"?(a[c]=(...m)=>(n(m.length),o(...m))).original=o:(a[c]=function(...m){return n(m.length),o(this[zc],...m)}).original=o}else/^(get|set):/.test(c)?Object.prototype.hasOwnProperty.call(a,c=c.substring(4))||Object.defineProperty(a,c,{get:r[i.replace("set:","get:")],set:r[i.replace("get:","set:")],enumerable:!0}):typeof o=="function"&&o!==n?(a[c]=(...l)=>(n(l.length),o(...l))).original=o:a[c]=o}return t}Mc.demangle=R6});var D6=re((nte,N6)=>{var{instantiate:zD}=U6();Jg.supported=typeof WebAssembly<"u";function Jg(r={}){if(!Jg.supported)return null;var e=new Uint8Array([0,97,115,109,1,0,0,0,1,78,14,96,2,127,126,0,96,1,127,1,126,96,2,127,127,0,96,1,127,1,127,96,1,127,0,96,2,127,127,1,127,96,3,127,127,127,1,127,96,0,0,96,3,127,127,127,0,96,0,1,127,96,4,127,127,127,127,0,96,5,127,127,127,127,127,1,127,96,1,126,1,127,96,2,126,126,1,126,2,13,1,3,101,110,118,5,97,98,111,114,116,0,10,3,54,53,2,2,8,9,3,5,2,8,6,5,3,4,2,6,9,12,13,2,5,11,3,2,3,2,3,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,6,7,7,4,4,5,3,1,0,1,6,47,9,127,1,65,0,11,127,1,65,0,11,127,0,65,3,11,127,0,65,4,11,127,1,65,0,11,127,1,65,0,11,127,1,65,0,11,127,0,65,240,2,11,127,0,65,6,11,7,240,5,41,6,109,101,109,111,114,121,2,0,7,95,95,97,108,108,111,99,0,10,8,95,95,114,101,116,97,105,110,0,11,9,95,95,114,101,108,101,97,115,101,0,12,9,95,95,99,111,108,108,101,99,116,0,51,11,95,95,114,116,116,105,95,98,97,115,101,3,7,13,73,110,116,51,50,65,114,114,97,121,95,73,68,3,2,13,85,105,110,116,56,65,114,114,97,121,95,73,68,3,3,6,100,101,103,114,101,101,0,16,3,109,111,100,0,17,5,82,97,98,105,110,3,8,16,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,0,21,16,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,0,22,21,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,23,21,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,24,14,82,97,98,105,110,35,103,101,116,58,119,112,111,115,0,25,14,82,97,98,105,110,35,115,101,116,58,119,112,111,115,0,26,15,82,97,98,105,110,35,103,101,116,58,99,111,117,110,116,0,27,15,82,97,98,105,110,35,115,101,116,58,99,111,117,110,116,0,28,13,82,97,98,105,110,35,103,101,116,58,112,111,115,0,29,13,82,97,98,105,110,35,115,101,116,58,112,111,115,0,30,15,82,97,98,105,110,35,103,101,116,58,115,116,97,114,116,0,31,15,82,97,98,105,110,35,115,101,116,58,115,116,97,114,116,0,32,16,82,97,98,105,110,35,103,101,116,58,100,105,103,101,115,116,0,33,16,82,97,98,105,110,35,115,101,116,58,100,105,103,101,115,116,0,34,21,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,35,21,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,36,22,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,37,22,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,38,31,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,39,31,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,40,20,82,97,98,105,110,35,103,101,116,58,112,111,108,121,110,111,109,105,97,108,0,41,20,82,97,98,105,110,35,115,101,116,58,112,111,108,121,110,111,109,105,97,108,0,42,17,82,97,98,105,110,35,103,101,116,58,109,105,110,115,105,122,101,0,43,17,82,97,98,105,110,35,115,101,116,58,109,105,110,115,105,122,101,0,44,17,82,97,98,105,110,35,103,101,116,58,109,97,120,115,105,122,101,0,45,17,82,97,98,105,110,35,115,101,116,58,109,97,120,115,105,122,101,0,46,14,82,97,98,105,110,35,103,101,116,58,109,97,115,107,0,47,14,82,97,98,105,110,35,115,101,116,58,109,97,115,107,0,48,17,82,97,98,105,110,35,99,111,110,115,116,114,117,99,116,111,114,0,20,17,82,97,98,105,110,35,102,105,110,103,101,114,112,114,105,110,116,0,49,8,1,50,10,165,31,53,199,1,1,4,127,32,1,40,2,0,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,3,65,4,107,118,65,16,115,33,4,32,3,65,7,107,11,33,3,32,1,40,2,20,33,2,32,1,40,2,16,34,5,4,64,32,5,32,2,54,2,20,11,32,2,4,64,32,2,32,5,54,2,16,11,32,1,32,0,32,4,32,3,65,4,116,106,65,2,116,106,40,2,96,70,4,64,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,2,54,2,96,32,2,69,4,64,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,65,127,115,113,34,1,54,2,4,32,1,69,4,64,32,0,32,0,40,2,0,65,1,32,3,116,65,127,115,113,54,2,0,11,11,11,11,226,2,1,6,127,32,1,40,2,0,33,3,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,34,5,65,1,113,4,64,32,3,65,124,113,65,16,106,32,5,65,124,113,106,34,2,65,240,255,255,255,3,73,4,64,32,0,32,4,16,1,32,1,32,2,32,3,65,3,113,114,34,3,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,33,5,11,11,32,3,65,2,113,4,64,32,1,65,4,107,40,2,0,34,2,40,2,0,34,6,65,124,113,65,16,106,32,3,65,124,113,106,34,7,65,240,255,255,255,3,73,4,64,32,0,32,2,16,1,32,2,32,7,32,6,65,3,113,114,34,3,54,2,0,32,2,33,1,11,11,32,4,32,5,65,2,114,54,2,0,32,4,65,4,107,32,1,54,2,0,32,0,32,3,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,2,65,4,107,118,65,16,115,33,4,32,2,65,7,107,11,34,3,65,4,116,32,4,106,65,2,116,106,40,2,96,33,2,32,1,65,0,54,2,16,32,1,32,2,54,2,20,32,2,4,64,32,2,32,1,54,2,16,11,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,1,54,2,96,32,0,32,0,40,2,0,65,1,32,3,116,114,54,2,0,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,114,54,2,4,11,119,1,1,127,32,2,2,127,32,0,40,2,160,12,34,2,4,64,32,2,32,1,65,16,107,70,4,64,32,2,40,2,0,33,3,32,1,65,16,107,33,1,11,11,32,1,11,107,34,2,65,48,73,4,64,15,11,32,1,32,3,65,2,113,32,2,65,32,107,65,1,114,114,54,2,0,32,1,65,0,54,2,16,32,1,65,0,54,2,20,32,1,32,2,106,65,16,107,34,2,65,2,54,2,0,32,0,32,2,54,2,160,12,32,0,32,1,16,2,11,155,1,1,3,127,35,0,34,0,69,4,64,65,1,63,0,34,0,74,4,127,65,1,32,0,107,64,0,65,0,72,5,65,0,11,4,64,0,11,65,176,3,34,0,65,0,54,2,0,65,208,15,65,0,54,2,0,3,64,32,1,65,23,73,4,64,32,1,65,2,116,65,176,3,106,65,0,54,2,4,65,0,33,2,3,64,32,2,65,16,73,4,64,32,1,65,4,116,32,2,106,65,2,116,65,176,3,106,65,0,54,2,96,32,2,65,1,106,33,2,12,1,11,11,32,1,65,1,106,33,1,12,1,11,11,65,176,3,65,224,15,63,0,65,16,116,16,3,65,176,3,36,0,11,32,0,11,45,0,32,0,65,240,255,255,255,3,79,4,64,65,32,65,224,0,65,201,3,65,29,16,0,0,11,32,0,65,15,106,65,112,113,34,0,65,16,32,0,65,16,75,27,11,169,1,1,1,127,32,0,32,1,65,128,2,73,4,127,32,1,65,4,118,33,1,65,0,5,32,1,65,248,255,255,255,1,73,4,64,32,1,65,1,65,27,32,1,103,107,116,106,65,1,107,33,1,11,32,1,65,31,32,1,103,107,34,2,65,4,107,118,65,16,115,33,1,32,2,65,7,107,11,34,2,65,2,116,106,40,2,4,65,127,32,1,116,113,34,1,4,127,32,0,32,1,104,32,2,65,4,116,106,65,2,116,106,40,2,96,5,32,0,40,2,0,65,127,32,2,65,1,106,116,113,34,1,4,127,32,0,32,0,32,1,104,34,0,65,2,116,106,40,2,4,104,32,0,65,4,116,106,65,2,116,106,40,2,96,5,65,0,11,11,11,111,1,1,127,63,0,34,2,32,1,65,248,255,255,255,1,73,4,127,32,1,65,1,65,27,32,1,103,107,116,65,1,107,106,5,32,1,11,65,16,32,0,40,2,160,12,32,2,65,16,116,65,16,107,71,116,106,65,255,255,3,106,65,128,128,124,113,65,16,118,34,1,32,2,32,1,74,27,64,0,65,0,72,4,64,32,1,64,0,65,0,72,4,64,0,11,11,32,0,32,2,65,16,116,63,0,65,16,116,16,3,11,113,1,2,127,32,1,40,2,0,34,3,65,124,113,32,2,107,34,4,65,32,79,4,64,32,1,32,2,32,3,65,2,113,114,54,2,0,32,2,32,1,65,16,106,106,34,1,32,4,65,16,107,65,1,114,54,2,0,32,0,32,1,16,2,5,32,1,32,3,65,126,113,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,32,1,65,16,106,32,1,40,2,0,65,124,113,106,40,2,0,65,125,113,54,2,0,11,11,91,1,2,127,32,0,32,1,16,5,34,4,16,6,34,3,69,4,64,65,1,36,1,65,0,36,1,32,0,32,4,16,6,34,3,69,4,64,32,0,32,4,16,7,32,0,32,4,16,6,33,3,11,11,32,3,65,0,54,2,4,32,3,32,2,54,2,8,32,3,32,1,54,2,12,32,0,32,3,16,1,32,0,32,3,32,4,16,8,32,3,11,13,0,16,4,32,0,32,1,16,9,65,16,106,11,33,1,1,127,32,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,18,0,32,0,65,172,3,75,4,64,32,0,65,16,107,16,52,11,11,140,3,1,1,127,2,64,32,1,69,13,0,32,0,65,0,58,0,0,32,0,32,1,106,65,1,107,65,0,58,0,0,32,1,65,2,77,13,0,32,0,65,1,106,65,0,58,0,0,32,0,65,2,106,65,0,58,0,0,32,0,32,1,106,34,2,65,2,107,65,0,58,0,0,32,2,65,3,107,65,0,58,0,0,32,1,65,6,77,13,0,32,0,65,3,106,65,0,58,0,0,32,0,32,1,106,65,4,107,65,0,58,0,0,32,1,65,8,77,13,0,32,1,65,0,32,0,107,65,3,113,34,1,107,33,2,32,0,32,1,106,34,0,65,0,54,2,0,32,0,32,2,65,124,113,34,1,106,65,4,107,65,0,54,2,0,32,1,65,8,77,13,0,32,0,65,4,106,65,0,54,2,0,32,0,65,8,106,65,0,54,2,0,32,0,32,1,106,34,2,65,12,107,65,0,54,2,0,32,2,65,8,107,65,0,54,2,0,32,1,65,24,77,13,0,32,0,65,12,106,65,0,54,2,0,32,0,65,16,106,65,0,54,2,0,32,0,65,20,106,65,0,54,2,0,32,0,65,24,106,65,0,54,2,0,32,0,32,1,106,34,2,65,28,107,65,0,54,2,0,32,2,65,24,107,65,0,54,2,0,32,2,65,20,107,65,0,54,2,0,32,2,65,16,107,65,0,54,2,0,32,0,32,0,65,4,113,65,24,106,34,2,106,33,0,32,1,32,2,107,33,1,3,64,32,1,65,32,79,4,64,32,0,66,0,55,3,0,32,0,65,8,106,66,0,55,3,0,32,0,65,16,106,66,0,55,3,0,32,0,65,24,106,66,0,55,3,0,32,1,65,32,107,33,1,32,0,65,32,106,33,0,12,1,11,11,11,11,178,1,1,3,127,32,1,65,240,255,255,255,3,32,2,118,75,4,64,65,144,1,65,192,1,65,23,65,56,16,0,0,11,32,1,32,2,116,34,3,65,0,16,10,34,2,32,3,16,13,32,0,69,4,64,65,12,65,2,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,2,34,1,32,0,40,2,0,34,4,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,32,4,16,12,11,32,0,32,1,54,2,0,32,0,32,2,54,2,4,32,0,32,3,54,2,8,32,0,11,46,1,2,127,65,12,65,5,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,65,128,2,65,3,16,14,11,9,0,65,63,32,0,121,167,107,11,49,1,2,127,65,63,32,1,121,167,107,33,2,3,64,65,63,32,0,121,167,107,32,2,107,34,3,65,0,78,4,64,32,0,32,1,32,3,172,134,133,33,0,12,1,11,11,32,0,11,40,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,163,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,65,0,58,0,0,11,38,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,152,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,45,0,0,11,254,5,2,1,127,4,126,32,0,69,4,64,65,232,0,65,6,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,24,32,0,66,0,55,3,32,32,0,66,0,55,3,40,32,0,66,0,55,3,48,32,0,66,0,55,3,56,32,0,66,0,55,3,64,32,0,66,0,55,3,72,32,0,66,0,55,3,80,32,0,66,0,55,3,88,32,0,66,0,55,3,96,32,0,32,2,173,55,3,80,32,0,32,3,173,55,3,88,65,12,65,4,16,10,34,2,65,172,3,75,4,64,32,2,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,32,4,65,0,16,14,33,2,32,0,40,2,0,16,12,32,0,32,2,54,2,0,32,0,32,4,54,2,4,32,0,66,1,32,1,173,134,66,1,125,55,3,96,32,0,66,243,130,183,218,216,230,232,30,55,3,72,35,4,69,4,64,65,0,33,2,3,64,32,2,65,128,2,72,4,64,32,2,65,255,1,113,173,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,65,0,33,4,3,64,32,4,32,0,40,2,4,65,1,107,72,4,64,32,6,66,8,134,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,32,4,65,1,106,33,4,12,1,11,11,35,6,40,2,4,32,2,65,3,116,106,32,6,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,63,32,0,41,3,72,121,167,107,172,33,7,65,0,33,2,3,64,32,2,65,128,2,72,4,64,35,5,33,1,32,2,172,32,7,134,34,8,33,6,65,63,32,0,41,3,72,34,9,121,167,107,33,3,3,64,65,63,32,6,121,167,107,32,3,107,34,4,65,0,78,4,64,32,6,32,9,32,4,172,134,133,33,6,12,1,11,11,32,1,40,2,4,32,2,65,3,116,106,32,6,32,8,132,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,1,36,4,11,32,0,66,0,55,3,24,32,0,66,0,55,3,32,65,0,33,2,3,64,32,2,32,0,40,2,4,72,4,64,32,0,40,2,0,32,2,16,18,32,2,65,1,106,33,2,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,6,66,45,136,167,65,3,116,106,41,3,0,32,6,66,8,134,66,1,132,133,55,3,40,32,0,11,38,1,1,127,32,0,40,2,0,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,55,1,2,127,32,1,32,0,40,2,0,34,2,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,16,12,11,32,0,32,1,54,2,0,11,7,0,32,0,40,2,4,11,9,0,32,0,32,1,54,2,4,11,7,0,32,0,40,2,8,11,9,0,32,0,32,1,54,2,8,11,7,0,32,0,41,3,16,11,9,0,32,0,32,1,55,3,16,11,7,0,32,0,41,3,24,11,9,0,32,0,32,1,55,3,24,11,7,0,32,0,41,3,32,11,9,0,32,0,32,1,55,3,32,11,7,0,32,0,41,3,40,11,9,0,32,0,32,1,55,3,40,11,7,0,32,0,41,3,48,11,9,0,32,0,32,1,55,3,48,11,7,0,32,0,41,3,56,11,9,0,32,0,32,1,55,3,56,11,7,0,32,0,41,3,64,11,9,0,32,0,32,1,55,3,64,11,7,0,32,0,41,3,72,11,9,0,32,0,32,1,55,3,72,11,7,0,32,0,41,3,80,11,9,0,32,0,32,1,55,3,80,11,7,0,32,0,41,3,88,11,9,0,32,0,32,1,55,3,88,11,7,0,32,0,41,3,96,11,9,0,32,0,32,1,55,3,96,11,172,4,2,5,127,1,126,32,2,65,172,3,75,4,64,32,2,65,16,107,34,4,32,4,40,2,4,65,1,106,54,2,4,11,32,2,33,4,65,0,33,2,32,1,40,2,8,33,5,32,1,40,2,4,33,6,3,64,2,127,65,0,33,3,3,64,32,3,32,5,72,4,64,32,3,32,6,106,45,0,0,33,1,32,0,40,2,0,32,0,40,2,8,16,19,33,7,32,0,40,2,8,32,0,40,2,0,40,2,4,106,32,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,7,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,1,173,32,8,66,8,134,132,133,55,3,40,32,0,32,0,41,3,16,66,1,124,55,3,16,32,0,32,0,41,3,24,66,1,124,55,3,24,32,0,41,3,16,32,0,41,3,80,90,4,127,32,0,41,3,40,32,0,41,3,96,131,80,5,65,0,11,4,127,65,1,5,32,0,41,3,16,32,0,41,3,88,90,11,4,64,32,0,32,0,41,3,32,55,3,48,32,0,32,0,41,3,16,55,3,56,32,0,32,0,41,3,40,55,3,64,65,0,33,1,3,64,32,1,32,0,40,2,4,72,4,64,32,0,40,2,0,32,1,16,18,32,1,65,1,106,33,1,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,8,66,8,134,66,1,132,133,55,3,40,32,3,65,1,106,12,3,11,32,3,65,1,106,33,3,12,1,11,11,65,127,11,34,1,65,0,78,4,64,32,5,32,1,107,33,5,32,1,32,6,106,33,6,32,2,34,1,65,1,106,33,2,32,4,40,2,4,32,1,65,2,116,106,32,0,41,3,56,62,2,0,12,1,11,11,32,4,11,10,0,16,15,36,5,16,15,36,6,11,3,0,1,11,73,1,2,127,32,0,40,2,4,34,1,65,255,255,255,255,0,113,34,2,65,1,70,4,64,32,0,65,16,106,16,53,32,0,32,0,40,2,0,65,1,114,54,2,0,35,0,32,0,16,2,5,32,0,32,2,65,1,107,32,1,65,128,128,128,128,127,113,114,54,2,4,11,11,58,0,2,64,2,64,2,64,32,0,65,8,107,40,2,0,14,7,0,0,1,1,1,1,1,2,11,15,11,32,0,40,2,0,34,0,4,64,32,0,65,172,3,79,4,64,32,0,65,16,107,16,52,11,11,15,11,0,11,11,137,3,7,0,65,16,11,55,40,0,0,0,1,0,0,0,1,0,0,0,40,0,0,0,97,0,108,0,108,0,111,0,99,0,97,0,116,0,105,0,111,0,110,0,32,0,116,0,111,0,111,0,32,0,108,0,97,0,114,0,103,0,101,0,65,208,0,11,45,30,0,0,0,1,0,0,0,1,0,0,0,30,0,0,0,126,0,108,0,105,0,98,0,47,0,114,0,116,0,47,0,116,0,108,0,115,0,102,0,46,0,116,0,115,0,65,128,1,11,43,28,0,0,0,1,0,0,0,1,0,0,0,28,0,0,0,73,0,110,0,118,0,97,0,108,0,105,0,100,0,32,0,108,0,101,0,110,0,103,0,116,0,104,0,65,176,1,11,53,38,0,0,0,1,0,0,0,1,0,0,0,38,0,0,0,126,0,108,0,105,0,98,0,47,0,97,0,114,0,114,0,97,0,121,0,98,0,117,0,102,0,102,0,101,0,114,0,46,0,116,0,115,0,65,240,1,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,73,0,110,0,100,0,101,0,120,0,32,0,111,0,117,0,116,0,32,0,111,0,102,0,32,0,114,0,97,0,110,0,103,0,101,0,65,176,2,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,126,0,108,0,105,0,98,0,47,0,116,0,121,0,112,0,101,0,100,0,97,0,114,0,114,0,97,0,121,0,46,0,116,0,115,0,65,240,2,11,53,7,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,145,4,0,0,2,0,0,0,49,0,0,0,2,0,0,0,17,1,0,0,2,0,0,0,16,0,34,16,115,111,117,114,99,101,77,97,112,112,105,110,103,85,82,76,16,46,47,114,97,98,105,110,46,119,97,115,109,46,109,97,112]);return zD(new Response(new Blob([e],{type:"application/wasm"})),r)}N6.exports=Jg});var O6=re((ite,P6)=>{var L6=k6(),VD=D6(),MD=async(r,e,t,n,i)=>{let o=await VD();return new L6(o,r,e,t,n,i)};P6.exports={Rabin:L6,create:MD}});var l4=re((Ere,c4)=>{"use strict";c4.exports=r=>{if(Object.prototype.toString.call(r)!=="[object Object]")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}});var m4=re((f4,h4)=>{"use strict";var Hp=l4(),{hasOwnProperty:p4}=Object.prototype,{propertyIsEnumerable:dL}=Object,Qs=(r,e,t)=>Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0}),fL=f4,u4={concatArrays:!1,ignoreUndefined:!1},qp=r=>{let e=[];for(let t in r)p4.call(r,t)&&e.push(t);if(Object.getOwnPropertySymbols){let t=Object.getOwnPropertySymbols(r);for(let n of t)dL.call(r,n)&&e.push(n)}return e};function ea(r){return Array.isArray(r)?hL(r):Hp(r)?mL(r):r}function hL(r){let e=r.slice(0,0);return qp(r).forEach(t=>{Qs(e,t,ea(r[t]))}),e}function mL(r){let e=Object.getPrototypeOf(r)===null?Object.create(null):{};return qp(r).forEach(t=>{Qs(e,t,ea(r[t]))}),e}var d4=(r,e,t,n)=>(t.forEach(i=>{typeof e[i]>"u"&&n.ignoreUndefined||(i in r&&r[i]!==Object.getPrototypeOf(r)?Qs(r,i,ex(r[i],e[i],n)):Qs(r,i,ea(e[i])))}),r),gL=(r,e,t)=>{let n=r.slice(0,0),i=0;return[r,e].forEach(o=>{let s=[];for(let a=0;a<o.length;a++)p4.call(o,a)&&(s.push(String(a)),o===r?Qs(n,i++,o[a]):Qs(n,i++,ea(o[a])));n=d4(n,o,qp(o).filter(a=>!s.includes(a)),t)}),n};function ex(r,e,t){return t.concatArrays&&Array.isArray(r)&&Array.isArray(e)?gL(r,e,t):!Hp(e)||!Hp(r)?ea(e):d4(r,e,qp(e),t)}h4.exports=function(...r){let e=ex(ea(u4),this!==fL&&this||{},u4),t={_:{}};for(let n of r)if(n!==void 0){if(!Hp(n))throw new TypeError("`"+n+"` is not an Option Object");t=ex(t,{_:n},e)}return t._}});var D4=re((coe,JL)=>{JL.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var P4=re((loe,L4)=>{L4.exports=D4()});var F4=re((uoe,O4)=>{O4.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var z4=re((poe,ax)=>{typeof Object.create=="function"?ax.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:ax.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}});var j4=re(ye=>{var ZL=/%[sdj%]/g;ye.format=function(r){if(!ud(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(zi(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,o=String(r).replace(ZL,function(a){if(a==="%%")return"%";if(t>=i)return a;switch(a){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return a}}),s=n[t];t<i;s=n[++t])ld(s)||!sa(s)?o+=" "+s:o+=" "+zi(s);return o};ye.deprecate=function(r,e){if(Xn(globalThis.process))return function(){return ye.deprecate(r,e).apply(this,arguments)};if(process.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(process.throwDeprecation)throw new Error(e);process.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n};var id={},cx;ye.debuglog=function(r){if(Xn(cx)&&(cx=process.env.NODE_DEBUG||""),r=r.toUpperCase(),!id[r])if(new RegExp("\\b"+r+"\\b","i").test(cx)){var e=process.pid;id[r]=function(){var t=ye.format.apply(ye,arguments);console.error("%s %d: %s",r,e,t)}}else id[r]=function(){};return id[r]};function zi(r,e){var t={seen:[],stylize:eP};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),fx(e)?t.showHidden=e:e&&ye._extend(t,e),Xn(t.showHidden)&&(t.showHidden=!1),Xn(t.depth)&&(t.depth=2),Xn(t.colors)&&(t.colors=!1),Xn(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=QL),cd(t,r,t.depth)}ye.inspect=zi;zi.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};zi.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function QL(r,e){var t=zi.styles[e];return t?"\x1B["+zi.colors[t][0]+"m"+r+"\x1B["+zi.colors[t][1]+"m":r}function eP(r,e){return r}function tP(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function cd(r,e,t){if(r.customInspect&&e&&ad(e.inspect)&&e.inspect!==ye.inspect&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return ud(n)||(n=cd(r,n,t)),n}var i=rP(r,e);if(i)return i;var o=Object.keys(e),s=tP(o);if(r.showHidden&&(o=Object.getOwnPropertyNames(e)),sd(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return lx(e);if(o.length===0){if(ad(e)){var a=e.name?": "+e.name:"";return r.stylize("[Function"+a+"]","special")}if(od(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(dx(e))return r.stylize(Date.prototype.toString.call(e),"date");if(sd(e))return lx(e)}var c="",u=!1,l=["{","}"];if(V4(e)&&(u=!0,l=["[","]"]),ad(e)){var p=e.name?": "+e.name:"";c=" [Function"+p+"]"}if(od(e)&&(c=" "+RegExp.prototype.toString.call(e)),dx(e)&&(c=" "+Date.prototype.toUTCString.call(e)),sd(e)&&(c=" "+lx(e)),o.length===0&&(!u||e.length==0))return l[0]+c+l[1];if(t<0)return od(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var m;return u?m=nP(r,e,t,s,o):m=o.map(function(d){return px(r,e,t,s,d,u)}),r.seen.pop(),iP(m,c,l)}function rP(r,e){if(Xn(e))return r.stylize("undefined","undefined");if(ud(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(M4(e))return r.stylize(""+e,"number");if(fx(e))return r.stylize(""+e,"boolean");if(ld(e))return r.stylize("null","null")}function lx(r){return"["+Error.prototype.toString.call(r)+"]"}function nP(r,e,t,n,i){for(var o=[],s=0,a=e.length;s<a;++s)$4(e,String(s))?o.push(px(r,e,t,n,String(s),!0)):o.push("");return i.forEach(function(c){c.match(/^\d+$/)||o.push(px(r,e,t,n,c,!0))}),o}function px(r,e,t,n,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?c.set?a=r.stylize("[Getter/Setter]","special"):a=r.stylize("[Getter]","special"):c.set&&(a=r.stylize("[Setter]","special")),$4(n,i)||(s="["+i+"]"),a||(r.seen.indexOf(c.value)<0?(ld(t)?a=cd(r,c.value,null):a=cd(r,c.value,t-1),a.indexOf(`
2
+ "use strict";var HeliaVerifiedFetch=(()=>{var f8=Object.create;var Zc=Object.defineProperty;var h8=Object.getOwnPropertyDescriptor;var m8=Object.getOwnPropertyNames;var g8=Object.getPrototypeOf,x8=Object.prototype.hasOwnProperty;var re=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),$=(r,e)=>{for(var t in e)Zc(r,t,{get:e[t],enumerable:!0})},Ix=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of m8(e))!x8.call(r,i)&&i!==t&&Zc(r,i,{get:()=>e[i],enumerable:!(n=h8(e,i))||n.enumerable});return r};var Q=(r,e,t)=>(t=r!=null?f8(g8(r)):{},Ix(e||!r||!r.__esModule?Zc(t,"default",{value:r,enumerable:!0}):t,r)),y8=r=>Ix(Zc({},"__esModule",{value:!0}),r);var Od=re((o7,Hx)=>{var Do=1e3,Lo=Do*60,Po=Lo*60,qi=Po*24,cA=qi*7,lA=qi*365.25;Hx.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return uA(r);if(t==="number"&&isFinite(r))return e.long?dA(r):pA(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function uA(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*lA;case"weeks":case"week":case"w":return t*cA;case"days":case"day":case"d":return t*qi;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Po;case"minutes":case"minute":case"mins":case"min":case"m":return t*Lo;case"seconds":case"second":case"secs":case"sec":case"s":return t*Do;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function pA(r){var e=Math.abs(r);return e>=qi?Math.round(r/qi)+"d":e>=Po?Math.round(r/Po)+"h":e>=Lo?Math.round(r/Lo)+"m":e>=Do?Math.round(r/Do)+"s":r+"ms"}function dA(r){var e=Math.abs(r);return e>=qi?rl(r,e,qi,"day"):e>=Po?rl(r,e,Po,"hour"):e>=Lo?rl(r,e,Lo,"minute"):e>=Do?rl(r,e,Do,"second"):r+" ms"}function rl(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var Kx=re((s7,qx)=>{function fA(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=s,t.humanize=Od(),t.destroy=u,Object.keys(r).forEach(l=>{t[l]=r[l]}),t.names=[],t.skips=[],t.formatters={};function e(l){let p=0;for(let m=0;m<l.length;m++)p=(p<<5)-p+l.charCodeAt(m),p|=0;return t.colors[Math.abs(p)%t.colors.length]}t.selectColor=e;function t(l){let p,m=null,d,f;function h(...x){if(!h.enabled)return;let g=h,w=Number(new Date),y=w-(p||w);g.diff=y,g.prev=p,g.curr=w,p=w,x[0]=t.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");let E=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,(S,b)=>{if(S==="%%")return"%";E++;let v=t.formatters[b];if(typeof v=="function"){let k=x[E];S=v.call(g,k),x.splice(E,1),E--}return S}),t.formatArgs.call(g,x),(g.log||t.log).apply(g,x)}return h.namespace=l,h.useColors=t.useColors(),h.color=t.selectColor(l),h.extend=n,h.destroy=t.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(d!==t.namespaces&&(d=t.namespaces,f=t.enabled(l)),f),set:x=>{m=x}}),typeof t.init=="function"&&t.init(h),h}function n(l,p){let m=t(this.namespace+(typeof p>"u"?":":p)+l);return m.log=this.log,m}function i(l){t.save(l),t.namespaces=l,t.names=[],t.skips=[];let p,m=(typeof l=="string"?l:"").split(/[\s,]+/),d=m.length;for(p=0;p<d;p++)m[p]&&(l=m[p].replace(/\*/g,".*?"),l[0]==="-"?t.skips.push(new RegExp("^"+l.slice(1)+"$")):t.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...t.names.map(a),...t.skips.map(a).map(p=>"-"+p)].join(",");return t.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let p,m;for(p=0,m=t.skips.length;p<m;p++)if(t.skips[p].test(l))return!1;for(p=0,m=t.names.length;p<m;p++)if(t.names[p].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}qx.exports=fA});var Fd=re((Ft,nl)=>{Ft.formatArgs=mA;Ft.save=gA;Ft.load=xA;Ft.useColors=hA;Ft.storage=yA();Ft.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ft.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function hA(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function mA(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+nl.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(n=t))}),r.splice(n,0,e)}Ft.log=console.debug||console.log||(()=>{});function gA(r){try{r?Ft.storage.setItem("debug",r):Ft.storage.removeItem("debug")}catch{}}function xA(){let r;try{r=Ft.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function yA(){try{return localStorage}catch{}}nl.exports=Kx()(Ft);var{formatters:wA}=nl.exports;wA.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Jx=re((f7,Xx)=>{Xx.exports=Vd;var Yx=128,AA=127,SA=~AA,BA=Math.pow(2,31);function Vd(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw Vd.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=BA;)e[t++]=r&255|Yx,r/=128;for(;r&SA;)e[t++]=r&255|Yx,r>>>=7;return e[t]=r|0,Vd.bytes=t-n+1,e}});var e1=re((h7,Qx)=>{Qx.exports=Md;var kA=128,Zx=127;function Md(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a||i>49)throw Md.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&Zx)<<i:(s&Zx)*Math.pow(2,i),i+=7}while(s>=kA);return Md.bytes=o-n,t}});var r1=re((m7,t1)=>{var IA=Math.pow(2,7),_A=Math.pow(2,14),TA=Math.pow(2,21),CA=Math.pow(2,28),RA=Math.pow(2,35),UA=Math.pow(2,42),NA=Math.pow(2,49),DA=Math.pow(2,56),LA=Math.pow(2,63);t1.exports=function(r){return r<IA?1:r<_A?2:r<TA?3:r<CA?4:r<RA?5:r<UA?6:r<NA?7:r<DA?8:r<LA?9:10}});var il=re((g7,n1)=>{n1.exports={encode:Jx(),decode:e1(),encodingLength:r1()}});var ke=re((NO,E1)=>{"use strict";function v1(r,e){for(let t in e)Object.defineProperty(r,t,{value:e[t],enumerable:!0,configurable:!0});return r}function g5(r,e,t){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=""),e&&(t.code=e);try{return v1(r,t)}catch{t.message=r.message,t.stack=r.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(r)),v1(new i,t)}}E1.exports=g5});var my=re(is=>{"use strict";var aB="[object ArrayBuffer]",xn=class r{static isArrayBuffer(e){return Object.prototype.toString.call(e)===aB}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=r.toUint8Array(e),i=r.toUint8Array(t);if(n.length!==i.byteLength)return!1;for(let o=0;o<n.length;o++)if(n[o]!==i[o])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let s of t)n+=s.byteLength;let i=new Uint8Array(n),o=0;for(let s of t){let a=this.toUint8Array(s);i.set(a,o),o+=a.length}return e[e.length-1]instanceof Function?this.toView(i,e[e.length-1]):i.buffer}},eh="string",cB=/^[0-9a-f]+$/i,lB=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,uB=/^[a-zA-Z0-9-_]+$/,Dl=class{static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n.buffer}static toString(e){let t=xn.toUint8Array(e),n="";for(let o=0;o<t.length;o++)n+=String.fromCharCode(t[o]);return decodeURIComponent(escape(n))}},sr=class{static toString(e,t=!1){let n=xn.toArrayBuffer(e),i=new DataView(n),o="";for(let s=0;s<n.byteLength;s+=2){let a=i.getUint16(s,t);o+=String.fromCharCode(a)}return o}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),i=new DataView(n);for(let o=0;o<e.length;o++)i.setUint16(o*2,e.charCodeAt(o),t);return n}},Ll=class r{static isHex(e){return typeof e===eh&&cB.test(e)}static isBase64(e){return typeof e===eh&&lB.test(e)}static isBase64Url(e){return typeof e===eh&&uB.test(e)}static ToString(e,t="utf8"){let n=xn.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return sr.toString(n,!0);case"utf16":case"utf16be":return sr.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return sr.fromString(e,!0);case"utf16":case"utf16be":return sr.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=xn.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return Dl.fromString(e);case"utf16":case"utf16be":return sr.fromString(e);case"utf16le":case"usc2":return sr.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return Dl.toString(e);case"utf16":case"utf16be":return sr.toString(e);case"utf16le":case"usc2":return sr.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);return n.buffer}static ToBinary(e){let t=xn.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return n}static ToHex(e){let t=xn.toUint8Array(e),n="",i=t.length;for(let o=0;o<i;o++){let s=t[o];s<16&&(n+="0"),n+=s.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i=i+2){let o=t.slice(i,i+2);n[i/2]=parseInt(o,16)}return n.buffer}static ToUtf16String(e,t=!1){return sr.toString(e,t)}static FromUtf16String(e,t=!1){return sr.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Ll.DEFAULT_UTF8_ENCODING="utf8";function pB(r,...e){let t=arguments[0];for(let n=1;n<arguments.length;n++){let i=arguments[n];for(let o in i)t[o]=i[o]}return t}function dB(...r){let e=r.map(i=>i.byteLength).reduce((i,o)=>i+o),t=new Uint8Array(e),n=0;return r.map(i=>new Uint8Array(i)).forEach(i=>{for(let o of i)t[n++]=o}),t.buffer}function fB(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<r.byteLength;i++)if(t[i]!==n[i])return!1;return!0}is.BufferSourceConverter=xn;is.Convert=Ll;is.assign=pB;is.combine=dB;is.isEqual=fB});var Su=re((XV,mh)=>{var YV=function(){typeof mh<"u"&&(mh.exports=h);var r=86400,e=3200,t=146097*e/400,n=r*t,i=1e3*n,o=864e13,s=4294967296,a=1e6,c="000000000",u=Math.trunc||function(v){var k=v-v%1;return k==0&&(v<0||v===0&&1/v!=1/0)?-0:k},l=h.prototype,p=(h.fromDate=function(v){return new h(+v)},h.fromInt64BE=E(0,1,2,3,0,4),h.fromInt64LE=E(3,2,1,0,4,0),h.fromString=function(R){var k,U=new h,R=(R+="").replace(/^\s*[+\-]?\d+/,function(L){var L=+L,le=1970+(L-1970)%400;return U.year=L-le,le}).replace(/(?:Z|([+\-]\d{2}):?(\d{2}))$/,function(M,L,le){return L<0&&(le*=-1),k=6e4*(60*+L+ +le),""}).replace(/\.\d+$/,function(M){return U.nano=+(M+c).substr(1,9),""}).split(/\D+/);if(1<R.length?R[1]--:R[1]=0,U.time=k=Date.UTC.apply(Date,R)-(k||0),isNaN(k))throw new TypeError("Invalid Date");return x(U)},h.fromTimeT=function(v){return w(v,0)},l.year=0,l.time=0,l.nano=0,l.addNano=function(v){return this.nano+=+v||0,this},l.getNano=function(){var v=x(this);return(v.time%1e3*a+ +v.nano+1e9)%1e9},l.getTimeT=function(){var k=x(this),v=Math.floor(k.time/1e3),k=k.year;return k&&(v+=k*t*r/e),v},l.getYear=function(){return this.toDate().getUTCFullYear()+this.year},l.toDate=function(){return g(x(this).time)},l.toJSON=function(){return this.toString().replace(/0{1,6}Z$/,"Z")},l.toString=function(v){var k=this,U=k.toDate(),R={H:function(){return S(U.getUTCHours())},L:function(){return b(U.getUTCMilliseconds(),3)},M:function(){return S(U.getUTCMinutes())},N:function(){return b(k.getNano(),9)},S:function(){return S(U.getUTCSeconds())},Y:function(){var M=k.getYear();return 999999<M?"+"+M:9999<M?"+"+b(M,6):0<=M?b(M,4):-999999<=M?"-"+b(-M,6):M},a:function(){return d[U.getUTCDay()]},b:function(){return m[U.getUTCMonth()]},d:function(){return S(U.getUTCDate())},e:function(){return function(M){return(9<M?"":" ")+(0|M)}(U.getUTCDate())},m:function(){return S(U.getUTCMonth()+1)}};return function M(L){return L.replace(/%./g,function(le){var D=le[1],_=f[D],D=R[D];return _?M(_):D?D():le})}(v||p)},l.writeInt64BE=y(0,1,2,3,0,4),l.writeInt64LE=y(3,2,1,0,4,0),"%Y-%m-%dT%H:%M:%S.%NZ"),m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],d=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],f={"%":"%",F:"%Y-%m-%d",n:`
3
+ `,R:"%H:%M",T:"%H:%M:%S",t:" ",X:"%T",Z:"GMT",z:"+0000"};return h;function h(v,k,U){var R=this;if(!(R instanceof h))return new h(v,k,U);R.time=+v||0,R.nano=+k||0,R.year=+U||0,x(R)}function x(v){var k,U,R,M=v.year,L=v.time,le=v.nano,_=((le<0||a<=le)&&(le-=(U=Math.floor(le/a))*a,L+=U,U=1),M%e);return(L<-o||o<L||_)&&((k=u(L/i))&&(M+=k*e,L-=k*i),(R=g(L)).setUTCFullYear(_+R.getUTCFullYear()),R=(L=+R)+(k=u((M-=_)/e))*i,k&&-o<=R&&R<=o&&(M-=k*e,L=R),U=1),U&&(v.year=M,v.time=L,v.nano=le),v}function g(v){var k=new Date(0);return k.setTime(v),k}function w(M,R){M=+M||0;var U=u((R=(R|0)*s)/n)+u(M/n),R=R%n+M%n,M=u(R/n);return M&&(U+=M,R-=M*n),new h(1e3*R,0,U*e)}function y(v,k,U,R,M,L){return function(_,D){var N=x(this);_=_||new Array(8),B(_,D|=0);var T=Math.floor(N.time/1e3),N=N.year*(t*r/e),J=u(N/s)+u(T/s),N=N%s+T%s,T=Math.floor(N/s);return T&&(J+=T,N-=T*s),le(_,D+M,J),le(_,D+L,N),_};function le(_,D,J){_[D+v]=J>>24&255,_[D+k]=J>>16&255,_[D+U]=J>>8&255,_[D+R]=255&J}}function E(v,k,U,R,M,L){return function(_,D){B(_,D|=0);var J=le(_,D+M);return w(le(_,D+L),J)};function le(_,D){return 16777216*_[D+v]+(_[D+k]<<16|_[D+U]<<8|_[D+R])}}function B(v,k){if(v=v&&v.length,v==null)throw new TypeError("Invalid Buffer");if(v<k+8)throw new RangeError("Out of range")}function S(v){return(9<v?"":"0")+(0|v)}function b(v,k){return(c+(0|v)).substr(-k)}}()});var Hb=re((N$,Th)=>{"use strict";var Nk=Object.prototype.hasOwnProperty,bt="~";function Ga(){}Object.create&&(Ga.prototype=Object.create(null),new Ga().__proto__||(bt=!1));function Dk(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function jb(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var o=new Dk(t,n||r,i),s=bt?bt+e:e;return r._events[s]?r._events[s].fn?r._events[s]=[r._events[s],o]:r._events[s].push(o):(r._events[s]=o,r._eventsCount++),r}function Mu(r,e){--r._eventsCount===0?r._events=new Ga:delete r._events[e]}function ht(){this._events=new Ga,this._eventsCount=0}ht.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)Nk.call(t,n)&&e.push(bt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};ht.prototype.listeners=function(e){var t=bt?bt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s};ht.prototype.listenerCount=function(e){var t=bt?bt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};ht.prototype.emit=function(e,t,n,i,o,s){var a=bt?bt+e:e;if(!this._events[a])return!1;var c=this._events[a],u=arguments.length,l,p;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,o),!0;case 6:return c.fn.call(c.context,t,n,i,o,s),!0}for(p=1,l=new Array(u-1);p<u;p++)l[p-1]=arguments[p];c.fn.apply(c.context,l)}else{var m=c.length,d;for(p=0;p<m;p++)switch(c[p].once&&this.removeListener(e,c[p].fn,void 0,!0),u){case 1:c[p].fn.call(c[p].context);break;case 2:c[p].fn.call(c[p].context,t);break;case 3:c[p].fn.call(c[p].context,t,n);break;case 4:c[p].fn.call(c[p].context,t,n,i);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[p].fn.apply(c[p].context,l)}}return!0};ht.prototype.on=function(e,t,n){return jb(this,e,t,n,!1)};ht.prototype.once=function(e,t,n){return jb(this,e,t,n,!0)};ht.prototype.removeListener=function(e,t,n,i){var o=bt?bt+e:e;if(!this._events[o])return this;if(!t)return Mu(this,o),this;var s=this._events[o];if(s.fn)s.fn===t&&(!i||s.once)&&(!n||s.context===n)&&Mu(this,o);else{for(var a=0,c=[],u=s.length;a<u;a++)(s[a].fn!==t||i&&!s[a].once||n&&s[a].context!==n)&&c.push(s[a]);c.length?this._events[o]=c.length===1?c[0]:c:Mu(this,o)}return this};ht.prototype.removeAllListeners=function(e){var t;return e?(t=bt?bt+e:e,this._events[t]&&Mu(this,t)):(this._events=new Ga,this._eventsCount=0),this};ht.prototype.off=ht.prototype.removeListener;ht.prototype.addListener=ht.prototype.on;ht.prefixed=bt;ht.EventEmitter=ht;typeof Th<"u"&&(Th.exports=ht)});var $0=re((QX,kE)=>{"use strict";var qR=typeof navigator<"u"&&navigator.product==="ReactNative";function KR(){return qR?"http://localhost":self.location?self.location.protocol+"//"+self.location.host:""}var Bc=self.URL,BE=KR(),M0=class{constructor(e="",t=BE){this.super=new Bc(e,t),this.path=this.pathname+this.search,this.auth=this.username&&this.password?this.username+":"+this.password:null,this.query=this.search&&this.search.startsWith("?")?this.search.slice(1):null}get hash(){return this.super.hash}get host(){return this.super.host}get hostname(){return this.super.hostname}get href(){return this.super.href}get origin(){return this.super.origin}get password(){return this.super.password}get pathname(){return this.super.pathname}get port(){return this.super.port}get protocol(){return this.super.protocol}get search(){return this.super.search}get searchParams(){return this.super.searchParams}get username(){return this.super.username}set hash(e){this.super.hash=e}set host(e){this.super.host=e}set hostname(e){this.super.hostname=e}set href(e){this.super.href=e}set password(e){this.super.password=e}set pathname(e){this.super.pathname=e}set port(e){this.super.port=e}set protocol(e){this.super.protocol=e}set search(e){this.super.search=e}set username(e){this.super.username=e}static createObjectURL(e){return Bc.createObjectURL(e)}static revokeObjectURL(e){Bc.revokeObjectURL(e)}toJSON(){return this.super.toJSON()}toString(){return this.super.toString()}format(){return this.toString()}};function GR(r){if(typeof r=="string")return new Bc(r).toString();if(!(r instanceof Bc)){let e=r.username&&r.password?`${r.username}:${r.password}@`:"",t=r.auth?r.auth+"@":"",n=r.port?":"+r.port:"",i=r.protocol?r.protocol+"//":"",o=r.host||"",s=r.hostname||"",a=r.search||(r.query?"?"+r.query:""),c=r.hash||"",u=r.pathname||"",l=r.path||u+a;return`${i}${e||t}${o||s+n}${l}${c}`}}kE.exports={URLWithLegacySupport:M0,URLSearchParams:self.URLSearchParams,defaultBase:BE,format:GR}});var TE=re((eJ,_E)=>{"use strict";var{URLWithLegacySupport:IE,format:WR}=$0();_E.exports=(r,e={},t={},n)=>{let i=e.protocol?e.protocol.replace(":",""):"http";i=(t[i]||n||i)+":";let o;try{o=new IE(r)}catch{o={}}let s=Object.assign({},e,{protocol:i||o.protocol,host:e.host||o.host});return new IE(r,WR(s)).toString()}});var RE=re((tJ,CE)=>{"use strict";var{URLWithLegacySupport:YR,format:XR,URLSearchParams:JR,defaultBase:ZR}=$0(),QR=TE();CE.exports={URL:YR,URLSearchParams:JR,format:XR,relative:QR,defaultBase:ZR}});var PE=re((uJ,LE)=>{"use strict";LE.exports=DE;var sU=Od(),Ui=DE.prototype,aU=new Date%1e9;function cU(){return(Math.random()*1e9>>>0)+aU++}function DE(r){r=r||{},this.id=r.id||cU(),this.max=r.max||1/0,this.items=r.items||[],this._lookup={},this.size=this.items.length,this.lastModified=new Date(r.lastModified||new Date);for(var e,t,n=this.items.length;n--;)e=this.items[n],t=new Date(e.expires)-new Date,this._lookup[e.key]=e,t>0?this.expire(e.key,t):t<=0&&this.delete(e.key)}Ui.has=function(r){return r in this._lookup};Ui.get=function(r){if(!this.has(r))return null;var e=this._lookup[r];return e.refresh&&this.expire(r,e.refresh),this.items.splice(this.items.indexOf(e),1),this.items.push(e),e.value};Ui.meta=function(r){if(!this.has(r))return null;var e=this._lookup[r];return"meta"in e?e.meta:null};Ui.set=function(r,e,t){var n=this._lookup[r],i=this._lookup[r]={key:r,value:e};return this.lastModified=new Date,n?(clearTimeout(n.timeout),this.items.splice(this.items.indexOf(n),1,i)):(this.size>=this.max&&this.delete(this.items[0].key),this.items.push(i),this.size++),t&&("ttl"in t&&this.expire(r,t.ttl),"meta"in t&&(i.meta=t.meta),t.refresh&&(i.refresh=t.ttl)),this};Ui.delete=function(r){var e=this._lookup[r];return e?(this.lastModified=new Date,this.items.splice(this.items.indexOf(e),1),clearTimeout(e.timeout),delete this._lookup[r],this.size--,this):!1};Ui.expire=function(r,e){var t=e||0,n=this._lookup[r];if(!n)return this;if(typeof t=="string"&&(t=sU(e)),typeof t!="number")throw new TypeError("Expiration time must be a string or number.");return clearTimeout(n.timeout),n.timeout=setTimeout(this.delete.bind(this,n.key),t),n.expires=Number(new Date)+t,this};Ui.clear=function(){for(var r=this.items.length;r--;)this.delete(this.items[r].key);return this};Ui.toJSON=function(){for(var r=new Array(this.items.length),e,t=r.length;t--;)e=this.items[t],r[t]={key:e.key,meta:e.meta,value:e.value,expires:e.expires,refresh:e.refresh};return{id:this.id,max:isFinite(this.max)?this.max:void 0,lastModified:this.lastModified,items:r}}});var W0=re((dJ,zE)=>{zE.exports=function(r){if(!r)throw Error("hashlru must have a max value, of type number, greater than 0");var e=0,t=Object.create(null),n=Object.create(null);function i(o,s){t[o]=s,e++,e>=r&&(e=0,n=t,t=Object.create(null))}return{has:function(o){return t[o]!==void 0||n[o]!==void 0},remove:function(o){t[o]!==void 0&&(t[o]=void 0),n[o]!==void 0&&(n[o]=void 0)},get:function(o){var s=t[o];if(s!==void 0)return s;if((s=n[o])!==void 0)return i(o,s),s},set:function(o,s){t[o]!==void 0?t[o]=s:i(o,s)},clear:function(){t=Object.create(null),n=Object.create(null)}}}});var QE=re(Ip=>{"use strict";Ip.byteLength=xU;Ip.toByteArray=wU;Ip.fromByteArray=EU;var Wr=[],pr=[],gU=typeof Uint8Array<"u"?Uint8Array:Array,eg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(wo=0,JE=eg.length;wo<JE;++wo)Wr[wo]=eg[wo],pr[eg.charCodeAt(wo)]=wo;var wo,JE;pr[45]=62;pr[95]=63;function ZE(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function xU(r){var e=ZE(r),t=e[0],n=e[1];return(t+n)*3/4-n}function yU(r,e,t){return(e+t)*3/4-t}function wU(r){var e,t=ZE(r),n=t[0],i=t[1],o=new gU(yU(r,n,i)),s=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=pr[r.charCodeAt(c)]<<18|pr[r.charCodeAt(c+1)]<<12|pr[r.charCodeAt(c+2)]<<6|pr[r.charCodeAt(c+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=pr[r.charCodeAt(c)]<<2|pr[r.charCodeAt(c+1)]>>4,o[s++]=e&255),i===1&&(e=pr[r.charCodeAt(c)]<<10|pr[r.charCodeAt(c+1)]<<4|pr[r.charCodeAt(c+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function bU(r){return Wr[r>>18&63]+Wr[r>>12&63]+Wr[r>>6&63]+Wr[r&63]}function vU(r,e,t){for(var n,i=[],o=e;o<t;o+=3)n=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),i.push(bU(n));return i.join("")}function EU(r){for(var e,t=r.length,n=t%3,i=[],o=16383,s=0,a=t-n;s<a;s+=o)i.push(vU(r,s,s+o>a?a:s+o));return n===1?(e=r[t-1],i.push(Wr[e>>2]+Wr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(Wr[e>>10]+Wr[e>>4&63]+Wr[e<<2&63]+"=")),i.join("")}});var e3=re(tg=>{tg.read=function(r,e,t,n,i){var o,s,a=i*8-n-1,c=(1<<a)-1,u=c>>1,l=-7,p=t?i-1:0,m=t?-1:1,d=r[e+p];for(p+=m,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=o*256+r[e+p],p+=m,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=s*256+r[e+p],p+=m,l-=8);if(o===0)o=1-u;else{if(o===c)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-u}return(d?-1:1)*s*Math.pow(2,o-n)};tg.write=function(r,e,t,n,i,o){var s,a,c,u=o*8-i-1,l=(1<<u)-1,p=l>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,h=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+p>=1?e+=m/c:e+=m*Math.pow(2,1-p),e*c>=2&&(s++,c/=2),s+p>=l?(a=0,s=l):s+p>=1?(a=(e*c-1)*Math.pow(2,i),s=s+p):(a=e*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;r[t+d]=a&255,d+=f,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;r[t+d]=s&255,d+=f,s/=256,u-=8);r[t+d-f]|=h*128}});var ug=re(qs=>{"use strict";var rg=QE(),js=e3(),t3=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;qs.Buffer=I;qs.SlowBuffer=_U;qs.INSPECT_MAX_BYTES=50;var _p=2147483647;qs.kMaxLength=_p;I.TYPED_ARRAY_SUPPORT=AU();!I.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 AU(){try{let r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(I.prototype,"parent",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.buffer}});Object.defineProperty(I.prototype,"offset",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.byteOffset}});function On(r){if(r>_p)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,I.prototype),e}function I(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return sg(r)}return o3(r,e,t)}I.poolSize=8192;function o3(r,e,t){if(typeof r=="string")return BU(r,e);if(ArrayBuffer.isView(r))return kU(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Yr(r,ArrayBuffer)||r&&Yr(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Yr(r,SharedArrayBuffer)||r&&Yr(r.buffer,SharedArrayBuffer)))return ig(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return I.from(n,e,t);let i=IU(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return I.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}I.from=function(r,e,t){return o3(r,e,t)};Object.setPrototypeOf(I.prototype,Uint8Array.prototype);Object.setPrototypeOf(I,Uint8Array);function s3(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function SU(r,e,t){return s3(r),r<=0?On(r):e!==void 0?typeof t=="string"?On(r).fill(e,t):On(r).fill(e):On(r)}I.alloc=function(r,e,t){return SU(r,e,t)};function sg(r){return s3(r),On(r<0?0:ag(r)|0)}I.allocUnsafe=function(r){return sg(r)};I.allocUnsafeSlow=function(r){return sg(r)};function BU(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!I.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=a3(r,e)|0,n=On(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}function ng(r){let e=r.length<0?0:ag(r.length)|0,t=On(e);for(let n=0;n<e;n+=1)t[n]=r[n]&255;return t}function kU(r){if(Yr(r,Uint8Array)){let e=new Uint8Array(r);return ig(e.buffer,e.byteOffset,e.byteLength)}return ng(r)}function ig(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,I.prototype),n}function IU(r){if(I.isBuffer(r)){let e=ag(r.length)|0,t=On(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||lg(r.length)?On(0):ng(r);if(r.type==="Buffer"&&Array.isArray(r.data))return ng(r.data)}function ag(r){if(r>=_p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_p.toString(16)+" bytes");return r|0}function _U(r){return+r!=r&&(r=0),I.alloc(+r)}I.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==I.prototype};I.compare=function(e,t){if(Yr(e,Uint8Array)&&(e=I.from(e,e.offset,e.byteLength)),Yr(t,Uint8Array)&&(t=I.from(t,t.offset,t.byteLength)),!I.isBuffer(e)||!I.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t.length;for(let o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==t[o]){n=e[o],i=t[o];break}return n<i?-1:i<n?1:0};I.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}};I.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return I.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let i=I.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){let s=e[n];if(Yr(s,Uint8Array))o+s.length>i.length?(I.isBuffer(s)||(s=I.from(s)),s.copy(i,o)):Uint8Array.prototype.set.call(i,s,o);else if(I.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i};function a3(r,e){if(I.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Yr(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return og(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return g3(r).length;default:if(i)return n?-1:og(r).length;e=(""+e).toLowerCase(),i=!0}}I.byteLength=a3;function TU(r,e,t){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return zU(this,e,t);case"utf8":case"utf-8":return l3(this,e,t);case"ascii":return OU(this,e,t);case"latin1":case"binary":return FU(this,e,t);case"base64":return LU(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return VU(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}I.prototype._isBuffer=!0;function bo(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}I.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 t=0;t<e;t+=2)bo(this,t,t+1);return this};I.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 t=0;t<e;t+=4)bo(this,t,t+3),bo(this,t+1,t+2);return this};I.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 t=0;t<e;t+=8)bo(this,t,t+7),bo(this,t+1,t+6),bo(this,t+2,t+5),bo(this,t+3,t+4);return this};I.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?l3(this,0,e):TU.apply(this,arguments)};I.prototype.toLocaleString=I.prototype.toString;I.prototype.equals=function(e){if(!I.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:I.compare(this,e)===0};I.prototype.inspect=function(){let e="",t=qs.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};t3&&(I.prototype[t3]=I.prototype.inspect);I.prototype.compare=function(e,t,n,i,o){if(Yr(e,Uint8Array)&&(e=I.from(e,e.offset,e.byteLength)),!I.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;let s=o-i,a=n-t,c=Math.min(s,a),u=this.slice(i,o),l=e.slice(t,n);for(let p=0;p<c;++p)if(u[p]!==l[p]){s=u[p],a=l[p];break}return s<a?-1:a<s?1:0};function c3(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,lg(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=I.from(e,n)),I.isBuffer(e))return e.length===0?-1:r3(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):r3(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function r3(r,e,t,n,i){let o=1,s=r.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;o=2,s/=2,a/=2,t/=2}function c(l,p){return o===1?l[p]:l.readUInt16BE(p*o)}let u;if(i){let l=-1;for(u=t;u<s;u++)if(c(r,u)===c(e,l===-1?0:u-l)){if(l===-1&&(l=u),u-l+1===a)return l*o}else l!==-1&&(u-=u-l),l=-1}else for(t+a>s&&(t=s-a),u=t;u>=0;u--){let l=!0;for(let p=0;p<a;p++)if(c(r,u+p)!==c(e,p)){l=!1;break}if(l)return u}return-1}I.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1};I.prototype.indexOf=function(e,t,n){return c3(this,e,t,n,!0)};I.prototype.lastIndexOf=function(e,t,n){return c3(this,e,t,n,!1)};function CU(r,e,t,n){t=Number(t)||0;let i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let s;for(s=0;s<n;++s){let a=parseInt(e.substr(s*2,2),16);if(lg(a))return s;r[t+s]=a}return s}function RU(r,e,t,n){return Tp(og(e,r.length-t),r,t,n)}function UU(r,e,t,n){return Tp(HU(e),r,t,n)}function NU(r,e,t,n){return Tp(g3(e),r,t,n)}function DU(r,e,t,n){return Tp(qU(e,r.length-t),r,t,n)}I.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>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-t;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return CU(this,e,t,n);case"utf8":case"utf-8":return RU(this,e,t,n);case"ascii":case"latin1":case"binary":return UU(this,e,t,n);case"base64":return NU(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return DU(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};I.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function LU(r,e,t){return e===0&&t===r.length?rg.fromByteArray(r):rg.fromByteArray(r.slice(e,t))}function l3(r,e,t){t=Math.min(r.length,t);let n=[],i=e;for(;i<t;){let o=r[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=t){let c,u,l,p;switch(a){case 1:o<128&&(s=o);break;case 2:c=r[i+1],(c&192)===128&&(p=(o&31)<<6|c&63,p>127&&(s=p));break;case 3:c=r[i+1],u=r[i+2],(c&192)===128&&(u&192)===128&&(p=(o&15)<<12|(c&63)<<6|u&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:c=r[i+1],u=r[i+2],l=r[i+3],(c&192)===128&&(u&192)===128&&(l&192)===128&&(p=(o&15)<<18|(c&63)<<12|(u&63)<<6|l&63,p>65535&&p<1114112&&(s=p))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return PU(n)}var n3=4096;function PU(r){let e=r.length;if(e<=n3)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=n3));return t}function OU(r,e,t){let n="";t=Math.min(r.length,t);for(let i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function FU(r,e,t){let n="";t=Math.min(r.length,t);for(let i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function zU(r,e,t){let n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);let i="";for(let o=e;o<t;++o)i+=KU[r[o]];return i}function VU(r,e,t){let n=r.slice(e,t),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}I.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let i=this.subarray(e,t);return Object.setPrototypeOf(i,I.prototype),i};function Qe(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}I.prototype.readUintLE=I.prototype.readUIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||Qe(e,t,this.length);let i=this[e],o=1,s=0;for(;++s<t&&(o*=256);)i+=this[e+s]*o;return i};I.prototype.readUintBE=I.prototype.readUIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||Qe(e,t,this.length);let i=this[e+--t],o=1;for(;t>0&&(o*=256);)i+=this[e+--t]*o;return i};I.prototype.readUint8=I.prototype.readUInt8=function(e,t){return e=e>>>0,t||Qe(e,1,this.length),this[e]};I.prototype.readUint16LE=I.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||Qe(e,2,this.length),this[e]|this[e+1]<<8};I.prototype.readUint16BE=I.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||Qe(e,2,this.length),this[e]<<8|this[e+1]};I.prototype.readUint32LE=I.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};I.prototype.readUint32BE=I.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};I.prototype.readBigUInt64LE=Di(function(e){e=e>>>0,Hs(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_c(e,this.length-8);let i=t+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))});I.prototype.readBigUInt64BE=Di(function(e){e=e>>>0,Hs(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_c(e,this.length-8);let i=t*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)});I.prototype.readIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||Qe(e,t,this.length);let i=this[e],o=1,s=0;for(;++s<t&&(o*=256);)i+=this[e+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i};I.prototype.readIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||Qe(e,t,this.length);let i=t,o=1,s=this[e+--i];for(;i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*t)),s};I.prototype.readInt8=function(e,t){return e=e>>>0,t||Qe(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};I.prototype.readInt16LE=function(e,t){e=e>>>0,t||Qe(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};I.prototype.readInt16BE=function(e,t){e=e>>>0,t||Qe(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};I.prototype.readInt32LE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};I.prototype.readInt32BE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};I.prototype.readBigInt64LE=Di(function(e){e=e>>>0,Hs(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_c(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(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});I.prototype.readBigInt64BE=Di(function(e){e=e>>>0,Hs(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_c(e,this.length-8);let i=(t<<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)});I.prototype.readFloatLE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),js.read(this,e,!0,23,4)};I.prototype.readFloatBE=function(e,t){return e=e>>>0,t||Qe(e,4,this.length),js.read(this,e,!1,23,4)};I.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||Qe(e,8,this.length),js.read(this,e,!0,52,8)};I.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||Qe(e,8,this.length),js.read(this,e,!1,52,8)};function Dt(r,e,t,n,i,o){if(!I.isBuffer(r))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(t+n>r.length)throw new RangeError("Index out of range")}I.prototype.writeUintLE=I.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;Dt(this,e,t,n,a,0)}let o=1,s=0;for(this[t]=e&255;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n};I.prototype.writeUintBE=I.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;Dt(this,e,t,n,a,0)}let o=n-1,s=1;for(this[t+o]=e&255;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n};I.prototype.writeUint8=I.prototype.writeUInt8=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,1,255,0),this[t]=e&255,t+1};I.prototype.writeUint16LE=I.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};I.prototype.writeUint16BE=I.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};I.prototype.writeUint32LE=I.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};I.prototype.writeUint32BE=I.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function u3(r,e,t,n,i){m3(e,n,i,r,t,7);let o=Number(e&BigInt(4294967295));r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s,t}function p3(r,e,t,n,i){m3(e,n,i,r,t,7);let o=Number(e&BigInt(4294967295));r[t+7]=o,o=o>>8,r[t+6]=o,o=o>>8,r[t+5]=o,o=o>>8,r[t+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=s,s=s>>8,r[t+2]=s,s=s>>8,r[t+1]=s,s=s>>8,r[t]=s,t+8}I.prototype.writeBigUInt64LE=Di(function(e,t=0){return u3(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});I.prototype.writeBigUInt64BE=Di(function(e,t=0){return p3(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});I.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);Dt(this,e,t,n,c-1,-c)}let o=0,s=1,a=0;for(this[t]=e&255;++o<n&&(s*=256);)e<0&&a===0&&this[t+o-1]!==0&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n};I.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);Dt(this,e,t,n,c-1,-c)}let o=n-1,s=1,a=0;for(this[t+o]=e&255;--o>=0&&(s*=256);)e<0&&a===0&&this[t+o+1]!==0&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n};I.prototype.writeInt8=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};I.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};I.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};I.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};I.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||Dt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};I.prototype.writeBigInt64LE=Di(function(e,t=0){return u3(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});I.prototype.writeBigInt64BE=Di(function(e,t=0){return p3(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function d3(r,e,t,n,i,o){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function f3(r,e,t,n,i){return e=+e,t=t>>>0,i||d3(r,e,t,4,34028234663852886e22,-34028234663852886e22),js.write(r,e,t,n,23,4),t+4}I.prototype.writeFloatLE=function(e,t,n){return f3(this,e,t,!0,n)};I.prototype.writeFloatBE=function(e,t,n){return f3(this,e,t,!1,n)};function h3(r,e,t,n,i){return e=+e,t=t>>>0,i||d3(r,e,t,8,17976931348623157e292,-17976931348623157e292),js.write(r,e,t,n,52,8),t+8}I.prototype.writeDoubleLE=function(e,t,n){return h3(this,e,t,!0,n)};I.prototype.writeDoubleBE=function(e,t,n){return h3(this,e,t,!1,n)};I.prototype.copy=function(e,t,n,i){if(!I.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<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-t<i-n&&(i=e.length-t+n);let o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),o};I.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=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"&&!I.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let s=e.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{let s=I.isBuffer(e)?e:I.from(e,i),a=s.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var $s={};function cg(r,e,t){$s[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}cg("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);cg("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError);cg("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out of range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=i3(String(t)):typeof t=="bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=i3(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function i3(r){let e="",t=r.length,n=r[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function MU(r,e,t){Hs(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&_c(e,r.length-(t+1))}function m3(r,e,t,n,i,o){if(r>t||r<e){let s=typeof e=="bigint"?"n":"",a;throw o>3?e===0||e===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${e}${s} and <= ${t}${s}`,new $s.ERR_OUT_OF_RANGE("value",a,r)}MU(n,i,o)}function Hs(r,e){if(typeof r!="number")throw new $s.ERR_INVALID_ARG_TYPE(e,"number",r)}function _c(r,e,t){throw Math.floor(r)!==r?(Hs(r,t),new $s.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new $s.ERR_BUFFER_OUT_OF_BOUNDS:new $s.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}var $U=/[^+/0-9A-Za-z-_]/g;function jU(r){if(r=r.split("=")[0],r=r.trim().replace($U,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function og(r,e){e=e||1/0;let t,n=r.length,i=null,o=[];for(let s=0;s<n;++s){if(t=r.charCodeAt(s),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&o.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;o.push(t)}else if(t<2048){if((e-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function HU(r){let e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function qU(r,e){let t,n,i,o=[];for(let s=0;s<r.length&&!((e-=2)<0);++s)t=r.charCodeAt(s),n=t>>8,i=t%256,o.push(i),o.push(n);return o}function g3(r){return rg.toByteArray(jU(r))}function Tp(r,e,t,n){let i;for(i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function Yr(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function lg(r){return r!==r}var KU=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i<16;++i)e[n+i]=r[t]+r[i]}return e}();function Di(r){return typeof BigInt>"u"?GU:r}function GU(){throw new Error("BigInt not supported")}});var x3=re(pg=>{"use strict";pg.toString=function(r){switch(r){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+r};pg.toType=function(r){switch(r.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return r.toUpperCase().startsWith("UNKNOWN_")?parseInt(r.slice(8)):0}});var y3=re(dg=>{"use strict";dg.toString=function(r){switch(r){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+r};dg.toRcode=function(r){switch(r.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var w3=re(fg=>{"use strict";fg.toString=function(r){switch(r){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+r};fg.toOpcode=function(r){switch(r.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var b3=re(hg=>{"use strict";hg.toString=function(r){switch(r){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+r};hg.toClass=function(r){switch(r.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var v3=re(mg=>{"use strict";mg.toString=function(r){switch(r){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return r<0?null:`OPTION_${r}`};mg.toCode=function(r){if(typeof r=="number")return r;if(!r)return-1;switch(r.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let e=r.match(/_(\d+)$/);return e?parseInt(e[1],10):-1}});var S3=re((A3,gg)=>{var E3=function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.decode=p,r.encode=l,r.familyOf=u,r.name=void 0,r.sizeOf=c,r.v6=r.v4=void 0;let e=/^(\d{1,3}\.){3,3}\d{1,3}$/,t=4,n=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,i=16,o={name:"v4",size:t,isFormat:m=>e.test(m),encode(m,d,f){f=~~f,d=d||new Uint8Array(f+t);let h=m.length,x=0;for(let g=0;g<h;){let w=m.charCodeAt(g++);w===46?(d[f++]=x,x=0):x=x*10+(w-48)}return d[f]=x,d},decode(m,d){return d=~~d,`${m[d++]}.${m[d++]}.${m[d++]}.${m[d]}`}};r.v4=o;let s={name:"v6",size:i,isFormat:m=>m.length>0&&n.test(m),encode(m,d,f){f=~~f;let h=f+i,x=-1,g=0,w=0,y=!0,E=!1;d=d||new Uint8Array(f+i);for(let B=0;B<m.length;B++){let S=m.charCodeAt(B);S===58?(y?x!==-1?(f<h&&(d[f]=0),f<h-1&&(d[f+1]=0),f+=2):f<h&&(x=f):(E===!0?(f<h&&(d[f]=w),f++):(f<h&&(d[f]=g>>8),f<h-1&&(d[f+1]=g&255),f+=2),g=0,w=0),y=!0,E=!1):S===46?(f<h&&(d[f]=w),f++,w=0,g=0,y=!1,E=!0):(y=!1,S>=97?S-=87:S>=65?S-=55:(S-=48,w=w*10+S),g=(g<<4)+S)}if(y===!1)E===!0?(f<h&&(d[f]=w),f++):(f<h&&(d[f]=g>>8),f<h-1&&(d[f+1]=g&255),f+=2);else if(x===0)f<h&&(d[f]=0),f<h-1&&(d[f+1]=0),f+=2;else if(x!==-1){f+=2;for(let B=Math.min(f-1,h-1);B>=x+2;B--)d[B]=d[B-2];d[x]=0,d[x+1]=0,x=f}if(x!==f&&x!==-1)for(f>h-2&&(f=h-2);h>x;)d[--h]=f<h&&f>x?d[--f]:0;else for(;f<h;)d[f++]=0;return d},decode(m,d){d=~~d;let f="";for(let h=0;h<i;h+=2)h!==0&&(f+=":"),f+=(m[d+h]<<8|m[d+h+1]).toString(16);return f.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};r.v6=s;let a="ip";r.name=a;function c(m){if(o.isFormat(m))return o.size;if(s.isFormat(m))return s.size;throw Error(`Invalid ip address: ${m}`)}function u(m){return c(m)===o.size?1:2}function l(m,d,f){f=~~f;let h=c(m);return typeof d=="function"&&(d=d(f+h)),h===o.size?o.encode(m,d,f):s.encode(m,d,f)}function p(m,d,f){if(d=~~d,f=f||m.length-d,f===o.size)return o.decode(m,d,f);if(f===s.size)return s.decode(m,d,f);throw Error(`Invalid buffer size needs to be ${o.size} for v4 or ${s.size} for v6.`)}return"default"in r?r.default:r}({});typeof define=="function"&&define.amd?define([],function(){return E3}):typeof gg=="object"&&typeof A3=="object"&&(gg.exports=E3)});var I3=re(G=>{"use strict";var W=ug().Buffer,Gn=x3(),WU=y3(),YU=w3(),Rp=b3(),xg=v3(),vo=S3(),XU=0,B3=32768,yg=32768,JU=~yg,k3=32768,ZU=~k3,V=G.name={};V.encode=function(r,e,t,{mail:n=!1}={}){e||(e=W.alloc(V.encodingLength(r))),t||(t=0);let i=t,o=r.replace(/^\.|\.$/gm,"");if(o.length){let s=[];if(n){let a="";o.split(".").forEach(c=>{c.endsWith("\\")?a+=(a.length?".":"")+c.slice(0,-1):s.length===0&&a.length?s.push(a+"."+c):s.push(c)})}else s=o.split(".");for(let a=0;a<s.length;a++){let c=e.write(s[a],t+1);e[t]=c,t+=c+1}}return e[t++]=0,V.encode.bytes=t-i,e};V.encode.bytes=0;V.decode=function(r,e,{mail:t=!1}={}){e||(e=0);let n=[],i=e,o=0,s=0,a=!1;for(;;){if(e>=r.length)throw new Error("Cannot decode name (buffer overflow)");let c=r[e++];if(s+=a?0:1,c===0)break;if(c&192)if((c&192)===192){if(e+1>r.length)throw new Error("Cannot decode name (buffer overflow)");let u=r.readUInt16BE(e-1)-49152;if(u>=i)throw new Error("Cannot decode name (bad pointer)");e=u,i=u,s+=a?0:1,a=!0}else throw new Error("Cannot decode name (bad label)");else{if(e+c>r.length)throw new Error("Cannot decode name (buffer overflow)");if(o+=c+1,o>254)throw new Error("Cannot decode name (name too long)");let u=r.toString("utf-8",e,e+c);t&&(u=u.replace(/\./g,"\\.")),n.push(u),e+=c,s+=a?0:c}}return V.decode.bytes=s,n.length===0?".":n.join(".")};V.decode.bytes=0;V.encodingLength=function(r){return r==="."||r===".."?1:W.byteLength(r.replace(/^\.|\.$/gm,""))+2};var se={};se.encode=function(r,e,t){e||(e=W.alloc(se.encodingLength(r))),t||(t=0);let n=e.write(r,t+1);return e[t]=n,se.encode.bytes=n+1,e};se.encode.bytes=0;se.decode=function(r,e){e||(e=0);let t=r[e],n=r.toString("utf-8",e+1,e+1+t);return se.decode.bytes=t+1,n};se.decode.bytes=0;se.encodingLength=function(r){return W.byteLength(r)+1};var Ir={};Ir.encode=function(r,e,t){e||(e=Ir.encodingLength(r)),t||(t=0);let n=(r.flags||0)&32767,i=r.type==="response"?B3:XU;return e.writeUInt16BE(r.id||0,t),e.writeUInt16BE(n|i,t+2),e.writeUInt16BE(r.questions.length,t+4),e.writeUInt16BE(r.answers.length,t+6),e.writeUInt16BE(r.authorities.length,t+8),e.writeUInt16BE(r.additionals.length,t+10),e};Ir.encode.bytes=12;Ir.decode=function(r,e){if(e||(e=0),r.length<12)throw new Error("Header must be 12 bytes");let t=r.readUInt16BE(e+2);return{id:r.readUInt16BE(e),type:t&B3?"response":"query",flags:t&32767,flag_qr:(t>>15&1)===1,opcode:YU.toString(t>>11&15),flag_aa:(t>>10&1)===1,flag_tc:(t>>9&1)===1,flag_rd:(t>>8&1)===1,flag_ra:(t>>7&1)===1,flag_z:(t>>6&1)===1,flag_ad:(t>>5&1)===1,flag_cd:(t>>4&1)===1,rcode:WU.toString(t&15),questions:new Array(r.readUInt16BE(e+4)),answers:new Array(r.readUInt16BE(e+6)),authorities:new Array(r.readUInt16BE(e+8)),additionals:new Array(r.readUInt16BE(e+10))}};Ir.decode.bytes=12;Ir.encodingLength=function(){return 12};var Fn=G.unknown={};Fn.encode=function(r,e,t){return e||(e=W.alloc(Fn.encodingLength(r))),t||(t=0),e.writeUInt16BE(r.length,t),r.copy(e,t+2),Fn.encode.bytes=r.length+2,e};Fn.encode.bytes=0;Fn.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n=r.slice(e+2,e+2+t);return Fn.decode.bytes=t+2,n};Fn.decode.bytes=0;Fn.encodingLength=function(r){return r.length+2};var zn=G.ns={};zn.encode=function(r,e,t){return e||(e=W.alloc(zn.encodingLength(r))),t||(t=0),V.encode(r,e,t+2),e.writeUInt16BE(V.encode.bytes,t),zn.encode.bytes=V.encode.bytes+2,e};zn.encode.bytes=0;zn.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n=V.decode(r,e+2);return zn.decode.bytes=t+2,n};zn.decode.bytes=0;zn.encodingLength=function(r){return V.encodingLength(r)+2};var Vn=G.soa={};Vn.encode=function(r,e,t){e||(e=W.alloc(Vn.encodingLength(r))),t||(t=0);let n=t;return t+=2,V.encode(r.mname,e,t),t+=V.encode.bytes,V.encode(r.rname,e,t,{mail:!0}),t+=V.encode.bytes,e.writeUInt32BE(r.serial||0,t),t+=4,e.writeUInt32BE(r.refresh||0,t),t+=4,e.writeUInt32BE(r.retry||0,t),t+=4,e.writeUInt32BE(r.expire||0,t),t+=4,e.writeUInt32BE(r.minimum||0,t),t+=4,e.writeUInt16BE(t-n-2,n),Vn.encode.bytes=t-n,e};Vn.encode.bytes=0;Vn.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.mname=V.decode(r,e),e+=V.decode.bytes,n.rname=V.decode(r,e,{mail:!0}),e+=V.decode.bytes,n.serial=r.readUInt32BE(e),e+=4,n.refresh=r.readUInt32BE(e),e+=4,n.retry=r.readUInt32BE(e),e+=4,n.expire=r.readUInt32BE(e),e+=4,n.minimum=r.readUInt32BE(e),e+=4,Vn.decode.bytes=e-t,n};Vn.decode.bytes=0;Vn.encodingLength=function(r){return 22+V.encodingLength(r.mname)+V.encodingLength(r.rname)};var Mn=G.txt={};Mn.encode=function(r,e,t){Array.isArray(r)||(r=[r]);for(let i=0;i<r.length;i++)if(typeof r[i]=="string"&&(r[i]=W.from(r[i])),!W.isBuffer(r[i]))throw new Error("Must be a Buffer");e||(e=W.alloc(Mn.encodingLength(r))),t||(t=0);let n=t;return t+=2,r.forEach(function(i){e[t++]=i.length,i.copy(e,t,0,i.length),t+=i.length}),e.writeUInt16BE(t-n-2,n),Mn.encode.bytes=t-n,e};Mn.encode.bytes=0;Mn.decode=function(r,e){e||(e=0);let t=e,n=r.readUInt16BE(e);e+=2;let i=[];for(;n>0;){let o=r[e++];if(--n,n<o)throw new Error("Buffer overflow");i.push(r.slice(e,e+o)),e+=o,n-=o}return Mn.decode.bytes=e-t,i};Mn.decode.bytes=0;Mn.encodingLength=function(r){Array.isArray(r)||(r=[r]);let e=2;return r.forEach(function(t){typeof t=="string"?e+=W.byteLength(t)+1:e+=t.length+1}),e};var $n=G.null={};$n.encode=function(r,e,t){e||(e=W.alloc($n.encodingLength(r))),t||(t=0),typeof r=="string"&&(r=W.from(r)),r||(r=W.alloc(0));let n=t;t+=2;let i=r.length;return r.copy(e,t,0,i),t+=i,e.writeUInt16BE(t-n-2,n),$n.encode.bytes=t-n,e};$n.encode.bytes=0;$n.decode=function(r,e){e||(e=0);let t=e,n=r.readUInt16BE(e);e+=2;let i=r.slice(e,e+n);return e+=n,$n.decode.bytes=e-t,i};$n.decode.bytes=0;$n.encodingLength=function(r){return r?(W.isBuffer(r)?r.length:W.byteLength(r))+2:2};var jn=G.hinfo={};jn.encode=function(r,e,t){e||(e=W.alloc(jn.encodingLength(r))),t||(t=0);let n=t;return t+=2,se.encode(r.cpu,e,t),t+=se.encode.bytes,se.encode(r.os,e,t),t+=se.encode.bytes,e.writeUInt16BE(t-n-2,n),jn.encode.bytes=t-n,e};jn.encode.bytes=0;jn.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.cpu=se.decode(r,e),e+=se.decode.bytes,n.os=se.decode(r,e),e+=se.decode.bytes,jn.decode.bytes=e-t,n};jn.decode.bytes=0;jn.encodingLength=function(r){return se.encodingLength(r.cpu)+se.encodingLength(r.os)+2};var Br=G.ptr={},QU=G.cname=Br,eN=G.dname=Br;Br.encode=function(r,e,t){return e||(e=W.alloc(Br.encodingLength(r))),t||(t=0),V.encode(r,e,t+2),e.writeUInt16BE(V.encode.bytes,t),Br.encode.bytes=V.encode.bytes+2,e};Br.encode.bytes=0;Br.decode=function(r,e){e||(e=0);let t=V.decode(r,e+2);return Br.decode.bytes=V.decode.bytes+2,t};Br.decode.bytes=0;Br.encodingLength=function(r){return V.encodingLength(r)+2};var Hn=G.srv={};Hn.encode=function(r,e,t){e||(e=W.alloc(Hn.encodingLength(r))),t||(t=0),e.writeUInt16BE(r.priority||0,t+2),e.writeUInt16BE(r.weight||0,t+4),e.writeUInt16BE(r.port||0,t+6),V.encode(r.target,e,t+8);let n=V.encode.bytes+6;return e.writeUInt16BE(n,t),Hn.encode.bytes=n+2,e};Hn.encode.bytes=0;Hn.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n={};return n.priority=r.readUInt16BE(e+2),n.weight=r.readUInt16BE(e+4),n.port=r.readUInt16BE(e+6),n.target=V.decode(r,e+8),Hn.decode.bytes=t+2,n};Hn.decode.bytes=0;Hn.encodingLength=function(r){return 8+V.encodingLength(r.target)};var Wt=G.caa={};Wt.ISSUER_CRITICAL=128;Wt.encode=function(r,e,t){let n=Wt.encodingLength(r);return e||(e=W.alloc(Wt.encodingLength(r))),t||(t=0),r.issuerCritical&&(r.flags=Wt.ISSUER_CRITICAL),e.writeUInt16BE(n-2,t),t+=2,e.writeUInt8(r.flags||0,t),t+=1,se.encode(r.tag,e,t),t+=se.encode.bytes,e.write(r.value,t),t+=W.byteLength(r.value),Wt.encode.bytes=n,e};Wt.encode.bytes=0;Wt.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e);e+=2;let n=e,i={};return i.flags=r.readUInt8(e),e+=1,i.tag=se.decode(r,e),e+=se.decode.bytes,i.value=r.toString("utf-8",e,n+t),i.issuerCritical=!!(i.flags&Wt.ISSUER_CRITICAL),Wt.decode.bytes=t+2,i};Wt.decode.bytes=0;Wt.encodingLength=function(r){return se.encodingLength(r.tag)+se.encodingLength(r.value)+2};var Li=G.mx={};Li.encode=function(r,e,t){e||(e=W.alloc(Li.encodingLength(r))),t||(t=0);let n=t;return t+=2,e.writeUInt16BE(r.preference||0,t),t+=2,V.encode(r.exchange,e,t),t+=V.encode.bytes,e.writeUInt16BE(t-n-2,n),Li.encode.bytes=t-n,e};Li.encode.bytes=0;Li.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.preference=r.readUInt16BE(e),e+=2,n.exchange=V.decode(r,e),e+=V.decode.bytes,Li.decode.bytes=e-t,n};Li.encodingLength=function(r){return 4+V.encodingLength(r.exchange)};var qn=G.a={};qn.encode=function(r,e,t){return e||(e=W.alloc(qn.encodingLength(r))),t||(t=0),e.writeUInt16BE(4,t),t+=2,vo.v4.encode(r,e,t),qn.encode.bytes=6,e};qn.encode.bytes=0;qn.decode=function(r,e){e||(e=0),e+=2;let t=vo.v4.decode(r,e);return qn.decode.bytes=6,t};qn.decode.bytes=0;qn.encodingLength=function(){return 6};var Kn=G.aaaa={};Kn.encode=function(r,e,t){return e||(e=W.alloc(Kn.encodingLength(r))),t||(t=0),e.writeUInt16BE(16,t),t+=2,vo.v6.encode(r,e,t),Kn.encode.bytes=18,e};Kn.encode.bytes=0;Kn.decode=function(r,e){e||(e=0),e+=2;let t=vo.v6.decode(r,e);return Kn.decode.bytes=18,t};Kn.decode.bytes=0;Kn.encodingLength=function(){return 18};var Lt=G.option={};Lt.encode=function(r,e,t){e||(e=W.alloc(Lt.encodingLength(r))),t||(t=0);let n=t,i=xg.toCode(r.code);if(e.writeUInt16BE(i,t),t+=2,r.data)e.writeUInt16BE(r.data.length,t),t+=2,r.data.copy(e,t),t+=r.data.length;else switch(i){case 8:let o=r.sourcePrefixLength||0,s=r.family||vo.familyOf(r.ip),a=vo.encode(r.ip,W.alloc),c=Math.ceil(o/8);e.writeUInt16BE(c+4,t),t+=2,e.writeUInt16BE(s,t),t+=2,e.writeUInt8(o,t++),e.writeUInt8(r.scopePrefixLength||0,t++),a.copy(e,t,0,c),t+=c;break;case 11:r.timeout?(e.writeUInt16BE(2,t),t+=2,e.writeUInt16BE(r.timeout,t),t+=2):(e.writeUInt16BE(0,t),t+=2);break;case 12:let u=r.length||0;e.writeUInt16BE(u,t),t+=2,e.fill(0,t,t+u),t+=u;break;case 14:let l=r.tags.length*2;e.writeUInt16BE(l,t),t+=2;for(let p of r.tags)e.writeUInt16BE(p,t),t+=2;break;default:throw new Error(`Unknown roption code: ${r.code}`)}return Lt.encode.bytes=t-n,e};Lt.encode.bytes=0;Lt.decode=function(r,e){e||(e=0);let t={};t.code=r.readUInt16BE(e),t.type=xg.toString(t.code),e+=2;let n=r.readUInt16BE(e);switch(e+=2,t.data=r.slice(e,e+n),t.code){case 8:t.family=r.readUInt16BE(e),e+=2,t.sourcePrefixLength=r.readUInt8(e++),t.scopePrefixLength=r.readUInt8(e++);let i=W.alloc(t.family===1?4:16);r.copy(i,0,e,e+n-4),t.ip=vo.decode(i);break;case 11:n>0&&(t.timeout=r.readUInt16BE(e),e+=2);break;case 14:t.tags=[];for(let o=0;o<n;o+=2)t.tags.push(r.readUInt16BE(e)),e+=2}return Lt.decode.bytes=n+4,t};Lt.decode.bytes=0;Lt.encodingLength=function(r){if(r.data)return r.data.length+4;switch(xg.toCode(r.code)){case 8:let t=r.sourcePrefixLength||0;return Math.ceil(t/8)+8;case 11:return typeof r.timeout=="number"?6:4;case 12:return r.length+4;case 14:return 4+r.tags.length*2}throw new Error(`Unknown roption code: ${r.code}`)};var Xt=G.opt={};Xt.encode=function(r,e,t){e||(e=W.alloc(Xt.encodingLength(r))),t||(t=0);let n=t,i=Ks(r,Lt);return e.writeUInt16BE(i,t),t=Tc(r,Lt,e,t+2),Xt.encode.bytes=t-n,e};Xt.encode.bytes=0;Xt.decode=function(r,e){e||(e=0);let t=e,n=[],i=r.readUInt16BE(e);e+=2;let o=0;for(;i>0;)n[o++]=Lt.decode(r,e),e+=Lt.decode.bytes,i-=Lt.decode.bytes;return Xt.decode.bytes=e-t,n};Xt.decode.bytes=0;Xt.encodingLength=function(r){return 2+Ks(r||[],Lt)};var At=G.dnskey={};At.PROTOCOL_DNSSEC=3;At.ZONE_KEY=128;At.SECURE_ENTRYPOINT=32768;At.encode=function(r,e,t){e||(e=W.alloc(At.encodingLength(r))),t||(t=0);let n=t,i=r.key;if(!W.isBuffer(i))throw new Error("Key must be a Buffer");return t+=2,e.writeUInt16BE(r.flags,t),t+=2,e.writeUInt8(At.PROTOCOL_DNSSEC,t),t+=1,e.writeUInt8(r.algorithm,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,At.encode.bytes=t-n,e.writeUInt16BE(At.encode.bytes-2,n),e};At.encode.bytes=0;At.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);if(e+=2,n.flags=r.readUInt16BE(e),e+=2,r.readUInt8(e)!==At.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return e+=1,n.algorithm=r.readUInt8(e),e+=1,n.key=r.slice(e,t+i+2),e+=n.key.length,At.decode.bytes=e-t,n};At.decode.bytes=0;At.encodingLength=function(r){return 6+W.byteLength(r.key)};var Xr=G.rrsig={};Xr.encode=function(r,e,t){e||(e=W.alloc(Xr.encodingLength(r))),t||(t=0);let n=t,i=r.signature;if(!W.isBuffer(i))throw new Error("Signature must be a Buffer");return t+=2,e.writeUInt16BE(Gn.toType(r.typeCovered),t),t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.labels,t),t+=1,e.writeUInt32BE(r.originalTTL,t),t+=4,e.writeUInt32BE(r.expiration,t),t+=4,e.writeUInt32BE(r.inception,t),t+=4,e.writeUInt16BE(r.keyTag,t),t+=2,V.encode(r.signersName,e,t),t+=V.encode.bytes,i.copy(e,t,0,i.length),t+=i.length,Xr.encode.bytes=t-n,e.writeUInt16BE(Xr.encode.bytes-2,n),e};Xr.encode.bytes=0;Xr.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.typeCovered=Gn.toString(r.readUInt16BE(e)),e+=2,n.algorithm=r.readUInt8(e),e+=1,n.labels=r.readUInt8(e),e+=1,n.originalTTL=r.readUInt32BE(e),e+=4,n.expiration=r.readUInt32BE(e),e+=4,n.inception=r.readUInt32BE(e),e+=4,n.keyTag=r.readUInt16BE(e),e+=2,n.signersName=V.decode(r,e),e+=V.decode.bytes,n.signature=r.slice(e,t+i+2),e+=n.signature.length,Xr.decode.bytes=e-t,n};Xr.decode.bytes=0;Xr.encodingLength=function(r){return 20+V.encodingLength(r.signersName)+W.byteLength(r.signature)};var Jr=G.rp={};Jr.encode=function(r,e,t){e||(e=W.alloc(Jr.encodingLength(r))),t||(t=0);let n=t;return t+=2,V.encode(r.mbox||".",e,t,{mail:!0}),t+=V.encode.bytes,V.encode(r.txt||".",e,t),t+=V.encode.bytes,Jr.encode.bytes=t-n,e.writeUInt16BE(Jr.encode.bytes-2,n),e};Jr.encode.bytes=0;Jr.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.mbox=V.decode(r,e,{mail:!0})||".",e+=V.decode.bytes,n.txt=V.decode(r,e)||".",e+=V.decode.bytes,Jr.decode.bytes=e-t,n};Jr.decode.bytes=0;Jr.encodingLength=function(r){return 2+V.encodingLength(r.mbox||".")+V.encodingLength(r.txt||".")};var et={};et.encode=function(r,e,t){e||(e=W.alloc(et.encodingLength(r))),t||(t=0);let n=t;for(var i=[],o=0;o<r.length;o++){var s=Gn.toType(r[o]);i[s>>8]===void 0&&(i[s>>8]=[]),i[s>>8][s>>3&31]|=1<<7-(s&7)}for(o=0;o<i.length;o++)if(i[o]!==void 0){var a=W.from(i[o]);e.writeUInt8(o,t),t+=1,e.writeUInt8(a.length,t),t+=1,a.copy(e,t),t+=a.length}return et.encode.bytes=t-n,e};et.encode.bytes=0;et.decode=function(r,e,t){e||(e=0);let n=e;for(var i=[];e-n<t;){var o=r.readUInt8(e);e+=1;var s=r.readUInt8(e);e+=1;for(var a=0;a<s;a++)for(var c=r.readUInt8(e+a),u=0;u<8;u++)if(c&1<<7-u){var l=Gn.toString(o<<8|a<<3|u);i.push(l)}e+=s}return et.decode.bytes=e-n,i};et.decode.bytes=0;et.encodingLength=function(r){for(var e=[],t=0;t<r.length;t++){var n=Gn.toType(r[t]);e[n>>8]=Math.max(e[n>>8]||0,n&255)}var i=0;for(t=0;t<e.length;t++)e[t]!==void 0&&(i+=2+Math.ceil((e[t]+1)/8));return i};var Zr=G.nsec={};Zr.encode=function(r,e,t){e||(e=W.alloc(Zr.encodingLength(r))),t||(t=0);let n=t;return t+=2,V.encode(r.nextDomain,e,t),t+=V.encode.bytes,et.encode(r.rrtypes,e,t),t+=et.encode.bytes,Zr.encode.bytes=t-n,e.writeUInt16BE(Zr.encode.bytes-2,n),e};Zr.encode.bytes=0;Zr.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.nextDomain=V.decode(r,e),e+=V.decode.bytes,n.rrtypes=et.decode(r,e,i-(e-t)),e+=et.decode.bytes,Zr.decode.bytes=e-t,n};Zr.decode.bytes=0;Zr.encodingLength=function(r){return 2+V.encodingLength(r.nextDomain)+et.encodingLength(r.rrtypes)};var Qr=G.nsec3={};Qr.encode=function(r,e,t){e||(e=W.alloc(Qr.encodingLength(r))),t||(t=0);let n=t,i=r.salt;if(!W.isBuffer(i))throw new Error("salt must be a Buffer");let o=r.nextDomain;if(!W.isBuffer(o))throw new Error("nextDomain must be a Buffer");return t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.flags,t),t+=1,e.writeUInt16BE(r.iterations,t),t+=2,e.writeUInt8(i.length,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,e.writeUInt8(o.length,t),t+=1,o.copy(e,t,0,o.length),t+=o.length,et.encode(r.rrtypes,e,t),t+=et.encode.bytes,Qr.encode.bytes=t-n,e.writeUInt16BE(Qr.encode.bytes-2,n),e};Qr.encode.bytes=0;Qr.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);e+=2,n.algorithm=r.readUInt8(e),e+=1,n.flags=r.readUInt8(e),e+=1,n.iterations=r.readUInt16BE(e),e+=2;let o=r.readUInt8(e);e+=1,n.salt=r.slice(e,e+o),e+=o;let s=r.readUInt8(e);return e+=1,n.nextDomain=r.slice(e,e+s),e+=s,n.rrtypes=et.decode(r,e,i-(e-t)),e+=et.decode.bytes,Qr.decode.bytes=e-t,n};Qr.decode.bytes=0;Qr.encodingLength=function(r){return 8+r.salt.length+r.nextDomain.length+et.encodingLength(r.rrtypes)};var en=G.ds={};en.encode=function(r,e,t){e||(e=W.alloc(en.encodingLength(r))),t||(t=0);let n=t,i=r.digest;if(!W.isBuffer(i))throw new Error("Digest must be a Buffer");return t+=2,e.writeUInt16BE(r.keyTag,t),t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.digestType,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,en.encode.bytes=t-n,e.writeUInt16BE(en.encode.bytes-2,n),e};en.encode.bytes=0;en.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.keyTag=r.readUInt16BE(e),e+=2,n.algorithm=r.readUInt8(e),e+=1,n.digestType=r.readUInt8(e),e+=1,n.digest=r.slice(e,t+i+2),e+=n.digest.length,en.decode.bytes=e-t,n};en.decode.bytes=0;en.encodingLength=function(r){return 6+W.byteLength(r.digest)};var Yt=G.sshfp={};Yt.getFingerprintLengthForHashType=function(e){switch(e){case 1:return 20;case 2:return 32}};Yt.encode=function(e,t,n){t||(t=W.alloc(Yt.encodingLength(e))),n||(n=0);let i=n;n+=2,t[n]=e.algorithm,n+=1,t[n]=e.hash,n+=1;let o=W.from(e.fingerprint.toUpperCase(),"hex");if(o.length!==Yt.getFingerprintLengthForHashType(e.hash))throw new Error("Invalid fingerprint length");return o.copy(t,n),n+=o.byteLength,Yt.encode.bytes=n-i,t.writeUInt16BE(Yt.encode.bytes-2,i),t};Yt.encode.bytes=0;Yt.decode=function(e,t){t||(t=0);let n=t,i={};t+=2,i.algorithm=e[t],t+=1,i.hash=e[t],t+=1;let o=Yt.getFingerprintLengthForHashType(i.hash);return i.fingerprint=e.slice(t,t+o).toString("hex").toUpperCase(),t+=o,Yt.decode.bytes=t-n,i};Yt.decode.bytes=0;Yt.encodingLength=function(r){return 4+W.from(r.fingerprint,"hex").byteLength};var tn=G.naptr={};tn.encode=function(r,e,t){e||(e=W.alloc(tn.encodingLength(r))),t||(t=0);let n=t;return t+=2,e.writeUInt16BE(r.order||0,t),t+=2,e.writeUInt16BE(r.preference||0,t),t+=2,se.encode(r.flags,e,t),t+=se.encode.bytes,se.encode(r.services,e,t),t+=se.encode.bytes,se.encode(r.regexp,e,t),t+=se.encode.bytes,V.encode(r.replacement,e,t),t+=V.encode.bytes,tn.encode.bytes=t-n,e.writeUInt16BE(tn.encode.bytes-2,n),e};tn.encode.bytes=0;tn.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.order=r.readUInt16BE(e),e+=2,n.preference=r.readUInt16BE(e),e+=2,n.flags=se.decode(r,e),e+=se.decode.bytes,n.services=se.decode(r,e),e+=se.decode.bytes,n.regexp=se.decode(r,e),e+=se.decode.bytes,n.replacement=V.decode(r,e),e+=V.decode.bytes,tn.decode.bytes=e-t,n};tn.decode.bytes=0;tn.encodingLength=function(r){return se.encodingLength(r.flags)+se.encodingLength(r.services)+se.encodingLength(r.regexp)+V.encodingLength(r.replacement)+6};var rn=G.tlsa={};rn.encode=function(r,e,t){e||(e=W.alloc(rn.encodingLength(r))),t||(t=0);let n=t,i=r.certificate;if(!W.isBuffer(i))throw new Error("Certificate must be a Buffer");return t+=2,e.writeUInt8(r.usage,t),t+=1,e.writeUInt8(r.selector,t),t+=1,e.writeUInt8(r.matchingType,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,rn.encode.bytes=t-n,e.writeUInt16BE(rn.encode.bytes-2,n),e};rn.encode.bytes=0;rn.decode=function(r,e){e||(e=0);let t=e,n={},i=r.readUInt16BE(e);return e+=2,n.usage=r.readUInt8(e),e+=1,n.selector=r.readUInt8(e),e+=1,n.matchingType=r.readUInt8(e),e+=1,n.certificate=r.slice(e,t+i+2),e+=n.certificate.length,rn.decode.bytes=e-t,n};rn.decode.bytes=0;rn.encodingLength=function(r){return 5+W.byteLength(r.certificate)};var wg=G.record=function(r){switch(r.toUpperCase()){case"A":return qn;case"PTR":return Br;case"CNAME":return QU;case"DNAME":return eN;case"TXT":return Mn;case"NULL":return $n;case"AAAA":return Kn;case"SRV":return Hn;case"HINFO":return jn;case"CAA":return Wt;case"NS":return zn;case"SOA":return Vn;case"MX":return Li;case"OPT":return Xt;case"DNSKEY":return At;case"RRSIG":return Xr;case"RP":return Jr;case"NSEC":return Zr;case"NSEC3":return Qr;case"SSHFP":return Yt;case"DS":return en;case"NAPTR":return tn;case"TLSA":return rn}return Fn},ct=G.answer={};ct.encode=function(r,e,t){e||(e=W.alloc(ct.encodingLength(r))),t||(t=0);let n=t;if(V.encode(r.name,e,t),t+=V.encode.bytes,e.writeUInt16BE(Gn.toType(r.type),t),r.type.toUpperCase()==="OPT"){if(r.name!==".")throw new Error("OPT name must be root.");e.writeUInt16BE(r.udpPayloadSize||4096,t+2),e.writeUInt8(r.extendedRcode||0,t+4),e.writeUInt8(r.ednsVersion||0,t+5),e.writeUInt16BE(r.flags||0,t+6),t+=8,Xt.encode(r.options||[],e,t),t+=Xt.encode.bytes}else{let i=Rp.toClass(r.class===void 0?"IN":r.class);r.flush&&(i|=yg),e.writeUInt16BE(i,t+2),e.writeUInt32BE(r.ttl||0,t+4),t+=8;let o=wg(r.type);o.encode(r.data,e,t),t+=o.encode.bytes}return ct.encode.bytes=t-n,e};ct.encode.bytes=0;ct.decode=function(r,e){e||(e=0);let t={},n=e;if(t.name=V.decode(r,e),e+=V.decode.bytes,t.type=Gn.toString(r.readUInt16BE(e)),t.type==="OPT")t.udpPayloadSize=r.readUInt16BE(e+2),t.extendedRcode=r.readUInt8(e+4),t.ednsVersion=r.readUInt8(e+5),t.flags=r.readUInt16BE(e+6),t.flag_do=(t.flags>>15&1)===1,t.options=Xt.decode(r,e+8),e+=8+Xt.decode.bytes;else{let i=r.readUInt16BE(e+2);t.ttl=r.readUInt32BE(e+4),t.class=Rp.toString(i&JU),t.flush=!!(i&yg);let o=wg(t.type);t.data=o.decode(r,e+8),e+=8+o.decode.bytes}return ct.decode.bytes=e-n,t};ct.decode.bytes=0;ct.encodingLength=function(r){let e=r.data!==null&&r.data!==void 0?r.data:r.options;return V.encodingLength(r.name)+8+wg(r.type).encodingLength(e)};var kr=G.question={};kr.encode=function(r,e,t){e||(e=W.alloc(kr.encodingLength(r))),t||(t=0);let n=t;return V.encode(r.name,e,t),t+=V.encode.bytes,e.writeUInt16BE(Gn.toType(r.type),t),t+=2,e.writeUInt16BE(Rp.toClass(r.class===void 0?"IN":r.class),t),t+=2,kr.encode.bytes=t-n,r};kr.encode.bytes=0;kr.decode=function(r,e){e||(e=0);let t=e,n={};return n.name=V.decode(r,e),e+=V.decode.bytes,n.type=Gn.toString(r.readUInt16BE(e)),e+=2,n.class=Rp.toString(r.readUInt16BE(e)),e+=2,!!(n.class&k3)&&(n.class&=ZU),kr.decode.bytes=e-t,n};kr.decode.bytes=0;kr.encodingLength=function(r){return V.encodingLength(r.name)+4};G.AUTHORITATIVE_ANSWER=1024;G.TRUNCATED_RESPONSE=512;G.RECURSION_DESIRED=256;G.RECURSION_AVAILABLE=128;G.AUTHENTIC_DATA=32;G.CHECKING_DISABLED=16;G.DNSSEC_OK=32768;G.encode=function(r,e,t){let n=!e;n&&(e=W.alloc(G.encodingLength(r))),t||(t=0);let i=t;return r.questions||(r.questions=[]),r.answers||(r.answers=[]),r.authorities||(r.authorities=[]),r.additionals||(r.additionals=[]),Ir.encode(r,e,t),t+=Ir.encode.bytes,t=Tc(r.questions,kr,e,t),t=Tc(r.answers,ct,e,t),t=Tc(r.authorities,ct,e,t),t=Tc(r.additionals,ct,e,t),G.encode.bytes=t-i,n&&G.encode.bytes!==e.length?e.slice(0,G.encode.bytes):e};G.encode.bytes=0;G.decode=function(r,e){e||(e=0);let t=e,n=Ir.decode(r,e);return e+=Ir.decode.bytes,e=Cp(n.questions,kr,r,e),e=Cp(n.answers,ct,r,e),e=Cp(n.authorities,ct,r,e),e=Cp(n.additionals,ct,r,e),G.decode.bytes=e-t,n};G.decode.bytes=0;G.encodingLength=function(r){return Ir.encodingLength(r)+Ks(r.questions||[],kr)+Ks(r.answers||[],ct)+Ks(r.authorities||[],ct)+Ks(r.additionals||[],ct)};G.streamEncode=function(r){let e=G.encode(r),t=W.alloc(2);t.writeUInt16BE(e.byteLength);let n=W.concat([t,e]);return G.streamEncode.bytes=n.byteLength,n};G.streamEncode.bytes=0;G.streamDecode=function(r){let e=r.readUInt16BE(0);if(r.byteLength<e+2)return null;let t=G.decode(r.slice(2));return G.streamDecode.bytes=G.decode.bytes,t};G.streamDecode.bytes=0;function Ks(r,e){let t=0;for(let n=0;n<r.length;n++)t+=e.encodingLength(r[n]);return t}function Tc(r,e,t,n){for(let i=0;i<r.length;i++)e.encode(r[i],t,n),n+=e.encode.bytes;return n}function Cp(r,e,t,n){for(let i=0;i<r.length;i++)r[i]=e.decode(t,n),n+=e.decode.bytes;return n}});var z3=re((Pc,Dp)=>{(function(r,e){"use strict";var t={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function n(d){if(!Array.isArray(d)&&!ArrayBuffer.isView(d))return!1;for(var f=0;f<d.length;f++)if(!Number.isInteger(d[f])||d[f]<0||d[f]>255)return!1;return!0}function i(d,f){return(d&65535)*f+(((d>>>16)*f&65535)<<16)}function o(d,f){return d<<f|d>>>32-f}function s(d){return d^=d>>>16,d=i(d,2246822507),d^=d>>>13,d=i(d,3266489909),d^=d>>>16,d}function a(d,f){d=[d[0]>>>16,d[0]&65535,d[1]>>>16,d[1]&65535],f=[f[0]>>>16,f[0]&65535,f[1]>>>16,f[1]&65535];var h=[0,0,0,0];return h[3]+=d[3]+f[3],h[2]+=h[3]>>>16,h[3]&=65535,h[2]+=d[2]+f[2],h[1]+=h[2]>>>16,h[2]&=65535,h[1]+=d[1]+f[1],h[0]+=h[1]>>>16,h[1]&=65535,h[0]+=d[0]+f[0],h[0]&=65535,[h[0]<<16|h[1],h[2]<<16|h[3]]}function c(d,f){d=[d[0]>>>16,d[0]&65535,d[1]>>>16,d[1]&65535],f=[f[0]>>>16,f[0]&65535,f[1]>>>16,f[1]&65535];var h=[0,0,0,0];return h[3]+=d[3]*f[3],h[2]+=h[3]>>>16,h[3]&=65535,h[2]+=d[2]*f[3],h[1]+=h[2]>>>16,h[2]&=65535,h[2]+=d[3]*f[2],h[1]+=h[2]>>>16,h[2]&=65535,h[1]+=d[1]*f[3],h[0]+=h[1]>>>16,h[1]&=65535,h[1]+=d[2]*f[2],h[0]+=h[1]>>>16,h[1]&=65535,h[1]+=d[3]*f[1],h[0]+=h[1]>>>16,h[1]&=65535,h[0]+=d[0]*f[3]+d[1]*f[2]+d[2]*f[1]+d[3]*f[0],h[0]&=65535,[h[0]<<16|h[1],h[2]<<16|h[3]]}function u(d,f){return f%=64,f===32?[d[1],d[0]]:f<32?[d[0]<<f|d[1]>>>32-f,d[1]<<f|d[0]>>>32-f]:(f-=32,[d[1]<<f|d[0]>>>32-f,d[0]<<f|d[1]>>>32-f])}function l(d,f){return f%=64,f===0?d:f<32?[d[0]<<f|d[1]>>>32-f,d[1]<<f]:[d[1]<<f-32,0]}function p(d,f){return[d[0]^f[0],d[1]^f[1]]}function m(d){return d=p(d,[0,d[0]>>>1]),d=c(d,[4283543511,3981806797]),d=p(d,[0,d[0]>>>1]),d=c(d,[3301882366,444984403]),d=p(d,[0,d[0]>>>1]),d}t.x86.hash32=function(d,f){if(t.inputValidation&&!n(d))return e;f=f||0;for(var h=d.length%4,x=d.length-h,g=f,w=0,y=3432918353,E=461845907,B=0;B<x;B=B+4)w=d[B]|d[B+1]<<8|d[B+2]<<16|d[B+3]<<24,w=i(w,y),w=o(w,15),w=i(w,E),g^=w,g=o(g,13),g=i(g,5)+3864292196;switch(w=0,h){case 3:w^=d[B+2]<<16;case 2:w^=d[B+1]<<8;case 1:w^=d[B],w=i(w,y),w=o(w,15),w=i(w,E),g^=w}return g^=d.length,g=s(g),g>>>0},t.x86.hash128=function(d,f){if(t.inputValidation&&!n(d))return e;f=f||0;for(var h=d.length%16,x=d.length-h,g=f,w=f,y=f,E=f,B=0,S=0,b=0,v=0,k=597399067,U=2869860233,R=951274213,M=2716044179,L=0;L<x;L=L+16)B=d[L]|d[L+1]<<8|d[L+2]<<16|d[L+3]<<24,S=d[L+4]|d[L+5]<<8|d[L+6]<<16|d[L+7]<<24,b=d[L+8]|d[L+9]<<8|d[L+10]<<16|d[L+11]<<24,v=d[L+12]|d[L+13]<<8|d[L+14]<<16|d[L+15]<<24,B=i(B,k),B=o(B,15),B=i(B,U),g^=B,g=o(g,19),g+=w,g=i(g,5)+1444728091,S=i(S,U),S=o(S,16),S=i(S,R),w^=S,w=o(w,17),w+=y,w=i(w,5)+197830471,b=i(b,R),b=o(b,17),b=i(b,M),y^=b,y=o(y,15),y+=E,y=i(y,5)+2530024501,v=i(v,M),v=o(v,18),v=i(v,k),E^=v,E=o(E,13),E+=g,E=i(E,5)+850148119;switch(B=0,S=0,b=0,v=0,h){case 15:v^=d[L+14]<<16;case 14:v^=d[L+13]<<8;case 13:v^=d[L+12],v=i(v,M),v=o(v,18),v=i(v,k),E^=v;case 12:b^=d[L+11]<<24;case 11:b^=d[L+10]<<16;case 10:b^=d[L+9]<<8;case 9:b^=d[L+8],b=i(b,R),b=o(b,17),b=i(b,M),y^=b;case 8:S^=d[L+7]<<24;case 7:S^=d[L+6]<<16;case 6:S^=d[L+5]<<8;case 5:S^=d[L+4],S=i(S,U),S=o(S,16),S=i(S,R),w^=S;case 4:B^=d[L+3]<<24;case 3:B^=d[L+2]<<16;case 2:B^=d[L+1]<<8;case 1:B^=d[L],B=i(B,k),B=o(B,15),B=i(B,U),g^=B}return g^=d.length,w^=d.length,y^=d.length,E^=d.length,g+=w,g+=y,g+=E,w+=g,y+=g,E+=g,g=s(g),w=s(w),y=s(y),E=s(E),g+=w,g+=y,g+=E,w+=g,y+=g,E+=g,("00000000"+(g>>>0).toString(16)).slice(-8)+("00000000"+(w>>>0).toString(16)).slice(-8)+("00000000"+(y>>>0).toString(16)).slice(-8)+("00000000"+(E>>>0).toString(16)).slice(-8)},t.x64.hash128=function(d,f){if(t.inputValidation&&!n(d))return e;f=f||0;for(var h=d.length%16,x=d.length-h,g=[0,f],w=[0,f],y=[0,0],E=[0,0],B=[2277735313,289559509],S=[1291169091,658871167],b=0;b<x;b=b+16)y=[d[b+4]|d[b+5]<<8|d[b+6]<<16|d[b+7]<<24,d[b]|d[b+1]<<8|d[b+2]<<16|d[b+3]<<24],E=[d[b+12]|d[b+13]<<8|d[b+14]<<16|d[b+15]<<24,d[b+8]|d[b+9]<<8|d[b+10]<<16|d[b+11]<<24],y=c(y,B),y=u(y,31),y=c(y,S),g=p(g,y),g=u(g,27),g=a(g,w),g=a(c(g,[0,5]),[0,1390208809]),E=c(E,S),E=u(E,33),E=c(E,B),w=p(w,E),w=u(w,31),w=a(w,g),w=a(c(w,[0,5]),[0,944331445]);switch(y=[0,0],E=[0,0],h){case 15:E=p(E,l([0,d[b+14]],48));case 14:E=p(E,l([0,d[b+13]],40));case 13:E=p(E,l([0,d[b+12]],32));case 12:E=p(E,l([0,d[b+11]],24));case 11:E=p(E,l([0,d[b+10]],16));case 10:E=p(E,l([0,d[b+9]],8));case 9:E=p(E,[0,d[b+8]]),E=c(E,S),E=u(E,33),E=c(E,B),w=p(w,E);case 8:y=p(y,l([0,d[b+7]],56));case 7:y=p(y,l([0,d[b+6]],48));case 6:y=p(y,l([0,d[b+5]],40));case 5:y=p(y,l([0,d[b+4]],32));case 4:y=p(y,l([0,d[b+3]],24));case 3:y=p(y,l([0,d[b+2]],16));case 2:y=p(y,l([0,d[b+1]],8));case 1:y=p(y,[0,d[b]]),y=c(y,B),y=u(y,31),y=c(y,S),g=p(g,y)}return g=p(g,[0,d.length]),w=p(w,[0,d.length]),g=a(g,w),w=a(w,g),g=m(g),w=m(w),g=a(g,w),w=a(w,g),("00000000"+(g[0]>>>0).toString(16)).slice(-8)+("00000000"+(g[1]>>>0).toString(16)).slice(-8)+("00000000"+(w[0]>>>0).toString(16)).slice(-8)+("00000000"+(w[1]>>>0).toString(16)).slice(-8)},typeof Pc<"u"?(typeof Dp<"u"&&Dp.exports&&(Pc=Dp.exports=t),Pc.murmurHash3=t):typeof define=="function"&&define.amd?define([],function(){return t}):(t._murmurHash3=r.murmurHash3,t.noConflict=function(){return r.murmurHash3=t._murmurHash3,t._murmurHash3=e,t.noConflict=e,t},r.murmurHash3=t)})(Pc)});var M3=re((AQ,V3)=>{V3.exports=z3()});var Pp=re((CQ,j3)=>{"use strict";j3.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(e,t){let n=this._internalPositionFor(e,!1);if(t===void 0)n!==-1&&(this._unsetInternalPos(n),this._unsetBit(e),this._changedLength=!0,this._changedData=!0);else{let i=!1;n===-1?(n=this._data.length,this._setBit(e),this._changedData=!0):i=!0,this._setInternalPos(n,e,t,i),this._changedLength=!0}}unset(e){this.set(e,void 0)}get(e){this._sortData();let t=this._internalPositionFor(e,!0);if(t!==-1)return this._data[t][1]}push(e){return this.set(this.length,e),this.length}get length(){if(this._sortData(),this._changedLength){let e=this._data[this._data.length-1];this._length=e?e[0]+1:0,this._changedLength=!1}return this._length}forEach(e){let t=0;for(;t<this.length;)e(this.get(t),t,this),t++}map(e){let t=0,n=new Array(this.length);for(;t<this.length;)n[t]=e(this.get(t),t,this),t++;return n}reduce(e,t){let n=0,i=t;for(;n<this.length;){let o=this.get(n);i=e(i,o,n),n++}return i}find(e){let t=0,n,i;for(;t<this.length&&!n;)i=this.get(t),n=e(i),t++;return n?i:void 0}_internalPositionFor(e,t){let n=this._bytePosFor(e,t);if(n>=this._bitArrays.length)return-1;let i=this._bitArrays[n],o=e-n*7;if(!((i&1<<o)>0))return-1;let a=this._bitArrays.slice(0,n).reduce(gN,0),c=~(4294967295<<o+1),u=$3(i&c);return a+u-1}_bytePosFor(e,t){let n=Math.floor(e/7),i=n+1;for(;!t&&this._bitArrays.length<i;)this._bitArrays.push(0);return n}_setBit(e){let t=this._bytePosFor(e,!1);this._bitArrays[t]|=1<<e-t*7}_unsetBit(e){let t=this._bytePosFor(e,!1);this._bitArrays[t]&=~(1<<e-t*7)}_setInternalPos(e,t,n,i){let o=this._data,s=[t,n];if(i)this._sortData(),o[e]=s;else{if(o.length)if(o[o.length-1][0]>=t)o.push(s);else if(o[0][0]<=t)o.unshift(s);else{let a=Math.round(o.length/2);this._data=o.slice(0,a).concat(s).concat(o.slice(a))}else this._data.push(s);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(e){this._data.splice(e,1)}_sortData(){this._changedData&&this._data.sort(xN),this._changedData=!1}bitField(){let e=[],t=8,n=0,i=0,o,s=this._bitArrays.slice();for(;s.length||n;){n===0&&(o=s.shift(),n=7);let c=Math.min(n,t),u=~(255<<c),l=o&u;i|=l<<8-t,o=o>>>c,n-=c,t-=c,(!t||!n&&!s.length)&&(e.push(i),i=0,t=8)}for(var a=e.length-1;a>0&&e[a]===0;a--)e.pop();return e}compactArray(){return this._sortData(),this._data.map(yN)}};function gN(r,e){return r+$3(e)}function $3(r){let e=r;return e=e-(e>>1&1431655765),e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}function xN(r,e){return r[0]-e[0]}function yN(r){return r[1]}});var _6=re((ite,I6)=>{var Xg=class{constructor(e,t=12,n=8*1024,i=32*1024,o=64,s){this.bits=t,this.min=n,this.max=i,this.asModule=e,this.rabin=new e.Rabin(t,n,i,o,s),this.polynomial=s}fingerprint(e){let{__retain:t,__release:n,__allocArray:i,__getInt32Array:o,Int32Array_ID:s,Uint8Array_ID:a}=this.asModule,c=new Int32Array(Math.ceil(e.length/this.min)),u=t(i(s,c)),l=t(i(a,e)),p=this.rabin.fingerprint(l,u),m=o(p);n(l),n(u);let d=m.indexOf(0);return d>=0?m.subarray(0,d):m}};I6.exports=Xg});var D6=re(jc=>{"use strict";var zD=typeof BigUint64Array<"u",Mc=Symbol(),$c=1024;function T6(r,e){let t=new Uint32Array(r),n=new Uint16Array(r);var i=t[e+-4>>>2]>>>1,o=e>>>1;if(i<=$c)return String.fromCharCode.apply(String,n.subarray(o,o+i));let s=[];do{let a=n[o+$c-1],c=a>=55296&&a<56320?$c-1:$c;s.push(String.fromCharCode.apply(String,n.subarray(o,o+=c))),i-=c}while(i>$c);return s.join("")+String.fromCharCode.apply(String,n.subarray(o,o+i))}function Jg(r){let e={};function t(i,o){return i?T6(i.buffer,o):"<yet unknown>"}let n=r.env=r.env||{};return n.abort=n.abort||function(o,s,a,c){let u=e.memory||n.memory;throw Error("abort: "+t(u,o)+" at "+t(u,s)+":"+a+":"+c)},n.trace=n.trace||function(o,s){let a=e.memory||n.memory;console.log("trace: "+t(a,o)+(s?" ":"")+Array.prototype.slice.call(arguments,2,2+s).join(", "))},r.Math=r.Math||Math,r.Date=r.Date||Date,e}function Zg(r,e){let t=e.exports,n=t.memory,i=t.table,o=t.__alloc,s=t.__retain,a=t.__rtti_base||-1;function c(S){let b=new Uint32Array(n.buffer),v=b[a>>>2];if((S>>>=0)>=v)throw Error("invalid id: "+S);return b[(a+4>>>2)+S*2]}function u(S){let b=new Uint32Array(n.buffer),v=b[a>>>2];if((S>>>=0)>=v)throw Error("invalid id: "+S);return b[(a+4>>>2)+S*2+1]}function l(S){return 31-Math.clz32(S>>>5&31)}function p(S){return 31-Math.clz32(S>>>14&31)}function m(S){let b=S.length,v=o(b<<1,1),k=new Uint16Array(n.buffer);for(var U=0,R=v>>>1;U<b;++U)k[R+U]=S.charCodeAt(U);return v}r.__allocString=m;function d(S){let b=n.buffer;if(new Uint32Array(b)[S+-8>>>2]!==1)throw Error("not a string: "+S);return T6(b,S)}r.__getString=d;function f(S,b,v){let k=n.buffer;if(v)switch(S){case 2:return new Float32Array(k);case 3:return new Float64Array(k)}else switch(S){case 0:return new(b?Int8Array:Uint8Array)(k);case 1:return new(b?Int16Array:Uint16Array)(k);case 2:return new(b?Int32Array:Uint32Array)(k);case 3:return new(b?BigInt64Array:BigUint64Array)(k)}throw Error("unsupported align: "+S)}function h(S,b){let v=c(S);if(!(v&3))throw Error("not an array: "+S+" @ "+v);let k=l(v),U=b.length,R=o(U<<k,0),M=o(v&2?16:12,S),L=new Uint32Array(n.buffer);L[M+0>>>2]=s(R),L[M+4>>>2]=R,L[M+8>>>2]=U<<k,v&2&&(L[M+12>>>2]=U);let le=f(k,v&1024,v&2048);if(v&8192)for(let _=0;_<U;++_)le[(R>>>k)+_]=s(b[_]);else le.set(b,R>>>k);return M}r.__allocArray=h;function x(S){let b=new Uint32Array(n.buffer),v=b[S+-8>>>2],k=c(v);if(!(k&1))throw Error("not an array: "+v);let U=l(k);var R=b[S+4>>>2];let M=k&2?b[S+12>>>2]:b[R+-4>>>2]>>>U;return f(U,k&1024,k&2048).subarray(R>>>=U,R+M)}r.__getArrayView=x;function g(S){let b=x(S),v=b.length,k=new Array(v);for(let U=0;U<v;U++)k[U]=b[U];return k}r.__getArray=g;function w(S){let b=n.buffer,v=new Uint32Array(b)[S+-4>>>2];return b.slice(S,S+v)}r.__getArrayBuffer=w;function y(S,b,v){return new S(E(S,b,v))}function E(S,b,v){let k=n.buffer,U=new Uint32Array(k),R=U[v+4>>>2];return new S(k,R,U[R+-4>>>2]>>>b)}r.__getInt8Array=y.bind(null,Int8Array,0),r.__getInt8ArrayView=E.bind(null,Int8Array,0),r.__getUint8Array=y.bind(null,Uint8Array,0),r.__getUint8ArrayView=E.bind(null,Uint8Array,0),r.__getUint8ClampedArray=y.bind(null,Uint8ClampedArray,0),r.__getUint8ClampedArrayView=E.bind(null,Uint8ClampedArray,0),r.__getInt16Array=y.bind(null,Int16Array,1),r.__getInt16ArrayView=E.bind(null,Int16Array,1),r.__getUint16Array=y.bind(null,Uint16Array,1),r.__getUint16ArrayView=E.bind(null,Uint16Array,1),r.__getInt32Array=y.bind(null,Int32Array,2),r.__getInt32ArrayView=E.bind(null,Int32Array,2),r.__getUint32Array=y.bind(null,Uint32Array,2),r.__getUint32ArrayView=E.bind(null,Uint32Array,2),zD&&(r.__getInt64Array=y.bind(null,BigInt64Array,3),r.__getInt64ArrayView=E.bind(null,BigInt64Array,3),r.__getUint64Array=y.bind(null,BigUint64Array,3),r.__getUint64ArrayView=E.bind(null,BigUint64Array,3)),r.__getFloat32Array=y.bind(null,Float32Array,2),r.__getFloat32ArrayView=E.bind(null,Float32Array,2),r.__getFloat64Array=y.bind(null,Float64Array,3),r.__getFloat64ArrayView=E.bind(null,Float64Array,3);function B(S,b){let v=new Uint32Array(n.buffer);var k=v[S+-8>>>2];if(k<=v[a>>>2])do if(k==b)return!0;while(k=u(k));return!1}return r.__instanceof=B,r.memory=r.memory||n,r.table=r.table||i,N6(t,r)}function C6(r){return typeof Response<"u"&&r instanceof Response}async function R6(r,e){return C6(r=await r)?U6(r,e):Zg(Jg(e||(e={})),await WebAssembly.instantiate(r instanceof WebAssembly.Module?r:await WebAssembly.compile(r),e))}jc.instantiate=R6;function VD(r,e){return Zg(Jg(e||(e={})),new WebAssembly.Instance(r instanceof WebAssembly.Module?r:new WebAssembly.Module(r),e))}jc.instantiateSync=VD;async function U6(r,e){return WebAssembly.instantiateStreaming?Zg(Jg(e||(e={})),(await WebAssembly.instantiateStreaming(r,e)).instance):R6(C6(r=await r)?r.arrayBuffer():r,e)}jc.instantiateStreaming=U6;function N6(r,e){var t=e?Object.create(e):{},n=r.__argumentsLength?function(i){r.__argumentsLength.value=i}:r.__setArgumentsLength||r.__setargc||function(){};for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let o=r[i],s=i.split("."),a=t;for(;s.length>1;){let l=s.shift();Object.prototype.hasOwnProperty.call(a,l)||(a[l]={}),a=a[l]}let c=s[0],u=c.indexOf("#");if(u>=0){let l=c.substring(0,u),p=a[l];if(typeof p>"u"||!p.prototype){let m=function(...d){return m.wrap(m.prototype.constructor(0,...d))};m.prototype={valueOf:function(){return this[Mc]}},m.wrap=function(d){return Object.create(m.prototype,{[Mc]:{value:d,writable:!1}})},p&&Object.getOwnPropertyNames(p).forEach(d=>Object.defineProperty(m,d,Object.getOwnPropertyDescriptor(p,d))),a[l]=m}if(c=c.substring(u+1),a=a[l].prototype,/^(get|set):/.test(c)){if(!Object.prototype.hasOwnProperty.call(a,c=c.substring(4))){let m=r[i.replace("set:","get:")],d=r[i.replace("get:","set:")];Object.defineProperty(a,c,{get:function(){return m(this[Mc])},set:function(f){d(this[Mc],f)},enumerable:!0})}}else c==="constructor"?(a[c]=(...m)=>(n(m.length),o(...m))).original=o:(a[c]=function(...m){return n(m.length),o(this[Mc],...m)}).original=o}else/^(get|set):/.test(c)?Object.prototype.hasOwnProperty.call(a,c=c.substring(4))||Object.defineProperty(a,c,{get:r[i.replace("set:","get:")],set:r[i.replace("get:","set:")],enumerable:!0}):typeof o=="function"&&o!==n?(a[c]=(...l)=>(n(l.length),o(...l))).original=o:a[c]=o}return t}jc.demangle=N6});var P6=re((ste,L6)=>{var{instantiate:MD}=D6();Qg.supported=typeof WebAssembly<"u";function Qg(r={}){if(!Qg.supported)return null;var e=new Uint8Array([0,97,115,109,1,0,0,0,1,78,14,96,2,127,126,0,96,1,127,1,126,96,2,127,127,0,96,1,127,1,127,96,1,127,0,96,2,127,127,1,127,96,3,127,127,127,1,127,96,0,0,96,3,127,127,127,0,96,0,1,127,96,4,127,127,127,127,0,96,5,127,127,127,127,127,1,127,96,1,126,1,127,96,2,126,126,1,126,2,13,1,3,101,110,118,5,97,98,111,114,116,0,10,3,54,53,2,2,8,9,3,5,2,8,6,5,3,4,2,6,9,12,13,2,5,11,3,2,3,2,3,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,6,7,7,4,4,5,3,1,0,1,6,47,9,127,1,65,0,11,127,1,65,0,11,127,0,65,3,11,127,0,65,4,11,127,1,65,0,11,127,1,65,0,11,127,1,65,0,11,127,0,65,240,2,11,127,0,65,6,11,7,240,5,41,6,109,101,109,111,114,121,2,0,7,95,95,97,108,108,111,99,0,10,8,95,95,114,101,116,97,105,110,0,11,9,95,95,114,101,108,101,97,115,101,0,12,9,95,95,99,111,108,108,101,99,116,0,51,11,95,95,114,116,116,105,95,98,97,115,101,3,7,13,73,110,116,51,50,65,114,114,97,121,95,73,68,3,2,13,85,105,110,116,56,65,114,114,97,121,95,73,68,3,3,6,100,101,103,114,101,101,0,16,3,109,111,100,0,17,5,82,97,98,105,110,3,8,16,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,0,21,16,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,0,22,21,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,23,21,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,24,14,82,97,98,105,110,35,103,101,116,58,119,112,111,115,0,25,14,82,97,98,105,110,35,115,101,116,58,119,112,111,115,0,26,15,82,97,98,105,110,35,103,101,116,58,99,111,117,110,116,0,27,15,82,97,98,105,110,35,115,101,116,58,99,111,117,110,116,0,28,13,82,97,98,105,110,35,103,101,116,58,112,111,115,0,29,13,82,97,98,105,110,35,115,101,116,58,112,111,115,0,30,15,82,97,98,105,110,35,103,101,116,58,115,116,97,114,116,0,31,15,82,97,98,105,110,35,115,101,116,58,115,116,97,114,116,0,32,16,82,97,98,105,110,35,103,101,116,58,100,105,103,101,115,116,0,33,16,82,97,98,105,110,35,115,101,116,58,100,105,103,101,115,116,0,34,21,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,35,21,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,36,22,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,37,22,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,38,31,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,39,31,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,40,20,82,97,98,105,110,35,103,101,116,58,112,111,108,121,110,111,109,105,97,108,0,41,20,82,97,98,105,110,35,115,101,116,58,112,111,108,121,110,111,109,105,97,108,0,42,17,82,97,98,105,110,35,103,101,116,58,109,105,110,115,105,122,101,0,43,17,82,97,98,105,110,35,115,101,116,58,109,105,110,115,105,122,101,0,44,17,82,97,98,105,110,35,103,101,116,58,109,97,120,115,105,122,101,0,45,17,82,97,98,105,110,35,115,101,116,58,109,97,120,115,105,122,101,0,46,14,82,97,98,105,110,35,103,101,116,58,109,97,115,107,0,47,14,82,97,98,105,110,35,115,101,116,58,109,97,115,107,0,48,17,82,97,98,105,110,35,99,111,110,115,116,114,117,99,116,111,114,0,20,17,82,97,98,105,110,35,102,105,110,103,101,114,112,114,105,110,116,0,49,8,1,50,10,165,31,53,199,1,1,4,127,32,1,40,2,0,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,3,65,4,107,118,65,16,115,33,4,32,3,65,7,107,11,33,3,32,1,40,2,20,33,2,32,1,40,2,16,34,5,4,64,32,5,32,2,54,2,20,11,32,2,4,64,32,2,32,5,54,2,16,11,32,1,32,0,32,4,32,3,65,4,116,106,65,2,116,106,40,2,96,70,4,64,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,2,54,2,96,32,2,69,4,64,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,65,127,115,113,34,1,54,2,4,32,1,69,4,64,32,0,32,0,40,2,0,65,1,32,3,116,65,127,115,113,54,2,0,11,11,11,11,226,2,1,6,127,32,1,40,2,0,33,3,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,34,5,65,1,113,4,64,32,3,65,124,113,65,16,106,32,5,65,124,113,106,34,2,65,240,255,255,255,3,73,4,64,32,0,32,4,16,1,32,1,32,2,32,3,65,3,113,114,34,3,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,33,5,11,11,32,3,65,2,113,4,64,32,1,65,4,107,40,2,0,34,2,40,2,0,34,6,65,124,113,65,16,106,32,3,65,124,113,106,34,7,65,240,255,255,255,3,73,4,64,32,0,32,2,16,1,32,2,32,7,32,6,65,3,113,114,34,3,54,2,0,32,2,33,1,11,11,32,4,32,5,65,2,114,54,2,0,32,4,65,4,107,32,1,54,2,0,32,0,32,3,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,2,65,4,107,118,65,16,115,33,4,32,2,65,7,107,11,34,3,65,4,116,32,4,106,65,2,116,106,40,2,96,33,2,32,1,65,0,54,2,16,32,1,32,2,54,2,20,32,2,4,64,32,2,32,1,54,2,16,11,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,1,54,2,96,32,0,32,0,40,2,0,65,1,32,3,116,114,54,2,0,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,114,54,2,4,11,119,1,1,127,32,2,2,127,32,0,40,2,160,12,34,2,4,64,32,2,32,1,65,16,107,70,4,64,32,2,40,2,0,33,3,32,1,65,16,107,33,1,11,11,32,1,11,107,34,2,65,48,73,4,64,15,11,32,1,32,3,65,2,113,32,2,65,32,107,65,1,114,114,54,2,0,32,1,65,0,54,2,16,32,1,65,0,54,2,20,32,1,32,2,106,65,16,107,34,2,65,2,54,2,0,32,0,32,2,54,2,160,12,32,0,32,1,16,2,11,155,1,1,3,127,35,0,34,0,69,4,64,65,1,63,0,34,0,74,4,127,65,1,32,0,107,64,0,65,0,72,5,65,0,11,4,64,0,11,65,176,3,34,0,65,0,54,2,0,65,208,15,65,0,54,2,0,3,64,32,1,65,23,73,4,64,32,1,65,2,116,65,176,3,106,65,0,54,2,4,65,0,33,2,3,64,32,2,65,16,73,4,64,32,1,65,4,116,32,2,106,65,2,116,65,176,3,106,65,0,54,2,96,32,2,65,1,106,33,2,12,1,11,11,32,1,65,1,106,33,1,12,1,11,11,65,176,3,65,224,15,63,0,65,16,116,16,3,65,176,3,36,0,11,32,0,11,45,0,32,0,65,240,255,255,255,3,79,4,64,65,32,65,224,0,65,201,3,65,29,16,0,0,11,32,0,65,15,106,65,112,113,34,0,65,16,32,0,65,16,75,27,11,169,1,1,1,127,32,0,32,1,65,128,2,73,4,127,32,1,65,4,118,33,1,65,0,5,32,1,65,248,255,255,255,1,73,4,64,32,1,65,1,65,27,32,1,103,107,116,106,65,1,107,33,1,11,32,1,65,31,32,1,103,107,34,2,65,4,107,118,65,16,115,33,1,32,2,65,7,107,11,34,2,65,2,116,106,40,2,4,65,127,32,1,116,113,34,1,4,127,32,0,32,1,104,32,2,65,4,116,106,65,2,116,106,40,2,96,5,32,0,40,2,0,65,127,32,2,65,1,106,116,113,34,1,4,127,32,0,32,0,32,1,104,34,0,65,2,116,106,40,2,4,104,32,0,65,4,116,106,65,2,116,106,40,2,96,5,65,0,11,11,11,111,1,1,127,63,0,34,2,32,1,65,248,255,255,255,1,73,4,127,32,1,65,1,65,27,32,1,103,107,116,65,1,107,106,5,32,1,11,65,16,32,0,40,2,160,12,32,2,65,16,116,65,16,107,71,116,106,65,255,255,3,106,65,128,128,124,113,65,16,118,34,1,32,2,32,1,74,27,64,0,65,0,72,4,64,32,1,64,0,65,0,72,4,64,0,11,11,32,0,32,2,65,16,116,63,0,65,16,116,16,3,11,113,1,2,127,32,1,40,2,0,34,3,65,124,113,32,2,107,34,4,65,32,79,4,64,32,1,32,2,32,3,65,2,113,114,54,2,0,32,2,32,1,65,16,106,106,34,1,32,4,65,16,107,65,1,114,54,2,0,32,0,32,1,16,2,5,32,1,32,3,65,126,113,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,32,1,65,16,106,32,1,40,2,0,65,124,113,106,40,2,0,65,125,113,54,2,0,11,11,91,1,2,127,32,0,32,1,16,5,34,4,16,6,34,3,69,4,64,65,1,36,1,65,0,36,1,32,0,32,4,16,6,34,3,69,4,64,32,0,32,4,16,7,32,0,32,4,16,6,33,3,11,11,32,3,65,0,54,2,4,32,3,32,2,54,2,8,32,3,32,1,54,2,12,32,0,32,3,16,1,32,0,32,3,32,4,16,8,32,3,11,13,0,16,4,32,0,32,1,16,9,65,16,106,11,33,1,1,127,32,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,18,0,32,0,65,172,3,75,4,64,32,0,65,16,107,16,52,11,11,140,3,1,1,127,2,64,32,1,69,13,0,32,0,65,0,58,0,0,32,0,32,1,106,65,1,107,65,0,58,0,0,32,1,65,2,77,13,0,32,0,65,1,106,65,0,58,0,0,32,0,65,2,106,65,0,58,0,0,32,0,32,1,106,34,2,65,2,107,65,0,58,0,0,32,2,65,3,107,65,0,58,0,0,32,1,65,6,77,13,0,32,0,65,3,106,65,0,58,0,0,32,0,32,1,106,65,4,107,65,0,58,0,0,32,1,65,8,77,13,0,32,1,65,0,32,0,107,65,3,113,34,1,107,33,2,32,0,32,1,106,34,0,65,0,54,2,0,32,0,32,2,65,124,113,34,1,106,65,4,107,65,0,54,2,0,32,1,65,8,77,13,0,32,0,65,4,106,65,0,54,2,0,32,0,65,8,106,65,0,54,2,0,32,0,32,1,106,34,2,65,12,107,65,0,54,2,0,32,2,65,8,107,65,0,54,2,0,32,1,65,24,77,13,0,32,0,65,12,106,65,0,54,2,0,32,0,65,16,106,65,0,54,2,0,32,0,65,20,106,65,0,54,2,0,32,0,65,24,106,65,0,54,2,0,32,0,32,1,106,34,2,65,28,107,65,0,54,2,0,32,2,65,24,107,65,0,54,2,0,32,2,65,20,107,65,0,54,2,0,32,2,65,16,107,65,0,54,2,0,32,0,32,0,65,4,113,65,24,106,34,2,106,33,0,32,1,32,2,107,33,1,3,64,32,1,65,32,79,4,64,32,0,66,0,55,3,0,32,0,65,8,106,66,0,55,3,0,32,0,65,16,106,66,0,55,3,0,32,0,65,24,106,66,0,55,3,0,32,1,65,32,107,33,1,32,0,65,32,106,33,0,12,1,11,11,11,11,178,1,1,3,127,32,1,65,240,255,255,255,3,32,2,118,75,4,64,65,144,1,65,192,1,65,23,65,56,16,0,0,11,32,1,32,2,116,34,3,65,0,16,10,34,2,32,3,16,13,32,0,69,4,64,65,12,65,2,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,2,34,1,32,0,40,2,0,34,4,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,32,4,16,12,11,32,0,32,1,54,2,0,32,0,32,2,54,2,4,32,0,32,3,54,2,8,32,0,11,46,1,2,127,65,12,65,5,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,65,128,2,65,3,16,14,11,9,0,65,63,32,0,121,167,107,11,49,1,2,127,65,63,32,1,121,167,107,33,2,3,64,65,63,32,0,121,167,107,32,2,107,34,3,65,0,78,4,64,32,0,32,1,32,3,172,134,133,33,0,12,1,11,11,32,0,11,40,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,163,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,65,0,58,0,0,11,38,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,152,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,45,0,0,11,254,5,2,1,127,4,126,32,0,69,4,64,65,232,0,65,6,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,24,32,0,66,0,55,3,32,32,0,66,0,55,3,40,32,0,66,0,55,3,48,32,0,66,0,55,3,56,32,0,66,0,55,3,64,32,0,66,0,55,3,72,32,0,66,0,55,3,80,32,0,66,0,55,3,88,32,0,66,0,55,3,96,32,0,32,2,173,55,3,80,32,0,32,3,173,55,3,88,65,12,65,4,16,10,34,2,65,172,3,75,4,64,32,2,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,32,4,65,0,16,14,33,2,32,0,40,2,0,16,12,32,0,32,2,54,2,0,32,0,32,4,54,2,4,32,0,66,1,32,1,173,134,66,1,125,55,3,96,32,0,66,243,130,183,218,216,230,232,30,55,3,72,35,4,69,4,64,65,0,33,2,3,64,32,2,65,128,2,72,4,64,32,2,65,255,1,113,173,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,65,0,33,4,3,64,32,4,32,0,40,2,4,65,1,107,72,4,64,32,6,66,8,134,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,32,4,65,1,106,33,4,12,1,11,11,35,6,40,2,4,32,2,65,3,116,106,32,6,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,63,32,0,41,3,72,121,167,107,172,33,7,65,0,33,2,3,64,32,2,65,128,2,72,4,64,35,5,33,1,32,2,172,32,7,134,34,8,33,6,65,63,32,0,41,3,72,34,9,121,167,107,33,3,3,64,65,63,32,6,121,167,107,32,3,107,34,4,65,0,78,4,64,32,6,32,9,32,4,172,134,133,33,6,12,1,11,11,32,1,40,2,4,32,2,65,3,116,106,32,6,32,8,132,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,1,36,4,11,32,0,66,0,55,3,24,32,0,66,0,55,3,32,65,0,33,2,3,64,32,2,32,0,40,2,4,72,4,64,32,0,40,2,0,32,2,16,18,32,2,65,1,106,33,2,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,6,66,45,136,167,65,3,116,106,41,3,0,32,6,66,8,134,66,1,132,133,55,3,40,32,0,11,38,1,1,127,32,0,40,2,0,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,55,1,2,127,32,1,32,0,40,2,0,34,2,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,16,12,11,32,0,32,1,54,2,0,11,7,0,32,0,40,2,4,11,9,0,32,0,32,1,54,2,4,11,7,0,32,0,40,2,8,11,9,0,32,0,32,1,54,2,8,11,7,0,32,0,41,3,16,11,9,0,32,0,32,1,55,3,16,11,7,0,32,0,41,3,24,11,9,0,32,0,32,1,55,3,24,11,7,0,32,0,41,3,32,11,9,0,32,0,32,1,55,3,32,11,7,0,32,0,41,3,40,11,9,0,32,0,32,1,55,3,40,11,7,0,32,0,41,3,48,11,9,0,32,0,32,1,55,3,48,11,7,0,32,0,41,3,56,11,9,0,32,0,32,1,55,3,56,11,7,0,32,0,41,3,64,11,9,0,32,0,32,1,55,3,64,11,7,0,32,0,41,3,72,11,9,0,32,0,32,1,55,3,72,11,7,0,32,0,41,3,80,11,9,0,32,0,32,1,55,3,80,11,7,0,32,0,41,3,88,11,9,0,32,0,32,1,55,3,88,11,7,0,32,0,41,3,96,11,9,0,32,0,32,1,55,3,96,11,172,4,2,5,127,1,126,32,2,65,172,3,75,4,64,32,2,65,16,107,34,4,32,4,40,2,4,65,1,106,54,2,4,11,32,2,33,4,65,0,33,2,32,1,40,2,8,33,5,32,1,40,2,4,33,6,3,64,2,127,65,0,33,3,3,64,32,3,32,5,72,4,64,32,3,32,6,106,45,0,0,33,1,32,0,40,2,0,32,0,40,2,8,16,19,33,7,32,0,40,2,8,32,0,40,2,0,40,2,4,106,32,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,7,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,1,173,32,8,66,8,134,132,133,55,3,40,32,0,32,0,41,3,16,66,1,124,55,3,16,32,0,32,0,41,3,24,66,1,124,55,3,24,32,0,41,3,16,32,0,41,3,80,90,4,127,32,0,41,3,40,32,0,41,3,96,131,80,5,65,0,11,4,127,65,1,5,32,0,41,3,16,32,0,41,3,88,90,11,4,64,32,0,32,0,41,3,32,55,3,48,32,0,32,0,41,3,16,55,3,56,32,0,32,0,41,3,40,55,3,64,65,0,33,1,3,64,32,1,32,0,40,2,4,72,4,64,32,0,40,2,0,32,1,16,18,32,1,65,1,106,33,1,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,8,66,8,134,66,1,132,133,55,3,40,32,3,65,1,106,12,3,11,32,3,65,1,106,33,3,12,1,11,11,65,127,11,34,1,65,0,78,4,64,32,5,32,1,107,33,5,32,1,32,6,106,33,6,32,2,34,1,65,1,106,33,2,32,4,40,2,4,32,1,65,2,116,106,32,0,41,3,56,62,2,0,12,1,11,11,32,4,11,10,0,16,15,36,5,16,15,36,6,11,3,0,1,11,73,1,2,127,32,0,40,2,4,34,1,65,255,255,255,255,0,113,34,2,65,1,70,4,64,32,0,65,16,106,16,53,32,0,32,0,40,2,0,65,1,114,54,2,0,35,0,32,0,16,2,5,32,0,32,2,65,1,107,32,1,65,128,128,128,128,127,113,114,54,2,4,11,11,58,0,2,64,2,64,2,64,32,0,65,8,107,40,2,0,14,7,0,0,1,1,1,1,1,2,11,15,11,32,0,40,2,0,34,0,4,64,32,0,65,172,3,79,4,64,32,0,65,16,107,16,52,11,11,15,11,0,11,11,137,3,7,0,65,16,11,55,40,0,0,0,1,0,0,0,1,0,0,0,40,0,0,0,97,0,108,0,108,0,111,0,99,0,97,0,116,0,105,0,111,0,110,0,32,0,116,0,111,0,111,0,32,0,108,0,97,0,114,0,103,0,101,0,65,208,0,11,45,30,0,0,0,1,0,0,0,1,0,0,0,30,0,0,0,126,0,108,0,105,0,98,0,47,0,114,0,116,0,47,0,116,0,108,0,115,0,102,0,46,0,116,0,115,0,65,128,1,11,43,28,0,0,0,1,0,0,0,1,0,0,0,28,0,0,0,73,0,110,0,118,0,97,0,108,0,105,0,100,0,32,0,108,0,101,0,110,0,103,0,116,0,104,0,65,176,1,11,53,38,0,0,0,1,0,0,0,1,0,0,0,38,0,0,0,126,0,108,0,105,0,98,0,47,0,97,0,114,0,114,0,97,0,121,0,98,0,117,0,102,0,102,0,101,0,114,0,46,0,116,0,115,0,65,240,1,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,73,0,110,0,100,0,101,0,120,0,32,0,111,0,117,0,116,0,32,0,111,0,102,0,32,0,114,0,97,0,110,0,103,0,101,0,65,176,2,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,126,0,108,0,105,0,98,0,47,0,116,0,121,0,112,0,101,0,100,0,97,0,114,0,114,0,97,0,121,0,46,0,116,0,115,0,65,240,2,11,53,7,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,145,4,0,0,2,0,0,0,49,0,0,0,2,0,0,0,17,1,0,0,2,0,0,0,16,0,34,16,115,111,117,114,99,101,77,97,112,112,105,110,103,85,82,76,16,46,47,114,97,98,105,110,46,119,97,115,109,46,109,97,112]);return MD(new Response(new Blob([e],{type:"application/wasm"})),r)}L6.exports=Qg});var z6=re((ate,F6)=>{var O6=_6(),$D=P6(),jD=async(r,e,t,n,i)=>{let o=await $D();return new O6(o,r,e,t,n,i)};F6.exports={Rabin:O6,create:jD}});var p4=re((Bre,u4)=>{"use strict";u4.exports=r=>{if(Object.prototype.toString.call(r)!=="[object Object]")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}});var x4=re((m4,g4)=>{"use strict";var Kp=p4(),{hasOwnProperty:f4}=Object.prototype,{propertyIsEnumerable:hL}=Object,ta=(r,e,t)=>Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0}),mL=m4,d4={concatArrays:!1,ignoreUndefined:!1},Gp=r=>{let e=[];for(let t in r)f4.call(r,t)&&e.push(t);if(Object.getOwnPropertySymbols){let t=Object.getOwnPropertySymbols(r);for(let n of t)hL.call(r,n)&&e.push(n)}return e};function ra(r){return Array.isArray(r)?gL(r):Kp(r)?xL(r):r}function gL(r){let e=r.slice(0,0);return Gp(r).forEach(t=>{ta(e,t,ra(r[t]))}),e}function xL(r){let e=Object.getPrototypeOf(r)===null?Object.create(null):{};return Gp(r).forEach(t=>{ta(e,t,ra(r[t]))}),e}var h4=(r,e,t,n)=>(t.forEach(i=>{typeof e[i]>"u"&&n.ignoreUndefined||(i in r&&r[i]!==Object.getPrototypeOf(r)?ta(r,i,rx(r[i],e[i],n)):ta(r,i,ra(e[i])))}),r),yL=(r,e,t)=>{let n=r.slice(0,0),i=0;return[r,e].forEach(o=>{let s=[];for(let a=0;a<o.length;a++)f4.call(o,a)&&(s.push(String(a)),o===r?ta(n,i++,o[a]):ta(n,i++,ra(o[a])));n=h4(n,o,Gp(o).filter(a=>!s.includes(a)),t)}),n};function rx(r,e,t){return t.concatArrays&&Array.isArray(r)&&Array.isArray(e)?yL(r,e,t):!Kp(e)||!Kp(r)?ra(e):h4(r,e,Gp(e),t)}g4.exports=function(...r){let e=rx(ra(d4),this!==mL&&this||{},d4),t={_:{}};for(let n of r)if(n!==void 0){if(!Kp(n))throw new TypeError("`"+n+"` is not an Option Object");t=rx(t,{_:n},e)}return t._}});var P4=re((poe,QL)=>{QL.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var F4=re((doe,O4)=>{O4.exports=P4()});var V4=re((foe,z4)=>{z4.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var M4=re((hoe,lx)=>{typeof Object.create=="function"?lx.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:lx.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}});var q4=re(ye=>{var eP=/%[sdj%]/g;ye.format=function(r){if(!dd(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(Mi(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,o=String(r).replace(eP,function(a){if(a==="%%")return"%";if(t>=i)return a;switch(a){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return a}}),s=n[t];t<i;s=n[++t])pd(s)||!ca(s)?o+=" "+s:o+=" "+Mi(s);return o};ye.deprecate=function(r,e){if(Jn(globalThis.process))return function(){return ye.deprecate(r,e).apply(this,arguments)};if(process.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(process.throwDeprecation)throw new Error(e);process.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n};var sd={},ux;ye.debuglog=function(r){if(Jn(ux)&&(ux=process.env.NODE_DEBUG||""),r=r.toUpperCase(),!sd[r])if(new RegExp("\\b"+r+"\\b","i").test(ux)){var e=process.pid;sd[r]=function(){var t=ye.format.apply(ye,arguments);console.error("%s %d: %s",r,e,t)}}else sd[r]=function(){};return sd[r]};function Mi(r,e){var t={seen:[],stylize:rP};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),mx(e)?t.showHidden=e:e&&ye._extend(t,e),Jn(t.showHidden)&&(t.showHidden=!1),Jn(t.depth)&&(t.depth=2),Jn(t.colors)&&(t.colors=!1),Jn(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=tP),ud(t,r,t.depth)}ye.inspect=Mi;Mi.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Mi.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function tP(r,e){var t=Mi.styles[e];return t?"\x1B["+Mi.colors[t][0]+"m"+r+"\x1B["+Mi.colors[t][1]+"m":r}function rP(r,e){return r}function nP(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function ud(r,e,t){if(r.customInspect&&e&&ld(e.inspect)&&e.inspect!==ye.inspect&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return dd(n)||(n=ud(r,n,t)),n}var i=iP(r,e);if(i)return i;var o=Object.keys(e),s=nP(o);if(r.showHidden&&(o=Object.getOwnPropertyNames(e)),cd(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return px(e);if(o.length===0){if(ld(e)){var a=e.name?": "+e.name:"";return r.stylize("[Function"+a+"]","special")}if(ad(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(hx(e))return r.stylize(Date.prototype.toString.call(e),"date");if(cd(e))return px(e)}var c="",u=!1,l=["{","}"];if($4(e)&&(u=!0,l=["[","]"]),ld(e)){var p=e.name?": "+e.name:"";c=" [Function"+p+"]"}if(ad(e)&&(c=" "+RegExp.prototype.toString.call(e)),hx(e)&&(c=" "+Date.prototype.toUTCString.call(e)),cd(e)&&(c=" "+px(e)),o.length===0&&(!u||e.length==0))return l[0]+c+l[1];if(t<0)return ad(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var m;return u?m=oP(r,e,t,s,o):m=o.map(function(d){return fx(r,e,t,s,d,u)}),r.seen.pop(),sP(m,c,l)}function iP(r,e){if(Jn(e))return r.stylize("undefined","undefined");if(dd(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(j4(e))return r.stylize(""+e,"number");if(mx(e))return r.stylize(""+e,"boolean");if(pd(e))return r.stylize("null","null")}function px(r){return"["+Error.prototype.toString.call(r)+"]"}function oP(r,e,t,n,i){for(var o=[],s=0,a=e.length;s<a;++s)H4(e,String(s))?o.push(fx(r,e,t,n,String(s),!0)):o.push("");return i.forEach(function(c){c.match(/^\d+$/)||o.push(fx(r,e,t,n,c,!0))}),o}function fx(r,e,t,n,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?c.set?a=r.stylize("[Getter/Setter]","special"):a=r.stylize("[Getter]","special"):c.set&&(a=r.stylize("[Setter]","special")),H4(n,i)||(s="["+i+"]"),a||(r.seen.indexOf(c.value)<0?(pd(t)?a=ud(r,c.value,null):a=ud(r,c.value,t-1),a.indexOf(`
4
4
  `)>-1&&(o?a=a.split(`
5
5
  `).map(function(u){return" "+u}).join(`
6
6
  `).substr(2):a=`
7
7
  `+a.split(`
8
8
  `).map(function(u){return" "+u}).join(`
9
- `))):a=r.stylize("[Circular]","special")),Xn(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=r.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=r.stylize(s,"string"))}return s+": "+a}function iP(r,e,t){var n=0,i=r.reduce(function(o,s){return n++,s.indexOf(`
9
+ `))):a=r.stylize("[Circular]","special")),Jn(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=r.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=r.stylize(s,"string"))}return s+": "+a}function sP(r,e,t){var n=0,i=r.reduce(function(o,s){return n++,s.indexOf(`
10
10
  `)>=0&&n++,o+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?t[0]+(e===""?"":e+`
11
11
  `)+" "+r.join(`,
12
- `)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function V4(r){return Array.isArray(r)}ye.isArray=V4;function fx(r){return typeof r=="boolean"}ye.isBoolean=fx;function ld(r){return r===null}ye.isNull=ld;function oP(r){return r==null}ye.isNullOrUndefined=oP;function M4(r){return typeof r=="number"}ye.isNumber=M4;function ud(r){return typeof r=="string"}ye.isString=ud;function sP(r){return typeof r=="symbol"}ye.isSymbol=sP;function Xn(r){return r===void 0}ye.isUndefined=Xn;function od(r){return sa(r)&&hx(r)==="[object RegExp]"}ye.isRegExp=od;function sa(r){return typeof r=="object"&&r!==null}ye.isObject=sa;function dx(r){return sa(r)&&hx(r)==="[object Date]"}ye.isDate=dx;function sd(r){return sa(r)&&(hx(r)==="[object Error]"||r instanceof Error)}ye.isError=sd;function ad(r){return typeof r=="function"}ye.isFunction=ad;function aP(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}ye.isPrimitive=aP;ye.isBuffer=F4();function hx(r){return Object.prototype.toString.call(r)}function ux(r){return r<10?"0"+r.toString(10):r.toString(10)}var cP=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function lP(){var r=new Date,e=[ux(r.getHours()),ux(r.getMinutes()),ux(r.getSeconds())].join(":");return[r.getDate(),cP[r.getMonth()],e].join(" ")}ye.log=function(){console.log("%s - %s",lP(),ye.format.apply(ye,arguments))};ye.inherits=z4();ye._extend=function(r,e){if(!e||!sa(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r};function $4(r,e){return Object.prototype.hasOwnProperty.call(r,e)}});var K4=re((foe,Yc)=>{"use strict";var uP=process.platform==="win32",Ur=j4();function pd(r,e){for(var t=[],n=0;n<r.length;n++){var i=r[n];!i||i==="."||(i===".."?t.length&&t[t.length-1]!==".."?t.pop():e&&t.push(".."):t.push(i))}return t}function Wc(r){for(var e=r.length-1,t=0;t<=e&&!r[t];t++);for(var n=e;n>=0&&!r[n];n--);return t===0&&n===e?r:t>n?[]:r.slice(t,n+1)}var H4=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,pP=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,Me={};function dd(r){var e=H4.exec(r),t=(e[1]||"")+(e[2]||""),n=e[3]||"",i=pP.exec(n),o=i[1],s=i[2],a=i[3];return[t,o,s,a]}function mx(r){var e=H4.exec(r),t=e[1]||"",n=!!t&&t[1]!==":";return{device:t,isUnc:n,isAbsolute:n||!!e[2],tail:e[3]}}function q4(r){return"\\\\"+r.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")}Me.resolve=function(){for(var r="",e="",t=!1,n=arguments.length-1;n>=-1;n--){var i;if(n>=0?i=arguments[n]:r?(i=process.env["="+r],(!i||i.substr(0,3).toLowerCase()!==r.toLowerCase()+"\\")&&(i=r+"\\")):i=process.cwd(),Ur.isString(i)){if(!i)continue}else throw new TypeError("Arguments to path.resolve must be strings");var o=mx(i),s=o.device,a=o.isUnc,c=o.isAbsolute,u=o.tail;if(!(s&&r&&s.toLowerCase()!==r.toLowerCase())&&(r||(r=s),t||(e=u+"\\"+e,t=c),r&&t))break}return a&&(r=q4(r)),e=pd(e.split(/[\\\/]+/),!t).join("\\"),r+(t?"\\":"")+e||"."};Me.normalize=function(r){var e=mx(r),t=e.device,n=e.isUnc,i=e.isAbsolute,o=e.tail,s=/[\\\/]$/.test(o);return o=pd(o.split(/[\\\/]+/),!i).join("\\"),!o&&!i&&(o="."),o&&s&&(o+="\\"),n&&(t=q4(t)),t+(i?"\\":"")+o};Me.isAbsolute=function(r){return mx(r).isAbsolute};Me.join=function(){for(var r=[],e=0;e<arguments.length;e++){var t=arguments[e];if(!Ur.isString(t))throw new TypeError("Arguments to path.join must be strings");t&&r.push(t)}var n=r.join("\\");return/^[\\\/]{2}[^\\\/]/.test(r[0])||(n=n.replace(/^[\\\/]{2,}/,"\\")),Me.normalize(n)};Me.relative=function(r,e){r=Me.resolve(r),e=Me.resolve(e);for(var t=r.toLowerCase(),n=e.toLowerCase(),i=Wc(e.split("\\")),o=Wc(t.split("\\")),s=Wc(n.split("\\")),a=Math.min(o.length,s.length),c=a,u=0;u<a;u++)if(o[u]!==s[u]){c=u;break}if(c==0)return e;for(var l=[],u=c;u<o.length;u++)l.push("..");return l=l.concat(i.slice(c)),l.join("\\")};Me._makeLong=function(r){if(!Ur.isString(r))return r;if(!r)return"";var e=Me.resolve(r);return/^[a-zA-Z]\:\\/.test(e)?"\\\\?\\"+e:/^\\\\[^?.]/.test(e)?"\\\\?\\UNC\\"+e.substring(2):r};Me.dirname=function(r){var e=dd(r),t=e[0],n=e[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)};Me.basename=function(r,e){var t=dd(r)[2];return e&&t.substr(-1*e.length)===e&&(t=t.substr(0,t.length-e.length)),t};Me.extname=function(r){return dd(r)[3]};Me.format=function(r){if(!Ur.isObject(r))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof r);var e=r.root||"";if(!Ur.isString(e))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof r.root);var t=r.dir,n=r.base||"";return t?t[t.length-1]===Me.sep?t+n:t+Me.sep+n:n};Me.parse=function(r){if(!Ur.isString(r))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=dd(r);if(!e||e.length!==4)throw new TypeError("Invalid path '"+r+"'");return{root:e[0],dir:e[0]+e[1].slice(0,-1),base:e[2],ext:e[3],name:e[2].slice(0,e[2].length-e[3].length)}};Me.sep="\\";Me.delimiter=";";var dP=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Ge={};function fd(r){return dP.exec(r).slice(1)}Ge.resolve=function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:process.cwd();if(Ur.isString(n)){if(!n)continue}else throw new TypeError("Arguments to path.resolve must be strings");r=n+"/"+r,e=n[0]==="/"}return r=pd(r.split("/"),!e).join("/"),(e?"/":"")+r||"."};Ge.normalize=function(r){var e=Ge.isAbsolute(r),t=r&&r[r.length-1]==="/";return r=pd(r.split("/"),!e).join("/"),!r&&!e&&(r="."),r&&t&&(r+="/"),(e?"/":"")+r};Ge.isAbsolute=function(r){return r.charAt(0)==="/"};Ge.join=function(){for(var r="",e=0;e<arguments.length;e++){var t=arguments[e];if(!Ur.isString(t))throw new TypeError("Arguments to path.join must be strings");t&&(r?r+="/"+t:r+=t)}return Ge.normalize(r)};Ge.relative=function(r,e){r=Ge.resolve(r).substr(1),e=Ge.resolve(e).substr(1);for(var t=Wc(r.split("/")),n=Wc(e.split("/")),i=Math.min(t.length,n.length),o=i,s=0;s<i;s++)if(t[s]!==n[s]){o=s;break}for(var a=[],s=o;s<t.length;s++)a.push("..");return a=a.concat(n.slice(o)),a.join("/")};Ge._makeLong=function(r){return r};Ge.dirname=function(r){var e=fd(r),t=e[0],n=e[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)};Ge.basename=function(r,e){var t=fd(r)[2];return e&&t.substr(-1*e.length)===e&&(t=t.substr(0,t.length-e.length)),t};Ge.extname=function(r){return fd(r)[3]};Ge.format=function(r){if(!Ur.isObject(r))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof r);var e=r.root||"";if(!Ur.isString(e))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof r.root);var t=r.dir?r.dir+Ge.sep:"",n=r.base||"";return t+n};Ge.parse=function(r){if(!Ur.isString(r))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=fd(r);if(!e||e.length!==4)throw new TypeError("Invalid path '"+r+"'");return e[1]=e[1]||"",e[2]=e[2]||"",e[3]=e[3]||"",{root:e[0],dir:e[0]+e[1].slice(0,-1),base:e[2],ext:e[3],name:e[2].slice(0,e[2].length-e[3].length)}};Ge.sep="/";Ge.delimiter=":";uP?Yc.exports=Me:Yc.exports=Ge;Yc.exports.posix=Ge;Yc.exports.win32=Me});var Y4=re(Pt=>{"use strict";var hd=P4(),fP=K4().extname,G4=/^\s*([^;\s]*)(?:;|\s|$)/,hP=/^text\//i;Pt.charset=W4;Pt.charsets={lookup:W4};Pt.contentType=mP;Pt.extension=gP;Pt.extensions=Object.create(null);Pt.lookup=xP;Pt.types=Object.create(null);yP(Pt.extensions,Pt.types);function W4(r){if(!r||typeof r!="string")return!1;var e=G4.exec(r),t=e&&hd[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&hP.test(e[1])?"UTF-8":!1}function mP(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Pt.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Pt.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function gP(r){if(!r||typeof r!="string")return!1;var e=G4.exec(r),t=e&&Pt.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function xP(r){if(!r||typeof r!="string")return!1;var e=fP("x."+r).toLowerCase().substr(1);return e&&Pt.types[e]||!1}function yP(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(hd).forEach(function(i){var o=hd[i],s=o.extensions;if(!(!s||!s.length)){r[i]=s;for(var a=0;a<s.length;a++){var c=s[a];if(e[c]){var u=t.indexOf(hd[e[c]].source),l=t.indexOf(o.source);if(e[c]!=="application/octet-stream"&&(u>l||u===l&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}})}});var _P={};$(_P,{createVerifiedFetch:()=>kP});function Mi(r){let e=new globalThis.AbortController;function t(){e.abort();for(let o of r)o?.removeEventListener!=null&&o.removeEventListener("abort",t)}for(let o of r){if(o?.aborted===!0){t();break}o?.addEventListener!=null&&o.addEventListener("abort",t)}function n(){for(let o of r)o?.removeEventListener!=null&&o.removeEventListener("abort",t)}let i=e.signal;return i.clear=n,i}function x8(r){let[e,t]=r[Symbol.asyncIterator]!=null?[r[Symbol.asyncIterator](),Symbol.asyncIterator]:[r[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:i=>{n.push(i)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[t](){return this}}}var ko=x8;function y8(r){return r[Symbol.asyncIterator]!=null}function kx(r){return r?.then!=null}function w8(r,e){if(y8(r))return async function*(){for await(let a of r){let c=e(a);kx(c)&&await c,yield a}}();let t=ko(r),{value:n,done:i}=t.next();if(i===!0)return function*(){}();if(typeof e(n)?.then=="function")return async function*(){yield n;for await(let a of t){let c=e(a);kx(c)&&await c,yield a}}();let s=e;return function*(){yield n;for(let a of t)s(a),yield a}()}var yd=w8;var kd={};$(kd,{base32:()=>nt,base32hex:()=>C8,base32hexpad:()=>U8,base32hexpadupper:()=>N8,base32hexupper:()=>R8,base32pad:()=>_8,base32padupper:()=>T8,base32upper:()=>Cx,base32z:()=>D8});var Io={};$(Io,{coerce:()=>Zt,empty:()=>Ix,equals:()=>wd,fromHex:()=>v8,fromString:()=>bd,isBinary:()=>E8,toHex:()=>b8,toString:()=>vd});var Ix=new Uint8Array(0);function b8(r){return r.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),"")}function v8(r){let e=r.match(/../g);return e!=null?new Uint8Array(e.map(t=>parseInt(t,16))):Ix}function wd(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function Zt(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function E8(r){return r instanceof ArrayBuffer||ArrayBuffer.isView(r)}function bd(r){return new TextEncoder().encode(r)}function vd(r){return new TextDecoder().decode(r)}function A8(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function p(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var h=0,x=0,g=0,y=f.length;g!==y&&f[g]===0;)g++,h++;for(var w=(y-g)*l+1>>>0,E=new Uint8Array(w);g!==y;){for(var B=f[g],S=0,b=w-1;(B!==0||S<x)&&b!==-1;b--,S++)B+=256*E[b]>>>0,E[b]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");x=S,g++}for(var v=w-x;v!==w&&E[v]===0;)v++;for(var k=c.repeat(h);v<w;++v)k+=r.charAt(E[v]);return k}function m(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var h=0;if(f[h]!==" "){for(var x=0,g=0;f[h]===c;)x++,h++;for(var y=(f.length-h)*u+1>>>0,w=new Uint8Array(y);f[h];){var E=t[f.charCodeAt(h)];if(E===255)return;for(var B=0,S=y-1;(E!==0||B<g)&&S!==-1;S--,B++)E+=a*w[S]>>>0,w[S]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,h++}if(f[h]!==" "){for(var b=y-g;b!==y&&w[b]===0;)b++;for(var v=new Uint8Array(x+(y-b)),k=x;b!==y;)v[k++]=w[b++];return v}}}function d(f){var h=m(f);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:m,decode:d}}var S8=A8,B8=S8,_x=B8;var Ed=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Ad=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Tx(this,e)}},Sd=class{decoders;constructor(e){this.decoders=e}or(e){return Tx(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Tx(r,e){return new Sd({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var Bd=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Ed(e,t,n),this.decoder=new Ad(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function _o({name:r,prefix:e,encode:t,decode:n}){return new Bd(r,e,t,n)}function Jn({name:r,prefix:e,alphabet:t}){let{encode:n,decode:i}=_x(t,r);return _o({prefix:e,name:r,encode:n,decode:o=>Zt(i(o))})}function k8(r,e,t,n){let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*t/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let p=i[r[l]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s}function I8(r,e,t){let n=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,o+=e[i&a>>s];if(s!==0&&(o+=e[i&a<<t-s]),n)for(;o.length*t&7;)o+="=";return o}function Ce({name:r,prefix:e,bitsPerChar:t,alphabet:n}){return _o({prefix:e,name:r,encode(i){return I8(i,n,t)},decode(i){return k8(i,n,t,r)}})}var nt=Ce({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Cx=Ce({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),_8=Ce({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),T8=Ce({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),C8=Ce({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),R8=Ce({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),U8=Ce({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),N8=Ce({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),D8=Ce({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Id={};$(Id,{base58btc:()=>Oe,base58flickr:()=>L8});var Oe=Jn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),L8=Jn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var P8=Nx,Rx=128,O8=127,F8=~O8,z8=Math.pow(2,31);function Nx(r,e,t){e=e||[],t=t||0;for(var n=t;r>=z8;)e[t++]=r&255|Rx,r/=128;for(;r&F8;)e[t++]=r&255|Rx,r>>>=7;return e[t]=r|0,Nx.bytes=t-n+1,e}var V8=_d,M8=128,Ux=127;function _d(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw _d.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&Ux)<<i:(s&Ux)*Math.pow(2,i),i+=7}while(s>=M8);return _d.bytes=o-n,t}var $8=Math.pow(2,7),j8=Math.pow(2,14),H8=Math.pow(2,21),q8=Math.pow(2,28),K8=Math.pow(2,35),G8=Math.pow(2,42),W8=Math.pow(2,49),Y8=Math.pow(2,56),X8=Math.pow(2,63),J8=function(r){return r<$8?1:r<j8?2:r<H8?3:r<q8?4:r<K8?5:r<G8?6:r<W8?7:r<Y8?8:r<X8?9:10},Z8={encode:P8,decode:V8,encodingLength:J8},Q8=Z8,ca=Q8;function la(r,e=0){return[ca.decode(r,e),ca.decode.bytes]}function To(r,e,t=0){return ca.encode(r,e,t),e}function Co(r){return ca.encodingLength(r)}function Nr(r,e){let t=e.byteLength,n=Co(r),i=n+Co(t),o=new Uint8Array(i+t);return To(r,o,0),To(t,o,n),o.set(e,i),new Ro(r,t,e,o)}function Ot(r){let e=Zt(r),[t,n]=la(e),[i,o]=la(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Ro(t,i,s,e)}function Dx(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&wd(r.bytes,t.bytes)}}var Ro=class{code;size;digest;bytes;constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};function Lx(r,e){let{bytes:t,version:n}=r;switch(n){case 0:return tA(t,Td(r),e??Oe.encoder);default:return rA(t,Td(r),e??nt.encoder)}}var Px=new WeakMap;function Td(r){let e=Px.get(r);if(e==null){let t=new Map;return Px.set(r,t),t}return e}var z=class r{code;version;multihash;bytes;"/";constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==ua)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==nA)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=Nr(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&&Dx(e.multihash,n.multihash)}toString(e){return Lx(this,e)}toJSON(){return{"/":Lx(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:o,bytes:s}=t;return new r(n,i,o,s??Ox(n,i,o.bytes))}else if(t[iA]===!0){let{version:n,multihash:i,code:o}=t,s=Ot(i);return r.create(n,o,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==ua)throw new Error(`Version 0 CID must use dag-pb (code: ${ua}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=Ox(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,ua,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=Zt(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new Ro(t.multihashCode,t.digestSize,o,i);return[t.version===0?r.createV0(s):r.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[p,m]=la(e.subarray(t));return t+=m,p},i=n(),o=ua;if(i===18?(i=0,t=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,a=n(),c=n(),u=t+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,i]=eA(e,t),o=r.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Td(o).set(n,e),o}};function eA(r,e){switch(r[0]){case"Q":{let t=e??Oe;return[Oe.prefix,t.decode(`${Oe.prefix}${r}`)]}case Oe.prefix:{let t=e??Oe;return[Oe.prefix,t.decode(r)]}case nt.prefix:{let t=e??nt;return[nt.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}}function tA(r,e,t){let{prefix:n}=t;if(n!==Oe.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let o=t.encode(r).slice(1);return e.set(n,o),o}else return i}function rA(r,e,t){let{prefix:n}=t,i=e.get(n);if(i==null){let o=t.encode(r);return e.set(n,o),o}else return i}var ua=112,nA=18;function Ox(r,e,t){let n=Co(r),i=n+Co(e),o=new Uint8Array(i+t.byteLength);return To(r,o,0),To(e,o,n),o.set(t,i),o}var iA=Symbol.for("@ipld/js-cid/CID");var pa=Symbol.for("@libp2p/content-routing");var Cd=Symbol.for("@libp2p/peer-id");function Fx(r){return r!=null&&!!r[Cd]}var da=Symbol.for("@libp2p/peer-routing");var Zn=class r extends Error{code;type;constructor(e="The operation was aborted"){super(e),this.code=r.code,this.type=r.type}static code="ABORT_ERR";static type="aborted"},O=class extends Error{code;props;constructor(e,t,n){super(e),this.code=t,this.name=n?.name??"CodeError",this.props=n??{}}};var Zc=class extends EventTarget{#e=new Map;listenerCount(e){let t=this.#e.get(e);return t==null?0:t.length}addEventListener(e,t,n){super.addEventListener(e,t,n);let i=this.#e.get(e);i==null&&(i=[],this.#e.set(e,i)),i.push({callback:t,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(e,t,n){super.removeEventListener(e.toString(),t??null,n);let i=this.#e.get(e);i!=null&&(i=i.filter(({callback:o})=>o!==t),this.#e.set(e,i))}dispatchEvent(e){let t=super.dispatchEvent(e),n=this.#e.get(e.type);return n==null||(n=n.filter(({once:i})=>!i),this.#e.set(e.type,n)),t}safeDispatchEvent(e,t={}){return this.dispatchEvent(new oA(e,t))}},Rd=class extends Event{detail;constructor(e,t){super(e,t),this.detail=t?.detail}},oA=globalThis.CustomEvent??Rd;var Qc=(r,...e)=>{try{[...e]}catch{}};function zx(r){return r!=null&&typeof r.start=="function"&&typeof r.stop=="function"}async function Qn(...r){let e=[];for(let t of r)zx(t)&&e.push(t);await Promise.all(e.map(async t=>{t.beforeStart!=null&&await t.beforeStart()})),await Promise.all(e.map(async t=>{await t.start()})),await Promise.all(e.map(async t=>{t.afterStart!=null&&await t.afterStart()}))}async function ei(...r){let e=[];for(let t of r)zx(t)&&e.push(t);await Promise.all(e.map(async t=>{t.beforeStop!=null&&await t.beforeStop()})),await Promise.all(e.map(async t=>{await t.stop()})),await Promise.all(e.map(async t=>{t.afterStop!=null&&await t.afterStop()}))}var Dd={};$(Dd,{sha256:()=>ae,sha512:()=>Nd});function $i({name:r,code:e,encode:t}){return new Ud(r,e,t)}var Ud=class{name;code;encode;constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?Nr(this.code,t):t.then(n=>Nr(this.code,n))}else throw Error("Unknown type, must be binary type")}};function Mx(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var ae=$i({name:"sha2-256",code:18,encode:Mx("SHA-256")}),Nd=$i({name:"sha2-512",code:19,encode:Mx("SHA-512")});var zt=Q(Pd(),1);var Od={};$(Od,{base64:()=>Lr,base64pad:()=>yA,base64url:()=>qx,base64urlpad:()=>wA});var Lr=Ce({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),yA=Ce({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),qx=Ce({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),wA=Ce({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});zt.default.formatters.b=r=>r==null?"undefined":Oe.baseEncode(r);zt.default.formatters.t=r=>r==null?"undefined":nt.baseEncode(r);zt.default.formatters.m=r=>r==null?"undefined":Lr.baseEncode(r);zt.default.formatters.p=r=>r==null?"undefined":r.toString();zt.default.formatters.c=r=>r==null?"undefined":r.toString();zt.default.formatters.k=r=>r==null?"undefined":r.toString();zt.default.formatters.a=r=>r==null?"undefined":r.toString();function bA(r){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=r,e.destroy=()=>!0,e.extend=()=>e,e}function Kx(){return{forComponent(r){return ue(r)}}}function ue(r){let e=bA(`${r}:trace`);return zt.default.enabled(`${r}:trace`)&&zt.default.names.map(t=>t.toString()).find(t=>t.includes(":trace"))!=null&&(e=(0,zt.default)(`${r}:trace`)),Object.assign((0,zt.default)(r),{error:(0,zt.default)(`${r}:error`),trace:e})}function ge(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function ti(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function ln(r=0){return globalThis.Buffer?.alloc!=null?ti(globalThis.Buffer.alloc(r)):new Uint8Array(r)}function Bt(r=0){return globalThis.Buffer?.allocUnsafe!=null?ti(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}var DA=Math.pow(2,7),LA=Math.pow(2,14),PA=Math.pow(2,21),Vd=Math.pow(2,28),Md=Math.pow(2,35),$d=Math.pow(2,42),jd=Math.pow(2,49),xe=128,pt=127;function Fe(r){if(r<DA)return 1;if(r<LA)return 2;if(r<PA)return 3;if(r<Vd)return 4;if(r<Md)return 5;if(r<$d)return 6;if(r<jd)return 7;if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Hd(r,e,t=0){switch(Fe(r)){case 8:e[t++]=r&255|xe,r/=128;case 7:e[t++]=r&255|xe,r/=128;case 6:e[t++]=r&255|xe,r/=128;case 5:e[t++]=r&255|xe,r/=128;case 4:e[t++]=r&255|xe,r>>>=7;case 3:e[t++]=r&255|xe,r>>>=7;case 2:e[t++]=r&255|xe,r>>>=7;case 1:{e[t++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return e}function OA(r,e,t=0){switch(Fe(r)){case 8:e.set(t++,r&255|xe),r/=128;case 7:e.set(t++,r&255|xe),r/=128;case 6:e.set(t++,r&255|xe),r/=128;case 5:e.set(t++,r&255|xe),r/=128;case 4:e.set(t++,r&255|xe),r>>>=7;case 3:e.set(t++,r&255|xe),r>>>=7;case 2:e.set(t++,r&255|xe),r>>>=7;case 1:{e.set(t++,r&255),r>>>=7;break}default:throw new Error("unreachable")}return e}function qd(r,e){let t=r[e],n=0;if(n+=t&pt,t<xe||(t=r[e+1],n+=(t&pt)<<7,t<xe)||(t=r[e+2],n+=(t&pt)<<14,t<xe)||(t=r[e+3],n+=(t&pt)<<21,t<xe)||(t=r[e+4],n+=(t&pt)*Vd,t<xe)||(t=r[e+5],n+=(t&pt)*Md,t<xe)||(t=r[e+6],n+=(t&pt)*$d,t<xe)||(t=r[e+7],n+=(t&pt)*jd,t<xe))return n;throw new RangeError("Could not decode varint")}function FA(r,e){let t=r.get(e),n=0;if(n+=t&pt,t<xe||(t=r.get(e+1),n+=(t&pt)<<7,t<xe)||(t=r.get(e+2),n+=(t&pt)<<14,t<xe)||(t=r.get(e+3),n+=(t&pt)<<21,t<xe)||(t=r.get(e+4),n+=(t&pt)*Vd,t<xe)||(t=r.get(e+5),n+=(t&pt)*Md,t<xe)||(t=r.get(e+6),n+=(t&pt)*$d,t<xe)||(t=r.get(e+7),n+=(t&pt)*jd,t<xe))return n;throw new RangeError("Could not decode varint")}function Qt(r,e,t=0){return e==null&&(e=Bt(Fe(r))),e instanceof Uint8Array?Hd(r,e,t):OA(r,e,t)}function kt(r,e=0){return r instanceof Uint8Array?qd(r,e):FA(r,e)}var Kd=new Float32Array([-0]),ri=new Uint8Array(Kd.buffer);function r1(r,e,t){Kd[0]=r,e[t]=ri[0],e[t+1]=ri[1],e[t+2]=ri[2],e[t+3]=ri[3]}function n1(r,e){return ri[0]=r[e],ri[1]=r[e+1],ri[2]=r[e+2],ri[3]=r[e+3],Kd[0]}var Gd=new Float64Array([-0]),dt=new Uint8Array(Gd.buffer);function i1(r,e,t){Gd[0]=r,e[t]=dt[0],e[t+1]=dt[1],e[t+2]=dt[2],e[t+3]=dt[3],e[t+4]=dt[4],e[t+5]=dt[5],e[t+6]=dt[6],e[t+7]=dt[7]}function o1(r,e){return dt[0]=r[e],dt[1]=r[e+1],dt[2]=r[e+2],dt[3]=r[e+3],dt[4]=r[e+4],dt[5]=r[e+5],dt[6]=r[e+6],dt[7]=r[e+7],Gd[0]}var zA=BigInt(Number.MAX_SAFE_INTEGER),VA=BigInt(Number.MIN_SAFE_INTEGER),Vt=class r{lo;hi;constructor(e,t){this.lo=e|0,this.hi=t|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let t=~this.lo+1>>>0,n=~this.hi>>>0;return t===0&&(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let t=~this.lo+1>>>0,n=~this.hi>>>0;return t===0&&(n=n+1>>>0),-(BigInt(t)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return Hi;if(e<zA&&e>VA)return this.fromNumber(Number(e));let t=e<0n;t&&(e=-e);let n=e>>32n,i=e-(n<<32n);return t&&(n=~n|0n,i=~i|0n,++i>s1&&(i=0n,++n>s1&&(n=0n))),new r(Number(i),Number(n))}static fromNumber(e){if(e===0)return Hi;let t=e<0;t&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new r(n,i)}static from(e){return typeof e=="number"?r.fromNumber(e):typeof e=="bigint"?r.fromBigInt(e):typeof e=="string"?r.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new r(e.low>>>0,e.high>>>0):Hi}},Hi=new Vt(0,0);Hi.toBigInt=function(){return 0n};Hi.zzEncode=Hi.zzDecode=function(){return this};Hi.length=function(){return 1};var s1=4294967296n;function a1(r){let e=0,t=0;for(let n=0;n<r.length;++n)t=r.charCodeAt(n),t<128?e+=1:t<2048?e+=2:(t&64512)===55296&&(r.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function c1(r,e,t){if(t-e<1)return"";let i,o=[],s=0,a;for(;e<t;)a=r[e++],a<128?o[s++]=a:a>191&&a<224?o[s++]=(a&31)<<6|r[e++]&63:a>239&&a<365?(a=((a&7)<<18|(r[e++]&63)<<12|(r[e++]&63)<<6|r[e++]&63)-65536,o[s++]=55296+(a>>10),o[s++]=56320+(a&1023)):o[s++]=(a&15)<<12|(r[e++]&63)<<6|r[e++]&63,s>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i!=null?(s>0&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))}function Wd(r,e,t){let n=t,i,o;for(let s=0;s<r.length;++s)i=r.charCodeAt(s),i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&((o=r.charCodeAt(s+1))&64512)===56320?(i=65536+((i&1023)<<10)+(o&1023),++s,e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128);return t-n}function dr(r,e){return RangeError(`index out of range: ${r.pos} + ${e??1} > ${r.len}`)}function il(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}var Yd=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,dr(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw dr(this,4);return il(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw dr(this,4);return il(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw dr(this,4);let e=n1(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw dr(this,4);let e=o1(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw dr(this,e);return this.pos+=e,t===n?new Uint8Array(0):this.buf.subarray(t,n)}string(){let e=this.bytes();return c1(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw dr(this,e);this.pos+=e}else do if(this.pos>=this.len)throw dr(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Vt(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw dr(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw dr(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw dr(this,8);let e=il(this.buf,this.pos+=4),t=il(this.buf,this.pos+=4);return new Vt(e,t)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let e=qd(this.buf,this.pos);return this.pos+=Fe(e),e}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Xd(r){return new Yd(r instanceof Uint8Array?r:r.subarray())}function er(r,e,t){let n=Xd(r);return e.decode(n,void 0,t)}var Jd={};$(Jd,{base10:()=>MA});var MA=Jn({prefix:"9",name:"base10",alphabet:"0123456789"});var Zd={};$(Zd,{base16:()=>$A,base16upper:()=>jA});var $A=Ce({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),jA=Ce({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Qd={};$(Qd,{base2:()=>HA});var HA=Ce({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ef={};$(ef,{base256emoji:()=>YA});var u1=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),qA=u1.reduce((r,e,t)=>(r[t]=e,r),[]),KA=u1.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function GA(r){return r.reduce((e,t)=>(e+=qA[t],e),"")}function WA(r){let e=[];for(let t of r){let n=KA[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var YA=_o({prefix:"\u{1F680}",name:"base256emoji",encode:GA,decode:WA});var tf={};$(tf,{base36:()=>ni,base36upper:()=>XA});var ni=Jn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),XA=Jn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var rf={};$(rf,{base8:()=>JA});var JA=Ce({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var nf={};$(nf,{identity:()=>ZA});var ZA=_o({prefix:"\0",name:"identity",encode:r=>vd(r),decode:r=>bd(r)});var QA=new TextEncoder,e5=new TextDecoder;var Lo=512;function p1(r){return QA.encode(JSON.stringify(r))}function d1(r){return JSON.parse(e5.decode(r))}var tr={};$(tr,{code:()=>je,decode:()=>sf,encode:()=>r5,name:()=>t5});var t5="raw",je=85;function r5(r){return Zt(r)}function sf(r){return Zt(r)}var af={};$(af,{identity:()=>It});var f1=0,n5="identity",h1=Zt;function i5(r){return Nr(f1,h1(r))}var It={code:f1,name:n5,encode:h1,digest:i5};var ii={...nf,...Qd,...rf,...Jd,...Zd,...kd,...tf,...Id,...Od,...ef},q7={...Dd,...af};function g1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var m1=g1("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),cf=g1("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=Bt(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),o5={utf8:m1,"utf-8":m1,hex:ii.base16,latin1:cf,ascii:cf,binary:cf,...ii},ol=o5;function Z(r,e="utf8"){let t=ol[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ti(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}function lf(r){let e=r??8192,t=e>>>1,n,i=e;return function(s){if(s<1||s>t)return Bt(s);i+s>e&&(n=Bt(e),i=0);let a=n.subarray(i,i+=s);return i&7&&(i=(i|7)+1),a}}var qi=class{fn;len;next;val;constructor(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}};function uf(){}var df=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},s5=lf();function a5(r){return globalThis.Buffer!=null?Bt(r):s5(r)}var ha=class{len;head;tail;states;constructor(){this.len=0,this.head=new qi(uf,0,0),this.tail=this.head,this.states=null}_push(e,t,n){return this.tail=this.tail.next=new qi(e,t,n),this.len+=t,this}uint32(e){return this.len+=(this.tail=this.tail.next=new ff((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(sl,10,Vt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let t=Vt.fromBigInt(e);return this._push(sl,t.length(),t)}uint64Number(e){return this._push(Hd,Fe(e),e)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let t=Vt.fromBigInt(e).zzEncode();return this._push(sl,t.length(),t)}sint64Number(e){let t=Vt.fromNumber(e).zzEncode();return this._push(sl,t.length(),t)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(pf,1,e?1:0)}fixed32(e){return this._push(fa,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let t=Vt.fromBigInt(e);return this._push(fa,4,t.lo)._push(fa,4,t.hi)}fixed64Number(e){let t=Vt.fromNumber(e);return this._push(fa,4,t.lo)._push(fa,4,t.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(r1,4,e)}double(e){return this._push(i1,8,e)}bytes(e){let t=e.length>>>0;return t===0?this._push(pf,1,0):this.uint32(t)._push(l5,t,e)}string(e){let t=a1(e);return t!==0?this.uint32(t)._push(Wd,t,e):this._push(pf,1,0)}fork(){return this.states=new df(this),this.head=this.tail=new qi(uf,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new qi(uf,0,0),this.len=0),this}ldelim(){let e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=t,this.len+=n),this}finish(){let e=this.head.next,t=a5(this.len),n=0;for(;e!=null;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t}};function pf(r,e,t){e[t]=r&255}function c5(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}var ff=class extends qi{next;constructor(e,t){super(c5,e,t),this.next=void 0}};function sl(r,e,t){for(;r.hi!==0;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}function fa(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function l5(r,e,t){e.set(r,t)}globalThis.Buffer!=null&&(ha.prototype.bytes=function(r){let e=r.length>>>0;return this.uint32(e),e>0&&this._push(u5,e,r),this},ha.prototype.string=function(r){let e=globalThis.Buffer.byteLength(r);return this.uint32(e),e>0&&this._push(p5,e,r),this});function u5(r,e,t){e.set(r,t)}function p5(r,e,t){r.length<40?Wd(r,e,t):e.utf8Write!=null?e.utf8Write(r,t):e.set(Z(r),t)}function hf(){return new ha}function rr(r,e){let t=hf();return e.encode(r,t,{lengthDelimited:!1}),t.finish()}var Po;(function(r){r[r.VARINT=0]="VARINT",r[r.BIT64=1]="BIT64",r[r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",r[r.START_GROUP=3]="START_GROUP",r[r.END_GROUP=4]="END_GROUP",r[r.BIT32=5]="BIT32"})(Po||(Po={}));function al(r,e,t,n){return{name:r,type:e,encode:t,decode:n}}function Ki(r){function e(i){if(r[i.toString()]==null)throw new Error("Invalid enum value");return r[i]}let t=function(o,s){let a=e(o);s.int32(a)},n=function(o){let s=o.int32();return e(s)};return al("enum",Po.VARINT,t,n)}function nr(r,e){return al("message",Po.LENGTH_DELIMITED,r,e)}function d5(r){return r[Symbol.asyncIterator]!=null}function f5(r){if(d5(r))return(async()=>{for await(let e of r);})();for(let e of r);}var Gi=f5;function ze(r,e){if(globalThis.Buffer!=null)return ti(globalThis.Buffer.concat(r,e));e==null&&(e=r.reduce((i,o)=>i+o.length,0));let t=Bt(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return ti(t)}var y1=Symbol.for("@achingbrain/uint8arraylist");function x1(r,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let t=0;for(let n of r){let i=t+n.byteLength;if(e<i)return{buf:n,index:e-t};t=i}throw new RangeError("index is out of bounds")}function cl(r){return!!r?.[y1]}var Wi=class r{bufs;length;[y1]=!0;constructor(...e){this.bufs=[],this.length=0,e.length>0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let n of e)if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.push(n);else if(cl(n))t+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let n of e.reverse())if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.unshift(n);else if(cl(n))t+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=x1(this.bufs,e);return t.buf[t.index]}set(e,t){let n=x1(this.bufs,e);n.buf[n.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let n=0;n<e.length;n++)this.set(t+n,e[n]);else if(cl(e))for(let n=0;n<e.length;n++)this.set(t+n,e.get(n));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0)){if(e===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,t){let{bufs:n,length:i}=this._subList(e,t);return ze(n,i)}subarray(e,t){let{bufs:n,length:i}=this._subList(e,t);return n.length===1?n[0]:ze(n,i)}sublist(e,t){let{bufs:n,length:i}=this._subList(e,t),o=new r;return o.length=i,o.bufs=[...n],o}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:this.bufs,length:this.length};let n=[],i=0;for(let o=0;o<this.bufs.length;o++){let s=this.bufs[o],a=i,c=a+s.byteLength;if(i=c,e>=c)continue;let u=e>=a&&e<c,l=t>a&&t<=c;if(u&&l){if(e===a&&t===c){n.push(s);break}let p=e-a;n.push(s.subarray(p,p+(t-e)));break}if(u){if(e===0){n.push(s);continue}n.push(s.subarray(e-a));continue}if(l){if(t===c){n.push(s);break}n.push(s.subarray(0,t-a));break}n.push(s)}return{bufs:n,length:t-e}}indexOf(e,t=0){if(!cl(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let o=256,s=new Int32Array(o);for(let p=0;p<o;p++)s[p]=-1;for(let p=0;p<i;p++)s[n[p]]=p;let a=s,c=this.byteLength-n.byteLength,u=n.byteLength-1,l;for(let p=t;p<=c;p+=l){l=0;for(let m=u;m>=0;m--){let d=this.get(p+m);if(n[m]!==d){l=Math.max(1,m-a[d]);break}}if(l===0)return p}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let n=Bt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,t),this.write(n,e)}getInt16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,t)}setInt16(e,t,n){let i=ln(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,t,n),this.write(i,e)}getInt32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,t)}setInt32(e,t,n){let i=ln(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,t,n),this.write(i,e)}getBigInt64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,t)}setBigInt64(e,t,n){let i=ln(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,t,n),this.write(i,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let n=Bt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,t),this.write(n,e)}getUint16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,t)}setUint16(e,t,n){let i=ln(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,t,n),this.write(i,e)}getUint32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,t)}setUint32(e,t,n){let i=ln(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,t,n),this.write(i,e)}getBigUint64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,t)}setBigUint64(e,t,n){let i=ln(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,t,n),this.write(i,e)}getFloat32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,t)}setFloat32(e,t,n){let i=ln(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,t,n),this.write(i,e)}getFloat64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,t)}setFloat64(e,t,n){let i=ln(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,t,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof r)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;t<this.bufs.length;t++)if(!ge(this.bufs[t],e.bufs[t]))return!1;return!0}static fromUint8Arrays(e,t){let n=new r;return n.bufs=e,t==null&&(t=e.reduce((i,o)=>i+o.byteLength,0)),n.length=t,n}};function m5(r){return r[Symbol.asyncIterator]!=null}function g5(r,e){if(m5(r))return async function*(){for await(let a of r)yield e(a)}();let t=ko(r),{value:n,done:i}=t.next();if(i===!0)return function*(){}();let o=e(n);if(typeof o.then=="function")return async function*(){yield await o;for await(let a of t)yield e(a)}();let s=e;return function*(){yield o;for(let a of t)yield s(a)}()}var fr=g5;function He(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}var ll=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Oo=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new ll(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new ll(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var mf=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function Pr(r={}){return x5(t=>{let n=t.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},r)}function x5(r,e){e=e??{};let t=e.onEnd,n=new Oo,i,o,s,a=He(),c=async()=>{try{return n.isEmpty()?s?{done:!0}:await new Promise((x,g)=>{o=y=>{o=null,n.push(y);try{x(r(n))}catch(w){g(w)}return i}}):r(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=He()})}},u=x=>o!=null?o(x):(n.push(x),i),l=x=>(n=new Oo,o!=null?o({error:x}):(n.push({error:x}),i)),p=x=>{if(s)return i;if(e?.objectMode!==!0&&x?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return u({done:!1,value:x})},m=x=>s?i:(s=!0,x!=null?l(x):u({done:!0})),d=()=>(n=new Oo,m(),{done:!0}),f=x=>(m(x),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:d,throw:f,push:p,end:m,get readableLength(){return n.size},onEmpty:async x=>{let g=x?.signal;if(g?.throwIfAborted(),n.isEmpty())return;let y,w;g!=null&&(y=new Promise((E,B)=>{w=()=>{B(new mf)},g.addEventListener("abort",w)}));try{await Promise.race([a.promise,y])}finally{w!=null&&g!=null&&g?.removeEventListener("abort",w)}}},t==null)return i;let h=i;return i={[Symbol.asyncIterator](){return this},next(){return h.next()},throw(x){return h.throw(x),t!=null&&(t(x),t=void 0),{done:!0}},return(){return h.return(),t!=null&&(t(),t=void 0),{done:!0}},push:p,end(x){return h.end(x),t!=null&&(t(x),t=void 0),i},get readableLength(){return h.readableLength},onEmpty:x=>h.onEmpty(x)},i}function y5(r){return r[Symbol.asyncIterator]!=null}function w5(...r){let e=[];for(let t of r)y5(t)||e.push(t);return e.length===r.length?function*(){for(let t of e)yield*t}():async function*(){let t=Pr({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(r.map(async n=>{for await(let i of n)t.push(i)})),t.end()}catch(n){t.end(n)}}),yield*t}()}var oi=w5;function hr(r,...e){if(r==null)throw new Error("Empty pipeline");if(gf(r)){let n=r;r=()=>n.source}else if(E1(r)||v1(r)){let n=r;r=()=>n}let t=[r,...e];if(t.length>1&&gf(t[t.length-1])&&(t[t.length-1]=t[t.length-1].sink),t.length>2)for(let n=1;n<t.length-1;n++)gf(t[n])&&(t[n]=v5(t[n]));return b5(...t)}var b5=(...r)=>{let e;for(;r.length>0;)e=r.shift()(e);return e},v1=r=>r?.[Symbol.asyncIterator]!=null,E1=r=>r?.[Symbol.iterator]!=null,gf=r=>r==null?!1:r.sink!=null&&r.source!=null,v5=r=>e=>{let t=r.sink(e);if(t?.then!=null){let n=Pr({objectMode:!0});t.then(()=>{n.end()},s=>{n.end(s)});let i,o=r.source;if(v1(o))i=async function*(){yield*o,n.end()};else if(E1(o))i=function*(){yield*o,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return oi(n,i())}return r.source};function E5(r){return r[Symbol.asyncIterator]!=null}function A5(r,e){return E5(r)?async function*(){let t=0;if(!(e<1)){for await(let n of r)if(yield n,t++,t===e)return}}():function*(){let t=0;if(!(e<1)){for(let n of r)if(yield n,t++,t===e)return}}()}var ul=A5;var P=class extends Event{constructor(e,t){super(e),this.detail=t}};function ie(r,e="utf8"){let t=ol[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var pl=class{url;#e=0;#t=0;#r=0;#n=0;constructor(e){this.url=e instanceof URL?e:new URL(e)}async getRawBlock(e,t){let n=this.url;if(n.pathname=`/ipfs/${e.toString()}`,n.search="?format=raw",t?.aborted===!0)throw new Error(`Signal to fetch raw block for CID ${e} from gateway ${this.url} was aborted prior to fetch`);try{this.#e++;let i=await fetch(n.toString(),{signal:t,headers:{Accept:"application/vnd.ipld.raw"},cache:"force-cache"});if(!i.ok)throw this.#t++,new Error(`unable to fetch raw block for CID ${e} from gateway ${this.url}`);return this.#n++,new Uint8Array(await i.arrayBuffer())}catch{throw t?.aborted===!0?new Error(`fetching raw block for CID ${e} from gateway ${this.url} was aborted`):(this.#t++,new Error(`unable to fetch raw block for CID ${e}`))}}reliability(){return this.#e===0?1:this.#r>0?-1/0:this.#n/(this.#e+this.#t*3)}incrementInvalidBlocks(){this.#r++}};var dl=class{gateways;log;constructor(e,t={}){this.log=e.logger.forComponent("helia:trustless-gateway-block-broker"),this.gateways=(t.gateways??A1).map(n=>new pl(n))}async retrieve(e,t={}){let n=this.gateways.sort((o,s)=>s.reliability()-o.reliability()),i=[];for(let o of n){this.log("getting block for %c from %s",e,o.url);try{let s=await o.getRawBlock(e,t.signal);this.log.trace("got block for %c from %s",e,o.url);try{await t.validateFn?.(s)}catch(a){throw this.log.error("failed to validate block for %c from %s",e,o.url,a),o.incrementInvalidBlocks(),new Error(`unable to validate block for CID ${e} from gateway ${o.url}`)}return s}catch(s){if(this.log.error("failed to get block for %c from %s",e,o.url,s),s instanceof Error?i.push(s):i.push(new Error(`unable to fetch raw block for CID ${e} from gateway ${o.url}`)),t.signal?.aborted===!0){this.log.trace("request aborted while fetching raw block for CID %c from gateway %s",e,o.url);break}}}throw new AggregateError(i,`unable to fetch raw block for CID ${e} from any gateway`)}};var A1=["https://trustless-gateway.link","https://cloudflare-ipfs.com","https://4everland.io"];function ma(r={}){return e=>new dl(e,r)}var S5=Symbol.for("nodejs.util.inspect.custom"),S1=Object.values(ii).map(r=>r.decoder).reduce((r,e)=>r.or(e),ii.identity.decoder),B1=114,xf=36,yf=37,ga=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Cd]=!0;toString(){return this.string==null&&(this.string=Oe.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return z.createV1(B1,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e==null)return!1;if(e instanceof Uint8Array)return ge(this.multihash.bytes,e);if(typeof e=="string")return mr(e).equals(this);if(e?.multihash?.bytes!=null)return ge(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[S5](){return`PeerId(${this.toString()})`}},Fo=class extends ga{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},zo=class extends ga{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},Vo=class extends ga{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function mr(r,e){if(e=e??S1,r.charAt(0)==="1"||r.charAt(0)==="Q"){let t=Ot(Oe.decode(`z${r}`));return r.startsWith("12D")?new zo({multihash:t}):r.startsWith("16U")?new Vo({multihash:t}):new Fo({multihash:t})}return xa(S1.decode(r))}function xa(r){try{let e=Ot(r);if(e.code===It.code){if(e.digest.length===xf)return new zo({multihash:e});if(e.digest.length===yf)return new Vo({multihash:e})}if(e.code===ae.code)return new Fo({multihash:e})}catch{return B5(z.decode(r))}throw new Error("Supplied PeerID CID is invalid")}function B5(r){if(r==null||r.multihash==null||r.version==null||r.version===1&&r.code!==B1)throw new Error("Supplied PeerID CID is invalid");let e=r.multihash;if(e.code===ae.code)return new Fo({multihash:r.multihash});if(e.code===It.code){if(e.digest.length===xf)return new zo({multihash:r.multihash});if(e.digest.length===yf)return new Vo({multihash:r.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function k1(r,e){return r.length===xf?new zo({multihash:Nr(It.code,r),privateKey:e}):r.length===yf?new Vo({multihash:Nr(It.code,r),privateKey:e}):new Fo({multihash:await ae.digest(r),publicKey:r,privateKey:e})}var fl=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let t=this.index,n=e();return n===void 0&&(this.index=t),n}parseWith(e){let t=e();if(this.index===this.input.length)return t}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let t=this.readChar();if(t===e)return t})}readSeparator(e,t,n){return this.readAtomically(()=>{if(!(t>0&&this.readGivenChar(e)===void 0))return n()})}readNumber(e,t,n,i){return this.readAtomically(()=>{let o=0,s=0,a=this.peekChar();if(a===void 0)return;let c=a==="0",u=2**(8*i)-1;for(;;){let l=this.readAtomically(()=>{let p=this.readChar();if(p===void 0)return;let m=Number.parseInt(p,e);if(!Number.isNaN(m))return m});if(l===void 0)break;if(o*=e,o+=l,o>u||(s+=1,t!==void 0&&s>t))return}if(s!==0)return!n&&c&&s>1?void 0:o})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let t=0;t<e.length;t++){let n=this.readSeparator(".",t,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;e[t]=n}return e})}readIPv6Addr(){let e=t=>{for(let n=0;n<t.length/2;n++){let i=n*2;if(n<t.length-3){let s=this.readSeparator(":",n,()=>this.readIPv4Addr());if(s!==void 0)return t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=s[3],[i+4,!0]}let o=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(o===void 0)return[i,!1];t[i]=o>>8,t[i+1]=o&255}return[t.length,!1]};return this.readAtomically(()=>{let t=new Uint8Array(16),[n,i]=e(t);if(n===16)return t;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let o=new Uint8Array(14),s=16-(n+2),[a]=e(o.subarray(0,s));return t.set(o.subarray(0,a),16-a),t})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var I1=45,k5=15,Mo=new fl;function wf(r){if(!(r.length>k5))return Mo.new(r).parseWith(()=>Mo.readIPv4Addr())}function bf(r){if(r.includes("%")&&(r=r.split("%")[0]),!(r.length>I1))return Mo.new(r).parseWith(()=>Mo.readIPv6Addr())}function hl(r){if(r.includes("%")&&(r=r.split("%")[0]),!(r.length>I1))return Mo.new(r).parseWith(()=>Mo.readIPAddr())}var vF=parseInt("0xFFFF",16),EF=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function $o(r){return!!wf(r)}function jo(r){return!!bf(r)}function ir(r){return!!hl(r)}var T1=$o,R5=jo,Ef=function(r){let e=0;if(r=r.toString().trim(),T1(r)){let t=new Uint8Array(e+4);return r.split(/\./g).forEach(n=>{t[e++]=parseInt(n,10)&255}),t}if(R5(r)){let t=r.split(":",8),n;for(n=0;n<t.length;n++){let o=T1(t[n]),s;o&&(s=Ef(t[n]),t[n]=ie(s.slice(0,2),"base16")),s!=null&&++n<8&&t.splice(n,0,ie(s.slice(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(n=0;n<t.length&&t[n]!=="";n++);let o=[n,1];for(n=9-t.length;n>0;n--)o.push("0");t.splice.apply(t,o)}let i=new Uint8Array(e+16);for(n=0;n<t.length;n++){let o=parseInt(t[n],16);i[e++]=o>>8&255,i[e++]=o&255}return i}throw new Error("invalid ip address")},C1=function(r,e=0,t){e=~~e,t=t??r.length-e;let n=new DataView(r.buffer);if(t===4){let i=[];for(let o=0;o<t;o++)i.push(r[e+o]);return i.join(".")}if(t===16){let i=[];for(let o=0;o<t;o+=2)i.push(n.getUint16(e+o).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Ho={},Af={},N5=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,-1,"memory"]];N5.forEach(r=>{let e=D5(...r);Af[e.code]=e,Ho[e.name]=e});function D5(r,e,t,n,i){return{code:r,size:e,name:t,resolvable:!!n,path:!!i}}function ve(r){if(typeof r=="number"){if(Af[r]!=null)return Af[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Ho[r]!=null)return Ho[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var o9=ve("ip4"),s9=ve("ip6"),a9=ve("ipcidr");function Bf(r,e){switch(ve(r).code){case 4:case 41:return P5(e);case 42:return N1(e);case 6:case 273:case 33:case 132:return L1(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return N1(e);case 421:return V5(e);case 444:return D1(e);case 445:return D1(e);case 466:return z5(e);default:return ie(e,"base16")}}function kf(r,e){switch(ve(r).code){case 4:return R1(e);case 41:return R1(e);case 42:return U1(e);case 6:case 273:case 33:case 132:return If(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return U1(e);case 421:return O5(e);case 444:return M5(e);case 445:return $5(e);case 466:return F5(e);default:return Z(e,"base16")}}var Sf=Object.values(ii).map(r=>r.decoder),L5=function(){let r=Sf[0].or(Sf[1]);return Sf.slice(2).forEach(e=>r=r.or(e)),r}();function R1(r){if(!ir(r))throw new Error("invalid ip address");return Ef(r)}function P5(r){let e=C1(r,0,r.length);if(e==null)throw new Error("ipBuff is required");if(!ir(e))throw new Error("invalid ip address");return e}function If(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r),new Uint8Array(e)}function L1(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function U1(r){let e=Z(r),t=Uint8Array.from(Qt(e.length));return ze([t,e],t.length+e.length)}function N1(r){let e=kt(r);if(r=r.slice(Fe(e)),r.length!==e)throw new Error("inconsistent lengths");return ie(r)}function O5(r){let e;r[0]==="Q"||r[0]==="1"?e=Ot(Oe.decode(`z${r}`)).bytes:e=z.parse(r).multihash.bytes;let t=Uint8Array.from(Qt(e.length));return ze([t,e],t.length+e.length)}function F5(r){let e=L5.decode(r),t=Uint8Array.from(Qt(e.length));return ze([t,e],t.length+e.length)}function z5(r){let e=kt(r),t=r.slice(Fe(e));if(t.length!==e)throw new Error("inconsistent lengths");return"u"+ie(t,"base64url")}function V5(r){let e=kt(r),t=r.slice(Fe(e));if(t.length!==e)throw new Error("inconsistent lengths");return ie(t,"base58btc")}function M5(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=nt.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=If(n);return ze([t,i],t.length+i.length)}function $5(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=nt.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=If(n);return ze([t,i],t.length+i.length)}function D1(r){let e=r.slice(0,r.length-2),t=r.slice(r.length-2),n=ie(e,"base32"),i=L1(t);return`${n}:${i}`}function P1(r){r=_f(r);let e=[],t=[],n=null,i=r.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let o=0;o<i.length;o++){let s=i[o],a=ve(s);if(a.size===0){e.push([a.code]),t.push([a.code]);continue}if(o++,o>=i.length)throw F1("invalid address: "+r);if(a.path===!0){n=_f(i.slice(o).join("/")),e.push([a.code,kf(a.code,n)]),t.push([a.code,n]);break}let c=kf(a.code,i[o]);e.push([a.code,c]),t.push([a.code,Bf(a.code,c)])}return{string:O1(t),bytes:Cf(e),tuples:e,stringTuples:t,path:n}}function Tf(r){let e=[],t=[],n=null,i=0;for(;i<r.length;){let o=kt(r,i),s=Fe(o),a=ve(o),c=j5(a,r.slice(i+s));if(c===0){e.push([o]),t.push([o]),i+=s;continue}let u=r.slice(i+s,i+s+c);if(i+=c+s,i>r.length)throw F1("Invalid address Uint8Array: "+ie(r,"base16"));e.push([o,u]);let l=Bf(o,u);if(t.push([o,l]),a.path===!0){n=l;break}}return{bytes:Uint8Array.from(r),string:O1(t),tuples:e,stringTuples:t,path:n}}function O1(r){let e=[];return r.map(t=>{let n=ve(t[0]);return e.push(n.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),_f(e.join("/"))}function Cf(r){return ze(r.map(e=>{let t=ve(e[0]),n=Uint8Array.from(Qt(t.code));return e.length>1&&e[1]!=null&&(n=ze([n,e[1]])),n}))}function j5(r,e){if(r.size>0)return r.size/8;if(r.size===0)return 0;{let t=kt(e instanceof Uint8Array?e:Uint8Array.from(e));return t+Fe(t)}}function _f(r){return"/"+r.trim().split("/").filter(e=>e).join("/")}function F1(r){return new Error("Error parsing address: "+r)}var H5=Symbol.for("nodejs.util.inspect.custom"),Rf=Symbol.for("@multiformats/js-multiaddr/multiaddr"),q5=[ve("dns").code,ve("dns4").code,ve("dns6").code,ve("dnsaddr").code],ml=class r{bytes;#e;#t;#r;#n;[Rf]=!0;constructor(e){e==null&&(e="");let t;if(e instanceof Uint8Array)t=Tf(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);t=P1(e)}else if(V1(e))t=Tf(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=t.bytes,this.#e=t.string,this.#t=t.tuples,this.#r=t.stringTuples,this.#n=t.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let e,t,n,i,o="",s=ve("tcp"),a=ve("udp"),c=ve("ip4"),u=ve("ip6"),l=ve("dns6"),p=ve("ip6zone");for(let[d,f]of this.stringTuples())d===p.code&&(o=`%${f??""}`),q5.includes(d)&&(t=s.name,i=443,n=`${f??""}${o}`,e=d===l.code?6:4),(d===s.code||d===a.code)&&(t=ve(d).name,i=parseInt(f??"")),(d===c.code||d===u.code)&&(t=ve(d).name,n=`${f??""}${o}`,e=d===u.code?6:4);if(e==null||t==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:t,port:i}}protos(){return this.#t.map(([e])=>Object.assign({},ve(e)))}protoCodes(){return this.#t.map(([e])=>e)}protoNames(){return this.#t.map(([e])=>ve(e).name)}tuples(){return this.#t}stringTuples(){return this.#r}encapsulate(e){return e=new r(e),new r(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),n=this.toString(),i=n.lastIndexOf(t);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new r(n.slice(0,i))}decapsulateCode(e){let t=this.tuples();for(let n=t.length-1;n>=0;n--)if(t[n][0]===e)return new r(Cf(t.slice(0,n)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([n,i])=>{n===Ho.p2p.code&&e.push([n,i]),n===Ho["p2p-circuit"].code&&(e=[])});let t=e.pop();if(t?.[1]!=null){let n=t[1];return n[0]==="Q"||n[0]==="1"?ie(Oe.decode(`z${n}`),"base58btc"):ie(z.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(e){return ge(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(o=>o.resolvable);if(t==null)return[this];let n=z1.get(t.name);if(n==null)throw new O(`no available resolver for ${t.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(o=>new r(o))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let t=(e??this).protos();return!(t.length!==2||t[0].code!==4&&t[0].code!==41||t[1].code!==6&&t[1].code!==273)}[H5](){return`Multiaddr(${this.#e})`}};var z1=new Map;function V1(r){return!!r?.[Rf]}function Uf(r){return new ml(r)}async function*gl(r,e={}){let t=r.getReader();try{for(;;){let n=await t.read();if(n.done)return;yield n.value}}finally{e.preventCancel!==!0&&await t.cancel(),t.releaseLock()}}var Xf={};$(Xf,{Ed25519PrivateKey:()=>Zi,Ed25519PublicKey:()=>ba,generateKeyPair:()=>rB,generateKeyPairFromSeed:()=>dy,unmarshalEd25519PrivateKey:()=>eB,unmarshalEd25519PublicKey:()=>tB});function or(r){return r==null?!1:typeof r.then=="function"&&typeof r.catch=="function"&&typeof r.finally=="function"}function qo(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function K5(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function Nf(r,...e){if(!K5(r))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}function xl(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");qo(r.outputLen),qo(r.blockLen)}function Ko(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function M1(r,e){Nf(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}var yl=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function $1(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}var Wo=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),gr=(r,e)=>r<<32-e|r>>>e,G5=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!G5)throw new Error("Non little-endian hardware is not supported");var W5=async()=>{};async function j1(r,e,t){let n=Date.now();for(let i=0;i<r;i++){t(i);let o=Date.now()-n;o>=0&&o<e||(await W5(),n+=o)}}function Df(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function si(r){if(typeof r=="string"&&(r=Df(r)),!$1(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function wl(...r){let e=0;for(let n=0;n<r.length;n++){let i=r[n];if(!$1(i))throw new Error("Uint8Array expected");e+=i.length}let t=new Uint8Array(e);for(let n=0,i=0;n<r.length;n++){let o=r[n];t.set(o,i),i+=o.length}return t}var Go=class{clone(){return this._cloneInto()}},Y5={}.toString;function H1(r,e){if(e!==void 0&&Y5.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}function bl(r){let e=n=>r().update(si(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function Yo(r=32){if(yl&&typeof yl.getRandomValues=="function")return yl.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}function X5(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(t>>i&o),a=Number(t&o),c=n?4:0,u=n?0:4;r.setUint32(e+c,s,n),r.setUint32(e+u,a,n)}var Xo=class extends Go{constructor(e,t,n,i){super(),this.blockLen=e,this.outputLen=t,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=Wo(this.buffer)}update(e){Ko(this);let{view:t,buffer:n,blockLen:i}=this;e=si(e);let o=e.length;for(let s=0;s<o;){let a=Math.min(i-this.pos,o-s);if(a===i){let c=Wo(e);for(;i<=o-s;s+=i)this.process(c,s);continue}n.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ko(this),M1(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:i,isLE:o}=this,{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(n,0),s=0);for(let p=s;p<i;p++)t[p]=0;X5(n,i-8,BigInt(this.length*8),o),this.process(n,0);let a=Wo(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<u;p++)a.setUint32(4*p,l[p],o)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:i,finished:o,destroyed:s,pos:a}=this;return e.length=i,e.pos=a,e.finished=o,e.destroyed=s,i%t&&e.buffer.set(n),e}};var vl=BigInt(4294967295),Lf=BigInt(32);function q1(r,e=!1){return e?{h:Number(r&vl),l:Number(r>>Lf&vl)}:{h:Number(r>>Lf&vl)|0,l:Number(r&vl)|0}}function J5(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let i=0;i<r.length;i++){let{h:o,l:s}=q1(r[i],e);[t[i],n[i]]=[o,s]}return[t,n]}var Z5=(r,e)=>BigInt(r>>>0)<<Lf|BigInt(e>>>0),Q5=(r,e,t)=>r>>>t,eS=(r,e,t)=>r<<32-t|e>>>t,tS=(r,e,t)=>r>>>t|e<<32-t,rS=(r,e,t)=>r<<32-t|e>>>t,nS=(r,e,t)=>r<<64-t|e>>>t-32,iS=(r,e,t)=>r>>>t-32|e<<64-t,oS=(r,e)=>e,sS=(r,e)=>r,aS=(r,e,t)=>r<<t|e>>>32-t,cS=(r,e,t)=>e<<t|r>>>32-t,lS=(r,e,t)=>e<<t-32|r>>>64-t,uS=(r,e,t)=>r<<t-32|e>>>64-t;function pS(r,e,t,n){let i=(e>>>0)+(n>>>0);return{h:r+t+(i/2**32|0)|0,l:i|0}}var dS=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),fS=(r,e,t,n)=>e+t+n+(r/2**32|0)|0,hS=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),mS=(r,e,t,n,i)=>e+t+n+i+(r/2**32|0)|0,gS=(r,e,t,n,i)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0),xS=(r,e,t,n,i,o)=>e+t+n+i+o+(r/2**32|0)|0;var yS={fromBig:q1,split:J5,toBig:Z5,shrSH:Q5,shrSL:eS,rotrSH:tS,rotrSL:rS,rotrBH:nS,rotrBL:iS,rotr32H:oS,rotr32L:sS,rotlSH:aS,rotlSL:cS,rotlBH:lS,rotlBL:uS,add:pS,add3L:dS,add3H:fS,add4L:hS,add4H:mS,add5H:xS,add5L:gS},ne=yS;var[wS,bS]=ne.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(r=>BigInt(r))),ai=new Uint32Array(80),ci=new Uint32Array(80),Pf=class extends Xo{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:t,Bh:n,Bl:i,Ch:o,Cl:s,Dh:a,Dl:c,Eh:u,El:l,Fh:p,Fl:m,Gh:d,Gl:f,Hh:h,Hl:x}=this;return[e,t,n,i,o,s,a,c,u,l,p,m,d,f,h,x]}set(e,t,n,i,o,s,a,c,u,l,p,m,d,f,h,x){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=s|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=p|0,this.Fl=m|0,this.Gh=d|0,this.Gl=f|0,this.Hh=h|0,this.Hl=x|0}process(e,t){for(let w=0;w<16;w++,t+=4)ai[w]=e.getUint32(t),ci[w]=e.getUint32(t+=4);for(let w=16;w<80;w++){let E=ai[w-15]|0,B=ci[w-15]|0,S=ne.rotrSH(E,B,1)^ne.rotrSH(E,B,8)^ne.shrSH(E,B,7),b=ne.rotrSL(E,B,1)^ne.rotrSL(E,B,8)^ne.shrSL(E,B,7),v=ai[w-2]|0,k=ci[w-2]|0,U=ne.rotrSH(v,k,19)^ne.rotrBH(v,k,61)^ne.shrSH(v,k,6),R=ne.rotrSL(v,k,19)^ne.rotrBL(v,k,61)^ne.shrSL(v,k,6),M=ne.add4L(b,R,ci[w-7],ci[w-16]),L=ne.add4H(M,S,U,ai[w-7],ai[w-16]);ai[w]=L|0,ci[w]=M|0}let{Ah:n,Al:i,Bh:o,Bl:s,Ch:a,Cl:c,Dh:u,Dl:l,Eh:p,El:m,Fh:d,Fl:f,Gh:h,Gl:x,Hh:g,Hl:y}=this;for(let w=0;w<80;w++){let E=ne.rotrSH(p,m,14)^ne.rotrSH(p,m,18)^ne.rotrBH(p,m,41),B=ne.rotrSL(p,m,14)^ne.rotrSL(p,m,18)^ne.rotrBL(p,m,41),S=p&d^~p&h,b=m&f^~m&x,v=ne.add5L(y,B,b,bS[w],ci[w]),k=ne.add5H(v,g,E,S,wS[w],ai[w]),U=v|0,R=ne.rotrSH(n,i,28)^ne.rotrBH(n,i,34)^ne.rotrBH(n,i,39),M=ne.rotrSL(n,i,28)^ne.rotrBL(n,i,34)^ne.rotrBL(n,i,39),L=n&o^n&a^o&a,ce=i&s^i&c^s&c;g=h|0,y=x|0,h=d|0,x=f|0,d=p|0,f=m|0,{h:p,l:m}=ne.add(u|0,l|0,k|0,U|0),u=a|0,l=c|0,a=o|0,c=s|0,o=n|0,s=i|0;let _=ne.add3L(U,M,ce);n=ne.add3H(_,k,R,L),i=_|0}({h:n,l:i}=ne.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:s}=ne.add(this.Bh|0,this.Bl|0,o|0,s|0),{h:a,l:c}=ne.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=ne.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:p,l:m}=ne.add(this.Eh|0,this.El|0,p|0,m|0),{h:d,l:f}=ne.add(this.Fh|0,this.Fl|0,d|0,f|0),{h,l:x}=ne.add(this.Gh|0,this.Gl|0,h|0,x|0),{h:g,l:y}=ne.add(this.Hh|0,this.Hl|0,g|0,y|0),this.set(n,i,o,s,a,c,u,l,p,m,d,f,h,x,g,y)}roundClean(){ai.fill(0),ci.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)}};var Jo=bl(()=>new Pf);var Al={};$(Al,{bitGet:()=>IS,bitLen:()=>kS,bitMask:()=>ya,bitSet:()=>_S,bytesToHex:()=>pn,bytesToNumberBE:()=>dn,bytesToNumberLE:()=>li,concatBytes:()=>fn,createHmacDrbg:()=>zf,ensureBytes:()=>Re,equalBytes:()=>SS,hexToBytes:()=>Yi,hexToNumber:()=>Ff,isBytes:()=>xr,numberToBytesBE:()=>ui,numberToBytesLE:()=>Xi,numberToHexUnpadded:()=>Y1,numberToVarBytesBE:()=>AS,utf8ToBytes:()=>BS,validateObject:()=>Or});var W1=BigInt(0),El=BigInt(1),vS=BigInt(2);function xr(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}var ES=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function pn(r){if(!xr(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=ES[r[t]];return e}function Y1(r){let e=r.toString(16);return e.length&1?`0${e}`:e}function Ff(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}var un={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function K1(r){if(r>=un._0&&r<=un._9)return r-un._0;if(r>=un._A&&r<=un._F)return r-(un._A-10);if(r>=un._a&&r<=un._f)return r-(un._a-10)}function Yi(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(t);for(let i=0,o=0;i<t;i++,o+=2){let s=K1(r.charCodeAt(o)),a=K1(r.charCodeAt(o+1));if(s===void 0||a===void 0){let c=r[o]+r[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}n[i]=s*16+a}return n}function dn(r){return Ff(pn(r))}function li(r){if(!xr(r))throw new Error("Uint8Array expected");return Ff(pn(Uint8Array.from(r).reverse()))}function ui(r,e){return Yi(r.toString(16).padStart(e*2,"0"))}function Xi(r,e){return ui(r,e).reverse()}function AS(r){return Yi(Y1(r))}function Re(r,e,t){let n;if(typeof e=="string")try{n=Yi(e)}catch(o){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${o}`)}else if(xr(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let i=n.length;if(typeof t=="number"&&i!==t)throw new Error(`${r} expected ${t} bytes, got ${i}`);return n}function fn(...r){let e=0;for(let i=0;i<r.length;i++){let o=r[i];if(!xr(o))throw new Error("Uint8Array expected");e+=o.length}let t=new Uint8Array(e),n=0;for(let i=0;i<r.length;i++){let o=r[i];t.set(o,n),n+=o.length}return t}function SS(r,e){if(r.length!==e.length)return!1;let t=0;for(let n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}function BS(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function kS(r){let e;for(e=0;r>W1;r>>=El,e+=1);return e}function IS(r,e){return r>>BigInt(e)&El}var _S=(r,e,t)=>r|(t?El:W1)<<BigInt(e),ya=r=>(vS<<BigInt(r-1))-El,Of=r=>new Uint8Array(r),G1=r=>Uint8Array.from(r);function zf(r,e,t){if(typeof r!="number"||r<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 t!="function")throw new Error("hmacFn must be a function");let n=Of(r),i=Of(r),o=0,s=()=>{n.fill(1),i.fill(0),o=0},a=(...p)=>t(i,n,...p),c=(p=Of())=>{i=a(G1([0]),p),n=a(),p.length!==0&&(i=a(G1([1]),p),n=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let p=0,m=[];for(;p<e;){n=a();let d=n.slice();m.push(d),p+=n.length}return fn(...m)};return(p,m)=>{s(),c(p);let d;for(;!(d=m(u()));)c();return s(),d}}var TS={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||xr(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function Or(r,e,t={}){let n=(i,o,s)=>{let a=TS[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);let c=r[i];if(!(s&&c===void 0)&&!a(c,r))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${o}`)};for(let[i,o]of Object.entries(e))n(i,o,!1);for(let[i,o]of Object.entries(t))n(i,o,!0);return r}var Ye=BigInt(0),Ae=BigInt(1),Ji=BigInt(2),CS=BigInt(3),Vf=BigInt(4),X1=BigInt(5),J1=BigInt(8),RS=BigInt(9),US=BigInt(16);function be(r,e){let t=r%e;return t>=Ye?t:e+t}function NS(r,e,t){if(t<=Ye||e<Ye)throw new Error("Expected power/modulo > 0");if(t===Ae)return Ye;let n=Ae;for(;e>Ye;)e&Ae&&(n=n*r%t),r=r*r%t,e>>=Ae;return n}function Se(r,e,t){let n=r;for(;e-- >Ye;)n*=n,n%=t;return n}function Sl(r,e){if(r===Ye||e<=Ye)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=be(r,e),n=e,i=Ye,o=Ae,s=Ae,a=Ye;for(;t!==Ye;){let u=n/t,l=n%t,p=i-s*u,m=o-a*u;n=t,t=l,i=s,o=a,s=p,a=m}if(n!==Ae)throw new Error("invert: does not exist");return be(i,e)}function DS(r){let e=(r-Ae)/Ji,t,n,i;for(t=r-Ae,n=0;t%Ji===Ye;t/=Ji,n++);for(i=Ji;i<r&&NS(i,e,r)!==r-Ae;i++);if(n===1){let s=(r+Ae)/Vf;return function(c,u){let l=c.pow(u,s);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}let o=(t+Ae)/Ji;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,l=a.pow(a.mul(a.ONE,i),t),p=a.pow(c,o),m=a.pow(c,t);for(;!a.eql(m,a.ONE);){if(a.eql(m,a.ZERO))return a.ZERO;let d=1;for(let h=a.sqr(m);d<u&&!a.eql(h,a.ONE);d++)h=a.sqr(h);let f=a.pow(l,Ae<<BigInt(u-d-1));l=a.sqr(f),p=a.mul(p,f),m=a.mul(m,l),u=d}return p}}function LS(r){if(r%Vf===CS){let e=(r+Ae)/Vf;return function(n,i){let o=n.pow(i,e);if(!n.eql(n.sqr(o),i))throw new Error("Cannot find square root");return o}}if(r%J1===X1){let e=(r-X1)/J1;return function(n,i){let o=n.mul(i,Ji),s=n.pow(o,e),a=n.mul(i,s),c=n.mul(n.mul(a,Ji),s),u=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),i))throw new Error("Cannot find square root");return u}}return r%US,DS(r)}var Z1=(r,e)=>(be(r,e)&Ae)===Ae,PS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Mf(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=PS.reduce((n,i)=>(n[i]="function",n),e);return Or(r,t)}function OS(r,e,t){if(t<Ye)throw new Error("Expected power > 0");if(t===Ye)return r.ONE;if(t===Ae)return e;let n=r.ONE,i=e;for(;t>Ye;)t&Ae&&(n=r.mul(n,i)),i=r.sqr(i),t>>=Ae;return n}function FS(r,e){let t=new Array(e.length),n=e.reduce((o,s,a)=>r.is0(s)?o:(t[a]=o,r.mul(o,s)),r.ONE),i=r.inv(n);return e.reduceRight((o,s,a)=>r.is0(s)?o:(t[a]=r.mul(o,t[a]),r.mul(o,s)),i),t}function $f(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function Bl(r,e,t=!1,n={}){if(r<=Ye)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:i,nByteLength:o}=$f(r,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");let s=LS(r),a=Object.freeze({ORDER:r,BITS:i,BYTES:o,MASK:ya(i),ZERO:Ye,ONE:Ae,create:c=>be(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Ye<=c&&c<r},is0:c=>c===Ye,isOdd:c=>(c&Ae)===Ae,neg:c=>be(-c,r),eql:(c,u)=>c===u,sqr:c=>be(c*c,r),add:(c,u)=>be(c+u,r),sub:(c,u)=>be(c-u,r),mul:(c,u)=>be(c*u,r),pow:(c,u)=>OS(a,c,u),div:(c,u)=>be(c*Sl(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>Sl(c,r),sqrt:n.sqrt||(c=>s(a,c)),invertBatch:c=>FS(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>t?Xi(c,o):ui(c,o),fromBytes:c=>{if(c.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${c.length}`);return t?li(c):dn(c)}});return Object.freeze(a)}function Q1(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?r.neg(t):t}function ey(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}function jf(r){let e=ey(r);return e+Math.ceil(e/2)}function ty(r,e,t=!1){let n=r.length,i=ey(e),o=jf(e);if(n<16||n<o||n>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${n}`);let s=t?dn(r):li(r),a=be(s,e-Ae)+Ae;return t?Xi(a,i):ui(a,i)}var VS=BigInt(0),Hf=BigInt(1);function kl(r,e){let t=(i,o)=>{let s=o.negate();return i?s:o},n=i=>{let o=Math.ceil(e/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:t,unsafeLadder(i,o){let s=r.ZERO,a=i;for(;o>VS;)o&Hf&&(s=s.add(a)),a=a.double(),o>>=Hf;return s},precomputeWindow(i,o){let{windows:s,windowSize:a}=n(o),c=[],u=i,l=u;for(let p=0;p<s;p++){l=u,c.push(l);for(let m=1;m<a;m++)l=l.add(u),c.push(l);u=l.double()}return c},wNAF(i,o,s){let{windows:a,windowSize:c}=n(i),u=r.ZERO,l=r.BASE,p=BigInt(2**i-1),m=2**i,d=BigInt(i);for(let f=0;f<a;f++){let h=f*c,x=Number(s&p);s>>=d,x>c&&(x-=m,s+=Hf);let g=h,y=h+Math.abs(x)-1,w=f%2!==0,E=x<0;x===0?l=l.add(t(w,o[g])):u=u.add(t(E,o[y]))}return{p:u,f:l}},wNAFCached(i,o,s,a){let c=i._WINDOW_SIZE||1,u=o.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&o.set(i,a(u))),this.wNAF(c,u,s)}}}function wa(r){return Mf(r.Fp),Or(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...$f(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}var yr=BigInt(0),Mt=BigInt(1),Il=BigInt(2),MS=BigInt(8),$S={zip215:!0};function jS(r){let e=wa(r);return Or(r,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function _l(r){let e=jS(r),{Fp:t,n,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:c}=e,u=Il<<BigInt(a*8)-Mt,l=t.create,p=e.uvRatio||((N,T)=>{try{return{isValid:!0,value:t.sqrt(N*t.inv(T))}}catch{return{isValid:!1,value:yr}}}),m=e.adjustScalarBytes||(N=>N),d=e.domain||((N,T,H)=>{if(T.length||H)throw new Error("Contexts/pre-hash are not supported");return N}),f=N=>typeof N=="bigint"&&yr<N,h=(N,T)=>f(N)&&f(T)&&N<T,x=N=>N===yr||h(N,u);function g(N,T){if(h(N,T))return N;throw new Error(`Expected valid scalar < ${T}, got ${typeof N} ${N}`)}function y(N){return N===yr?N:g(N,n)}let w=new Map;function E(N){if(!(N instanceof B))throw new Error("ExtendedPoint expected")}class B{constructor(T,H,Y,ee){if(this.ex=T,this.ey=H,this.ez=Y,this.et=ee,!x(T))throw new Error("x required");if(!x(H))throw new Error("y required");if(!x(Y))throw new Error("z required");if(!x(ee))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(T){if(T instanceof B)throw new Error("extended point not allowed");let{x:H,y:Y}=T||{};if(!x(H)||!x(Y))throw new Error("invalid affine point");return new B(H,Y,Mt,l(H*Y))}static normalizeZ(T){let H=t.invertBatch(T.map(Y=>Y.ez));return T.map((Y,ee)=>Y.toAffine(H[ee])).map(B.fromAffine)}_setWindowSize(T){this._WINDOW_SIZE=T,w.delete(this)}assertValidity(){let{a:T,d:H}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:Y,ey:ee,ez:se,et:le}=this,we=l(Y*Y),de=l(ee*ee),he=l(se*se),$e=l(he*he),Te=l(we*T),tt=l(he*l(Te+de)),rt=l($e+l(H*l(we*de)));if(tt!==rt)throw new Error("bad point: equation left != right (1)");let We=l(Y*ee),ut=l(se*le);if(We!==ut)throw new Error("bad point: equation left != right (2)")}equals(T){E(T);let{ex:H,ey:Y,ez:ee}=this,{ex:se,ey:le,ez:we}=T,de=l(H*we),he=l(se*ee),$e=l(Y*we),Te=l(le*ee);return de===he&&$e===Te}is0(){return this.equals(B.ZERO)}negate(){return new B(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:T}=e,{ex:H,ey:Y,ez:ee}=this,se=l(H*H),le=l(Y*Y),we=l(Il*l(ee*ee)),de=l(T*se),he=H+Y,$e=l(l(he*he)-se-le),Te=de+le,tt=Te-we,rt=de-le,We=l($e*tt),ut=l(Te*rt),cn=l($e*rt),Vi=l(tt*Te);return new B(We,ut,Vi,cn)}add(T){E(T);let{a:H,d:Y}=e,{ex:ee,ey:se,ez:le,et:we}=this,{ex:de,ey:he,ez:$e,et:Te}=T;if(H===BigInt(-1)){let yx=l((se-ee)*(he+de)),wx=l((se+ee)*(he-de)),xd=l(wx-yx);if(xd===yr)return this.double();let bx=l(le*Il*Te),vx=l(we*Il*$e),Ex=vx+bx,Ax=wx+yx,Sx=vx-bx,a8=l(Ex*xd),c8=l(Ax*Sx),l8=l(Ex*Sx),u8=l(xd*Ax);return new B(a8,c8,u8,l8)}let tt=l(ee*de),rt=l(se*he),We=l(we*Y*Te),ut=l(le*$e),cn=l((ee+se)*(de+he)-tt-rt),Vi=ut-We,aa=ut+We,xx=l(rt-H*tt),n8=l(cn*Vi),i8=l(aa*xx),o8=l(cn*xx),s8=l(Vi*aa);return new B(n8,i8,s8,o8)}subtract(T){return this.add(T.negate())}wNAF(T){return v.wNAFCached(this,w,T,B.normalizeZ)}multiply(T){let{p:H,f:Y}=this.wNAF(g(T,n));return B.normalizeZ([H,Y])[0]}multiplyUnsafe(T){let H=y(T);return H===yr?b:this.equals(b)||H===Mt?this:this.equals(S)?this.wNAF(H).p:v.unsafeLadder(this,H)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return v.unsafeLadder(this,n).is0()}toAffine(T){let{ex:H,ey:Y,ez:ee}=this,se=this.is0();T==null&&(T=se?MS:t.inv(ee));let le=l(H*T),we=l(Y*T),de=l(ee*T);if(se)return{x:yr,y:Mt};if(de!==Mt)throw new Error("invZ was invalid");return{x:le,y:we}}clearCofactor(){let{h:T}=e;return T===Mt?this:this.multiplyUnsafe(T)}static fromHex(T,H=!1){let{d:Y,a:ee}=e,se=t.BYTES;T=Re("pointHex",T,se);let le=T.slice(),we=T[se-1];le[se-1]=we&-129;let de=li(le);de===yr||(H?g(de,u):g(de,t.ORDER));let he=l(de*de),$e=l(he-Mt),Te=l(Y*he-ee),{isValid:tt,value:rt}=p($e,Te);if(!tt)throw new Error("Point.fromHex: invalid y coordinate");let We=(rt&Mt)===Mt,ut=(we&128)!==0;if(!H&&rt===yr&&ut)throw new Error("Point.fromHex: x=0 and x_0=1");return ut!==We&&(rt=l(-rt)),B.fromAffine({x:rt,y:de})}static fromPrivateKey(T){return R(T).point}toRawBytes(){let{x:T,y:H}=this.toAffine(),Y=Xi(H,t.BYTES);return Y[Y.length-1]|=T&Mt?128:0,Y}toHex(){return pn(this.toRawBytes())}}B.BASE=new B(e.Gx,e.Gy,Mt,l(e.Gx*e.Gy)),B.ZERO=new B(yr,Mt,Mt,yr);let{BASE:S,ZERO:b}=B,v=kl(B,a*8);function k(N){return be(N,n)}function U(N){return k(li(N))}function R(N){let T=a;N=Re("private key",N,T);let H=Re("hashed private key",o(N),2*T),Y=m(H.slice(0,T)),ee=H.slice(T,2*T),se=U(Y),le=S.multiply(se),we=le.toRawBytes();return{head:Y,prefix:ee,scalar:se,point:le,pointBytes:we}}function M(N){return R(N).pointBytes}function L(N=new Uint8Array,...T){let H=fn(...T);return U(o(d(H,Re("context",N),!!i)))}function ce(N,T,H={}){N=Re("message",N),i&&(N=i(N));let{prefix:Y,scalar:ee,pointBytes:se}=R(T),le=L(H.context,Y,N),we=S.multiply(le).toRawBytes(),de=L(H.context,we,se,N),he=k(le+de*ee);y(he);let $e=fn(we,Xi(he,t.BYTES));return Re("result",$e,a*2)}let _=$S;function D(N,T,H,Y=_){let{context:ee,zip215:se}=Y,le=t.BYTES;N=Re("signature",N,2*le),T=Re("message",T),i&&(T=i(T));let we=li(N.slice(le,2*le)),de,he,$e;try{de=B.fromHex(H,se),he=B.fromHex(N.slice(0,le),se),$e=S.multiplyUnsafe(we)}catch{return!1}if(!se&&de.isSmallOrder())return!1;let Te=L(ee,he.toRawBytes(),de.toRawBytes(),T);return he.add(de.multiplyUnsafe(Te)).subtract($e).clearCofactor().equals(B.ZERO)}return S._setWindowSize(8),{CURVE:e,getPublicKey:M,sign:ce,verify:D,ExtendedPoint:B,utils:{getExtendedPublicKey:R,randomPrivateKey:()=>s(t.BYTES),precompute(N=8,T=B.BASE){return T._setWindowSize(N),T.multiply(BigInt(3)),T}}}}var Kf=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),ry=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),sz=BigInt(0),HS=BigInt(1),qf=BigInt(2),qS=BigInt(5),ny=BigInt(10),KS=BigInt(20),GS=BigInt(40),iy=BigInt(80);function WS(r){let e=Kf,n=r*r%e*r%e,i=Se(n,qf,e)*n%e,o=Se(i,HS,e)*r%e,s=Se(o,qS,e)*o%e,a=Se(s,ny,e)*s%e,c=Se(a,KS,e)*a%e,u=Se(c,GS,e)*c%e,l=Se(u,iy,e)*u%e,p=Se(l,iy,e)*u%e,m=Se(p,ny,e)*s%e;return{pow_p_5_8:Se(m,qf,e)*r%e,b2:n}}function YS(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}function XS(r,e){let t=Kf,n=be(e*e*e,t),i=be(n*n*e,t),o=WS(r*i).pow_p_5_8,s=be(r*n*o,t),a=be(e*s*s,t),c=s,u=be(s*ry,t),l=a===r,p=a===be(-r,t),m=a===be(-r*ry,t);return l&&(s=c),(p||m)&&(s=u),Z1(s,t)&&(s=be(-s,t)),{isValid:l||p,value:s}}var hn=Bl(Kf,void 0,!0),Gf={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:hn,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Jo,randomBytes:Yo,adjustScalarBytes:YS,uvRatio:XS},Zo=_l(Gf);function oy(r,e,t){if(e.length>255)throw new Error("Context is too big");return wl(Df("SigEd25519 no Ed25519 collisions"),new Uint8Array([t?1:0,e.length]),e,r)}var az=_l({...Gf,domain:oy}),cz=_l({...Gf,domain:oy,prehash:Jo});var JS=(hn.ORDER+BigInt(3))/BigInt(8),lz=hn.pow(qf,JS),uz=hn.sqrt(hn.neg(hn.ONE)),pz=(hn.ORDER-BigInt(5))/BigInt(8),dz=BigInt(486662);var fz=Q1(hn,hn.neg(BigInt(486664)));var hz=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),mz=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),gz=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),xz=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var yz=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Qo=32,mn=64,Tl=32;function sy(){let r=Zo.utils.randomPrivateKey(),e=Zo.getPublicKey(r);return{privateKey:uy(r,e),publicKey:e}}function ay(r){if(r.length!==Tl)throw new TypeError('"seed" must be 32 bytes in length.');if(!(r instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=r,t=Zo.getPublicKey(e);return{privateKey:uy(e,t),publicKey:t}}function cy(r,e){let t=r.subarray(0,Tl);return Zo.sign(e instanceof Uint8Array?e:e.subarray(),t)}function ly(r,e,t){return Zo.verify(e,t instanceof Uint8Array?t:t.subarray(),r)}function uy(r,e){let t=new Uint8Array(mn);for(let n=0;n<Tl;n++)t[n]=r[n],t[Tl+n]=e[n];return t}var xt={get(r=globalThis){let e=r.crypto;if(e==null||e.subtle==null)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p/blob/main/packages/crypto/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return e}};var Wf={alg:"A128GCM",ext:!0,k:"scm9jmO_4BJAgdwWGVulLg",key_ops:["encrypt","decrypt"],kty:"oct"};function py(r){let e=r?.algorithm??"AES-GCM",t=r?.keyLength??16,n=r?.nonceLength??12,i=r?.digest??"SHA-256",o=r?.saltLength??16,s=r?.iterations??32767,a=xt.get();t*=8;async function c(p,m){let d=a.getRandomValues(new Uint8Array(o)),f=a.getRandomValues(new Uint8Array(n)),h={name:e,iv:f};typeof m=="string"&&(m=Z(m));let x;if(m.length===0){x=await a.subtle.importKey("jwk",Wf,{name:"AES-GCM"},!0,["encrypt"]);try{let y={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},w=await a.subtle.importKey("raw",m,{name:"PBKDF2"},!1,["deriveKey"]);x=await a.subtle.deriveKey(y,w,{name:e,length:t},!0,["encrypt"])}catch{x=await a.subtle.importKey("jwk",Wf,{name:"AES-GCM"},!0,["encrypt"])}}else{let y={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},w=await a.subtle.importKey("raw",m,{name:"PBKDF2"},!1,["deriveKey"]);x=await a.subtle.deriveKey(y,w,{name:e,length:t},!0,["encrypt"])}let g=await a.subtle.encrypt(h,x,p);return ze([d,h.iv,new Uint8Array(g)])}async function u(p,m){let d=p.subarray(0,o),f=p.subarray(o,o+n),h=p.subarray(o+n),x={name:e,iv:f};typeof m=="string"&&(m=Z(m));let g;if(m.length===0)try{let w={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},E=await a.subtle.importKey("raw",m,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(w,E,{name:e,length:t},!0,["decrypt"])}catch{g=await a.subtle.importKey("jwk",Wf,{name:"AES-GCM"},!0,["decrypt"])}else{let w={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},E=await a.subtle.importKey("raw",m,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(w,E,{name:e,length:t},!0,["decrypt"])}let y=await a.subtle.decrypt(x,g,h);return new Uint8Array(y)}return{encrypt:c,decrypt:u}}async function es(r,e){let n=await py().encrypt(r,e);return Lr.encode(n)}var Be;(function(r){r.RSA="RSA",r.Ed25519="Ed25519",r.Secp256k1="Secp256k1"})(Be||(Be={}));var Yf;(function(r){r[r.RSA=0]="RSA",r[r.Ed25519=1]="Ed25519",r[r.Secp256k1=2]="Secp256k1"})(Yf||(Yf={}));(function(r){r.codec=()=>Ki(Yf)})(Be||(Be={}));var Fr;(function(r){let e;r.codec=()=>(e==null&&(e=nr((t,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),t.Type!=null&&(n.uint32(8),Be.codec().encode(t.Type,n)),t.Data!=null&&(n.uint32(18),n.bytes(t.Data)),i.lengthDelimited!==!1&&n.ldelim()},(t,n)=>{let i={},o=n==null?t.len:t.pos+n;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.Type=Be.codec().decode(t);break;case 2:i.Data=t.bytes();break;default:t.skipType(s&7);break}}return i})),e),r.encode=t=>rr(t,r.codec()),r.decode=t=>er(t,r.codec())})(Fr||(Fr={}));var zr;(function(r){let e;r.codec=()=>(e==null&&(e=nr((t,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),t.Type!=null&&(n.uint32(8),Be.codec().encode(t.Type,n)),t.Data!=null&&(n.uint32(18),n.bytes(t.Data)),i.lengthDelimited!==!1&&n.ldelim()},(t,n)=>{let i={},o=n==null?t.len:t.pos+n;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.Type=Be.codec().decode(t);break;case 2:i.Data=t.bytes();break;default:t.skipType(s&7);break}}return i})),e),r.encode=t=>rr(t,r.codec()),r.decode=t=>er(t,r.codec())})(zr||(zr={}));var ba=class{_key;constructor(e){this._key=ts(e,Qo)}verify(e,t){return ly(this._key,t,e)}marshal(){return this._key}get bytes(){return Fr.encode({Type:Be.Ed25519,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}hash(){let e=ae.digest(this.bytes);return or(e)?e.then(({bytes:t})=>t):e.bytes}},Zi=class{_key;_publicKey;constructor(e,t){this._key=ts(e,mn),this._publicKey=ts(t,Qo)}sign(e){return cy(this._key,e)}get public(){return new ba(this._publicKey)}marshal(){return this._key}get bytes(){return zr.encode({Type:Be.Ed25519,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}async hash(){let e=ae.digest(this.bytes),t;return or(e)?{bytes:t}=await e:t=e.bytes,t}async id(){let e=It.digest(this.public.bytes);return Oe.encode(e.bytes).substring(1)}async export(e,t="libp2p-key"){if(t==="libp2p-key")return es(this.bytes,e);throw new O(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function eB(r){if(r.length>mn){r=ts(r,mn+Qo);let n=r.subarray(0,mn),i=r.subarray(mn,r.length);return new Zi(n,i)}r=ts(r,mn);let e=r.subarray(0,mn),t=r.subarray(Qo);return new Zi(e,t)}function tB(r){return r=ts(r,Qo),new ba(r)}async function rB(){let{privateKey:r,publicKey:e}=sy();return new Zi(r,e)}async function dy(r){let{privateKey:e,publicKey:t}=ay(r);return new Zi(e,t)}function ts(r,e){if(r=Uint8Array.from(r??[]),r.length!==e)throw new O(`Key must be a Uint8Array of length ${e}, got ${r.length}`,"ERR_INVALID_KEY_TYPE");return r}var sh={};$(sh,{MAX_RSA_KEY_SIZE:()=>Ua,RsaPrivateKey:()=>ss,RsaPublicKey:()=>Ra,fromJwk:()=>TB,generateKeyPair:()=>CB,unmarshalRsaPrivateKey:()=>ih,unmarshalRsaPublicKey:()=>_B});function Qi(r){if(isNaN(r)||r<=0)throw new O("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return Yo(r)}var hi={};$(hi,{exportToPem:()=>AB,importFromPem:()=>SB,jwkToPkcs1:()=>wB,jwkToPkix:()=>vB,pkcs1ToJwk:()=>yB,pkixToJwk:()=>bB});var Rl=class extends Go{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,xl(e);let n=si(t);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 s=0;s<o.length;s++)o[s]^=54;this.iHash.update(o),this.oHash=e.create();for(let s=0;s<o.length;s++)o[s]^=106;this.oHash.update(o),o.fill(0)}update(e){return Ko(this),this.iHash.update(e),this}digestInto(e){Ko(this),Nf(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:t,iHash:n,finished:i,destroyed:o,blockLen:s,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=o,e.blockLen=s,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},va=(r,e,t)=>new Rl(r,e).update(t).digest();va.create=(r,e)=>new Rl(r,e);function nB(r,e,t,n){xl(r);let i=H1({dkLen:32,asyncTick:10},n),{c:o,dkLen:s,asyncTick:a}=i;if(qo(o),qo(s),qo(a),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let c=si(e),u=si(t),l=new Uint8Array(s),p=va.create(r,c),m=p._cloneInto().update(u);return{c:o,dkLen:s,asyncTick:a,DK:l,PRF:p,PRFSalt:m}}function iB(r,e,t,n,i){return r.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),t}async function Jf(r,e,t,n){let{c:i,dkLen:o,asyncTick:s,DK:a,PRF:c,PRFSalt:u}=nB(r,e,t,n),l,p=new Uint8Array(4),m=Wo(p),d=new Uint8Array(c.outputLen);for(let f=1,h=0;h<o;f++,h+=c.outputLen){let x=a.subarray(h,h+c.outputLen);m.setInt32(0,f,!1),(l=u._cloneInto(l)).update(p).digestInto(d),x.set(d.subarray(0,x.length)),await j1(i-1,s,()=>{c._cloneInto(l).update(d).digestInto(d);for(let g=0;g<x.length;g++)x[g]^=d[g]})}return iB(c,u,a,l,d)}var pe=Q(fy());function eo(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}function pi(r,e,t=-1){let n=t,i=r,o=0,s=Math.pow(2,e);for(let a=1;a<8;a++){if(r<s){let c;if(n<0)c=new ArrayBuffer(a),o=a;else{if(n<a)return new ArrayBuffer(0);c=new ArrayBuffer(n),o=n}let u=new Uint8Array(c);for(let l=a-1;l>=0;l--){let p=Math.pow(2,l*e);u[o-l-1]=Math.floor(i/p),i-=u[o-l-1]*p}return c}s*=Math.pow(2,e)}return new ArrayBuffer(0)}function Dl(...r){let e=0,t=0;for(let o of r)e+=o.length;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let o of r)i.set(o,t),t+=o.length;return i}function Qf(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)t[a]=0;t[0]=r[0]&128;let n=eo(t,8),i=new ArrayBuffer(this.valueHex.byteLength),o=new Uint8Array(i);for(let a=0;a<this.valueHex.byteLength;a++)o[a]=r[a];return o[0]&=127,eo(o,8)-n}function hy(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let s=t-e,a=pi(s,8,n),c=new Uint8Array(a);return c[0]|=128,a}let i=pi(e,8,n),o=new Uint8Array(i);if(o[0]&128){let s=i.slice(0),a=new Uint8Array(s);i=new ArrayBuffer(i.byteLength+1),o=new Uint8Array(i);for(let c=0;c<s.byteLength;c++)o[c+1]=a[c];o[0]=0}return i}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function my(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}function _t(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,i=new Array(n);for(let s=0;s<n;s++)i[s]="0";return i.join("").concat(t)}var Kz=Math.log(2);function Ll(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function eh(r){let e=0,t=0;for(let i=0;i<r.length;i++){let o=r[i];e+=o.byteLength}let n=new Uint8Array(e);for(let i=0;i<r.length;i++){let o=r[i];n.set(new Uint8Array(o),t),t+=o.byteLength}return n.buffer}function bn(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}var Aa=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return eh(this.items)}},Ea=[new Uint8Array([1])],gy="0123456789";var is="",br=new ArrayBuffer(0),th=new Uint8Array(0),Sa="EndOfContent",yy="OCTET STRING",wy="BIT STRING";function vn(r){var e;return e=class extends r{constructor(...n){var i;super(...n);let o=n[0]||{};this.isHexOnly=(i=o.isHexOnly)!==null&&i!==void 0?i:!1,this.valueHexView=o.valueHex?pe.BufferSourceConverter.toUint8Array(o.valueHex):th}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}fromBER(n,i,o){let s=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!bn(this,s,i,o))return-1;let a=i+o;return this.valueHexView=s.subarray(i,a),this.valueHexView.length?(this.blockLength=o,a):(this.warnings.push("Zero buffer length"),i)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",br)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:pe.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var xn=class{constructor({blockLength:e=0,error:t=is,warnings:n=[],valueBeforeDecode:i=th}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=pe.BufferSourceConverter.toUint8Array(i)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:pe.Convert.ToHex(this.valueBeforeDecodeView)}}};xn.NAME="baseBlock";var ft=class extends xn{fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};ft.NAME="valueBlock";var Pl=class extends vn(xn){constructor({idBlock:e={}}={}){var t,n,i,o;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?pe.BufferSourceConverter.toUint8Array(e.valueHex):th,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(i=e.tagNumber)!==null&&i!==void 0?i:-1,this.isConstructed=(o=e.isConstructed)!==null&&o!==void 0?o:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",br}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let i=new Uint8Array(1);if(!e){let o=this.tagNumber;o&=31,t|=o,i[0]=t}return i.buffer}if(!this.isHexOnly){let i=pi(this.tagNumber,7),o=new Uint8Array(i),s=i.byteLength,a=new Uint8Array(s+1);if(a[0]=t|31,!e){for(let c=0;c<s-1;c++)a[c+1]=o[c]|128;a[s]=o[s-1]}return a.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let i=this.valueHexView;for(let o=0;o<i.length-1;o++)n[o+1]=i[o]|128;n[this.valueHexView.byteLength]=i[i.length-1]}return n.buffer}fromBER(e,t,n){let i=pe.BufferSourceConverter.toUint8Array(e);if(!bn(this,i,t,n))return-1;let o=i.subarray(t,t+n);if(o.length===0)return this.error="Zero buffer length",-1;switch(o[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(o[0]&32)===32,this.isHexOnly=!1;let a=o[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else{let c=1,u=this.valueHexView=new Uint8Array(255),l=255;for(;o[c]&128;){if(u[c-1]=o[c]&127,c++,c>=o.length)return this.error="End of input reached before message was fully decoded",-1;if(c===l){l+=255;let m=new Uint8Array(l);for(let d=0;d<u.length;d++)m[d]=u[d];u=this.valueHexView=new Uint8Array(l)}}this.blockLength=c+1,u[c-1]=o[c]&127;let p=new Uint8Array(c);for(let m=0;m<c;m++)p[m]=u[m];u=this.valueHexView=new Uint8Array(c),u.set(p),this.blockLength<=9?this.tagNumber=eo(u,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};Pl.NAME="identificationBlock";var Ol=class extends xn{constructor({lenBlock:e={}}={}){var t,n,i;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(i=e.length)!==null&&i!==void 0?i:0}fromBER(e,t,n){let i=pe.BufferSourceConverter.toUint8Array(e);if(!bn(this,i,t,n))return-1;let o=i.subarray(t,t+n);if(o.length===0)return this.error="Zero buffer length",-1;if(o[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=o[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(o[0]&128),this.longFormUsed===!1)return this.length=o[0],this.blockLength=1,t+this.blockLength;let s=o[0]&127;if(s>8)return this.error="Too big integer",-1;if(s+1>o.length)return this.error="End of input reached before message was fully decoded",-1;let a=t+1,c=i.subarray(a,a+s);return c[s-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=eo(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=s+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let i=pi(this.length,8);if(i.byteLength>127)return this.error="Too big length",br;if(t=new ArrayBuffer(i.byteLength+1),e)return t;let o=new Uint8Array(i);n=new Uint8Array(t),n[0]=i.byteLength|128;for(let s=0;s<i.byteLength;s++)n[s+1]=o[s];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};Ol.NAME="lengthBlock";var j={},it=class extends xn{constructor({name:e=is,optional:t=!1,primitiveSchema:n,...i}={},o){super(i),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new Pl(i),this.lenBlock=new Ol(i),this.valueBlock=o?new o(i):new ft(i)}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}toBER(e,t){let n=t||new Aa;t||by(this);let i=this.idBlock.toBER(e);if(n.write(i),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let o=this.valueBlock.toBER(e);this.lenBlock.length=o.byteLength;let s=this.lenBlock.toBER(e);n.write(s),n.write(o)}return t?br:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():pe.Convert.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${pe.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return my(t,n)}};it.NAME="BaseBlock";function by(r){if(r instanceof j.Constructed)for(let e of r.valueBlock.value)by(e)&&(r.lenBlock.isIndefiniteForm=!0);return!!r.lenBlock.isIndefiniteForm}var Fl=class extends it{constructor({value:e=is,...t}={},n){super(t,n),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};Fl.NAME="BaseStringBlock";var zl=class extends vn(ft){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};zl.NAME="PrimitiveValueBlock";var vy,Vl=class extends it{constructor(e={}){super(e,zl),this.idBlock.isConstructed=!1}};vy=Vl;j.Primitive=vy;Vl.NAME="PRIMITIVE";function fB(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function wu(r,e=0,t=r.length){let n=e,i=new it({},ft),o=new xn;if(!bn(o,r,e,t))return i.error=o.error,{offset:-1,result:i};if(!r.subarray(e,e+t).length)return i.error="Zero buffer length",{offset:-1,result:i};let a=i.idBlock.fromBER(r,e,t);if(i.idBlock.warnings.length&&i.warnings.concat(i.idBlock.warnings),a===-1)return i.error=i.idBlock.error,{offset:-1,result:i};if(e=a,t-=i.idBlock.blockLength,a=i.lenBlock.fromBER(r,e,t),i.lenBlock.warnings.length&&i.warnings.concat(i.lenBlock.warnings),a===-1)return i.error=i.lenBlock.error,{offset:-1,result:i};if(e=a,t-=i.lenBlock.blockLength,!i.idBlock.isConstructed&&i.lenBlock.isIndefiniteForm)return i.error="Indefinite length form used for primitive encoding form",{offset:-1,result:i};let c=it;switch(i.idBlock.tagClass){case 1:if(i.idBlock.tagNumber>=37&&i.idBlock.isHexOnly===!1)return i.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:i};switch(i.idBlock.tagNumber){case 0:if(i.idBlock.isConstructed&&i.lenBlock.length>0)return i.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:i};c=j.EndOfContent;break;case 1:c=j.Boolean;break;case 2:c=j.Integer;break;case 3:c=j.BitString;break;case 4:c=j.OctetString;break;case 5:c=j.Null;break;case 6:c=j.ObjectIdentifier;break;case 10:c=j.Enumerated;break;case 12:c=j.Utf8String;break;case 13:c=j.RelativeObjectIdentifier;break;case 14:c=j.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:c=j.Sequence;break;case 17:c=j.Set;break;case 18:c=j.NumericString;break;case 19:c=j.PrintableString;break;case 20:c=j.TeletexString;break;case 21:c=j.VideotexString;break;case 22:c=j.IA5String;break;case 23:c=j.UTCTime;break;case 24:c=j.GeneralizedTime;break;case 25:c=j.GraphicString;break;case 26:c=j.VisibleString;break;case 27:c=j.GeneralString;break;case 28:c=j.UniversalString;break;case 29:c=j.CharacterString;break;case 30:c=j.BmpString;break;case 31:c=j.DATE;break;case 32:c=j.TimeOfDay;break;case 33:c=j.DateTime;break;case 34:c=j.Duration;break;default:{let u=i.idBlock.isConstructed?new j.Constructed:new j.Primitive;u.idBlock=i.idBlock,u.lenBlock=i.lenBlock,u.warnings=i.warnings,i=u}}break;case 2:case 3:case 4:default:c=i.idBlock.isConstructed?j.Constructed:j.Primitive}return i=fB(i,c),a=i.fromBER(r,e,i.lenBlock.isIndefiniteForm?t:i.lenBlock.length),i.valueBeforeDecodeView=r.subarray(n,n+i.blockLength),{offset:a,result:i}}function os(r){if(!r.byteLength){let e=new it({},ft);return e.error="Input buffer has zero length",{offset:-1,result:e}}return wu(pe.BufferSourceConverter.toUint8Array(r).slice(),0,r.byteLength)}function hB(r,e){return r?1:e}var Vr=class extends ft{constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let i=pe.BufferSourceConverter.toUint8Array(e);if(!bn(this,i,t,n))return-1;if(this.valueBeforeDecodeView=i.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let o=t;for(;hB(this.isIndefiniteForm,n)>0;){let s=wu(i,o,n);if(s.offset===-1)return this.error=s.result.error,this.warnings.concat(s.result.warnings),-1;if(o=s.offset,this.blockLength+=s.result.blockLength,n-=s.result.blockLength,this.value.push(s.result),this.isIndefiniteForm&&s.result.constructor.NAME===Sa)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Sa?this.value.pop():this.warnings.push("No EndOfContent block encoded")),o}toBER(e,t){let n=t||new Aa;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,n);return t?br:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Vr.NAME="ConstructedValueBlock";var Ey,di=class extends it{constructor(e={}){super(e,Vr),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
12
+ `)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function $4(r){return Array.isArray(r)}ye.isArray=$4;function mx(r){return typeof r=="boolean"}ye.isBoolean=mx;function pd(r){return r===null}ye.isNull=pd;function aP(r){return r==null}ye.isNullOrUndefined=aP;function j4(r){return typeof r=="number"}ye.isNumber=j4;function dd(r){return typeof r=="string"}ye.isString=dd;function cP(r){return typeof r=="symbol"}ye.isSymbol=cP;function Jn(r){return r===void 0}ye.isUndefined=Jn;function ad(r){return ca(r)&&gx(r)==="[object RegExp]"}ye.isRegExp=ad;function ca(r){return typeof r=="object"&&r!==null}ye.isObject=ca;function hx(r){return ca(r)&&gx(r)==="[object Date]"}ye.isDate=hx;function cd(r){return ca(r)&&(gx(r)==="[object Error]"||r instanceof Error)}ye.isError=cd;function ld(r){return typeof r=="function"}ye.isFunction=ld;function lP(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}ye.isPrimitive=lP;ye.isBuffer=V4();function gx(r){return Object.prototype.toString.call(r)}function dx(r){return r<10?"0"+r.toString(10):r.toString(10)}var uP=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pP(){var r=new Date,e=[dx(r.getHours()),dx(r.getMinutes()),dx(r.getSeconds())].join(":");return[r.getDate(),uP[r.getMonth()],e].join(" ")}ye.log=function(){console.log("%s - %s",pP(),ye.format.apply(ye,arguments))};ye.inherits=M4();ye._extend=function(r,e){if(!e||!ca(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r};function H4(r,e){return Object.prototype.hasOwnProperty.call(r,e)}});var W4=re((goe,Jc)=>{"use strict";var dP=process.platform==="win32",Ur=q4();function fd(r,e){for(var t=[],n=0;n<r.length;n++){var i=r[n];!i||i==="."||(i===".."?t.length&&t[t.length-1]!==".."?t.pop():e&&t.push(".."):t.push(i))}return t}function Xc(r){for(var e=r.length-1,t=0;t<=e&&!r[t];t++);for(var n=e;n>=0&&!r[n];n--);return t===0&&n===e?r:t>n?[]:r.slice(t,n+1)}var K4=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,fP=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,Me={};function hd(r){var e=K4.exec(r),t=(e[1]||"")+(e[2]||""),n=e[3]||"",i=fP.exec(n),o=i[1],s=i[2],a=i[3];return[t,o,s,a]}function xx(r){var e=K4.exec(r),t=e[1]||"",n=!!t&&t[1]!==":";return{device:t,isUnc:n,isAbsolute:n||!!e[2],tail:e[3]}}function G4(r){return"\\\\"+r.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")}Me.resolve=function(){for(var r="",e="",t=!1,n=arguments.length-1;n>=-1;n--){var i;if(n>=0?i=arguments[n]:r?(i=process.env["="+r],(!i||i.substr(0,3).toLowerCase()!==r.toLowerCase()+"\\")&&(i=r+"\\")):i=process.cwd(),Ur.isString(i)){if(!i)continue}else throw new TypeError("Arguments to path.resolve must be strings");var o=xx(i),s=o.device,a=o.isUnc,c=o.isAbsolute,u=o.tail;if(!(s&&r&&s.toLowerCase()!==r.toLowerCase())&&(r||(r=s),t||(e=u+"\\"+e,t=c),r&&t))break}return a&&(r=G4(r)),e=fd(e.split(/[\\\/]+/),!t).join("\\"),r+(t?"\\":"")+e||"."};Me.normalize=function(r){var e=xx(r),t=e.device,n=e.isUnc,i=e.isAbsolute,o=e.tail,s=/[\\\/]$/.test(o);return o=fd(o.split(/[\\\/]+/),!i).join("\\"),!o&&!i&&(o="."),o&&s&&(o+="\\"),n&&(t=G4(t)),t+(i?"\\":"")+o};Me.isAbsolute=function(r){return xx(r).isAbsolute};Me.join=function(){for(var r=[],e=0;e<arguments.length;e++){var t=arguments[e];if(!Ur.isString(t))throw new TypeError("Arguments to path.join must be strings");t&&r.push(t)}var n=r.join("\\");return/^[\\\/]{2}[^\\\/]/.test(r[0])||(n=n.replace(/^[\\\/]{2,}/,"\\")),Me.normalize(n)};Me.relative=function(r,e){r=Me.resolve(r),e=Me.resolve(e);for(var t=r.toLowerCase(),n=e.toLowerCase(),i=Xc(e.split("\\")),o=Xc(t.split("\\")),s=Xc(n.split("\\")),a=Math.min(o.length,s.length),c=a,u=0;u<a;u++)if(o[u]!==s[u]){c=u;break}if(c==0)return e;for(var l=[],u=c;u<o.length;u++)l.push("..");return l=l.concat(i.slice(c)),l.join("\\")};Me._makeLong=function(r){if(!Ur.isString(r))return r;if(!r)return"";var e=Me.resolve(r);return/^[a-zA-Z]\:\\/.test(e)?"\\\\?\\"+e:/^\\\\[^?.]/.test(e)?"\\\\?\\UNC\\"+e.substring(2):r};Me.dirname=function(r){var e=hd(r),t=e[0],n=e[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)};Me.basename=function(r,e){var t=hd(r)[2];return e&&t.substr(-1*e.length)===e&&(t=t.substr(0,t.length-e.length)),t};Me.extname=function(r){return hd(r)[3]};Me.format=function(r){if(!Ur.isObject(r))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof r);var e=r.root||"";if(!Ur.isString(e))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof r.root);var t=r.dir,n=r.base||"";return t?t[t.length-1]===Me.sep?t+n:t+Me.sep+n:n};Me.parse=function(r){if(!Ur.isString(r))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=hd(r);if(!e||e.length!==4)throw new TypeError("Invalid path '"+r+"'");return{root:e[0],dir:e[0]+e[1].slice(0,-1),base:e[2],ext:e[3],name:e[2].slice(0,e[2].length-e[3].length)}};Me.sep="\\";Me.delimiter=";";var hP=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Ge={};function md(r){return hP.exec(r).slice(1)}Ge.resolve=function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:process.cwd();if(Ur.isString(n)){if(!n)continue}else throw new TypeError("Arguments to path.resolve must be strings");r=n+"/"+r,e=n[0]==="/"}return r=fd(r.split("/"),!e).join("/"),(e?"/":"")+r||"."};Ge.normalize=function(r){var e=Ge.isAbsolute(r),t=r&&r[r.length-1]==="/";return r=fd(r.split("/"),!e).join("/"),!r&&!e&&(r="."),r&&t&&(r+="/"),(e?"/":"")+r};Ge.isAbsolute=function(r){return r.charAt(0)==="/"};Ge.join=function(){for(var r="",e=0;e<arguments.length;e++){var t=arguments[e];if(!Ur.isString(t))throw new TypeError("Arguments to path.join must be strings");t&&(r?r+="/"+t:r+=t)}return Ge.normalize(r)};Ge.relative=function(r,e){r=Ge.resolve(r).substr(1),e=Ge.resolve(e).substr(1);for(var t=Xc(r.split("/")),n=Xc(e.split("/")),i=Math.min(t.length,n.length),o=i,s=0;s<i;s++)if(t[s]!==n[s]){o=s;break}for(var a=[],s=o;s<t.length;s++)a.push("..");return a=a.concat(n.slice(o)),a.join("/")};Ge._makeLong=function(r){return r};Ge.dirname=function(r){var e=md(r),t=e[0],n=e[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)};Ge.basename=function(r,e){var t=md(r)[2];return e&&t.substr(-1*e.length)===e&&(t=t.substr(0,t.length-e.length)),t};Ge.extname=function(r){return md(r)[3]};Ge.format=function(r){if(!Ur.isObject(r))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof r);var e=r.root||"";if(!Ur.isString(e))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof r.root);var t=r.dir?r.dir+Ge.sep:"",n=r.base||"";return t+n};Ge.parse=function(r){if(!Ur.isString(r))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=md(r);if(!e||e.length!==4)throw new TypeError("Invalid path '"+r+"'");return e[1]=e[1]||"",e[2]=e[2]||"",e[3]=e[3]||"",{root:e[0],dir:e[0]+e[1].slice(0,-1),base:e[2],ext:e[3],name:e[2].slice(0,e[2].length-e[3].length)}};Ge.sep="/";Ge.delimiter=":";dP?Jc.exports=Me:Jc.exports=Ge;Jc.exports.posix=Ge;Jc.exports.win32=Me});var J4=re(Pt=>{"use strict";var gd=F4(),mP=W4().extname,Y4=/^\s*([^;\s]*)(?:;|\s|$)/,gP=/^text\//i;Pt.charset=X4;Pt.charsets={lookup:X4};Pt.contentType=xP;Pt.extension=yP;Pt.extensions=Object.create(null);Pt.lookup=wP;Pt.types=Object.create(null);bP(Pt.extensions,Pt.types);function X4(r){if(!r||typeof r!="string")return!1;var e=Y4.exec(r),t=e&&gd[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&gP.test(e[1])?"UTF-8":!1}function xP(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Pt.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Pt.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function yP(r){if(!r||typeof r!="string")return!1;var e=Y4.exec(r),t=e&&Pt.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function wP(r){if(!r||typeof r!="string")return!1;var e=mP("x."+r).toLowerCase().substr(1);return e&&Pt.types[e]||!1}function bP(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(gd).forEach(function(i){var o=gd[i],s=o.extensions;if(!(!s||!s.length)){r[i]=s;for(var a=0;a<s.length;a++){var c=s[a];if(e[c]){var u=t.indexOf(gd[e[c]].source),l=t.indexOf(o.source);if(e[c]!=="application/octet-stream"&&(u>l||u===l&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}})}});var RP={};$(RP,{createVerifiedFetch:()=>TP});function ji(r){let e=new globalThis.AbortController;function t(){e.abort();for(let o of r)o?.removeEventListener!=null&&o.removeEventListener("abort",t)}for(let o of r){if(o?.aborted===!0){t();break}o?.addEventListener!=null&&o.addEventListener("abort",t)}function n(){for(let o of r)o?.removeEventListener!=null&&o.removeEventListener("abort",t)}let i=e.signal;return i.clear=n,i}function w8(r){let[e,t]=r[Symbol.asyncIterator]!=null?[r[Symbol.asyncIterator](),Symbol.asyncIterator]:[r[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:i=>{n.push(i)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[t](){return this}}}var _o=w8;function b8(r){return r[Symbol.asyncIterator]!=null}function _x(r){return r?.then!=null}function v8(r,e){if(b8(r))return async function*(){for await(let a of r){let c=e(a);_x(c)&&await c,yield a}}();let t=_o(r),{value:n,done:i}=t.next();if(i===!0)return function*(){}();if(typeof e(n)?.then=="function")return async function*(){yield n;for await(let a of t){let c=e(a);_x(c)&&await c,yield a}}();let s=e;return function*(){yield n;for(let a of t)s(a),yield a}()}var bd=v8;var _d={};$(_d,{base32:()=>nt,base32hex:()=>U8,base32hexpad:()=>D8,base32hexpadupper:()=>L8,base32hexupper:()=>N8,base32pad:()=>C8,base32padupper:()=>R8,base32upper:()=>Ux,base32z:()=>P8});var To={};$(To,{coerce:()=>Zt,empty:()=>Tx,equals:()=>vd,fromHex:()=>A8,fromString:()=>Ed,isBinary:()=>S8,toHex:()=>E8,toString:()=>Ad});var Tx=new Uint8Array(0);function E8(r){return r.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),"")}function A8(r){let e=r.match(/../g);return e!=null?new Uint8Array(e.map(t=>parseInt(t,16))):Tx}function vd(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function Zt(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function S8(r){return r instanceof ArrayBuffer||ArrayBuffer.isView(r)}function Ed(r){return new TextEncoder().encode(r)}function Ad(r){return new TextDecoder().decode(r)}function B8(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function p(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var h=0,x=0,g=0,w=f.length;g!==w&&f[g]===0;)g++,h++;for(var y=(w-g)*l+1>>>0,E=new Uint8Array(y);g!==w;){for(var B=f[g],S=0,b=y-1;(B!==0||S<x)&&b!==-1;b--,S++)B+=256*E[b]>>>0,E[b]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");x=S,g++}for(var v=y-x;v!==y&&E[v]===0;)v++;for(var k=c.repeat(h);v<y;++v)k+=r.charAt(E[v]);return k}function m(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var h=0;if(f[h]!==" "){for(var x=0,g=0;f[h]===c;)x++,h++;for(var w=(f.length-h)*u+1>>>0,y=new Uint8Array(w);f[h];){var E=t[f.charCodeAt(h)];if(E===255)return;for(var B=0,S=w-1;(E!==0||B<g)&&S!==-1;S--,B++)E+=a*y[S]>>>0,y[S]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,h++}if(f[h]!==" "){for(var b=w-g;b!==w&&y[b]===0;)b++;for(var v=new Uint8Array(x+(w-b)),k=x;b!==w;)v[k++]=y[b++];return v}}}function d(f){var h=m(f);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:m,decode:d}}var k8=B8,I8=k8,Cx=I8;var Sd=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Bd=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Rx(this,e)}},kd=class{decoders;constructor(e){this.decoders=e}or(e){return Rx(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Rx(r,e){return new kd({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var Id=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Sd(e,t,n),this.decoder=new Bd(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Co({name:r,prefix:e,encode:t,decode:n}){return new Id(r,e,t,n)}function Qn({name:r,prefix:e,alphabet:t}){let{encode:n,decode:i}=Cx(t,r);return Co({prefix:e,name:r,encode:n,decode:o=>Zt(i(o))})}function _8(r,e,t,n){let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*t/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let p=i[r[l]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s}function T8(r,e,t){let n=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,o+=e[i&a>>s];if(s!==0&&(o+=e[i&a<<t-s]),n)for(;o.length*t&7;)o+="=";return o}function Ce({name:r,prefix:e,bitsPerChar:t,alphabet:n}){return Co({prefix:e,name:r,encode(i){return T8(i,n,t)},decode(i){return _8(i,n,t,r)}})}var nt=Ce({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ux=Ce({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),C8=Ce({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),R8=Ce({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),U8=Ce({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),N8=Ce({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),D8=Ce({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),L8=Ce({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),P8=Ce({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Td={};$(Td,{base58btc:()=>Oe,base58flickr:()=>O8});var Oe=Qn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),O8=Qn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var F8=Lx,Nx=128,z8=127,V8=~z8,M8=Math.pow(2,31);function Lx(r,e,t){e=e||[],t=t||0;for(var n=t;r>=M8;)e[t++]=r&255|Nx,r/=128;for(;r&V8;)e[t++]=r&255|Nx,r>>>=7;return e[t]=r|0,Lx.bytes=t-n+1,e}var $8=Cd,j8=128,Dx=127;function Cd(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw Cd.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&Dx)<<i:(s&Dx)*Math.pow(2,i),i+=7}while(s>=j8);return Cd.bytes=o-n,t}var H8=Math.pow(2,7),q8=Math.pow(2,14),K8=Math.pow(2,21),G8=Math.pow(2,28),W8=Math.pow(2,35),Y8=Math.pow(2,42),X8=Math.pow(2,49),J8=Math.pow(2,56),Z8=Math.pow(2,63),Q8=function(r){return r<H8?1:r<q8?2:r<K8?3:r<G8?4:r<W8?5:r<Y8?6:r<X8?7:r<J8?8:r<Z8?9:10},eA={encode:F8,decode:$8,encodingLength:Q8},tA=eA,ua=tA;function pa(r,e=0){return[ua.decode(r,e),ua.decode.bytes]}function Ro(r,e,t=0){return ua.encode(r,e,t),e}function Uo(r){return ua.encodingLength(r)}function Dr(r,e){let t=e.byteLength,n=Uo(r),i=n+Uo(t),o=new Uint8Array(i+t);return Ro(r,o,0),Ro(t,o,n),o.set(e,i),new No(r,t,e,o)}function Ot(r){let e=Zt(r),[t,n]=pa(e),[i,o]=pa(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new No(t,i,s,e)}function Px(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&vd(r.bytes,t.bytes)}}var No=class{code;size;digest;bytes;constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};function Ox(r,e){let{bytes:t,version:n}=r;switch(n){case 0:return nA(t,Rd(r),e??Oe.encoder);default:return iA(t,Rd(r),e??nt.encoder)}}var Fx=new WeakMap;function Rd(r){let e=Fx.get(r);if(e==null){let t=new Map;return Fx.set(r,t),t}return e}var z=class r{code;version;multihash;bytes;"/";constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==da)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==oA)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=Dr(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&&Px(e.multihash,n.multihash)}toString(e){return Ox(this,e)}toJSON(){return{"/":Ox(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:o,bytes:s}=t;return new r(n,i,o,s??zx(n,i,o.bytes))}else if(t[sA]===!0){let{version:n,multihash:i,code:o}=t,s=Ot(i);return r.create(n,o,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==da)throw new Error(`Version 0 CID must use dag-pb (code: ${da}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=zx(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,da,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=Zt(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new No(t.multihashCode,t.digestSize,o,i);return[t.version===0?r.createV0(s):r.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[p,m]=pa(e.subarray(t));return t+=m,p},i=n(),o=da;if(i===18?(i=0,t=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,a=n(),c=n(),u=t+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,i]=rA(e,t),o=r.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Rd(o).set(n,e),o}};function rA(r,e){switch(r[0]){case"Q":{let t=e??Oe;return[Oe.prefix,t.decode(`${Oe.prefix}${r}`)]}case Oe.prefix:{let t=e??Oe;return[Oe.prefix,t.decode(r)]}case nt.prefix:{let t=e??nt;return[nt.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}}function nA(r,e,t){let{prefix:n}=t;if(n!==Oe.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let o=t.encode(r).slice(1);return e.set(n,o),o}else return i}function iA(r,e,t){let{prefix:n}=t,i=e.get(n);if(i==null){let o=t.encode(r);return e.set(n,o),o}else return i}var da=112,oA=18;function zx(r,e,t){let n=Uo(r),i=n+Uo(e),o=new Uint8Array(i+t.byteLength);return Ro(r,o,0),Ro(e,o,n),o.set(t,i),o}var sA=Symbol.for("@ipld/js-cid/CID");var fa=Symbol.for("@libp2p/content-routing");var Ud=Symbol.for("@libp2p/peer-id");function Vx(r){return r!=null&&!!r[Ud]}var ha=Symbol.for("@libp2p/peer-routing");var ei=class r extends Error{code;type;constructor(e="The operation was aborted"){super(e),this.code=r.code,this.type=r.type}static code="ABORT_ERR";static type="aborted"},O=class extends Error{code;props;constructor(e,t,n){super(e),this.code=t,this.name=n?.name??"CodeError",this.props=n??{}}};var el=class extends EventTarget{#e=new Map;listenerCount(e){let t=this.#e.get(e);return t==null?0:t.length}addEventListener(e,t,n){super.addEventListener(e,t,n);let i=this.#e.get(e);i==null&&(i=[],this.#e.set(e,i)),i.push({callback:t,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(e,t,n){super.removeEventListener(e.toString(),t??null,n);let i=this.#e.get(e);i!=null&&(i=i.filter(({callback:o})=>o!==t),this.#e.set(e,i))}dispatchEvent(e){let t=super.dispatchEvent(e),n=this.#e.get(e.type);return n==null||(n=n.filter(({once:i})=>!i),this.#e.set(e.type,n)),t}safeDispatchEvent(e,t={}){return this.dispatchEvent(new aA(e,t))}},Nd=class extends Event{detail;constructor(e,t){super(e,t),this.detail=t?.detail}},aA=globalThis.CustomEvent??Nd;var tl=(r,...e)=>{try{[...e]}catch{}};function Mx(r){return r!=null&&typeof r.start=="function"&&typeof r.stop=="function"}async function ti(...r){let e=[];for(let t of r)Mx(t)&&e.push(t);await Promise.all(e.map(async t=>{t.beforeStart!=null&&await t.beforeStart()})),await Promise.all(e.map(async t=>{await t.start()})),await Promise.all(e.map(async t=>{t.afterStart!=null&&await t.afterStart()}))}async function ri(...r){let e=[];for(let t of r)Mx(t)&&e.push(t);await Promise.all(e.map(async t=>{t.beforeStop!=null&&await t.beforeStop()})),await Promise.all(e.map(async t=>{await t.stop()})),await Promise.all(e.map(async t=>{t.afterStop!=null&&await t.afterStop()}))}var Pd={};$(Pd,{sha256:()=>ce,sha512:()=>Ld});function Hi({name:r,code:e,encode:t}){return new Dd(r,e,t)}var Dd=class{name;code;encode;constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?Dr(this.code,t):t.then(n=>Dr(this.code,n))}else throw Error("Unknown type, must be binary type")}};function jx(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var ce=Hi({name:"sha2-256",code:18,encode:jx("SHA-256")}),Ld=Hi({name:"sha2-512",code:19,encode:jx("SHA-512")});var zt=Q(Fd(),1);var zd={};$(zd,{base64:()=>Pr,base64pad:()=>bA,base64url:()=>Gx,base64urlpad:()=>vA});var Pr=Ce({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),bA=Ce({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Gx=Ce({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),vA=Ce({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});zt.default.formatters.b=r=>r==null?"undefined":Oe.baseEncode(r);zt.default.formatters.t=r=>r==null?"undefined":nt.baseEncode(r);zt.default.formatters.m=r=>r==null?"undefined":Pr.baseEncode(r);zt.default.formatters.p=r=>r==null?"undefined":r.toString();zt.default.formatters.c=r=>r==null?"undefined":r.toString();zt.default.formatters.k=r=>r==null?"undefined":r.toString();zt.default.formatters.a=r=>r==null?"undefined":r.toString();function EA(r){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=r,e.destroy=()=>!0,e.extend=()=>e,e}function Wx(){return{forComponent(r){return ne(r)}}}function ne(r){let e=EA(`${r}:trace`);return zt.default.enabled(`${r}:trace`)&&zt.default.names.map(t=>t.toString()).find(t=>t.includes(":trace"))!=null&&(e=(0,zt.default)(`${r}:trace`)),Object.assign((0,zt.default)(r),{error:(0,zt.default)(`${r}:error`),trace:e})}function ge(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function ni(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function un(r=0){return globalThis.Buffer?.alloc!=null?ni(globalThis.Buffer.alloc(r)):new Uint8Array(r)}function Bt(r=0){return globalThis.Buffer?.allocUnsafe!=null?ni(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}var PA=Math.pow(2,7),OA=Math.pow(2,14),FA=Math.pow(2,21),$d=Math.pow(2,28),jd=Math.pow(2,35),Hd=Math.pow(2,42),qd=Math.pow(2,49),xe=128,pt=127;function Fe(r){if(r<PA)return 1;if(r<OA)return 2;if(r<FA)return 3;if(r<$d)return 4;if(r<jd)return 5;if(r<Hd)return 6;if(r<qd)return 7;if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Kd(r,e,t=0){switch(Fe(r)){case 8:e[t++]=r&255|xe,r/=128;case 7:e[t++]=r&255|xe,r/=128;case 6:e[t++]=r&255|xe,r/=128;case 5:e[t++]=r&255|xe,r/=128;case 4:e[t++]=r&255|xe,r>>>=7;case 3:e[t++]=r&255|xe,r>>>=7;case 2:e[t++]=r&255|xe,r>>>=7;case 1:{e[t++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return e}function zA(r,e,t=0){switch(Fe(r)){case 8:e.set(t++,r&255|xe),r/=128;case 7:e.set(t++,r&255|xe),r/=128;case 6:e.set(t++,r&255|xe),r/=128;case 5:e.set(t++,r&255|xe),r/=128;case 4:e.set(t++,r&255|xe),r>>>=7;case 3:e.set(t++,r&255|xe),r>>>=7;case 2:e.set(t++,r&255|xe),r>>>=7;case 1:{e.set(t++,r&255),r>>>=7;break}default:throw new Error("unreachable")}return e}function Gd(r,e){let t=r[e],n=0;if(n+=t&pt,t<xe||(t=r[e+1],n+=(t&pt)<<7,t<xe)||(t=r[e+2],n+=(t&pt)<<14,t<xe)||(t=r[e+3],n+=(t&pt)<<21,t<xe)||(t=r[e+4],n+=(t&pt)*$d,t<xe)||(t=r[e+5],n+=(t&pt)*jd,t<xe)||(t=r[e+6],n+=(t&pt)*Hd,t<xe)||(t=r[e+7],n+=(t&pt)*qd,t<xe))return n;throw new RangeError("Could not decode varint")}function VA(r,e){let t=r.get(e),n=0;if(n+=t&pt,t<xe||(t=r.get(e+1),n+=(t&pt)<<7,t<xe)||(t=r.get(e+2),n+=(t&pt)<<14,t<xe)||(t=r.get(e+3),n+=(t&pt)<<21,t<xe)||(t=r.get(e+4),n+=(t&pt)*$d,t<xe)||(t=r.get(e+5),n+=(t&pt)*jd,t<xe)||(t=r.get(e+6),n+=(t&pt)*Hd,t<xe)||(t=r.get(e+7),n+=(t&pt)*qd,t<xe))return n;throw new RangeError("Could not decode varint")}function Qt(r,e,t=0){return e==null&&(e=Bt(Fe(r))),e instanceof Uint8Array?Kd(r,e,t):zA(r,e,t)}function kt(r,e=0){return r instanceof Uint8Array?Gd(r,e):VA(r,e)}var Wd=new Float32Array([-0]),ii=new Uint8Array(Wd.buffer);function i1(r,e,t){Wd[0]=r,e[t]=ii[0],e[t+1]=ii[1],e[t+2]=ii[2],e[t+3]=ii[3]}function o1(r,e){return ii[0]=r[e],ii[1]=r[e+1],ii[2]=r[e+2],ii[3]=r[e+3],Wd[0]}var Yd=new Float64Array([-0]),dt=new Uint8Array(Yd.buffer);function s1(r,e,t){Yd[0]=r,e[t]=dt[0],e[t+1]=dt[1],e[t+2]=dt[2],e[t+3]=dt[3],e[t+4]=dt[4],e[t+5]=dt[5],e[t+6]=dt[6],e[t+7]=dt[7]}function a1(r,e){return dt[0]=r[e],dt[1]=r[e+1],dt[2]=r[e+2],dt[3]=r[e+3],dt[4]=r[e+4],dt[5]=r[e+5],dt[6]=r[e+6],dt[7]=r[e+7],Yd[0]}var MA=BigInt(Number.MAX_SAFE_INTEGER),$A=BigInt(Number.MIN_SAFE_INTEGER),Vt=class r{lo;hi;constructor(e,t){this.lo=e|0,this.hi=t|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let t=~this.lo+1>>>0,n=~this.hi>>>0;return t===0&&(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let t=~this.lo+1>>>0,n=~this.hi>>>0;return t===0&&(n=n+1>>>0),-(BigInt(t)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return Ki;if(e<MA&&e>$A)return this.fromNumber(Number(e));let t=e<0n;t&&(e=-e);let n=e>>32n,i=e-(n<<32n);return t&&(n=~n|0n,i=~i|0n,++i>c1&&(i=0n,++n>c1&&(n=0n))),new r(Number(i),Number(n))}static fromNumber(e){if(e===0)return Ki;let t=e<0;t&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new r(n,i)}static from(e){return typeof e=="number"?r.fromNumber(e):typeof e=="bigint"?r.fromBigInt(e):typeof e=="string"?r.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new r(e.low>>>0,e.high>>>0):Ki}},Ki=new Vt(0,0);Ki.toBigInt=function(){return 0n};Ki.zzEncode=Ki.zzDecode=function(){return this};Ki.length=function(){return 1};var c1=4294967296n;function l1(r){let e=0,t=0;for(let n=0;n<r.length;++n)t=r.charCodeAt(n),t<128?e+=1:t<2048?e+=2:(t&64512)===55296&&(r.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function u1(r,e,t){if(t-e<1)return"";let i,o=[],s=0,a;for(;e<t;)a=r[e++],a<128?o[s++]=a:a>191&&a<224?o[s++]=(a&31)<<6|r[e++]&63:a>239&&a<365?(a=((a&7)<<18|(r[e++]&63)<<12|(r[e++]&63)<<6|r[e++]&63)-65536,o[s++]=55296+(a>>10),o[s++]=56320+(a&1023)):o[s++]=(a&15)<<12|(r[e++]&63)<<6|r[e++]&63,s>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i!=null?(s>0&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))}function Xd(r,e,t){let n=t,i,o;for(let s=0;s<r.length;++s)i=r.charCodeAt(s),i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&((o=r.charCodeAt(s+1))&64512)===56320?(i=65536+((i&1023)<<10)+(o&1023),++s,e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128);return t-n}function dr(r,e){return RangeError(`index out of range: ${r.pos} + ${e??1} > ${r.len}`)}function sl(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}var Jd=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,dr(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw dr(this,4);return sl(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw dr(this,4);return sl(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw dr(this,4);let e=o1(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw dr(this,4);let e=a1(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw dr(this,e);return this.pos+=e,t===n?new Uint8Array(0):this.buf.subarray(t,n)}string(){let e=this.bytes();return u1(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw dr(this,e);this.pos+=e}else do if(this.pos>=this.len)throw dr(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Vt(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw dr(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw dr(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw dr(this,8);let e=sl(this.buf,this.pos+=4),t=sl(this.buf,this.pos+=4);return new Vt(e,t)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let e=Gd(this.buf,this.pos);return this.pos+=Fe(e),e}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Zd(r){return new Jd(r instanceof Uint8Array?r:r.subarray())}function er(r,e,t){let n=Zd(r);return e.decode(n,void 0,t)}var Qd={};$(Qd,{base10:()=>jA});var jA=Qn({prefix:"9",name:"base10",alphabet:"0123456789"});var ef={};$(ef,{base16:()=>HA,base16upper:()=>qA});var HA=Ce({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),qA=Ce({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var tf={};$(tf,{base2:()=>KA});var KA=Ce({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var rf={};$(rf,{base256emoji:()=>JA});var d1=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),GA=d1.reduce((r,e,t)=>(r[t]=e,r),[]),WA=d1.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function YA(r){return r.reduce((e,t)=>(e+=GA[t],e),"")}function XA(r){let e=[];for(let t of r){let n=WA[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var JA=Co({prefix:"\u{1F680}",name:"base256emoji",encode:YA,decode:XA});var nf={};$(nf,{base36:()=>oi,base36upper:()=>ZA});var oi=Qn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ZA=Qn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var of={};$(of,{base8:()=>QA});var QA=Ce({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var sf={};$(sf,{identity:()=>e5});var e5=Co({prefix:"\0",name:"identity",encode:r=>Ad(r),decode:r=>Ed(r)});var t5=new TextEncoder,r5=new TextDecoder;var Oo=512;function f1(r){return t5.encode(JSON.stringify(r))}function h1(r){return JSON.parse(r5.decode(r))}var tr={};$(tr,{code:()=>je,decode:()=>cf,encode:()=>i5,name:()=>n5});var n5="raw",je=85;function i5(r){return Zt(r)}function cf(r){return Zt(r)}var lf={};$(lf,{identity:()=>It});var m1=0,o5="identity",g1=Zt;function s5(r){return Dr(m1,g1(r))}var It={code:m1,name:o5,encode:g1,digest:s5};var si={...sf,...tf,...of,...Qd,...ef,..._d,...nf,...Td,...zd,...rf},W7={...Pd,...lf};function y1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var x1=y1("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),uf=y1("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=Bt(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),a5={utf8:x1,"utf-8":x1,hex:si.base16,latin1:uf,ascii:uf,binary:uf,...si},al=a5;function Z(r,e="utf8"){let t=al[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ni(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}function pf(r){let e=r??8192,t=e>>>1,n,i=e;return function(s){if(s<1||s>t)return Bt(s);i+s>e&&(n=Bt(e),i=0);let a=n.subarray(i,i+=s);return i&7&&(i=(i|7)+1),a}}var Gi=class{fn;len;next;val;constructor(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}};function df(){}var hf=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},c5=pf();function l5(r){return globalThis.Buffer!=null?Bt(r):c5(r)}var ga=class{len;head;tail;states;constructor(){this.len=0,this.head=new Gi(df,0,0),this.tail=this.head,this.states=null}_push(e,t,n){return this.tail=this.tail.next=new Gi(e,t,n),this.len+=t,this}uint32(e){return this.len+=(this.tail=this.tail.next=new mf((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(cl,10,Vt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let t=Vt.fromBigInt(e);return this._push(cl,t.length(),t)}uint64Number(e){return this._push(Kd,Fe(e),e)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let t=Vt.fromBigInt(e).zzEncode();return this._push(cl,t.length(),t)}sint64Number(e){let t=Vt.fromNumber(e).zzEncode();return this._push(cl,t.length(),t)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(ff,1,e?1:0)}fixed32(e){return this._push(ma,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let t=Vt.fromBigInt(e);return this._push(ma,4,t.lo)._push(ma,4,t.hi)}fixed64Number(e){let t=Vt.fromNumber(e);return this._push(ma,4,t.lo)._push(ma,4,t.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(i1,4,e)}double(e){return this._push(s1,8,e)}bytes(e){let t=e.length>>>0;return t===0?this._push(ff,1,0):this.uint32(t)._push(p5,t,e)}string(e){let t=l1(e);return t!==0?this.uint32(t)._push(Xd,t,e):this._push(ff,1,0)}fork(){return this.states=new hf(this),this.head=this.tail=new Gi(df,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Gi(df,0,0),this.len=0),this}ldelim(){let e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=t,this.len+=n),this}finish(){let e=this.head.next,t=l5(this.len),n=0;for(;e!=null;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t}};function ff(r,e,t){e[t]=r&255}function u5(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}var mf=class extends Gi{next;constructor(e,t){super(u5,e,t),this.next=void 0}};function cl(r,e,t){for(;r.hi!==0;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}function ma(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function p5(r,e,t){e.set(r,t)}globalThis.Buffer!=null&&(ga.prototype.bytes=function(r){let e=r.length>>>0;return this.uint32(e),e>0&&this._push(d5,e,r),this},ga.prototype.string=function(r){let e=globalThis.Buffer.byteLength(r);return this.uint32(e),e>0&&this._push(f5,e,r),this});function d5(r,e,t){e.set(r,t)}function f5(r,e,t){r.length<40?Xd(r,e,t):e.utf8Write!=null?e.utf8Write(r,t):e.set(Z(r),t)}function gf(){return new ga}function rr(r,e){let t=gf();return e.encode(r,t,{lengthDelimited:!1}),t.finish()}var Fo;(function(r){r[r.VARINT=0]="VARINT",r[r.BIT64=1]="BIT64",r[r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",r[r.START_GROUP=3]="START_GROUP",r[r.END_GROUP=4]="END_GROUP",r[r.BIT32=5]="BIT32"})(Fo||(Fo={}));function ll(r,e,t,n){return{name:r,type:e,encode:t,decode:n}}function Wi(r){function e(i){if(r[i.toString()]==null)throw new Error("Invalid enum value");return r[i]}let t=function(o,s){let a=e(o);s.int32(a)},n=function(o){let s=o.int32();return e(s)};return ll("enum",Fo.VARINT,t,n)}function nr(r,e){return ll("message",Fo.LENGTH_DELIMITED,r,e)}function h5(r){return r[Symbol.asyncIterator]!=null}function m5(r){if(h5(r))return(async()=>{for await(let e of r);})();for(let e of r);}var Yi=m5;function ze(r,e){if(globalThis.Buffer!=null)return ni(globalThis.Buffer.concat(r,e));e==null&&(e=r.reduce((i,o)=>i+o.length,0));let t=Bt(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return ni(t)}var b1=Symbol.for("@achingbrain/uint8arraylist");function w1(r,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let t=0;for(let n of r){let i=t+n.byteLength;if(e<i)return{buf:n,index:e-t};t=i}throw new RangeError("index is out of bounds")}function ul(r){return!!r?.[b1]}var Xi=class r{bufs;length;[b1]=!0;constructor(...e){this.bufs=[],this.length=0,e.length>0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let n of e)if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.push(n);else if(ul(n))t+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let n of e.reverse())if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.unshift(n);else if(ul(n))t+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=w1(this.bufs,e);return t.buf[t.index]}set(e,t){let n=w1(this.bufs,e);n.buf[n.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let n=0;n<e.length;n++)this.set(t+n,e[n]);else if(ul(e))for(let n=0;n<e.length;n++)this.set(t+n,e.get(n));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0)){if(e===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,t){let{bufs:n,length:i}=this._subList(e,t);return ze(n,i)}subarray(e,t){let{bufs:n,length:i}=this._subList(e,t);return n.length===1?n[0]:ze(n,i)}sublist(e,t){let{bufs:n,length:i}=this._subList(e,t),o=new r;return o.length=i,o.bufs=[...n],o}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:this.bufs,length:this.length};let n=[],i=0;for(let o=0;o<this.bufs.length;o++){let s=this.bufs[o],a=i,c=a+s.byteLength;if(i=c,e>=c)continue;let u=e>=a&&e<c,l=t>a&&t<=c;if(u&&l){if(e===a&&t===c){n.push(s);break}let p=e-a;n.push(s.subarray(p,p+(t-e)));break}if(u){if(e===0){n.push(s);continue}n.push(s.subarray(e-a));continue}if(l){if(t===c){n.push(s);break}n.push(s.subarray(0,t-a));break}n.push(s)}return{bufs:n,length:t-e}}indexOf(e,t=0){if(!ul(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let o=256,s=new Int32Array(o);for(let p=0;p<o;p++)s[p]=-1;for(let p=0;p<i;p++)s[n[p]]=p;let a=s,c=this.byteLength-n.byteLength,u=n.byteLength-1,l;for(let p=t;p<=c;p+=l){l=0;for(let m=u;m>=0;m--){let d=this.get(p+m);if(n[m]!==d){l=Math.max(1,m-a[d]);break}}if(l===0)return p}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let n=Bt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,t),this.write(n,e)}getInt16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,t)}setInt16(e,t,n){let i=un(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,t,n),this.write(i,e)}getInt32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,t)}setInt32(e,t,n){let i=un(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,t,n),this.write(i,e)}getBigInt64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,t)}setBigInt64(e,t,n){let i=un(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,t,n),this.write(i,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let n=Bt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,t),this.write(n,e)}getUint16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,t)}setUint16(e,t,n){let i=un(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,t,n),this.write(i,e)}getUint32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,t)}setUint32(e,t,n){let i=un(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,t,n),this.write(i,e)}getBigUint64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,t)}setBigUint64(e,t,n){let i=un(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,t,n),this.write(i,e)}getFloat32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,t)}setFloat32(e,t,n){let i=un(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,t,n),this.write(i,e)}getFloat64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,t)}setFloat64(e,t,n){let i=un(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,t,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof r)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;t<this.bufs.length;t++)if(!ge(this.bufs[t],e.bufs[t]))return!1;return!0}static fromUint8Arrays(e,t){let n=new r;return n.bufs=e,t==null&&(t=e.reduce((i,o)=>i+o.byteLength,0)),n.length=t,n}};function x5(r){return r[Symbol.asyncIterator]!=null}function y5(r,e){if(x5(r))return async function*(){for await(let a of r)yield e(a)}();let t=_o(r),{value:n,done:i}=t.next();if(i===!0)return function*(){}();let o=e(n);if(typeof o.then=="function")return async function*(){yield await o;for await(let a of t)yield e(a)}();let s=e;return function*(){yield o;for(let a of t)yield s(a)}()}var fr=y5;function He(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}var pl=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},zo=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new pl(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new pl(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var xf=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function Or(r={}){return w5(t=>{let n=t.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},r)}function w5(r,e){e=e??{};let t=e.onEnd,n=new zo,i,o,s,a=He(),c=async()=>{try{return n.isEmpty()?s?{done:!0}:await new Promise((x,g)=>{o=w=>{o=null,n.push(w);try{x(r(n))}catch(y){g(y)}return i}}):r(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=He()})}},u=x=>o!=null?o(x):(n.push(x),i),l=x=>(n=new zo,o!=null?o({error:x}):(n.push({error:x}),i)),p=x=>{if(s)return i;if(e?.objectMode!==!0&&x?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return u({done:!1,value:x})},m=x=>s?i:(s=!0,x!=null?l(x):u({done:!0})),d=()=>(n=new zo,m(),{done:!0}),f=x=>(m(x),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:d,throw:f,push:p,end:m,get readableLength(){return n.size},onEmpty:async x=>{let g=x?.signal;if(g?.throwIfAborted(),n.isEmpty())return;let w,y;g!=null&&(w=new Promise((E,B)=>{y=()=>{B(new xf)},g.addEventListener("abort",y)}));try{await Promise.race([a.promise,w])}finally{y!=null&&g!=null&&g?.removeEventListener("abort",y)}}},t==null)return i;let h=i;return i={[Symbol.asyncIterator](){return this},next(){return h.next()},throw(x){return h.throw(x),t!=null&&(t(x),t=void 0),{done:!0}},return(){return h.return(),t!=null&&(t(),t=void 0),{done:!0}},push:p,end(x){return h.end(x),t!=null&&(t(x),t=void 0),i},get readableLength(){return h.readableLength},onEmpty:x=>h.onEmpty(x)},i}function b5(r){return r[Symbol.asyncIterator]!=null}function v5(...r){let e=[];for(let t of r)b5(t)||e.push(t);return e.length===r.length?function*(){for(let t of e)yield*t}():async function*(){let t=Or({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(r.map(async n=>{for await(let i of n)t.push(i)})),t.end()}catch(n){t.end(n)}}),yield*t}()}var ai=v5;function hr(r,...e){if(r==null)throw new Error("Empty pipeline");if(yf(r)){let n=r;r=()=>n.source}else if(S1(r)||A1(r)){let n=r;r=()=>n}let t=[r,...e];if(t.length>1&&yf(t[t.length-1])&&(t[t.length-1]=t[t.length-1].sink),t.length>2)for(let n=1;n<t.length-1;n++)yf(t[n])&&(t[n]=A5(t[n]));return E5(...t)}var E5=(...r)=>{let e;for(;r.length>0;)e=r.shift()(e);return e},A1=r=>r?.[Symbol.asyncIterator]!=null,S1=r=>r?.[Symbol.iterator]!=null,yf=r=>r==null?!1:r.sink!=null&&r.source!=null,A5=r=>e=>{let t=r.sink(e);if(t?.then!=null){let n=Or({objectMode:!0});t.then(()=>{n.end()},s=>{n.end(s)});let i,o=r.source;if(A1(o))i=async function*(){yield*o,n.end()};else if(S1(o))i=function*(){yield*o,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return ai(n,i())}return r.source};function S5(r){return r[Symbol.asyncIterator]!=null}function B5(r,e){return S5(r)?async function*(){let t=0;if(!(e<1)){for await(let n of r)if(yield n,t++,t===e)return}}():function*(){let t=0;if(!(e<1)){for(let n of r)if(yield n,t++,t===e)return}}()}var dl=B5;var P=class extends Event{constructor(e,t){super(e),this.detail=t}};function oe(r,e="utf8"){let t=al[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var fl=class{url;#e=0;#t=0;#r=0;#n=0;constructor(e){this.url=e instanceof URL?e:new URL(e)}async getRawBlock(e,t){let n=this.url;if(n.pathname=`/ipfs/${e.toString()}`,n.search="?format=raw",t?.aborted===!0)throw new Error(`Signal to fetch raw block for CID ${e} from gateway ${this.url} was aborted prior to fetch`);try{this.#e++;let i=await fetch(n.toString(),{signal:t,headers:{Accept:"application/vnd.ipld.raw"},cache:"force-cache"});if(!i.ok)throw this.#t++,new Error(`unable to fetch raw block for CID ${e} from gateway ${this.url}`);return this.#n++,new Uint8Array(await i.arrayBuffer())}catch{throw t?.aborted===!0?new Error(`fetching raw block for CID ${e} from gateway ${this.url} was aborted`):(this.#t++,new Error(`unable to fetch raw block for CID ${e}`))}}reliability(){return this.#e===0?1:this.#r>0?-1/0:this.#n/(this.#e+this.#t*3)}incrementInvalidBlocks(){this.#r++}};var hl=class{gateways;log;constructor(e,t={}){this.log=e.logger.forComponent("helia:trustless-gateway-block-broker"),this.gateways=(t.gateways??B1).map(n=>new fl(n))}async retrieve(e,t={}){let n=this.gateways.sort((o,s)=>s.reliability()-o.reliability()),i=[];for(let o of n){this.log("getting block for %c from %s",e,o.url);try{let s=await o.getRawBlock(e,t.signal);this.log.trace("got block for %c from %s",e,o.url);try{await t.validateFn?.(s)}catch(a){throw this.log.error("failed to validate block for %c from %s",e,o.url,a),o.incrementInvalidBlocks(),new Error(`unable to validate block for CID ${e} from gateway ${o.url}`)}return s}catch(s){if(this.log.error("failed to get block for %c from %s",e,o.url,s),s instanceof Error?i.push(s):i.push(new Error(`unable to fetch raw block for CID ${e} from gateway ${o.url}`)),t.signal?.aborted===!0){this.log.trace("request aborted while fetching raw block for CID %c from gateway %s",e,o.url);break}}}throw new AggregateError(i,`unable to fetch raw block for CID ${e} from any gateway`)}};var B1=["https://trustless-gateway.link","https://cloudflare-ipfs.com","https://4everland.io"];function xa(r={}){return e=>new hl(e,r)}var k5=Symbol.for("nodejs.util.inspect.custom"),k1=Object.values(si).map(r=>r.decoder).reduce((r,e)=>r.or(e),si.identity.decoder),I1=114,wf=36,bf=37,ya=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Ud]=!0;toString(){return this.string==null&&(this.string=Oe.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return z.createV1(I1,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e==null)return!1;if(e instanceof Uint8Array)return ge(this.multihash.bytes,e);if(typeof e=="string")return mr(e).equals(this);if(e?.multihash?.bytes!=null)return ge(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[k5](){return`PeerId(${this.toString()})`}},Vo=class extends ya{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Mo=class extends ya{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},$o=class extends ya{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function mr(r,e){if(e=e??k1,r.charAt(0)==="1"||r.charAt(0)==="Q"){let t=Ot(Oe.decode(`z${r}`));return r.startsWith("12D")?new Mo({multihash:t}):r.startsWith("16U")?new $o({multihash:t}):new Vo({multihash:t})}return wa(k1.decode(r))}function wa(r){try{let e=Ot(r);if(e.code===It.code){if(e.digest.length===wf)return new Mo({multihash:e});if(e.digest.length===bf)return new $o({multihash:e})}if(e.code===ce.code)return new Vo({multihash:e})}catch{return I5(z.decode(r))}throw new Error("Supplied PeerID CID is invalid")}function I5(r){if(r==null||r.multihash==null||r.version==null||r.version===1&&r.code!==I1)throw new Error("Supplied PeerID CID is invalid");let e=r.multihash;if(e.code===ce.code)return new Vo({multihash:r.multihash});if(e.code===It.code){if(e.digest.length===wf)return new Mo({multihash:r.multihash});if(e.digest.length===bf)return new $o({multihash:r.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function _1(r,e){return r.length===wf?new Mo({multihash:Dr(It.code,r),privateKey:e}):r.length===bf?new $o({multihash:Dr(It.code,r),privateKey:e}):new Vo({multihash:await ce.digest(r),publicKey:r,privateKey:e})}var ml=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let t=this.index,n=e();return n===void 0&&(this.index=t),n}parseWith(e){let t=e();if(this.index===this.input.length)return t}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let t=this.readChar();if(t===e)return t})}readSeparator(e,t,n){return this.readAtomically(()=>{if(!(t>0&&this.readGivenChar(e)===void 0))return n()})}readNumber(e,t,n,i){return this.readAtomically(()=>{let o=0,s=0,a=this.peekChar();if(a===void 0)return;let c=a==="0",u=2**(8*i)-1;for(;;){let l=this.readAtomically(()=>{let p=this.readChar();if(p===void 0)return;let m=Number.parseInt(p,e);if(!Number.isNaN(m))return m});if(l===void 0)break;if(o*=e,o+=l,o>u||(s+=1,t!==void 0&&s>t))return}if(s!==0)return!n&&c&&s>1?void 0:o})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let t=0;t<e.length;t++){let n=this.readSeparator(".",t,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;e[t]=n}return e})}readIPv6Addr(){let e=t=>{for(let n=0;n<t.length/2;n++){let i=n*2;if(n<t.length-3){let s=this.readSeparator(":",n,()=>this.readIPv4Addr());if(s!==void 0)return t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=s[3],[i+4,!0]}let o=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(o===void 0)return[i,!1];t[i]=o>>8,t[i+1]=o&255}return[t.length,!1]};return this.readAtomically(()=>{let t=new Uint8Array(16),[n,i]=e(t);if(n===16)return t;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let o=new Uint8Array(14),s=16-(n+2),[a]=e(o.subarray(0,s));return t.set(o.subarray(0,a),16-a),t})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var T1=45,_5=15,jo=new ml;function vf(r){if(!(r.length>_5))return jo.new(r).parseWith(()=>jo.readIPv4Addr())}function Ef(r){if(r.includes("%")&&(r=r.split("%")[0]),!(r.length>T1))return jo.new(r).parseWith(()=>jo.readIPv6Addr())}function gl(r){if(r.includes("%")&&(r=r.split("%")[0]),!(r.length>T1))return jo.new(r).parseWith(()=>jo.readIPAddr())}var SF=parseInt("0xFFFF",16),BF=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function Ho(r){return!!vf(r)}function qo(r){return!!Ef(r)}function ir(r){return!!gl(r)}var R1=Ho,N5=qo,Sf=function(r){let e=0;if(r=r.toString().trim(),R1(r)){let t=new Uint8Array(e+4);return r.split(/\./g).forEach(n=>{t[e++]=parseInt(n,10)&255}),t}if(N5(r)){let t=r.split(":",8),n;for(n=0;n<t.length;n++){let o=R1(t[n]),s;o&&(s=Sf(t[n]),t[n]=oe(s.slice(0,2),"base16")),s!=null&&++n<8&&t.splice(n,0,oe(s.slice(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(n=0;n<t.length&&t[n]!=="";n++);let o=[n,1];for(n=9-t.length;n>0;n--)o.push("0");t.splice.apply(t,o)}let i=new Uint8Array(e+16);for(n=0;n<t.length;n++){let o=parseInt(t[n],16);i[e++]=o>>8&255,i[e++]=o&255}return i}throw new Error("invalid ip address")},U1=function(r,e=0,t){e=~~e,t=t??r.length-e;let n=new DataView(r.buffer);if(t===4){let i=[];for(let o=0;o<t;o++)i.push(r[e+o]);return i.join(".")}if(t===16){let i=[];for(let o=0;o<t;o+=2)i.push(n.getUint16(e+o).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Ko={},Bf={},L5=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,-1,"memory"]];L5.forEach(r=>{let e=P5(...r);Bf[e.code]=e,Ko[e.name]=e});function P5(r,e,t,n,i){return{code:r,size:e,name:t,resolvable:!!n,path:!!i}}function ve(r){if(typeof r=="number"){if(Bf[r]!=null)return Bf[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Ko[r]!=null)return Ko[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var c9=ve("ip4"),l9=ve("ip6"),u9=ve("ipcidr");function If(r,e){switch(ve(r).code){case 4:case 41:return F5(e);case 42:return L1(e);case 6:case 273:case 33:case 132:return O1(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return L1(e);case 421:return $5(e);case 444:return P1(e);case 445:return P1(e);case 466:return M5(e);default:return oe(e,"base16")}}function _f(r,e){switch(ve(r).code){case 4:return N1(e);case 41:return N1(e);case 42:return D1(e);case 6:case 273:case 33:case 132:return Tf(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return D1(e);case 421:return z5(e);case 444:return j5(e);case 445:return H5(e);case 466:return V5(e);default:return Z(e,"base16")}}var kf=Object.values(si).map(r=>r.decoder),O5=function(){let r=kf[0].or(kf[1]);return kf.slice(2).forEach(e=>r=r.or(e)),r}();function N1(r){if(!ir(r))throw new Error("invalid ip address");return Sf(r)}function F5(r){let e=U1(r,0,r.length);if(e==null)throw new Error("ipBuff is required");if(!ir(e))throw new Error("invalid ip address");return e}function Tf(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r),new Uint8Array(e)}function O1(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function D1(r){let e=Z(r),t=Uint8Array.from(Qt(e.length));return ze([t,e],t.length+e.length)}function L1(r){let e=kt(r);if(r=r.slice(Fe(e)),r.length!==e)throw new Error("inconsistent lengths");return oe(r)}function z5(r){let e;r[0]==="Q"||r[0]==="1"?e=Ot(Oe.decode(`z${r}`)).bytes:e=z.parse(r).multihash.bytes;let t=Uint8Array.from(Qt(e.length));return ze([t,e],t.length+e.length)}function V5(r){let e=O5.decode(r),t=Uint8Array.from(Qt(e.length));return ze([t,e],t.length+e.length)}function M5(r){let e=kt(r),t=r.slice(Fe(e));if(t.length!==e)throw new Error("inconsistent lengths");return"u"+oe(t,"base64url")}function $5(r){let e=kt(r),t=r.slice(Fe(e));if(t.length!==e)throw new Error("inconsistent lengths");return oe(t,"base58btc")}function j5(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=nt.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Tf(n);return ze([t,i],t.length+i.length)}function H5(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=nt.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Tf(n);return ze([t,i],t.length+i.length)}function P1(r){let e=r.slice(0,r.length-2),t=r.slice(r.length-2),n=oe(e,"base32"),i=O1(t);return`${n}:${i}`}function F1(r){r=Cf(r);let e=[],t=[],n=null,i=r.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let o=0;o<i.length;o++){let s=i[o],a=ve(s);if(a.size===0){e.push([a.code]),t.push([a.code]);continue}if(o++,o>=i.length)throw V1("invalid address: "+r);if(a.path===!0){n=Cf(i.slice(o).join("/")),e.push([a.code,_f(a.code,n)]),t.push([a.code,n]);break}let c=_f(a.code,i[o]);e.push([a.code,c]),t.push([a.code,If(a.code,c)])}return{string:z1(t),bytes:Uf(e),tuples:e,stringTuples:t,path:n}}function Rf(r){let e=[],t=[],n=null,i=0;for(;i<r.length;){let o=kt(r,i),s=Fe(o),a=ve(o),c=q5(a,r.slice(i+s));if(c===0){e.push([o]),t.push([o]),i+=s;continue}let u=r.slice(i+s,i+s+c);if(i+=c+s,i>r.length)throw V1("Invalid address Uint8Array: "+oe(r,"base16"));e.push([o,u]);let l=If(o,u);if(t.push([o,l]),a.path===!0){n=l;break}}return{bytes:Uint8Array.from(r),string:z1(t),tuples:e,stringTuples:t,path:n}}function z1(r){let e=[];return r.map(t=>{let n=ve(t[0]);return e.push(n.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),Cf(e.join("/"))}function Uf(r){return ze(r.map(e=>{let t=ve(e[0]),n=Uint8Array.from(Qt(t.code));return e.length>1&&e[1]!=null&&(n=ze([n,e[1]])),n}))}function q5(r,e){if(r.size>0)return r.size/8;if(r.size===0)return 0;{let t=kt(e instanceof Uint8Array?e:Uint8Array.from(e));return t+Fe(t)}}function Cf(r){return"/"+r.trim().split("/").filter(e=>e).join("/")}function V1(r){return new Error("Error parsing address: "+r)}var K5=Symbol.for("nodejs.util.inspect.custom"),Nf=Symbol.for("@multiformats/js-multiaddr/multiaddr"),G5=[ve("dns").code,ve("dns4").code,ve("dns6").code,ve("dnsaddr").code],xl=class r{bytes;#e;#t;#r;#n;[Nf]=!0;constructor(e){e==null&&(e="");let t;if(e instanceof Uint8Array)t=Rf(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);t=F1(e)}else if($1(e))t=Rf(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=t.bytes,this.#e=t.string,this.#t=t.tuples,this.#r=t.stringTuples,this.#n=t.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let e,t,n,i,o="",s=ve("tcp"),a=ve("udp"),c=ve("ip4"),u=ve("ip6"),l=ve("dns6"),p=ve("ip6zone");for(let[d,f]of this.stringTuples())d===p.code&&(o=`%${f??""}`),G5.includes(d)&&(t=s.name,i=443,n=`${f??""}${o}`,e=d===l.code?6:4),(d===s.code||d===a.code)&&(t=ve(d).name,i=parseInt(f??"")),(d===c.code||d===u.code)&&(t=ve(d).name,n=`${f??""}${o}`,e=d===u.code?6:4);if(e==null||t==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:t,port:i}}protos(){return this.#t.map(([e])=>Object.assign({},ve(e)))}protoCodes(){return this.#t.map(([e])=>e)}protoNames(){return this.#t.map(([e])=>ve(e).name)}tuples(){return this.#t}stringTuples(){return this.#r}encapsulate(e){return e=new r(e),new r(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),n=this.toString(),i=n.lastIndexOf(t);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new r(n.slice(0,i))}decapsulateCode(e){let t=this.tuples();for(let n=t.length-1;n>=0;n--)if(t[n][0]===e)return new r(Uf(t.slice(0,n)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([n,i])=>{n===Ko.p2p.code&&e.push([n,i]),n===Ko["p2p-circuit"].code&&(e=[])});let t=e.pop();if(t?.[1]!=null){let n=t[1];return n[0]==="Q"||n[0]==="1"?oe(Oe.decode(`z${n}`),"base58btc"):oe(z.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(e){return ge(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(o=>o.resolvable);if(t==null)return[this];let n=M1.get(t.name);if(n==null)throw new O(`no available resolver for ${t.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(o=>new r(o))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let t=(e??this).protos();return!(t.length!==2||t[0].code!==4&&t[0].code!==41||t[1].code!==6&&t[1].code!==273)}[K5](){return`Multiaddr(${this.#e})`}};var M1=new Map;function $1(r){return!!r?.[Nf]}function Df(r){return new xl(r)}async function*yl(r,e={}){let t=r.getReader();try{for(;;){let n=await t.read();if(n.done)return;yield n.value}}finally{e.preventCancel!==!0&&await t.cancel(),t.releaseLock()}}var Zf={};$(Zf,{Ed25519PrivateKey:()=>eo,Ed25519PublicKey:()=>Ea,generateKeyPair:()=>iB,generateKeyPairFromSeed:()=>hy,unmarshalEd25519PrivateKey:()=>rB,unmarshalEd25519PublicKey:()=>nB});function or(r){return r==null?!1:typeof r.then=="function"&&typeof r.catch=="function"&&typeof r.finally=="function"}function Go(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function W5(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function Lf(r,...e){if(!W5(r))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}function wl(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Go(r.outputLen),Go(r.blockLen)}function Wo(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function j1(r,e){Lf(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}var bl=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function H1(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}var Xo=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),gr=(r,e)=>r<<32-e|r>>>e,Y5=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Y5)throw new Error("Non little-endian hardware is not supported");var X5=async()=>{};async function q1(r,e,t){let n=Date.now();for(let i=0;i<r;i++){t(i);let o=Date.now()-n;o>=0&&o<e||(await X5(),n+=o)}}function Pf(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function ci(r){if(typeof r=="string"&&(r=Pf(r)),!H1(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function vl(...r){let e=0;for(let n=0;n<r.length;n++){let i=r[n];if(!H1(i))throw new Error("Uint8Array expected");e+=i.length}let t=new Uint8Array(e);for(let n=0,i=0;n<r.length;n++){let o=r[n];t.set(o,i),i+=o.length}return t}var Yo=class{clone(){return this._cloneInto()}},J5={}.toString;function K1(r,e){if(e!==void 0&&J5.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}function El(r){let e=n=>r().update(ci(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function Jo(r=32){if(bl&&typeof bl.getRandomValues=="function")return bl.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}function Z5(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(t>>i&o),a=Number(t&o),c=n?4:0,u=n?0:4;r.setUint32(e+c,s,n),r.setUint32(e+u,a,n)}var Zo=class extends Yo{constructor(e,t,n,i){super(),this.blockLen=e,this.outputLen=t,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=Xo(this.buffer)}update(e){Wo(this);let{view:t,buffer:n,blockLen:i}=this;e=ci(e);let o=e.length;for(let s=0;s<o;){let a=Math.min(i-this.pos,o-s);if(a===i){let c=Xo(e);for(;i<=o-s;s+=i)this.process(c,s);continue}n.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Wo(this),j1(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:i,isLE:o}=this,{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(n,0),s=0);for(let p=s;p<i;p++)t[p]=0;Z5(n,i-8,BigInt(this.length*8),o),this.process(n,0);let a=Xo(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<u;p++)a.setUint32(4*p,l[p],o)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:i,finished:o,destroyed:s,pos:a}=this;return e.length=i,e.pos=a,e.finished=o,e.destroyed=s,i%t&&e.buffer.set(n),e}};var Al=BigInt(4294967295),Of=BigInt(32);function G1(r,e=!1){return e?{h:Number(r&Al),l:Number(r>>Of&Al)}:{h:Number(r>>Of&Al)|0,l:Number(r&Al)|0}}function Q5(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let i=0;i<r.length;i++){let{h:o,l:s}=G1(r[i],e);[t[i],n[i]]=[o,s]}return[t,n]}var eS=(r,e)=>BigInt(r>>>0)<<Of|BigInt(e>>>0),tS=(r,e,t)=>r>>>t,rS=(r,e,t)=>r<<32-t|e>>>t,nS=(r,e,t)=>r>>>t|e<<32-t,iS=(r,e,t)=>r<<32-t|e>>>t,oS=(r,e,t)=>r<<64-t|e>>>t-32,sS=(r,e,t)=>r>>>t-32|e<<64-t,aS=(r,e)=>e,cS=(r,e)=>r,lS=(r,e,t)=>r<<t|e>>>32-t,uS=(r,e,t)=>e<<t|r>>>32-t,pS=(r,e,t)=>e<<t-32|r>>>64-t,dS=(r,e,t)=>r<<t-32|e>>>64-t;function fS(r,e,t,n){let i=(e>>>0)+(n>>>0);return{h:r+t+(i/2**32|0)|0,l:i|0}}var hS=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),mS=(r,e,t,n)=>e+t+n+(r/2**32|0)|0,gS=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),xS=(r,e,t,n,i)=>e+t+n+i+(r/2**32|0)|0,yS=(r,e,t,n,i)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0),wS=(r,e,t,n,i,o)=>e+t+n+i+o+(r/2**32|0)|0;var bS={fromBig:G1,split:Q5,toBig:eS,shrSH:tS,shrSL:rS,rotrSH:nS,rotrSL:iS,rotrBH:oS,rotrBL:sS,rotr32H:aS,rotr32L:cS,rotlSH:lS,rotlSL:uS,rotlBH:pS,rotlBL:dS,add:fS,add3L:hS,add3H:mS,add4L:gS,add4H:xS,add5H:wS,add5L:yS},ie=bS;var[vS,ES]=ie.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(r=>BigInt(r))),li=new Uint32Array(80),ui=new Uint32Array(80),Ff=class extends Zo{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:t,Bh:n,Bl:i,Ch:o,Cl:s,Dh:a,Dl:c,Eh:u,El:l,Fh:p,Fl:m,Gh:d,Gl:f,Hh:h,Hl:x}=this;return[e,t,n,i,o,s,a,c,u,l,p,m,d,f,h,x]}set(e,t,n,i,o,s,a,c,u,l,p,m,d,f,h,x){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=s|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=p|0,this.Fl=m|0,this.Gh=d|0,this.Gl=f|0,this.Hh=h|0,this.Hl=x|0}process(e,t){for(let y=0;y<16;y++,t+=4)li[y]=e.getUint32(t),ui[y]=e.getUint32(t+=4);for(let y=16;y<80;y++){let E=li[y-15]|0,B=ui[y-15]|0,S=ie.rotrSH(E,B,1)^ie.rotrSH(E,B,8)^ie.shrSH(E,B,7),b=ie.rotrSL(E,B,1)^ie.rotrSL(E,B,8)^ie.shrSL(E,B,7),v=li[y-2]|0,k=ui[y-2]|0,U=ie.rotrSH(v,k,19)^ie.rotrBH(v,k,61)^ie.shrSH(v,k,6),R=ie.rotrSL(v,k,19)^ie.rotrBL(v,k,61)^ie.shrSL(v,k,6),M=ie.add4L(b,R,ui[y-7],ui[y-16]),L=ie.add4H(M,S,U,li[y-7],li[y-16]);li[y]=L|0,ui[y]=M|0}let{Ah:n,Al:i,Bh:o,Bl:s,Ch:a,Cl:c,Dh:u,Dl:l,Eh:p,El:m,Fh:d,Fl:f,Gh:h,Gl:x,Hh:g,Hl:w}=this;for(let y=0;y<80;y++){let E=ie.rotrSH(p,m,14)^ie.rotrSH(p,m,18)^ie.rotrBH(p,m,41),B=ie.rotrSL(p,m,14)^ie.rotrSL(p,m,18)^ie.rotrBL(p,m,41),S=p&d^~p&h,b=m&f^~m&x,v=ie.add5L(w,B,b,ES[y],ui[y]),k=ie.add5H(v,g,E,S,vS[y],li[y]),U=v|0,R=ie.rotrSH(n,i,28)^ie.rotrBH(n,i,34)^ie.rotrBH(n,i,39),M=ie.rotrSL(n,i,28)^ie.rotrBL(n,i,34)^ie.rotrBL(n,i,39),L=n&o^n&a^o&a,le=i&s^i&c^s&c;g=h|0,w=x|0,h=d|0,x=f|0,d=p|0,f=m|0,{h:p,l:m}=ie.add(u|0,l|0,k|0,U|0),u=a|0,l=c|0,a=o|0,c=s|0,o=n|0,s=i|0;let _=ie.add3L(U,M,le);n=ie.add3H(_,k,R,L),i=_|0}({h:n,l:i}=ie.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:s}=ie.add(this.Bh|0,this.Bl|0,o|0,s|0),{h:a,l:c}=ie.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=ie.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:p,l:m}=ie.add(this.Eh|0,this.El|0,p|0,m|0),{h:d,l:f}=ie.add(this.Fh|0,this.Fl|0,d|0,f|0),{h,l:x}=ie.add(this.Gh|0,this.Gl|0,h|0,x|0),{h:g,l:w}=ie.add(this.Hh|0,this.Hl|0,g|0,w|0),this.set(n,i,o,s,a,c,u,l,p,m,d,f,h,x,g,w)}roundClean(){li.fill(0),ui.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)}};var Qo=El(()=>new Ff);var Bl={};$(Bl,{bitGet:()=>TS,bitLen:()=>_S,bitMask:()=>ba,bitSet:()=>CS,bytesToHex:()=>dn,bytesToNumberBE:()=>fn,bytesToNumberLE:()=>pi,concatBytes:()=>hn,createHmacDrbg:()=>Mf,ensureBytes:()=>Re,equalBytes:()=>kS,hexToBytes:()=>Ji,hexToNumber:()=>Vf,isBytes:()=>xr,numberToBytesBE:()=>di,numberToBytesLE:()=>Zi,numberToHexUnpadded:()=>J1,numberToVarBytesBE:()=>BS,utf8ToBytes:()=>IS,validateObject:()=>Fr});var X1=BigInt(0),Sl=BigInt(1),AS=BigInt(2);function xr(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}var SS=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function dn(r){if(!xr(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=SS[r[t]];return e}function J1(r){let e=r.toString(16);return e.length&1?`0${e}`:e}function Vf(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}var pn={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function W1(r){if(r>=pn._0&&r<=pn._9)return r-pn._0;if(r>=pn._A&&r<=pn._F)return r-(pn._A-10);if(r>=pn._a&&r<=pn._f)return r-(pn._a-10)}function Ji(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(t);for(let i=0,o=0;i<t;i++,o+=2){let s=W1(r.charCodeAt(o)),a=W1(r.charCodeAt(o+1));if(s===void 0||a===void 0){let c=r[o]+r[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}n[i]=s*16+a}return n}function fn(r){return Vf(dn(r))}function pi(r){if(!xr(r))throw new Error("Uint8Array expected");return Vf(dn(Uint8Array.from(r).reverse()))}function di(r,e){return Ji(r.toString(16).padStart(e*2,"0"))}function Zi(r,e){return di(r,e).reverse()}function BS(r){return Ji(J1(r))}function Re(r,e,t){let n;if(typeof e=="string")try{n=Ji(e)}catch(o){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${o}`)}else if(xr(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let i=n.length;if(typeof t=="number"&&i!==t)throw new Error(`${r} expected ${t} bytes, got ${i}`);return n}function hn(...r){let e=0;for(let i=0;i<r.length;i++){let o=r[i];if(!xr(o))throw new Error("Uint8Array expected");e+=o.length}let t=new Uint8Array(e),n=0;for(let i=0;i<r.length;i++){let o=r[i];t.set(o,n),n+=o.length}return t}function kS(r,e){if(r.length!==e.length)return!1;let t=0;for(let n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}function IS(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function _S(r){let e;for(e=0;r>X1;r>>=Sl,e+=1);return e}function TS(r,e){return r>>BigInt(e)&Sl}var CS=(r,e,t)=>r|(t?Sl:X1)<<BigInt(e),ba=r=>(AS<<BigInt(r-1))-Sl,zf=r=>new Uint8Array(r),Y1=r=>Uint8Array.from(r);function Mf(r,e,t){if(typeof r!="number"||r<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 t!="function")throw new Error("hmacFn must be a function");let n=zf(r),i=zf(r),o=0,s=()=>{n.fill(1),i.fill(0),o=0},a=(...p)=>t(i,n,...p),c=(p=zf())=>{i=a(Y1([0]),p),n=a(),p.length!==0&&(i=a(Y1([1]),p),n=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let p=0,m=[];for(;p<e;){n=a();let d=n.slice();m.push(d),p+=n.length}return hn(...m)};return(p,m)=>{s(),c(p);let d;for(;!(d=m(u()));)c();return s(),d}}var RS={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||xr(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function Fr(r,e,t={}){let n=(i,o,s)=>{let a=RS[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);let c=r[i];if(!(s&&c===void 0)&&!a(c,r))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${o}`)};for(let[i,o]of Object.entries(e))n(i,o,!1);for(let[i,o]of Object.entries(t))n(i,o,!0);return r}var Ye=BigInt(0),Ae=BigInt(1),Qi=BigInt(2),US=BigInt(3),$f=BigInt(4),Z1=BigInt(5),Q1=BigInt(8),NS=BigInt(9),DS=BigInt(16);function be(r,e){let t=r%e;return t>=Ye?t:e+t}function LS(r,e,t){if(t<=Ye||e<Ye)throw new Error("Expected power/modulo > 0");if(t===Ae)return Ye;let n=Ae;for(;e>Ye;)e&Ae&&(n=n*r%t),r=r*r%t,e>>=Ae;return n}function Se(r,e,t){let n=r;for(;e-- >Ye;)n*=n,n%=t;return n}function kl(r,e){if(r===Ye||e<=Ye)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=be(r,e),n=e,i=Ye,o=Ae,s=Ae,a=Ye;for(;t!==Ye;){let u=n/t,l=n%t,p=i-s*u,m=o-a*u;n=t,t=l,i=s,o=a,s=p,a=m}if(n!==Ae)throw new Error("invert: does not exist");return be(i,e)}function PS(r){let e=(r-Ae)/Qi,t,n,i;for(t=r-Ae,n=0;t%Qi===Ye;t/=Qi,n++);for(i=Qi;i<r&&LS(i,e,r)!==r-Ae;i++);if(n===1){let s=(r+Ae)/$f;return function(c,u){let l=c.pow(u,s);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}let o=(t+Ae)/Qi;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,l=a.pow(a.mul(a.ONE,i),t),p=a.pow(c,o),m=a.pow(c,t);for(;!a.eql(m,a.ONE);){if(a.eql(m,a.ZERO))return a.ZERO;let d=1;for(let h=a.sqr(m);d<u&&!a.eql(h,a.ONE);d++)h=a.sqr(h);let f=a.pow(l,Ae<<BigInt(u-d-1));l=a.sqr(f),p=a.mul(p,f),m=a.mul(m,l),u=d}return p}}function OS(r){if(r%$f===US){let e=(r+Ae)/$f;return function(n,i){let o=n.pow(i,e);if(!n.eql(n.sqr(o),i))throw new Error("Cannot find square root");return o}}if(r%Q1===Z1){let e=(r-Z1)/Q1;return function(n,i){let o=n.mul(i,Qi),s=n.pow(o,e),a=n.mul(i,s),c=n.mul(n.mul(a,Qi),s),u=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),i))throw new Error("Cannot find square root");return u}}return r%DS,PS(r)}var ey=(r,e)=>(be(r,e)&Ae)===Ae,FS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function jf(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=FS.reduce((n,i)=>(n[i]="function",n),e);return Fr(r,t)}function zS(r,e,t){if(t<Ye)throw new Error("Expected power > 0");if(t===Ye)return r.ONE;if(t===Ae)return e;let n=r.ONE,i=e;for(;t>Ye;)t&Ae&&(n=r.mul(n,i)),i=r.sqr(i),t>>=Ae;return n}function VS(r,e){let t=new Array(e.length),n=e.reduce((o,s,a)=>r.is0(s)?o:(t[a]=o,r.mul(o,s)),r.ONE),i=r.inv(n);return e.reduceRight((o,s,a)=>r.is0(s)?o:(t[a]=r.mul(o,t[a]),r.mul(o,s)),i),t}function Hf(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function Il(r,e,t=!1,n={}){if(r<=Ye)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:i,nByteLength:o}=Hf(r,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");let s=OS(r),a=Object.freeze({ORDER:r,BITS:i,BYTES:o,MASK:ba(i),ZERO:Ye,ONE:Ae,create:c=>be(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Ye<=c&&c<r},is0:c=>c===Ye,isOdd:c=>(c&Ae)===Ae,neg:c=>be(-c,r),eql:(c,u)=>c===u,sqr:c=>be(c*c,r),add:(c,u)=>be(c+u,r),sub:(c,u)=>be(c-u,r),mul:(c,u)=>be(c*u,r),pow:(c,u)=>zS(a,c,u),div:(c,u)=>be(c*kl(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>kl(c,r),sqrt:n.sqrt||(c=>s(a,c)),invertBatch:c=>VS(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>t?Zi(c,o):di(c,o),fromBytes:c=>{if(c.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${c.length}`);return t?pi(c):fn(c)}});return Object.freeze(a)}function ty(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?r.neg(t):t}function ry(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}function qf(r){let e=ry(r);return e+Math.ceil(e/2)}function ny(r,e,t=!1){let n=r.length,i=ry(e),o=qf(e);if(n<16||n<o||n>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${n}`);let s=t?fn(r):pi(r),a=be(s,e-Ae)+Ae;return t?Zi(a,i):di(a,i)}var $S=BigInt(0),Kf=BigInt(1);function _l(r,e){let t=(i,o)=>{let s=o.negate();return i?s:o},n=i=>{let o=Math.ceil(e/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:t,unsafeLadder(i,o){let s=r.ZERO,a=i;for(;o>$S;)o&Kf&&(s=s.add(a)),a=a.double(),o>>=Kf;return s},precomputeWindow(i,o){let{windows:s,windowSize:a}=n(o),c=[],u=i,l=u;for(let p=0;p<s;p++){l=u,c.push(l);for(let m=1;m<a;m++)l=l.add(u),c.push(l);u=l.double()}return c},wNAF(i,o,s){let{windows:a,windowSize:c}=n(i),u=r.ZERO,l=r.BASE,p=BigInt(2**i-1),m=2**i,d=BigInt(i);for(let f=0;f<a;f++){let h=f*c,x=Number(s&p);s>>=d,x>c&&(x-=m,s+=Kf);let g=h,w=h+Math.abs(x)-1,y=f%2!==0,E=x<0;x===0?l=l.add(t(y,o[g])):u=u.add(t(E,o[w]))}return{p:u,f:l}},wNAFCached(i,o,s,a){let c=i._WINDOW_SIZE||1,u=o.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&o.set(i,a(u))),this.wNAF(c,u,s)}}}function va(r){return jf(r.Fp),Fr(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Hf(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}var yr=BigInt(0),Mt=BigInt(1),Tl=BigInt(2),jS=BigInt(8),HS={zip215:!0};function qS(r){let e=va(r);return Fr(r,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Cl(r){let e=qS(r),{Fp:t,n,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:c}=e,u=Tl<<BigInt(a*8)-Mt,l=t.create,p=e.uvRatio||((N,T)=>{try{return{isValid:!0,value:t.sqrt(N*t.inv(T))}}catch{return{isValid:!1,value:yr}}}),m=e.adjustScalarBytes||(N=>N),d=e.domain||((N,T,H)=>{if(T.length||H)throw new Error("Contexts/pre-hash are not supported");return N}),f=N=>typeof N=="bigint"&&yr<N,h=(N,T)=>f(N)&&f(T)&&N<T,x=N=>N===yr||h(N,u);function g(N,T){if(h(N,T))return N;throw new Error(`Expected valid scalar < ${T}, got ${typeof N} ${N}`)}function w(N){return N===yr?N:g(N,n)}let y=new Map;function E(N){if(!(N instanceof B))throw new Error("ExtendedPoint expected")}class B{constructor(T,H,Y,ee){if(this.ex=T,this.ey=H,this.ez=Y,this.et=ee,!x(T))throw new Error("x required");if(!x(H))throw new Error("y required");if(!x(Y))throw new Error("z required");if(!x(ee))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(T){if(T instanceof B)throw new Error("extended point not allowed");let{x:H,y:Y}=T||{};if(!x(H)||!x(Y))throw new Error("invalid affine point");return new B(H,Y,Mt,l(H*Y))}static normalizeZ(T){let H=t.invertBatch(T.map(Y=>Y.ez));return T.map((Y,ee)=>Y.toAffine(H[ee])).map(B.fromAffine)}_setWindowSize(T){this._WINDOW_SIZE=T,y.delete(this)}assertValidity(){let{a:T,d:H}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:Y,ey:ee,ez:ae,et:ue}=this,we=l(Y*Y),de=l(ee*ee),he=l(ae*ae),$e=l(he*he),Te=l(we*T),tt=l(he*l(Te+de)),rt=l($e+l(H*l(we*de)));if(tt!==rt)throw new Error("bad point: equation left != right (1)");let We=l(Y*ee),ut=l(ae*ue);if(We!==ut)throw new Error("bad point: equation left != right (2)")}equals(T){E(T);let{ex:H,ey:Y,ez:ee}=this,{ex:ae,ey:ue,ez:we}=T,de=l(H*we),he=l(ae*ee),$e=l(Y*we),Te=l(ue*ee);return de===he&&$e===Te}is0(){return this.equals(B.ZERO)}negate(){return new B(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:T}=e,{ex:H,ey:Y,ez:ee}=this,ae=l(H*H),ue=l(Y*Y),we=l(Tl*l(ee*ee)),de=l(T*ae),he=H+Y,$e=l(l(he*he)-ae-ue),Te=de+ue,tt=Te-we,rt=de-ue,We=l($e*tt),ut=l(Te*rt),ln=l($e*rt),$i=l(tt*Te);return new B(We,ut,$i,ln)}add(T){E(T);let{a:H,d:Y}=e,{ex:ee,ey:ae,ez:ue,et:we}=this,{ex:de,ey:he,ez:$e,et:Te}=T;if(H===BigInt(-1)){let bx=l((ae-ee)*(he+de)),vx=l((ae+ee)*(he-de)),wd=l(vx-bx);if(wd===yr)return this.double();let Ex=l(ue*Tl*Te),Ax=l(we*Tl*$e),Sx=Ax+Ex,Bx=vx+bx,kx=Ax-Ex,l8=l(Sx*wd),u8=l(Bx*kx),p8=l(Sx*kx),d8=l(wd*Bx);return new B(l8,u8,d8,p8)}let tt=l(ee*de),rt=l(ae*he),We=l(we*Y*Te),ut=l(ue*$e),ln=l((ee+ae)*(de+he)-tt-rt),$i=ut-We,la=ut+We,wx=l(rt-H*tt),o8=l(ln*$i),s8=l(la*wx),a8=l(ln*wx),c8=l($i*la);return new B(o8,s8,c8,a8)}subtract(T){return this.add(T.negate())}wNAF(T){return v.wNAFCached(this,y,T,B.normalizeZ)}multiply(T){let{p:H,f:Y}=this.wNAF(g(T,n));return B.normalizeZ([H,Y])[0]}multiplyUnsafe(T){let H=w(T);return H===yr?b:this.equals(b)||H===Mt?this:this.equals(S)?this.wNAF(H).p:v.unsafeLadder(this,H)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return v.unsafeLadder(this,n).is0()}toAffine(T){let{ex:H,ey:Y,ez:ee}=this,ae=this.is0();T==null&&(T=ae?jS:t.inv(ee));let ue=l(H*T),we=l(Y*T),de=l(ee*T);if(ae)return{x:yr,y:Mt};if(de!==Mt)throw new Error("invZ was invalid");return{x:ue,y:we}}clearCofactor(){let{h:T}=e;return T===Mt?this:this.multiplyUnsafe(T)}static fromHex(T,H=!1){let{d:Y,a:ee}=e,ae=t.BYTES;T=Re("pointHex",T,ae);let ue=T.slice(),we=T[ae-1];ue[ae-1]=we&-129;let de=pi(ue);de===yr||(H?g(de,u):g(de,t.ORDER));let he=l(de*de),$e=l(he-Mt),Te=l(Y*he-ee),{isValid:tt,value:rt}=p($e,Te);if(!tt)throw new Error("Point.fromHex: invalid y coordinate");let We=(rt&Mt)===Mt,ut=(we&128)!==0;if(!H&&rt===yr&&ut)throw new Error("Point.fromHex: x=0 and x_0=1");return ut!==We&&(rt=l(-rt)),B.fromAffine({x:rt,y:de})}static fromPrivateKey(T){return R(T).point}toRawBytes(){let{x:T,y:H}=this.toAffine(),Y=Zi(H,t.BYTES);return Y[Y.length-1]|=T&Mt?128:0,Y}toHex(){return dn(this.toRawBytes())}}B.BASE=new B(e.Gx,e.Gy,Mt,l(e.Gx*e.Gy)),B.ZERO=new B(yr,Mt,Mt,yr);let{BASE:S,ZERO:b}=B,v=_l(B,a*8);function k(N){return be(N,n)}function U(N){return k(pi(N))}function R(N){let T=a;N=Re("private key",N,T);let H=Re("hashed private key",o(N),2*T),Y=m(H.slice(0,T)),ee=H.slice(T,2*T),ae=U(Y),ue=S.multiply(ae),we=ue.toRawBytes();return{head:Y,prefix:ee,scalar:ae,point:ue,pointBytes:we}}function M(N){return R(N).pointBytes}function L(N=new Uint8Array,...T){let H=hn(...T);return U(o(d(H,Re("context",N),!!i)))}function le(N,T,H={}){N=Re("message",N),i&&(N=i(N));let{prefix:Y,scalar:ee,pointBytes:ae}=R(T),ue=L(H.context,Y,N),we=S.multiply(ue).toRawBytes(),de=L(H.context,we,ae,N),he=k(ue+de*ee);w(he);let $e=hn(we,Zi(he,t.BYTES));return Re("result",$e,a*2)}let _=HS;function D(N,T,H,Y=_){let{context:ee,zip215:ae}=Y,ue=t.BYTES;N=Re("signature",N,2*ue),T=Re("message",T),i&&(T=i(T));let we=pi(N.slice(ue,2*ue)),de,he,$e;try{de=B.fromHex(H,ae),he=B.fromHex(N.slice(0,ue),ae),$e=S.multiplyUnsafe(we)}catch{return!1}if(!ae&&de.isSmallOrder())return!1;let Te=L(ee,he.toRawBytes(),de.toRawBytes(),T);return he.add(de.multiplyUnsafe(Te)).subtract($e).clearCofactor().equals(B.ZERO)}return S._setWindowSize(8),{CURVE:e,getPublicKey:M,sign:le,verify:D,ExtendedPoint:B,utils:{getExtendedPublicKey:R,randomPrivateKey:()=>s(t.BYTES),precompute(N=8,T=B.BASE){return T._setWindowSize(N),T.multiply(BigInt(3)),T}}}}var Wf=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),iy=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),lz=BigInt(0),KS=BigInt(1),Gf=BigInt(2),GS=BigInt(5),oy=BigInt(10),WS=BigInt(20),YS=BigInt(40),sy=BigInt(80);function XS(r){let e=Wf,n=r*r%e*r%e,i=Se(n,Gf,e)*n%e,o=Se(i,KS,e)*r%e,s=Se(o,GS,e)*o%e,a=Se(s,oy,e)*s%e,c=Se(a,WS,e)*a%e,u=Se(c,YS,e)*c%e,l=Se(u,sy,e)*u%e,p=Se(l,sy,e)*u%e,m=Se(p,oy,e)*s%e;return{pow_p_5_8:Se(m,Gf,e)*r%e,b2:n}}function JS(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}function ZS(r,e){let t=Wf,n=be(e*e*e,t),i=be(n*n*e,t),o=XS(r*i).pow_p_5_8,s=be(r*n*o,t),a=be(e*s*s,t),c=s,u=be(s*iy,t),l=a===r,p=a===be(-r,t),m=a===be(-r*iy,t);return l&&(s=c),(p||m)&&(s=u),ey(s,t)&&(s=be(-s,t)),{isValid:l||p,value:s}}var mn=Il(Wf,void 0,!0),Yf={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:mn,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Qo,randomBytes:Jo,adjustScalarBytes:JS,uvRatio:ZS},es=Cl(Yf);function ay(r,e,t){if(e.length>255)throw new Error("Context is too big");return vl(Pf("SigEd25519 no Ed25519 collisions"),new Uint8Array([t?1:0,e.length]),e,r)}var uz=Cl({...Yf,domain:ay}),pz=Cl({...Yf,domain:ay,prehash:Qo});var QS=(mn.ORDER+BigInt(3))/BigInt(8),dz=mn.pow(Gf,QS),fz=mn.sqrt(mn.neg(mn.ONE)),hz=(mn.ORDER-BigInt(5))/BigInt(8),mz=BigInt(486662);var gz=ty(mn,mn.neg(BigInt(486664)));var xz=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),yz=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),wz=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),bz=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var vz=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var ts=32,gn=64,Rl=32;function cy(){let r=es.utils.randomPrivateKey(),e=es.getPublicKey(r);return{privateKey:dy(r,e),publicKey:e}}function ly(r){if(r.length!==Rl)throw new TypeError('"seed" must be 32 bytes in length.');if(!(r instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=r,t=es.getPublicKey(e);return{privateKey:dy(e,t),publicKey:t}}function uy(r,e){let t=r.subarray(0,Rl);return es.sign(e instanceof Uint8Array?e:e.subarray(),t)}function py(r,e,t){return es.verify(e,t instanceof Uint8Array?t:t.subarray(),r)}function dy(r,e){let t=new Uint8Array(gn);for(let n=0;n<Rl;n++)t[n]=r[n],t[Rl+n]=e[n];return t}var xt={get(r=globalThis){let e=r.crypto;if(e==null||e.subtle==null)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p/blob/main/packages/crypto/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return e}};var Xf={alg:"A128GCM",ext:!0,k:"scm9jmO_4BJAgdwWGVulLg",key_ops:["encrypt","decrypt"],kty:"oct"};function fy(r){let e=r?.algorithm??"AES-GCM",t=r?.keyLength??16,n=r?.nonceLength??12,i=r?.digest??"SHA-256",o=r?.saltLength??16,s=r?.iterations??32767,a=xt.get();t*=8;async function c(p,m){let d=a.getRandomValues(new Uint8Array(o)),f=a.getRandomValues(new Uint8Array(n)),h={name:e,iv:f};typeof m=="string"&&(m=Z(m));let x;if(m.length===0){x=await a.subtle.importKey("jwk",Xf,{name:"AES-GCM"},!0,["encrypt"]);try{let w={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},y=await a.subtle.importKey("raw",m,{name:"PBKDF2"},!1,["deriveKey"]);x=await a.subtle.deriveKey(w,y,{name:e,length:t},!0,["encrypt"])}catch{x=await a.subtle.importKey("jwk",Xf,{name:"AES-GCM"},!0,["encrypt"])}}else{let w={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},y=await a.subtle.importKey("raw",m,{name:"PBKDF2"},!1,["deriveKey"]);x=await a.subtle.deriveKey(w,y,{name:e,length:t},!0,["encrypt"])}let g=await a.subtle.encrypt(h,x,p);return ze([d,h.iv,new Uint8Array(g)])}async function u(p,m){let d=p.subarray(0,o),f=p.subarray(o,o+n),h=p.subarray(o+n),x={name:e,iv:f};typeof m=="string"&&(m=Z(m));let g;if(m.length===0)try{let y={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},E=await a.subtle.importKey("raw",m,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(y,E,{name:e,length:t},!0,["decrypt"])}catch{g=await a.subtle.importKey("jwk",Xf,{name:"AES-GCM"},!0,["decrypt"])}else{let y={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},E=await a.subtle.importKey("raw",m,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(y,E,{name:e,length:t},!0,["decrypt"])}let w=await a.subtle.decrypt(x,g,h);return new Uint8Array(w)}return{encrypt:c,decrypt:u}}async function rs(r,e){let n=await fy().encrypt(r,e);return Pr.encode(n)}var Be;(function(r){r.RSA="RSA",r.Ed25519="Ed25519",r.Secp256k1="Secp256k1"})(Be||(Be={}));var Jf;(function(r){r[r.RSA=0]="RSA",r[r.Ed25519=1]="Ed25519",r[r.Secp256k1=2]="Secp256k1"})(Jf||(Jf={}));(function(r){r.codec=()=>Wi(Jf)})(Be||(Be={}));var zr;(function(r){let e;r.codec=()=>(e==null&&(e=nr((t,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),t.Type!=null&&(n.uint32(8),Be.codec().encode(t.Type,n)),t.Data!=null&&(n.uint32(18),n.bytes(t.Data)),i.lengthDelimited!==!1&&n.ldelim()},(t,n)=>{let i={},o=n==null?t.len:t.pos+n;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.Type=Be.codec().decode(t);break;case 2:i.Data=t.bytes();break;default:t.skipType(s&7);break}}return i})),e),r.encode=t=>rr(t,r.codec()),r.decode=t=>er(t,r.codec())})(zr||(zr={}));var Vr;(function(r){let e;r.codec=()=>(e==null&&(e=nr((t,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),t.Type!=null&&(n.uint32(8),Be.codec().encode(t.Type,n)),t.Data!=null&&(n.uint32(18),n.bytes(t.Data)),i.lengthDelimited!==!1&&n.ldelim()},(t,n)=>{let i={},o=n==null?t.len:t.pos+n;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.Type=Be.codec().decode(t);break;case 2:i.Data=t.bytes();break;default:t.skipType(s&7);break}}return i})),e),r.encode=t=>rr(t,r.codec()),r.decode=t=>er(t,r.codec())})(Vr||(Vr={}));var Ea=class{_key;constructor(e){this._key=ns(e,ts)}verify(e,t){return py(this._key,t,e)}marshal(){return this._key}get bytes(){return zr.encode({Type:Be.Ed25519,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}hash(){let e=ce.digest(this.bytes);return or(e)?e.then(({bytes:t})=>t):e.bytes}},eo=class{_key;_publicKey;constructor(e,t){this._key=ns(e,gn),this._publicKey=ns(t,ts)}sign(e){return uy(this._key,e)}get public(){return new Ea(this._publicKey)}marshal(){return this._key}get bytes(){return Vr.encode({Type:Be.Ed25519,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}async hash(){let e=ce.digest(this.bytes),t;return or(e)?{bytes:t}=await e:t=e.bytes,t}async id(){let e=It.digest(this.public.bytes);return Oe.encode(e.bytes).substring(1)}async export(e,t="libp2p-key"){if(t==="libp2p-key")return rs(this.bytes,e);throw new O(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function rB(r){if(r.length>gn){r=ns(r,gn+ts);let n=r.subarray(0,gn),i=r.subarray(gn,r.length);return new eo(n,i)}r=ns(r,gn);let e=r.subarray(0,gn),t=r.subarray(ts);return new eo(e,t)}function nB(r){return r=ns(r,ts),new Ea(r)}async function iB(){let{privateKey:r,publicKey:e}=cy();return new eo(r,e)}async function hy(r){let{privateKey:e,publicKey:t}=ly(r);return new eo(e,t)}function ns(r,e){if(r=Uint8Array.from(r??[]),r.length!==e)throw new O(`Key must be a Uint8Array of length ${e}, got ${r.length}`,"ERR_INVALID_KEY_TYPE");return r}var ch={};$(ch,{MAX_RSA_KEY_SIZE:()=>Da,RsaPrivateKey:()=>cs,RsaPublicKey:()=>Na,fromJwk:()=>RB,generateKeyPair:()=>UB,unmarshalRsaPrivateKey:()=>sh,unmarshalRsaPublicKey:()=>CB});function to(r){if(isNaN(r)||r<=0)throw new O("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return Jo(r)}var gi={};$(gi,{exportToPem:()=>BB,importFromPem:()=>kB,jwkToPkcs1:()=>vB,jwkToPkix:()=>AB,pkcs1ToJwk:()=>bB,pkixToJwk:()=>EB});var Nl=class extends Yo{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,wl(e);let n=ci(t);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 s=0;s<o.length;s++)o[s]^=54;this.iHash.update(o),this.oHash=e.create();for(let s=0;s<o.length;s++)o[s]^=106;this.oHash.update(o),o.fill(0)}update(e){return Wo(this),this.iHash.update(e),this}digestInto(e){Wo(this),Lf(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:t,iHash:n,finished:i,destroyed:o,blockLen:s,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=o,e.blockLen=s,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Aa=(r,e,t)=>new Nl(r,e).update(t).digest();Aa.create=(r,e)=>new Nl(r,e);function oB(r,e,t,n){wl(r);let i=K1({dkLen:32,asyncTick:10},n),{c:o,dkLen:s,asyncTick:a}=i;if(Go(o),Go(s),Go(a),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let c=ci(e),u=ci(t),l=new Uint8Array(s),p=Aa.create(r,c),m=p._cloneInto().update(u);return{c:o,dkLen:s,asyncTick:a,DK:l,PRF:p,PRFSalt:m}}function sB(r,e,t,n,i){return r.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),t}async function Qf(r,e,t,n){let{c:i,dkLen:o,asyncTick:s,DK:a,PRF:c,PRFSalt:u}=oB(r,e,t,n),l,p=new Uint8Array(4),m=Xo(p),d=new Uint8Array(c.outputLen);for(let f=1,h=0;h<o;f++,h+=c.outputLen){let x=a.subarray(h,h+c.outputLen);m.setInt32(0,f,!1),(l=u._cloneInto(l)).update(p).digestInto(d),x.set(d.subarray(0,x.length)),await q1(i-1,s,()=>{c._cloneInto(l).update(d).digestInto(d);for(let g=0;g<x.length;g++)x[g]^=d[g]})}return sB(c,u,a,l,d)}var pe=Q(my());function ro(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}function fi(r,e,t=-1){let n=t,i=r,o=0,s=Math.pow(2,e);for(let a=1;a<8;a++){if(r<s){let c;if(n<0)c=new ArrayBuffer(a),o=a;else{if(n<a)return new ArrayBuffer(0);c=new ArrayBuffer(n),o=n}let u=new Uint8Array(c);for(let l=a-1;l>=0;l--){let p=Math.pow(2,l*e);u[o-l-1]=Math.floor(i/p),i-=u[o-l-1]*p}return c}s*=Math.pow(2,e)}return new ArrayBuffer(0)}function Pl(...r){let e=0,t=0;for(let o of r)e+=o.length;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let o of r)i.set(o,t),t+=o.length;return i}function th(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)t[a]=0;t[0]=r[0]&128;let n=ro(t,8),i=new ArrayBuffer(this.valueHex.byteLength),o=new Uint8Array(i);for(let a=0;a<this.valueHex.byteLength;a++)o[a]=r[a];return o[0]&=127,ro(o,8)-n}function gy(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let s=t-e,a=fi(s,8,n),c=new Uint8Array(a);return c[0]|=128,a}let i=fi(e,8,n),o=new Uint8Array(i);if(o[0]&128){let s=i.slice(0),a=new Uint8Array(s);i=new ArrayBuffer(i.byteLength+1),o=new Uint8Array(i);for(let c=0;c<s.byteLength;c++)o[c+1]=a[c];o[0]=0}return i}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function xy(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}function _t(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,i=new Array(n);for(let s=0;s<n;s++)i[s]="0";return i.join("").concat(t)}var Yz=Math.log(2);function Ol(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function rh(r){let e=0,t=0;for(let i=0;i<r.length;i++){let o=r[i];e+=o.byteLength}let n=new Uint8Array(e);for(let i=0;i<r.length;i++){let o=r[i];n.set(new Uint8Array(o),t),t+=o.byteLength}return n.buffer}function vn(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}var Ba=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return rh(this.items)}},Sa=[new Uint8Array([1])],yy="0123456789";var ss="",br=new ArrayBuffer(0),nh=new Uint8Array(0),ka="EndOfContent",by="OCTET STRING",vy="BIT STRING";function En(r){var e;return e=class extends r{constructor(...n){var i;super(...n);let o=n[0]||{};this.isHexOnly=(i=o.isHexOnly)!==null&&i!==void 0?i:!1,this.valueHexView=o.valueHex?pe.BufferSourceConverter.toUint8Array(o.valueHex):nh}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}fromBER(n,i,o){let s=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!vn(this,s,i,o))return-1;let a=i+o;return this.valueHexView=s.subarray(i,a),this.valueHexView.length?(this.blockLength=o,a):(this.warnings.push("Zero buffer length"),i)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",br)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:pe.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var yn=class{constructor({blockLength:e=0,error:t=ss,warnings:n=[],valueBeforeDecode:i=nh}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=pe.BufferSourceConverter.toUint8Array(i)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:pe.Convert.ToHex(this.valueBeforeDecodeView)}}};yn.NAME="baseBlock";var ft=class extends yn{fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};ft.NAME="valueBlock";var Fl=class extends En(yn){constructor({idBlock:e={}}={}){var t,n,i,o;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?pe.BufferSourceConverter.toUint8Array(e.valueHex):nh,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(i=e.tagNumber)!==null&&i!==void 0?i:-1,this.isConstructed=(o=e.isConstructed)!==null&&o!==void 0?o:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",br}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let i=new Uint8Array(1);if(!e){let o=this.tagNumber;o&=31,t|=o,i[0]=t}return i.buffer}if(!this.isHexOnly){let i=fi(this.tagNumber,7),o=new Uint8Array(i),s=i.byteLength,a=new Uint8Array(s+1);if(a[0]=t|31,!e){for(let c=0;c<s-1;c++)a[c+1]=o[c]|128;a[s]=o[s-1]}return a.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let i=this.valueHexView;for(let o=0;o<i.length-1;o++)n[o+1]=i[o]|128;n[this.valueHexView.byteLength]=i[i.length-1]}return n.buffer}fromBER(e,t,n){let i=pe.BufferSourceConverter.toUint8Array(e);if(!vn(this,i,t,n))return-1;let o=i.subarray(t,t+n);if(o.length===0)return this.error="Zero buffer length",-1;switch(o[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(o[0]&32)===32,this.isHexOnly=!1;let a=o[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else{let c=1,u=this.valueHexView=new Uint8Array(255),l=255;for(;o[c]&128;){if(u[c-1]=o[c]&127,c++,c>=o.length)return this.error="End of input reached before message was fully decoded",-1;if(c===l){l+=255;let m=new Uint8Array(l);for(let d=0;d<u.length;d++)m[d]=u[d];u=this.valueHexView=new Uint8Array(l)}}this.blockLength=c+1,u[c-1]=o[c]&127;let p=new Uint8Array(c);for(let m=0;m<c;m++)p[m]=u[m];u=this.valueHexView=new Uint8Array(c),u.set(p),this.blockLength<=9?this.tagNumber=ro(u,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};Fl.NAME="identificationBlock";var zl=class extends yn{constructor({lenBlock:e={}}={}){var t,n,i;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(i=e.length)!==null&&i!==void 0?i:0}fromBER(e,t,n){let i=pe.BufferSourceConverter.toUint8Array(e);if(!vn(this,i,t,n))return-1;let o=i.subarray(t,t+n);if(o.length===0)return this.error="Zero buffer length",-1;if(o[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=o[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(o[0]&128),this.longFormUsed===!1)return this.length=o[0],this.blockLength=1,t+this.blockLength;let s=o[0]&127;if(s>8)return this.error="Too big integer",-1;if(s+1>o.length)return this.error="End of input reached before message was fully decoded",-1;let a=t+1,c=i.subarray(a,a+s);return c[s-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=ro(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=s+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let i=fi(this.length,8);if(i.byteLength>127)return this.error="Too big length",br;if(t=new ArrayBuffer(i.byteLength+1),e)return t;let o=new Uint8Array(i);n=new Uint8Array(t),n[0]=i.byteLength|128;for(let s=0;s<i.byteLength;s++)n[s+1]=o[s];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};zl.NAME="lengthBlock";var j={},it=class extends yn{constructor({name:e=ss,optional:t=!1,primitiveSchema:n,...i}={},o){super(i),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new Fl(i),this.lenBlock=new zl(i),this.valueBlock=o?new o(i):new ft(i)}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}toBER(e,t){let n=t||new Ba;t||Ey(this);let i=this.idBlock.toBER(e);if(n.write(i),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let o=this.valueBlock.toBER(e);this.lenBlock.length=o.byteLength;let s=this.lenBlock.toBER(e);n.write(s),n.write(o)}return t?br:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():pe.Convert.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${pe.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return xy(t,n)}};it.NAME="BaseBlock";function Ey(r){if(r instanceof j.Constructed)for(let e of r.valueBlock.value)Ey(e)&&(r.lenBlock.isIndefiniteForm=!0);return!!r.lenBlock.isIndefiniteForm}var Vl=class extends it{constructor({value:e=ss,...t}={},n){super(t,n),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};Vl.NAME="BaseStringBlock";var Ml=class extends En(ft){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};Ml.NAME="PrimitiveValueBlock";var Ay,$l=class extends it{constructor(e={}){super(e,Ml),this.idBlock.isConstructed=!1}};Ay=$l;j.Primitive=Ay;$l.NAME="PRIMITIVE";function mB(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function vu(r,e=0,t=r.length){let n=e,i=new it({},ft),o=new yn;if(!vn(o,r,e,t))return i.error=o.error,{offset:-1,result:i};if(!r.subarray(e,e+t).length)return i.error="Zero buffer length",{offset:-1,result:i};let a=i.idBlock.fromBER(r,e,t);if(i.idBlock.warnings.length&&i.warnings.concat(i.idBlock.warnings),a===-1)return i.error=i.idBlock.error,{offset:-1,result:i};if(e=a,t-=i.idBlock.blockLength,a=i.lenBlock.fromBER(r,e,t),i.lenBlock.warnings.length&&i.warnings.concat(i.lenBlock.warnings),a===-1)return i.error=i.lenBlock.error,{offset:-1,result:i};if(e=a,t-=i.lenBlock.blockLength,!i.idBlock.isConstructed&&i.lenBlock.isIndefiniteForm)return i.error="Indefinite length form used for primitive encoding form",{offset:-1,result:i};let c=it;switch(i.idBlock.tagClass){case 1:if(i.idBlock.tagNumber>=37&&i.idBlock.isHexOnly===!1)return i.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:i};switch(i.idBlock.tagNumber){case 0:if(i.idBlock.isConstructed&&i.lenBlock.length>0)return i.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:i};c=j.EndOfContent;break;case 1:c=j.Boolean;break;case 2:c=j.Integer;break;case 3:c=j.BitString;break;case 4:c=j.OctetString;break;case 5:c=j.Null;break;case 6:c=j.ObjectIdentifier;break;case 10:c=j.Enumerated;break;case 12:c=j.Utf8String;break;case 13:c=j.RelativeObjectIdentifier;break;case 14:c=j.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:c=j.Sequence;break;case 17:c=j.Set;break;case 18:c=j.NumericString;break;case 19:c=j.PrintableString;break;case 20:c=j.TeletexString;break;case 21:c=j.VideotexString;break;case 22:c=j.IA5String;break;case 23:c=j.UTCTime;break;case 24:c=j.GeneralizedTime;break;case 25:c=j.GraphicString;break;case 26:c=j.VisibleString;break;case 27:c=j.GeneralString;break;case 28:c=j.UniversalString;break;case 29:c=j.CharacterString;break;case 30:c=j.BmpString;break;case 31:c=j.DATE;break;case 32:c=j.TimeOfDay;break;case 33:c=j.DateTime;break;case 34:c=j.Duration;break;default:{let u=i.idBlock.isConstructed?new j.Constructed:new j.Primitive;u.idBlock=i.idBlock,u.lenBlock=i.lenBlock,u.warnings=i.warnings,i=u}}break;case 2:case 3:case 4:default:c=i.idBlock.isConstructed?j.Constructed:j.Primitive}return i=mB(i,c),a=i.fromBER(r,e,i.lenBlock.isIndefiniteForm?t:i.lenBlock.length),i.valueBeforeDecodeView=r.subarray(n,n+i.blockLength),{offset:a,result:i}}function as(r){if(!r.byteLength){let e=new it({},ft);return e.error="Input buffer has zero length",{offset:-1,result:e}}return vu(pe.BufferSourceConverter.toUint8Array(r).slice(),0,r.byteLength)}function gB(r,e){return r?1:e}var Mr=class extends ft{constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let i=pe.BufferSourceConverter.toUint8Array(e);if(!vn(this,i,t,n))return-1;if(this.valueBeforeDecodeView=i.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let o=t;for(;gB(this.isIndefiniteForm,n)>0;){let s=vu(i,o,n);if(s.offset===-1)return this.error=s.result.error,this.warnings.concat(s.result.warnings),-1;if(o=s.offset,this.blockLength+=s.result.blockLength,n-=s.result.blockLength,this.value.push(s.result),this.isIndefiniteForm&&s.result.constructor.NAME===ka)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===ka?this.value.pop():this.warnings.push("No EndOfContent block encoded")),o}toBER(e,t){let n=t||new Ba;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,n);return t?br:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Mr.NAME="ConstructedValueBlock";var Sy,hi=class extends it{constructor(e={}){super(e,Mr),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
13
13
  `).map(i=>` ${i}`).join(`
14
14
  `));let t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
15
15
  ${e.join(`
16
- `)}`:`${t} :`}};Ey=di;j.Constructed=Ey;di.NAME="CONSTRUCTED";var Ml=class extends ft{fromBER(e,t,n){return t}toBER(e){return br}};Ml.override="EndOfContentValueBlock";var Ay,$l=class extends it{constructor(e={}){super(e,Ml),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};Ay=$l;j.EndOfContent=Ay;$l.NAME=Sa;var Sy,fi=class extends it{constructor(e={}){super(e,ft),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,n){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=n,t+n>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+n}toBER(e,t){let n=new ArrayBuffer(2);if(!e){let i=new Uint8Array(n);i[0]=5,i[1]=0}return t&&t.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}};Sy=fi;j.Null=Sy;fi.NAME="NULL";var jl=class extends vn(ft){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=pe.BufferSourceConverter.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}get value(){for(let e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,n){let i=pe.BufferSourceConverter.toUint8Array(e);return bn(this,i,t,n)?(this.valueHexView=i.subarray(t,t+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,Qf.call(this),this.blockLength=n,t+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};jl.NAME="BooleanValueBlock";var By,Hl=class extends it{constructor(e={}){super(e,jl),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};By=Hl;j.Boolean=By;Hl.NAME="BOOLEAN";var ql=class extends vn(Vr){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,n){let i=0;if(this.isConstructed){if(this.isHexOnly=!1,i=Vr.prototype.fromBER.call(this,e,t,n),i===-1)return i;for(let o=0;o<this.value.length;o++){let s=this.value[o].constructor.NAME;if(s===Sa){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(s!==yy)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,i=super.fromBER(e,t,n),this.blockLength=n;return i}toBER(e,t){return this.isConstructed?Vr.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};ql.NAME="OctetStringValueBlock";var ky,yn=class r extends it{constructor({idBlock:e={},lenBlock:t={},...n}={}){var i,o;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((o=n.value)===null||o===void 0)&&o.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},ql),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){let o=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+n);try{if(o.byteLength){let s=wu(o,0,o.byteLength);s.offset!==-1&&s.offset===n&&(this.valueBlock.value=[s.result])}}catch{}}return super.fromBER(e,t,n)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?di.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${pe.Convert.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let t of this.valueBlock.value)t instanceof r&&e.push(t.valueBlock.valueHexView);return pe.BufferSourceConverter.concat(e)}};ky=yn;j.OctetString=ky;yn.NAME=yy;var Kl=class extends vn(Vr){constructor({unusedBits:e=0,isConstructed:t=!1,...n}={}){super(n),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,n){if(!n)return t;let i=-1;if(this.isConstructed){if(i=Vr.prototype.fromBER.call(this,e,t,n),i===-1)return i;for(let a of this.value){let c=a.constructor.NAME;if(c===Sa){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==wy)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let u=a.valueBlock;if(this.unusedBits>0&&u.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=u.unusedBits}return i}let o=pe.BufferSourceConverter.toUint8Array(e);if(!bn(this,o,t,n))return-1;let s=o.subarray(t,t+n);if(this.unusedBits=s[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let a=s.subarray(1);try{if(a.byteLength){let c=wu(a,0,a.byteLength);c.offset!==-1&&c.offset===n-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=s.subarray(1),this.blockLength=s.length,t+n}toBER(e,t){if(this.isConstructed)return Vr.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return br;let n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};Kl.NAME="BitStringValueBlock";var Iy,ns=class extends it{constructor({idBlock:e={},lenBlock:t={},...n}={}){var i,o;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((o=n.value)===null||o===void 0)&&o.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},Kl),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return di.prototype.onAsciiEncoding.call(this);{let e=[],t=this.valueBlock.valueHexView;for(let i of t)e.push(i.toString(2).padStart(8,"0"));let n=e.join("");return`${this.constructor.NAME} : ${n.substring(0,n.length-this.valueBlock.unusedBits)}`}}};Iy=ns;j.BitString=Iy;ns.NAME=wy;var _y;function mB(r,e){let t=new Uint8Array([0]),n=new Uint8Array(r),i=new Uint8Array(e),o=n.slice(0),s=o.length-1,a=i.slice(0),c=a.length-1,u=0,l=c<s?s:c,p=0;for(let m=l;m>=0;m--,p++){switch(!0){case p<a.length:u=o[s-p]+a[c-p]+t[0];break;default:u=o[s-p]+t[0]}switch(t[0]=u/10,!0){case p>=o.length:o=Dl(new Uint8Array([u%10]),o);break;default:o[s-p]=u%10}}return t[0]>0&&(o=Dl(t,o)),o}function xy(r){if(r>=Ea.length)for(let e=Ea.length;e<=r;e++){let t=new Uint8Array([0]),n=Ea[e-1].slice(0);for(let i=n.length-1;i>=0;i--){let o=new Uint8Array([(n[i]<<1)+t[0]]);t[0]=o[0]/10,n[i]=o[0]%10}t[0]>0&&(n=Dl(t,n)),Ea.push(n)}return Ea[r]}function gB(r,e){let t=0,n=new Uint8Array(r),i=new Uint8Array(e),o=n.slice(0),s=o.length-1,a=i.slice(0),c=a.length-1,u,l=0;for(let p=c;p>=0;p--,l++)switch(u=o[s-l]-a[c-l]-t,!0){case u<0:t=1,o[s-l]=u+10;break;default:t=0,o[s-l]=u}if(t>0)for(let p=s-c+1;p>=0;p--,l++)if(u=o[s-l]-t,u<0)t=1,o[s-l]=u+10;else{t=0,o[s-l]=u;break}return o.slice()}var Ba=class extends vn(ft){constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=Qf.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(hy(e))}get valueDec(){return this._valueDec}fromDER(e,t,n,i=0){let o=this.fromBER(e,t,n);if(o===-1)return o;let s=this.valueHexView;return s[0]===0&&s[1]&128?this.valueHexView=s.subarray(1):i!==0&&s.length<i&&(i-s.length>1&&(i=s.length+1),this.valueHexView=s.subarray(i-s.length)),o}toDER(e=!1){let t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{let n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(t,1),this.valueHexView=n}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,n){let i=super.fromBER(e,t,n);return i===-1||this.setValueHex(),i}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){let e=this.valueHexView.length*8-1,t=new Uint8Array(this.valueHexView.length*8/3),n=0,i,o=this.valueHexView,s="",a=!1;for(let c=o.byteLength-1;c>=0;c--){i=o[c];for(let u=0;u<8;u++){if((i&1)===1)switch(n){case e:t=gB(xy(n),t),s="-";break;default:t=mB(t,xy(n))}n++,i>>=1}}for(let c=0;c<t.length;c++)t[c]&&(a=!0),a&&(s+=gy.charAt(t[c]));return a===!1&&(s+=gy.charAt(0)),s}};_y=Ba;Ba.NAME="IntegerValueBlock";Object.defineProperty(_y.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Ty,qe=class r extends it{constructor(e={}){super(e,Ba),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ll(),BigInt(this.valueBlock.toString())}static fromBigInt(e){Ll();let t=BigInt(e),n=new Aa,i=t.toString(16).replace(/^-/,""),o=new Uint8Array(pe.Convert.FromHex(i));if(t<0){let a=new Uint8Array(o.length+(o[0]&128?1:0));a[0]|=128;let u=BigInt(`0x${pe.Convert.ToHex(a)}`)+t,l=pe.BufferSourceConverter.toUint8Array(pe.Convert.FromHex(u.toString(16)));l[0]|=128,n.write(l)}else o[0]&128&&n.write(new Uint8Array([0])),n.write(o);return new r({valueHex:n.final()})}convertToDER(){let e=new r({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new r({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};Ty=qe;j.Integer=Ty;qe.NAME="INTEGER";var Cy,Gl=class extends qe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};Cy=Gl;j.Enumerated=Cy;Gl.NAME="ENUMERATED";var ka=class extends vn(ft){constructor({valueDec:e=-1,isFirstSid:t=!1,...n}={}){super(n),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,n){if(!n)return t;let i=pe.BufferSourceConverter.toUint8Array(e);if(!bn(this,i,t,n))return-1;let o=i.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let a=0;a<n&&(this.valueHexView[a]=o[a]&127,this.blockLength++,!!(o[a]&128));a++);let s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)s[a]=this.valueHexView[a];return this.valueHexView=s,o[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=eo(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){Ll();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;let n=new Uint8Array(t.length/7);for(let i=0;i<n.length;i++)n[i]=parseInt(t.slice(i*7,i*7+7),2)+(i+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let i=this.valueHexView,o=new Uint8Array(this.blockLength);for(let s=0;s<this.blockLength-1;s++)o[s]=i[s]|128;return o[this.blockLength-1]=i[this.blockLength-1],o.buffer}let t=pi(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",br;let n=new Uint8Array(t.byteLength);if(!e){let i=new Uint8Array(t),o=t.byteLength-1;for(let s=0;s<o;s++)n[s]=i[s]|128;n[o]=i[o]}return n}toString(){let e="";if(this.isHexOnly)e=pe.Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};ka.NAME="sidBlock";var Wl=class extends ft{constructor({value:e=is,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let i=t;for(;n>0;){let o=new ka;if(i=o.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=o.error,i;this.value.length===0&&(o.isFirstSid=!0),this.blockLength+=o.blockLength,n-=o.blockLength,this.value.push(o)}return i}toBER(e){let t=[];for(let n=0;n<this.value.length;n++){let i=this.value[n].toBER(e);if(i.byteLength===0)return this.error=this.value[n].error,br;t.push(i)}return eh(t)}fromString(e){this.value=[];let t=0,n=0,i="",o=!1;do if(n=e.indexOf(".",t),n===-1?i=e.substring(t):i=e.substring(t,n),t=n+1,o){let s=this.value[0],a=0;switch(s.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}let c=parseInt(i,10);if(isNaN(c))return;s.valueDec=c+a,o=!1}else{let s=new ka;if(i>Number.MAX_SAFE_INTEGER){Ll();let a=BigInt(i);s.valueBigInt=a}else if(s.valueDec=parseInt(i,10),isNaN(s.valueDec))return;this.value.length||(s.isFirstSid=!0,o=!0),this.value.push(s)}while(n!==-1)}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),t?(i=`{${i}}`,this.value[n].isFirstSid?e=`2.{${i} - 80}`:e+=i):e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};Wl.NAME="ObjectIdentifierValueBlock";var Ry,wr=class extends it{constructor(e={}){super(e,Wl),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};Ry=wr;j.ObjectIdentifier=Ry;wr.NAME="OBJECT IDENTIFIER";var Ia=class extends vn(xn){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,n){if(n===0)return t;let i=pe.BufferSourceConverter.toUint8Array(e);if(!bn(this,i,t,n))return-1;let o=i.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let a=0;a<n&&(this.valueHexView[a]=o[a]&127,this.blockLength++,!!(o[a]&128));a++);let s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)s[a]=this.valueHexView[a];return this.valueHexView=s,o[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=eo(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let i=this.valueHexView,o=new Uint8Array(this.blockLength);for(let s=0;s<this.blockLength-1;s++)o[s]=i[s]|128;return o[this.blockLength-1]=i[this.blockLength-1],o.buffer}let t=pi(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",br;let n=new Uint8Array(t.byteLength);if(!e){let i=new Uint8Array(t),o=t.byteLength-1;for(let s=0;s<o;s++)n[s]=i[s]|128;n[o]=i[o]}return n.buffer}toString(){let e="";return this.isHexOnly?e=pe.Convert.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};Ia.NAME="relativeSidBlock";var Yl=class extends ft{constructor({value:e=is,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let i=t;for(;n>0;){let o=new Ia;if(i=o.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=o.error,i;this.blockLength+=o.blockLength,n-=o.blockLength,this.value.push(o)}return i}toBER(e,t){let n=[];for(let i=0;i<this.value.length;i++){let o=this.value[i].toBER(e);if(o.byteLength===0)return this.error=this.value[i].error,br;n.push(o)}return eh(n)}fromString(e){this.value=[];let t=0,n=0,i="";do{n=e.indexOf(".",t),n===-1?i=e.substring(t):i=e.substring(t,n),t=n+1;let o=new Ia;if(o.valueDec=parseInt(i,10),isNaN(o.valueDec))return!0;this.value.push(o)}while(n!==-1);return!0}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),t&&(i=`{${i}}`),e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};Yl.NAME="RelativeObjectIdentifierValueBlock";var Uy,Xl=class extends it{constructor(e={}){super(e,Yl),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};Uy=Xl;j.RelativeObjectIdentifier=Uy;Xl.NAME="RelativeObjectIdentifier";var Ny,Je=class extends di{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};Ny=Je;j.Sequence=Ny;Je.NAME="SEQUENCE";var Dy,Jl=class extends di{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Dy=Jl;j.Set=Dy;Jl.NAME="SET";var Zl=class extends vn(ft){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=is}toJSON(){return{...super.toJSON(),value:this.value}}};Zl.NAME="StringValueBlock";var Ql=class extends Zl{};Ql.NAME="SimpleStringValueBlock";var yt=class extends Fl{constructor({...e}={}){super(e,Ql)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,pe.BufferSourceConverter.toUint8Array(e))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);this.valueBlock.value=e}};yt.NAME="SIMPLE STRING";var eu=class extends yt{fromBuffer(e){this.valueBlock.valueHexView=pe.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=pe.Convert.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=pe.Convert.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(pe.Convert.FromUtf8String(e)),this.valueBlock.value=e}};eu.NAME="Utf8StringValueBlock";var Ly,wn=class extends eu{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};Ly=wn;j.Utf8String=Ly;wn.NAME="UTF8String";var tu=class extends yt{fromBuffer(e){this.valueBlock.value=pe.Convert.ToUtf16String(e),this.valueBlock.valueHexView=pe.BufferSourceConverter.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(pe.Convert.FromUtf16String(e))}};tu.NAME="BmpStringValueBlock";var Py,ru=class extends tu{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};Py=ru;j.BmpString=Py;ru.NAME="BMPString";var nu=class extends yt{fromBuffer(e){let t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),n=new Uint8Array(t);for(let i=0;i<n.length;i+=4)n[i]=n[i+3],n[i+1]=n[i+2],n[i+2]=0,n[i+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let i=0;i<t;i++){let o=pi(e.charCodeAt(i),8),s=new Uint8Array(o);if(s.length>4)continue;let a=4-s.length;for(let c=s.length-1;c>=0;c--)n[i*4+c+a]=s[c]}this.valueBlock.value=e}};nu.NAME="UniversalStringValueBlock";var Oy,iu=class extends nu{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};Oy=iu;j.UniversalString=Oy;iu.NAME="UniversalString";var Fy,ou=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};Fy=ou;j.NumericString=Fy;ou.NAME="NumericString";var zy,su=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};zy=su;j.PrintableString=zy;su.NAME="PrintableString";var Vy,au=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};Vy=au;j.TeletexString=Vy;au.NAME="TeletexString";var My,cu=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};My=cu;j.VideotexString=My;cu.NAME="VideotexString";var $y,lu=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};$y=lu;j.IA5String=$y;lu.NAME="IA5String";var jy,uu=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};jy=uu;j.GraphicString=jy;uu.NAME="GraphicString";var Hy,_a=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};Hy=_a;j.VisibleString=Hy;_a.NAME="VisibleString";var qy,pu=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};qy=pu;j.GeneralString=qy;pu.NAME="GeneralString";var Ky,du=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};Ky=du;j.CharacterString=Ky;du.NAME="CharacterString";var Gy,Ta=class extends _a{constructor({value:e,valueDate:t,...n}={}){if(super(n),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let i=0;i<e.length;i++)this.valueBlock.valueHexView[i]=e.charCodeAt(i)}t&&(this.fromDate(t),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,pe.BufferSourceConverter.toUint8Array(e)))}toBuffer(){let e=this.toString(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){let n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(n===null){this.error="Wrong input string for conversion";return}let i=parseInt(n[1],10);i>=50?this.year=1900+i:this.year=2e3+i,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(e="iso"){if(e==="iso"){let t=new Array(7);return t[0]=_t(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=_t(this.month,2),t[2]=_t(this.day,2),t[3]=_t(this.hour,2),t[4]=_t(this.minute,2),t[5]=_t(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}};Gy=Ta;j.UTCTime=Gy;Ta.NAME="UTCTime";var Wy,fu=class extends Ta{constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t=!1,n="",i="",o=0,s,a=0,c=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),t=!0;else{let p=new Number(e[e.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(t){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,m=n.indexOf("+"),d="";if(m===-1&&(m=n.indexOf("-"),p=-1),m!==-1){if(d=n.substring(m+1),n=n.substring(0,m),d.length!==2&&d.length!==4)throw new Error("Wrong input string for conversion");let f=parseInt(d.substring(0,2),10);if(isNaN(f.valueOf()))throw new Error("Wrong input string for conversion");if(a=p*f,d.length===4){if(f=parseInt(d.substring(2,4),10),isNaN(f.valueOf()))throw new Error("Wrong input string for conversion");c=p*f}}}let u=n.indexOf(".");if(u===-1&&(u=n.indexOf(",")),u!==-1){let p=new Number(`0${n.substring(u)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");o=p.valueOf(),i=n.substring(0,u)}else i=n;switch(!0){case i.length===8:if(s=/(\d{4})(\d{2})(\d{2})/ig,u!==-1)throw new Error("Wrong input string for conversion");break;case i.length===10:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let p=60*o;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case i.length===12:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let p=60*o;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case i.length===14:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let p=1e3*o;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}let l=s.exec(i);if(l===null)throw new Error("Wrong input string for conversion");for(let p=1;p<l.length;p++)switch(p){case 1:this.year=parseInt(l[p],10);break;case 2:this.month=parseInt(l[p],10);break;case 3:this.day=parseInt(l[p],10);break;case 4:this.hour=parseInt(l[p],10)+a;break;case 5:this.minute=parseInt(l[p],10)+c;break;case 6:this.second=parseInt(l[p],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){let p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let t=[];return t.push(_t(this.year,4)),t.push(_t(this.month,2)),t.push(_t(this.day,2)),t.push(_t(this.hour,2)),t.push(_t(this.minute,2)),t.push(_t(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(_t(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};Wy=fu;j.GeneralizedTime=Wy;fu.NAME="GeneralizedTime";var Yy,hu=class extends wn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};Yy=hu;j.DATE=Yy;hu.NAME="DATE";var Xy,mu=class extends wn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};Xy=mu;j.TimeOfDay=Xy;mu.NAME="TimeOfDay";var Jy,gu=class extends wn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};Jy=gu;j.DateTime=Jy;gu.NAME="DateTime";var Zy,xu=class extends wn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};Zy=xu;j.Duration=Zy;xu.NAME="Duration";var Qy,yu=class extends wn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};Qy=yu;j.TIME=Qy;yu.NAME="TIME";function yB(r){let{result:e}=os(r),t=e.valueBlock.value;return{n:ie(Mr(t[1].toBigInt()),"base64url"),e:ie(Mr(t[2].toBigInt()),"base64url"),d:ie(Mr(t[3].toBigInt()),"base64url"),p:ie(Mr(t[4].toBigInt()),"base64url"),q:ie(Mr(t[5].toBigInt()),"base64url"),dp:ie(Mr(t[6].toBigInt()),"base64url"),dq:ie(Mr(t[7].toBigInt()),"base64url"),qi:ie(Mr(t[8].toBigInt()),"base64url"),kty:"RSA",alg:"RS256"}}function wB(r){if(r.n==null||r.e==null||r.d==null||r.p==null||r.q==null||r.dp==null||r.dq==null||r.qi==null)throw new O("JWK was missing components","ERR_INVALID_PARAMETERS");let t=new Je({value:[new qe({value:0}),qe.fromBigInt($r(Z(r.n,"base64url"))),qe.fromBigInt($r(Z(r.e,"base64url"))),qe.fromBigInt($r(Z(r.d,"base64url"))),qe.fromBigInt($r(Z(r.p,"base64url"))),qe.fromBigInt($r(Z(r.q,"base64url"))),qe.fromBigInt($r(Z(r.dp,"base64url"))),qe.fromBigInt($r(Z(r.dq,"base64url"))),qe.fromBigInt($r(Z(r.qi,"base64url")))]}).toBER();return new Uint8Array(t,0,t.byteLength)}function bB(r){let{result:e}=os(r),t=e.valueBlock.value[1].valueBlock.value[0].valueBlock.value;return{kty:"RSA",n:ie(Mr(t[0].toBigInt()),"base64url"),e:ie(Mr(t[1].toBigInt()),"base64url")}}function vB(r){if(r.n==null||r.e==null)throw new O("JWK was missing components","ERR_INVALID_PARAMETERS");let t=new Je({value:[new Je({value:[new wr({value:"1.2.840.113549.1.1.1"}),new fi]}),new ns({valueHex:new Je({value:[qe.fromBigInt($r(Z(r.n,"base64url"))),qe.fromBigInt($r(Z(r.e,"base64url")))]}).toBER()})]}).toBER();return new Uint8Array(t,0,t.byteLength)}function Mr(r){let e=r.toString(16);e.length%2>0&&(e=`0${e}`);let t=e.length/2,n=new Uint8Array(t),i=0,o=0;for(;i<t;)n[i]=parseInt(e.slice(o,o+2),16),i+=1,o+=2;return n}function $r(r){let e=[];return r.forEach(function(t){let n=t.toString(16);n.length%2>0&&(n=`0${n}`),e.push(n)}),BigInt("0x"+e.join(""))}var EB=16,rh=32,nh=1e4;async function AB(r,e){let t=xt.get(),i=new Je({value:[new qe({value:0}),new Je({value:[new wr({value:"1.2.840.113549.1.1.1"}),new fi]}),new yn({valueHex:r.marshal()})]}).toBER(),o=new Uint8Array(i,0,i.byteLength),s=Qi(EB),a=await Jf(Jo,e,s,{c:nh,dkLen:rh}),c=Qi(16),u=await t.subtle.importKey("raw",a,"AES-CBC",!1,["encrypt"]),l=await t.subtle.encrypt({name:"AES-CBC",iv:c},u,o),p=new Je({value:[new yn({valueHex:s}),new qe({value:nh}),new qe({value:rh}),new Je({value:[new wr({value:"1.2.840.113549.2.11"}),new fi]})]}),m=new Je({value:[new wr({value:"1.2.840.113549.1.5.13"}),new Je({value:[new Je({value:[new wr({value:"1.2.840.113549.1.5.12"}),p]}),new Je({value:[new wr({value:"2.16.840.1.101.3.4.1.42"}),new yn({valueHex:c})]})]})]}),f=new Je({value:[m,new yn({valueHex:l})]}).toBER(),h=new Uint8Array(f,0,f.byteLength);return["-----BEGIN ENCRYPTED PRIVATE KEY-----",...ie(h,"base64pad").split(/(.{64})/).filter(Boolean),"-----END ENCRYPTED PRIVATE KEY-----"].join(`
17
- `)}async function SB(r,e){let t=xt.get(),n;if(r.includes("-----BEGIN ENCRYPTED PRIVATE KEY-----")){let i=Z(r.replace("-----BEGIN ENCRYPTED PRIVATE KEY-----","").replace("-----END ENCRYPTED PRIVATE KEY-----","").replace(/\n/g,"").trim(),"base64pad"),{result:o}=os(i),{iv:s,salt:a,iterations:c,keySize:u,cipherText:l}=BB(o),p=await Jf(Jo,e,a,{c,dkLen:u}),m=await t.subtle.importKey("raw",p,"AES-CBC",!1,["decrypt"]),d=Ca(await t.subtle.decrypt({name:"AES-CBC",iv:s},m,l)),{result:f}=os(d);n=ew(f)}else if(r.includes("-----BEGIN PRIVATE KEY-----")){let i=Z(r.replace("-----BEGIN PRIVATE KEY-----","").replace("-----END PRIVATE KEY-----","").replace(/\n/g,"").trim(),"base64pad"),{result:o}=os(i);n=ew(o)}else throw new O("Could not parse private key from PEM data","ERR_INVALID_PARAMETERS");return ih(n)}function BB(r){let e=r.valueBlock.value[0];if(e.valueBlock.value[0].toString()!=="OBJECT IDENTIFIER : 1.2.840.113549.1.5.13")throw new O("Only pkcs5PBES2 encrypted private keys are supported","ERR_INVALID_PARAMS");let n=e.valueBlock.value[1].valueBlock.value[0];if(n.valueBlock.value[0].toString()!=="OBJECT IDENTIFIER : 1.2.840.113549.1.5.12")throw new O("Only pkcs5PBKDF2 key derivation functions are supported","ERR_INVALID_PARAMS");let o=n.valueBlock.value[1],s=Ca(o.valueBlock.value[0].getValue()),a=nh,c=rh;if(o.valueBlock.value.length===3)a=Number(o.valueBlock.value[1].toBigInt()),c=Number(o.valueBlock.value[2].toBigInt());else if(o.valueBlock.value.length===2)throw new O("Could not derive key size and iterations from PEM file - please use @libp2p/rsa to re-import your key","ERR_INVALID_PARAMS");let u=e.valueBlock.value[1].valueBlock.value[1],l=u.valueBlock.value[0].toString();if(l!=="OBJECT IDENTIFIER : 1.2.840.113549.3.7"){if(l!=="OBJECT IDENTIFIER : 1.3.14.3.2.7"){if(l!=="OBJECT IDENTIFIER : 2.16.840.1.101.3.4.1.2"){if(l!=="OBJECT IDENTIFIER : 2.16.840.1.101.3.4.1.22"){if(l!=="OBJECT IDENTIFIER : 2.16.840.1.101.3.4.1.42")throw new O("Only AES-CBC encryption schemes are supported","ERR_INVALID_PARAMS")}}}}let p=Ca(u.valueBlock.value[1].getValue());return{cipherText:Ca(r.valueBlock.value[1].getValue()),salt:s,iterations:a,keySize:c,iv:p}}function ew(r){return Ca(r.valueBlock.value[2].getValue())}function Ca(r){return new Uint8Array(r,0,r.byteLength)}async function tw(r){let e=await xt.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),t=await iw(e);return{privateKey:t[0],publicKey:t[1]}}async function oh(r){let t=[await xt.get().subtle.importKey("jwk",r,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await kB(r)],n=await iw({privateKey:t[0],publicKey:t[1]});return{privateKey:n[0],publicKey:n[1]}}async function rw(r,e){let t=await xt.get().subtle.importKey("jwk",r,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await xt.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},t,e instanceof Uint8Array?e:e.subarray());return new Uint8Array(n,0,n.byteLength)}async function nw(r,e,t){let n=await xt.get().subtle.importKey("jwk",r,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return xt.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,t instanceof Uint8Array?t:t.subarray())}async function iw(r){if(r.privateKey==null||r.publicKey==null)throw new O("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([xt.get().subtle.exportKey("jwk",r.privateKey),xt.get().subtle.exportKey("jwk",r.publicKey)])}async function kB(r){return xt.get().subtle.importKey("jwk",{kty:r.kty,n:r.n,e:r.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function bu(r){if(r.kty!=="RSA")throw new O("invalid key type","ERR_INVALID_KEY_TYPE");if(r.n==null)throw new O("invalid key modulus","ERR_INVALID_KEY_MODULUS");return Z(r.n,"base64url").length*8}var Ua=8192,Ra=class{_key;constructor(e){this._key=e}verify(e,t){return nw(this._key,t,e)}marshal(){return hi.jwkToPkix(this._key)}get bytes(){return Fr.encode({Type:Be.RSA,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}hash(){let e=ae.digest(this.bytes);return or(e)?e.then(({bytes:t})=>t):e.bytes}},ss=class{_key;_publicKey;constructor(e,t){this._key=e,this._publicKey=t}genSecret(){return Qi(16)}sign(e){return rw(this._key,e)}get public(){if(this._publicKey==null)throw new O("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Ra(this._publicKey)}marshal(){return hi.jwkToPkcs1(this._key)}get bytes(){return zr.encode({Type:Be.RSA,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}hash(){let e=ae.digest(this.bytes);return or(e)?e.then(({bytes:t})=>t):e.bytes}async id(){let e=await this.public.hash();return ie(e,"base58btc")}async export(e,t="pkcs-8"){if(t==="pkcs-8")return hi.exportToPem(this,e);if(t==="libp2p-key")return es(this.bytes,e);throw new O(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};async function ih(r){let e=hi.pkcs1ToJwk(r);if(bu(e)>Ua)throw new O("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let t=await oh(e);return new ss(t.privateKey,t.publicKey)}function _B(r){let e=hi.pkixToJwk(r);if(bu(e)>Ua)throw new O("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Ra(e)}async function TB(r){if(bu(r)>Ua)throw new O("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await oh(r);return new ss(e.privateKey,e.publicKey)}async function CB(r){if(r>Ua)throw new O("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await tw(r);return new ss(e.privateKey,e.publicKey)}var ph={};$(ph,{Secp256k1PrivateKey:()=>Da,Secp256k1PublicKey:()=>Na,generateKeyPair:()=>qB,unmarshalSecp256k1PrivateKey:()=>jB,unmarshalSecp256k1PublicKey:()=>HB});var RB=(r,e,t)=>r&e^~r&t,UB=(r,e,t)=>r&e^r&t^e&t,NB=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]),mi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),gi=new Uint32Array(64),ah=class extends Xo{constructor(){super(64,32,8,!1),this.A=mi[0]|0,this.B=mi[1]|0,this.C=mi[2]|0,this.D=mi[3]|0,this.E=mi[4]|0,this.F=mi[5]|0,this.G=mi[6]|0,this.H=mi[7]|0}get(){let{A:e,B:t,C:n,D:i,E:o,F:s,G:a,H:c}=this;return[e,t,n,i,o,s,a,c]}set(e,t,n,i,o,s,a,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=c|0}process(e,t){for(let p=0;p<16;p++,t+=4)gi[p]=e.getUint32(t,!1);for(let p=16;p<64;p++){let m=gi[p-15],d=gi[p-2],f=gr(m,7)^gr(m,18)^m>>>3,h=gr(d,17)^gr(d,19)^d>>>10;gi[p]=h+gi[p-7]+f+gi[p-16]|0}let{A:n,B:i,C:o,D:s,E:a,F:c,G:u,H:l}=this;for(let p=0;p<64;p++){let m=gr(a,6)^gr(a,11)^gr(a,25),d=l+m+RB(a,c,u)+NB[p]+gi[p]|0,h=(gr(n,2)^gr(n,13)^gr(n,22))+UB(n,i,o)|0;l=u,u=c,c=a,a=s+d|0,s=o,o=i,i=n,n=d+h|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,i,o,s,a,c,u,l)}roundClean(){gi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var ow=bl(()=>new ah);function DB(r){let e=wa(r);Or(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:i}=e;if(t){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:LB,hexToBytes:PB}=Al,to={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=to;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)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:LB(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=to,t=typeof r=="string"?PB(r):r;if(!xr(t))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:o}=to._parseInt(t.subarray(2)),{d:s,l:a}=to._parseInt(o);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(r){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,t=u=>{let l=u.toString(16);return l.length&1?`0${l}`:l},n=e(t(r.s)),i=e(t(r.r)),o=n.length/2,s=i.length/2,a=t(o),c=t(s);return`30${t(s+o+4)}02${c}${i}02${a}${n}`}},En=BigInt(0),ar=BigInt(1),yV=BigInt(2),sw=BigInt(3),wV=BigInt(4);function OB(r){let e=DB(r),{Fp:t}=e,n=e.toBytes||((f,h,x)=>{let g=h.toAffine();return fn(Uint8Array.from([4]),t.toBytes(g.x),t.toBytes(g.y))}),i=e.fromBytes||(f=>{let h=f.subarray(1),x=t.fromBytes(h.subarray(0,t.BYTES)),g=t.fromBytes(h.subarray(t.BYTES,2*t.BYTES));return{x,y:g}});function o(f){let{a:h,b:x}=e,g=t.sqr(f),y=t.mul(g,f);return t.add(t.add(y,t.mul(f,h)),x)}if(!t.eql(t.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function s(f){return typeof f=="bigint"&&En<f&&f<e.n}function a(f){if(!s(f))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(f){let{allowedPrivateKeyLengths:h,nByteLength:x,wrapPrivateKey:g,n:y}=e;if(h&&typeof f!="bigint"){if(xr(f)&&(f=pn(f)),typeof f!="string"||!h.includes(f.length))throw new Error("Invalid key");f=f.padStart(x*2,"0")}let w;try{w=typeof f=="bigint"?f:dn(Re("private key",f,x))}catch{throw new Error(`private key must be ${x} bytes, hex or bigint, not ${typeof f}`)}return g&&(w=be(w,y)),a(w),w}let u=new Map;function l(f){if(!(f instanceof p))throw new Error("ProjectivePoint expected")}class p{constructor(h,x,g){if(this.px=h,this.py=x,this.pz=g,h==null||!t.isValid(h))throw new Error("x required");if(x==null||!t.isValid(x))throw new Error("y required");if(g==null||!t.isValid(g))throw new Error("z required")}static fromAffine(h){let{x,y:g}=h||{};if(!h||!t.isValid(x)||!t.isValid(g))throw new Error("invalid affine point");if(h instanceof p)throw new Error("projective point not allowed");let y=w=>t.eql(w,t.ZERO);return y(x)&&y(g)?p.ZERO:new p(x,g,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(h){let x=t.invertBatch(h.map(g=>g.pz));return h.map((g,y)=>g.toAffine(x[y])).map(p.fromAffine)}static fromHex(h){let x=p.fromAffine(i(Re("pointHex",h)));return x.assertValidity(),x}static fromPrivateKey(h){return p.BASE.multiply(c(h))}_setWindowSize(h){this._WINDOW_SIZE=h,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:h,y:x}=this.toAffine();if(!t.isValid(h)||!t.isValid(x))throw new Error("bad point: x or y not FE");let g=t.sqr(x),y=o(h);if(!t.eql(g,y))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:h}=this.toAffine();if(t.isOdd)return!t.isOdd(h);throw new Error("Field doesn't support isOdd")}equals(h){l(h);let{px:x,py:g,pz:y}=this,{px:w,py:E,pz:B}=h,S=t.eql(t.mul(x,B),t.mul(w,y)),b=t.eql(t.mul(g,B),t.mul(E,y));return S&&b}negate(){return new p(this.px,t.neg(this.py),this.pz)}double(){let{a:h,b:x}=e,g=t.mul(x,sw),{px:y,py:w,pz:E}=this,B=t.ZERO,S=t.ZERO,b=t.ZERO,v=t.mul(y,y),k=t.mul(w,w),U=t.mul(E,E),R=t.mul(y,w);return R=t.add(R,R),b=t.mul(y,E),b=t.add(b,b),B=t.mul(h,b),S=t.mul(g,U),S=t.add(B,S),B=t.sub(k,S),S=t.add(k,S),S=t.mul(B,S),B=t.mul(R,B),b=t.mul(g,b),U=t.mul(h,U),R=t.sub(v,U),R=t.mul(h,R),R=t.add(R,b),b=t.add(v,v),v=t.add(b,v),v=t.add(v,U),v=t.mul(v,R),S=t.add(S,v),U=t.mul(w,E),U=t.add(U,U),v=t.mul(U,R),B=t.sub(B,v),b=t.mul(U,k),b=t.add(b,b),b=t.add(b,b),new p(B,S,b)}add(h){l(h);let{px:x,py:g,pz:y}=this,{px:w,py:E,pz:B}=h,S=t.ZERO,b=t.ZERO,v=t.ZERO,k=e.a,U=t.mul(e.b,sw),R=t.mul(x,w),M=t.mul(g,E),L=t.mul(y,B),ce=t.add(x,g),_=t.add(w,E);ce=t.mul(ce,_),_=t.add(R,M),ce=t.sub(ce,_),_=t.add(x,y);let D=t.add(w,B);return _=t.mul(_,D),D=t.add(R,L),_=t.sub(_,D),D=t.add(g,y),S=t.add(E,B),D=t.mul(D,S),S=t.add(M,L),D=t.sub(D,S),v=t.mul(k,_),S=t.mul(U,L),v=t.add(S,v),S=t.sub(M,v),v=t.add(M,v),b=t.mul(S,v),M=t.add(R,R),M=t.add(M,R),L=t.mul(k,L),_=t.mul(U,_),M=t.add(M,L),L=t.sub(R,L),L=t.mul(k,L),_=t.add(_,L),R=t.mul(M,_),b=t.add(b,R),R=t.mul(D,_),S=t.mul(ce,S),S=t.sub(S,R),R=t.mul(ce,M),v=t.mul(D,v),v=t.add(v,R),new p(S,b,v)}subtract(h){return this.add(h.negate())}is0(){return this.equals(p.ZERO)}wNAF(h){return d.wNAFCached(this,u,h,x=>{let g=t.invertBatch(x.map(y=>y.pz));return x.map((y,w)=>y.toAffine(g[w])).map(p.fromAffine)})}multiplyUnsafe(h){let x=p.ZERO;if(h===En)return x;if(a(h),h===ar)return this;let{endo:g}=e;if(!g)return d.unsafeLadder(this,h);let{k1neg:y,k1:w,k2neg:E,k2:B}=g.splitScalar(h),S=x,b=x,v=this;for(;w>En||B>En;)w&ar&&(S=S.add(v)),B&ar&&(b=b.add(v)),v=v.double(),w>>=ar,B>>=ar;return y&&(S=S.negate()),E&&(b=b.negate()),b=new p(t.mul(b.px,g.beta),b.py,b.pz),S.add(b)}multiply(h){a(h);let x=h,g,y,{endo:w}=e;if(w){let{k1neg:E,k1:B,k2neg:S,k2:b}=w.splitScalar(x),{p:v,f:k}=this.wNAF(B),{p:U,f:R}=this.wNAF(b);v=d.constTimeNegate(E,v),U=d.constTimeNegate(S,U),U=new p(t.mul(U.px,w.beta),U.py,U.pz),g=v.add(U),y=k.add(R)}else{let{p:E,f:B}=this.wNAF(x);g=E,y=B}return p.normalizeZ([g,y])[0]}multiplyAndAddUnsafe(h,x,g){let y=p.BASE,w=(B,S)=>S===En||S===ar||!B.equals(y)?B.multiplyUnsafe(S):B.multiply(S),E=w(this,x).add(w(h,g));return E.is0()?void 0:E}toAffine(h){let{px:x,py:g,pz:y}=this,w=this.is0();h==null&&(h=w?t.ONE:t.inv(y));let E=t.mul(x,h),B=t.mul(g,h),S=t.mul(y,h);if(w)return{x:t.ZERO,y:t.ZERO};if(!t.eql(S,t.ONE))throw new Error("invZ was invalid");return{x:E,y:B}}isTorsionFree(){let{h,isTorsionFree:x}=e;if(h===ar)return!0;if(x)return x(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h,clearCofactor:x}=e;return h===ar?this:x?x(p,this):this.multiplyUnsafe(e.h)}toRawBytes(h=!0){return this.assertValidity(),n(p,this,h)}toHex(h=!0){return pn(this.toRawBytes(h))}}p.BASE=new p(e.Gx,e.Gy,t.ONE),p.ZERO=new p(t.ZERO,t.ONE,t.ZERO);let m=e.nBitLength,d=kl(p,e.endo?Math.ceil(m/2):m);return{CURVE:e,ProjectivePoint:p,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:s}}function FB(r){let e=wa(r);return Or(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function aw(r){let e=FB(r),{Fp:t,n}=e,i=t.BYTES+1,o=2*t.BYTES+1;function s(_){return En<_&&_<t.ORDER}function a(_){return be(_,n)}function c(_){return Sl(_,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:l,weierstrassEquation:p,isWithinCurveOrder:m}=OB({...e,toBytes(_,D,J){let N=D.toAffine(),T=t.toBytes(N.x),H=fn;return J?H(Uint8Array.from([D.hasEvenY()?2:3]),T):H(Uint8Array.from([4]),T,t.toBytes(N.y))},fromBytes(_){let D=_.length,J=_[0],N=_.subarray(1);if(D===i&&(J===2||J===3)){let T=dn(N);if(!s(T))throw new Error("Point is not on curve");let H=p(T),Y=t.sqrt(H),ee=(Y&ar)===ar;return(J&1)===1!==ee&&(Y=t.neg(Y)),{x:T,y:Y}}else if(D===o&&J===4){let T=t.fromBytes(N.subarray(0,t.BYTES)),H=t.fromBytes(N.subarray(t.BYTES,2*t.BYTES));return{x:T,y:H}}else throw new Error(`Point of length ${D} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}}),d=_=>pn(ui(_,e.nByteLength));function f(_){let D=n>>ar;return _>D}function h(_){return f(_)?a(-_):_}let x=(_,D,J)=>dn(_.slice(D,J));class g{constructor(D,J,N){this.r=D,this.s=J,this.recovery=N,this.assertValidity()}static fromCompact(D){let J=e.nByteLength;return D=Re("compactSignature",D,J*2),new g(x(D,0,J),x(D,J,2*J))}static fromDER(D){let{r:J,s:N}=to.toSig(Re("DER",D));return new g(J,N)}assertValidity(){if(!m(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!m(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(D){return new g(this.r,this.s,D)}recoverPublicKey(D){let{r:J,s:N,recovery:T}=this,H=b(Re("msgHash",D));if(T==null||![0,1,2,3].includes(T))throw new Error("recovery id invalid");let Y=T===2||T===3?J+e.n:J;if(Y>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let ee=T&1?"03":"02",se=u.fromHex(ee+d(Y)),le=c(Y),we=a(-H*le),de=a(N*le),he=u.BASE.multiplyAndAddUnsafe(se,we,de);if(!he)throw new Error("point at infinify");return he.assertValidity(),he}hasHighS(){return f(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Yi(this.toDERHex())}toDERHex(){return to.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Yi(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}let y={isValidPrivateKey(_){try{return l(_),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let _=jf(e.n);return ty(e.randomBytes(_),e.n)},precompute(_=8,D=u.BASE){return D._setWindowSize(_),D.multiply(BigInt(3)),D}};function w(_,D=!0){return u.fromPrivateKey(_).toRawBytes(D)}function E(_){let D=xr(_),J=typeof _=="string",N=(D||J)&&_.length;return D?N===i||N===o:J?N===2*i||N===2*o:_ instanceof u}function B(_,D,J=!0){if(E(_))throw new Error("first arg must be private key");if(!E(D))throw new Error("second arg must be public key");return u.fromHex(D).multiply(l(_)).toRawBytes(J)}let S=e.bits2int||function(_){let D=dn(_),J=_.length*8-e.nBitLength;return J>0?D>>BigInt(J):D},b=e.bits2int_modN||function(_){return a(S(_))},v=ya(e.nBitLength);function k(_){if(typeof _!="bigint")throw new Error("bigint expected");if(!(En<=_&&_<v))throw new Error(`bigint expected < 2^${e.nBitLength}`);return ui(_,e.nByteLength)}function U(_,D,J=R){if(["recovered","canonical"].some(Te=>Te in J))throw new Error("sign() legacy options not supported");let{hash:N,randomBytes:T}=e,{lowS:H,prehash:Y,extraEntropy:ee}=J;H==null&&(H=!0),_=Re("msgHash",_),Y&&(_=Re("prehashed msgHash",N(_)));let se=b(_),le=l(D),we=[k(le),k(se)];if(ee!=null){let Te=ee===!0?T(t.BYTES):ee;we.push(Re("extraEntropy",Te))}let de=fn(...we),he=se;function $e(Te){let tt=S(Te);if(!m(tt))return;let rt=c(tt),We=u.BASE.multiply(tt).toAffine(),ut=a(We.x);if(ut===En)return;let cn=a(rt*a(he+ut*le));if(cn===En)return;let Vi=(We.x===ut?0:2)|Number(We.y&ar),aa=cn;return H&&f(cn)&&(aa=h(cn),Vi^=1),new g(ut,aa,Vi)}return{seed:de,k2sig:$e}}let R={lowS:e.lowS,prehash:!1},M={lowS:e.lowS,prehash:!1};function L(_,D,J=R){let{seed:N,k2sig:T}=U(_,D,J),H=e;return zf(H.hash.outputLen,H.nByteLength,H.hmac)(N,T)}u.BASE._setWindowSize(8);function ce(_,D,J,N=M){let T=_;if(D=Re("msgHash",D),J=Re("publicKey",J),"strict"in N)throw new Error("options.strict was renamed to lowS");let{lowS:H,prehash:Y}=N,ee,se;try{if(typeof T=="string"||xr(T))try{ee=g.fromDER(T)}catch(We){if(!(We instanceof to.Err))throw We;ee=g.fromCompact(T)}else if(typeof T=="object"&&typeof T.r=="bigint"&&typeof T.s=="bigint"){let{r:We,s:ut}=T;ee=new g(We,ut)}else throw new Error("PARSE");se=u.fromHex(J)}catch(We){if(We.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&ee.hasHighS())return!1;Y&&(D=e.hash(D));let{r:le,s:we}=ee,de=b(D),he=c(we),$e=a(de*he),Te=a(le*he),tt=u.BASE.multiplyAndAddUnsafe(se,$e,Te)?.toAffine();return tt?a(tt.x)===le:!1}return{CURVE:e,getPublicKey:w,getSharedSecret:B,sign:L,verify:ce,ProjectivePoint:u,Signature:g,utils:y}}function zB(r){return{hash:r,hmac:(e,...t)=>va(r,e,wl(...t)),randomBytes:Yo}}function cw(r,e){let t=n=>aw({...r,...zB(n)});return Object.freeze({...t(e),create:t})}var pw=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),lw=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),VB=BigInt(1),ch=BigInt(2),uw=(r,e)=>(r+e/ch)/e;function MB(r){let e=pw,t=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=r*r*r%e,l=u*u*r%e,p=Se(l,t,e)*l%e,m=Se(p,t,e)*l%e,d=Se(m,ch,e)*u%e,f=Se(d,i,e)*d%e,h=Se(f,o,e)*f%e,x=Se(h,a,e)*h%e,g=Se(x,c,e)*x%e,y=Se(g,a,e)*h%e,w=Se(y,t,e)*l%e,E=Se(w,s,e)*f%e,B=Se(E,n,e)*u%e,S=Se(B,ch,e);if(!lh.eql(lh.sqr(S),r))throw new Error("Cannot find square root");return S}var lh=Bl(pw,void 0,void 0,{sqrt:MB}),vr=cw({a:BigInt(0),b:BigInt(7),Fp:lh,n:lw,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=lw,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-VB*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=t,s=BigInt("0x100000000000000000000000000000000"),a=uw(o*r,e),c=uw(-n*r,e),u=be(r-a*t-c*i,e),l=be(-a*n-c*o,e),p=u>s,m=l>s;if(p&&(u=e-u),m&&(l=e-l),u>s||l>s)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:p,k1:u,k2neg:m,k2:l}}}},ow),_V=BigInt(0);var TV=vr.ProjectivePoint;function dw(){return vr.utils.randomPrivateKey()}function fw(r,e){let t=ae.digest(e instanceof Uint8Array?e:e.subarray());if(or(t))return t.then(({digest:n})=>vr.sign(n,r).toDERRawBytes()).catch(n=>{throw new O(String(n),"ERR_INVALID_INPUT")});try{return vr.sign(t.digest,r).toDERRawBytes()}catch(n){throw new O(String(n),"ERR_INVALID_INPUT")}}function hw(r,e,t){let n=ae.digest(t instanceof Uint8Array?t:t.subarray());if(or(n))return n.then(({digest:i})=>vr.verify(e,i,r)).catch(i=>{throw new O(String(i),"ERR_INVALID_INPUT")});try{return vr.verify(e,n.digest,r)}catch(i){throw new O(String(i),"ERR_INVALID_INPUT")}}function mw(r){return vr.ProjectivePoint.fromHex(r).toRawBytes(!0)}function gw(r){try{vr.getPublicKey(r,!0)}catch(e){throw new O(String(e),"ERR_INVALID_PRIVATE_KEY")}}function uh(r){try{vr.ProjectivePoint.fromHex(r)}catch(e){throw new O(String(e),"ERR_INVALID_PUBLIC_KEY")}}function xw(r){try{return vr.getPublicKey(r,!0)}catch(e){throw new O(String(e),"ERR_INVALID_PRIVATE_KEY")}}var Na=class{_key;constructor(e){uh(e),this._key=e}verify(e,t){return hw(this._key,t,e)}marshal(){return mw(this._key)}get bytes(){return Fr.encode({Type:Be.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}async hash(){let e=ae.digest(this.bytes),t;return or(e)?{bytes:t}=await e:t=e.bytes,t}},Da=class{_key;_publicKey;constructor(e,t){this._key=e,this._publicKey=t??xw(e),gw(this._key),uh(this._publicKey)}sign(e){return fw(this._key,e)}get public(){return new Na(this._publicKey)}marshal(){return this._key}get bytes(){return zr.encode({Type:Be.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}hash(){let e=ae.digest(this.bytes);return or(e)?e.then(({bytes:t})=>t):e.bytes}async id(){let e=await this.public.hash();return ie(e,"base58btc")}async export(e,t="libp2p-key"){if(t==="libp2p-key")return es(this.bytes,e);throw new O(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function jB(r){return new Da(r)}function HB(r){return new Na(r)}async function qB(){let r=dw();return new Da(r)}var ro={rsa:sh,ed25519:Xf,secp256k1:ph};function yw(r){let e=Object.keys(ro).join(" / ");return new O(`invalid or unsupported key type ${r}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function dh(r){let e=Fr.decode(r),t=e.Data??new Uint8Array;switch(e.Type){case Be.RSA:return ro.rsa.unmarshalRsaPublicKey(t);case Be.Ed25519:return ro.ed25519.unmarshalEd25519PublicKey(t);case Be.Secp256k1:return ro.secp256k1.unmarshalSecp256k1PublicKey(t);default:throw yw(e.Type??"unknown")}}async function ww(r){let e=zr.decode(r),t=e.Data??new Uint8Array;switch(e.Type){case Be.RSA:return ro.rsa.unmarshalRsaPrivateKey(t);case Be.Ed25519:return ro.ed25519.unmarshalEd25519PrivateKey(t);case Be.Secp256k1:return ro.secp256k1.unmarshalSecp256k1PrivateKey(t);default:throw yw(e.Type??"RSA")}}var kh=Q(ke(),1);var An="/",bw=new TextEncoder().encode(An),vu=bw[0],Xe=class r{_buf;constructor(e,t){if(typeof e=="string")this._buf=Z(e);else if(e instanceof Uint8Array)this._buf=e;else throw new Error("Invalid key, should be String of Uint8Array");if(t==null&&(t=!0),t&&this.clean(),this._buf.byteLength===0||this._buf[0]!==vu)throw new Error("Invalid key")}toString(e="utf8"){return ie(this._buf,e)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return`Key(${this.toString()})`}static withNamespaces(e){return new r(e.join(An))}static random(){return new r(Math.random().toString().substring(2))}static asKey(e){return e instanceof Uint8Array||typeof e=="string"?new r(e):typeof e.uint8Array=="function"?new r(e.uint8Array()):null}clean(){if((this._buf==null||this._buf.byteLength===0)&&(this._buf=bw),this._buf[0]!==vu){let e=new Uint8Array(this._buf.byteLength+1);e.fill(vu,0,1),e.set(this._buf,1),this._buf=e}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===vu;)this._buf=this._buf.subarray(0,-1)}less(e){let t=this.list(),n=e.list();for(let i=0;i<t.length;i++){if(n.length<i+1)return!1;let o=t[i],s=n[i];if(o<s)return!0;if(o>s)return!1}return t.length<n.length}reverse(){return r.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){let e=this.namespaces();return e[e.length-1]}list(){return this.toString().split(An).slice(1)}type(){return KB(this.baseNamespace())}name(){return GB(this.baseNamespace())}instance(e){return new r(this.toString()+":"+e)}path(){let e=this.parent().toString();return e.endsWith(An)||(e+=An),e+=this.type(),new r(e)}parent(){let e=this.list();return e.length===1?new r(An):new r(e.slice(0,-1).join(An))}child(e){return this.toString()===An?e:e.toString()===An?this:new r(this.toString()+e.toString(),!1)}isAncestorOf(e){return e.toString()===this.toString()?!1:e.toString().startsWith(this.toString())}isDecendantOf(e){return e.toString()===this.toString()?!1:this.toString().startsWith(e.toString())}isTopLevel(){return this.list().length===1}concat(...e){return r.withNamespaces([...this.namespaces(),...WB(e.map(t=>t.namespaces()))])}};function KB(r){let e=r.split(":");return e.length<2?"":e.slice(0,-1).join(":")}function GB(r){let e=r.split(":");return e[e.length-1]}function WB(r){return[].concat(...r)}var Ob=Q(Eu(),1);var vw="ERR_IPNS_EXPIRED_RECORD",La="ERR_UNRECOGNIZED_VALIDITY",Ew="ERR_SIGNATURE_CREATION",Sn="ERR_SIGNATURE_VERIFICATION";var hh="ERR_UNDEFINED_PARAMETER",Aw="ERR_INVALID_RECORD_DATA",Sw="ERR_INVALID_VALUE",Bw="ERR_INVALID_EMBEDDED_KEY",kw="ERR_MISSING_PRIVATE_KEY",Iw="ERR_RECORD_TOO_LARGE";var ot;(function(r){let e;(function(i){i.EOL="EOL"})(e=r.ValidityType||(r.ValidityType={}));let t;(function(i){i[i.EOL=0]="EOL"})(t||(t={})),function(i){i.codec=()=>Ki(t)}(e=r.ValidityType||(r.ValidityType={}));let n;r.codec=()=>(n==null&&(n=nr((i,o,s={})=>{s.lengthDelimited!==!1&&o.fork(),i.value!=null&&(o.uint32(10),o.bytes(i.value)),i.signatureV1!=null&&(o.uint32(18),o.bytes(i.signatureV1)),i.validityType!=null&&(o.uint32(24),r.ValidityType.codec().encode(i.validityType,o)),i.validity!=null&&(o.uint32(34),o.bytes(i.validity)),i.sequence!=null&&(o.uint32(40),o.uint64(i.sequence)),i.ttl!=null&&(o.uint32(48),o.uint64(i.ttl)),i.pubKey!=null&&(o.uint32(58),o.bytes(i.pubKey)),i.signatureV2!=null&&(o.uint32(66),o.bytes(i.signatureV2)),i.data!=null&&(o.uint32(74),o.bytes(i.data)),s.lengthDelimited!==!1&&o.ldelim()},(i,o)=>{let s={},a=o==null?i.len:i.pos+o;for(;i.pos<a;){let c=i.uint32();switch(c>>>3){case 1:s.value=i.bytes();break;case 2:s.signatureV1=i.bytes();break;case 3:s.validityType=r.ValidityType.codec().decode(i);break;case 4:s.validity=i.bytes();break;case 5:s.sequence=i.uint64();break;case 6:s.ttl=i.uint64();break;case 7:s.pubKey=i.bytes();break;case 8:s.signatureV2=i.bytes();break;case 9:s.data=i.bytes();break;default:i.skipType(c&7);break}}return s})),n),r.encode=i=>rr(i,r.codec()),r.decode=i=>er(i,r.codec())})(ot||(ot={}));var YB=["string","number","bigint","symbol"],XB=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function _w(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if(YB.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(JB(r))return"Buffer";let t=ZB(r);return t||"Object"}function JB(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}function ZB(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(XB.includes(e))return e}var A=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};A.uint=new A(0,"uint",!0);A.negint=new A(1,"negint",!0);A.bytes=new A(2,"bytes",!0);A.string=new A(3,"string",!0);A.array=new A(4,"array",!1);A.map=new A(5,"map",!1);A.tag=new A(6,"tag",!1);A.float=new A(7,"float",!0);A.false=new A(7,"false",!0);A.true=new A(7,"true",!0);A.null=new A(7,"null",!0);A.undefined=new A(7,"undefined",!0);A.break=new A(7,"break",!0);var C=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};var as=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",QB=new TextDecoder,ek=new TextEncoder;function Au(r){return as&&globalThis.Buffer.isBuffer(r)}function Pa(r){return r instanceof Uint8Array?Au(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}var Uw=as?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):Cw(r,e,t):(r,e,t)=>t-e>64?QB.decode(r.subarray(e,t)):Cw(r,e,t),Su=as?r=>r.length>64?globalThis.Buffer.from(r):Tw(r):r=>r.length>64?ek.encode(r):Tw(r),jr=r=>Uint8Array.from(r),cs=as?(r,e,t)=>Au(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),Nw=as?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),Pa(globalThis.Buffer.concat(r,e))):(r,e)=>{let t=new Uint8Array(e),n=0;for(let i of r)n+i.length>t.length&&(i=i.subarray(0,t.length-n)),t.set(i,n),n+=i.length;return t},Dw=as?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function Lw(r,e){if(Au(r)&&Au(e))return r.compare(e);for(let t=0;t<r.length;t++)if(r[t]!==e[t])return r[t]<e[t]?-1:1;return 0}function Tw(r){let e=[],t=0;for(let n=0;n<r.length;n++){let i=r.charCodeAt(n);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&n+1<r.length&&(r.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(r.charCodeAt(++n)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e}function Cw(r,e,t){let n=[];for(;e<t;){let i=r[e],o=null,s=i>239?4:i>223?3:i>191?2:1;if(e+s<=t){let a,c,u,l;switch(s){case 1:i<128&&(o=i);break;case 2:a=r[e+1],(a&192)===128&&(l=(i&31)<<6|a&63,l>127&&(o=l));break;case 3:a=r[e+1],c=r[e+2],(a&192)===128&&(c&192)===128&&(l=(i&15)<<12|(a&63)<<6|c&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:a=r[e+1],c=r[e+2],u=r[e+3],(a&192)===128&&(c&192)===128&&(u&192)===128&&(l=(i&15)<<18|(a&63)<<12|(c&63)<<6|u&63,l>65535&&l<1114112&&(o=l))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),e+=s}return gh(n)}var Rw=4096;function gh(r){let e=r.length;if(e<=Rw)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Rw));return t}var tk=256,Oa=class{constructor(e=tk){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let i=t.length-(this.maxCursor-this.cursor)-1;t.set(e,i)}else{if(t){let i=t.length-(this.maxCursor-this.cursor)-1;i<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,i),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=Dw(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=cs(n,0,this.cursor)}else t=Nw(this.chunks,this.cursor);return e&&this.reset(),t}};var q="CBOR decode error:",Bn="CBOR encode error:",Fa=[];Fa[23]=1;Fa[24]=2;Fa[25]=3;Fa[26]=5;Fa[27]=9;function kn(r,e,t){if(r.length-e<t)throw new Error(`${q} not enough data for type`)}var Ze=[24,256,65536,4294967296,BigInt("18446744073709551616")];function $t(r,e,t){kn(r,e,1);let n=r[e];if(t.strict===!0&&n<Ze[0])throw new Error(`${q} integer encoded in more bytes than necessary (strict decode)`);return n}function jt(r,e,t){kn(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Ze[1])throw new Error(`${q} integer encoded in more bytes than necessary (strict decode)`);return n}function Ht(r,e,t){kn(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Ze[2])throw new Error(`${q} integer encoded in more bytes than necessary (strict decode)`);return n}function qt(r,e,t){kn(r,e,8);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3],i=r[e+4]*16777216+(r[e+5]<<16)+(r[e+6]<<8)+r[e+7],o=(BigInt(n)<<BigInt(32))+BigInt(i);if(t.strict===!0&&o<Ze[3])throw new Error(`${q} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(t.allowBigInt===!0)return o;throw new Error(`${q} integers outside of the safe integer range are not supported`)}function Pw(r,e,t,n){return new C(A.uint,$t(r,e+1,n),2)}function Ow(r,e,t,n){return new C(A.uint,jt(r,e+1,n),3)}function Fw(r,e,t,n){return new C(A.uint,Ht(r,e+1,n),5)}function zw(r,e,t,n){return new C(A.uint,qt(r,e+1,n),9)}function cr(r,e){return st(r,0,e.value)}function st(r,e,t){if(t<Ze[0]){let n=Number(t);r.push([e|n])}else if(t<Ze[1]){let n=Number(t);r.push([e|24,n])}else if(t<Ze[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Ze[3]){let n=Number(t);r.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(t);if(n<Ze[4]){let i=[e|27,0,0,0,0,0,0,0],o=Number(n&BigInt(4294967295)),s=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=o&255,o=o>>8,i[7]=o&255,o=o>>8,i[6]=o&255,o=o>>8,i[5]=o&255,i[4]=s&255,s=s>>8,i[3]=s&255,s=s>>8,i[2]=s&255,s=s>>8,i[1]=s&255,r.push(i)}else throw new Error(`${q} encountered BigInt larger than allowable range`)}}cr.encodedSize=function(e){return st.encodedSize(e.value)};st.encodedSize=function(e){return e<Ze[0]?1:e<Ze[1]?2:e<Ze[2]?3:e<Ze[3]?5:9};cr.compareTokens=function(e,t){return e.value<t.value?-1:e.value>t.value?1:0};function Vw(r,e,t,n){return new C(A.negint,-1-$t(r,e+1,n),2)}function Mw(r,e,t,n){return new C(A.negint,-1-jt(r,e+1,n),3)}function $w(r,e,t,n){return new C(A.negint,-1-Ht(r,e+1,n),5)}var xh=BigInt(-1),jw=BigInt(1);function Hw(r,e,t,n){let i=qt(r,e+1,n);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new C(A.negint,o,9)}if(n.allowBigInt!==!0)throw new Error(`${q} integers outside of the safe integer range are not supported`);return new C(A.negint,xh-BigInt(i),9)}function Bu(r,e){let t=e.value,n=typeof t=="bigint"?t*xh-jw:t*-1-1;st(r,e.type.majorEncoded,n)}Bu.encodedSize=function(e){let t=e.value,n=typeof t=="bigint"?t*xh-jw:t*-1-1;return n<Ze[0]?1:n<Ze[1]?2:n<Ze[2]?3:n<Ze[3]?5:9};Bu.compareTokens=function(e,t){return e.value<t.value?1:e.value>t.value?-1:0};function za(r,e,t,n){kn(r,e,t+n);let i=cs(r,e+t,e+t+n);return new C(A.bytes,i,t+n)}function qw(r,e,t,n){return za(r,e,1,t)}function Kw(r,e,t,n){return za(r,e,2,$t(r,e+1,n))}function Gw(r,e,t,n){return za(r,e,3,jt(r,e+1,n))}function Ww(r,e,t,n){return za(r,e,5,Ht(r,e+1,n))}function Yw(r,e,t,n){let i=qt(r,e+1,n);if(typeof i=="bigint")throw new Error(`${q} 64-bit integer bytes lengths not supported`);return za(r,e,9,i)}function ku(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===A.string?Su(r.value):r.value),r.encodedBytes}function ls(r,e){let t=ku(e);st(r,e.type.majorEncoded,t.length),r.push(t)}ls.encodedSize=function(e){let t=ku(e);return st.encodedSize(t.length)+t.length};ls.compareTokens=function(e,t){return nk(ku(e),ku(t))};function nk(r,e){return r.length<e.length?-1:r.length>e.length?1:Lw(r,e)}function Va(r,e,t,n,i){let o=t+n;kn(r,e,o);let s=new C(A.string,Uw(r,e+t,e+o),o);return i.retainStringBytes===!0&&(s.byteValue=cs(r,e+t,e+o)),s}function Xw(r,e,t,n){return Va(r,e,1,t,n)}function Jw(r,e,t,n){return Va(r,e,2,$t(r,e+1,n),n)}function Zw(r,e,t,n){return Va(r,e,3,jt(r,e+1,n),n)}function Qw(r,e,t,n){return Va(r,e,5,Ht(r,e+1,n),n)}function eb(r,e,t,n){let i=qt(r,e+1,n);if(typeof i=="bigint")throw new Error(`${q} 64-bit integer string lengths not supported`);return Va(r,e,9,i,n)}var tb=ls;function us(r,e,t,n){return new C(A.array,n,t)}function rb(r,e,t,n){return us(r,e,1,t)}function nb(r,e,t,n){return us(r,e,2,$t(r,e+1,n))}function ib(r,e,t,n){return us(r,e,3,jt(r,e+1,n))}function ob(r,e,t,n){return us(r,e,5,Ht(r,e+1,n))}function sb(r,e,t,n){let i=qt(r,e+1,n);if(typeof i=="bigint")throw new Error(`${q} 64-bit integer array lengths not supported`);return us(r,e,9,i)}function ab(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${q} indefinite length items not allowed`);return us(r,e,1,1/0)}function Iu(r,e){st(r,A.array.majorEncoded,e.value)}Iu.compareTokens=cr.compareTokens;Iu.encodedSize=function(e){return st.encodedSize(e.value)};function ps(r,e,t,n){return new C(A.map,n,t)}function cb(r,e,t,n){return ps(r,e,1,t)}function lb(r,e,t,n){return ps(r,e,2,$t(r,e+1,n))}function ub(r,e,t,n){return ps(r,e,3,jt(r,e+1,n))}function pb(r,e,t,n){return ps(r,e,5,Ht(r,e+1,n))}function db(r,e,t,n){let i=qt(r,e+1,n);if(typeof i=="bigint")throw new Error(`${q} 64-bit integer map lengths not supported`);return ps(r,e,9,i)}function fb(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${q} indefinite length items not allowed`);return ps(r,e,1,1/0)}function _u(r,e){st(r,A.map.majorEncoded,e.value)}_u.compareTokens=cr.compareTokens;_u.encodedSize=function(e){return st.encodedSize(e.value)};function hb(r,e,t,n){return new C(A.tag,t,1)}function mb(r,e,t,n){return new C(A.tag,$t(r,e+1,n),2)}function gb(r,e,t,n){return new C(A.tag,jt(r,e+1,n),3)}function xb(r,e,t,n){return new C(A.tag,Ht(r,e+1,n),5)}function yb(r,e,t,n){return new C(A.tag,qt(r,e+1,n),9)}function Tu(r,e){st(r,A.tag.majorEncoded,e.value)}Tu.compareTokens=cr.compareTokens;Tu.encodedSize=function(e){return st.encodedSize(e.value)};var lk=20,uk=21,pk=22,dk=23;function wb(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${q} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new C(A.null,null,1):new C(A.undefined,void 0,1)}function bb(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${q} indefinite length items not allowed`);return new C(A.break,void 0,1)}function yh(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${q} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${q} Infinity values are not supported`)}return new C(A.float,r,e)}function vb(r,e,t,n){return yh(wh(r,e+1),3,n)}function Eb(r,e,t,n){return yh(bh(r,e+1),5,n)}function Ab(r,e,t,n){return yh(Ib(r,e+1),9,n)}function Cu(r,e,t){let n=e.value;if(n===!1)r.push([A.float.majorEncoded|lk]);else if(n===!0)r.push([A.float.majorEncoded|uk]);else if(n===null)r.push([A.float.majorEncoded|pk]);else if(n===void 0)r.push([A.float.majorEncoded|dk]);else{let i,o=!1;(!t||t.float64!==!0)&&(Bb(n),i=wh(Er,1),n===i||Number.isNaN(n)?(Er[0]=249,r.push(Er.slice(0,3)),o=!0):(kb(n),i=bh(Er,1),n===i&&(Er[0]=250,r.push(Er.slice(0,5)),o=!0))),o||(fk(n),i=Ib(Er,1),Er[0]=251,r.push(Er.slice(0,9)))}}Cu.encodedSize=function(e,t){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!t||t.float64!==!0){Bb(n);let i=wh(Er,1);if(n===i||Number.isNaN(n))return 3;if(kb(n),i=bh(Er,1),n===i)return 5}return 9};var Sb=new ArrayBuffer(9),lr=new DataView(Sb,1),Er=new Uint8Array(Sb,0);function Bb(r){if(r===1/0)lr.setUint16(0,31744,!1);else if(r===-1/0)lr.setUint16(0,64512,!1);else if(Number.isNaN(r))lr.setUint16(0,32256,!1);else{lr.setFloat32(0,r);let e=lr.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)lr.setUint16(0,31744,!1);else if(t===0)lr.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?lr.setUint16(0,0):i<-14?lr.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):lr.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}function wh(r,e){if(r.length-e<2)throw new Error(`${q} not enough data for float16`);let t=(r[e]<<8)+r[e+1];if(t===31744)return 1/0;if(t===64512)return-1/0;if(t===32256)return NaN;let n=t>>10&31,i=t&1023,o;return n===0?o=i*2**-24:n!==31?o=(i+1024)*2**(n-25):o=i===0?1/0:NaN,t&32768?-o:o}function kb(r){lr.setFloat32(0,r,!1)}function bh(r,e){if(r.length-e<4)throw new Error(`${q} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}function fk(r){lr.setFloat64(0,r,!1)}function Ib(r,e){if(r.length-e<8)throw new Error(`${q} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}Cu.compareTokens=cr.compareTokens;function me(r,e,t){throw new Error(`${q} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}function Ru(r){return()=>{throw new Error(`${q} ${r}`)}}var F=[];for(let r=0;r<=23;r++)F[r]=me;F[24]=Pw;F[25]=Ow;F[26]=Fw;F[27]=zw;F[28]=me;F[29]=me;F[30]=me;F[31]=me;for(let r=32;r<=55;r++)F[r]=me;F[56]=Vw;F[57]=Mw;F[58]=$w;F[59]=Hw;F[60]=me;F[61]=me;F[62]=me;F[63]=me;for(let r=64;r<=87;r++)F[r]=qw;F[88]=Kw;F[89]=Gw;F[90]=Ww;F[91]=Yw;F[92]=me;F[93]=me;F[94]=me;F[95]=Ru("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)F[r]=Xw;F[120]=Jw;F[121]=Zw;F[122]=Qw;F[123]=eb;F[124]=me;F[125]=me;F[126]=me;F[127]=Ru("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)F[r]=rb;F[152]=nb;F[153]=ib;F[154]=ob;F[155]=sb;F[156]=me;F[157]=me;F[158]=me;F[159]=ab;for(let r=160;r<=183;r++)F[r]=cb;F[184]=lb;F[185]=ub;F[186]=pb;F[187]=db;F[188]=me;F[189]=me;F[190]=me;F[191]=fb;for(let r=192;r<=215;r++)F[r]=hb;F[216]=mb;F[217]=gb;F[218]=xb;F[219]=yb;F[220]=me;F[221]=me;F[222]=me;F[223]=me;for(let r=224;r<=243;r++)F[r]=Ru("simple values are not supported");F[244]=me;F[245]=me;F[246]=me;F[247]=wb;F[248]=Ru("simple values are not supported");F[249]=vb;F[250]=Eb;F[251]=Ab;F[252]=me;F[253]=me;F[254]=me;F[255]=bb;var Ar=[];for(let r=0;r<24;r++)Ar[r]=new C(A.uint,r,1);for(let r=-1;r>=-24;r--)Ar[31-r]=new C(A.negint,r,1);Ar[64]=new C(A.bytes,new Uint8Array(0),1);Ar[96]=new C(A.string,"",1);Ar[128]=new C(A.array,0,1);Ar[160]=new C(A.map,0,1);Ar[244]=new C(A.false,!1,1);Ar[245]=new C(A.true,!0,1);Ar[246]=new C(A.null,null,1);function _b(r){switch(r.type){case A.false:return jr([244]);case A.true:return jr([245]);case A.null:return jr([246]);case A.bytes:return r.value.length?void 0:jr([64]);case A.string:return r.value===""?jr([96]):void 0;case A.array:return r.value===0?jr([128]):void 0;case A.map:return r.value===0?jr([160]):void 0;case A.uint:return r.value<24?jr([Number(r.value)]):void 0;case A.negint:if(r.value>=-24)return jr([31-Number(r.value)])}}var mk={float64:!1,mapSorter:yk,quickEncodeToken:_b};function gk(){let r=[];return r[A.uint.major]=cr,r[A.negint.major]=Bu,r[A.bytes.major]=ls,r[A.string.major]=tb,r[A.array.major]=Iu,r[A.map.major]=_u,r[A.tag.major]=Tu,r[A.float.major]=Cu,r}var Tb=gk(),vh=new Oa,Nu=class r{constructor(e,t){this.obj=e,this.parent=t}includes(e){let t=this;do if(t.obj===e)return!0;while(t=t.parent);return!1}static createCheck(e,t){if(e&&e.includes(t))throw new Error(`${Bn} object contains circular references`);return new r(t,e)}},xi={null:new C(A.null,null),undefined:new C(A.undefined,void 0),true:new C(A.true,!0),false:new C(A.false,!1),emptyArray:new C(A.array,0),emptyMap:new C(A.map,0)},yi={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new C(A.float,r):r>=0?new C(A.uint,r):new C(A.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new C(A.uint,r):new C(A.negint,r)},Uint8Array(r,e,t,n){return new C(A.bytes,r)},string(r,e,t,n){return new C(A.string,r)},boolean(r,e,t,n){return r?xi.true:xi.false},null(r,e,t,n){return xi.null},undefined(r,e,t,n){return xi.undefined},ArrayBuffer(r,e,t,n){return new C(A.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new C(A.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[xi.emptyArray,new C(A.break)]:xi.emptyArray;n=Nu.createCheck(n,r);let i=[],o=0;for(let s of r)i[o++]=Uu(s,t,n);return t.addBreakTokens?[new C(A.array,r.length),i,new C(A.break)]:[new C(A.array,r.length),i]},Object(r,e,t,n){let i=e!=="Object",o=i?r.keys():Object.keys(r),s=i?r.size:o.length;if(!s)return t.addBreakTokens===!0?[xi.emptyMap,new C(A.break)]:xi.emptyMap;n=Nu.createCheck(n,r);let a=[],c=0;for(let u of o)a[c++]=[Uu(u,t,n),Uu(i?r.get(u):r[u],t,n)];return xk(a,t),t.addBreakTokens?[new C(A.map,s),a,new C(A.break)]:[new C(A.map,s),a]}};yi.Map=yi.Object;yi.Buffer=yi.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))yi[`${r}Array`]=yi.DataView;function Uu(r,e={},t){let n=_w(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||yi[n];if(typeof i=="function"){let s=i(r,n,e,t);if(s!=null)return s}let o=yi[n];if(!o)throw new Error(`${Bn} unsupported type: ${n}`);return o(r,n,e,t)}function xk(r,e){e.mapSorter&&r.sort(e.mapSorter)}function yk(r,e){let t=Array.isArray(r[0])?r[0][0]:r[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(t.type!==n.type)return t.type.compare(n.type);let i=t.type.major,o=Tb[i].compareTokens(t,n);return o===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),o}function Cb(r,e,t,n){if(Array.isArray(e))for(let i of e)Cb(r,i,t,n);else t[e.type.major](r,e,n)}function Eh(r,e,t){let n=Uu(r,t);if(!Array.isArray(n)&&t.quickEncodeToken){let i=t.quickEncodeToken(n);if(i)return i;let o=e[n.type.major];if(o.encodedSize){let s=o.encodedSize(n,t),a=new Oa(s);if(o(a,n,t),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return Pa(a.chunks[0])}}return vh.reset(),Cb(vh,n,e,t),vh.toBytes(!0)}function wi(r,e){return e=Object.assign({},mk,e),Eh(r,Tb,e)}var wk={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Ah=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],t=Ar[e];if(t===void 0){let n=F[e];if(!n)throw new Error(`${q} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let i=e&31;t=n(this.data,this._pos,i,this.options)}return this._pos+=t.encodedLength,t}},Ma=Symbol.for("DONE"),Du=Symbol.for("BREAK");function bk(r,e,t){let n=[];for(let i=0;i<r.value;i++){let o=$a(e,t);if(o===Du){if(r.value===1/0)break;throw new Error(`${q} got unexpected break to lengthed array`)}if(o===Ma)throw new Error(`${q} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=o}return n}function vk(r,e,t){let n=t.useMaps===!0,i=n?void 0:{},o=n?new Map:void 0;for(let s=0;s<r.value;s++){let a=$a(e,t);if(a===Du){if(r.value===1/0)break;throw new Error(`${q} got unexpected break to lengthed map`)}if(a===Ma)throw new Error(`${q} found map but not enough entries (got ${s} [no key], expected ${r.value})`);if(n!==!0&&typeof a!="string")throw new Error(`${q} non-string keys not supported (got ${typeof a})`);if(t.rejectDuplicateMapKeys===!0&&(n&&o.has(a)||!n&&a in i))throw new Error(`${q} found repeat map key "${a}"`);let c=$a(e,t);if(c===Ma)throw new Error(`${q} found map but not enough entries (got ${s} [no value], expected ${r.value})`);n?o.set(a,c):i[a]=c}return n?o:i}function $a(r,e){if(r.done())return Ma;let t=r.next();if(t.type===A.break)return Du;if(t.type.terminal)return t.value;if(t.type===A.array)return bk(t,r,e);if(t.type===A.map)return vk(t,r,e);if(t.type===A.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=$a(r,e);return e.tags[t.value](n)}throw new Error(`${q} tag not supported (${t.value})`)}throw new Error("unsupported")}function Sh(r,e){if(!(r instanceof Uint8Array))throw new Error(`${q} data to decode must be a Uint8Array`);e=Object.assign({},wk,e);let t=e.tokenizer||new Ah(r,e),n=$a(t,e);if(n===Ma)throw new Error(`${q} did not find any content to decode`);if(n===Du)throw new Error(`${q} got unexpected break`);return[n,r.subarray(t.pos())]}function Kt(r,e){let[t,n]=Sh(r,e);if(n.length>0)throw new Error(`${q} too many terminals, data makes no sense`);return t}var Tt=Q(ke(),1);var Rb=ue("ipns:utils"),Ub=Z("/ipns/"),Ek=114,Nb=async(r,e)=>{if(e==null||r==null){let n=new Error("one or more of the provided parameters are not defined");throw Rb.error(n),(0,Tt.default)(n,hh)}let t;if(e.pubKey!=null){try{t=dh(e.pubKey)}catch(i){throw Rb.error(i),i}if(!(await k1(e.pubKey)).equals(r))throw(0,Tt.default)(new Error("Embedded public key did not match PeerID"),Bw)}else r.publicKey!=null&&(t=dh(r.publicKey));if(t!=null)return t;throw(0,Tt.default)(new Error("no public key is available"),hh)},Db=(r,e,t)=>{let n=Z(e);return ze([r,t,n])},Pu=r=>{let e=Z("ipns-signature:");return ze([e,r])},In=r=>"signatureV1"in r?ot.encode({value:Z(r.value),signatureV1:r.signatureV1,validityType:r.validityType,validity:Z(r.validity),sequence:r.sequence,ttl:r.ttl,pubKey:r.pubKey,signatureV2:r.signatureV2,data:r.data}):ot.encode({pubKey:r.pubKey,signatureV2:r.signatureV2,data:r.data});function wt(r){let e=ot.decode(r);if(e.sequence!=null&&(e.sequence=BigInt(e.sequence)),e.ttl!=null&&(e.ttl=BigInt(e.ttl)),e.signatureV2==null||e.data==null)throw(0,Tt.default)(new Error("missing data or signatureV2"),Sn);let t=Pb(e.data),n=Bh(t.Value),i=ie(t.Validity);if(e.value!=null&&e.signatureV1!=null)return Ak(e),{value:n,validityType:ot.ValidityType.EOL,validity:i,sequence:t.Sequence,ttl:t.TTL,pubKey:e.pubKey,signatureV1:e.signatureV1,signatureV2:e.signatureV2,data:e.data};if(e.signatureV2!=null)return{value:n,validityType:ot.ValidityType.EOL,validity:i,sequence:t.Sequence,ttl:t.TTL,pubKey:e.pubKey,signatureV2:e.signatureV2,data:e.data};throw new Error("invalid record: does not include signatureV1 or signatureV2")}var ds=r=>ze([Ub,r.toBytes()]),fs=r=>xa(r.slice(Ub.length)),Lb=(r,e,t,n,i)=>{let o;if(e===ot.ValidityType.EOL)o=0;else throw(0,Tt.default)(new Error("Unknown validity type"),La);return wi({Value:r,Validity:t,ValidityType:o,Sequence:n,TTL:i})},Pb=r=>{let e=Kt(r);if(e.ValidityType===0)e.ValidityType=ot.ValidityType.EOL;else throw(0,Tt.default)(new Error("Unknown validity type"),La);return Number.isInteger(e.Sequence)&&(e.Sequence=BigInt(e.Sequence)),Number.isInteger(e.TTL)&&(e.TTL=BigInt(e.TTL)),e},Bh=r=>{if(r!=null){if(Fx(r))return`/ipns/${r.toCID().toString(ni)}`;if(r instanceof Uint8Array){let n=ie(r);n.startsWith("/")&&(r=n)}let e=r.toString().trim();if(e.startsWith("/")&&e.length>1)return e;let t=z.asCID(r);if(t!=null)return t.code===Ek?`/ipns/${t.toString(ni)}`:`/ipfs/${t.toV1().toString()}`;try{return r instanceof Uint8Array?`/ipfs/${z.decode(r).toV1().toString()}`:`/ipfs/${z.parse(e).toV1().toString()}`}catch{}}throw(0,Tt.default)(new Error("Value must be a valid content path starting with /"),Sw)},Ak=r=>{if(r.data==null)throw(0,Tt.default)(new Error("Record data is missing"),Aw);let e=Pb(r.data);if(!ge(e.Value,r.value??new Uint8Array(0)))throw(0,Tt.default)(new Error('Field "value" did not match between protobuf and CBOR'),Sn);if(!ge(e.Validity,r.validity??new Uint8Array(0)))throw(0,Tt.default)(new Error('Field "validity" did not match between protobuf and CBOR'),Sn);if(e.ValidityType!==r.validityType)throw(0,Tt.default)(new Error('Field "validityType" did not match between protobuf and CBOR'),Sn);if(e.Sequence!==r.sequence)throw(0,Tt.default)(new Error('Field "sequence" did not match between protobuf and CBOR'),Sn);if(e.TTL!==r.ttl)throw(0,Tt.default)(new Error('Field "ttl" did not match between protobuf and CBOR'),Sn)};var Sk=ue("ipns"),Bk=It.code,kk="/ipns/",h$=kk.length,Fb={v1Compatible:!0};async function zb(r,e,t,n,i=Fb){let o=new Ob.default(Date.now()+Number(n)),s=ot.ValidityType.EOL,[a,c]=n.toString().split("."),u=BigInt(a)*BigInt(1e5)+BigInt(c??"0");return Ik(r,e,t,s,o.toString(),u,i)}var Ik=async(r,e,t,n,i,o,s=Fb)=>{t=BigInt(t);let a=Z(i),c=Bh(e),u=Z(c);if(r.privateKey==null)throw(0,kh.default)(new Error("Missing private key"),kw);let l=await ww(r.privateKey),p=Lb(u,n,a,t,o),m=Pu(p),d=await l.sign(m),f;if(r.publicKey!=null){let h=Ot(r.toBytes());(h.code!==Bk||!ge(r.publicKey,h.digest))&&(f=r.publicKey)}if(s.v1Compatible===!0){let h=await _k(l,u,n,a),x={value:c,signatureV1:h,validity:i,validityType:n,sequence:t,ttl:o,signatureV2:d,data:p};return f!=null&&(x.pubKey=f),x}else{let h={value:c,validity:i,validityType:n,sequence:t,ttl:o,signatureV2:d,data:p};return f!=null&&(h.pubKey=f),h}};var _k=async(r,e,t,n)=>{try{let i=Db(e,t,n);return await r.sign(i)}catch(i){throw Sk.error("record signature creation failed",i),(0,kh.default)(new Error("record signature creation failed"),Ew)}};var ja=Q(ke(),1),Vb=Q(Eu(),1);var Ou=ue("ipns:validator"),Tk=1024*10,Ck=async(r,e)=>{let t=wt(e),n;try{let i=Pu(t.data);n=await r.verify(i,t.signatureV2)}catch{n=!1}if(!n)throw Ou.error("record signature verification failed"),(0,ja.default)(new Error("record signature verification failed"),Sn);if(t.validityType===ot.ValidityType.EOL){if(Vb.default.fromString(t.validity).toDate().getTime()<Date.now())throw Ou.error("record has expired"),(0,ja.default)(new Error("record has expired"),vw)}else if(t.validityType!=null)throw Ou.error("unrecognized validity type"),(0,ja.default)(new Error("unrecognized validity type"),La);Ou("ipns record for %s is valid",t.value)};async function Fu(r,e){if(e.byteLength>Tk)throw(0,ja.default)(new Error("record too large"),Iw);let t=fs(r),n=wt(e),i=await Nb(t,n);await Ck(i,e)}async function*Ha(r){let e=/\r?\n/,t=new TextDecoder("utf8"),n="";for await(let i of r){typeof i=="string"&&(i=new TextEncoder().encode(i)),n+=t.decode(i,{stream:!0});let o=n.split(e);n=o.pop()??"";for(let s=0;s<o.length;s++)yield JSON.parse(o[s])}n+=t.decode(),n!==""&&(yield JSON.parse(n))}var _h=Q($b(),1);var Ka=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Th=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},jb=r=>globalThis.DOMException===void 0?new Th(r):new DOMException(r),Hb=r=>{let e=r.reason===void 0?jb("This operation was aborted."):r.reason;return e instanceof Error?e:jb(e)};function Ga(r,e){let{milliseconds:t,fallback:n,message:i,customTimers:o={setTimeout,clearTimeout}}=e,s,c=new Promise((u,l)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:m}=e;m.aborted&&l(Hb(m)),m.addEventListener("abort",()=>{l(Hb(m))})}if(t===Number.POSITIVE_INFINITY){r.then(u,l);return}let p=new Ka;s=o.setTimeout.call(void 0,()=>{if(n){try{u(n())}catch(m){l(m)}return}typeof r.cancel=="function"&&r.cancel(),i===!1?u():i instanceof Error?l(i):(p.message=i??`Promise timed out after ${t} milliseconds`,l(p))},t),(async()=>{try{u(await r)}catch(m){l(m)}})()}).finally(()=>{c.clear()});return c.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},c}function Ch(r,e,t){let n=0,i=r.length;for(;i>0;){let o=Math.trunc(i/2),s=n+o;t(r[s],e)<=0?(n=++s,i-=o+1):i=o}return n}var Wa=class{#e=[];enqueue(e,t){t={priority:0,...t};let n={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(n);return}let i=Ch(this.#e,n,(o,s)=>s.priority-o.priority);this.#e.splice(i,0,n)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var Ct=class extends _h.default{#e;#t;#r=0;#n;#c;#h=0;#o;#l;#i;#m;#s=0;#u;#a;#g;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Wa,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#t=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#n=e.intervalCap,this.#c=e.interval,this.#i=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#a=e.autoStart===!1}get#w(){return this.#t||this.#r<this.#n}get#b(){return this.#s<this.#u}#v(){this.#s--,this.#p(),this.emit("next")}#E(){this.#y(),this.#x(),this.#l=void 0}get#A(){let e=Date.now();if(this.#o===void 0){let t=this.#h-e;if(t<0)this.#r=this.#e?this.#s:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#E()},t)),!0}return!1}#p(){if(this.#i.size===0)return this.#o&&clearInterval(this.#o),this.#o=void 0,this.emit("empty"),this.#s===0&&this.emit("idle"),!1;if(!this.#a){let e=!this.#A;if(this.#w&&this.#b){let t=this.#i.dequeue();return t?(this.emit("active"),t(),e&&this.#x(),!0):!1}}return!1}#x(){this.#t||this.#o!==void 0||(this.#o=setInterval(()=>{this.#y()},this.#c),this.#h=Date.now()+this.#c)}#y(){this.#r===0&&this.#s===0&&this.#o&&(clearInterval(this.#o),this.#o=void 0),this.#r=this.#e?this.#s:0,this.#d()}#d(){for(;this.#p(););}get concurrency(){return this.#u}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#u=e,this.#d()}async#S(e){return new Promise((t,n)=>{e.addEventListener("abort",()=>{n(e.reason)},{once:!0})})}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:this.#g,...t},new Promise((n,i)=>{this.#i.enqueue(async()=>{this.#s++,this.#r++;try{t.signal?.throwIfAborted();let o=e({signal:t.signal});t.timeout&&(o=Ga(Promise.resolve(o),{milliseconds:t.timeout})),t.signal&&(o=Promise.race([o,this.#S(t.signal)]));let s=await o;n(s),this.emit("completed",s)}catch(o){if(o instanceof Ka&&!t.throwOnTimeout){n();return}i(o),this.emit("error",o)}finally{this.#v()}},t),this.emit("add"),this.#p()})}async addAll(e,t){return Promise.all(e.map(async n=>this.add(n,t)))}start(){return this.#a?(this.#a=!1,this.#d(),this):this}pause(){this.#a=!0}clear(){this.#i=new this.#m}async onEmpty(){this.#i.size!==0&&await this.#f("empty")}async onSizeLessThan(e){this.#i.size<e||await this.#f("next",()=>this.#i.size<e)}async onIdle(){this.#s===0&&this.#i.size===0||await this.#f("idle")}async#f(e,t){return new Promise(n=>{let i=()=>{t&&!t()||(this.off(e,i),n())};this.on(e,i)})}get size(){return this.#i.size}sizeBy(e){return this.#i.filter(e).length}get pending(){return this.#s}get isPaused(){return this.#a}};function Nk(r){return r[Symbol.asyncIterator]!=null}function Dk(r){if(Nk(r))return(async()=>{for await(let e of r)return e})();for(let e of r)return e}var io=Dk;var Rh=Z("/ipns/");function qb(r){return ge(r.subarray(0,Rh.byteLength),Rh)}var Kb=r=>xa(r.slice(Rh.length)),Vu=class{client;constructor(e){this.client=e}async*findProviders(e,t={}){yield*fr(this.client.getProviders(e,t),n=>({id:n.ID,multiaddrs:n.Addrs??[]}))}async provide(){}async put(e,t,n){if(!qb(e))return;let i=Kb(e),o=wt(t);await this.client.putIPNS(i,o,n)}async get(e,t){if(!qb(e))throw new O("Not found","ERR_NOT_FOUND");let n=Kb(e);try{let i=await this.client.getIPNS(n,t);return In(i)}catch(i){throw i.code==="ERR_BAD_RESPONSE"?new O("Not found","ERR_NOT_FOUND"):i}}},Mu=class{client;constructor(e){this.client=e}async findPeer(e,t={}){let n=await io(this.client.getPeers(e,t));if(n!=null)return{id:n.ID,multiaddrs:n.Addrs??[]};throw new O("Not found","ERR_NOT_FOUND")}async*getClosestPeers(e,t={}){}};var Rt=ue("delegated-routing-v1-http-api-client"),Gb={concurrentRequests:4,timeout:3e4},$u=class{started;httpQueue;shutDownController;clientUrl;timeout;contentRouting;peerRouting;constructor(e,t={}){this.started=!1,this.shutDownController=new AbortController,Qc(1/0,this.shutDownController.signal),this.httpQueue=new Ct({concurrency:t.concurrentRequests??Gb.concurrentRequests}),this.clientUrl=e instanceof URL?e:new URL(e),this.timeout=t.timeout??Gb.timeout,this.contentRouting=new Vu(this),this.peerRouting=new Mu(this)}get[pa](){return this.contentRouting}get[da](){return this.peerRouting}isStarted(){return this.started}start(){this.started=!0}stop(){this.httpQueue.clear(),this.shutDownController.abort(),this.started=!1}async*getProviders(e,t={}){Rt("getProviders starts: %c",e);let n=Mi([this.shutDownController.signal,t.signal,AbortSignal.timeout(this.timeout)]),i=He(),o=He();this.httpQueue.add(async()=>(i.resolve(),o.promise));try{await i.promise;let s=`${this.clientUrl}routing/v1/providers/${e.toString()}`,c=await fetch(s,{headers:{Accept:"application/x-ndjson"},signal:n});if(c.status===404)throw new O("No matching records found.","ERR_NOT_FOUND");if(c.status===422)throw new O("Request does not conform to schema or semantic constraints.","ERR_INVALID_REQUEST");if(c.body==null)throw new O("Routing response had no body","ERR_BAD_RESPONSE");if(c.headers.get("Content-Type")==="application/json"){let l=await c.json();for(let p of l.Providers){let m=this.#e(p);m!=null&&(yield m)}}else for await(let l of Ha(gl(c.body))){let p=this.#e(l);p!=null&&(yield p)}}catch(s){Rt.error("getProviders errored:",s)}finally{n.clear(),o.resolve(),Rt("getProviders finished: %c",e)}}async*getPeers(e,t={}){Rt("getPeers starts: %c",e);let n=Mi([this.shutDownController.signal,t.signal,AbortSignal.timeout(this.timeout)]),i=He(),o=He();this.httpQueue.add(async()=>(i.resolve(),o.promise));try{await i.promise;let s=`${this.clientUrl}routing/v1/peers/${e.toCID().toString()}`,c=await fetch(s,{headers:{Accept:"application/x-ndjson"},signal:n});if(c.status===404)throw new O("No matching records found.","ERR_NOT_FOUND");if(c.status===422)throw new O("Request does not conform to schema or semantic constraints.","ERR_INVALID_REQUEST");if(c.body==null)throw new O("Routing response had no body","ERR_BAD_RESPONSE");if(c.headers.get("Content-Type")==="application/json"){let l=await c.json();for(let p of l.Peers){let m=this.#e(p);m!=null&&(yield m)}}else for await(let l of Ha(gl(c.body))){let p=this.#e(l);p!=null&&(yield p)}}catch(s){Rt.error("getPeers errored:",s)}finally{n.clear(),o.resolve(),Rt("getPeers finished: %c",e)}}async getIPNS(e,t={}){Rt("getIPNS starts: %c",e);let n=Mi([this.shutDownController.signal,t.signal,AbortSignal.timeout(this.timeout)]),i=He(),o=He();this.httpQueue.add(async()=>(i.resolve(),o.promise));let s=`${this.clientUrl}routing/v1/ipns/${e.toCID().toString()}`;try{await i.promise;let c=await fetch(s,{headers:{Accept:"application/vnd.ipfs.ipns-record"},signal:n});if(Rt("getIPNS GET %s %d",s,c.status),c.status===404)throw new O("No matching records found.","ERR_NOT_FOUND");if(c.status===422)throw new O("Request does not conform to schema or semantic constraints.","ERR_INVALID_REQUEST");if(c.body==null)throw new O("GET ipns response had no body","ERR_BAD_RESPONSE");let u=await c.arrayBuffer(),l=new Uint8Array(u,0,u.byteLength);return t.validate!==!1&&await Fu(ds(e),l),wt(l)}catch(a){throw Rt.error("getIPNS GET %s error:",s,a),a}finally{n.clear(),o.resolve(),Rt("getIPNS finished: %c",e)}}async putIPNS(e,t,n={}){Rt("putIPNS starts: %c",e);let i=Mi([this.shutDownController.signal,n.signal,AbortSignal.timeout(this.timeout)]),o=He(),s=He();this.httpQueue.add(async()=>(o.resolve(),s.promise));let a=`${this.clientUrl}routing/v1/ipns/${e.toCID().toString()}`;try{await o.promise;let c=In(t),l=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/vnd.ipfs.ipns-record"},body:c,signal:i});if(Rt("putIPNS PUT %s %d",a,l.status),l.status!==200)throw new O("PUT ipns response had status other than 200","ERR_BAD_RESPONSE")}catch(c){throw Rt.error("putIPNS PUT %s error:",a,c.stack),c}finally{i.clear(),s.resolve(),Rt("putIPNS finished: %c",e)}}#e(e){let t=[],n=e.Addrs?.map(Uf)??[];return e.Protocols!=null&&t.push(...e.Protocols),e.Protocol!=null&&(t.push(e.Protocol),delete e.Protocol),{...e,Schema:"peer",ID:mr(e.ID),Addrs:n,Protocols:t}}};function Wb(r,e={}){return new $u(new URL(r),e)}var Yb=Z("/ipns/");function Xb(r){return ge(r.subarray(0,Yb.byteLength),Yb)}var Uh=class{client;constructor(e){this.client=Wb(e)}async provide(e,t){}async*findProviders(e,t){yield*fr(this.client.getProviders(e,t),n=>({id:n.ID,multiaddrs:n.Addrs,protocols:n.Protocols}))}async put(e,t,n){if(!Xb(e))return;let i=fs(e),o=wt(t);await this.client.putIPNS(i,o,n)}async get(e,t){if(!Xb(e))throw new O("Not found","ERR_NOT_FOUND");let n=fs(e);try{let i=await this.client.getIPNS(n,t);return In(i)}catch(i){throw i.code==="ERR_BAD_RESPONSE"?new O("Not found","ERR_NOT_FOUND"):i}}async findPeer(e,t){let n=await io(this.client.getPeers(e,t));if(n!=null)return{id:n.ID,multiaddrs:n.Addrs??[]};throw new O("Not found","ERR_NOT_FOUND")}async*getClosestPeers(e,t){}};function Ya(r){return new Uh(new URL(r))}var Nh=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=t??"ABORT_ERR"}};async function ju(r,e,t,n){let i=new Nh(n?.errorMessage,n?.errorCode);return t?.aborted===!0?Promise.reject(i):new Promise((o,s)=>{let a=u=>{n?.filter?.(u)!==!1&&(r.removeEventListener(e,a),t?.removeEventListener("abort",c),o(u))},c=()=>{r.removeEventListener(e,a),t?.removeEventListener("abort",c),s(i)};r.addEventListener(e,a),t?.addEventListener("abort",c)})}var Hu=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=t??"ABORT_ERR"}};async function Jb(r,e,t){if(e==null)return r;if(e.aborted)return Promise.reject(new Hu(t?.errorMessage,t?.errorCode));let n,i=new Hu(t?.errorMessage,t?.errorCode);try{return await Promise.race([r,new Promise((o,s)=>{n=()=>{s(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var qu=class{deferred;signal;where;constructor(e,t){this.signal=t,this.deferred=He(),this.where=e,this.onAbort=this.onAbort.bind(this),this.signal?.addEventListener("abort",this.onAbort)}onAbort(){this.deferred.reject(new Zn)}cleanup(){this.signal?.removeEventListener("abort",this.onAbort)}};function Lk(){return`${parseInt(String(Math.random()*1e9),10).toString()}${Date.now()}`}var Ku=class{id;fn;options;priority;recipients;status;timeline;controller;constructor(e,t,n=0){this.id=Lk(),this.status="queued",this.fn=e,this.priority=n,this.options=t,this.recipients=[],this.timeline={created:Date.now()},this.controller=new AbortController,Qc(1/0,this.controller.signal),this.onAbort=this.onAbort.bind(this)}abort(e){this.controller.abort(e)}onAbort(){this.recipients.reduce((t,n)=>t&&n.signal?.aborted===!0,!0)&&this.controller.abort(new Zn)}async join(e={}){let t=new qu(new Error("where").stack,e.signal);return this.recipients.push(t),e.signal?.addEventListener("abort",this.onAbort),t.deferred.promise}async run(){this.status="running",this.timeline.started=Date.now();try{this.controller.signal.throwIfAborted();let e=await Jb(this.fn({...this.options??{},signal:this.controller.signal}),this.controller.signal);this.recipients.forEach(t=>{t.deferred.resolve(e)}),this.status="complete"}catch(e){this.recipients.forEach(t=>{t.deferred.reject(e)}),this.status="errored"}finally{this.timeline.finished=Date.now(),this.cleanup()}}cleanup(){this.recipients.forEach(e=>{e.signal?.removeEventListener("abort",this.onAbort)})}};function Pk(r,e,t){let n=0,i=r.length;for(;i>0;){let o=Math.trunc(i/2),s=n+o;t(r[s],e)<=0?(n=++s,i-=o+1):i=o}return n}var Xa=class extends Zc{concurrency;queue;pending;constructor(e={}){super(),this.concurrency=e.concurrency??Number.POSITIVE_INFINITY,this.pending=0,e.metricName!=null&&e.metrics?.registerMetricGroup(e.metricName,{calculate:()=>({size:this.queue.length,running:this.pending,queued:this.queue.length-this.pending})}),this.queue=[]}tryToStartAnother(){if(this.size===0)return queueMicrotask(()=>{this.safeDispatchEvent("empty")}),this.running===0&&queueMicrotask(()=>{this.safeDispatchEvent("idle")}),!1;if(this.pending<this.concurrency){let e;for(let t of this.queue)if(t.status==="queued"){e=t;break}return e==null?!1:(this.safeDispatchEvent("active"),this.pending++,e.run().finally(()=>{for(let t=0;t<this.queue.length;t++)if(this.queue[t]===e){this.queue.splice(t,1);break}this.pending--,this.tryToStartAnother(),this.safeDispatchEvent("next")}),!0)}return!1}enqueue(e){if(this.queue[this.size-1]?.priority>=e.priority){this.queue.push(e);return}let t=Pk(this.queue,e,(n,i)=>i.priority-n.priority);this.queue.splice(t,0,e)}async add(e,t){t?.signal?.throwIfAborted();let n=new Ku(e,t,t?.priority),i=n.join(t).then(o=>(this.safeDispatchEvent("completed",{detail:o}),o)).catch(o=>{throw this.safeDispatchEvent("error",{detail:o}),o});return this.enqueue(n),this.safeDispatchEvent("add"),this.tryToStartAnother(),i}clear(){this.queue.splice(0,this.queue.length)}abort(){this.queue.forEach(e=>{e.abort(new Zn)}),this.clear()}async onEmpty(e){this.size!==0&&await ju(this,"empty",e?.signal)}async onSizeLessThan(e,t){this.size<e||await ju(this,"next",t?.signal,{filter:()=>this.size<e})}async onIdle(e){this.pending===0&&this.size===0||await ju(this,"idle",e?.signal)}get size(){return this.queue.length}get queued(){return this.queue.length-this.pending}get running(){return this.pending}async*toGenerator(e){e?.signal?.throwIfAborted();let t=Pr({objectMode:!0}),n=c=>{c!=null?this.abort():this.clear(),t.end(c)},i=c=>{c.detail!=null&&t.push(c.detail)},o=c=>{n(c.detail)},s=()=>{n()},a=()=>{n(new O("Queue aborted","ERR_QUEUE_ABORTED"))};this.addEventListener("completed",i),this.addEventListener("error",o),this.addEventListener("idle",s),e?.signal?.addEventListener("abort",a);try{yield*t}finally{this.removeEventListener("completed",i),this.removeEventListener("error",o),this.removeEventListener("idle",s),e?.signal?.removeEventListener("abort",a),n()}}};var tv="/pin/",Zb="/pinned-block/",Dh=ni,Qb=1;function ev(r){return r.version===0&&(r=r.toV1()),new Xe(`${tv}${r.toString(Dh)}`)}var Gu=class{datastore;blockstore;dagWalkers;constructor(e,t,n){this.datastore=e,this.blockstore=t,this.dagWalkers=n}async*add(e,t={}){let n=ev(e);if(await this.datastore.has(n))throw new Error("Already pinned");let i=Math.round(t.depth??1/0);if(i<0)throw new Error("Depth must be greater than or equal to 0");let o=new Xa({concurrency:Qb});for await(let a of this.#e(e,o,{...t,depth:i}))await this.#t(a,c=>c.pinnedBy.find(u=>ge(u,e.bytes))!=null?!1:(c.pinCount++,c.pinnedBy.push(e.bytes),!0),t),yield a;let s={depth:i,metadata:t.metadata??{}};await this.datastore.put(n,wi(s),t)}async*#e(e,t,n){if(n.depth===-1)return;let i=this.dagWalkers[e.code];if(i==null)throw new Error(`No dag walker found for cid codec ${e.code}`);let o=await this.blockstore.get(e,n);yield e;for await(let s of i.walk(o))yield*await t.add(async()=>this.#e(s,t,{...n,depth:n.depth-1}))}async#t(e,t,n){let i=new Xe(`${Zb}${Dh.encode(e.multihash.bytes)}`),o={pinCount:0,pinnedBy:[]};try{o=Kt(await this.datastore.get(i,n))}catch(a){if(a.code!=="ERR_NOT_FOUND")throw a}if(t(o)){if(o.pinCount===0&&await this.datastore.has(i)){await this.datastore.delete(i);return}await this.datastore.put(i,wi(o),n),n.onProgress?.(new P("helia:pin:add",e))}}async*rm(e,t={}){let n=ev(e),i=await this.datastore.get(n,t),o=Kt(i);await this.datastore.delete(n,t);let s=new Xa({concurrency:Qb});for await(let a of this.#e(e,s,{...t,depth:o.depth}))await this.#t(a,c=>(c.pinCount--,c.pinnedBy=c.pinnedBy.filter(u=>ge(u,e.bytes)),!0),{...t,depth:o.depth}),yield a}async*ls(e={}){for await(let{key:t,value:n}of this.datastore.query({prefix:tv+(e.cid!=null?`${e.cid.toString(ni)}`:"")},e)){let i=z.parse(t.toString().substring(5),ni),o=Kt(n);yield{cid:i,...o}}}async isPinned(e,t={}){let n=new Xe(`${Zb}${Dh.encode(e.multihash.bytes)}`);return this.datastore.has(n,t)}};function Lh(r,e){let t={[Symbol.iterator]:()=>t,next:()=>{let n=r.next(),i=n.value;return n.done===!0||i==null?{done:!0,value:void 0}:{done:!1,value:e(i)}}};return t}var hs=class r{set;constructor(e){if(this.set=new Set,e!=null)for(let t of e)this.set.add(t.toString())}get size(){return this.set.size}[Symbol.iterator](){return this.values()}add(e){this.set.add(e.toString())}clear(){this.set.clear()}delete(e){this.set.delete(e.toString())}entries(){return Lh(this.set.entries(),e=>{let t=mr(e[0]);return[t,t]})}forEach(e){this.set.forEach(t=>{let n=mr(t);e(n,n,this)})}has(e){return this.set.has(e.toString())}values(){return Lh(this.set.values(),e=>mr(e))}intersection(e){let t=new r;for(let n of e)this.has(n)&&t.add(n);return t}difference(e){let t=new r;for(let n of this)e.has(n)||t.add(n);return t}union(e){let t=new r;for(let n of e)t.add(n);for(let n of this)t.add(n);return t}};var Wu=class{log;routers;constructor(e,t){this.log=e.logger.forComponent("helia:routing"),this.routers=t.routers??[]}async start(){await Qn(...this.routers)}async stop(){await ei(...this.routers)}async*findProviders(e,t={}){if(this.routers.length===0)throw new O("No content routers available","ERR_NO_ROUTERS_AVAILABLE");let n=new hs;for await(let i of oi(...ms(this.routers,"findProviders").map(o=>o.findProviders(e,t))))i!=null&&(n.has(i.id)||(n.add(i.id),yield i))}async provide(e,t={}){if(this.routers.length===0)throw new O("No content routers available","ERR_NO_ROUTERS_AVAILABLE");await Promise.all(ms(this.routers,"provide").map(async n=>{await n.provide(e,t)}))}async put(e,t,n){await Promise.all(ms(this.routers,"put").map(async i=>{await i.put(e,t,n)}))}async get(e,t){return Promise.any(ms(this.routers,"get").map(async n=>n.get(e,t)))}async findPeer(e,t){if(this.routers.length===0)throw new O("No peer routers available","ERR_NO_ROUTERS_AVAILABLE");let n=this,i=oi(...ms(this.routers,"findPeer").map(o=>async function*(){try{yield await o.findPeer(e,t)}catch(s){n.log.error(s)}}()));for await(let o of i)if(o!=null)return o;throw new O("Could not find peer in routing","ERR_NOT_FOUND")}async*getClosestPeers(e,t={}){if(this.routers.length===0)throw new O("No peer routers available","ERR_NO_ROUTERS_AVAILABLE");let n=new hs;for await(let i of oi(...ms(this.routers,"getClosestPeers").map(o=>o.getClosestPeers(e,t))))i!=null&&(n.has(i.id)||(n.add(i.id),yield i))}};function ms(r,e){return r.filter(t=>t[e]!=null)}var bi={},gs=r=>{r.addEventListener("message",e=>{gs.dispatchEvent("message",r,e)}),r.port!=null&&r.port.addEventListener("message",e=>{gs.dispatchEvent("message",r,e)})};gs.addEventListener=(r,e)=>{bi[r]==null&&(bi[r]=[]),bi[r].push(e)};gs.removeEventListener=(r,e)=>{bi[r]!=null&&(bi[r]=bi[r].filter(t=>t===e))};gs.dispatchEvent=function(r,e,t){bi[r]!=null&&bi[r].forEach(n=>n(e,t))};var Ph=gs;var Oh="lock:worker:request-read",Fh="lock:worker:release-read",zh="lock:master:grant-read",Vh="lock:worker:request-write",Mh="lock:worker:release-write",$h="lock:master:grant-write";var rv=(r=21)=>Math.random().toString().substring(2);var nv=(r,e,t,n,i)=>(o,s)=>{if(s.data.type!==t)return;let a={type:s.data.type,name:s.data.name,identifier:s.data.identifier};r.dispatchEvent(new MessageEvent(e,{data:{name:a.name,handler:async()=>{o.postMessage({type:i,name:a.name,identifier:a.identifier}),await new Promise(c=>{let u=l=>{if(l==null||l.data==null)return;let p={type:l.data.type,name:l.data.name,identifier:l.data.identifier};p.type===n&&p.identifier===a.identifier&&(o.removeEventListener("message",u),c())};o.addEventListener("message",u)})}}}))},iv=(r,e,t,n)=>async()=>{let i=rv();return globalThis.postMessage({type:e,identifier:i,name:r}),new Promise(o=>{let s=a=>{if(a==null||a.data==null)return;let c={type:a.data.type,identifier:a.data.identifier};c.type===t&&c.identifier===i&&(globalThis.removeEventListener("message",s),o(()=>{globalThis.postMessage({type:n,identifier:i,name:r})}))};globalThis.addEventListener("message",s)})},Ok={singleProcess:!1},ov=r=>{if(r=Object.assign({},Ok,r),!!globalThis.document||r.singleProcess){let t=new EventTarget;return Ph.addEventListener("message",nv(t,"requestReadLock",Oh,Fh,zh)),Ph.addEventListener("message",nv(t,"requestWriteLock",Vh,Mh,$h)),t}return{isWorker:!0,readLock:t=>iv(t,Oh,zh,Fh),writeLock:t=>iv(t,Vh,$h,Mh)}};var oo={},vi;async function jh(r,e){let t,n=new Promise(i=>{t=i});return r.add(async()=>Ga((async()=>{await new Promise(i=>{t(()=>{i()})})})(),{milliseconds:e.timeout})),n}var Fk=(r,e)=>{if(vi.isWorker===!0)return{readLock:vi.readLock(r,e),writeLock:vi.writeLock(r,e)};let t=new Ct({concurrency:1}),n;return{async readLock(){if(n!=null)return jh(n,e);n=new Ct({concurrency:e.concurrency,autoStart:!1});let i=n,o=jh(n,e);return t.add(async()=>{i.start(),await i.onIdle().then(()=>{n===i&&(n=null)})}),o},async writeLock(){return n=null,jh(t,e)}}},zk={name:"lock",concurrency:1/0,timeout:846e5,singleProcess:!1};function Hh(r){let e=Object.assign({},zk,r);return vi==null&&(vi=ov(e),vi.isWorker!==!0&&(vi.addEventListener("requestReadLock",t=>{oo[t.data.name]!=null&&oo[t.data.name].readLock().then(async n=>t.data.handler().finally(()=>{n()}))}),vi.addEventListener("requestWriteLock",async t=>{oo[t.data.name]!=null&&oo[t.data.name].writeLock().then(async n=>t.data.handler().finally(()=>{n()}))}))),oo[e.name]==null&&(oo[e.name]=Fk(e.name,e)),oo[e.name]}var Yu=class{lock;child;pins;started;constructor(e,t,n={}){this.child=e,this.pins=t,this.lock=Hh({singleProcess:n.holdGcLock}),this.started=!1}isStarted(){return this.started}async start(){await Qn(this.child),this.started=!0}async stop(){await ei(this.child),this.started=!1}unwrap(){return this.child}async put(e,t,n={}){let i=await this.lock.readLock();try{return await this.child.put(e,t,n)}finally{i()}}async*putMany(e,t={}){let n=await this.lock.readLock();try{yield*this.child.putMany(e,t)}finally{n()}}async get(e,t={}){let n=await this.lock.readLock();try{return await this.child.get(e,t)}finally{n()}}async*getMany(e,t={}){let n=await this.lock.readLock();try{yield*this.child.getMany(e,t)}finally{n()}}async delete(e,t={}){let n=await this.lock.writeLock();try{if(await this.pins.isPinned(e))throw new Error("CID was pinned");await this.child.delete(e,t)}finally{n()}}async*deleteMany(e,t={}){let n=await this.lock.writeLock();try{let i=this;yield*this.child.deleteMany(async function*(){for await(let o of e){if(await i.pins.isPinned(o))throw new Error("CID was pinned");yield o}}(),t)}finally{n()}}async has(e,t={}){let n=await this.lock.readLock();try{return await this.child.has(e,t)}finally{n()}}async*getAll(e={}){let t=await this.lock.readLock();try{yield*this.child.getAll(e)}finally{t()}}};var sv=42;function Vk(r){if(r.asCID!==r&&r["/"]!==r.bytes)return null;let e=z.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new C(A.tag,sv),new C(A.bytes,t)]}function Mk(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function $k(r){if(Number.isNaN(r))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(r===1/0||r===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var qh={float64:!0,typeEncoders:{Object:Vk,undefined:Mk,number:$k}},mH={...qh,typeEncoders:{...qh.typeEncoders}};function jk(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return z.decode(r.subarray(1))}var Xu={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Xu.tags[sv]=jk;var gH={...Xu,tags:Xu.tags.slice()};var Ei=113,av=r=>wi(r,qh),Ju=r=>Kt(r,Xu);var Kh=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===A.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===A.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[A.uint.major](e,t){this.prefix(e);let n=String(t.value),i=[];for(let o=0;o<n.length;o++)i[o]=n.charCodeAt(o);e.push(i)}[A.negint.major](e,t){this[A.uint.major](e,t)}[A.bytes.major](e,t){throw new Error(`${Bn} unsupported type: Uint8Array`)}[A.string.major](e,t){this.prefix(e);let n=Su(JSON.stringify(t.value));e.push(n.length>32?Pa(n):n)}[A.array.major](e,t){this.prefix(e),this.inRecursive.push({type:A.array,elements:0}),e.push([91])}[A.map.major](e,t){this.prefix(e),this.inRecursive.push({type:A.map,elements:0}),e.push([123])}[A.tag.major](e,t){}[A.float.major](e,t){if(t.type.name==="break"){let s=this.inRecursive.pop();if(s){if(s.type===A.array)e.push([93]);else if(s.type===A.map)e.push([125]);else throw new Error("Unexpected recursive type; this should not happen!");return}throw new Error("Unexpected break; this should not happen!")}if(t.value===void 0)throw new Error(`${Bn} unsupported type: undefined`);if(this.prefix(e),t.type.name==="true"){e.push([116,114,117,101]);return}else if(t.type.name==="false"){e.push([102,97,108,115,101]);return}else if(t.type.name==="null"){e.push([110,117,108,108]);return}let n=String(t.value),i=[],o=!1;for(let s=0;s<n.length;s++)i[s]=n.charCodeAt(s),!o&&(i[s]===46||i[s]===101||i[s]===69)&&(o=!0);o||(i.push(46),i.push(48)),e.push(i)}};function Hk(r,e){if(Array.isArray(r[0])||Array.isArray(e[0]))throw new Error(`${Bn} complex map keys are not supported`);let t=r[0],n=e[0];if(t.type!==A.string||n.type!==A.string)throw new Error(`${Bn} non-string map keys are not supported`);if(t<n)return-1;if(t>n)return 1;throw new Error(`${Bn} unexpected duplicate map keys, this is not supported`)}var qk={addBreakTokens:!0,mapSorter:Hk};function Gh(r,e){return e=Object.assign({},qk,e),Eh(r,new Kh,e)}var Ai=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t,this.modeStack=["value"],this.lastToken=""}pos(){return this._pos}done(){return this._pos>=this.data.length}ch(){return this.data[this._pos]}currentMode(){return this.modeStack[this.modeStack.length-1]}skipWhitespace(){let e=this.ch();for(;e===32||e===9||e===13||e===10;)e=this.data[++this._pos]}expect(e){if(this.data.length-this._pos<e.length)throw new Error(`${q} unexpected end of input at position ${this._pos}`);for(let t=0;t<e.length;t++)if(this.data[this._pos++]!==e[t])throw new Error(`${q} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,n=!1,i=a=>{for(;!this.done();){let c=this.ch();if(a.includes(c))this._pos++;else break}};if(this.ch()===45&&(t=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,n=!0;else return new C(A.uint,0,this._pos-e);if(i([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${q} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(n)throw new Error(`${q} unexpected token at position ${this._pos}`);n=!0,this._pos++,i([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(n=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,i([48,49,50,51,52,53,54,55,56,57]));let o=String.fromCharCode.apply(null,this.data.subarray(e,this._pos)),s=parseFloat(o);return n?new C(A.float,s,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(s)?new C(s>=0?A.uint:A.negint,s,this._pos-e):new C(s>=0?A.uint:A.negint,BigInt(o),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${q} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let o=this._pos,s=0;o<this.data.length&&s<65536;o++,s++){let a=this.data[o];if(a===92||a<32||a>=128)break;if(a===34){let c=String.fromCharCode.apply(null,this.data.subarray(this._pos,o));return this._pos=o+1,new C(A.string,c,s)}}let e=this._pos,t=[],n=()=>{if(this._pos+4>=this.data.length)throw new Error(`${q} unexpected end of unicode escape sequence at position ${this._pos}`);let o=0;for(let s=0;s<4;s++){let a=this.ch();if(a>=48&&a<=57)a-=48;else if(a>=97&&a<=102)a=a-97+10;else if(a>=65&&a<=70)a=a-65+10;else throw new Error(`${q} unexpected unicode escape character at position ${this._pos}`);o=o*16+a,this._pos++}return o},i=()=>{let o=this.ch(),s=null,a=o>239?4:o>223?3:o>191?2:1;if(this._pos+a>this.data.length)throw new Error(`${q} unexpected unicode sequence at position ${this._pos}`);let c,u,l,p;switch(a){case 1:o<128&&(s=o);break;case 2:c=this.data[this._pos+1],(c&192)===128&&(p=(o&31)<<6|c&63,p>127&&(s=p));break;case 3:c=this.data[this._pos+1],u=this.data[this._pos+2],(c&192)===128&&(u&192)===128&&(p=(o&15)<<12|(c&63)<<6|u&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:c=this.data[this._pos+1],u=this.data[this._pos+2],l=this.data[this._pos+3],(c&192)===128&&(u&192)===128&&(l&192)===128&&(p=(o&15)<<18|(c&63)<<12|(u&63)<<6|l&63,p>65535&&p<1114112&&(s=p))}s===null?(s=65533,a=1):s>65535&&(s-=65536,t.push(s>>>10&1023|55296),s=56320|s&1023),t.push(s),this._pos+=a};for(;!this.done();){let o=this.ch(),s;switch(o){case 92:if(this._pos++,this.done())throw new Error(`${q} unexpected string termination at position ${this._pos}`);switch(s=this.ch(),this._pos++,s){case 34:case 39:case 92:case 47:t.push(s);break;case 98:t.push(8);break;case 116:t.push(9);break;case 110:t.push(10);break;case 102:t.push(12);break;case 114:t.push(13);break;case 117:t.push(n());break;default:throw new Error(`${q} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new C(A.string,gh(t),this._pos-e);default:if(o<32)throw new Error(`${q} invalid control character at position ${this._pos}`);o<128?(t.push(o),this._pos++):i()}}throw new Error(`${q} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new C(A.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new C(A.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new C(A.null,null,4);case 102:return this.expect([102,97,108,115,101]),new C(A.false,!1,5);case 116:return this.expect([116,114,117,101]),new C(A.true,!0,4);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:throw new Error(`${q} unexpected character at position ${this._pos}`)}}next(){switch(this.skipWhitespace(),this.currentMode()){case"value":return this.modeStack.pop(),this.parseValue();case"array-value":{if(this.modeStack.pop(),this.ch()===93)return this._pos++,this.skipWhitespace(),new C(A.break,void 0,1);if(this.ch()!==44)throw new Error(`${q} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue()}case"array-start":return this.modeStack.pop(),this.ch()===93?(this._pos++,this.skipWhitespace(),new C(A.break,void 0,1)):(this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue());case"obj-key":if(this.ch()===125)return this.modeStack.pop(),this._pos++,this.skipWhitespace(),new C(A.break,void 0,1);if(this.ch()!==44)throw new Error(`${q} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`);this._pos++,this.skipWhitespace();case"obj-start":{if(this.modeStack.pop(),this.ch()===125)return this._pos++,this.skipWhitespace(),new C(A.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${q} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("obj-value"),e}case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue();default:throw new Error(`${q} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function Ja(r,e){return e=Object.assign({tokenizer:new Ai(r,e)},e),Kt(r,e)}function Kk(r){if(r.asCID!==r&&r["/"]!==r.bytes)return null;let e=z.asCID(r);if(!e)return null;let t=e.toString();return[new C(A.map,1/0,1),new C(A.string,"/",1),new C(A.string,t,t.length),new C(A.break,void 0,1)]}function Qu(r){let e=Lr.encode(r).slice(1);return[new C(A.map,1/0,1),new C(A.string,"/",1),new C(A.map,1/0,1),new C(A.string,"bytes",5),new C(A.string,e,e.length),new C(A.break,void 0,1),new C(A.break,void 0,1)]}function Sr(r){return Qu(new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}function Gk(r){return Qu(new Uint8Array(r))}function Wk(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function Yk(r){if(Number.isNaN(r))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(r===1/0||r===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var Xk={typeEncoders:{Object:Kk,Buffer:Qu,Uint8Array:Qu,Int8Array:Sr,Uint16Array:Sr,Int16Array:Sr,Uint32Array:Sr,Int32Array:Sr,Float32Array:Sr,Float64Array:Sr,Uint8ClampedArray:Sr,BigInt64Array:Sr,BigUint64Array:Sr,DataView:Sr,ArrayBuffer:Gk,undefined:Wk,number:Yk}},Wh=class extends Ai{constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===A.map){let t=this._next();if(t.type===A.string&&t.value==="/"){let n=this._next();if(n.type===A.string){if(this._next().type!==A.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(n),new C(A.tag,42,0)}if(n.type===A.map){let i=this._next();if(i.type===A.string&&i.value==="bytes"){let o=this._next();if(o.type===A.string){for(let a=0;a<2;a++)if(this._next().type!==A.break)throw new Error("Invalid encoded Bytes form");let s=Lr.decode(`m${o.value}`);return new C(A.bytes,s,o.value.length)}this.tokenBuffer.push(o)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(t)}return e}},Yh={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Yh.tags[42]=z.parse;var Si=297,lv=r=>Gh(r,Xk),ep=r=>{let e=Object.assign(Yh,{tokenizer:new Wh(r,Yh)});return Ja(r,e)};var NH=new TextDecoder;var DH=new TextEncoder;var Ke={};$(Ke,{code:()=>Ve,createLink:()=>wv,createNode:()=>yv,decode:()=>Ie,encode:()=>fe,name:()=>aI,prepare:()=>Ue,validate:()=>Zh});var Jk=new TextDecoder;function Xh(r,e){let t=0;for(let n=0;;n+=7){if(n>=64)throw new Error("protobuf: varint overflow");if(e>=r.length)throw new Error("protobuf: unexpected end of data");let i=r[e++];if(t+=n<28?(i&127)<<n:(i&127)*2**n,i<128)break}return[t,e]}function rp(r,e){let t;[t,e]=Xh(r,e);let n=e+t;if(t<0||n<0)throw new Error("protobuf: invalid length");if(n>r.length)throw new Error("protobuf: unexpected end of data");return[r.subarray(e,n),n]}function uv(r,e){let t;return[t,e]=Xh(r,e),[t&7,t>>3,e]}function Zk(r){let e={},t=r.length,n=0;for(;n<t;){let i,o;if([i,o,n]=uv(r,n),o===1){if(e.Hash)throw new Error("protobuf: (PBLink) duplicate Hash section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Hash`);if(e.Name!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Name before Hash");if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Hash");[e.Hash,n]=rp(r,n)}else if(o===2){if(e.Name!==void 0)throw new Error("protobuf: (PBLink) duplicate Name section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Name`);if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Name");let s;[s,n]=rp(r,n),e.Name=Jk.decode(s)}else if(o===3){if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) duplicate Tsize section");if(i!==0)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Tsize`);[e.Tsize,n]=Xh(r,n)}else throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${o}`)}if(n>t)throw new Error("protobuf: (PBLink) unexpected end of data");return e}function pv(r){let e=r.length,t=0,n,i=!1,o;for(;t<e;){let a,c;if([a,c,t]=uv(r,t),a!==2)throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${a}`);if(c===1){if(o)throw new Error("protobuf: (PBNode) duplicate Data section");[o,t]=rp(r,t),n&&(i=!0)}else if(c===2){if(i)throw new Error("protobuf: (PBNode) duplicate Links section");n||(n=[]);let u;[u,t]=rp(r,t),n.push(Zk(u))}else throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${c}`)}if(t>e)throw new Error("protobuf: (PBNode) unexpected end of data");let s={};return o&&(s.Data=o),s.Links=n||[],s}var fv=new TextEncoder,dv=2**32,Qk=2**31;function eI(r,e){let t=e.length;if(typeof r.Tsize=="number"){if(r.Tsize<0)throw new Error("Tsize cannot be negative");if(!Number.isSafeInteger(r.Tsize))throw new Error("Tsize too large for encoding");t=Za(e,t,r.Tsize)-1,e[t]=24}if(typeof r.Name=="string"){let n=fv.encode(r.Name);t-=n.length,e.set(n,t),t=Za(e,t,n.length)-1,e[t]=18}return r.Hash&&(t-=r.Hash.length,e.set(r.Hash,t),t=Za(e,t,r.Hash.length)-1,e[t]=10),e.length-t}function hv(r){let e=rI(r),t=new Uint8Array(e),n=e;if(r.Data&&(n-=r.Data.length,t.set(r.Data,n),n=Za(t,n,r.Data.length)-1,t[n]=10),r.Links)for(let i=r.Links.length-1;i>=0;i--){let o=eI(r.Links[i],t.subarray(0,n));n-=o,n=Za(t,n,o)-1,t[n]=18}return t}function tI(r){let e=0;if(r.Hash){let t=r.Hash.length;e+=1+t+xs(t)}if(typeof r.Name=="string"){let t=fv.encode(r.Name).length;e+=1+t+xs(t)}return typeof r.Tsize=="number"&&(e+=1+xs(r.Tsize)),e}function rI(r){let e=0;if(r.Data){let t=r.Data.length;e+=1+t+xs(t)}if(r.Links)for(let t of r.Links){let n=tI(t);e+=1+n+xs(n)}return e}function Za(r,e,t){e-=xs(t);let n=e;for(;t>=Qk;)r[e++]=t&127|128,t/=128;for(;t>=128;)r[e++]=t&127|128,t>>>=7;return r[e]=t,n}function xs(r){return r%2===0&&r++,Math.floor((nI(r)+6)/7)}function nI(r){let e=0;return r>=dv&&(r=Math.floor(r/dv),e=32),r>=65536&&(r>>>=16,e+=16),r>=256&&(r>>>=8,e+=8),e+iI[r]}var iI=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8];var oI=["Data","Links"],sI=["Hash","Name","Tsize"],Jh=new TextEncoder;function gv(r,e){if(r===e)return 0;let t=r.Name?Jh.encode(r.Name):[],n=e.Name?Jh.encode(e.Name):[],i=t.length,o=n.length;for(let s=0,a=Math.min(i,o);s<a;++s)if(t[s]!==n[s]){i=t[s],o=n[s];break}return i<o?-1:o<i?1:0}function mv(r,e){return!Object.keys(r).some(t=>!e.includes(t))}function xv(r){if(typeof r.asCID=="object"){let t=z.asCID(r);if(!t)throw new TypeError("Invalid DAG-PB form");return{Hash:t}}if(typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");let e={};if(r.Hash){let t=z.asCID(r.Hash);try{t||(typeof r.Hash=="string"?t=z.parse(r.Hash):r.Hash instanceof Uint8Array&&(t=z.decode(r.Hash)))}catch(n){throw new TypeError(`Invalid DAG-PB form: ${n.message}`)}t&&(e.Hash=t)}if(!e.Hash)throw new TypeError("Invalid DAG-PB form");return typeof r.Name=="string"&&(e.Name=r.Name),typeof r.Tsize=="number"&&(e.Tsize=r.Tsize),e}function Ue(r){if((r instanceof Uint8Array||typeof r=="string")&&(r={Data:r}),typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");let e={};if(r.Data!==void 0)if(typeof r.Data=="string")e.Data=Jh.encode(r.Data);else if(r.Data instanceof Uint8Array)e.Data=r.Data;else throw new TypeError("Invalid DAG-PB form");if(r.Links!==void 0)if(Array.isArray(r.Links))e.Links=r.Links.map(xv),e.Links.sort(gv);else throw new TypeError("Invalid DAG-PB form");else e.Links=[];return e}function Zh(r){if(!r||typeof r!="object"||Array.isArray(r)||r instanceof Uint8Array||r["/"]&&r["/"]===r.bytes)throw new TypeError("Invalid DAG-PB form");if(!mv(r,oI))throw new TypeError("Invalid DAG-PB form (extraneous properties)");if(r.Data!==void 0&&!(r.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be bytes)");if(!Array.isArray(r.Links))throw new TypeError("Invalid DAG-PB form (Links must be a list)");for(let e=0;e<r.Links.length;e++){let t=r.Links[e];if(!t||typeof t!="object"||Array.isArray(t)||t instanceof Uint8Array||t["/"]&&t["/"]===t.bytes)throw new TypeError("Invalid DAG-PB form (bad link)");if(!mv(t,sI))throw new TypeError("Invalid DAG-PB form (extraneous properties on link)");if(t.Hash===void 0)throw new TypeError("Invalid DAG-PB form (link must have a Hash)");if(t.Hash==null||!t.Hash["/"]||t.Hash["/"]!==t.Hash.bytes)throw new TypeError("Invalid DAG-PB form (link Hash must be a CID)");if(t.Name!==void 0&&typeof t.Name!="string")throw new TypeError("Invalid DAG-PB form (link Name must be a string)");if(t.Tsize!==void 0){if(typeof t.Tsize!="number"||t.Tsize%1!==0)throw new TypeError("Invalid DAG-PB form (link Tsize must be an integer)");if(t.Tsize<0)throw new TypeError("Invalid DAG-PB form (link Tsize cannot be negative)")}if(e>0&&gv(t,r.Links[e-1])===-1)throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}function yv(r,e=[]){return Ue({Data:r,Links:e})}function wv(r,e,t){return xv({Hash:t,Name:r,Tsize:e})}var aI="dag-pb",Ve=112;function fe(r){Zh(r);let e={};return r.Links&&(e.Links=r.Links.map(t=>{let n={};return t.Hash&&(n.Hash=t.Hash.bytes),t.Name!==void 0&&(n.Name=t.Name),t.Tsize!==void 0&&(n.Tsize=t.Tsize),n})),r.Data&&(e.Data=r.Data),hv(e)}function Ie(r){let e=pv(r),t={};return e.Data&&(t.Data=e.Data),e.Links&&(t.Links=e.Links.map(n=>{let i={};try{i.Hash=z.decode(n.Hash)}catch{}if(!i.Hash)throw new Error("Invalid Hash field found in link, expected CID");return n.Name!==void 0&&(i.Name=n.Name),n.Tsize!==void 0&&(i.Tsize=n.Tsize),i})),t}var cI={codec:Ve,*walk(r){yield*Ie(r).Links.map(t=>t.Hash)}},lI={codec:je,*walk(){}},bv=42,uI={codec:Ei,*walk(r){let e=[],t=[];t[bv]=n=>{if(n[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");let i=z.decode(n.subarray(1));return e.push(i),i},Kt(r,{tags:t}),yield*e}},Qh=class extends Ai{tokenBuffer;constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===A.map){let t=this._next();if(t.type===A.string&&t.value==="/"){let n=this._next();if(n.type===A.string){if(this._next().type!==A.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(n),new C(A.tag,42,0)}if(n.type===A.map){let i=this._next();if(i.type===A.string&&i.value==="bytes"){let o=this._next();if(o.type===A.string){for(let a=0;a<2;a++)if(this._next().type!==A.break)throw new Error("Invalid encoded Bytes form");let s=Lr.decode(`m${o.value}`);return new C(A.bytes,s,o.value.length)}this.tokenBuffer.push(o)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(t)}return e}},pI={codec:Si,*walk(r){let e=[],t=[];t[bv]=n=>{let i=z.parse(n);return e.push(i),i},Ja(r,{tags:t,tokenizer:new Qh(r,{tags:t,allowIndefinite:!0,allowUndefined:!0,allowNaN:!0,allowInfinity:!0,allowBigInt:!0,strict:!1,rejectDuplicateMapKeys:!1})}),yield*e}},dI={codec:Lo,*walk(){}};function vv(r=[]){let e={};return[cI,lI,uI,pI,dI,...r].forEach(t=>{e[t.codec]=t}),e}var em=new Xe("/version"),Ev=1;async function Av(r){if(!await r.has(em)){await r.put(em,Z(`${Ev}`));return}let e=await r.get(em),t=ie(e);if(parseInt(t,10)!==Ev)throw new Error("Unknown datastore version, a datastore migration may be required")}function Sv(r=[]){let e={};return[ae,Nd,It,...r].forEach(t=>{e[t.code]=t}),e}function fI(r){return r[Symbol.asyncIterator]!=null}function hI(r,e){if(fI(r))return async function*(){for await(let a of r)await e(a)&&(yield a)}();let t=ko(r),{value:n,done:i}=t.next();if(i===!0)return function*(){}();let o=e(n);if(typeof o.then=="function")return async function*(){await o&&(yield n);for await(let a of t)await e(a)&&(yield a)}();let s=e;return function*(){o===!0&&(yield n);for(let a of t)s(a)&&(yield a)}()}var Gt=hI;function mI(r){return typeof r.retrieve=="function"}function gI(r){return typeof r.announce=="function"}var np=class{child;blockRetrievers;blockAnnouncers;hashers;started;log;constructor(e){this.log=e.logger.forComponent("helia:networked-storage"),this.child=e.blockstore,this.blockRetrievers=(e.blockBrokers??[]).filter(mI),this.blockAnnouncers=(e.blockBrokers??[]).filter(gI),this.hashers=e.hashers??{},this.started=!1}isStarted(){return this.started}async start(){await Qn(this.child,...new Set([...this.blockRetrievers,...this.blockAnnouncers])),this.started=!0}async stop(){await ei(this.child,...new Set([...this.blockRetrievers,...this.blockAnnouncers])),this.started=!1}unwrap(){return this.child}async put(e,t,n={}){return await this.child.has(e)?(n.onProgress?.(new P("blocks:put:duplicate",e)),e):(n.onProgress?.(new P("blocks:put:providers:notify",e)),this.blockAnnouncers.forEach(i=>{i.announce(e,t,n)}),n.onProgress?.(new P("blocks:put:blockstore:put",e)),this.child.put(e,t,n))}async*putMany(e,t={}){let n=Gt(e,async({cid:o})=>{let s=await this.child.has(o);return s&&t.onProgress?.(new P("blocks:put-many:duplicate",o)),!s}),i=yd(n,({cid:o,block:s})=>{t.onProgress?.(new P("blocks:put-many:providers:notify",o)),this.blockAnnouncers.forEach(a=>{a.announce(o,s,t)})});t.onProgress?.(new P("blocks:put-many:blockstore:put-many")),yield*this.child.putMany(i,t)}async get(e,t={}){if(t.offline!==!0&&!await this.child.has(e)){t.onProgress?.(new P("blocks:get:providers:get",e));let n=await Bv(e,this.blockRetrievers,this.hashers[e.multihash.code],{...t,log:this.log});return t.onProgress?.(new P("blocks:get:blockstore:put",e)),await this.child.put(e,n,t),t.onProgress?.(new P("blocks:get:providers:notify",e)),this.blockAnnouncers.forEach(i=>{i.announce(e,n,t)}),n}return t.onProgress?.(new P("blocks:get:blockstore:get",e)),this.child.get(e,t)}async*getMany(e,t={}){t.onProgress?.(new P("blocks:get-many:blockstore:get-many")),yield*this.child.getMany(yd(e,async n=>{if(t.offline!==!0&&!await this.child.has(n)){t.onProgress?.(new P("blocks:get-many:providers:get",n));let i=await Bv(n,this.blockRetrievers,this.hashers[n.multihash.code],{...t,log:this.log});t.onProgress?.(new P("blocks:get-many:blockstore:put",n)),await this.child.put(n,i,t),t.onProgress?.(new P("blocks:get-many:providers:notify",n)),this.blockAnnouncers.forEach(o=>{o.announce(n,i,t)})}}))}async delete(e,t={}){t.onProgress?.(new P("blocks:delete:blockstore:delete",e)),await this.child.delete(e,t)}async*deleteMany(e,t={}){t.onProgress?.(new P("blocks:delete-many:blockstore:delete-many")),yield*this.child.deleteMany(async function*(){for await(let n of e)yield n}(),t)}async has(e,t={}){return this.child.has(e,t)}async*getAll(e={}){e.onProgress?.(new P("blocks:get-all:blockstore:get-many")),yield*this.child.getAll(e)}},xI=(r,e)=>{if(e==null)throw new O(`No hasher configured for multihash code 0x${r.multihash.code.toString(16)}, please configure one. You can look up which hash this is at https://github.com/multiformats/multicodec/blob/master/table.csv`,"ERR_UNKNOWN_HASH_ALG");return async t=>{let n=await e.digest(t);if(!ge(n.digest,r.multihash.digest))throw new O("Hash of downloaded block did not match multihash from passed CID","ERR_HASH_MISMATCH")}};async function Bv(r,e,t,n){let i=xI(r,t),o=new AbortController,s=Mi([o.signal,n.signal]);try{return await Promise.any(e.map(async a=>{try{let c=!1,u=await a.retrieve(r,{...n,signal:s,validateFn:async l=>{await i(l),c=!0}});return c||await i(u),u}catch(c){throw n.log.error("could not retrieve verified block for %c",r,c),c}}))}finally{s.clear()}}var ip=class{blockstore;datastore;pins;logger;routing;dagWalkers;hashers;log;constructor(e){this.logger=e.logger??Kx(),this.log=this.logger.forComponent("helia"),this.hashers=Sv(e.hashers),this.dagWalkers=vv(e.dagWalkers);let t={blockstore:e.blockstore,datastore:e.datastore,hashers:this.hashers,dagWalkers:this.dagWalkers,logger:this.logger,blockBrokers:[],...e.components??{}};t.blockBrokers=e.blockBrokers.map(i=>i(t));let n=new np(t);this.pins=new Gu(e.datastore,n,this.dagWalkers),this.blockstore=new Yu(n,this.pins,{holdGcLock:e.holdGcLock??!0}),this.datastore=e.datastore,this.routing=new Wu(t,{routers:(e.routers??[]).flatMap(i=>{let o=[i];return i[pa]!=null&&o.push(i[pa]),i[da]!=null&&o.push(i[da]),o})})}async start(){await Av(this.datastore),await Qn(this.blockstore,this.datastore,this.routing)}async stop(){await ei(this.blockstore,this.datastore,this.routing)}async gc(e={}){let t=await this.blockstore.lock.writeLock();try{let n=this,i=this.blockstore.unwrap();this.log("gc start"),await Gi(i.deleteMany(async function*(){for await(let{cid:o}of i.getAll())try{if(await n.pins.isPinned(o,e))continue;yield o,e.onProgress?.(new P("helia:gc:deleted",o))}catch(s){n.log.error("Error during gc",s),e.onProgress?.(new P("helia:gc:error",s))}}()))}finally{t()}this.log("gc finished")}};var ys={};$(ys,{abortedError:()=>EI,closeFailedError:()=>wI,deleteFailedError:()=>Iv,getFailedError:()=>bI,hasFailedError:()=>vI,notFoundError:()=>Qa,openFailedError:()=>yI,putFailedError:()=>kv});var _n=Q(ke(),1);function yI(r){return r=r??new Error("Open failed"),(0,_n.default)(r,"ERR_OPEN_FAILED")}function wI(r){return r=r??new Error("Close failed"),(0,_n.default)(r,"ERR_CLOSE_FAILED")}function kv(r){return r=r??new Error("Put failed"),(0,_n.default)(r,"ERR_PUT_FAILED")}function bI(r){return r=r??new Error("Get failed"),(0,_n.default)(r,"ERR_GET_FAILED")}function Iv(r){return r=r??new Error("Delete failed"),(0,_n.default)(r,"ERR_DELETE_FAILED")}function vI(r){return r=r??new Error("Has failed"),(0,_n.default)(r,"ERR_HAS_FAILED")}function Qa(r){return r=r??new Error("Not Found"),(0,_n.default)(r,"ERR_NOT_FOUND")}function EI(r){return r=r??new Error("Aborted"),(0,_n.default)(r,"ERR_ABORTED")}var so=class{has(e,t){return Promise.reject(new Error(".has is not implemented"))}put(e,t,n){return Promise.reject(new Error(".put is not implemented"))}async*putMany(e,t){for await(let{cid:n,block:i}of e)await this.put(n,i,t),yield n}get(e,t){return Promise.reject(new Error(".get is not implemented"))}async*getMany(e,t){for await(let n of e)yield{cid:n,block:await this.get(n,t)}}async delete(e,t){await Promise.reject(new Error(".delete is not implemented"))}async*deleteMany(e,t){for await(let n of e)await this.delete(n,t),yield n}async*getAll(e){throw new Error(".getAll is not implemented")}};var ec=class extends so{data;constructor(){super(),this.data=new Map}put(e,t){return this.data.set(nt.encode(e.multihash.bytes),t),e}get(e){let t=this.data.get(nt.encode(e.multihash.bytes));if(t==null)throw Qa();return t}has(e){return this.data.has(nt.encode(e.multihash.bytes))}async delete(e){this.data.delete(nt.encode(e.multihash.bytes))}async*getAll(){for(let[e,t]of this.data.entries())yield{cid:z.createV1(je,Ot(nt.decode(e))),block:t}}};var Dq=ue("blockstore:core:tiered");var Fq={...ys};var _v=Q(ke(),1);function op(r){return r=r??new Error("Not Found"),(0,_v.default)(r,"ERR_NOT_FOUND")}var Tv="SHARDING";function SI(r){return r[Symbol.asyncIterator]!=null}function BI(r){if(SI(r))return(async()=>{let t=[];for await(let n of r)t.push(n);return t})();let e=[];for(let t of r)e.push(t);return e}var sp=BI;function kI(r){return r[Symbol.asyncIterator]!=null}function II(r,e){return kI(r)?async function*(){yield*(await sp(r)).sort(e)}():function*(){yield*sp(r).sort(e)}()}var ap=II;var Tn=class{put(e,t,n){return Promise.reject(new Error(".put is not implemented"))}get(e,t){return Promise.reject(new Error(".get is not implemented"))}has(e,t){return Promise.reject(new Error(".has is not implemented"))}delete(e,t){return Promise.reject(new Error(".delete is not implemented"))}async*putMany(e,t={}){for await(let{key:n,value:i}of e)await this.put(n,i,t),yield n}async*getMany(e,t={}){for await(let n of e)yield{key:n,value:await this.get(n,t)}}async*deleteMany(e,t={}){for await(let n of e)await this.delete(n,t),yield n}batch(){let e=[],t=[];return{put(n,i){e.push({key:n,value:i})},delete(n){t.push(n)},commit:async n=>{await Gi(this.putMany(e,n)),e=[],await Gi(this.deleteMany(t,n)),t=[]}}}async*_all(e,t){throw new Error("._all is not implemented")}async*_allKeys(e,t){throw new Error("._allKeys is not implemented")}query(e,t){let n=this._all(e,t);if(e.prefix!=null){let i=e.prefix;n=Gt(n,o=>o.key.toString().startsWith(i))}if(Array.isArray(e.filters)&&(n=e.filters.reduce((i,o)=>Gt(i,o),n)),Array.isArray(e.orders)&&(n=e.orders.reduce((i,o)=>ap(i,o),n)),e.offset!=null){let i=0,o=e.offset;n=Gt(n,()=>i++>=o)}return e.limit!=null&&(n=ul(n,e.limit)),n}queryKeys(e,t){let n=this._allKeys(e,t);if(e.prefix!=null){let i=e.prefix;n=Gt(n,o=>o.toString().startsWith(i))}if(Array.isArray(e.filters)&&(n=e.filters.reduce((i,o)=>Gt(i,o),n)),Array.isArray(e.orders)&&(n=e.orders.reduce((i,o)=>ap(i,o),n)),e.offset!=null){let i=e.offset,o=0;n=Gt(n,()=>o++>=i)}return e.limit!=null&&(n=ul(n,e.limit)),n}};var rc=class extends Tn{data;constructor(){super(),this.data=new Map}put(e,t){return this.data.set(e.toString(),t),e}get(e){let t=this.data.get(e.toString());if(t==null)throw op();return t}has(e){return this.data.has(e.toString())}delete(e){this.data.delete(e.toString())}*_all(){for(let[e,t]of this.data.entries())yield{key:new Xe(e),value:t}}*_allKeys(){for(let e of this.data.keys())yield new Xe(e)}};var dK=new Xe(Tv);var SK=ue("datastore:core:tiered");async function Rv(r={}){let e=r.datastore??new rc,t=r.blockstore??new ec,n=new ip({...r,datastore:e,blockstore:t,blockBrokers:r.blockBrokers??[ma()],routers:r.routers??[Ya("https://delegated-ipfs.dev")]});return r.start!==!1&&await n.start(),n}var tm=class{components;constructor(e){this.components=e}async add(e,t={}){let n=av(e),i=await(t.hasher??ae).digest(n),o=z.createV1(Ei,i);return await this.components.blockstore.put(o,n,t),o}async get(e,t={}){let n=await this.components.blockstore.get(e,t);return Ju(n)}};function Uv(r){return new tm(r)}var rm=class{components;constructor(e){this.components=e}async add(e,t={}){let n=lv(e),i=await(t.hasher??ae).digest(n),o=z.createV1(Si,i);return await this.components.blockstore.put(o,n,t),o}async get(e,t={}){let n=await this.components.blockstore.get(e,t);return ep(n)}};function Nv(r){return new rm(r)}var nm=Q(Eu(),1);function Dv(r,e){let t=e.map((n,i)=>({record:wt(n),index:i}));return t.sort((n,i)=>{let o=n.record.sequence,s=i.record.sequence;if(o>s)return-1;if(o<s)return 1;if(n.record.validityType===ot.ValidityType.EOL&&i.record.validityType===ot.ValidityType.EOL){let a=nm.default.fromString(n.record.validity).toDate(),c=nm.default.fromString(i.record.validity).toDate();if(a.getTime()>c.getTime())return-1;if(a.getTime()<c.getTime())return 1}return 0}),t[0].index}var cm={};$(cm,{base58btc:()=>vt,base58flickr:()=>LI});function CI(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function p(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var h=0,x=0,g=0,y=f.length;g!==y&&f[g]===0;)g++,h++;for(var w=(y-g)*l+1>>>0,E=new Uint8Array(w);g!==y;){for(var B=f[g],S=0,b=w-1;(B!==0||S<x)&&b!==-1;b--,S++)B+=256*E[b]>>>0,E[b]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");x=S,g++}for(var v=w-x;v!==w&&E[v]===0;)v++;for(var k=c.repeat(h);v<w;++v)k+=r.charAt(E[v]);return k}function m(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var h=0;if(f[h]!==" "){for(var x=0,g=0;f[h]===c;)x++,h++;for(var y=(f.length-h)*u+1>>>0,w=new Uint8Array(y);f[h];){var E=t[f.charCodeAt(h)];if(E===255)return;for(var B=0,S=y-1;(E!==0||B<g)&&S!==-1;S--,B++)E+=a*w[S]>>>0,w[S]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,h++}if(f[h]!==" "){for(var b=y-g;b!==y&&w[b]===0;)b++;for(var v=new Uint8Array(x+(y-b)),k=x;b!==y;)v[k++]=w[b++];return v}}}function d(f){var h=m(f);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:m,decode:d}}var RI=CI,UI=RI,Lv=UI;var aG=new Uint8Array(0);var Pv=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},Cn=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var Ov=r=>new TextEncoder().encode(r),Fv=r=>new TextDecoder().decode(r);var im=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},om=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Vv(this,e)}},sm=class{constructor(e){this.decoders=e}or(e){return Vv(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Vv=(r,e)=>new sm({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),am=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new im(e,t,n),this.decoder=new om(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ws=({name:r,prefix:e,encode:t,decode:n})=>new am(r,e,t,n),Bi=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Lv(t,e);return ws({prefix:r,name:e,encode:n,decode:o=>Cn(i(o))})},NI=(r,e,t,n)=>{let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*t/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let p=i[r[l]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},DI=(r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,o+=e[i&a>>s];if(s&&(o+=e[i&a<<t-s]),n)for(;o.length*t&7;)o+="=";return o},Ne=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>ws({prefix:e,name:r,encode(i){return DI(i,n,t)},decode(i){return NI(i,n,t,r)}});var vt=Bi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),LI=Bi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var lm={};$(lm,{base32:()=>Hr,base32hex:()=>zI,base32hexpad:()=>MI,base32hexpadupper:()=>$I,base32hexupper:()=>VI,base32pad:()=>OI,base32padupper:()=>FI,base32upper:()=>PI,base32z:()=>jI});var Hr=Ne({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),PI=Ne({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),OI=Ne({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),FI=Ne({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),zI=Ne({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),VI=Ne({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),MI=Ne({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),$I=Ne({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),jI=Ne({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var HI=jv,Mv=128,qI=127,KI=~qI,GI=Math.pow(2,31);function jv(r,e,t){e=e||[],t=t||0;for(var n=t;r>=GI;)e[t++]=r&255|Mv,r/=128;for(;r&KI;)e[t++]=r&255|Mv,r>>>=7;return e[t]=r|0,jv.bytes=t-n+1,e}var WI=um,YI=128,$v=127;function um(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw um.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&$v)<<i:(s&$v)*Math.pow(2,i),i+=7}while(s>=YI);return um.bytes=o-n,t}var XI=Math.pow(2,7),JI=Math.pow(2,14),ZI=Math.pow(2,21),QI=Math.pow(2,28),e_=Math.pow(2,35),t_=Math.pow(2,42),r_=Math.pow(2,49),n_=Math.pow(2,56),i_=Math.pow(2,63),o_=function(r){return r<XI?1:r<JI?2:r<ZI?3:r<QI?4:r<e_?5:r<t_?6:r<r_?7:r<n_?8:r<i_?9:10},s_={encode:HI,decode:WI,encodingLength:o_},a_=s_,nc=a_;var ic=(r,e=0)=>[nc.decode(r,e),nc.decode.bytes],bs=(r,e,t=0)=>(nc.encode(r,e,t),e),vs=r=>nc.encodingLength(r);var ao=(r,e)=>{let t=e.byteLength,n=vs(r),i=n+vs(t),o=new Uint8Array(i+t);return bs(r,o,0),bs(t,o,n),o.set(e,i),new Es(r,t,e,o)},oc=r=>{let e=Cn(r),[t,n]=ic(e),[i,o]=ic(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Es(t,i,s,e)},Hv=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Pv(r.bytes,t.bytes)}},Es=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};var mm={};$(mm,{base10:()=>f_});function c_(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function p(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var h=0,x=0,g=0,y=f.length;g!==y&&f[g]===0;)g++,h++;for(var w=(y-g)*l+1>>>0,E=new Uint8Array(w);g!==y;){for(var B=f[g],S=0,b=w-1;(B!==0||S<x)&&b!==-1;b--,S++)B+=256*E[b]>>>0,E[b]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");x=S,g++}for(var v=w-x;v!==w&&E[v]===0;)v++;for(var k=c.repeat(h);v<w;++v)k+=r.charAt(E[v]);return k}function m(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var h=0;if(f[h]!==" "){for(var x=0,g=0;f[h]===c;)x++,h++;for(var y=(f.length-h)*u+1>>>0,w=new Uint8Array(y);f[h];){var E=t[f.charCodeAt(h)];if(E===255)return;for(var B=0,S=y-1;(E!==0||B<g)&&S!==-1;S--,B++)E+=a*w[S]>>>0,w[S]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,h++}if(f[h]!==" "){for(var b=y-g;b!==y&&w[b]===0;)b++;for(var v=new Uint8Array(x+(y-b)),k=x;b!==y;)v[k++]=w[b++];return v}}}function d(f){var h=m(f);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:m,decode:d}}var l_=c_,u_=l_,qv=u_;var xG=new Uint8Array(0);var Kv=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},Rn=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var Gv=r=>new TextEncoder().encode(r),Wv=r=>new TextDecoder().decode(r);var pm=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},dm=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Xv(this,e)}},fm=class{constructor(e){this.decoders=e}or(e){return Xv(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Xv=(r,e)=>new fm({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),hm=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new pm(e,t,n),this.decoder=new dm(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},As=({name:r,prefix:e,encode:t,decode:n})=>new hm(r,e,t,n),ki=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=qv(t,e);return As({prefix:r,name:e,encode:n,decode:o=>Rn(i(o))})},p_=(r,e,t,n)=>{let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*t/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let p=i[r[l]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},d_=(r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,o+=e[i&a>>s];if(s&&(o+=e[i&a<<t-s]),n)for(;o.length*t&7;)o+="=";return o},De=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>As({prefix:e,name:r,encode(i){return d_(i,n,t)},decode(i){return p_(i,n,t,r)}});var f_=ki({prefix:"9",name:"base10",alphabet:"0123456789"});var gm={};$(gm,{base16:()=>h_,base16upper:()=>m_});var h_=De({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),m_=De({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var xm={};$(xm,{base2:()=>g_});var g_=De({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ym={};$(ym,{base256emoji:()=>v_});var Jv=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),x_=Jv.reduce((r,e,t)=>(r[t]=e,r),[]),y_=Jv.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function w_(r){return r.reduce((e,t)=>(e+=x_[t],e),"")}function b_(r){let e=[];for(let t of r){let n=y_[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var v_=As({prefix:"\u{1F680}",name:"base256emoji",encode:w_,decode:b_});var wm={};$(wm,{base32:()=>Ss,base32hex:()=>B_,base32hexpad:()=>I_,base32hexpadupper:()=>__,base32hexupper:()=>k_,base32pad:()=>A_,base32padupper:()=>S_,base32upper:()=>E_,base32z:()=>T_});var Ss=De({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),E_=De({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),A_=De({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),S_=De({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),B_=De({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),k_=De({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),I_=De({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),__=De({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),T_=De({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var bm={};$(bm,{base36:()=>C_,base36upper:()=>R_});var C_=ki({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),R_=ki({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var vm={};$(vm,{base58btc:()=>qr,base58flickr:()=>U_});var qr=ki({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),U_=ki({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Em={};$(Em,{base64:()=>N_,base64pad:()=>D_,base64url:()=>L_,base64urlpad:()=>P_});var N_=De({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),D_=De({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),L_=De({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),P_=De({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Am={};$(Am,{base8:()=>O_});var O_=De({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Sm={};$(Sm,{identity:()=>F_});var F_=As({prefix:"\0",name:"identity",encode:r=>Wv(r),decode:r=>Gv(r)});var UG=new TextEncoder,NG=new TextDecoder;var km={};$(km,{identity:()=>aT});var M_=e2,Zv=128,$_=127,j_=~$_,H_=Math.pow(2,31);function e2(r,e,t){e=e||[],t=t||0;for(var n=t;r>=H_;)e[t++]=r&255|Zv,r/=128;for(;r&j_;)e[t++]=r&255|Zv,r>>>=7;return e[t]=r|0,e2.bytes=t-n+1,e}var q_=Bm,K_=128,Qv=127;function Bm(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw Bm.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&Qv)<<i:(s&Qv)*Math.pow(2,i),i+=7}while(s>=K_);return Bm.bytes=o-n,t}var G_=Math.pow(2,7),W_=Math.pow(2,14),Y_=Math.pow(2,21),X_=Math.pow(2,28),J_=Math.pow(2,35),Z_=Math.pow(2,42),Q_=Math.pow(2,49),eT=Math.pow(2,56),tT=Math.pow(2,63),rT=function(r){return r<G_?1:r<W_?2:r<Y_?3:r<X_?4:r<J_?5:r<Z_?6:r<Q_?7:r<eT?8:r<tT?9:10},nT={encode:M_,decode:q_,encodingLength:rT},iT=nT,sc=iT;var ac=(r,e=0)=>[sc.decode(r,e),sc.decode.bytes],Bs=(r,e,t=0)=>(sc.encode(r,e,t),e),ks=r=>sc.encodingLength(r);var lo=(r,e)=>{let t=e.byteLength,n=ks(r),i=n+ks(t),o=new Uint8Array(i+t);return Bs(r,o,0),Bs(t,o,n),o.set(e,i),new Is(r,t,e,o)},t2=r=>{let e=Rn(r),[t,n]=ac(e),[i,o]=ac(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Is(t,i,s,e)},r2=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Kv(r.bytes,t.bytes)}},Is=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};var n2=0,oT="identity",i2=Rn,sT=r=>lo(n2,i2(r)),aT={code:n2,name:oT,encode:i2,digest:sT};var Tm={};$(Tm,{sha256:()=>cT,sha512:()=>lT});var _m=({name:r,code:e,encode:t})=>new Im(r,e,t),Im=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?lo(this.code,t):t.then(n=>lo(this.code,n))}else throw Error("Unknown type, must be binary type")}};var s2=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),cT=_m({name:"sha2-256",code:18,encode:s2("SHA-256")}),lT=_m({name:"sha2-512",code:19,encode:s2("SHA-512")});var a2=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return pT(t,Cm(r),e||qr.encoder);default:return dT(t,Cm(r),e||Ss.encoder)}};var c2=new WeakMap,Cm=r=>{let e=c2.get(r);if(e==null){let t=new Map;return c2.set(r,t),t}return e},up=class r{constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==lc)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==fT)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=lo(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&r2(e.multihash,n.multihash)}toString(e){return a2(this,e)}toJSON(){return{"/":a2(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:o,bytes:s}=t;return new r(n,i,o,s||l2(n,i,o.bytes))}else if(t[hT]===!0){let{version:n,multihash:i,code:o}=t,s=t2(i);return r.create(n,o,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==lc)throw new Error(`Version 0 CID must use dag-pb (code: ${lc}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=l2(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,lc,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=Rn(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new Is(t.multihashCode,t.digestSize,o,i);return[t.version===0?r.createV0(s):r.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[p,m]=ac(e.subarray(t));return t+=m,p},i=n(),o=lc;if(i===18?(i=0,t=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,a=n(),c=n(),u=t+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,i]=uT(e,t),o=r.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Cm(o).set(n,e),o}},uT=(r,e)=>{switch(r[0]){case"Q":{let t=e||qr;return[qr.prefix,t.decode(`${qr.prefix}${r}`)]}case qr.prefix:{let t=e||qr;return[qr.prefix,t.decode(r)]}case Ss.prefix:{let t=e||Ss;return[Ss.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},pT=(r,e,t)=>{let{prefix:n}=t;if(n!==qr.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let o=t.encode(r).slice(1);return e.set(n,o),o}else return i},dT=(r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let o=t.encode(r);return e.set(n,o),o}else return i},lc=112,fT=18,l2=(r,e,t)=>{let n=ks(r),i=n+ks(e),o=new Uint8Array(i+t.byteLength);return Bs(r,o,0),Bs(e,o,n),o.set(t,i),o},hT=Symbol.for("@ipld/js-cid/CID");var Rm={...Sm,...xm,...Am,...mm,...gm,...wm,...bm,...vm,...Em,...ym},YG={...Tm,...km};function _s(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function pp(r=0){return globalThis.Buffer?.allocUnsafe!=null?_s(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function p2(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var u2=p2("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Um=p2("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=pp(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),mT={utf8:u2,"utf-8":u2,hex:Rm.base16,latin1:Um,ascii:Um,binary:Um,...Rm},dp=mT;function Et(r,e="utf8"){let t=dp[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var d2=$o,gT=jo,Nm=function(r){let e=0;if(r=r.toString().trim(),d2(r)){let t=new Uint8Array(e+4);return r.split(/\./g).forEach(n=>{t[e++]=parseInt(n,10)&255}),t}if(gT(r)){let t=r.split(":",8),n;for(n=0;n<t.length;n++){let o=d2(t[n]),s;o&&(s=Nm(t[n]),t[n]=Et(s.slice(0,2),"base16")),s!=null&&++n<8&&t.splice(n,0,Et(s.slice(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(n=0;n<t.length&&t[n]!=="";n++);let o=[n,1];for(n=9-t.length;n>0;n--)o.push("0");t.splice.apply(t,o)}let i=new Uint8Array(e+16);for(n=0;n<t.length;n++){let o=parseInt(t[n],16);i[e++]=o>>8&255,i[e++]=o&255}return i}throw new Error("invalid ip address")},f2=function(r,e=0,t){e=~~e,t=t??r.length-e;let n=new DataView(r.buffer);if(t===4){let i=[];for(let o=0;o<t;o++)i.push(r[e+o]);return i.join(".")}if(t===16){let i=[];for(let o=0;o<t;o+=2)i.push(n.getUint16(e+o).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var uc={},Dm={},yT=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc"],[281,0,"webrtc-w3c"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,-1,"memory"]];yT.forEach(r=>{let e=wT(...r);Dm[e.code]=e,uc[e.name]=e});function wT(r,e,t,n,i){return{code:r,size:e,name:t,resolvable:!!n,path:!!i}}function _e(r){if(typeof r=="number"){if(Dm[r]!=null)return Dm[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(uc[r]!=null)return uc[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var h2=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return vT(t,Lm(r),e||vt.encoder);default:return ET(t,Lm(r),e||Hr.encoder)}};var m2=new WeakMap,Lm=r=>{let e=m2.get(r);if(e==null){let t=new Map;return m2.set(r,t),t}return e},ur=class r{constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==pc)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==AT)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=ao(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&Hv(e.multihash,n.multihash)}toString(e){return h2(this,e)}toJSON(){return{"/":h2(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:o,bytes:s}=t;return new r(n,i,o,s||g2(n,i,o.bytes))}else if(t[ST]===!0){let{version:n,multihash:i,code:o}=t,s=oc(i);return r.create(n,o,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==pc)throw new Error(`Version 0 CID must use dag-pb (code: ${pc}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=g2(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,pc,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=Cn(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new Es(t.multihashCode,t.digestSize,o,i);return[t.version===0?r.createV0(s):r.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[p,m]=ic(e.subarray(t));return t+=m,p},i=n(),o=pc;if(i===18?(i=0,t=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,a=n(),c=n(),u=t+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,i]=bT(e,t),o=r.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Lm(o).set(n,e),o}},bT=(r,e)=>{switch(r[0]){case"Q":{let t=e||vt;return[vt.prefix,t.decode(`${vt.prefix}${r}`)]}case vt.prefix:{let t=e||vt;return[vt.prefix,t.decode(r)]}case Hr.prefix:{let t=e||Hr;return[Hr.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},vT=(r,e,t)=>{let{prefix:n}=t;if(n!==vt.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let o=t.encode(r).slice(1);return e.set(n,o),o}else return i},ET=(r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let o=t.encode(r);return e.set(n,o),o}else return i},pc=112,AT=18,g2=(r,e,t)=>{let n=vs(r),i=n+vs(e),o=new Uint8Array(i+t.byteLength);return bs(r,o,0),bs(e,o,n),o.set(t,i),o},ST=Symbol.for("@ipld/js-cid/CID");var Pm={};$(Pm,{identity:()=>BT});var BT=ws({prefix:"\0",name:"identity",encode:r=>Fv(r),decode:r=>Ov(r)});var Om={};$(Om,{base2:()=>kT});var kT=Ne({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Fm={};$(Fm,{base8:()=>IT});var IT=Ne({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var zm={};$(zm,{base10:()=>_T});var _T=Bi({prefix:"9",name:"base10",alphabet:"0123456789"});var Vm={};$(Vm,{base16:()=>TT,base16upper:()=>CT});var TT=Ne({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),CT=Ne({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Mm={};$(Mm,{base36:()=>RT,base36upper:()=>UT});var RT=Bi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),UT=Bi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var $m={};$($m,{base64:()=>NT,base64pad:()=>DT,base64url:()=>LT,base64urlpad:()=>PT});var NT=Ne({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),DT=Ne({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),LT=Ne({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),PT=Ne({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var jm={};$(jm,{base256emoji:()=>MT});var x2=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),OT=x2.reduce((r,e,t)=>(r[t]=e,r),[]),FT=x2.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function zT(r){return r.reduce((e,t)=>(e+=OT[t],e),"")}function VT(r){let e=[];for(let t of r){let n=FT[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var MT=ws({prefix:"\u{1F680}",name:"base256emoji",encode:zT,decode:VT});var Km={};$(Km,{sha256:()=>$T,sha512:()=>jT});var qm=({name:r,code:e,encode:t})=>new Hm(r,e,t),Hm=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?ao(this.code,t):t.then(n=>ao(this.code,n))}else throw Error("Unknown type, must be binary type")}};var w2=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),$T=qm({name:"sha2-256",code:18,encode:w2("SHA-256")}),jT=qm({name:"sha2-512",code:19,encode:w2("SHA-512")});var Gm={};$(Gm,{identity:()=>KT});var b2=0,HT="identity",v2=Cn,qT=r=>ao(b2,v2(r)),KT={code:b2,name:HT,encode:v2,digest:qT};var kW=new TextEncoder,IW=new TextDecoder;var E2={...Pm,...Om,...Fm,...zm,...Vm,...lm,...Mm,...cm,...$m,...jm},UW={...Km,...Gm};var Kr=Q(rl(),1);function Wm(r,e="utf8"){let t=dp[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?_s(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}function Un(r,e){e==null&&(e=r.reduce((i,o)=>i+o.length,0));let t=pp(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return _s(t)}function I2(r,e){switch(_e(r).code){case 4:case 41:return XT(e);case 42:return B2(e);case 6:case 273:case 33:case 132:return T2(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return B2(e);case 421:return eC(e);case 444:return k2(e);case 445:return k2(e);case 466:return QT(e);default:return Et(e,"base16")}}function _2(r,e){switch(_e(r).code){case 4:return A2(e);case 41:return A2(e);case 42:return S2(e);case 6:case 273:case 33:case 132:return Xm(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return S2(e);case 421:return JT(e);case 444:return tC(e);case 445:return rC(e);case 466:return ZT(e);default:return Wm(e,"base16")}}var Ym=Object.values(E2).map(r=>r.decoder),YT=function(){let r=Ym[0].or(Ym[1]);return Ym.slice(2).forEach(e=>r=r.or(e)),r}();function A2(r){if(!ir(r))throw new Error("invalid ip address");return Nm(r)}function XT(r){let e=f2(r,0,r.length);if(e==null)throw new Error("ipBuff is required");if(!ir(e))throw new Error("invalid ip address");return e}function Xm(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r),new Uint8Array(e)}function T2(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function S2(r){let e=Wm(r),t=Uint8Array.from(Kr.default.encode(e.length));return Un([t,e],t.length+e.length)}function B2(r){let e=Kr.default.decode(r);if(r=r.slice(Kr.default.decode.bytes),r.length!==e)throw new Error("inconsistent lengths");return Et(r)}function JT(r){let e;r[0]==="Q"||r[0]==="1"?e=oc(vt.decode(`z${r}`)).bytes:e=ur.parse(r).multihash.bytes;let t=Uint8Array.from(Kr.default.encode(e.length));return Un([t,e],t.length+e.length)}function ZT(r){let e=YT.decode(r),t=Uint8Array.from(Kr.default.encode(e.length));return Un([t,e],t.length+e.length)}function QT(r){let e=Kr.default.decode(r),t=r.slice(Kr.default.decode.bytes);if(t.length!==e)throw new Error("inconsistent lengths");return"u"+Et(t,"base64url")}function eC(r){let e=Kr.default.decode(r),t=r.slice(Kr.default.decode.bytes);if(t.length!==e)throw new Error("inconsistent lengths");return Et(t,"base58btc")}function tC(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=Hr.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Xm(n);return Un([t,i],t.length+i.length)}function rC(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=Hr.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Xm(n);return Un([t,i],t.length+i.length)}function k2(r){let e=r.slice(0,r.length-2),t=r.slice(r.length-2),n=Et(e,"base32"),i=T2(t);return`${n}:${i}`}var Ts=Q(rl(),1);function nC(r){let e=[],t=r.split("/").slice(1);if(t.length===1&&t[0]==="")return[];for(let n=0;n<t.length;n++){let i=t[n],o=_e(i);if(o.size===0){e.push([i]);continue}if(n++,n>=t.length)throw R2("invalid address: "+r);if(o.path===!0){e.push([i,t0(t.slice(n).join("/"))]);break}e.push([i,t[n]])}return e}function iC(r){let e=[];return r.map(t=>{let n=mp(t);return e.push(n.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),t0(e.join("/"))}function oC(r){return r.map(e=>{Array.isArray(e)||(e=[e]);let t=mp(e);return e.length>1?[t.code,_2(t.code,e[1])]:[t.code]})}function Jm(r){return r.map(e=>{let t=mp(e);return e[1]!=null?[t.code,I2(t.code,e[1])]:[t.code]})}function Zm(r){return hp(Un(r.map(e=>{let t=mp(e),n=Uint8Array.from(Ts.default.encode(t.code));return e.length>1&&e[1]!=null&&(n=Un([n,e[1]])),n})))}function Qm(r,e){return r.size>0?r.size/8:r.size===0?0:Ts.default.decode(e)+(Ts.default.decode.bytes??0)}function fp(r){let e=[],t=0;for(;t<r.length;){let n=Ts.default.decode(r,t),i=Ts.default.decode.bytes??0,o=_e(n),s=Qm(o,r.slice(t+i));if(s===0){e.push([n]),t+=i;continue}let a=r.slice(t+i,t+i+s);if(t+=s+i,t>r.length)throw R2("Invalid address Uint8Array: "+Et(r,"base16"));e.push([n,a])}return e}function e0(r){let e=fp(r),t=Jm(e);return iC(t)}function sC(r){r=t0(r);let e=nC(r),t=oC(e);return Zm(t)}function C2(r){return sC(r)}function hp(r){let e=aC(r);if(e!=null)throw e;return Uint8Array.from(r)}function aC(r){try{fp(r)}catch(e){return e}}function t0(r){return"/"+r.trim().split("/").filter(e=>e).join("/")}function R2(r){return new Error("Error parsing address: "+r)}function mp(r){return _e(r[0])}var n0=Q(rl(),1);var L2=Q(ke(),1);function U2(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}var Cs=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},r0=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},dc,fc,hc,N2,lC=Symbol.for("nodejs.util.inspect.custom"),uC=[_e("dns").code,_e("dns4").code,_e("dns6").code,_e("dnsaddr").code],pC=new Map,P2=Symbol.for("@multiformats/js-multiaddr/multiaddr");function dC(r){return!!r?.[P2]}var D2=class r{constructor(e){if(dc.set(this,void 0),fc.set(this,void 0),hc.set(this,void 0),this[N2]=!0,e==null&&(e=""),e instanceof Uint8Array)this.bytes=hp(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);this.bytes=C2(e)}else if(dC(e))this.bytes=hp(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return Cs(this,dc,"f")==null&&r0(this,dc,e0(this.bytes),"f"),Cs(this,dc,"f")}toJSON(){return this.toString()}toOptions(){let e,t,n,i,o="",s=_e("tcp"),a=_e("udp"),c=_e("ip4"),u=_e("ip6"),l=_e("dns6"),p=_e("ip6zone");for(let[d,f]of this.stringTuples())d===p.code&&(o=`%${f??""}`),uC.includes(d)&&(t=s.name,i=443,n=`${f??""}${o}`,e=d===l.code?6:4),(d===s.code||d===a.code)&&(t=_e(d).name,i=parseInt(f??"")),(d===c.code||d===u.code)&&(t=_e(d).name,n=`${f??""}${o}`,e=d===u.code?6:4);if(e==null||t==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:t,port:i}}protos(){return this.protoCodes().map(e=>Object.assign({},_e(e)))}protoCodes(){let e=[],t=this.bytes,n=0;for(;n<t.length;){let i=n0.default.decode(t,n),o=n0.default.decode.bytes??0,s=_e(i),a=Qm(s,t.slice(n+o));n+=a+o,e.push(i)}return e}protoNames(){return this.protos().map(e=>e.name)}tuples(){return Cs(this,fc,"f")==null&&r0(this,fc,fp(this.bytes),"f"),Cs(this,fc,"f")}stringTuples(){return Cs(this,hc,"f")==null&&r0(this,hc,Jm(this.tuples()),"f"),Cs(this,hc,"f")}encapsulate(e){return e=new r(e),new r(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),n=this.toString(),i=n.lastIndexOf(t);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new r(n.slice(0,i))}decapsulateCode(e){let t=this.tuples();for(let n=t.length-1;n>=0;n--)if(t[n][0]===e)return new r(Zm(t.slice(0,n)));return this}getPeerId(){try{let t=this.stringTuples().filter(n=>n[0]===uc.ipfs.code).pop();if(t?.[1]!=null){let n=t[1];return n[0]==="Q"||n[0]==="1"?Et(vt.decode(`z${n}`),"base58btc"):Et(ur.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){let e=null;try{e=this.stringTuples().filter(t=>_e(t[0]).path===!0)[0][1],e==null&&(e=null)}catch{e=null}return e}equals(e){return U2(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(o=>o.resolvable);if(t==null)return[this];let n=pC.get(t.name);if(n==null)throw(0,L2.default)(new Error(`no available resolver for ${t.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(o=>new r(o))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let t=(e??this).protos();return!(t.length!==2||t[0].code!==4&&t[0].code!==41||t[1].code!==6&&t[1].code!==273)}[(dc=new WeakMap,fc=new WeakMap,hc=new WeakMap,N2=P2,lC)](){return`Multiaddr(${e0(this.bytes)})`}};var c0={};$(c0,{base58btc:()=>Ut,base58flickr:()=>yC});var sY=new Uint8Array(0);function O2(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function Nn(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function F2(r){return new TextEncoder().encode(r)}function z2(r){return new TextDecoder().decode(r)}function fC(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function p(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var h=0,x=0,g=0,y=f.length;g!==y&&f[g]===0;)g++,h++;for(var w=(y-g)*l+1>>>0,E=new Uint8Array(w);g!==y;){for(var B=f[g],S=0,b=w-1;(B!==0||S<x)&&b!==-1;b--,S++)B+=256*E[b]>>>0,E[b]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");x=S,g++}for(var v=w-x;v!==w&&E[v]===0;)v++;for(var k=c.repeat(h);v<w;++v)k+=r.charAt(E[v]);return k}function m(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var h=0;if(f[h]!==" "){for(var x=0,g=0;f[h]===c;)x++,h++;for(var y=(f.length-h)*u+1>>>0,w=new Uint8Array(y);f[h];){var E=t[f.charCodeAt(h)];if(E===255)return;for(var B=0,S=y-1;(E!==0||B<g)&&S!==-1;S--,B++)E+=a*w[S]>>>0,w[S]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,h++}if(f[h]!==" "){for(var b=y-g;b!==y&&w[b]===0;)b++;for(var v=new Uint8Array(x+(y-b)),k=x;b!==y;)v[k++]=w[b++];return v}}}function d(f){var h=m(f);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:m,decode:d}}var hC=fC,mC=hC,M2=mC;var i0=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},o0=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return $2(this,e)}},s0=class{decoders;constructor(e){this.decoders=e}or(e){return $2(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function $2(r,e){return new s0({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var a0=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new i0(e,t,n),this.decoder=new o0(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Rs({name:r,prefix:e,encode:t,decode:n}){return new a0(r,e,t,n)}function Ii({name:r,prefix:e,alphabet:t}){let{encode:n,decode:i}=M2(t,r);return Rs({prefix:e,name:r,encode:n,decode:o=>Nn(i(o))})}function gC(r,e,t,n){let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*t/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let p=i[r[l]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s}function xC(r,e,t){let n=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,o+=e[i&a>>s];if(s!==0&&(o+=e[i&a<<t-s]),n)for(;o.length*t&7;)o+="=";return o}function Le({name:r,prefix:e,bitsPerChar:t,alphabet:n}){return Rs({prefix:e,name:r,encode(i){return xC(i,n,t)},decode(i){return gC(i,n,t,r)}})}var Ut=Ii({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),yC=Ii({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var l0={};$(l0,{base32:()=>Dn,base32hex:()=>EC,base32hexpad:()=>SC,base32hexpadupper:()=>BC,base32hexupper:()=>AC,base32pad:()=>bC,base32padupper:()=>vC,base32upper:()=>wC,base32z:()=>kC});var Dn=Le({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),wC=Le({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),bC=Le({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),vC=Le({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),EC=Le({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),AC=Le({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),SC=Le({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),BC=Le({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),kC=Le({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var IC=q2,j2=128,_C=127,TC=~_C,CC=Math.pow(2,31);function q2(r,e,t){e=e||[],t=t||0;for(var n=t;r>=CC;)e[t++]=r&255|j2,r/=128;for(;r&TC;)e[t++]=r&255|j2,r>>>=7;return e[t]=r|0,q2.bytes=t-n+1,e}var RC=u0,UC=128,H2=127;function u0(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw u0.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&H2)<<i:(s&H2)*Math.pow(2,i),i+=7}while(s>=UC);return u0.bytes=o-n,t}var NC=Math.pow(2,7),DC=Math.pow(2,14),LC=Math.pow(2,21),PC=Math.pow(2,28),OC=Math.pow(2,35),FC=Math.pow(2,42),zC=Math.pow(2,49),VC=Math.pow(2,56),MC=Math.pow(2,63),$C=function(r){return r<NC?1:r<DC?2:r<LC?3:r<PC?4:r<OC?5:r<FC?6:r<zC?7:r<VC?8:r<MC?9:10},jC={encode:IC,decode:RC,encodingLength:$C},HC=jC,mc=HC;function gc(r,e=0){return[mc.decode(r,e),mc.decode.bytes]}function Us(r,e,t=0){return mc.encode(r,e,t),e}function Ns(r){return mc.encodingLength(r)}function uo(r,e){let t=e.byteLength,n=Ns(r),i=n+Ns(t),o=new Uint8Array(i+t);return Us(r,o,0),Us(t,o,n),o.set(e,i),new Ds(r,t,e,o)}function xp(r){let e=Nn(r),[t,n]=gc(e),[i,o]=gc(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Ds(t,i,s,e)}function K2(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&O2(r.bytes,t.bytes)}}var Ds=class{code;size;digest;bytes;constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};function G2(r,e){let{bytes:t,version:n}=r;switch(n){case 0:return KC(t,p0(r),e??Ut.encoder);default:return GC(t,p0(r),e??Dn.encoder)}}var W2=new WeakMap;function p0(r){let e=W2.get(r);if(e==null){let t=new Map;return W2.set(r,t),t}return e}var _i=class r{code;version;multihash;bytes;"/";constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==xc)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==WC)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=uo(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&&K2(e.multihash,n.multihash)}toString(e){return G2(this,e)}toJSON(){return{"/":G2(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:o,bytes:s}=t;return new r(n,i,o,s??Y2(n,i,o.bytes))}else if(t[YC]===!0){let{version:n,multihash:i,code:o}=t,s=xp(i);return r.create(n,o,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==xc)throw new Error(`Version 0 CID must use dag-pb (code: ${xc}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=Y2(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,xc,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=Nn(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new Ds(t.multihashCode,t.digestSize,o,i);return[t.version===0?r.createV0(s):r.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[p,m]=gc(e.subarray(t));return t+=m,p},i=n(),o=xc;if(i===18?(i=0,t=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,a=n(),c=n(),u=t+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,i]=qC(e,t),o=r.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return p0(o).set(n,e),o}};function qC(r,e){switch(r[0]){case"Q":{let t=e??Ut;return[Ut.prefix,t.decode(`${Ut.prefix}${r}`)]}case Ut.prefix:{let t=e??Ut;return[Ut.prefix,t.decode(r)]}case Dn.prefix:{let t=e??Dn;return[Dn.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}}function KC(r,e,t){let{prefix:n}=t;if(n!==Ut.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let o=t.encode(r).slice(1);return e.set(n,o),o}else return i}function GC(r,e,t){let{prefix:n}=t,i=e.get(n);if(i==null){let o=t.encode(r);return e.set(n,o),o}else return i}var xc=112,WC=18;function Y2(r,e,t){let n=Ns(r),i=n+Ns(e),o=new Uint8Array(i+t.byteLength);return Us(r,o,0),Us(e,o,n),o.set(t,i),o}var YC=Symbol.for("@ipld/js-cid/CID");function X2(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}var d0={};$(d0,{base10:()=>XC});var XC=Ii({prefix:"9",name:"base10",alphabet:"0123456789"});var f0={};$(f0,{base16:()=>JC,base16upper:()=>ZC});var JC=Le({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ZC=Le({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var h0={};$(h0,{base2:()=>QC});var QC=Le({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var m0={};$(m0,{base256emoji:()=>iR});var J2=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),eR=J2.reduce((r,e,t)=>(r[t]=e,r),[]),tR=J2.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function rR(r){return r.reduce((e,t)=>(e+=eR[t],e),"")}function nR(r){let e=[];for(let t of r){let n=tR[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var iR=Rs({prefix:"\u{1F680}",name:"base256emoji",encode:rR,decode:nR});var g0={};$(g0,{base36:()=>oR,base36upper:()=>sR});var oR=Ii({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),sR=Ii({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var x0={};$(x0,{base64:()=>aR,base64pad:()=>cR,base64url:()=>lR,base64urlpad:()=>uR});var aR=Le({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),cR=Le({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),lR=Le({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),uR=Le({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var y0={};$(y0,{base8:()=>pR});var pR=Le({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var w0={};$(w0,{identity:()=>dR});var dR=Rs({prefix:"\0",name:"identity",encode:r=>z2(r),decode:r=>F2(r)});var RY=new TextEncoder,UY=new TextDecoder;var b0={};$(b0,{identity:()=>xR});var Z2=0,mR="identity",Q2=Nn;function gR(r){return uo(Z2,Q2(r))}var xR={code:Z2,name:mR,encode:Q2,digest:gR};var A0={};$(A0,{sha256:()=>yR,sha512:()=>wR});function E0({name:r,code:e,encode:t}){return new v0(r,e,t)}var v0=class{name;code;encode;constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?uo(this.code,t):t.then(n=>uo(this.code,n))}else throw Error("Unknown type, must be binary type")}};function tE(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var yR=E0({name:"sha2-256",code:18,encode:tE("SHA-256")}),wR=E0({name:"sha2-512",code:19,encode:tE("SHA-512")});var yc={...w0,...h0,...y0,...d0,...f0,...l0,...g0,...c0,...x0,...m0},qY={...A0,...b0};function po(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function yp(r=0){return globalThis.Buffer?.allocUnsafe!=null?po(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function nE(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var rE=nE("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),S0=nE("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=yp(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),bR={utf8:rE,"utf-8":rE,hex:yc.base16,latin1:S0,ascii:S0,binary:S0,...yc},wp=bR;function Nt(r,e="utf8"){let t=wp[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}function Ln(r,e){if(globalThis.Buffer!=null)return po(globalThis.Buffer.concat(r,e));e==null&&(e=r.reduce((i,o)=>i+o.length,0));let t=yp(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return po(t)}function B0(r,e="utf8"){let t=wp[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?po(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var iE=$o,vR=jo,k0=function(r){let e=0;if(r=r.toString().trim(),iE(r)){let t=new Uint8Array(e+4);return r.split(/\./g).forEach(n=>{t[e++]=parseInt(n,10)&255}),t}if(vR(r)){let t=r.split(":",8),n;for(n=0;n<t.length;n++){let o=iE(t[n]),s;o&&(s=k0(t[n]),t[n]=Nt(s.slice(0,2),"base16")),s!=null&&++n<8&&t.splice(n,0,Nt(s.slice(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(n=0;n<t.length&&t[n]!=="";n++);let o=[n,1];for(n=9-t.length;n>0;n--)o.push("0");t.splice.apply(t,o)}let i=new Uint8Array(e+16);for(n=0;n<t.length;n++){let o=parseInt(t[n],16);i[e++]=o>>8&255,i[e++]=o&255}return i}throw new Error("invalid ip address")},oE=function(r,e=0,t){e=~~e,t=t??r.length-e;let n=new DataView(r.buffer);if(t===4){let i=[];for(let o=0;o<t;o++)i.push(r[e+o]);return i.join(".")}if(t===16){let i=[];for(let o=0;o<t;o+=2)i.push(n.getUint16(e+o).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Ps={},I0={},AR=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,-1,"memory"]];AR.forEach(r=>{let e=SR(...r);I0[e.code]=e,Ps[e.name]=e});function SR(r,e,t,n,i){return{code:r,size:e,name:t,resolvable:!!n,path:!!i}}function Ee(r){if(typeof r=="number"){if(I0[r]!=null)return I0[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Ps[r]!=null)return Ps[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var bX=Ee("ip4"),vX=Ee("ip6"),EX=Ee("ipcidr");function T0(r,e){switch(Ee(r).code){case 4:case 41:return kR(e);case 42:return cE(e);case 6:case 273:case 33:case 132:return uE(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return cE(e);case 421:return CR(e);case 444:return lE(e);case 445:return lE(e);case 466:return TR(e);default:return Nt(e,"base16")}}function C0(r,e){switch(Ee(r).code){case 4:return sE(e);case 41:return sE(e);case 42:return aE(e);case 6:case 273:case 33:case 132:return R0(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return aE(e);case 421:return IR(e);case 444:return RR(e);case 445:return UR(e);case 466:return _R(e);default:return B0(e,"base16")}}var _0=Object.values(yc).map(r=>r.decoder),BR=function(){let r=_0[0].or(_0[1]);return _0.slice(2).forEach(e=>r=r.or(e)),r}();function sE(r){if(!ir(r))throw new Error("invalid ip address");return k0(r)}function kR(r){let e=oE(r,0,r.length);if(e==null)throw new Error("ipBuff is required");if(!ir(e))throw new Error("invalid ip address");return e}function R0(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r),new Uint8Array(e)}function uE(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function aE(r){let e=B0(r),t=Uint8Array.from(Qt(e.length));return Ln([t,e],t.length+e.length)}function cE(r){let e=kt(r);if(r=r.slice(Fe(e)),r.length!==e)throw new Error("inconsistent lengths");return Nt(r)}function IR(r){let e;r[0]==="Q"||r[0]==="1"?e=xp(Ut.decode(`z${r}`)).bytes:e=_i.parse(r).multihash.bytes;let t=Uint8Array.from(Qt(e.length));return Ln([t,e],t.length+e.length)}function _R(r){let e=BR.decode(r),t=Uint8Array.from(Qt(e.length));return Ln([t,e],t.length+e.length)}function TR(r){let e=kt(r),t=r.slice(Fe(e));if(t.length!==e)throw new Error("inconsistent lengths");return"u"+Nt(t,"base64url")}function CR(r){let e=kt(r),t=r.slice(Fe(e));if(t.length!==e)throw new Error("inconsistent lengths");return Nt(t,"base58btc")}function RR(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=Dn.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=R0(n);return Ln([t,i],t.length+i.length)}function UR(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=Dn.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=R0(n);return Ln([t,i],t.length+i.length)}function lE(r){let e=r.slice(0,r.length-2),t=r.slice(r.length-2),n=Nt(e,"base32"),i=uE(t);return`${n}:${i}`}function pE(r){r=U0(r);let e=[],t=[],n=null,i=r.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let o=0;o<i.length;o++){let s=i[o],a=Ee(s);if(a.size===0){e.push([a.code]),t.push([a.code]);continue}if(o++,o>=i.length)throw fE("invalid address: "+r);if(a.path===!0){n=U0(i.slice(o).join("/")),e.push([a.code,C0(a.code,n)]),t.push([a.code,n]);break}let c=C0(a.code,i[o]);e.push([a.code,c]),t.push([a.code,T0(a.code,c)])}return{string:dE(t),bytes:D0(e),tuples:e,stringTuples:t,path:n}}function N0(r){let e=[],t=[],n=null,i=0;for(;i<r.length;){let o=kt(r,i),s=Fe(o),a=Ee(o),c=NR(a,r.slice(i+s));if(c===0){e.push([o]),t.push([o]),i+=s;continue}let u=r.slice(i+s,i+s+c);if(i+=c+s,i>r.length)throw fE("Invalid address Uint8Array: "+Nt(r,"base16"));e.push([o,u]);let l=T0(o,u);if(t.push([o,l]),a.path===!0){n=l;break}}return{bytes:Uint8Array.from(r),string:dE(t),tuples:e,stringTuples:t,path:n}}function dE(r){let e=[];return r.map(t=>{let n=Ee(t[0]);return e.push(n.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),U0(e.join("/"))}function D0(r){return Ln(r.map(e=>{let t=Ee(e[0]),n=Uint8Array.from(Qt(t.code));return e.length>1&&e[1]!=null&&(n=Ln([n,e[1]])),n}))}function NR(r,e){if(r.size>0)return r.size/8;if(r.size===0)return 0;{let t=kt(e instanceof Uint8Array?e:Uint8Array.from(e));return t+Fe(t)}}function U0(r){return"/"+r.trim().split("/").filter(e=>e).join("/")}function fE(r){return new Error("Error parsing address: "+r)}var DR=Symbol.for("nodejs.util.inspect.custom"),L0=Symbol.for("@multiformats/js-multiaddr/multiaddr"),LR=[Ee("dns").code,Ee("dns4").code,Ee("dns6").code,Ee("dnsaddr").code],bp=class r{bytes;#e;#t;#r;#n;[L0]=!0;constructor(e){e==null&&(e="");let t;if(e instanceof Uint8Array)t=N0(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);t=pE(e)}else if(mE(e))t=N0(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=t.bytes,this.#e=t.string,this.#t=t.tuples,this.#r=t.stringTuples,this.#n=t.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let e,t,n,i,o="",s=Ee("tcp"),a=Ee("udp"),c=Ee("ip4"),u=Ee("ip6"),l=Ee("dns6"),p=Ee("ip6zone");for(let[d,f]of this.stringTuples())d===p.code&&(o=`%${f??""}`),LR.includes(d)&&(t=s.name,i=443,n=`${f??""}${o}`,e=d===l.code?6:4),(d===s.code||d===a.code)&&(t=Ee(d).name,i=parseInt(f??"")),(d===c.code||d===u.code)&&(t=Ee(d).name,n=`${f??""}${o}`,e=d===u.code?6:4);if(e==null||t==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:t,port:i}}protos(){return this.#t.map(([e])=>Object.assign({},Ee(e)))}protoCodes(){return this.#t.map(([e])=>e)}protoNames(){return this.#t.map(([e])=>Ee(e).name)}tuples(){return this.#t}stringTuples(){return this.#r}encapsulate(e){return e=new r(e),new r(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),n=this.toString(),i=n.lastIndexOf(t);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new r(n.slice(0,i))}decapsulateCode(e){let t=this.tuples();for(let n=t.length-1;n>=0;n--)if(t[n][0]===e)return new r(D0(t.slice(0,n)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([n,i])=>{n===Ps.p2p.code&&e.push([n,i]),n===Ps["p2p-circuit"].code&&(e=[])});let t=e.pop();if(t?.[1]!=null){let n=t[1];return n[0]==="Q"||n[0]==="1"?Nt(Ut.decode(`z${n}`),"base58btc"):Nt(_i.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(e){return X2(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(o=>o.resolvable);if(t==null)return[this];let n=hE.get(t.name);if(n==null)throw new O(`no available resolver for ${t.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(o=>new r(o))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let t=(e??this).protos();return!(t.length!==2||t[0].code!==4&&t[0].code!==41||t[1].code!==6&&t[1].code!==273)}[DR](){return`Multiaddr(${this.#e})`}};var hE=new Map;function mE(r){return!!r?.[L0]}function vp(r){return new bp(r)}var PR=K("dns4"),OR=K("dns6"),FR=K("dnsaddr"),fo=at(K("dns"),FR,PR,OR),Ep=at(K("ip4"),K("ip6")),Os=at(te(Ep,K("tcp")),te(fo,K("tcp"))),F0=te(Ep,K("udp")),zR=te(F0,K("utp")),VR=te(F0,K("quic")),bc=at(te(Os,K("ws")),te(fo,K("ws"))),vc=at(te(Os,K("wss")),te(fo,K("wss")),te(Os,K("tls"),K("ws")),te(fo,K("tls"),K("ws"))),P0=at(te(Os,K("http")),te(Ep,K("http")),te(fo,K("http"))),O0=at(te(Os,K("https")),te(Ep,K("https")),te(fo,K("https"))),gE=te(F0,K("webrtc"),K("certhash")),yE=at(te(gE,K("p2p")),gE),wE=at(te(bc,K("p2p-webrtc-star"),K("p2p")),te(vc,K("p2p-webrtc-star"),K("p2p")),te(bc,K("p2p-webrtc-star")),te(vc,K("p2p-webrtc-star"))),WX=at(te(bc,K("p2p-websocket-star"),K("p2p")),te(vc,K("p2p-websocket-star"),K("p2p")),te(bc,K("p2p-websocket-star")),te(vc,K("p2p-websocket-star"))),bE=at(te(P0,K("p2p-webrtc-direct"),K("p2p")),te(O0,K("p2p-webrtc-direct"),K("p2p")),te(P0,K("p2p-webrtc-direct")),te(O0,K("p2p-webrtc-direct"))),Ec=at(bc,vc,P0,O0,wE,bE,Os,zR,VR,fo,yE),YX=at(te(Ec,K("p2p-stardust"),K("p2p")),te(Ec,K("p2p-stardust"))),Ti=at(te(Ec,K("p2p")),wE,bE,yE,K("p2p")),xE=at(te(Ti,K("p2p-circuit"),Ti),te(Ti,K("p2p-circuit")),te(K("p2p-circuit"),Ti),te(Ec,K("p2p-circuit")),te(K("p2p-circuit"),Ec),K("p2p-circuit")),vE=()=>at(te(xE,vE),xE),wc=vE(),MR=at(te(wc,Ti,wc),te(Ti,wc),te(wc,Ti),wc,Ti);function EE(r){function e(t){let n;try{n=vp(t)}catch{return!1}let i=r(n.protoNames());return i===null?!1:i===!0||i===!1?i:i.length===0}return e}function te(...r){function e(t){if(t.length<r.length)return null;let n=t;return r.some(i=>(n=typeof i=="function"?i().partialMatch(t):i.partialMatch(t),Array.isArray(n)&&(t=n),n===null)),n}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:EE(e),partialMatch:e}}function at(...r){function e(n){let i=null;return r.some(o=>{let s=typeof o=="function"?o().partialMatch(n):o.partialMatch(n);return s!=null?(i=s,!0):!1}),i}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:EE(e),partialMatch:e}}function K(r){let e=r;function t(i){let o;try{o=vp(i)}catch{return!1}let s=o.protoNames();return s.length===1&&s[0]===e}function n(i){return i.length===0?null:i[0]===e?i.slice(1):null}return{toString:function(){return e},matches:t,partialMatch:n}}var ZR=Q(TE(),1);function CE(r){try{return QR(r)?!!ur.parse(r):r instanceof Uint8Array?!!ur.decode(r):!!ur.asCID(r)}catch{return!1}}function QR(r){return typeof r=="string"}var tU=r=>{let e=r.data;return e.startsWith('"')&&(e=e.substring(1)),e.endsWith('"')&&(e=e.substring(0,e.length-1)),e.replace("dnslink=","")},M0=(r,e)=>{let t=rU(r,e);return{ipfsPath:tU(t),answer:t}},rU=(r,e)=>{let t=e.Answer?.filter(n=>n.data.includes("dnslink=/ipfs")||n.data.includes("dnslink=/ipns")).pop();if(t==null)throw new O(`No dnslink records found for domain: ${r}`,"ERR_DNSLINK_NOT_FOUND");return t},Sc=32,Fs=async(r,e,t,n={})=>{if(e===0)throw new Error("recursion limit exceeded");let i;try{i=await t(r,n)}catch(c){if(c.code!=="ENOTFOUND"&&c.code!=="ERR_DNSLINK_NOT_FOUND"&&c.code!=="ENODATA")throw c;r.startsWith("_dnslink.")?r=r.replace("_dnslink.",""):r=`_dnslink.${r}`,i=await t(r,n)}let o=i.replace("dnslink=",""),s=o.split("/")[2];return CE(s)?o:Fs(s,e-1,t,n)},nU=/^dnslink=.+$/,RE=async(r,e)=>{let i=(await r.resolveTxt(e)).flat().filter(o=>nU.test(o))[0];if(i==null)throw new O(`No dnslink records found for domain: ${e}`,"ERR_DNSLINK_NOT_FOUND");return i};var j0=Q(Pd(),1),H0=Q(DE(),1);function Ap(r,e,t){return`${r}?name=${e}&type=${t}`}async function LE(r,e){return await(await fetch(r,{headers:new Headers({accept:"application/dns-json"}),signal:e})).json()}function ho(r,e){return`${e}_${r}`}var $0=Object.assign((0,j0.default)("dns-over-http-resolver"),{error:(0,j0.default)("dns-over-http-resolver:error")}),q0=class{_cache;_TXTcache;_servers;_request;_abortControllers;constructor(e={}){this._cache=new H0.default({max:e?.maxCache??100}),this._TXTcache=new H0.default({max:e?.maxCache??100}),this._servers=["https://cloudflare-dns.com/dns-query","https://dns.google/resolve"],this._request=e.request??LE,this._abortControllers=[]}cancel(){this._abortControllers.forEach(e=>{e.abort()})}getServers(){return this._servers}_getShuffledServers(){let e=[...this._servers];for(let t=e.length-1;t>0;t--){let n=Math.floor(Math.random()*t),i=e[t];e[t]=e[n],e[n]=i}return e}setServers(e){this._servers=e}async resolve(e,t="A"){switch(t){case"A":return this.resolve4(e);case"AAAA":return this.resolve6(e);case"TXT":return this.resolveTxt(e);default:throw new Error(`${t} is not supported`)}}async resolve4(e){let t="A",n=this._cache.get(ho(e,t));if(n!=null)return n;let i=!1;for(let o of this._getShuffledServers()){let s=new AbortController;this._abortControllers.push(s);try{let a=await this._request(Ap(o,e,t),s.signal),c=a.Answer.map(l=>l.data),u=Math.min(...a.Answer.map(l=>l.TTL));return this._cache.set(ho(e,t),c,{ttl:u}),c}catch{s.signal.aborted&&(i=!0),$0.error(`${o} could not resolve ${e} record ${t}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==s)}}throw i?Object.assign(new Error("queryA ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${t}`)}async resolve6(e){let t="AAAA",n=this._cache.get(ho(e,t));if(n!=null)return n;let i=!1;for(let o of this._getShuffledServers()){let s=new AbortController;this._abortControllers.push(s);try{let a=await this._request(Ap(o,e,t),s.signal),c=a.Answer.map(l=>l.data),u=Math.min(...a.Answer.map(l=>l.TTL));return this._cache.set(ho(e,t),c,{ttl:u}),c}catch{s.signal.aborted&&(i=!0),$0.error(`${o} could not resolve ${e} record ${t}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==s)}}throw i?Object.assign(new Error("queryAaaa ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${t}`)}async resolveTxt(e){let t="TXT",n=this._TXTcache.get(ho(e,t));if(n!=null)return n;let i=!1;for(let o of this._getShuffledServers()){let s=new AbortController;this._abortControllers.push(s);try{let a=await this._request(Ap(o,e,t),s.signal),c=a.Answer.map(l=>[l.data.replace(/['"]+/g,"")]),u=Math.min(...a.Answer.map(l=>l.TTL));return this._TXTcache.set(ho(e,t),c,{ttl:u}),c}catch{s.signal.aborted&&(i=!0),$0.error(`${o} could not resolve ${e} record ${t}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==s)}}throw i?Object.assign(new Error("queryTxt ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${t}`)}clearCache(){this._cache.clear(),this._TXTcache.clear()}},PE=q0;var FE=Q(K0(),1),Ri=class{lru;constructor(e){this.lru=(0,FE.default)(e)}get(e){let t=this.lru.get(e);if(t!=null){if(t.expire!=null&&t.expire<Date.now()){this.lru.remove(e);return}return t.value}}set(e,t,n){this.lru.set(e,{value:t,expire:Date.now()+n})}has(e){return this.get(e)!=null}remove(e){this.lru.remove(e)}clear(){this.lru.clear()}};var G0=new Ri(1e3),cU=60*1e3,lU=new Ct({concurrency:4}),uU=async function(e,t={}){let n=new PE({maxCache:0});if(t.nocache!==!0&&G0.has(e)){let o=G0.get(e);if(o!=null)return t?.onProgress?.(new P("dnslink:cache",{detail:o})),o}t.onProgress?.(new P("dnslink:query",{detail:e}));let i=await lU.add(async()=>{let o=await RE(n,e);return t.onProgress?.(new P("dnslink:answer",{detail:o})),G0.set(e,o,cU),o},{signal:t?.signal});if(i==null)throw new Error("No DNS response received");return i},zE=uU;function VE(){return async(r,e={})=>Fs(r,Sc,zE,e)}var W0=class{routing;constructor(e){this.routing=e}async put(e,t,n={}){try{await this.routing.put(e,t,n)}catch(i){n.onProgress?.(new P("ipns:routing:helia:error",i))}}async get(e,t={}){try{return await this.routing.get(e,t)}catch(n){t.onProgress?.(new P("ipns:routing:helia:error",n))}throw new Error("Not found")}};function ME(r){return new W0(r)}var Sp=globalThis.CustomEvent??Event;async function*mo(r,e={}){let t=e.concurrency??1/0;t<1&&(t=1/0);let n=e.ordered==null?!1:e.ordered,i=new EventTarget,o=[],s=He(),a=He(),c=!1,u,l=!1;i.addEventListener("task-complete",()=>{a.resolve()}),Promise.resolve().then(async()=>{try{for await(let f of r){if(o.length===t&&(s=He(),await s.promise),l)break;let h={done:!1};o.push(h),f().then(x=>{h.done=!0,h.ok=!0,h.value=x,i.dispatchEvent(new Sp("task-complete"))},x=>{h.done=!0,h.err=x,i.dispatchEvent(new Sp("task-complete"))})}c=!0,i.dispatchEvent(new Sp("task-complete"))}catch(f){u=f,i.dispatchEvent(new Sp("task-complete"))}});function p(){return n?o[0]?.done:!!o.find(f=>f.done)}function*m(){for(;o.length>0&&o[0].done;){let f=o[0];if(o.shift(),f.ok)yield f.value;else throw l=!0,s.resolve(),f.err;s.resolve()}}function*d(){for(;p();)for(let f=0;f<o.length;f++)if(o[f].done){let h=o[f];if(o.splice(f,1),f--,h.ok)yield h.value;else throw l=!0,s.resolve(),h.err;s.resolve()}}for(;;){if(p()||(a=He(),await a.promise),u!=null)throw u;if(n?yield*m():yield*d(),c&&o.length===0)break}}var Bc;(function(r){let e;r.codec=()=>(e==null&&(e=nr((t,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),t.key!=null&&t.key.byteLength>0&&(n.uint32(10),n.bytes(t.key)),t.value!=null&&t.value.byteLength>0&&(n.uint32(18),n.bytes(t.value)),t.timeReceived!=null&&t.timeReceived!==""&&(n.uint32(42),n.string(t.timeReceived)),i.lengthDelimited!==!1&&n.ldelim()},(t,n)=>{let i={key:new Uint8Array(0),value:new Uint8Array(0),timeReceived:""},o=n==null?t.len:t.pos+n;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.key=t.bytes();break;case 2:i.value=t.bytes();break;case 5:i.timeReceived=t.string();break;default:t.skipType(s&7);break}}return i})),e),r.encode=t=>rr(t,r.codec()),r.decode=t=>er(t,r.codec())})(Bc||(Bc={}));function $E(r){let e=r.getUTCFullYear(),t=String(r.getUTCMonth()+1).padStart(2,"0"),n=String(r.getUTCDate()).padStart(2,"0"),i=String(r.getUTCHours()).padStart(2,"0"),o=String(r.getUTCMinutes()).padStart(2,"0"),s=String(r.getUTCSeconds()).padStart(2,"0"),a=r.getUTCMilliseconds(),c=String(a*1e3*1e3).padStart(9,"0");return`${e}-${t}-${n}T${i}:${o}:${s}.${c}Z`}function jE(r){let e=new RegExp("(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})\\.(\\d+)Z"),t=String(r).trim().match(e);if(t==null)throw new Error("Invalid format");let n=parseInt(t[1],10),i=parseInt(t[2],10)-1,o=parseInt(t[3],10),s=parseInt(t[4],10),a=parseInt(t[5],10),c=parseInt(t[6],10),u=parseInt(t[7].slice(0,-6),10);return new Date(Date.UTC(n,i,o,s,a,c,u))}var zs=class r{key;value;timeReceived;constructor(e,t,n){if(!(e instanceof Uint8Array))throw new Error("key must be a Uint8Array");if(!(t instanceof Uint8Array))throw new Error("value must be a Uint8Array");this.key=e,this.value=t,this.timeReceived=n}serialize(){return Bc.encode(this.prepareSerialize())}prepareSerialize(){return{key:this.key,value:this.value,timeReceived:$E(this.timeReceived)}}static deserialize(e){let t=Bc.decode(e);return new r(t.key,t.value,new Date(t.timeReceived))}static fromDeserialized(e){let t=jE(e.timeReceived);if(e.key==null)throw new Error("key missing from deserialized object");if(e.value==null)throw new Error("value missing from deserialized object");return new r(e.key,e.value,t)}};var HE;(function(r){r[r.SEND_QUERY=0]="SEND_QUERY",r[r.PEER_RESPONSE=1]="PEER_RESPONSE",r[r.FINAL_PEER=2]="FINAL_PEER",r[r.QUERY_ERROR=3]="QUERY_ERROR",r[r.PROVIDER=4]="PROVIDER",r[r.VALUE=5]="VALUE",r[r.ADD_PEER=6]="ADD_PEER",r[r.DIAL_PEER=7]="DIAL_PEER"})(HE||(HE={}));var qE;(function(r){r[r.PUT_VALUE=0]="PUT_VALUE",r[r.GET_VALUE=1]="GET_VALUE",r[r.ADD_PROVIDER=2]="ADD_PROVIDER",r[r.GET_PROVIDERS=3]="GET_PROVIDERS",r[r.FIND_NODE=4]="FIND_NODE",r[r.PING=5]="PING"})(qE||(qE={}));function Y0(r){return new Xe("/dht/record/"+ie(r,"base32"),!1)}function KE(r){return{async put(e,t,n={}){try{let i=Y0(e),o=new zs(e,t,new Date);n.onProgress?.(new P("ipns:routing:datastore:put")),await r.put(i,o.serialize(),n)}catch(i){throw n.onProgress?.(new P("ipns:routing:datastore:error",i)),i}},async get(e,t={}){try{let n=Y0(e);t.onProgress?.(new P("ipns:routing:datastore:get"));let i=await r.get(n,t);return zs.deserialize(i).value}catch(n){throw t.onProgress?.(new P("ipns:routing:datastore:error",n)),n}},async has(e,t={}){let n=Y0(e);return r.has(n,t)}}}var go=ue("helia:ipns"),dU=60*1e3,GE=60*dU,fU=24*GE,X0=23*GE,J0=class{routers;localStore;timeout;defaultResolvers;constructor(e,t=[],n=[]){this.routers=[ME(e.routing),...t],this.localStore=KE(e.datastore),this.defaultResolvers=n.length>0?n:[VE()]}async publish(e,t,n={}){try{let i=1n,o=ds(e);if(await this.localStore.has(o,n)){let c=await this.localStore.get(o,n);i=wt(c).sequence+1n}let s=await zb(e,t,i,n.lifetime??fU,n),a=In(s);return await this.localStore.put(o,a,n),n.offline!==!0&&await Promise.all(this.routers.map(async c=>{await c.put(o,a,n)})),s}catch(i){throw n.onProgress?.(new P("ipns:publish:error",i)),i}}async resolve(e,t={}){let n=ds(e),i=await this.#t(n,t);return this.#e(i.value,t)}async resolveDns(e,t={}){let n=t.resolvers??this.defaultResolvers,i=await Promise.any(n.map(async o=>o(e,t)));return this.#e(i,t)}republish(e={}){if(this.timeout!=null)throw new Error("Republish is already running");e.signal?.addEventListener("abort",()=>{clearTimeout(this.timeout)});async function t(){let n=Date.now();e.onProgress?.(new P("ipns:republish:start"));let o=Date.now()-n,s=X0-o;s<0&&(s=e.interval??X0),setTimeout(()=>{t().catch(a=>{go.error("error republishing",a)})},s)}this.timeout=setTimeout(()=>{t().catch(n=>{go.error("error republishing",n)})},e.interval??X0)}async#e(e,t={}){let n=e.split("/");try{let i=n[1];if(i==="ipns"){let{cid:o}=await this.resolve(mr(n[2]),t),s=n.slice(3).join("/");return{cid:o,path:s}}else if(i==="ipfs"){let o=z.parse(n[2]),s=n.slice(3).join("/");return{cid:o,path:s}}}catch(i){go.error("error parsing ipfs path",i)}throw go.error("invalid ipfs path %s",e),new Error("Invalid value")}async#t(e,t={}){let n=[this.localStore,...this.routers];t.offline===!0&&(n=[this.localStore]);let i=[],o=0;if(await Promise.all(n.map(async a=>{let c;try{c=await a.get(e,{...t,validate:!1})}catch(u){a===this.localStore&&u.code==="ERR_NOT_FOUND"?go("did not have record locally"):go.error("error finding IPNS record",u);return}try{await Fu(e,c),i.push(c)}catch(u){o++,go.error("error finding IPNS record",u)}})),i.length===0)throw o>0?new O(`${o>1?`${o} records`:"Record"} found for routing key ${o>1?"were":"was"} invalid`,"ERR_RECORDS_FAILED_VALIDATION"):new O("Could not find record for routing key","ERR_NOT_FOUND");let s=i[Dv(e,i)];return await this.localStore.put(e,s,t),wt(s)}};function WE(r,{routers:e=[],resolvers:t=[]}={}){return new J0(r,e,t)}var QU=Q(cg(),1),eN=Q(B3(),1);var cZ=new Ri(1e3),lZ=60*1e3;var yg=new Ri(1e3),tN=60*1e3;function Cp(r){let e=new Ct({concurrency:4}),t=async(n,i={})=>{let o=new URLSearchParams;o.set("name",n),o.set("type","TXT");let s=o.toString();if(i.nocache!==!0&&yg.has(s)){let c=yg.get(s);if(c!=null)return i.onProgress?.(new P("dnslink:cache",{detail:c})),c}i.onProgress?.(new P("dnslink:query",{detail:n}));let a=await e.add(async()=>{let c=await fetch(`${r}?${o}`,{headers:{accept:"application/dns-json"},signal:i.signal});if(c.status!==200)throw new Error(`Unexpected HTTP status: ${c.status} - ${c.statusText}`);let u=new URL(c.url).search.slice(1),l=await c.json();i.onProgress?.(new P("dnslink:answer",{detail:l}));let{ipfsPath:p,answer:m}=M0(n,l);return yg.set(u,p,m.TTL??tN),p},{signal:i.signal});if(a==null)throw new Error("No DNS response received");return a};return async(n,i={})=>Fs(n,Sc,t,i)}var wg=class{components;constructor(e){this.components=e}async add(e,t={}){let n=p1(e),i=await(t.hasher??ae).digest(n),o=z.createV1(Lo,i);return await this.components.blockstore.put(o,n,t),o}async get(e,t={}){let n=await this.components.blockstore.get(e,t);return d1(n)}};function k3(r){return new wg(r)}var Gg=Q(ke(),1);function rN(r){return r[Symbol.asyncIterator]!=null}function nN(r,e=1){return e=Number(e),rN(r)?async function*(){let t=[];if(e<1&&(e=1),e!==Math.round(e))throw new Error("Batch size must be an integer");for await(let n of r)for(t.push(n);t.length>=e;)yield t.slice(0,e),t=t.slice(e);for(;t.length>0;)yield t.slice(0,e),t=t.slice(e)}():function*(){let t=[];if(e<1&&(e=1),e!==Math.round(e))throw new Error("Batch size must be an integer");for(let n of r)for(t.push(n);t.length>=e;)yield t.slice(0,e),t=t.slice(e);for(;t.length>0;)yield t.slice(0,e),t=t.slice(e)}()}var _c=nN;async function*Tc(r,e=1){for await(let t of _c(r,e)){let n=t.map(async i=>i().then(o=>({ok:!0,value:o}),o=>({ok:!1,err:o})));for(let i=0;i<n.length;i++){let o=await n[i];if(o.ok)yield o.value;else throw o.err}}}var iN=262144,Cc=(r={})=>{let e=r.chunkSize??iN;return async function*(n){let i=new Wi,o=0,s=!1;for await(let a of n)for(i.append(a),o+=a.length;o>=e;)if(yield i.slice(0,e),s=!0,e===i.length)i=new Wi,o=0;else{let c=new Wi;c.append(i.sublist(e)),i=c,o-=e}(!s||o>0)&&(yield i.subarray(0,o))}};var bg=Q(ke(),1);var _r;(function(r){let e;(function(i){i.Raw="Raw",i.Directory="Directory",i.File="File",i.Metadata="Metadata",i.Symlink="Symlink",i.HAMTShard="HAMTShard"})(e=r.DataType||(r.DataType={}));let t;(function(i){i[i.Raw=0]="Raw",i[i.Directory=1]="Directory",i[i.File=2]="File",i[i.Metadata=3]="Metadata",i[i.Symlink=4]="Symlink",i[i.HAMTShard=5]="HAMTShard"})(t||(t={})),function(i){i.codec=()=>Ki(t)}(e=r.DataType||(r.DataType={}));let n;r.codec=()=>(n==null&&(n=nr((i,o,s={})=>{if(s.lengthDelimited!==!1&&o.fork(),i.Type!=null&&(o.uint32(8),r.DataType.codec().encode(i.Type,o)),i.Data!=null&&(o.uint32(18),o.bytes(i.Data)),i.filesize!=null&&(o.uint32(24),o.uint64(i.filesize)),i.blocksizes!=null)for(let a of i.blocksizes)o.uint32(32),o.uint64(a);i.hashType!=null&&(o.uint32(40),o.uint64(i.hashType)),i.fanout!=null&&(o.uint32(48),o.uint64(i.fanout)),i.mode!=null&&(o.uint32(56),o.uint32(i.mode)),i.mtime!=null&&(o.uint32(66),Rp.codec().encode(i.mtime,o)),s.lengthDelimited!==!1&&o.ldelim()},(i,o)=>{let s={blocksizes:[]},a=o==null?i.len:i.pos+o;for(;i.pos<a;){let c=i.uint32();switch(c>>>3){case 1:s.Type=r.DataType.codec().decode(i);break;case 2:s.Data=i.bytes();break;case 3:s.filesize=i.uint64();break;case 4:s.blocksizes.push(i.uint64());break;case 5:s.hashType=i.uint64();break;case 6:s.fanout=i.uint64();break;case 7:s.mode=i.uint32();break;case 8:s.mtime=Rp.codec().decode(i,i.uint32());break;default:i.skipType(c&7);break}}return s})),n),r.encode=i=>rr(i,r.codec()),r.decode=i=>er(i,r.codec())})(_r||(_r={}));var Rp;(function(r){let e;r.codec=()=>(e==null&&(e=nr((t,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),t.Seconds!=null&&(n.uint32(8),n.int64(t.Seconds)),t.FractionalNanoseconds!=null&&(n.uint32(21),n.fixed32(t.FractionalNanoseconds)),i.lengthDelimited!==!1&&n.ldelim()},(t,n)=>{let i={},o=n==null?t.len:t.pos+n;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.Seconds=t.int64();break;case 2:i.FractionalNanoseconds=t.fixed32();break;default:t.skipType(s&7);break}}return i})),e),r.encode=t=>rr(t,r.codec()),r.decode=t=>er(t,r.codec())})(Rp||(Rp={}));var I3;(function(r){let e;r.codec=()=>(e==null&&(e=nr((t,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),t.MimeType!=null&&(n.uint32(10),n.string(t.MimeType)),i.lengthDelimited!==!1&&n.ldelim()},(t,n)=>{let i={},o=n==null?t.len:t.pos+n;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.MimeType=t.string();break;default:t.skipType(s&7);break}}return i})),e),r.encode=t=>rr(t,r.codec()),r.decode=t=>er(t,r.codec())})(I3||(I3={}));var _3={Raw:"raw",Directory:"directory",File:"file",Metadata:"metadata",Symlink:"symlink",HAMTShard:"hamt-sharded-directory"},oN=["directory","hamt-sharded-directory"],T3=parseInt("0644",8),C3=parseInt("0755",8),X=class r{static unmarshal(e){let t=_r.decode(e),n=new r({type:_3[t.Type!=null?t.Type.toString():"File"],data:t.Data,blockSizes:t.blocksizes,mode:t.mode,mtime:t.mtime!=null?{secs:t.mtime.Seconds??0n,nsecs:t.mtime.FractionalNanoseconds}:void 0,fanout:t.fanout});return n._originalMode=t.mode??0,n}type;data;blockSizes;hashType;fanout;mtime;_mode;_originalMode;constructor(e={type:"file"}){let{type:t,data:n,blockSizes:i,hashType:o,fanout:s,mtime:a,mode:c}=e;if(t!=null&&!Object.values(_3).includes(t))throw(0,bg.default)(new Error("Type: "+t+" is not valid"),"ERR_INVALID_TYPE");this.type=t??"file",this.data=n,this.hashType=o,this.fanout=s,this.blockSizes=i??[],this._originalMode=0,this.mode=c,this.mtime=a}set mode(e){e==null?this._mode=this.isDirectory()?C3:T3:this._mode=e&4095}get mode(){return this._mode}isDirectory(){return oN.includes(this.type)}addBlockSize(e){this.blockSizes.push(e)}removeBlockSize(e){this.blockSizes.splice(e,1)}fileSize(){if(this.isDirectory())return 0n;let e=0n;return this.blockSizes.forEach(t=>{e+=t}),this.data!=null&&(e+=BigInt(this.data.length)),e}marshal(){let e;switch(this.type){case"raw":e=_r.DataType.Raw;break;case"directory":e=_r.DataType.Directory;break;case"file":e=_r.DataType.File;break;case"metadata":e=_r.DataType.Metadata;break;case"symlink":e=_r.DataType.Symlink;break;case"hamt-sharded-directory":e=_r.DataType.HAMTShard;break;default:throw(0,bg.default)(new Error(`Type: ${e} is not valid`),"ERR_INVALID_TYPE")}let t=this.data;(this.data==null||this.data.length===0)&&(t=void 0);let n;this.mode!=null&&(n=this._originalMode&4294963200|(this.mode??0),n===T3&&!this.isDirectory()&&(n=void 0),n===C3&&this.isDirectory()&&(n=void 0));let i;return this.mtime!=null&&(i={Seconds:this.mtime.secs,FractionalNanoseconds:this.mtime.nsecs}),_r.encode({Type:e,Data:t,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:n,mtime:i})}};var Tr=async(r,e,t)=>{t.codec==null&&(t.codec=Ke);let n=await ae.digest(r),i=z.create(t.cidVersion,t.codec.code,n);return await e.put(i,r,t),i};function R3(r){return async function*(t,n){let i=0n;for await(let o of t.content)yield async()=>{let s,a={codec:Ke,cidVersion:r.cidVersion,onProgress:r.onProgress};r.rawLeaves?(a.codec=tr,a.cidVersion=1):(s=new X({type:r.leafType,data:o}),o=fe({Data:s.marshal(),Links:[]}));let c=await Tr(o,n,a);return i+=BigInt(o.byteLength),r.onProgress?.(new P("unixfs:importer:progress:file:write",{bytesWritten:i,cid:c,path:t.path})),{cid:c,unixfs:s,size:BigInt(o.length),block:o}}}}var vg=Q(ke(),1);var U3=async(r,e,t)=>{let n=new X({type:"directory",mtime:r.mtime,mode:r.mode}),i=fe(Ue({Data:n.marshal()})),o=await Tr(i,e,t),s=r.path;return{cid:o,path:s,unixfs:n,size:BigInt(i.length),originalPath:r.originalPath,block:i}};async function*sN(r,e,t){let n=-1,i;for await(let o of Tc(t.bufferImporter(r,e),t.blockWriteConcurrency)){if(n++,n===0){i={...o,single:!0};continue}else n===1&&i!=null&&(yield{...i,block:void 0,single:void 0},i=void 0);yield{...o,block:void 0}}i!=null&&(yield i)}function N3(r){return r.single===!0}var aN=(r,e,t)=>async function(i){if(i.length===1&&N3(i[0])&&t.reduceSingleLeafToSelf){let l=i[0],p=l.block;return N3(l)&&(r.mtime!==void 0||r.mode!==void 0)&&(l.unixfs=new X({type:"file",mtime:r.mtime,mode:r.mode,data:l.block}),p={Data:l.unixfs.marshal(),Links:[]},l.block=fe(Ue(p)),l.cid=await Tr(l.block,e,{...t,cidVersion:t.cidVersion}),l.size=BigInt(l.block.length)),t.onProgress?.(new P("unixfs:importer:progress:file:layout",{cid:l.cid,path:l.originalPath})),{cid:l.cid,path:r.path,unixfs:l.unixfs,size:l.size,originalPath:l.originalPath}}let o=new X({type:"file",mtime:r.mtime,mode:r.mode}),s=i.filter(l=>l.cid.code===je&&l.size>0||l.unixfs!=null&&l.unixfs.data==null&&l.unixfs.fileSize()>0n?!0:!!l.unixfs?.data?.length).map(l=>l.cid.code===je?(o.addBlockSize(l.size),{Name:"",Tsize:Number(l.size),Hash:l.cid}):(l.unixfs==null||l.unixfs.data==null?o.addBlockSize(l.unixfs?.fileSize()??0n):o.addBlockSize(BigInt(l.unixfs.data.length)),{Name:"",Tsize:Number(l.size),Hash:l.cid})),a={Data:o.marshal(),Links:s},c=fe(Ue(a)),u=await Tr(c,e,t);return t.onProgress?.(new P("unixfs:importer:progress:file:layout",{cid:u,path:r.originalPath})),{cid:u,path:r.path,unixfs:o,size:BigInt(c.length+a.Links.reduce((l,p)=>l+(p.Tsize??0),0)),originalPath:r.originalPath,block:c}},D3=async(r,e,t)=>t.layout(sN(r,e,t),aN(r,e,t));function cN(r){return Symbol.iterator in r}function lN(r){return Symbol.asyncIterator in r}function uN(r){try{if(r instanceof Uint8Array)return async function*(){yield r}();if(cN(r))return async function*(){yield*r}();if(lN(r))return r}catch{throw(0,vg.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}throw(0,vg.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}function L3(r){return async function*(t,n){for await(let i of t){let o;if(i.path!=null&&(o=i.path,i.path=i.path.split("/").filter(s=>s!=null&&s!==".").join("/")),pN(i)){let s={path:i.path,mtime:i.mtime,mode:i.mode,content:async function*(){let a=0n;for await(let c of r.chunker(r.chunkValidator(uN(i.content)))){let u=BigInt(c.byteLength);a+=u,r.onProgress?.(new P("unixfs:importer:progress:file:read",{bytesRead:a,chunkSize:u,path:i.path})),yield c}}(),originalPath:o};yield async()=>D3(s,n,r)}else if(i.path!=null){let s={path:i.path,mtime:i.mtime,mode:i.mode,originalPath:o};yield async()=>U3(s,n,r)}else throw new Error("Import candidate must have content or path or both")}}}function pN(r){return r.content!=null}var Eg=Q(ke(),1);var P3=()=>async function*(e){for await(let t of e){if(t.length===void 0)throw(0,Eg.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT");if(typeof t=="string"||t instanceof String)yield Z(t.toString());else if(Array.isArray(t))yield Uint8Array.from(t);else if(t instanceof Uint8Array)yield t;else throw(0,Eg.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}};var dN=174;function Rc(r){let e=r?.maxChildrenPerNode??dN;return async function t(n,i){let o=[];for await(let s of _c(n,e))o.push(await i(s));return o.length>1?t(o,i):o[0]}}var rn=class{options;root;dir;path;dirty;flat;parent;parentKey;unixfs;mode;mtime;cid;size;nodeSize;constructor(e,t){this.options=t??{},this.root=e.root,this.dir=e.dir,this.path=e.path,this.dirty=e.dirty,this.flat=e.flat,this.parent=e.parent,this.parentKey=e.parentKey,this.unixfs=e.unixfs,this.mode=e.mode,this.mtime=e.mtime}},Uc=z.parse("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"),Nc=z.parse("zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi");var bo=class extends rn{_children;constructor(e,t){super(e,t),this._children=new Map}async put(e,t){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,this._children.set(e,t)}async get(e){return Promise.resolve(this._children.get(e))}childCount(){return this._children.size}directChildrenCount(){return this.childCount()}onlyChild(){return this._children.values().next().value}async*eachChildSeries(){for(let[e,t]of this._children.entries())yield{key:e,child:t}}estimateNodeSize(){if(this.nodeSize!==void 0)return this.nodeSize;this.nodeSize=0;for(let[e,t]of this._children.entries())t.size!=null&&t.cid!=null&&(this.nodeSize+=e.length+(this.options.cidVersion===1?Nc.bytes.byteLength:Uc.bytes.byteLength));return this.nodeSize}async*flush(e){let t=[];for(let[c,u]of this._children.entries()){let l=u;if(u instanceof rn)for await(let p of u.flush(e))l=p,yield p;l.size!=null&&l.cid!=null&&t.push({Name:c,Tsize:Number(l.size),Hash:l.cid})}let n=new X({type:"directory",mtime:this.mtime,mode:this.mode}),i={Data:n.marshal(),Links:t},o=fe(Ue(i)),s=await Tr(o,e,this.options),a=o.length+i.Links.reduce((c,u)=>c+(u.Tsize==null?0:u.Tsize),0);this.cid=s,this.size=a,yield{cid:s,unixfs:n,path:this.path,size:BigInt(a)}}};var Np=Q(z3(),1);function fN(r){let e=new Array(4);for(let t=0;t<4;t++)e[t]=r&255,r=r>>8;return new Uint8Array(e)}var AQ=$i({name:"murmur3-32",code:35,encode:r=>fN(Np.default.x86.hash32(r))}),vo=$i({name:"murmur3-128",code:34,encode:r=>Io.fromHex(Np.default.x64.hash128(r))}),SQ=$i({name:"murmur3-x64-64",code:34,encode:r=>Io.fromHex(Np.default.x64.hash128(r)).subarray(0,8)});var p6=Q(Dp(),1);function qs(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}var Ig={};$(Ig,{base10:()=>EN});function xN(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function p(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var h=0,x=0,g=0,y=f.length;g!==y&&f[g]===0;)g++,h++;for(var w=(y-g)*l+1>>>0,E=new Uint8Array(w);g!==y;){for(var B=f[g],S=0,b=w-1;(B!==0||S<x)&&b!==-1;b--,S++)B+=256*E[b]>>>0,E[b]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");x=S,g++}for(var v=w-x;v!==w&&E[v]===0;)v++;for(var k=c.repeat(h);v<w;++v)k+=r.charAt(E[v]);return k}function m(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var h=0;if(f[h]!==" "){for(var x=0,g=0;f[h]===c;)x++,h++;for(var y=(f.length-h)*u+1>>>0,w=new Uint8Array(y);f[h];){var E=t[f.charCodeAt(h)];if(E===255)return;for(var B=0,S=y-1;(E!==0||B<g)&&S!==-1;S--,B++)E+=a*w[S]>>>0,w[S]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,h++}if(f[h]!==" "){for(var b=y-g;b!==y&&w[b]===0;)b++;for(var v=new Uint8Array(x+(y-b)),k=x;b!==y;)v[k++]=w[b++];return v}}}function d(f){var h=m(f);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:m,decode:d}}var yN=xN,wN=yN,$3=wN;var CQ=new Uint8Array(0);var j3=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},Gn=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var H3=r=>new TextEncoder().encode(r),q3=r=>new TextDecoder().decode(r);var Ag=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Sg=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return G3(this,e)}},Bg=class{constructor(e){this.decoders=e}or(e){return G3(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},G3=(r,e)=>new Bg({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),kg=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Ag(e,t,n),this.decoder=new Sg(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Ks=({name:r,prefix:e,encode:t,decode:n})=>new kg(r,e,t,n),Di=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=$3(t,e);return Ks({prefix:r,name:e,encode:n,decode:o=>Gn(i(o))})},bN=(r,e,t,n)=>{let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*t/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let p=i[r[l]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},vN=(r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,o+=e[i&a>>s];if(s&&(o+=e[i&a<<t-s]),n)for(;o.length*t&7;)o+="=";return o},Pe=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Ks({prefix:e,name:r,encode(i){return vN(i,n,t)},decode(i){return bN(i,n,t,r)}});var EN=Di({prefix:"9",name:"base10",alphabet:"0123456789"});var _g={};$(_g,{base16:()=>AN,base16upper:()=>SN});var AN=Pe({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),SN=Pe({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Tg={};$(Tg,{base2:()=>BN});var BN=Pe({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Cg={};$(Cg,{base256emoji:()=>CN});var W3=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),kN=W3.reduce((r,e,t)=>(r[t]=e,r),[]),IN=W3.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function _N(r){return r.reduce((e,t)=>(e+=kN[t],e),"")}function TN(r){let e=[];for(let t of r){let n=IN[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var CN=Ks({prefix:"\u{1F680}",name:"base256emoji",encode:_N,decode:TN});var Rg={};$(Rg,{base32:()=>Gs,base32hex:()=>DN,base32hexpad:()=>PN,base32hexpadupper:()=>ON,base32hexupper:()=>LN,base32pad:()=>UN,base32padupper:()=>NN,base32upper:()=>RN,base32z:()=>FN});var Gs=Pe({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),RN=Pe({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),UN=Pe({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),NN=Pe({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),DN=Pe({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),LN=Pe({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),PN=Pe({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ON=Pe({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),FN=Pe({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ug={};$(Ug,{base36:()=>zN,base36upper:()=>VN});var zN=Di({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),VN=Di({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ng={};$(Ng,{base58btc:()=>nn,base58flickr:()=>MN});var nn=Di({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),MN=Di({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Dg={};$(Dg,{base64:()=>$N,base64pad:()=>jN,base64url:()=>HN,base64urlpad:()=>qN});var $N=Pe({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jN=Pe({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),HN=Pe({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),qN=Pe({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Lg={};$(Lg,{base8:()=>KN});var KN=Pe({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Pg={};$(Pg,{identity:()=>GN});var GN=Ks({prefix:"\0",name:"identity",encode:r=>q3(r),decode:r=>H3(r)});var qQ=new TextEncoder,KQ=new TextDecoder;var Fg={};$(Fg,{identity:()=>gD});var XN=J3,Y3=128,JN=127,ZN=~JN,QN=Math.pow(2,31);function J3(r,e,t){e=e||[],t=t||0;for(var n=t;r>=QN;)e[t++]=r&255|Y3,r/=128;for(;r&ZN;)e[t++]=r&255|Y3,r>>>=7;return e[t]=r|0,J3.bytes=t-n+1,e}var eD=Og,tD=128,X3=127;function Og(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw Og.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&X3)<<i:(s&X3)*Math.pow(2,i),i+=7}while(s>=tD);return Og.bytes=o-n,t}var rD=Math.pow(2,7),nD=Math.pow(2,14),iD=Math.pow(2,21),oD=Math.pow(2,28),sD=Math.pow(2,35),aD=Math.pow(2,42),cD=Math.pow(2,49),lD=Math.pow(2,56),uD=Math.pow(2,63),pD=function(r){return r<rD?1:r<nD?2:r<iD?3:r<oD?4:r<sD?5:r<aD?6:r<cD?7:r<lD?8:r<uD?9:10},dD={encode:XN,decode:eD,encodingLength:pD},fD=dD,Lc=fD;var Pc=(r,e=0)=>[Lc.decode(r,e),Lc.decode.bytes],Ws=(r,e,t=0)=>(Lc.encode(r,e,t),e),Ys=r=>Lc.encodingLength(r);var Eo=(r,e)=>{let t=e.byteLength,n=Ys(r),i=n+Ys(t),o=new Uint8Array(i+t);return Ws(r,o,0),Ws(t,o,n),o.set(e,i),new Xs(r,t,e,o)},Z3=r=>{let e=Gn(r),[t,n]=Pc(e),[i,o]=Pc(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Xs(t,i,s,e)},Q3=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&j3(r.bytes,t.bytes)}},Xs=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};var e6=0,hD="identity",t6=Gn,mD=r=>Eo(e6,t6(r)),gD={code:e6,name:hD,encode:t6,digest:mD};var Mg={};$(Mg,{sha256:()=>xD,sha512:()=>yD});var Vg=({name:r,code:e,encode:t})=>new zg(r,e,t),zg=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?Eo(this.code,t):t.then(n=>Eo(this.code,n))}else throw Error("Unknown type, must be binary type")}};var n6=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),xD=Vg({name:"sha2-256",code:18,encode:n6("SHA-256")}),yD=Vg({name:"sha2-512",code:19,encode:n6("SHA-512")});var i6=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return bD(t,$g(r),e||nn.encoder);default:return vD(t,$g(r),e||Gs.encoder)}};var o6=new WeakMap,$g=r=>{let e=o6.get(r);if(e==null){let t=new Map;return o6.set(r,t),t}return e},Pp=class r{constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==Fc)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==ED)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=Eo(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&Q3(e.multihash,n.multihash)}toString(e){return i6(this,e)}toJSON(){return{"/":i6(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:o,bytes:s}=t;return new r(n,i,o,s||s6(n,i,o.bytes))}else if(t[AD]===!0){let{version:n,multihash:i,code:o}=t,s=Z3(i);return r.create(n,o,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==Fc)throw new Error(`Version 0 CID must use dag-pb (code: ${Fc}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=s6(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,Fc,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=Gn(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new Xs(t.multihashCode,t.digestSize,o,i);return[t.version===0?r.createV0(s):r.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[p,m]=Pc(e.subarray(t));return t+=m,p},i=n(),o=Fc;if(i===18?(i=0,t=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,a=n(),c=n(),u=t+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,i]=wD(e,t),o=r.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return $g(o).set(n,e),o}},wD=(r,e)=>{switch(r[0]){case"Q":{let t=e||nn;return[nn.prefix,t.decode(`${nn.prefix}${r}`)]}case nn.prefix:{let t=e||nn;return[nn.prefix,t.decode(r)]}case Gs.prefix:{let t=e||Gs;return[Gs.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},bD=(r,e,t)=>{let{prefix:n}=t;if(n!==nn.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let o=t.encode(r).slice(1);return e.set(n,o),o}else return i},vD=(r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let o=t.encode(r);return e.set(n,o),o}else return i},Fc=112,ED=18,s6=(r,e,t)=>{let n=Ys(r),i=n+Ys(e),o=new Uint8Array(i+t.byteLength);return Ws(r,o,0),Ws(e,o,n),o.set(t,i),o},AD=Symbol.for("@ipld/js-cid/CID");var jg={...Pg,...Tg,...Lg,...Ig,..._g,...Rg,...Ug,...Ng,...Dg,...Cg},cee={...Mg,...Fg};function Op(r=0){return globalThis.Buffer?.allocUnsafe!=null?qs(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function c6(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var a6=c6("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Hg=c6("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=Op(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),SD={utf8:a6,"utf-8":a6,hex:jg.base16,latin1:Hg,ascii:Hg,binary:Hg,...jg},l6=SD;function u6(r,e="utf8"){let t=l6[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?qs(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var Jt=class r{constructor(e,t,n=0){this._options=e,this._popCount=0,this._parent=t,this._posAtParent=n,this._children=new p6.default,this.key=null}async put(e,t){let n=await this._findNewBucketAndPos(e);await n.bucket._putAt(n,e,t)}async get(e){let t=await this._findChild(e);if(t!=null)return t.value}async del(e){let t=await this._findPlace(e),n=t.bucket._at(t.pos);n!=null&&n.key===e&&t.bucket._delAt(t.pos)}leafCount(){return this._children.compactArray().reduce((t,n)=>n instanceof r?t+n.leafCount():t+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){let e=this._children.compactArray();for(let t of e)t instanceof r?yield*t.eachLeafSeries():yield t}serialize(e,t){let n=[];return t(this._children.reduce((i,o,s)=>(o!=null&&(o instanceof r?i.push(o.serialize(e,t)):i.push(e(o,s))),i),n))}async asyncTransform(e,t){return await d6(this,e,t)}toJSON(){return this.serialize(kD,ID)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(e){let t=await this._findPlace(e),n=t.bucket._at(t.pos);if(!(n instanceof r)&&n!=null&&n.key===e)return n}async _findPlace(e){let t=this._options.hash(typeof e=="string"?u6(e):e),n=await t.take(this._options.bits),i=this._children.get(n);return i instanceof r?await i._findPlace(t):{bucket:this,pos:n,hash:t,existingChild:i}}async _findNewBucketAndPos(e){let t=await this._findPlace(e);if(t.existingChild!=null&&t.existingChild.key!==e){let n=new r(this._options,t.bucket,t.pos);t.bucket._putObjectAt(t.pos,n);let i=await n._findPlace(t.existingChild.hash);return i.bucket._putAt(i,t.existingChild.key,t.existingChild.value),await n._findNewBucketAndPos(t.hash)}return t}_putAt(e,t,n){this._putObjectAt(e.pos,{key:t,value:n,hash:e.hash})}_putObjectAt(e,t){this._children.get(e)==null&&this._popCount++,this._children.set(e,t)}_delAt(e){if(e===-1)throw new Error("Invalid position");this._children.get(e)!=null&&this._popCount--,this._children.unset(e),this._level()}_level(){if(this._parent!=null&&this._popCount<=1)if(this._popCount===1){let e=this._children.find(BD);if(e!=null&&!(e instanceof r)){let t=e.hash;t.untake(this._options.bits);let n={pos:this._posAtParent,hash:t,bucket:this._parent};this._parent._putAt(n,e.key,e.value)}}else this._parent._delAt(this._posAtParent)}_at(e){return this._children.get(e)}};function BD(r){return!!r}function kD(r,e){return r.key}function ID(r){return r}async function d6(r,e,t){let n=[];for(let i of r._children.compactArray())if(i instanceof Jt)await d6(i,e,t);else{let o=await e(i);n.push({bitField:r._children.bitField(),children:o})}return await t(n)}var _D=[255,254,252,248,240,224,192,128],TD=[1,3,7,15,31,63,127,255],Fp=class{constructor(e){this._value=e,this._currentBytePos=e.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take(e){let t=e,n=0;for(;t>0&&this._haveBits();){let i=this._value[this._currentBytePos],o=this._currentBitPos+1,s=Math.min(o,t),a=CD(i,o-s,s);n=(n<<s)+a,t-=s,this._currentBitPos-=s,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return n}untake(e){for(this._currentBitPos+=e;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function CD(r,e,t){let n=RD(e,t);return(r&n)>>>e}function RD(r,e){return _D[r]&TD[Math.min(e+r-1,7)]}function f6(r,e){e==null&&(e=r.reduce((i,o)=>i+o.length,0));let t=Op(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return qs(t)}function h6(r){function e(t){return t instanceof zp?t:new zp(t,r)}return e}var zp=class{constructor(e,t){if(!(e instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=e,this._hashFn=t,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(e){let t=e;for(;this._availableBits<t;)await this._produceMoreBits();let n=0;for(;t>0;){let i=this._buffers[this._currentBufferIndex],o=Math.min(i.availableBits(),t),s=i.take(o);n=(n<<o)+s,t-=o,this._availableBits-=o,i.availableBits()===0&&this._currentBufferIndex++}return n}untake(e){let t=e;for(;t>0;){let n=this._buffers[this._currentBufferIndex],i=Math.min(n.totalBits()-n.availableBits(),t);n.untake(i),t-=i,this._availableBits+=i,this._currentBufferIndex>0&&n.totalBits()===n.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;let e=this._depth>0?f6([this._value,Uint8Array.from([this._depth])]):this._value,t=await this._hashFn(e),n=new Fp(t);this._buffers.push(n),this._availableBits+=n.availableBits()}};function Js(r){if(r==null||r.hashFn==null)throw new Error("please define an options.hashFn");let e={bits:r.bits??8,hash:h6(r.hashFn)};return new Jt(e)}async function UD(r){return(await vo.encode(r)).slice(0,8).reverse()}var m6=BigInt(34),ND=8,qg=class extends rn{_bucket;constructor(e,t){super(e,t),this._bucket=Js({hashFn:UD,bits:t.shardFanoutBits??ND})}async put(e,t){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,await this._bucket.put(e,t)}async get(e){return this._bucket.get(e)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(let{key:e,value:t}of this._bucket.eachLeafSeries())yield{key:e,child:t}}estimateNodeSize(){return this.nodeSize!==void 0?this.nodeSize:(this.nodeSize=y6(this._bucket,this,this.options),this.nodeSize)}async*flush(e){for await(let t of x6(this._bucket,e,this,this.options))yield{...t,path:this.path}}},g6=qg;async function*x6(r,e,t,n){let i=r._children,o=(r.tableSize()-1).toString(16).length,s=[],a=0n;for(let f=0;f<i.length;f++){let h=i.get(f);if(h==null)continue;let x=f.toString(16).toUpperCase().padStart(o,"0");if(h instanceof Jt){let g;for await(let y of x6(h,e,null,n))g=y;if(g==null)throw new Error("Could not flush sharded directory, no subshard found");s.push({Name:x,Tsize:Number(g.size),Hash:g.cid}),a+=g.size}else if(DD(h.value)){let g=h.value,y;for await(let E of g.flush(e))y=E,yield y;if(y==null)throw new Error("Did not flush dir");let w=x+h.key;s.push({Name:w,Tsize:Number(y.size),Hash:y.cid}),a+=y.size}else{let g=h.value;if(g.cid==null)continue;let y=x+h.key,w=g.size;s.push({Name:y,Tsize:Number(w),Hash:g.cid}),a+=BigInt(w??0)}}let c=Uint8Array.from(i.bitField().reverse()),u=new X({type:"hamt-sharded-directory",data:c,fanout:BigInt(r.tableSize()),hashType:m6,mtime:t?.mtime,mode:t?.mode}),l={Data:u.marshal(),Links:s},p=fe(Ue(l)),m=await Tr(p,e,n),d=BigInt(p.byteLength)+a;yield{cid:m,unixfs:u,size:d}}function DD(r){return typeof r.flush=="function"}function y6(r,e,t){let n=r._children,i=(r.tableSize()-1).toString(16).length,o=[];for(let u=0;u<n.length;u++){let l=n.get(u);if(l==null)continue;let p=u.toString(16).toUpperCase().padStart(i,"0");if(l instanceof Jt){let m=y6(l,null,t);o.push({Name:p,Tsize:Number(m),Hash:t.cidVersion===0?Uc:Nc})}else if(typeof l.value.flush=="function"){let d=l.value.nodeSize();o.push({Name:p+l.key,Tsize:Number(d),Hash:t.cidVersion===0?Uc:Nc})}else{let m=l.value;if(m.cid==null)continue;let d=p+l.key,f=m.size;o.push({Name:d,Tsize:Number(f),Hash:m.cid})}}let s=Uint8Array.from(n.bitField().reverse()),a=new X({type:"hamt-sharded-directory",data:s,fanout:BigInt(r.tableSize()),hashType:m6,mtime:e?.mtime,mode:e?.mode});return fe(Ue({Data:a.marshal(),Links:o})).length}async function Kg(r,e,t,n){let i=e;e instanceof bo&&e.estimateNodeSize()>t&&(i=await LD(e,n));let o=i.parent;if(o!=null){if(i!==e){if(r!=null&&(r.parent=i),i.parentKey==null)throw new Error("No parent key found");await o.put(i.parentKey,i)}return Kg(i,o,t,n)}return i}async function LD(r,e){let t=new g6({root:r.root,dir:!0,parent:r.parent,parentKey:r.parentKey,path:r.path,dirty:r.dirty,flat:!1,mtime:r.mtime,mode:r.mode},e);for await(let{key:n,child:i}of r.eachChildSeries())await t.put(n,i);return t}var w6=(r="")=>r.split(/(?<!\\)\//).filter(Boolean);async function PD(r,e,t){let n=w6(r.path??""),i=n.length-1,o=e,s="";for(let a=0;a<n.length;a++){let c=n[a];s+=`${s!==""?"/":""}${c}`;let u=a===i;if(o.dirty=!0,o.cid=void 0,o.size=void 0,u)await o.put(c,r),e=await Kg(null,o,t.shardSplitThresholdBytes,t);else{let l=await o.get(c);(l==null||!(l instanceof rn))&&(l=new bo({root:!1,dir:!0,parent:o,parentKey:c,path:s,dirty:!0,flat:!0,mtime:l?.unixfs?.mtime,mode:l?.unixfs?.mode},t)),await o.put(c,l),o=l}}return e}async function*b6(r,e){if(!(r instanceof rn)){r.unixfs?.isDirectory()===!0&&(yield r);return}yield*r.flush(e)}function v6(r){return async function*(t,n){let i=new bo({root:!0,dir:!0,path:"",dirty:!0,flat:!0},r),o,s=!1;for await(let a of t){if(a==null)continue;let c=`${a.originalPath??""}`.split("/")[0];c!=null&&c!==""&&(o==null?(o=c,s=!0):o!==c&&(s=!1)),i=await PD(a,i,r),(a.unixfs==null||!a.unixfs.isDirectory())&&(yield a)}if(r.wrapWithDirectory||s&&i.childCount()>1)yield*b6(i,n);else for await(let a of i.eachChildSeries())a!=null&&(yield*b6(a.child,n))}}async function*Li(r,e,t={}){let n;Symbol.asyncIterator in r||Symbol.iterator in r?n=r:n=[r];let i=t.wrapWithDirectory??!1,o=t.shardSplitThresholdBytes??262144,s=t.shardFanoutBits??8,a=t.cidVersion??1,c=t.rawLeaves??!0,u=t.leafType??"file",l=t.fileImportConcurrency??50,p=t.blockWriteConcurrency??10,m=t.reduceSingleLeafToSelf??!0,d=t.chunker??Cc(),f=t.chunkValidator??P3(),h=t.dagBuilder??L3({chunker:d,chunkValidator:f,wrapWithDirectory:i,layout:t.layout??Rc(),bufferImporter:t.bufferImporter??R3({cidVersion:a,rawLeaves:c,leafType:u,onProgress:t.onProgress}),blockWriteConcurrency:p,reduceSingleLeafToSelf:m,cidVersion:a,onProgress:t.onProgress}),x=t.treeBuilder??v6({wrapWithDirectory:i,shardSplitThresholdBytes:o,shardFanoutBits:s,cidVersion:a,onProgress:t.onProgress});for await(let g of x(Tc(h(n,e),l),e))yield{cid:g.cid,path:g.path,unixfs:g.unixfs,size:g.size}}async function Vp(r,e,t={}){let n=await io(Li([r],e,t));if(n==null)throw(0,Gg.default)(new Error("Nothing imported"),"ERR_INVALID_PARAMS");return n}async function E6(r,e,t={}){let n=await io(Li([r],e,t));if(n==null)throw(0,Gg.default)(new Error("Nothing imported"),"ERR_INVALID_PARAMS");return n}async function A6(r,e,t={}){return Vp({content:r},e,t)}async function S6(r,e,t={}){return Vp({content:r},e,t)}var $D=Q(ke(),1),jD=Q(O6(),1);var $c={cidVersion:1,rawLeaves:!0,layout:Rc({maxChildrenPerNode:1024}),chunker:Cc({chunkSize:1048576})};async function*F6(r,e,t={}){yield*Li(r,e,{...$c,...t})}async function z6(r,e,t={}){let{cid:n}=await A6(r,e,{...$c,...t});return n}async function V6(r,e,t={}){let{cid:n}=await S6(r,e,{...$c,...t});return n}async function M6(r,e,t={}){let{cid:n}=await Vp(r,e,{...$c,...t});return n}async function $6(r,e,t={}){let{cid:n}=await E6({...r,path:r.path??"-"},e,{...$c,...t});return n}var $p=Q(ke(),1);function HD(r){return r[Symbol.asyncIterator]!=null}function qD(r){if(HD(r))return(async()=>{let t;for await(let n of r)t=n;return t})();let e;for(let t of r)e=t;return e}var Pi=qD;var o4=Q(ke(),1);var j6=Q(ke(),1);var KD=async(r,e,t,n,i,o,s,a)=>{let c=await s.get(r,a),u=Ju(c),l=u,p=t;for(;n.length>0;){let m=n[0];if(m in l){n.shift(),p=`${p}/${m}`;let d=z.asCID(l[m]);if(d!=null)return{entry:{type:"object",name:e,path:t,cid:r,node:c,depth:o,size:BigInt(c.length),content:async function*(){yield u}},next:{cid:d,name:m,path:p,toResolve:n}};l=l[m]}else throw(0,j6.default)(new Error(`No property named ${m} found in cbor node ${r}`),"ERR_NO_PROP")}return{entry:{type:"object",name:e,path:t,cid:r,node:c,depth:o,size:BigInt(c.length),content:async function*(){yield u}}}},H6=KD;var q6=Q(ke(),1);var GD=async(r,e,t,n,i,o,s,a)=>{let c=await s.get(r,a),u=ep(c),l=u,p=t;for(;n.length>0;){let m=n[0];if(m in l){n.shift(),p=`${p}/${m}`;let d=z.asCID(l[m]);if(d!=null)return{entry:{type:"object",name:e,path:t,cid:r,node:c,depth:o,size:BigInt(c.length),content:async function*(){yield u}},next:{cid:d,name:m,path:p,toResolve:n}};l=l[m]}else throw(0,q6.default)(new Error(`No property named ${m} found in dag-json node ${r}`),"ERR_NO_PROP")}return{entry:{type:"object",name:e,path:t,cid:r,node:c,depth:o,size:BigInt(c.length),content:async function*(){yield u}}}},K6=GD;var G6=Q(ke(),1);function WD(r,e,t,n){let i=BigInt(r.length),o=BigInt(e+i);return t>=o||n<e?new Uint8Array(0):(n>=e&&n<o&&(r=r.subarray(0,Number(n-e))),t>=e&&t<o&&(r=r.subarray(Number(t-e))),r)}var Ao=WD;var jc=Q(ke(),1),YD=(r,e=0,t=r)=>{let n=BigInt(r),i=BigInt(e??0),o=BigInt(t);if(o!==n&&(o=i+o),o>n&&(o=n),i<0n)throw(0,jc.default)(new Error("Offset must be greater than or equal to 0"),"ERR_INVALID_PARAMS");if(i>n)throw(0,jc.default)(new Error("Offset must be less than the file size"),"ERR_INVALID_PARAMS");if(o<0n)throw(0,jc.default)(new Error("Length must be greater than or equal to 0"),"ERR_INVALID_PARAMS");if(o>n)throw(0,jc.default)(new Error("Length must be less than the file size"),"ERR_INVALID_PARAMS");return{start:i,end:o}},Zs=YD;var XD=r=>{async function*e(t={}){let{start:n,end:i}=Zs(r.length,t.offset,t.length),o=Ao(r,0n,n,i);t.onProgress?.(new P("unixfs:exporter:progress:identity",{bytesRead:BigInt(o.byteLength),totalBytes:i-n,fileSize:BigInt(r.byteLength)})),yield o}return e},JD=async(r,e,t,n,i,o,s,a)=>{if(n.length>0)throw(0,G6.default)(new Error(`No link named ${t} found in raw node ${r}`),"ERR_NOT_FOUND");let c=Ot(r.multihash.bytes);return{entry:{type:"identity",name:e,path:t,cid:r,content:XD(c.digest),depth:o,size:BigInt(c.digest.length),node:c.digest}}},W6=JD;var Y6=Q(ke(),1);var ZD=r=>{async function*e(t={}){let{start:n,end:i}=Zs(r.length,t.offset,t.length),o=Ao(r,0n,n,i);t.onProgress?.(new P("unixfs:exporter:progress:raw",{bytesRead:BigInt(o.byteLength),totalBytes:i-n,fileSize:BigInt(r.byteLength)})),yield o}return e},QD=async(r,e,t,n,i,o,s,a)=>{if(n.length>0)throw(0,Y6.default)(new Error(`No link named ${t} found in raw node ${r}`),"ERR_NOT_FOUND");let c=await s.get(r,a);return{entry:{type:"raw",name:e,path:t,cid:r,content:ZD(c),depth:o,size:BigInt(c.length),node:c}}},X6=QD;var qc=Q(ke(),1);var Hc=Q(ke(),1);var eL=async function(r){return(await vo.encode(r)).slice(0,8).reverse()},tL=async(r,e,t)=>{let n=(e.tableSize()-1).toString(16).length;await Promise.all(r.map(async i=>{if(i.Name==null)throw new Error("Unexpected Link without a Name");if(i.Name.length===n){let o=parseInt(i.Name,16);e._putObjectAt(o,new Jt({hash:t._options.hash,bits:t._options.bits},e,o));return}await t.put(i.Name.substring(2),!0)}))},J6=(r,e)=>r.toString(16).toUpperCase().padStart(e,"0").substring(0,e),rL=r=>{let e=r.bucket,t=[];for(;e._parent!=null;)t.push(e),e=e._parent;return t.push(e),t.reverse()},Z6=async(r,e,t,n,i)=>{if(n==null){if(r.Data==null)throw(0,Hc.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");let p;try{p=X.unmarshal(r.Data)}catch(d){throw(0,Hc.default)(d,"ERR_NOT_UNIXFS")}if(p.type!=="hamt-sharded-directory")throw(0,Hc.default)(new Error("not a HAMT"),"ERR_NOT_UNIXFS");if(p.fanout==null)throw(0,Hc.default)(new Error("missing fanout"),"ERR_NOT_UNIXFS");let m=Js({hashFn:eL,bits:Math.log2(Number(p.fanout))});n={rootBucket:m,hamtDepth:1,lastBucket:m}}let o=(n.lastBucket.tableSize()-1).toString(16).length;await tL(r.Links,n.lastBucket,n.rootBucket);let s=await n.rootBucket._findNewBucketAndPos(e),a=J6(s.pos,o),c=rL(s);c.length>n.hamtDepth&&(n.lastBucket=c[n.hamtDepth],a=J6(n.lastBucket._posAtParent,o));let u=r.Links.find(p=>{if(p.Name==null)return!1;let m=p.Name.substring(0,o),d=p.Name.substring(o);return!(m!==a||d!==""&&d!==e)});if(u==null)return;if(u.Name!=null&&u.Name.substring(o)===e)return u.Hash;n.hamtDepth++;let l=await t.get(u.Hash,i);return r=Ie(l),Z6(r,e,t,n,i)},Q6=Z6;var nL=(r,e,t,n,i,o,s)=>{async function*a(c={}){let u=c.offset??0,l=c.length??e.Links.length,p=e.Links.slice(u,l);c.onProgress?.(new P("unixfs:exporter:walk:directory",{cid:r})),yield*hr(p,m=>fr(m,d=>async()=>{let f=d.Name??"",h=`${n}/${f}`;return(await i(d.Hash,f,h,[],o+1,s,c)).entry}),m=>mo(m,{ordered:!0,concurrency:c.blockReadConcurrency}),m=>Gt(m,d=>d!=null))}return a},e4=nL;var So=Q(ke(),1);async function t4(r,e,t,n,i,o,s){if(e instanceof Uint8Array){let u=Ao(e,n,i,o);t.push(u);return}if(e.Data==null)throw(0,So.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");let a;try{a=X.unmarshal(e.Data)}catch(u){throw(0,So.default)(u,"ERR_NOT_UNIXFS")}if(a.data!=null){let u=a.data,l=Ao(u,n,i,o);t.push(l),n+=BigInt(l.byteLength)}let c=[];if(e.Links.length!==a.blockSizes.length)throw(0,So.default)(new Error("Inconsistent block sizes and dag links"),"ERR_NOT_UNIXFS");for(let u=0;u<e.Links.length;u++){let l=e.Links[u],p=n,m=p+a.blockSizes[u];if((i>=p&&i<m||o>=p&&o<=m||i<p&&o>m)&&c.push({link:l,blockStart:n}),n=m,n>o)break}await hr(c,u=>fr(u,l=>async()=>{let p=await r.get(l.link.Hash,s);return{...l,block:p}}),u=>mo(u,{ordered:!0,concurrency:s.blockReadConcurrency}),async u=>{for await(let{link:l,block:p,blockStart:m}of u){let d;switch(l.Hash.code){case Ve:d=Ie(p);break;case je:d=p;break;default:t.end((0,So.default)(new Error(`Unsupported codec: ${l.Hash.code}`),"ERR_NOT_UNIXFS"));return}let f=new Ct({concurrency:1});f.on("error",h=>{t.end(h)}),f.add(async()=>{s.onProgress?.(new P("unixfs:exporter:walk:file",{cid:l.Hash})),await t4(r,d,t,m,i,o,s)}),await f.onIdle()}}),n>=o&&t.end()}var iL=(r,e,t,n,i,o,s)=>{async function*a(c={}){let u=t.fileSize();if(u===void 0)throw new Error("File was a directory");let{start:l,end:p}=Zs(u,c.offset,c.length);if(p===0n)return;let m=0n,d=p-l,f=Pr();c.onProgress?.(new P("unixfs:exporter:walk:file",{cid:r})),t4(s,e,f,0n,l,p,c).catch(h=>{f.end(h)});for await(let h of f)if(h!=null){if(m+=BigInt(h.byteLength),m>d)throw f.end(),(0,So.default)(new Error("Read too many bytes - the file size reported by the UnixFS data in the root node may be incorrect"),"ERR_OVER_READ");m===d&&f.end(),c.onProgress?.(new P("unixfs:exporter:progress:unixfs:file",{bytesRead:m,totalBytes:d,fileSize:u})),yield h}if(m<d)throw(0,So.default)(new Error("Traversed entire DAG but did not read enough bytes"),"ERR_UNDER_READ")}return a},Zg=iL;var Mp=Q(ke(),1);var oL=(r,e,t,n,i,o,s)=>{function a(c={}){return c.onProgress?.(new P("unixfs:exporter:walk:hamt-sharded-directory",{cid:r})),r4(e,n,i,o,s,c)}return a};async function*r4(r,e,t,n,i,o){let s=r.Links;if(r.Data==null)throw(0,Mp.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");let a;try{a=X.unmarshal(r.Data)}catch(l){throw(0,Mp.default)(l,"ERR_NOT_UNIXFS")}if(a.fanout==null)throw(0,Mp.default)(new Error("missing fanout"),"ERR_NOT_UNIXFS");let c=(a.fanout-1n).toString(16).length,u=hr(s,l=>fr(l,p=>async()=>{let m=p.Name!=null?p.Name.substring(c):null;if(m!=null&&m!==""){let d=await t(p.Hash,m,`${e}/${m}`,[],n+1,i,o);return{entries:d.entry==null?[]:[d.entry]}}else{let d=await i.get(p.Hash,o);return r=Ie(d),o.onProgress?.(new P("unixfs:exporter:walk:hamt-sharded-directory",{cid:p.Hash})),{entries:r4(r,e,t,n,i,o)}}}),l=>mo(l,{ordered:!0,concurrency:o.blockReadConcurrency}));for await(let{entries:l}of u)yield*l}var n4=oL;var sL=(r,e)=>r.Links.find(n=>n.Name===e)?.Hash,aL={raw:Zg,file:Zg,directory:e4,"hamt-sharded-directory":n4,metadata:(r,e,t,n,i,o,s)=>()=>[],symlink:(r,e,t,n,i,o,s)=>()=>[]},cL=async(r,e,t,n,i,o,s,a)=>{let c=await s.get(r,a),u=Ie(c),l,p;if(e==null&&(e=r.toString()),u.Data==null)throw(0,qc.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");try{l=X.unmarshal(u.Data)}catch(d){throw(0,qc.default)(d,"ERR_NOT_UNIXFS")}if(t==null&&(t=e),n.length>0){let d;if(l?.type==="hamt-sharded-directory"?d=await Q6(u,n[0],s):d=sL(u,n[0]),d==null)throw(0,qc.default)(new Error("file does not exist"),"ERR_NOT_FOUND");let f=n.shift(),h=`${t}/${f}`;p={cid:d,toResolve:n,name:f??"",path:h}}let m=aL[l.type](r,u,l,t,i,o,s);if(m==null)throw(0,qc.default)(new Error("could not find content exporter"),"ERR_NOT_FOUND");return l.isDirectory()?{entry:{type:"directory",name:e,path:t,cid:r,content:m,unixfs:l,depth:o,node:u,size:l.fileSize()},next:p}:{entry:{type:"file",name:e,path:t,cid:r,content:m,unixfs:l,depth:o,node:u,size:l.fileSize()},next:p}},i4=cL;var lL={[Ve]:i4,[je]:X6,[Ei]:H6,[Si]:K6,[It.code]:W6},s4=async(r,e,t,n,i,o,s)=>{let a=lL[r.code];if(a==null)throw(0,o4.default)(new Error(`No resolver for code ${r.code}`),"ERR_NO_RESOLVER");return a(r,e,t,n,s4,i,o,s)},a4=s4;var uL=(r="")=>(r.trim().match(/([^\\^/]|\\\/)+/g)??[]).filter(Boolean),pL=r=>{if(r instanceof Uint8Array)return{cid:z.decode(r),toResolve:[]};let e=z.asCID(r);if(e!=null)return{cid:e,toResolve:[]};if(typeof r=="string"){r.indexOf("/ipfs/")===0&&(r=r.substring(6));let t=uL(r);return{cid:z.parse(t[0]),toResolve:t.slice(1)}}throw(0,$p.default)(new Error(`Unknown path type ${r}`),"ERR_BAD_PATH")};async function*Qg(r,e,t={}){let{cid:n,toResolve:i}=pL(r),o=n.toString(),s=o,a=i.length;for(;;){let c=await a4(n,o,s,i,a,e,t);if(c.entry==null&&c.next==null)throw(0,$p.default)(new Error(`Could not resolve ${r}`),"ERR_NOT_FOUND");if(c.entry!=null&&(yield c.entry),c.next==null)return;i=c.next.toResolve,n=c.next.cid,o=c.next.name,s=c.next.path}}async function lt(r,e,t={}){let n=await Pi(Qg(r,e,t));if(n==null)throw(0,$p.default)(new Error(`Could not resolve ${r}`),"ERR_NOT_FOUND");return n}async function*jp(r,e,t={}){let n=await lt(r,e,t);if(n==null)return;if(yield n,n.type==="directory")for await(let o of i(n,t))yield o;async function*i(o,s){for await(let a of o.content(s))yield a,!(a instanceof Uint8Array)&&a.type==="directory"&&(yield*i(a,s))}}var g4=Q(m4(),1),mt=g4.default;var Cr=class extends Error{name;code;constructor(e,t,n){super(e),this.name=t,this.code=n}},on=class extends Cr{constructor(e="not a Unixfs node"){super(e,"NotUnixFSError","ERR_NOT_UNIXFS")}},St=class extends Cr{constructor(e="invalid PBNode"){super(e,"InvalidPBNodeError","ERR_INVALID_PBNODE")}},Wn=class extends Cr{constructor(e="unknown error"){super(e,"InvalidPBNodeError","ERR_UNKNOWN_ERROR")}},Kc=class extends Cr{constructor(e="path already exists"){super(e,"AlreadyExistsError","ERR_ALREADY_EXISTS")}},Kp=class extends Cr{constructor(e="path does not exist"){super(e,"DoesNotExistError","ERR_DOES_NOT_EXIST")}},ta=class extends Cr{constructor(e="no content"){super(e,"NoContentError","ERR_NO_CONTENT")}},Gp=class extends Cr{constructor(e="not a file"){super(e,"NotAFileError","ERR_NOT_A_FILE")}},Oi=class extends Cr{constructor(e="not a directory"){super(e,"NotADirectoryError","ERR_NOT_A_DIRECTORY")}},gt=class extends Cr{constructor(e="invalid parameters"){super(e,"InvalidParametersError","ERR_INVALID_PARAMETERS")}};var ix=Q(Dp(),1);function Yp(r){function e(t){return t instanceof Wp?t:new Wp(t,r)}return e}var Wp=class{_value;_hashFn;_depth;_availableBits;_currentBufferIndex;_buffers;constructor(e,t){if(!(e instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=e,this._hashFn=t,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(e){let t=e;for(;this._availableBits<t;)await this._produceMoreBits();let n=0;for(;t>0;){let i=this._buffers[this._currentBufferIndex],o=Math.min(i.availableBits(),t),s=i.take(o);n=(n<<o)+s,t-=o,this._availableBits-=o,i.availableBits()===0&&this._currentBufferIndex++}return n}untake(e){let t=e;for(;t>0;){let n=this._buffers[this._currentBufferIndex],i=Math.min(n.totalBits()-n.availableBits(),t);n.untake(i),t-=i,this._availableBits+=i,this._currentBufferIndex>0&&n.totalBits()===n.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;let e=this._depth>0?ze([this._value,Uint8Array.from([this._depth])]):this._value,t=await this._hashFn(e),n=new tx(t);this._buffers.push(n),this._availableBits+=n.availableBits()}},xL=[255,254,252,248,240,224,192,128],yL=[1,3,7,15,31,63,127,255],tx=class{_value;_currentBytePos;_currentBitPos;constructor(e){this._value=e,this._currentBytePos=e.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take(e){let t=e,n=0;for(;t>0&&this._haveBits();){let i=this._value[this._currentBytePos],o=this._currentBitPos+1,s=Math.min(o,t),a=wL(i,o-s,s);n=(n<<s)+a,t-=s,this._currentBitPos-=s,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return n}untake(e){for(this._currentBitPos+=e;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function wL(r,e,t){let n=bL(e,t);return(r&n)>>>e}function bL(r,e){return xL[r]&yL[Math.min(e+r-1,7)]}var Gc=BigInt(vo.code),Bo=8;async function ra(r){return(await vo.encode(r)).subarray(0,8).reverse()}var w4=Q(Dp(),1);var Rr=async(r,e,t)=>{t.codec==null&&(t.codec=Ke);let n=await ae.digest(r),i=z.create(t.cidVersion,t.codec.code,n);return await e.put(i,r,{...t,signal:t.signal}),i};var rx=class{options;root;dir;path;dirty;flat;parent;parentKey;unixfs;mode;mtime;cid;size;nodeSize;constructor(e,t){this.options=t??{},this.root=e.root,this.dir=e.dir,this.path=e.path,this.dirty=e.dirty,this.flat=e.flat,this.parent=e.parent,this.parentKey=e.parentKey,this.unixfs=e.unixfs,this.mode=e.mode,this.mtime=e.mtime}},Xp=class extends rx{_bucket;constructor(e,t){super(e,t),this._bucket=Js({hashFn:ra,bits:8})}async put(e,t){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,await this._bucket.put(e,t)}async get(e){return this._bucket.get(e)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(let{key:e,value:t}of this._bucket.eachLeafSeries())yield{key:e,child:t}}estimateNodeSize(){return this.nodeSize!==void 0?this.nodeSize:(this.nodeSize=y4(this._bucket,this,this.options),this.nodeSize)}async*flush(e){for await(let t of x4(this._bucket,e,this,this.options))yield{...t,path:this.path}}};async function*x4(r,e,t,n){let i=r._children,o=[],s=0n;for(let d=0;d<i.length;d++){let f=i.get(d);if(f==null)continue;let h=d.toString(16).toUpperCase().padStart(2,"0");if(f instanceof Jt){let x;for await(let g of x4(f,e,null,n))x=g;if(x==null)throw new Error("Could not flush sharded directory, no subshard found");o.push({Name:h,Tsize:Number(x.size),Hash:x.cid}),s+=x.size}else if(vL(f.value)){let x=f.value,g;for await(let w of x.flush(e))g=w,yield g;if(g==null)throw new Error("Did not flush dir");let y=h+f.key;o.push({Name:y,Tsize:Number(g.size),Hash:g.cid}),s+=g.size}else{let x=f.value;if(x.cid==null)continue;let g=h+f.key,y=x.size;o.push({Name:g,Tsize:Number(y),Hash:x.cid}),s+=BigInt(y??0)}}let a=Uint8Array.from(i.bitField().reverse()),c=new X({type:"hamt-sharded-directory",data:a,fanout:BigInt(r.tableSize()),hashType:Gc,mtime:t?.mtime,mode:t?.mode}),u={Data:c.marshal(),Links:o},l=fe(Ue(u)),p=await Rr(l,e,n),m=BigInt(l.byteLength)+s;yield{cid:p,unixfs:c,size:m}}function vL(r){return typeof r.flush=="function"}function y4(r,e,t){let n=r._children,i=[];for(let c=0;c<n.length;c++){let u=n.get(c);if(u==null)continue;let l=c.toString(16).toUpperCase().padStart(2,"0");if(u instanceof Jt){let p=y4(u,null,t);i.push({Name:l,Tsize:Number(p),Hash:t.cidVersion===0?Jp:Zp})}else if(typeof u.value.flush=="function"){let m=u.value.nodeSize();i.push({Name:l+u.key,Tsize:Number(m),Hash:t.cidVersion===0?Jp:Zp})}else{let p=u.value;if(p.cid==null)continue;let m=l+u.key,d=p.size;i.push({Name:m,Tsize:Number(d),Hash:p.cid})}}let o=Uint8Array.from(n.bitField().reverse()),s=new X({type:"hamt-sharded-directory",data:o,fanout:BigInt(r.tableSize()),hashType:Gc,mtime:e?.mtime,mode:e?.mode});return fe(Ue({Data:s.marshal(),Links:i})).length}var Jp=z.parse("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"),Zp=z.parse("zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi");var nx=ue("helia:unixfs:commands:utils:hamt-utils"),Qp=r=>r.toString(16).toUpperCase().padStart(2,"0").substring(0,2),b4=async(r,e,t)=>{let n=new Xp({root:!0,dir:!0,parent:void 0,parentKey:void 0,path:"",dirty:!0,flat:!1,mtime:t.mtime,mode:t.mode},t);for(let o=0;o<e.length;o++)await n._bucket.put(e[o].name,{size:e[o].size,cid:e[o].cid});let i=await Pi(n.flush(r));if(i==null)throw new Error("Flushing shard yielded no result");return i},ed=async(r,e,t)=>{let n=X.unmarshal(r[0].node.Data??new Uint8Array(0)),i=BigInt(Math.pow(2,Bo));r.reverse();let o,s;for(let a=0;a<r.length;a++){let c=a===r.length-1,u=r[a],l=Uint8Array.from(u.children.bitField().reverse()),p=new X({type:"hamt-sharded-directory",data:l,fanout:i,hashType:Gc});c&&(p.mtime=n.mtime,p.mode=n.mode),s={Data:p.marshal(),Links:u.node.Links};let m=fe(Ue(s));if(o=await Rr(m,e,t),!c){let d=r[a+1];if(d==null)throw new Error("Was not operating on shard root but also had no parent?");nx("updating link in parent sub-shard with prefix %s",d.prefix),d.node.Links=d.node.Links.filter(f=>f.Name!==d.prefix),d.node.Links.push({Name:d.prefix,Hash:o,Tsize:u.node.Links.reduce((f,h)=>f+(h.Tsize??0),m.byteLength)})}}if(o==null||s==null)throw new Error("Noting persisted");return{cid:o,node:s}},td=async(r,e,t,n)=>{let o=Yp(ra)(Z(e)),s=[];for(;;){let a=await t.get(r,n),c=Ie(a),u=new w4.default,l=await o.take(Bo),p=Qp(l);s.push({prefix:p,children:u,node:c});let m;for(let f of c.Links){let h=f.Name??"";if(h.length<2)throw new Error("Invalid HAMT - link name was too short");let x=parseInt(h.substring(0,2),16);u.set(x,!0),h.startsWith(p)&&(m=f)}if(m==null){nx("no link found with prefix %s for %s",p,e);break}let d=m.Name??"";if(d.length<2)throw new Error("Invalid HAMT - link name was too short");if(d.length===2){r=m.Hash,nx("descend into sub-shard with prefix %s",d);continue}break}return{path:s,hash:o}};async function rd(r,e,t,n){if(r.Data==null)throw new Error("DagPB node had no data");let i=X.unmarshal(r.Data),o;if(i.type==="directory")o=EL(r);else if(i.type==="hamt-sharded-directory")o=await v4(r,0,t,e,n);else throw new Error("Can only estimate the size of directories or shards");return o>t}function EL(r){let e=0;for(let t of r.Links)e+=(t.Name??"").length,e+=t.Hash.version===1?Zp.bytes.byteLength:Jp.bytes.byteLength;return e}async function v4(r,e,t,n,i){if(e>t)return t;if(r.Data==null||!X.unmarshal(r.Data).isDirectory())return e;for(let s of r.Links){let a=s.Name??"";if(a=a.substring(2),e+=a.length,e+=s.Hash.bytes.byteLength,s.Hash.code===Ve){let c=await n.get(s.Hash,i),u=Ie(c);e+=await v4(u,e,t,n,i)}}return e}var sn=ue("helia:unixfs:components:utils:add-link");async function na(r,e,t,n){if(r.node.Data==null)throw new gt("Invalid parent passed to addLink");if(X.unmarshal(r.node.Data).type==="hamt-sharded-directory")return sn("adding link to sharded directory"),BL(r,e,t,n);sn(`adding ${e.Name} (${e.Hash}) to regular directory`);let o=await SL(r,e,t,n);if(await rd(o.node,t,n.shardSplitThresholdBytes,n)){sn("converting directory to sharded directory");let s=await AL(o,t);o.cid=s.cid,o.node=Ie(await t.get(s.cid,n))}return o}var AL=async(r,e)=>{if(r.node.Data==null)throw new gt("Invalid parent passed to convertToShardedDirectory");let t=X.unmarshal(r.node.Data),n=await b4(e,r.node.Links.map(i=>({name:i.Name??"",size:BigInt(i.Tsize??0),cid:i.Hash})),{mode:t.mode,mtime:t.mtime,cidVersion:r.cid.version});return sn(`converted directory to sharded directory ${n.cid}`),n},SL=async(r,e,t,n)=>{let i=r.node.Links.filter(l=>{let p=l.Name===e.Name;if(p&&!n.allowOverwriting)throw new Kc;return!p});if(i.push(e),r.node.Data==null)throw new St("Parent node with no data passed to addToDirectory");let o=X.unmarshal(r.node.Data),s;if(o.mtime!=null){let l=Date.now(),p=Math.floor(l/1e3);o.mtime={secs:BigInt(p),nsecs:(l-p*1e3)*1e3},s=o.marshal()}else s=r.node.Data;r.node=Ue({Data:s,Links:i});let a=fe(r.node),c=await ae.digest(a),u=z.create(r.cid.version,Ve,c);return await t.put(u,a),{node:r.node,cid:u}},BL=async(r,e,t,n)=>{let{path:i,hash:o}=await td(r.cid,e.Name,t,n),s=i[i.length-1];if(s==null)throw new Error("Invalid HAMT, could not generate path");let a=s.prefix,c=parseInt(a,16);sn("next prefix for %s is %s",e.Name,a);let u=`${a}${e.Name}`,l=s.node.Links.find(p=>(p.Name??"").startsWith(a));if(l!=null)if(sn("link %s was present in shard",u),l.Name===u){if(!n.allowOverwriting)throw new Kc;sn("overwriting %s in subshard",e.Name),s.node.Links=s.node.Links.filter(p=>p.Name!==u),s.node.Links.push({Name:u,Hash:e.Hash,Tsize:e.Tsize})}else{if(l.Name?.length===2)throw new Error("Existing link was subshard?!");{sn("prefix %s already exists, creating new subshard",a);let p=s.node.Links.findIndex(x=>x.Name?.startsWith(a)),m=s.node.Links.splice(p,1)[0],d=(m.Name??"").substring(2),h=Yp(ra)(Z(d));for(let x=0;x<i.length;x++)await h.take(Bo);for(;;){let x=await h.take(Bo),g=Qp(x);m.Name=`${g}${d}`;let y=await o.take(Bo),w=Qp(y);if(g===w){let B=new ix.default;B.set(y,!0),i.push({prefix:w,children:B,node:{Links:[]}});continue}let E=new ix.default;E.set(y,!0),E.set(x,!0),i.push({prefix:a,children:E,node:{Links:[m,{Name:`${w}${e.Name}`,Hash:e.Hash,Tsize:e.Tsize}]}});break}}}else sn("link %s was not present in sub-shard",u),e.Name=u,s.node.Links.push(e),s.children.set(c,!0),sn("adding %s to existing sub-shard",u);return ed(i,t,n)};async function Fi(r,e,t={}){let n=await lt(r,e,t);if(n.type!=="directory")throw new Oi(`${r.toString()} was not a UnixFS directory`);return{cid:r,node:n.node}}async function ia(r,e,t,n){let i=await lt(r,t,n);if(i.type!=="directory"&&i.type!=="file"&&i.type!=="raw")throw new on(`${r.toString()} was not a UnixFS node`);return{Name:e,Tsize:i.node instanceof Uint8Array?i.node.byteLength:kL(i.node),Hash:r}}function kL(r){let e=r.Links.reduce((t,n)=>t+(n.Tsize??0),0);return fe(r).byteLength+e}var ox=ue("helia:unixfs:components:utils:resolve");async function an(r,e,t,n){if(e==null||e==="")return{cid:r};ox('resolve "%s" under %c',e,r);let i=e.split("/").filter(Boolean),o=[{name:"",cid:r,size:0n}];for(let s=0;s<i.length;s++){let a=i[s],c=await lt(r,t,n);if(ox('resolving "%s"',a,c),c.type==="file"){if(s<i.length-1)throw new gt("Path was invalid");r=c.cid}else if(c.type==="directory"){let u;for await(let l of c.content())if(l.name===a){u=l.cid;break}if(u==null)throw new Kp("Could not find path in directory");r=u,o.push({name:a,cid:r,size:c.size})}else throw new gt("Could not resolve path")}return ox("resolved %s to %c",e,r),{cid:r,path:e,segments:o}}async function oa(r,e,t,n){if(e.segments==null||e.segments.length===0)return r;let i=e.segments.pop();if(i==null)throw new Error("Insufficient segments");i.cid=r,e.segments.reverse();for(let o of e.segments){let[s,a]=await Promise.all([Fi(o.cid,t,n),ia(i.cid,i.name,t,n)]);r=(await na(s,a,t,{...n,allowOverwriting:!0,cidVersion:r.version})).cid,o.cid=r,i=o}return r}var IL=mt.bind({ignoreUndefined:!0}),_L={};async function*E4(r,e,t={}){let n=IL(_L,t),i=await an(r,n.path,e,n),o=await lt(i.cid,e,n);if(o.type!=="file"&&o.type!=="raw")throw new Gp;if(o.content==null)throw new ta;yield*o.content(n)}var TL=mt.bind({ignoreUndefined:!0}),CL=ue("helia:unixfs:chmod"),RL={recursive:!1,shardSplitThresholdBytes:262144};async function A4(r,e,t,n={}){let i=TL(RL,n),o=await an(r,i.path,t,n);if(CL("chmod %c %d",o.cid,e),i.recursive){let m=await hr(async function*(){for await(let d of jp(o.cid,t,n)){let f,h=[];if(d.type==="raw")f=new X({type:"file",data:d.node});else if(d.type==="file"||d.type==="directory")f=d.unixfs,h=d.node.Links;else throw new on;f.mode=e;let x={Data:f.marshal(),Links:h};yield{path:d.path,content:x}}},d=>Li(d,t,{...i,dagBuilder:async function*(f,h){for await(let x of f)yield async function(){let g=x.content,y=fe(g),w=await Rr(y,h,{...i,cidVersion:r.version});if(g.Data==null)throw new St(`${w} had no data`);let E=X.unmarshal(g.Data);return{cid:w,size:BigInt(y.length),path:x.path,unixfs:E}}}}),async d=>Pi(d));if(m==null)throw new Wn(`Could not chmod ${o.cid.toString()}`);return oa(m.cid,o,t,i)}let s=await t.get(o.cid,n),a,c=[];if(o.cid.code===je)a=new X({type:"file",data:s});else{let m=Ie(s);if(m.Data==null)throw new St(`${o.cid.toString()} had no data`);c=m.Links,a=X.unmarshal(m.Data)}a.mode=e;let u=fe({Data:a.marshal(),Links:c}),l=await ae.digest(u),p=z.create(o.cid.version,Ve,l);return await t.put(p,u),oa(p,o,t,i)}var UL=mt.bind({ignoreUndefined:!0}),NL=ue("helia:unixfs:cp"),DL={force:!1,shardSplitThresholdBytes:262144};async function S4(r,e,t,n,i={}){let o=UL(DL,i);if(t.includes("/"))throw new gt("Name must not have slashes");let[s,a]=await Promise.all([Fi(e,n,o),ia(r,t,n,o)]);return NL('Adding %c as "%s" to %c',r,t,e),(await na(s,a,n,{allowOverwriting:o.force,cidVersion:e.version,...o})).cid}var LL=mt.bind({ignoreUndefined:!0}),PL={};async function*B4(r,e,t={}){let n=LL(PL,t),i=await an(r,n.path,e,n),o=await lt(i.cid,e);if(o.type==="file"||o.type==="raw"){yield o;return}if(o.content==null)throw new ta;if(o.type!=="directory")throw new Oi;yield*o.content({offset:t.offset,length:t.length})}var OL=mt.bind({ignoreUndefined:!0}),k4=ue("helia:unixfs:mkdir"),FL={cidVersion:1,force:!1,shardSplitThresholdBytes:262144};async function I4(r,e,t,n={}){let i=OL(FL,n);if(e.includes("/"))throw new gt("Path must not have slashes");if((await lt(r,t,n)).type!=="directory")throw new Oi(`${r.toString()} was not a UnixFS directory`);k4("creating %s",e);let a={Data:new X({type:"directory",mode:i.mode,mtime:i.mtime}).marshal(),Links:[]},c=fe(a),u=await ae.digest(c),l=z.create(i.cidVersion,Ve,u);await t.put(l,c);let[p,m]=await Promise.all([Fi(r,t,i),ia(l,e,t,i)]);return k4("adding empty dir called %s to %c",e,r),(await na(p,m,t,{...i,allowOverwriting:i.force})).cid}var nd=ue("helia:unixfs:utils:remove-link");async function _4(r,e,t,n){if(r.node.Data==null)throw new St("Parent node had no data");if(X.unmarshal(r.node.Data).type==="hamt-sharded-directory"){nd(`removing ${e} from sharded directory`);let o=await VL(r,e,t,n);return await rd(o.node,t,n.shardSplitThresholdBytes,n)?o:(nd("converting shard to flat directory %c",r.cid),ML(o,t,n))}return nd(`removing link ${e} regular directory`),zL(r,e,t,n)}var zL=async(r,e,t,n)=>{r.node.Links=r.node.Links.filter(s=>s.Name!==e);let i=fe(r.node),o=await Rr(i,t,{...n,cidVersion:r.cid.version});return nd(`Updated regular directory ${o}`),{node:r.node,cid:o}},VL=async(r,e,t,n)=>{let{path:i}=await td(r.cid,e,t,n),o=i[i.length-1];if(o==null)throw new Error("Invalid HAMT, could not generate path");let s=o.node.Links.filter(u=>(u.Name??"").substring(2)===e).map(u=>u.Name).pop();if(s==null)throw new Error("File not found");let a=s.substring(0,2),c=parseInt(a,16);if(o.node.Links=o.node.Links.filter(u=>u.Name!==s),o.children.unset(c),o.node.Links.length===1)for(;i.length!==1;){let u=i[i.length-1];if(u==null||u.node.Links.length>1)break;i.pop();let l=i[i.length-1];if(l==null)break;let p=u.node.Links[0];l.node.Links=l.node.Links.filter(m=>!(m.Name??"").startsWith(l.prefix)),l.node.Links.push({Hash:p.Hash,Name:`${l.prefix}${(p.Name??"").substring(2)}`,Tsize:p.Tsize})}return ed(i,t,n)},ML=async(r,e,t)=>{if(r.node.Data==null)throw new gt("Invalid parent passed to convertToFlatDirectory");let n={Links:[]},i=await lt(r.cid,e);if(i.type!=="directory")throw new Error("Unexpected node type");for await(let c of i.content()){let u=0;c.node instanceof Uint8Array?u=c.node.byteLength:u=fe(c.node).length,n.Links.push({Hash:c.cid,Name:c.name,Tsize:u})}let o=X.unmarshal(r.node.Data);n.Data=new X({type:"directory",mode:o.mode,mtime:o.mtime}).marshal();let s=fe(Ue(n));return{cid:await Rr(s,e,{codec:Ke,cidVersion:r.cid.version,signal:t.signal}),node:n}};var $L=mt.bind({ignoreUndefined:!0}),jL=ue("helia:unixfs:rm"),HL={shardSplitThresholdBytes:262144};async function T4(r,e,t,n={}){let i=$L(HL,n);if(e.includes("/"))throw new gt("Name must not have slashes");let o=await Fi(r,t,i);return jL("Removing %s from %c",e,r),(await _4(o,e,t,{...i,cidVersion:r.version})).cid}var qL=mt.bind({ignoreUndefined:!0}),KL=ue("helia:unixfs:stat"),GL={};async function C4(r,e,t={}){let n=qL(GL,t),i=await an(r,t.path,e,n);KL("stat %c",i.cid);let o=await lt(i.cid,e,n);if(o.type!=="file"&&o.type!=="directory"&&o.type!=="raw")throw new on;let s=0n,a=0n,c=0n,u=0n,l=0,p,m,d=o.type,f;if(o.type==="raw"&&(s=BigInt(o.node.byteLength),a=BigInt(o.node.byteLength),c=BigInt(o.node.byteLength),u=BigInt(o.node.byteLength),l=1),o.type==="directory"&&(s=0n,a=BigInt(o.unixfs.marshal().byteLength),c=0n,u=a,l=1,p=o.unixfs.mode,m=o.unixfs.mtime,f=o.unixfs),o.type==="file"){let h=await R4(i.cid,e,n);s=o.unixfs.fileSize(),a=BigInt((o.node.Data?.byteLength??0)+o.node.Links.reduce((x,g)=>x+(g.Tsize??0),0)),c=BigInt(h.localFileSize),u=BigInt(h.localDagSize),l=h.blocks,p=o.unixfs.mode,m=o.unixfs.mtime,f=o.unixfs}return{cid:i.cid,mode:p,mtime:m,fileSize:s,dagSize:a,localFileSize:c,localDagSize:u,blocks:l,type:d,unixfs:f}}async function R4(r,e,t){let n={localFileSize:0,localDagSize:0,blocks:0};if(await e.has(r,t)){let i=await e.get(r,t);if(n.blocks++,n.localDagSize+=i.byteLength,r.code===je)n.localFileSize+=i.byteLength;else if(r.code===Ve){let o=Ie(i);if(o.Links.length>0)for(let s of o.Links){let a=await R4(s.Hash,e,t);n.localFileSize+=a.localFileSize,n.localDagSize+=a.localDagSize,n.blocks+=a.blocks}else{if(o.Data==null)throw new St(`PBNode ${r.toString()} had no data`);let s=X.unmarshal(o.Data);if(s.data==null)throw new St(`UnixFS node ${r.toString()} had no data`);n.localFileSize+=s.data.byteLength??0}}else throw new Wn(`${r.toString()} was neither DAG_PB nor RAW`)}return n}var WL=mt.bind({ignoreUndefined:!0}),YL=ue("helia:unixfs:touch"),XL={recursive:!1,shardSplitThresholdBytes:262144};async function U4(r,e,t={}){let n=WL(XL,t),i=await an(r,n.path,e,n),o=n.mtime??{secs:BigInt(Math.round(Date.now()/1e3)),nsecs:0};if(YL("touch %c %o",i.cid,o),n.recursive){let m=await hr(async function*(){for await(let d of jp(i.cid,e)){let f,h;if(d.type==="raw")f=new X({data:d.node}),h=[];else if(d.type==="file"||d.type==="directory")f=d.unixfs,h=d.node.Links;else throw new on;f.mtime=o;let x={Data:f.marshal(),Links:h};yield{path:d.path,content:x}}},d=>Li(d,e,{...n,dagBuilder:async function*(f,h){for await(let x of f)yield async function(){let g=x.content,y=fe(g),w=await Rr(y,h,{...n,cidVersion:r.version});if(g.Data==null)throw new St(`${w} had no data`);let E=X.unmarshal(g.Data);return{cid:w,size:BigInt(y.length),path:x.path,unixfs:E}}}}),async d=>Pi(d));if(m==null)throw new Wn(`Could not chmod ${i.cid.toString()}`);return oa(m.cid,i,e,n)}let s=await e.get(i.cid,t),a,c=[];if(i.cid.code===je)a=new X({data:s});else{let m=Ie(s);if(c=m.Links,m.Data==null)throw new St(`${i.cid.toString()} had no data`);a=X.unmarshal(m.Data)}a.mtime=o;let u=fe({Data:a.marshal(),Links:c}),l=await ae.digest(u),p=z.create(i.cid.version,Ve,l);return await e.put(p,u),oa(p,i,e,n)}var sx=class{components;constructor(e){this.components=e}async*addAll(e,t={}){yield*F6(e,this.components.blockstore,t)}async addBytes(e,t={}){return z6(e,this.components.blockstore,t)}async addByteStream(e,t={}){return V6(e,this.components.blockstore,t)}async addFile(e,t={}){return M6(e,this.components.blockstore,t)}async addDirectory(e={},t={}){return $6(e,this.components.blockstore,t)}async*cat(e,t={}){yield*E4(e,this.components.blockstore,t)}async chmod(e,t,n={}){return A4(e,t,this.components.blockstore,n)}async cp(e,t,n,i={}){return S4(e,t,n,this.components.blockstore,i)}async*ls(e,t={}){yield*B4(e,this.components.blockstore,t)}async mkdir(e,t,n={}){return I4(e,t,this.components.blockstore,n)}async rm(e,t,n={}){return T4(e,t,this.components.blockstore,n)}async stat(e,t={}){return C4(e,this.components.blockstore,t)}async touch(e,t={}){return U4(e,this.components.blockstore,t)}};function N4(r){return new sx(r)}var X4=Q(Y4(),1),wP="application/octet-stream",bP=/^(<\?xml[^>]+>)?[^<^\w]+<svg/ig,vP=[async({bytes:r})=>bP.test(new TextDecoder().decode(r.slice(0,64)))?"image/svg+xml":void 0,async({path:r})=>{let e=X4.default.lookup(r);if(e!==!1)return e}],EP={"video/quicktime":"video/mp4"};function AP(r){return EP[r]??r}async function J4(r){for(let e of vP){let t=await e(r);if(t!==void 0)return AP(t)}return wP}async function Z4(r,e,t,n){let i=t.forComponent("helia:verified-fetch:get-stream-and-content-type"),o=r[Symbol.asyncIterator](),{value:s,done:a}=await o.next();if(a===!0)throw i.error("No content found for path",e),new Error("No content found");let c=await J4({bytes:s,path:e}),u=new ReadableStream({async start(l){n?.onProgress?.(new P("verified-fetch:request:progress:chunk")),l.enqueue(s)},async pull(l){let{value:p,done:m}=await o.next();if(m===!0){p!=null&&(n?.onProgress?.(new P("verified-fetch:request:progress:chunk")),l.enqueue(p)),l.close();return}n?.onProgress?.(new P("verified-fetch:request:progress:chunk")),l.enqueue(p)}});return{contentType:c,stream:u}}var Q4=Q(K0(),1),md=class{lru;constructor(e){this.lru=(0,Q4.default)(e)}get(e){let t=this.lru.get(e);if(t!=null){if(t.expire!=null&&t.expire<Date.now()){this.lru.remove(e);return}return t.value}}set(e,t,n){this.lru.set(e,{value:t,expire:Date.now()+n})}has(e){return this.get(e)!=null}remove(e){this.lru.remove(e)}clear(){this.lru.clear()}};var gx=new md(1e3),SP=/^(?<protocol>ip[fn]s):\/\/(?<cidOrPeerIdOrDnsLink>[^/$?]+)\/?(?<path>[^$?]*)\??(?<queryString>.*)$/;async function e8({urlString:r,ipns:e,logger:t},n){let i=t.forComponent("helia:verified-fetch:parse-url-string"),o=r.match(SP);if(o==null||o.groups==null)throw new TypeError(`Invalid URL: ${r}, please use ipfs:// or ipns:// URLs only.`);let{protocol:s,cidOrPeerIdOrDnsLink:a,path:c,queryString:u}=o.groups,l,p,m=[];if(s==="ipfs")try{l=z.parse(a)}catch(x){i.error(x),m.push(new TypeError("Invalid CID for ipfs://<cid> URL"))}else{let x=gx.get(a);if(x!=null)l=x.cid,p=x.path,i.trace("resolved %s to %c from cache",a,l);else{i.trace("Attempting to resolve PeerId for %s",a);let g=null;try{g=mr(a),x=await e.resolve(g,{onProgress:n?.onProgress}),l=x?.cid,p=x?.path,i.trace("resolved %s to %c",a,l),gx.set(a,x,60*1e3*2)}catch(y){g==null?(i.error('Could not parse PeerId string "%s"',a,y),m.push(new TypeError(`Could not parse PeerId in ipns url "${a}", ${y.message}`))):(i.error("Could not resolve PeerId %c",g,y),m.push(new TypeError(`Could not resolve PeerId "${a}", ${y.message}`)))}if(l==null){i.trace("Attempting to resolve DNSLink for %s",a);try{x=await e.resolveDns(a,{onProgress:n?.onProgress}),l=x?.cid,p=x?.path,i.trace("resolved %s to %c",a,l),gx.set(a,x,60*1e3*2)}catch(y){i.error('Could not resolve DnsLink for "%s"',a,y),m.push(y)}}}}if(l==null)throw new AggregateError(m,`Invalid resource. Cannot determine CID from URL "${r}"`);let d={};if(u!=null&&u.length>0){let x=u.split("&");for(let g of x){let[y,w]=g.split("=");d[y]=decodeURIComponent(w)}}let f=[];c.length>0&&f.push(c),p!=null&&p.length>0&&f.push(p);let h=f.join("/");return{protocol:s,cid:l,path:h,query:d}}async function t8(r,{ipns:e,logger:t},n){if(typeof r=="string")return e8({urlString:r,ipns:e,logger:t},{onProgress:n?.onProgress});let i=z.asCID(r);if(i!=null)return{cid:i,protocol:"ipfs",path:"",query:{}};throw new TypeError(`Invalid resource. Cannot determine CID from resource: ${r}`)}async function r8(r,e,t){let n=[],i;for await(let o of Qg(e,r,t))n.push(o.cid),i=o;if(i==null)throw new Error("No terminal element found");return{ipfsRoots:n,terminalElement:i}}function BP(r){if(r==null)return;let e;return r?.signal===null&&(e=void 0),{...r,signal:e}}var gd=class{helia;ipns;unixfs;dagJson;dagCbor;json;pathWalker;log;constructor({helia:e,ipns:t,unixfs:n,dagJson:i,json:o,dagCbor:s,pathWalker:a},c){this.helia=e,this.log=e.logger.forComponent("helia:verified-fetch"),this.ipns=t??WE(e,{resolvers:[Cp("https://mozilla.cloudflare-dns.com/dns-query"),Cp("https://dns.google/resolve")]}),this.unixfs=n??N4(e),this.dagJson=i??Nv(e),this.json=o??k3(e),this.dagCbor=s??Uv(e),this.pathWalker=a??r8,this.log.trace("created VerifiedFetch instance")}async handleIPNSRecord({cid:e,path:t,options:n}){let i=new Response("vnd.ipfs.ipns-record support is not implemented",{status:501});return i.headers.set("X-Content-Type-Options","nosniff"),i}async handleIPLDCar({cid:e,path:t,options:n}){let i=new Response("vnd.ipld.car support is not implemented",{status:501});return i.headers.set("X-Content-Type-Options","nosniff"),i}async handleDagJson({cid:e,path:t,options:n}){this.log.trace("fetching %c/%s",e,t),n?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.dagJson.get(e,{signal:n?.signal,onProgress:n?.onProgress});n?.onProgress?.(new P("verified-fetch:request:end",{cid:e.toString(),path:t}));let o=new Response(JSON.stringify(i),{status:200});return o.headers.set("content-type","application/json"),o}async handleJson({cid:e,path:t,options:n}){this.log.trace("fetching %c/%s",e,t),n?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.json.get(e,{signal:n?.signal,onProgress:n?.onProgress});n?.onProgress?.(new P("verified-fetch:request:end",{cid:e.toString(),path:t}));let o=new Response(JSON.stringify(i),{status:200});return o.headers.set("content-type","application/json"),o}async handleDagCbor({cid:e,path:t,options:n}){this.log.trace("fetching %c/%s",e,t),n?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.dagCbor.get(e,{signal:n?.signal,onProgress:n?.onProgress});n?.onProgress?.(new P("verified-fetch:request:end",{cid:e.toString(),path:t}));let o=new Response(JSON.stringify(i),{status:200});return o.headers.set("content-type","application/json"),o}async handleDagPb({cid:e,path:t,options:n,terminalElement:i}){this.log.trace("fetching %c/%s",e,t);let o=i?.cid??e,s;if(i?.type==="directory"){let p=i.cid,m="index.html";try{this.log.trace("found directory at %c/%s, looking for index.html",e,t),n?.onProgress?.(new P("verified-fetch:request:start",{cid:p.toString(),path:m})),s=await this.unixfs.stat(p,{path:m,signal:n?.signal,onProgress:n?.onProgress}),this.log.trace("found root file at %c/%s with cid %c",p,m,s.cid),t=m,o=s.cid}catch(d){return this.log("error loading path %c/%s",p,m,d),new Response("Unable to find index.html for directory at given path. Support for directories with implicit root is not implemented",{status:501})}finally{n?.onProgress?.(new P("verified-fetch:request:end",{cid:p.toString(),path:m}))}}n?.onProgress?.(new P("verified-fetch:request:start",{cid:o.toString(),path:""}));let a=this.unixfs.cat(o,{signal:n?.signal,onProgress:n?.onProgress});n?.onProgress?.(new P("verified-fetch:request:end",{cid:o.toString(),path:""})),this.log("got async iterator for %c/%s",e,t);let{contentType:c,stream:u}=await Z4(a,t??"",this.helia.logger,{onProgress:n?.onProgress}),l=new Response(u,{status:200});return l.headers.set("content-type",c),l}async handleRaw({cid:e,path:t,options:n}){this.log.trace("fetching %c/%s",e,t),n?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.helia.blockstore.get(e);n?.onProgress?.(new P("verified-fetch:request:end",{cid:e.toString(),path:t}));let o=new Response(sf(i),{status:200});return o.headers.set("content-type","application/octet-stream"),o}getFormat({headerFormat:e,queryFormat:t}){let n={"vnd.ipld.raw":"raw","vnd.ipld.car":"car","application/x-tar":"tar","application/vnd.ipld.dag-json":"dag-json","application/vnd.ipld.dag-cbor":"dag-cbor","application/json":"json","application/cbor":"cbor","vnd.ipfs.ipns-record":"ipns-record"};if(e!=null){for(let i in n)if(e.includes(i))return n[i]}else if(t!=null)return t;return null}formatHandlers={raw:async()=>new Response("application/vnd.ipld.raw support is not implemented",{status:501}),car:this.handleIPLDCar,"ipns-record":this.handleIPNSRecord,tar:async()=>new Response("application/x-tar support is not implemented",{status:501}),"dag-json":async()=>new Response("application/vnd.ipld.dag-json support is not implemented",{status:501}),"dag-cbor":async()=>new Response("application/vnd.ipld.dag-cbor support is not implemented",{status:501}),json:async()=>new Response("application/json support is not implemented",{status:501}),cbor:async()=>new Response("application/cbor support is not implemented",{status:501})};codecHandlers={[Si]:this.handleDagJson,[Ve]:this.handleDagPb,[Lo]:this.handleJson,[Ei]:this.handleDagCbor,[je]:this.handleRaw};async fetch(e,t){let n=BP(t),{path:i,query:o,...s}=await t8(e,{ipns:this.ipns,logger:this.helia.logger},n),a=s.cid,c,u=this.getFormat({headerFormat:new Headers(n?.headers).get("accept"),queryFormat:o.format??null});if(u!=null){let m=this.formatHandlers[u];if(m!=null&&(c=await m.call(this,{cid:a,path:i,options:n}),c.status===501))return c}let l,p;try{let m=await this.pathWalker(this.helia.blockstore,`${a.toString()}/${i}`,n);p=m.ipfsRoots,l=m.terminalElement}catch(m){this.log.error("Error walking path %s",i,m)}if(c==null){let m=this.codecHandlers[a.code];if(m!=null)c=await m.call(this,{cid:a,path:i,options:n,terminalElement:l});else return new Response(`Support for codec with code ${a.code} is not yet implemented. Please open an issue at https://github.com/ipfs/helia/issues/new`,{status:501})}return c.headers.set("etag",a.toString()),c.headers.set("cache-cotrol","public, max-age=29030400, immutable"),c.headers.set("X-Ipfs-Path",e.toString()),p!=null&&c.headers.set("X-Ipfs-Roots",p.map(m=>m.toV1().toString()).join(",")),c}async start(){await this.helia.start()}async stop(){await this.helia.stop()}};async function kP(r){IP(r)||(r=await Rv({blockBrokers:[ma({gateways:r.gateways})],routers:r.routers?.map(n=>Ya(n))}));let e=new gd({helia:r});async function t(n,i){return e.fetch(n,i)}return t.stop=e.stop.bind(e),t.start=e.start.bind(e),t}function IP(r){return r?.blockstore!=null&&r?.datastore!=null&&r?.gc!=null&&r?.stop!=null&&r?.start!=null}return g8(_P);})();
16
+ `)}`:`${t} :`}};Sy=hi;j.Constructed=Sy;hi.NAME="CONSTRUCTED";var jl=class extends ft{fromBER(e,t,n){return t}toBER(e){return br}};jl.override="EndOfContentValueBlock";var By,Hl=class extends it{constructor(e={}){super(e,jl),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};By=Hl;j.EndOfContent=By;Hl.NAME=ka;var ky,mi=class extends it{constructor(e={}){super(e,ft),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,n){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=n,t+n>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+n}toBER(e,t){let n=new ArrayBuffer(2);if(!e){let i=new Uint8Array(n);i[0]=5,i[1]=0}return t&&t.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}};ky=mi;j.Null=ky;mi.NAME="NULL";var ql=class extends En(ft){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=pe.BufferSourceConverter.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}get value(){for(let e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,n){let i=pe.BufferSourceConverter.toUint8Array(e);return vn(this,i,t,n)?(this.valueHexView=i.subarray(t,t+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,th.call(this),this.blockLength=n,t+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};ql.NAME="BooleanValueBlock";var Iy,Kl=class extends it{constructor(e={}){super(e,ql),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};Iy=Kl;j.Boolean=Iy;Kl.NAME="BOOLEAN";var Gl=class extends En(Mr){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,n){let i=0;if(this.isConstructed){if(this.isHexOnly=!1,i=Mr.prototype.fromBER.call(this,e,t,n),i===-1)return i;for(let o=0;o<this.value.length;o++){let s=this.value[o].constructor.NAME;if(s===ka){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(s!==by)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,i=super.fromBER(e,t,n),this.blockLength=n;return i}toBER(e,t){return this.isConstructed?Mr.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};Gl.NAME="OctetStringValueBlock";var _y,wn=class r extends it{constructor({idBlock:e={},lenBlock:t={},...n}={}){var i,o;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((o=n.value)===null||o===void 0)&&o.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},Gl),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){let o=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+n);try{if(o.byteLength){let s=vu(o,0,o.byteLength);s.offset!==-1&&s.offset===n&&(this.valueBlock.value=[s.result])}}catch{}}return super.fromBER(e,t,n)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?hi.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${pe.Convert.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let t of this.valueBlock.value)t instanceof r&&e.push(t.valueBlock.valueHexView);return pe.BufferSourceConverter.concat(e)}};_y=wn;j.OctetString=_y;wn.NAME=by;var Wl=class extends En(Mr){constructor({unusedBits:e=0,isConstructed:t=!1,...n}={}){super(n),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,n){if(!n)return t;let i=-1;if(this.isConstructed){if(i=Mr.prototype.fromBER.call(this,e,t,n),i===-1)return i;for(let a of this.value){let c=a.constructor.NAME;if(c===ka){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==vy)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let u=a.valueBlock;if(this.unusedBits>0&&u.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=u.unusedBits}return i}let o=pe.BufferSourceConverter.toUint8Array(e);if(!vn(this,o,t,n))return-1;let s=o.subarray(t,t+n);if(this.unusedBits=s[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let a=s.subarray(1);try{if(a.byteLength){let c=vu(a,0,a.byteLength);c.offset!==-1&&c.offset===n-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=s.subarray(1),this.blockLength=s.length,t+n}toBER(e,t){if(this.isConstructed)return Mr.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return br;let n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};Wl.NAME="BitStringValueBlock";var Ty,os=class extends it{constructor({idBlock:e={},lenBlock:t={},...n}={}){var i,o;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((o=n.value)===null||o===void 0)&&o.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},Wl),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return hi.prototype.onAsciiEncoding.call(this);{let e=[],t=this.valueBlock.valueHexView;for(let i of t)e.push(i.toString(2).padStart(8,"0"));let n=e.join("");return`${this.constructor.NAME} : ${n.substring(0,n.length-this.valueBlock.unusedBits)}`}}};Ty=os;j.BitString=Ty;os.NAME=vy;var Cy;function xB(r,e){let t=new Uint8Array([0]),n=new Uint8Array(r),i=new Uint8Array(e),o=n.slice(0),s=o.length-1,a=i.slice(0),c=a.length-1,u=0,l=c<s?s:c,p=0;for(let m=l;m>=0;m--,p++){switch(!0){case p<a.length:u=o[s-p]+a[c-p]+t[0];break;default:u=o[s-p]+t[0]}switch(t[0]=u/10,!0){case p>=o.length:o=Pl(new Uint8Array([u%10]),o);break;default:o[s-p]=u%10}}return t[0]>0&&(o=Pl(t,o)),o}function wy(r){if(r>=Sa.length)for(let e=Sa.length;e<=r;e++){let t=new Uint8Array([0]),n=Sa[e-1].slice(0);for(let i=n.length-1;i>=0;i--){let o=new Uint8Array([(n[i]<<1)+t[0]]);t[0]=o[0]/10,n[i]=o[0]%10}t[0]>0&&(n=Pl(t,n)),Sa.push(n)}return Sa[r]}function yB(r,e){let t=0,n=new Uint8Array(r),i=new Uint8Array(e),o=n.slice(0),s=o.length-1,a=i.slice(0),c=a.length-1,u,l=0;for(let p=c;p>=0;p--,l++)switch(u=o[s-l]-a[c-l]-t,!0){case u<0:t=1,o[s-l]=u+10;break;default:t=0,o[s-l]=u}if(t>0)for(let p=s-c+1;p>=0;p--,l++)if(u=o[s-l]-t,u<0)t=1,o[s-l]=u+10;else{t=0,o[s-l]=u;break}return o.slice()}var Ia=class extends En(ft){constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=th.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(gy(e))}get valueDec(){return this._valueDec}fromDER(e,t,n,i=0){let o=this.fromBER(e,t,n);if(o===-1)return o;let s=this.valueHexView;return s[0]===0&&s[1]&128?this.valueHexView=s.subarray(1):i!==0&&s.length<i&&(i-s.length>1&&(i=s.length+1),this.valueHexView=s.subarray(i-s.length)),o}toDER(e=!1){let t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{let n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(t,1),this.valueHexView=n}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,n){let i=super.fromBER(e,t,n);return i===-1||this.setValueHex(),i}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){let e=this.valueHexView.length*8-1,t=new Uint8Array(this.valueHexView.length*8/3),n=0,i,o=this.valueHexView,s="",a=!1;for(let c=o.byteLength-1;c>=0;c--){i=o[c];for(let u=0;u<8;u++){if((i&1)===1)switch(n){case e:t=yB(wy(n),t),s="-";break;default:t=xB(t,wy(n))}n++,i>>=1}}for(let c=0;c<t.length;c++)t[c]&&(a=!0),a&&(s+=yy.charAt(t[c]));return a===!1&&(s+=yy.charAt(0)),s}};Cy=Ia;Ia.NAME="IntegerValueBlock";Object.defineProperty(Cy.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Ry,qe=class r extends it{constructor(e={}){super(e,Ia),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ol(),BigInt(this.valueBlock.toString())}static fromBigInt(e){Ol();let t=BigInt(e),n=new Ba,i=t.toString(16).replace(/^-/,""),o=new Uint8Array(pe.Convert.FromHex(i));if(t<0){let a=new Uint8Array(o.length+(o[0]&128?1:0));a[0]|=128;let u=BigInt(`0x${pe.Convert.ToHex(a)}`)+t,l=pe.BufferSourceConverter.toUint8Array(pe.Convert.FromHex(u.toString(16)));l[0]|=128,n.write(l)}else o[0]&128&&n.write(new Uint8Array([0])),n.write(o);return new r({valueHex:n.final()})}convertToDER(){let e=new r({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new r({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};Ry=qe;j.Integer=Ry;qe.NAME="INTEGER";var Uy,Yl=class extends qe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};Uy=Yl;j.Enumerated=Uy;Yl.NAME="ENUMERATED";var _a=class extends En(ft){constructor({valueDec:e=-1,isFirstSid:t=!1,...n}={}){super(n),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,n){if(!n)return t;let i=pe.BufferSourceConverter.toUint8Array(e);if(!vn(this,i,t,n))return-1;let o=i.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let a=0;a<n&&(this.valueHexView[a]=o[a]&127,this.blockLength++,!!(o[a]&128));a++);let s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)s[a]=this.valueHexView[a];return this.valueHexView=s,o[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=ro(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){Ol();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;let n=new Uint8Array(t.length/7);for(let i=0;i<n.length;i++)n[i]=parseInt(t.slice(i*7,i*7+7),2)+(i+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let i=this.valueHexView,o=new Uint8Array(this.blockLength);for(let s=0;s<this.blockLength-1;s++)o[s]=i[s]|128;return o[this.blockLength-1]=i[this.blockLength-1],o.buffer}let t=fi(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",br;let n=new Uint8Array(t.byteLength);if(!e){let i=new Uint8Array(t),o=t.byteLength-1;for(let s=0;s<o;s++)n[s]=i[s]|128;n[o]=i[o]}return n}toString(){let e="";if(this.isHexOnly)e=pe.Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};_a.NAME="sidBlock";var Xl=class extends ft{constructor({value:e=ss,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let i=t;for(;n>0;){let o=new _a;if(i=o.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=o.error,i;this.value.length===0&&(o.isFirstSid=!0),this.blockLength+=o.blockLength,n-=o.blockLength,this.value.push(o)}return i}toBER(e){let t=[];for(let n=0;n<this.value.length;n++){let i=this.value[n].toBER(e);if(i.byteLength===0)return this.error=this.value[n].error,br;t.push(i)}return rh(t)}fromString(e){this.value=[];let t=0,n=0,i="",o=!1;do if(n=e.indexOf(".",t),n===-1?i=e.substring(t):i=e.substring(t,n),t=n+1,o){let s=this.value[0],a=0;switch(s.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}let c=parseInt(i,10);if(isNaN(c))return;s.valueDec=c+a,o=!1}else{let s=new _a;if(i>Number.MAX_SAFE_INTEGER){Ol();let a=BigInt(i);s.valueBigInt=a}else if(s.valueDec=parseInt(i,10),isNaN(s.valueDec))return;this.value.length||(s.isFirstSid=!0,o=!0),this.value.push(s)}while(n!==-1)}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),t?(i=`{${i}}`,this.value[n].isFirstSid?e=`2.{${i} - 80}`:e+=i):e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};Xl.NAME="ObjectIdentifierValueBlock";var Ny,wr=class extends it{constructor(e={}){super(e,Xl),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};Ny=wr;j.ObjectIdentifier=Ny;wr.NAME="OBJECT IDENTIFIER";var Ta=class extends En(yn){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,n){if(n===0)return t;let i=pe.BufferSourceConverter.toUint8Array(e);if(!vn(this,i,t,n))return-1;let o=i.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let a=0;a<n&&(this.valueHexView[a]=o[a]&127,this.blockLength++,!!(o[a]&128));a++);let s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)s[a]=this.valueHexView[a];return this.valueHexView=s,o[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=ro(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let i=this.valueHexView,o=new Uint8Array(this.blockLength);for(let s=0;s<this.blockLength-1;s++)o[s]=i[s]|128;return o[this.blockLength-1]=i[this.blockLength-1],o.buffer}let t=fi(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",br;let n=new Uint8Array(t.byteLength);if(!e){let i=new Uint8Array(t),o=t.byteLength-1;for(let s=0;s<o;s++)n[s]=i[s]|128;n[o]=i[o]}return n.buffer}toString(){let e="";return this.isHexOnly?e=pe.Convert.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};Ta.NAME="relativeSidBlock";var Jl=class extends ft{constructor({value:e=ss,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let i=t;for(;n>0;){let o=new Ta;if(i=o.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=o.error,i;this.blockLength+=o.blockLength,n-=o.blockLength,this.value.push(o)}return i}toBER(e,t){let n=[];for(let i=0;i<this.value.length;i++){let o=this.value[i].toBER(e);if(o.byteLength===0)return this.error=this.value[i].error,br;n.push(o)}return rh(n)}fromString(e){this.value=[];let t=0,n=0,i="";do{n=e.indexOf(".",t),n===-1?i=e.substring(t):i=e.substring(t,n),t=n+1;let o=new Ta;if(o.valueDec=parseInt(i,10),isNaN(o.valueDec))return!0;this.value.push(o)}while(n!==-1);return!0}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),t&&(i=`{${i}}`),e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};Jl.NAME="RelativeObjectIdentifierValueBlock";var Dy,Zl=class extends it{constructor(e={}){super(e,Jl),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};Dy=Zl;j.RelativeObjectIdentifier=Dy;Zl.NAME="RelativeObjectIdentifier";var Ly,Je=class extends hi{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};Ly=Je;j.Sequence=Ly;Je.NAME="SEQUENCE";var Py,Ql=class extends hi{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Py=Ql;j.Set=Py;Ql.NAME="SET";var eu=class extends En(ft){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=ss}toJSON(){return{...super.toJSON(),value:this.value}}};eu.NAME="StringValueBlock";var tu=class extends eu{};tu.NAME="SimpleStringValueBlock";var yt=class extends Vl{constructor({...e}={}){super(e,tu)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,pe.BufferSourceConverter.toUint8Array(e))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);this.valueBlock.value=e}};yt.NAME="SIMPLE STRING";var ru=class extends yt{fromBuffer(e){this.valueBlock.valueHexView=pe.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=pe.Convert.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=pe.Convert.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(pe.Convert.FromUtf8String(e)),this.valueBlock.value=e}};ru.NAME="Utf8StringValueBlock";var Oy,bn=class extends ru{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};Oy=bn;j.Utf8String=Oy;bn.NAME="UTF8String";var nu=class extends yt{fromBuffer(e){this.valueBlock.value=pe.Convert.ToUtf16String(e),this.valueBlock.valueHexView=pe.BufferSourceConverter.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(pe.Convert.FromUtf16String(e))}};nu.NAME="BmpStringValueBlock";var Fy,iu=class extends nu{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};Fy=iu;j.BmpString=Fy;iu.NAME="BMPString";var ou=class extends yt{fromBuffer(e){let t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),n=new Uint8Array(t);for(let i=0;i<n.length;i+=4)n[i]=n[i+3],n[i+1]=n[i+2],n[i+2]=0,n[i+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let i=0;i<t;i++){let o=fi(e.charCodeAt(i),8),s=new Uint8Array(o);if(s.length>4)continue;let a=4-s.length;for(let c=s.length-1;c>=0;c--)n[i*4+c+a]=s[c]}this.valueBlock.value=e}};ou.NAME="UniversalStringValueBlock";var zy,su=class extends ou{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};zy=su;j.UniversalString=zy;su.NAME="UniversalString";var Vy,au=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};Vy=au;j.NumericString=Vy;au.NAME="NumericString";var My,cu=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};My=cu;j.PrintableString=My;cu.NAME="PrintableString";var $y,lu=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};$y=lu;j.TeletexString=$y;lu.NAME="TeletexString";var jy,uu=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};jy=uu;j.VideotexString=jy;uu.NAME="VideotexString";var Hy,pu=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};Hy=pu;j.IA5String=Hy;pu.NAME="IA5String";var qy,du=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};qy=du;j.GraphicString=qy;du.NAME="GraphicString";var Ky,Ca=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};Ky=Ca;j.VisibleString=Ky;Ca.NAME="VisibleString";var Gy,fu=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};Gy=fu;j.GeneralString=Gy;fu.NAME="GeneralString";var Wy,hu=class extends yt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};Wy=hu;j.CharacterString=Wy;hu.NAME="CharacterString";var Yy,Ra=class extends Ca{constructor({value:e,valueDate:t,...n}={}){if(super(n),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let i=0;i<e.length;i++)this.valueBlock.valueHexView[i]=e.charCodeAt(i)}t&&(this.fromDate(t),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,pe.BufferSourceConverter.toUint8Array(e)))}toBuffer(){let e=this.toString(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){let n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(n===null){this.error="Wrong input string for conversion";return}let i=parseInt(n[1],10);i>=50?this.year=1900+i:this.year=2e3+i,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(e="iso"){if(e==="iso"){let t=new Array(7);return t[0]=_t(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=_t(this.month,2),t[2]=_t(this.day,2),t[3]=_t(this.hour,2),t[4]=_t(this.minute,2),t[5]=_t(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}};Yy=Ra;j.UTCTime=Yy;Ra.NAME="UTCTime";var Xy,mu=class extends Ra{constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t=!1,n="",i="",o=0,s,a=0,c=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),t=!0;else{let p=new Number(e[e.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(t){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,m=n.indexOf("+"),d="";if(m===-1&&(m=n.indexOf("-"),p=-1),m!==-1){if(d=n.substring(m+1),n=n.substring(0,m),d.length!==2&&d.length!==4)throw new Error("Wrong input string for conversion");let f=parseInt(d.substring(0,2),10);if(isNaN(f.valueOf()))throw new Error("Wrong input string for conversion");if(a=p*f,d.length===4){if(f=parseInt(d.substring(2,4),10),isNaN(f.valueOf()))throw new Error("Wrong input string for conversion");c=p*f}}}let u=n.indexOf(".");if(u===-1&&(u=n.indexOf(",")),u!==-1){let p=new Number(`0${n.substring(u)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");o=p.valueOf(),i=n.substring(0,u)}else i=n;switch(!0){case i.length===8:if(s=/(\d{4})(\d{2})(\d{2})/ig,u!==-1)throw new Error("Wrong input string for conversion");break;case i.length===10:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let p=60*o;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case i.length===12:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let p=60*o;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case i.length===14:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let p=1e3*o;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}let l=s.exec(i);if(l===null)throw new Error("Wrong input string for conversion");for(let p=1;p<l.length;p++)switch(p){case 1:this.year=parseInt(l[p],10);break;case 2:this.month=parseInt(l[p],10);break;case 3:this.day=parseInt(l[p],10);break;case 4:this.hour=parseInt(l[p],10)+a;break;case 5:this.minute=parseInt(l[p],10)+c;break;case 6:this.second=parseInt(l[p],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){let p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let t=[];return t.push(_t(this.year,4)),t.push(_t(this.month,2)),t.push(_t(this.day,2)),t.push(_t(this.hour,2)),t.push(_t(this.minute,2)),t.push(_t(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(_t(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};Xy=mu;j.GeneralizedTime=Xy;mu.NAME="GeneralizedTime";var Jy,gu=class extends bn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};Jy=gu;j.DATE=Jy;gu.NAME="DATE";var Zy,xu=class extends bn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};Zy=xu;j.TimeOfDay=Zy;xu.NAME="TimeOfDay";var Qy,yu=class extends bn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};Qy=yu;j.DateTime=Qy;yu.NAME="DateTime";var ew,wu=class extends bn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};ew=wu;j.Duration=ew;wu.NAME="Duration";var tw,bu=class extends bn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};tw=bu;j.TIME=tw;bu.NAME="TIME";function bB(r){let{result:e}=as(r),t=e.valueBlock.value;return{n:oe($r(t[1].toBigInt()),"base64url"),e:oe($r(t[2].toBigInt()),"base64url"),d:oe($r(t[3].toBigInt()),"base64url"),p:oe($r(t[4].toBigInt()),"base64url"),q:oe($r(t[5].toBigInt()),"base64url"),dp:oe($r(t[6].toBigInt()),"base64url"),dq:oe($r(t[7].toBigInt()),"base64url"),qi:oe($r(t[8].toBigInt()),"base64url"),kty:"RSA",alg:"RS256"}}function vB(r){if(r.n==null||r.e==null||r.d==null||r.p==null||r.q==null||r.dp==null||r.dq==null||r.qi==null)throw new O("JWK was missing components","ERR_INVALID_PARAMETERS");let t=new Je({value:[new qe({value:0}),qe.fromBigInt(jr(Z(r.n,"base64url"))),qe.fromBigInt(jr(Z(r.e,"base64url"))),qe.fromBigInt(jr(Z(r.d,"base64url"))),qe.fromBigInt(jr(Z(r.p,"base64url"))),qe.fromBigInt(jr(Z(r.q,"base64url"))),qe.fromBigInt(jr(Z(r.dp,"base64url"))),qe.fromBigInt(jr(Z(r.dq,"base64url"))),qe.fromBigInt(jr(Z(r.qi,"base64url")))]}).toBER();return new Uint8Array(t,0,t.byteLength)}function EB(r){let{result:e}=as(r),t=e.valueBlock.value[1].valueBlock.value[0].valueBlock.value;return{kty:"RSA",n:oe($r(t[0].toBigInt()),"base64url"),e:oe($r(t[1].toBigInt()),"base64url")}}function AB(r){if(r.n==null||r.e==null)throw new O("JWK was missing components","ERR_INVALID_PARAMETERS");let t=new Je({value:[new Je({value:[new wr({value:"1.2.840.113549.1.1.1"}),new mi]}),new os({valueHex:new Je({value:[qe.fromBigInt(jr(Z(r.n,"base64url"))),qe.fromBigInt(jr(Z(r.e,"base64url")))]}).toBER()})]}).toBER();return new Uint8Array(t,0,t.byteLength)}function $r(r){let e=r.toString(16);e.length%2>0&&(e=`0${e}`);let t=e.length/2,n=new Uint8Array(t),i=0,o=0;for(;i<t;)n[i]=parseInt(e.slice(o,o+2),16),i+=1,o+=2;return n}function jr(r){let e=[];return r.forEach(function(t){let n=t.toString(16);n.length%2>0&&(n=`0${n}`),e.push(n)}),BigInt("0x"+e.join(""))}var SB=16,ih=32,oh=1e4;async function BB(r,e){let t=xt.get(),i=new Je({value:[new qe({value:0}),new Je({value:[new wr({value:"1.2.840.113549.1.1.1"}),new mi]}),new wn({valueHex:r.marshal()})]}).toBER(),o=new Uint8Array(i,0,i.byteLength),s=to(SB),a=await Qf(Qo,e,s,{c:oh,dkLen:ih}),c=to(16),u=await t.subtle.importKey("raw",a,"AES-CBC",!1,["encrypt"]),l=await t.subtle.encrypt({name:"AES-CBC",iv:c},u,o),p=new Je({value:[new wn({valueHex:s}),new qe({value:oh}),new qe({value:ih}),new Je({value:[new wr({value:"1.2.840.113549.2.11"}),new mi]})]}),m=new Je({value:[new wr({value:"1.2.840.113549.1.5.13"}),new Je({value:[new Je({value:[new wr({value:"1.2.840.113549.1.5.12"}),p]}),new Je({value:[new wr({value:"2.16.840.1.101.3.4.1.42"}),new wn({valueHex:c})]})]})]}),f=new Je({value:[m,new wn({valueHex:l})]}).toBER(),h=new Uint8Array(f,0,f.byteLength);return["-----BEGIN ENCRYPTED PRIVATE KEY-----",...oe(h,"base64pad").split(/(.{64})/).filter(Boolean),"-----END ENCRYPTED PRIVATE KEY-----"].join(`
17
+ `)}async function kB(r,e){let t=xt.get(),n;if(r.includes("-----BEGIN ENCRYPTED PRIVATE KEY-----")){let i=Z(r.replace("-----BEGIN ENCRYPTED PRIVATE KEY-----","").replace("-----END ENCRYPTED PRIVATE KEY-----","").replace(/\n/g,"").trim(),"base64pad"),{result:o}=as(i),{iv:s,salt:a,iterations:c,keySize:u,cipherText:l}=IB(o),p=await Qf(Qo,e,a,{c,dkLen:u}),m=await t.subtle.importKey("raw",p,"AES-CBC",!1,["decrypt"]),d=Ua(await t.subtle.decrypt({name:"AES-CBC",iv:s},m,l)),{result:f}=as(d);n=rw(f)}else if(r.includes("-----BEGIN PRIVATE KEY-----")){let i=Z(r.replace("-----BEGIN PRIVATE KEY-----","").replace("-----END PRIVATE KEY-----","").replace(/\n/g,"").trim(),"base64pad"),{result:o}=as(i);n=rw(o)}else throw new O("Could not parse private key from PEM data","ERR_INVALID_PARAMETERS");return sh(n)}function IB(r){let e=r.valueBlock.value[0];if(e.valueBlock.value[0].toString()!=="OBJECT IDENTIFIER : 1.2.840.113549.1.5.13")throw new O("Only pkcs5PBES2 encrypted private keys are supported","ERR_INVALID_PARAMS");let n=e.valueBlock.value[1].valueBlock.value[0];if(n.valueBlock.value[0].toString()!=="OBJECT IDENTIFIER : 1.2.840.113549.1.5.12")throw new O("Only pkcs5PBKDF2 key derivation functions are supported","ERR_INVALID_PARAMS");let o=n.valueBlock.value[1],s=Ua(o.valueBlock.value[0].getValue()),a=oh,c=ih;if(o.valueBlock.value.length===3)a=Number(o.valueBlock.value[1].toBigInt()),c=Number(o.valueBlock.value[2].toBigInt());else if(o.valueBlock.value.length===2)throw new O("Could not derive key size and iterations from PEM file - please use @libp2p/rsa to re-import your key","ERR_INVALID_PARAMS");let u=e.valueBlock.value[1].valueBlock.value[1],l=u.valueBlock.value[0].toString();if(l!=="OBJECT IDENTIFIER : 1.2.840.113549.3.7"){if(l!=="OBJECT IDENTIFIER : 1.3.14.3.2.7"){if(l!=="OBJECT IDENTIFIER : 2.16.840.1.101.3.4.1.2"){if(l!=="OBJECT IDENTIFIER : 2.16.840.1.101.3.4.1.22"){if(l!=="OBJECT IDENTIFIER : 2.16.840.1.101.3.4.1.42")throw new O("Only AES-CBC encryption schemes are supported","ERR_INVALID_PARAMS")}}}}let p=Ua(u.valueBlock.value[1].getValue());return{cipherText:Ua(r.valueBlock.value[1].getValue()),salt:s,iterations:a,keySize:c,iv:p}}function rw(r){return Ua(r.valueBlock.value[2].getValue())}function Ua(r){return new Uint8Array(r,0,r.byteLength)}async function nw(r){let e=await xt.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),t=await sw(e);return{privateKey:t[0],publicKey:t[1]}}async function ah(r){let t=[await xt.get().subtle.importKey("jwk",r,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await _B(r)],n=await sw({privateKey:t[0],publicKey:t[1]});return{privateKey:n[0],publicKey:n[1]}}async function iw(r,e){let t=await xt.get().subtle.importKey("jwk",r,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await xt.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},t,e instanceof Uint8Array?e:e.subarray());return new Uint8Array(n,0,n.byteLength)}async function ow(r,e,t){let n=await xt.get().subtle.importKey("jwk",r,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return xt.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,t instanceof Uint8Array?t:t.subarray())}async function sw(r){if(r.privateKey==null||r.publicKey==null)throw new O("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([xt.get().subtle.exportKey("jwk",r.privateKey),xt.get().subtle.exportKey("jwk",r.publicKey)])}async function _B(r){return xt.get().subtle.importKey("jwk",{kty:r.kty,n:r.n,e:r.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Eu(r){if(r.kty!=="RSA")throw new O("invalid key type","ERR_INVALID_KEY_TYPE");if(r.n==null)throw new O("invalid key modulus","ERR_INVALID_KEY_MODULUS");return Z(r.n,"base64url").length*8}var Da=8192,Na=class{_key;constructor(e){this._key=e}verify(e,t){return ow(this._key,t,e)}marshal(){return gi.jwkToPkix(this._key)}get bytes(){return zr.encode({Type:Be.RSA,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}hash(){let e=ce.digest(this.bytes);return or(e)?e.then(({bytes:t})=>t):e.bytes}},cs=class{_key;_publicKey;constructor(e,t){this._key=e,this._publicKey=t}genSecret(){return to(16)}sign(e){return iw(this._key,e)}get public(){if(this._publicKey==null)throw new O("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Na(this._publicKey)}marshal(){return gi.jwkToPkcs1(this._key)}get bytes(){return Vr.encode({Type:Be.RSA,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}hash(){let e=ce.digest(this.bytes);return or(e)?e.then(({bytes:t})=>t):e.bytes}async id(){let e=await this.public.hash();return oe(e,"base58btc")}async export(e,t="pkcs-8"){if(t==="pkcs-8")return gi.exportToPem(this,e);if(t==="libp2p-key")return rs(this.bytes,e);throw new O(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};async function sh(r){let e=gi.pkcs1ToJwk(r);if(Eu(e)>Da)throw new O("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let t=await ah(e);return new cs(t.privateKey,t.publicKey)}function CB(r){let e=gi.pkixToJwk(r);if(Eu(e)>Da)throw new O("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Na(e)}async function RB(r){if(Eu(r)>Da)throw new O("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await ah(r);return new cs(e.privateKey,e.publicKey)}async function UB(r){if(r>Da)throw new O("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await nw(r);return new cs(e.privateKey,e.publicKey)}var fh={};$(fh,{Secp256k1PrivateKey:()=>Pa,Secp256k1PublicKey:()=>La,generateKeyPair:()=>GB,unmarshalSecp256k1PrivateKey:()=>qB,unmarshalSecp256k1PublicKey:()=>KB});var NB=(r,e,t)=>r&e^~r&t,DB=(r,e,t)=>r&e^r&t^e&t,LB=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]),xi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),yi=new Uint32Array(64),lh=class extends Zo{constructor(){super(64,32,8,!1),this.A=xi[0]|0,this.B=xi[1]|0,this.C=xi[2]|0,this.D=xi[3]|0,this.E=xi[4]|0,this.F=xi[5]|0,this.G=xi[6]|0,this.H=xi[7]|0}get(){let{A:e,B:t,C:n,D:i,E:o,F:s,G:a,H:c}=this;return[e,t,n,i,o,s,a,c]}set(e,t,n,i,o,s,a,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=c|0}process(e,t){for(let p=0;p<16;p++,t+=4)yi[p]=e.getUint32(t,!1);for(let p=16;p<64;p++){let m=yi[p-15],d=yi[p-2],f=gr(m,7)^gr(m,18)^m>>>3,h=gr(d,17)^gr(d,19)^d>>>10;yi[p]=h+yi[p-7]+f+yi[p-16]|0}let{A:n,B:i,C:o,D:s,E:a,F:c,G:u,H:l}=this;for(let p=0;p<64;p++){let m=gr(a,6)^gr(a,11)^gr(a,25),d=l+m+NB(a,c,u)+LB[p]+yi[p]|0,h=(gr(n,2)^gr(n,13)^gr(n,22))+DB(n,i,o)|0;l=u,u=c,c=a,a=s+d|0,s=o,o=i,i=n,n=d+h|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,i,o,s,a,c,u,l)}roundClean(){yi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var aw=El(()=>new lh);function PB(r){let e=va(r);Fr(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:i}=e;if(t){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:OB,hexToBytes:FB}=Bl,no={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=no;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)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:OB(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=no,t=typeof r=="string"?FB(r):r;if(!xr(t))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:o}=no._parseInt(t.subarray(2)),{d:s,l:a}=no._parseInt(o);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(r){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,t=u=>{let l=u.toString(16);return l.length&1?`0${l}`:l},n=e(t(r.s)),i=e(t(r.r)),o=n.length/2,s=i.length/2,a=t(o),c=t(s);return`30${t(s+o+4)}02${c}${i}02${a}${n}`}},An=BigInt(0),ar=BigInt(1),vV=BigInt(2),cw=BigInt(3),EV=BigInt(4);function zB(r){let e=PB(r),{Fp:t}=e,n=e.toBytes||((f,h,x)=>{let g=h.toAffine();return hn(Uint8Array.from([4]),t.toBytes(g.x),t.toBytes(g.y))}),i=e.fromBytes||(f=>{let h=f.subarray(1),x=t.fromBytes(h.subarray(0,t.BYTES)),g=t.fromBytes(h.subarray(t.BYTES,2*t.BYTES));return{x,y:g}});function o(f){let{a:h,b:x}=e,g=t.sqr(f),w=t.mul(g,f);return t.add(t.add(w,t.mul(f,h)),x)}if(!t.eql(t.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function s(f){return typeof f=="bigint"&&An<f&&f<e.n}function a(f){if(!s(f))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(f){let{allowedPrivateKeyLengths:h,nByteLength:x,wrapPrivateKey:g,n:w}=e;if(h&&typeof f!="bigint"){if(xr(f)&&(f=dn(f)),typeof f!="string"||!h.includes(f.length))throw new Error("Invalid key");f=f.padStart(x*2,"0")}let y;try{y=typeof f=="bigint"?f:fn(Re("private key",f,x))}catch{throw new Error(`private key must be ${x} bytes, hex or bigint, not ${typeof f}`)}return g&&(y=be(y,w)),a(y),y}let u=new Map;function l(f){if(!(f instanceof p))throw new Error("ProjectivePoint expected")}class p{constructor(h,x,g){if(this.px=h,this.py=x,this.pz=g,h==null||!t.isValid(h))throw new Error("x required");if(x==null||!t.isValid(x))throw new Error("y required");if(g==null||!t.isValid(g))throw new Error("z required")}static fromAffine(h){let{x,y:g}=h||{};if(!h||!t.isValid(x)||!t.isValid(g))throw new Error("invalid affine point");if(h instanceof p)throw new Error("projective point not allowed");let w=y=>t.eql(y,t.ZERO);return w(x)&&w(g)?p.ZERO:new p(x,g,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(h){let x=t.invertBatch(h.map(g=>g.pz));return h.map((g,w)=>g.toAffine(x[w])).map(p.fromAffine)}static fromHex(h){let x=p.fromAffine(i(Re("pointHex",h)));return x.assertValidity(),x}static fromPrivateKey(h){return p.BASE.multiply(c(h))}_setWindowSize(h){this._WINDOW_SIZE=h,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:h,y:x}=this.toAffine();if(!t.isValid(h)||!t.isValid(x))throw new Error("bad point: x or y not FE");let g=t.sqr(x),w=o(h);if(!t.eql(g,w))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:h}=this.toAffine();if(t.isOdd)return!t.isOdd(h);throw new Error("Field doesn't support isOdd")}equals(h){l(h);let{px:x,py:g,pz:w}=this,{px:y,py:E,pz:B}=h,S=t.eql(t.mul(x,B),t.mul(y,w)),b=t.eql(t.mul(g,B),t.mul(E,w));return S&&b}negate(){return new p(this.px,t.neg(this.py),this.pz)}double(){let{a:h,b:x}=e,g=t.mul(x,cw),{px:w,py:y,pz:E}=this,B=t.ZERO,S=t.ZERO,b=t.ZERO,v=t.mul(w,w),k=t.mul(y,y),U=t.mul(E,E),R=t.mul(w,y);return R=t.add(R,R),b=t.mul(w,E),b=t.add(b,b),B=t.mul(h,b),S=t.mul(g,U),S=t.add(B,S),B=t.sub(k,S),S=t.add(k,S),S=t.mul(B,S),B=t.mul(R,B),b=t.mul(g,b),U=t.mul(h,U),R=t.sub(v,U),R=t.mul(h,R),R=t.add(R,b),b=t.add(v,v),v=t.add(b,v),v=t.add(v,U),v=t.mul(v,R),S=t.add(S,v),U=t.mul(y,E),U=t.add(U,U),v=t.mul(U,R),B=t.sub(B,v),b=t.mul(U,k),b=t.add(b,b),b=t.add(b,b),new p(B,S,b)}add(h){l(h);let{px:x,py:g,pz:w}=this,{px:y,py:E,pz:B}=h,S=t.ZERO,b=t.ZERO,v=t.ZERO,k=e.a,U=t.mul(e.b,cw),R=t.mul(x,y),M=t.mul(g,E),L=t.mul(w,B),le=t.add(x,g),_=t.add(y,E);le=t.mul(le,_),_=t.add(R,M),le=t.sub(le,_),_=t.add(x,w);let D=t.add(y,B);return _=t.mul(_,D),D=t.add(R,L),_=t.sub(_,D),D=t.add(g,w),S=t.add(E,B),D=t.mul(D,S),S=t.add(M,L),D=t.sub(D,S),v=t.mul(k,_),S=t.mul(U,L),v=t.add(S,v),S=t.sub(M,v),v=t.add(M,v),b=t.mul(S,v),M=t.add(R,R),M=t.add(M,R),L=t.mul(k,L),_=t.mul(U,_),M=t.add(M,L),L=t.sub(R,L),L=t.mul(k,L),_=t.add(_,L),R=t.mul(M,_),b=t.add(b,R),R=t.mul(D,_),S=t.mul(le,S),S=t.sub(S,R),R=t.mul(le,M),v=t.mul(D,v),v=t.add(v,R),new p(S,b,v)}subtract(h){return this.add(h.negate())}is0(){return this.equals(p.ZERO)}wNAF(h){return d.wNAFCached(this,u,h,x=>{let g=t.invertBatch(x.map(w=>w.pz));return x.map((w,y)=>w.toAffine(g[y])).map(p.fromAffine)})}multiplyUnsafe(h){let x=p.ZERO;if(h===An)return x;if(a(h),h===ar)return this;let{endo:g}=e;if(!g)return d.unsafeLadder(this,h);let{k1neg:w,k1:y,k2neg:E,k2:B}=g.splitScalar(h),S=x,b=x,v=this;for(;y>An||B>An;)y&ar&&(S=S.add(v)),B&ar&&(b=b.add(v)),v=v.double(),y>>=ar,B>>=ar;return w&&(S=S.negate()),E&&(b=b.negate()),b=new p(t.mul(b.px,g.beta),b.py,b.pz),S.add(b)}multiply(h){a(h);let x=h,g,w,{endo:y}=e;if(y){let{k1neg:E,k1:B,k2neg:S,k2:b}=y.splitScalar(x),{p:v,f:k}=this.wNAF(B),{p:U,f:R}=this.wNAF(b);v=d.constTimeNegate(E,v),U=d.constTimeNegate(S,U),U=new p(t.mul(U.px,y.beta),U.py,U.pz),g=v.add(U),w=k.add(R)}else{let{p:E,f:B}=this.wNAF(x);g=E,w=B}return p.normalizeZ([g,w])[0]}multiplyAndAddUnsafe(h,x,g){let w=p.BASE,y=(B,S)=>S===An||S===ar||!B.equals(w)?B.multiplyUnsafe(S):B.multiply(S),E=y(this,x).add(y(h,g));return E.is0()?void 0:E}toAffine(h){let{px:x,py:g,pz:w}=this,y=this.is0();h==null&&(h=y?t.ONE:t.inv(w));let E=t.mul(x,h),B=t.mul(g,h),S=t.mul(w,h);if(y)return{x:t.ZERO,y:t.ZERO};if(!t.eql(S,t.ONE))throw new Error("invZ was invalid");return{x:E,y:B}}isTorsionFree(){let{h,isTorsionFree:x}=e;if(h===ar)return!0;if(x)return x(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h,clearCofactor:x}=e;return h===ar?this:x?x(p,this):this.multiplyUnsafe(e.h)}toRawBytes(h=!0){return this.assertValidity(),n(p,this,h)}toHex(h=!0){return dn(this.toRawBytes(h))}}p.BASE=new p(e.Gx,e.Gy,t.ONE),p.ZERO=new p(t.ZERO,t.ONE,t.ZERO);let m=e.nBitLength,d=_l(p,e.endo?Math.ceil(m/2):m);return{CURVE:e,ProjectivePoint:p,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:s}}function VB(r){let e=va(r);return Fr(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function lw(r){let e=VB(r),{Fp:t,n}=e,i=t.BYTES+1,o=2*t.BYTES+1;function s(_){return An<_&&_<t.ORDER}function a(_){return be(_,n)}function c(_){return kl(_,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:l,weierstrassEquation:p,isWithinCurveOrder:m}=zB({...e,toBytes(_,D,J){let N=D.toAffine(),T=t.toBytes(N.x),H=hn;return J?H(Uint8Array.from([D.hasEvenY()?2:3]),T):H(Uint8Array.from([4]),T,t.toBytes(N.y))},fromBytes(_){let D=_.length,J=_[0],N=_.subarray(1);if(D===i&&(J===2||J===3)){let T=fn(N);if(!s(T))throw new Error("Point is not on curve");let H=p(T),Y=t.sqrt(H),ee=(Y&ar)===ar;return(J&1)===1!==ee&&(Y=t.neg(Y)),{x:T,y:Y}}else if(D===o&&J===4){let T=t.fromBytes(N.subarray(0,t.BYTES)),H=t.fromBytes(N.subarray(t.BYTES,2*t.BYTES));return{x:T,y:H}}else throw new Error(`Point of length ${D} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}}),d=_=>dn(di(_,e.nByteLength));function f(_){let D=n>>ar;return _>D}function h(_){return f(_)?a(-_):_}let x=(_,D,J)=>fn(_.slice(D,J));class g{constructor(D,J,N){this.r=D,this.s=J,this.recovery=N,this.assertValidity()}static fromCompact(D){let J=e.nByteLength;return D=Re("compactSignature",D,J*2),new g(x(D,0,J),x(D,J,2*J))}static fromDER(D){let{r:J,s:N}=no.toSig(Re("DER",D));return new g(J,N)}assertValidity(){if(!m(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!m(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(D){return new g(this.r,this.s,D)}recoverPublicKey(D){let{r:J,s:N,recovery:T}=this,H=b(Re("msgHash",D));if(T==null||![0,1,2,3].includes(T))throw new Error("recovery id invalid");let Y=T===2||T===3?J+e.n:J;if(Y>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let ee=T&1?"03":"02",ae=u.fromHex(ee+d(Y)),ue=c(Y),we=a(-H*ue),de=a(N*ue),he=u.BASE.multiplyAndAddUnsafe(ae,we,de);if(!he)throw new Error("point at infinify");return he.assertValidity(),he}hasHighS(){return f(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Ji(this.toDERHex())}toDERHex(){return no.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ji(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}let w={isValidPrivateKey(_){try{return l(_),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let _=qf(e.n);return ny(e.randomBytes(_),e.n)},precompute(_=8,D=u.BASE){return D._setWindowSize(_),D.multiply(BigInt(3)),D}};function y(_,D=!0){return u.fromPrivateKey(_).toRawBytes(D)}function E(_){let D=xr(_),J=typeof _=="string",N=(D||J)&&_.length;return D?N===i||N===o:J?N===2*i||N===2*o:_ instanceof u}function B(_,D,J=!0){if(E(_))throw new Error("first arg must be private key");if(!E(D))throw new Error("second arg must be public key");return u.fromHex(D).multiply(l(_)).toRawBytes(J)}let S=e.bits2int||function(_){let D=fn(_),J=_.length*8-e.nBitLength;return J>0?D>>BigInt(J):D},b=e.bits2int_modN||function(_){return a(S(_))},v=ba(e.nBitLength);function k(_){if(typeof _!="bigint")throw new Error("bigint expected");if(!(An<=_&&_<v))throw new Error(`bigint expected < 2^${e.nBitLength}`);return di(_,e.nByteLength)}function U(_,D,J=R){if(["recovered","canonical"].some(Te=>Te in J))throw new Error("sign() legacy options not supported");let{hash:N,randomBytes:T}=e,{lowS:H,prehash:Y,extraEntropy:ee}=J;H==null&&(H=!0),_=Re("msgHash",_),Y&&(_=Re("prehashed msgHash",N(_)));let ae=b(_),ue=l(D),we=[k(ue),k(ae)];if(ee!=null){let Te=ee===!0?T(t.BYTES):ee;we.push(Re("extraEntropy",Te))}let de=hn(...we),he=ae;function $e(Te){let tt=S(Te);if(!m(tt))return;let rt=c(tt),We=u.BASE.multiply(tt).toAffine(),ut=a(We.x);if(ut===An)return;let ln=a(rt*a(he+ut*ue));if(ln===An)return;let $i=(We.x===ut?0:2)|Number(We.y&ar),la=ln;return H&&f(ln)&&(la=h(ln),$i^=1),new g(ut,la,$i)}return{seed:de,k2sig:$e}}let R={lowS:e.lowS,prehash:!1},M={lowS:e.lowS,prehash:!1};function L(_,D,J=R){let{seed:N,k2sig:T}=U(_,D,J),H=e;return Mf(H.hash.outputLen,H.nByteLength,H.hmac)(N,T)}u.BASE._setWindowSize(8);function le(_,D,J,N=M){let T=_;if(D=Re("msgHash",D),J=Re("publicKey",J),"strict"in N)throw new Error("options.strict was renamed to lowS");let{lowS:H,prehash:Y}=N,ee,ae;try{if(typeof T=="string"||xr(T))try{ee=g.fromDER(T)}catch(We){if(!(We instanceof no.Err))throw We;ee=g.fromCompact(T)}else if(typeof T=="object"&&typeof T.r=="bigint"&&typeof T.s=="bigint"){let{r:We,s:ut}=T;ee=new g(We,ut)}else throw new Error("PARSE");ae=u.fromHex(J)}catch(We){if(We.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&ee.hasHighS())return!1;Y&&(D=e.hash(D));let{r:ue,s:we}=ee,de=b(D),he=c(we),$e=a(de*he),Te=a(ue*he),tt=u.BASE.multiplyAndAddUnsafe(ae,$e,Te)?.toAffine();return tt?a(tt.x)===ue:!1}return{CURVE:e,getPublicKey:y,getSharedSecret:B,sign:L,verify:le,ProjectivePoint:u,Signature:g,utils:w}}function MB(r){return{hash:r,hmac:(e,...t)=>Aa(r,e,vl(...t)),randomBytes:Jo}}function uw(r,e){let t=n=>lw({...r,...MB(n)});return Object.freeze({...t(e),create:t})}var fw=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),pw=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),$B=BigInt(1),uh=BigInt(2),dw=(r,e)=>(r+e/uh)/e;function jB(r){let e=fw,t=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=r*r*r%e,l=u*u*r%e,p=Se(l,t,e)*l%e,m=Se(p,t,e)*l%e,d=Se(m,uh,e)*u%e,f=Se(d,i,e)*d%e,h=Se(f,o,e)*f%e,x=Se(h,a,e)*h%e,g=Se(x,c,e)*x%e,w=Se(g,a,e)*h%e,y=Se(w,t,e)*l%e,E=Se(y,s,e)*f%e,B=Se(E,n,e)*u%e,S=Se(B,uh,e);if(!ph.eql(ph.sqr(S),r))throw new Error("Cannot find square root");return S}var ph=Il(fw,void 0,void 0,{sqrt:jB}),vr=uw({a:BigInt(0),b:BigInt(7),Fp:ph,n:pw,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=pw,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-$B*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=t,s=BigInt("0x100000000000000000000000000000000"),a=dw(o*r,e),c=dw(-n*r,e),u=be(r-a*t-c*i,e),l=be(-a*n-c*o,e),p=u>s,m=l>s;if(p&&(u=e-u),m&&(l=e-l),u>s||l>s)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:p,k1:u,k2neg:m,k2:l}}}},aw),RV=BigInt(0);var UV=vr.ProjectivePoint;function hw(){return vr.utils.randomPrivateKey()}function mw(r,e){let t=ce.digest(e instanceof Uint8Array?e:e.subarray());if(or(t))return t.then(({digest:n})=>vr.sign(n,r).toDERRawBytes()).catch(n=>{throw new O(String(n),"ERR_INVALID_INPUT")});try{return vr.sign(t.digest,r).toDERRawBytes()}catch(n){throw new O(String(n),"ERR_INVALID_INPUT")}}function gw(r,e,t){let n=ce.digest(t instanceof Uint8Array?t:t.subarray());if(or(n))return n.then(({digest:i})=>vr.verify(e,i,r)).catch(i=>{throw new O(String(i),"ERR_INVALID_INPUT")});try{return vr.verify(e,n.digest,r)}catch(i){throw new O(String(i),"ERR_INVALID_INPUT")}}function xw(r){return vr.ProjectivePoint.fromHex(r).toRawBytes(!0)}function yw(r){try{vr.getPublicKey(r,!0)}catch(e){throw new O(String(e),"ERR_INVALID_PRIVATE_KEY")}}function dh(r){try{vr.ProjectivePoint.fromHex(r)}catch(e){throw new O(String(e),"ERR_INVALID_PUBLIC_KEY")}}function ww(r){try{return vr.getPublicKey(r,!0)}catch(e){throw new O(String(e),"ERR_INVALID_PRIVATE_KEY")}}var La=class{_key;constructor(e){dh(e),this._key=e}verify(e,t){return gw(this._key,t,e)}marshal(){return xw(this._key)}get bytes(){return zr.encode({Type:Be.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}async hash(){let e=ce.digest(this.bytes),t;return or(e)?{bytes:t}=await e:t=e.bytes,t}},Pa=class{_key;_publicKey;constructor(e,t){this._key=e,this._publicKey=t??ww(e),yw(this._key),dh(this._publicKey)}sign(e){return mw(this._key,e)}get public(){return new La(this._publicKey)}marshal(){return this._key}get bytes(){return Vr.encode({Type:Be.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return ge(this.bytes,e.bytes)}hash(){let e=ce.digest(this.bytes);return or(e)?e.then(({bytes:t})=>t):e.bytes}async id(){let e=await this.public.hash();return oe(e,"base58btc")}async export(e,t="libp2p-key"){if(t==="libp2p-key")return rs(this.bytes,e);throw new O(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function qB(r){return new Pa(r)}function KB(r){return new La(r)}async function GB(){let r=hw();return new Pa(r)}var io={rsa:ch,ed25519:Zf,secp256k1:fh};function bw(r){let e=Object.keys(io).join(" / ");return new O(`invalid or unsupported key type ${r}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function hh(r){let e=zr.decode(r),t=e.Data??new Uint8Array;switch(e.Type){case Be.RSA:return io.rsa.unmarshalRsaPublicKey(t);case Be.Ed25519:return io.ed25519.unmarshalEd25519PublicKey(t);case Be.Secp256k1:return io.secp256k1.unmarshalSecp256k1PublicKey(t);default:throw bw(e.Type??"unknown")}}async function vw(r){let e=Vr.decode(r),t=e.Data??new Uint8Array;switch(e.Type){case Be.RSA:return io.rsa.unmarshalRsaPrivateKey(t);case Be.Ed25519:return io.ed25519.unmarshalEd25519PrivateKey(t);case Be.Secp256k1:return io.secp256k1.unmarshalSecp256k1PrivateKey(t);default:throw bw(e.Type??"RSA")}}var _h=Q(ke(),1);var Sn="/",Ew=new TextEncoder().encode(Sn),Au=Ew[0],Xe=class r{_buf;constructor(e,t){if(typeof e=="string")this._buf=Z(e);else if(e instanceof Uint8Array)this._buf=e;else throw new Error("Invalid key, should be String of Uint8Array");if(t==null&&(t=!0),t&&this.clean(),this._buf.byteLength===0||this._buf[0]!==Au)throw new Error("Invalid key")}toString(e="utf8"){return oe(this._buf,e)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return`Key(${this.toString()})`}static withNamespaces(e){return new r(e.join(Sn))}static random(){return new r(Math.random().toString().substring(2))}static asKey(e){return e instanceof Uint8Array||typeof e=="string"?new r(e):typeof e.uint8Array=="function"?new r(e.uint8Array()):null}clean(){if((this._buf==null||this._buf.byteLength===0)&&(this._buf=Ew),this._buf[0]!==Au){let e=new Uint8Array(this._buf.byteLength+1);e.fill(Au,0,1),e.set(this._buf,1),this._buf=e}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===Au;)this._buf=this._buf.subarray(0,-1)}less(e){let t=this.list(),n=e.list();for(let i=0;i<t.length;i++){if(n.length<i+1)return!1;let o=t[i],s=n[i];if(o<s)return!0;if(o>s)return!1}return t.length<n.length}reverse(){return r.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){let e=this.namespaces();return e[e.length-1]}list(){return this.toString().split(Sn).slice(1)}type(){return WB(this.baseNamespace())}name(){return YB(this.baseNamespace())}instance(e){return new r(this.toString()+":"+e)}path(){let e=this.parent().toString();return e.endsWith(Sn)||(e+=Sn),e+=this.type(),new r(e)}parent(){let e=this.list();return e.length===1?new r(Sn):new r(e.slice(0,-1).join(Sn))}child(e){return this.toString()===Sn?e:e.toString()===Sn?this:new r(this.toString()+e.toString(),!1)}isAncestorOf(e){return e.toString()===this.toString()?!1:e.toString().startsWith(this.toString())}isDecendantOf(e){return e.toString()===this.toString()?!1:this.toString().startsWith(e.toString())}isTopLevel(){return this.list().length===1}concat(...e){return r.withNamespaces([...this.namespaces(),...XB(e.map(t=>t.namespaces()))])}};function WB(r){let e=r.split(":");return e.length<2?"":e.slice(0,-1).join(":")}function YB(r){let e=r.split(":");return e[e.length-1]}function XB(r){return[].concat(...r)}var zb=Q(Su(),1);var Aw="ERR_IPNS_EXPIRED_RECORD",Oa="ERR_UNRECOGNIZED_VALIDITY",Sw="ERR_SIGNATURE_CREATION",Bn="ERR_SIGNATURE_VERIFICATION";var gh="ERR_UNDEFINED_PARAMETER",Bw="ERR_INVALID_RECORD_DATA",kw="ERR_INVALID_VALUE",Iw="ERR_INVALID_EMBEDDED_KEY",_w="ERR_MISSING_PRIVATE_KEY",Tw="ERR_RECORD_TOO_LARGE";var ot;(function(r){let e;(function(i){i.EOL="EOL"})(e=r.ValidityType||(r.ValidityType={}));let t;(function(i){i[i.EOL=0]="EOL"})(t||(t={})),function(i){i.codec=()=>Wi(t)}(e=r.ValidityType||(r.ValidityType={}));let n;r.codec=()=>(n==null&&(n=nr((i,o,s={})=>{s.lengthDelimited!==!1&&o.fork(),i.value!=null&&(o.uint32(10),o.bytes(i.value)),i.signatureV1!=null&&(o.uint32(18),o.bytes(i.signatureV1)),i.validityType!=null&&(o.uint32(24),r.ValidityType.codec().encode(i.validityType,o)),i.validity!=null&&(o.uint32(34),o.bytes(i.validity)),i.sequence!=null&&(o.uint32(40),o.uint64(i.sequence)),i.ttl!=null&&(o.uint32(48),o.uint64(i.ttl)),i.pubKey!=null&&(o.uint32(58),o.bytes(i.pubKey)),i.signatureV2!=null&&(o.uint32(66),o.bytes(i.signatureV2)),i.data!=null&&(o.uint32(74),o.bytes(i.data)),s.lengthDelimited!==!1&&o.ldelim()},(i,o)=>{let s={},a=o==null?i.len:i.pos+o;for(;i.pos<a;){let c=i.uint32();switch(c>>>3){case 1:s.value=i.bytes();break;case 2:s.signatureV1=i.bytes();break;case 3:s.validityType=r.ValidityType.codec().decode(i);break;case 4:s.validity=i.bytes();break;case 5:s.sequence=i.uint64();break;case 6:s.ttl=i.uint64();break;case 7:s.pubKey=i.bytes();break;case 8:s.signatureV2=i.bytes();break;case 9:s.data=i.bytes();break;default:i.skipType(c&7);break}}return s})),n),r.encode=i=>rr(i,r.codec()),r.decode=i=>er(i,r.codec())})(ot||(ot={}));var JB=["string","number","bigint","symbol"],ZB=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Cw(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if(JB.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(QB(r))return"Buffer";let t=ek(r);return t||"Object"}function QB(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}function ek(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(ZB.includes(e))return e}var A=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};A.uint=new A(0,"uint",!0);A.negint=new A(1,"negint",!0);A.bytes=new A(2,"bytes",!0);A.string=new A(3,"string",!0);A.array=new A(4,"array",!1);A.map=new A(5,"map",!1);A.tag=new A(6,"tag",!1);A.float=new A(7,"float",!0);A.false=new A(7,"false",!0);A.true=new A(7,"true",!0);A.null=new A(7,"null",!0);A.undefined=new A(7,"undefined",!0);A.break=new A(7,"break",!0);var C=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};var ls=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",tk=new TextDecoder,rk=new TextEncoder;function Bu(r){return ls&&globalThis.Buffer.isBuffer(r)}function Fa(r){return r instanceof Uint8Array?Bu(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}var Dw=ls?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):Uw(r,e,t):(r,e,t)=>t-e>64?tk.decode(r.subarray(e,t)):Uw(r,e,t),ku=ls?r=>r.length>64?globalThis.Buffer.from(r):Rw(r):r=>r.length>64?rk.encode(r):Rw(r),Hr=r=>Uint8Array.from(r),us=ls?(r,e,t)=>Bu(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),Lw=ls?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),Fa(globalThis.Buffer.concat(r,e))):(r,e)=>{let t=new Uint8Array(e),n=0;for(let i of r)n+i.length>t.length&&(i=i.subarray(0,t.length-n)),t.set(i,n),n+=i.length;return t},Pw=ls?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function Ow(r,e){if(Bu(r)&&Bu(e))return r.compare(e);for(let t=0;t<r.length;t++)if(r[t]!==e[t])return r[t]<e[t]?-1:1;return 0}function Rw(r){let e=[],t=0;for(let n=0;n<r.length;n++){let i=r.charCodeAt(n);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&n+1<r.length&&(r.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(r.charCodeAt(++n)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e}function Uw(r,e,t){let n=[];for(;e<t;){let i=r[e],o=null,s=i>239?4:i>223?3:i>191?2:1;if(e+s<=t){let a,c,u,l;switch(s){case 1:i<128&&(o=i);break;case 2:a=r[e+1],(a&192)===128&&(l=(i&31)<<6|a&63,l>127&&(o=l));break;case 3:a=r[e+1],c=r[e+2],(a&192)===128&&(c&192)===128&&(l=(i&15)<<12|(a&63)<<6|c&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:a=r[e+1],c=r[e+2],u=r[e+3],(a&192)===128&&(c&192)===128&&(u&192)===128&&(l=(i&15)<<18|(a&63)<<12|(c&63)<<6|u&63,l>65535&&l<1114112&&(o=l))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),e+=s}return yh(n)}var Nw=4096;function yh(r){let e=r.length;if(e<=Nw)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Nw));return t}var nk=256,za=class{constructor(e=nk){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let i=t.length-(this.maxCursor-this.cursor)-1;t.set(e,i)}else{if(t){let i=t.length-(this.maxCursor-this.cursor)-1;i<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,i),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=Pw(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=us(n,0,this.cursor)}else t=Lw(this.chunks,this.cursor);return e&&this.reset(),t}};var q="CBOR decode error:",kn="CBOR encode error:",Va=[];Va[23]=1;Va[24]=2;Va[25]=3;Va[26]=5;Va[27]=9;function In(r,e,t){if(r.length-e<t)throw new Error(`${q} not enough data for type`)}var Ze=[24,256,65536,4294967296,BigInt("18446744073709551616")];function $t(r,e,t){In(r,e,1);let n=r[e];if(t.strict===!0&&n<Ze[0])throw new Error(`${q} integer encoded in more bytes than necessary (strict decode)`);return n}function jt(r,e,t){In(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Ze[1])throw new Error(`${q} integer encoded in more bytes than necessary (strict decode)`);return n}function Ht(r,e,t){In(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Ze[2])throw new Error(`${q} integer encoded in more bytes than necessary (strict decode)`);return n}function qt(r,e,t){In(r,e,8);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3],i=r[e+4]*16777216+(r[e+5]<<16)+(r[e+6]<<8)+r[e+7],o=(BigInt(n)<<BigInt(32))+BigInt(i);if(t.strict===!0&&o<Ze[3])throw new Error(`${q} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(t.allowBigInt===!0)return o;throw new Error(`${q} integers outside of the safe integer range are not supported`)}function Fw(r,e,t,n){return new C(A.uint,$t(r,e+1,n),2)}function zw(r,e,t,n){return new C(A.uint,jt(r,e+1,n),3)}function Vw(r,e,t,n){return new C(A.uint,Ht(r,e+1,n),5)}function Mw(r,e,t,n){return new C(A.uint,qt(r,e+1,n),9)}function cr(r,e){return st(r,0,e.value)}function st(r,e,t){if(t<Ze[0]){let n=Number(t);r.push([e|n])}else if(t<Ze[1]){let n=Number(t);r.push([e|24,n])}else if(t<Ze[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Ze[3]){let n=Number(t);r.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(t);if(n<Ze[4]){let i=[e|27,0,0,0,0,0,0,0],o=Number(n&BigInt(4294967295)),s=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=o&255,o=o>>8,i[7]=o&255,o=o>>8,i[6]=o&255,o=o>>8,i[5]=o&255,i[4]=s&255,s=s>>8,i[3]=s&255,s=s>>8,i[2]=s&255,s=s>>8,i[1]=s&255,r.push(i)}else throw new Error(`${q} encountered BigInt larger than allowable range`)}}cr.encodedSize=function(e){return st.encodedSize(e.value)};st.encodedSize=function(e){return e<Ze[0]?1:e<Ze[1]?2:e<Ze[2]?3:e<Ze[3]?5:9};cr.compareTokens=function(e,t){return e.value<t.value?-1:e.value>t.value?1:0};function $w(r,e,t,n){return new C(A.negint,-1-$t(r,e+1,n),2)}function jw(r,e,t,n){return new C(A.negint,-1-jt(r,e+1,n),3)}function Hw(r,e,t,n){return new C(A.negint,-1-Ht(r,e+1,n),5)}var wh=BigInt(-1),qw=BigInt(1);function Kw(r,e,t,n){let i=qt(r,e+1,n);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new C(A.negint,o,9)}if(n.allowBigInt!==!0)throw new Error(`${q} integers outside of the safe integer range are not supported`);return new C(A.negint,wh-BigInt(i),9)}function Iu(r,e){let t=e.value,n=typeof t=="bigint"?t*wh-qw:t*-1-1;st(r,e.type.majorEncoded,n)}Iu.encodedSize=function(e){let t=e.value,n=typeof t=="bigint"?t*wh-qw:t*-1-1;return n<Ze[0]?1:n<Ze[1]?2:n<Ze[2]?3:n<Ze[3]?5:9};Iu.compareTokens=function(e,t){return e.value<t.value?1:e.value>t.value?-1:0};function Ma(r,e,t,n){In(r,e,t+n);let i=us(r,e+t,e+t+n);return new C(A.bytes,i,t+n)}function Gw(r,e,t,n){return Ma(r,e,1,t)}function Ww(r,e,t,n){return Ma(r,e,2,$t(r,e+1,n))}function Yw(r,e,t,n){return Ma(r,e,3,jt(r,e+1,n))}function Xw(r,e,t,n){return Ma(r,e,5,Ht(r,e+1,n))}function Jw(r,e,t,n){let i=qt(r,e+1,n);if(typeof i=="bigint")throw new Error(`${q} 64-bit integer bytes lengths not supported`);return Ma(r,e,9,i)}function _u(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===A.string?ku(r.value):r.value),r.encodedBytes}function ps(r,e){let t=_u(e);st(r,e.type.majorEncoded,t.length),r.push(t)}ps.encodedSize=function(e){let t=_u(e);return st.encodedSize(t.length)+t.length};ps.compareTokens=function(e,t){return ok(_u(e),_u(t))};function ok(r,e){return r.length<e.length?-1:r.length>e.length?1:Ow(r,e)}function $a(r,e,t,n,i){let o=t+n;In(r,e,o);let s=new C(A.string,Dw(r,e+t,e+o),o);return i.retainStringBytes===!0&&(s.byteValue=us(r,e+t,e+o)),s}function Zw(r,e,t,n){return $a(r,e,1,t,n)}function Qw(r,e,t,n){return $a(r,e,2,$t(r,e+1,n),n)}function eb(r,e,t,n){return $a(r,e,3,jt(r,e+1,n),n)}function tb(r,e,t,n){return $a(r,e,5,Ht(r,e+1,n),n)}function rb(r,e,t,n){let i=qt(r,e+1,n);if(typeof i=="bigint")throw new Error(`${q} 64-bit integer string lengths not supported`);return $a(r,e,9,i,n)}var nb=ps;function ds(r,e,t,n){return new C(A.array,n,t)}function ib(r,e,t,n){return ds(r,e,1,t)}function ob(r,e,t,n){return ds(r,e,2,$t(r,e+1,n))}function sb(r,e,t,n){return ds(r,e,3,jt(r,e+1,n))}function ab(r,e,t,n){return ds(r,e,5,Ht(r,e+1,n))}function cb(r,e,t,n){let i=qt(r,e+1,n);if(typeof i=="bigint")throw new Error(`${q} 64-bit integer array lengths not supported`);return ds(r,e,9,i)}function lb(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${q} indefinite length items not allowed`);return ds(r,e,1,1/0)}function Tu(r,e){st(r,A.array.majorEncoded,e.value)}Tu.compareTokens=cr.compareTokens;Tu.encodedSize=function(e){return st.encodedSize(e.value)};function fs(r,e,t,n){return new C(A.map,n,t)}function ub(r,e,t,n){return fs(r,e,1,t)}function pb(r,e,t,n){return fs(r,e,2,$t(r,e+1,n))}function db(r,e,t,n){return fs(r,e,3,jt(r,e+1,n))}function fb(r,e,t,n){return fs(r,e,5,Ht(r,e+1,n))}function hb(r,e,t,n){let i=qt(r,e+1,n);if(typeof i=="bigint")throw new Error(`${q} 64-bit integer map lengths not supported`);return fs(r,e,9,i)}function mb(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${q} indefinite length items not allowed`);return fs(r,e,1,1/0)}function Cu(r,e){st(r,A.map.majorEncoded,e.value)}Cu.compareTokens=cr.compareTokens;Cu.encodedSize=function(e){return st.encodedSize(e.value)};function gb(r,e,t,n){return new C(A.tag,t,1)}function xb(r,e,t,n){return new C(A.tag,$t(r,e+1,n),2)}function yb(r,e,t,n){return new C(A.tag,jt(r,e+1,n),3)}function wb(r,e,t,n){return new C(A.tag,Ht(r,e+1,n),5)}function bb(r,e,t,n){return new C(A.tag,qt(r,e+1,n),9)}function Ru(r,e){st(r,A.tag.majorEncoded,e.value)}Ru.compareTokens=cr.compareTokens;Ru.encodedSize=function(e){return st.encodedSize(e.value)};var pk=20,dk=21,fk=22,hk=23;function vb(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${q} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new C(A.null,null,1):new C(A.undefined,void 0,1)}function Eb(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${q} indefinite length items not allowed`);return new C(A.break,void 0,1)}function bh(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${q} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${q} Infinity values are not supported`)}return new C(A.float,r,e)}function Ab(r,e,t,n){return bh(vh(r,e+1),3,n)}function Sb(r,e,t,n){return bh(Eh(r,e+1),5,n)}function Bb(r,e,t,n){return bh(Tb(r,e+1),9,n)}function Uu(r,e,t){let n=e.value;if(n===!1)r.push([A.float.majorEncoded|pk]);else if(n===!0)r.push([A.float.majorEncoded|dk]);else if(n===null)r.push([A.float.majorEncoded|fk]);else if(n===void 0)r.push([A.float.majorEncoded|hk]);else{let i,o=!1;(!t||t.float64!==!0)&&(Ib(n),i=vh(Er,1),n===i||Number.isNaN(n)?(Er[0]=249,r.push(Er.slice(0,3)),o=!0):(_b(n),i=Eh(Er,1),n===i&&(Er[0]=250,r.push(Er.slice(0,5)),o=!0))),o||(mk(n),i=Tb(Er,1),Er[0]=251,r.push(Er.slice(0,9)))}}Uu.encodedSize=function(e,t){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!t||t.float64!==!0){Ib(n);let i=vh(Er,1);if(n===i||Number.isNaN(n))return 3;if(_b(n),i=Eh(Er,1),n===i)return 5}return 9};var kb=new ArrayBuffer(9),lr=new DataView(kb,1),Er=new Uint8Array(kb,0);function Ib(r){if(r===1/0)lr.setUint16(0,31744,!1);else if(r===-1/0)lr.setUint16(0,64512,!1);else if(Number.isNaN(r))lr.setUint16(0,32256,!1);else{lr.setFloat32(0,r);let e=lr.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)lr.setUint16(0,31744,!1);else if(t===0)lr.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?lr.setUint16(0,0):i<-14?lr.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):lr.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}function vh(r,e){if(r.length-e<2)throw new Error(`${q} not enough data for float16`);let t=(r[e]<<8)+r[e+1];if(t===31744)return 1/0;if(t===64512)return-1/0;if(t===32256)return NaN;let n=t>>10&31,i=t&1023,o;return n===0?o=i*2**-24:n!==31?o=(i+1024)*2**(n-25):o=i===0?1/0:NaN,t&32768?-o:o}function _b(r){lr.setFloat32(0,r,!1)}function Eh(r,e){if(r.length-e<4)throw new Error(`${q} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}function mk(r){lr.setFloat64(0,r,!1)}function Tb(r,e){if(r.length-e<8)throw new Error(`${q} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}Uu.compareTokens=cr.compareTokens;function me(r,e,t){throw new Error(`${q} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}function Nu(r){return()=>{throw new Error(`${q} ${r}`)}}var F=[];for(let r=0;r<=23;r++)F[r]=me;F[24]=Fw;F[25]=zw;F[26]=Vw;F[27]=Mw;F[28]=me;F[29]=me;F[30]=me;F[31]=me;for(let r=32;r<=55;r++)F[r]=me;F[56]=$w;F[57]=jw;F[58]=Hw;F[59]=Kw;F[60]=me;F[61]=me;F[62]=me;F[63]=me;for(let r=64;r<=87;r++)F[r]=Gw;F[88]=Ww;F[89]=Yw;F[90]=Xw;F[91]=Jw;F[92]=me;F[93]=me;F[94]=me;F[95]=Nu("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)F[r]=Zw;F[120]=Qw;F[121]=eb;F[122]=tb;F[123]=rb;F[124]=me;F[125]=me;F[126]=me;F[127]=Nu("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)F[r]=ib;F[152]=ob;F[153]=sb;F[154]=ab;F[155]=cb;F[156]=me;F[157]=me;F[158]=me;F[159]=lb;for(let r=160;r<=183;r++)F[r]=ub;F[184]=pb;F[185]=db;F[186]=fb;F[187]=hb;F[188]=me;F[189]=me;F[190]=me;F[191]=mb;for(let r=192;r<=215;r++)F[r]=gb;F[216]=xb;F[217]=yb;F[218]=wb;F[219]=bb;F[220]=me;F[221]=me;F[222]=me;F[223]=me;for(let r=224;r<=243;r++)F[r]=Nu("simple values are not supported");F[244]=me;F[245]=me;F[246]=me;F[247]=vb;F[248]=Nu("simple values are not supported");F[249]=Ab;F[250]=Sb;F[251]=Bb;F[252]=me;F[253]=me;F[254]=me;F[255]=Eb;var Ar=[];for(let r=0;r<24;r++)Ar[r]=new C(A.uint,r,1);for(let r=-1;r>=-24;r--)Ar[31-r]=new C(A.negint,r,1);Ar[64]=new C(A.bytes,new Uint8Array(0),1);Ar[96]=new C(A.string,"",1);Ar[128]=new C(A.array,0,1);Ar[160]=new C(A.map,0,1);Ar[244]=new C(A.false,!1,1);Ar[245]=new C(A.true,!0,1);Ar[246]=new C(A.null,null,1);function Cb(r){switch(r.type){case A.false:return Hr([244]);case A.true:return Hr([245]);case A.null:return Hr([246]);case A.bytes:return r.value.length?void 0:Hr([64]);case A.string:return r.value===""?Hr([96]):void 0;case A.array:return r.value===0?Hr([128]):void 0;case A.map:return r.value===0?Hr([160]):void 0;case A.uint:return r.value<24?Hr([Number(r.value)]):void 0;case A.negint:if(r.value>=-24)return Hr([31-Number(r.value)])}}var xk={float64:!1,mapSorter:bk,quickEncodeToken:Cb};function yk(){let r=[];return r[A.uint.major]=cr,r[A.negint.major]=Iu,r[A.bytes.major]=ps,r[A.string.major]=nb,r[A.array.major]=Tu,r[A.map.major]=Cu,r[A.tag.major]=Ru,r[A.float.major]=Uu,r}var Rb=yk(),Ah=new za,Lu=class r{constructor(e,t){this.obj=e,this.parent=t}includes(e){let t=this;do if(t.obj===e)return!0;while(t=t.parent);return!1}static createCheck(e,t){if(e&&e.includes(t))throw new Error(`${kn} object contains circular references`);return new r(t,e)}},wi={null:new C(A.null,null),undefined:new C(A.undefined,void 0),true:new C(A.true,!0),false:new C(A.false,!1),emptyArray:new C(A.array,0),emptyMap:new C(A.map,0)},bi={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new C(A.float,r):r>=0?new C(A.uint,r):new C(A.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new C(A.uint,r):new C(A.negint,r)},Uint8Array(r,e,t,n){return new C(A.bytes,r)},string(r,e,t,n){return new C(A.string,r)},boolean(r,e,t,n){return r?wi.true:wi.false},null(r,e,t,n){return wi.null},undefined(r,e,t,n){return wi.undefined},ArrayBuffer(r,e,t,n){return new C(A.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new C(A.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[wi.emptyArray,new C(A.break)]:wi.emptyArray;n=Lu.createCheck(n,r);let i=[],o=0;for(let s of r)i[o++]=Du(s,t,n);return t.addBreakTokens?[new C(A.array,r.length),i,new C(A.break)]:[new C(A.array,r.length),i]},Object(r,e,t,n){let i=e!=="Object",o=i?r.keys():Object.keys(r),s=i?r.size:o.length;if(!s)return t.addBreakTokens===!0?[wi.emptyMap,new C(A.break)]:wi.emptyMap;n=Lu.createCheck(n,r);let a=[],c=0;for(let u of o)a[c++]=[Du(u,t,n),Du(i?r.get(u):r[u],t,n)];return wk(a,t),t.addBreakTokens?[new C(A.map,s),a,new C(A.break)]:[new C(A.map,s),a]}};bi.Map=bi.Object;bi.Buffer=bi.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))bi[`${r}Array`]=bi.DataView;function Du(r,e={},t){let n=Cw(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||bi[n];if(typeof i=="function"){let s=i(r,n,e,t);if(s!=null)return s}let o=bi[n];if(!o)throw new Error(`${kn} unsupported type: ${n}`);return o(r,n,e,t)}function wk(r,e){e.mapSorter&&r.sort(e.mapSorter)}function bk(r,e){let t=Array.isArray(r[0])?r[0][0]:r[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(t.type!==n.type)return t.type.compare(n.type);let i=t.type.major,o=Rb[i].compareTokens(t,n);return o===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),o}function Ub(r,e,t,n){if(Array.isArray(e))for(let i of e)Ub(r,i,t,n);else t[e.type.major](r,e,n)}function Sh(r,e,t){let n=Du(r,t);if(!Array.isArray(n)&&t.quickEncodeToken){let i=t.quickEncodeToken(n);if(i)return i;let o=e[n.type.major];if(o.encodedSize){let s=o.encodedSize(n,t),a=new za(s);if(o(a,n,t),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return Fa(a.chunks[0])}}return Ah.reset(),Ub(Ah,n,e,t),Ah.toBytes(!0)}function vi(r,e){return e=Object.assign({},xk,e),Sh(r,Rb,e)}var vk={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Bh=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],t=Ar[e];if(t===void 0){let n=F[e];if(!n)throw new Error(`${q} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let i=e&31;t=n(this.data,this._pos,i,this.options)}return this._pos+=t.encodedLength,t}},ja=Symbol.for("DONE"),Pu=Symbol.for("BREAK");function Ek(r,e,t){let n=[];for(let i=0;i<r.value;i++){let o=Ha(e,t);if(o===Pu){if(r.value===1/0)break;throw new Error(`${q} got unexpected break to lengthed array`)}if(o===ja)throw new Error(`${q} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=o}return n}function Ak(r,e,t){let n=t.useMaps===!0,i=n?void 0:{},o=n?new Map:void 0;for(let s=0;s<r.value;s++){let a=Ha(e,t);if(a===Pu){if(r.value===1/0)break;throw new Error(`${q} got unexpected break to lengthed map`)}if(a===ja)throw new Error(`${q} found map but not enough entries (got ${s} [no key], expected ${r.value})`);if(n!==!0&&typeof a!="string")throw new Error(`${q} non-string keys not supported (got ${typeof a})`);if(t.rejectDuplicateMapKeys===!0&&(n&&o.has(a)||!n&&a in i))throw new Error(`${q} found repeat map key "${a}"`);let c=Ha(e,t);if(c===ja)throw new Error(`${q} found map but not enough entries (got ${s} [no value], expected ${r.value})`);n?o.set(a,c):i[a]=c}return n?o:i}function Ha(r,e){if(r.done())return ja;let t=r.next();if(t.type===A.break)return Pu;if(t.type.terminal)return t.value;if(t.type===A.array)return Ek(t,r,e);if(t.type===A.map)return Ak(t,r,e);if(t.type===A.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=Ha(r,e);return e.tags[t.value](n)}throw new Error(`${q} tag not supported (${t.value})`)}throw new Error("unsupported")}function kh(r,e){if(!(r instanceof Uint8Array))throw new Error(`${q} data to decode must be a Uint8Array`);e=Object.assign({},vk,e);let t=e.tokenizer||new Bh(r,e),n=Ha(t,e);if(n===ja)throw new Error(`${q} did not find any content to decode`);if(n===Pu)throw new Error(`${q} got unexpected break`);return[n,r.subarray(t.pos())]}function Kt(r,e){let[t,n]=kh(r,e);if(n.length>0)throw new Error(`${q} too many terminals, data makes no sense`);return t}var Tt=Q(ke(),1);var Nb=ne("ipns:utils"),Db=Z("/ipns/"),Sk=114,Lb=async(r,e)=>{if(e==null||r==null){let n=new Error("one or more of the provided parameters are not defined");throw Nb.error(n),(0,Tt.default)(n,gh)}let t;if(e.pubKey!=null){try{t=hh(e.pubKey)}catch(i){throw Nb.error(i),i}if(!(await _1(e.pubKey)).equals(r))throw(0,Tt.default)(new Error("Embedded public key did not match PeerID"),Iw)}else r.publicKey!=null&&(t=hh(r.publicKey));if(t!=null)return t;throw(0,Tt.default)(new Error("no public key is available"),gh)},Pb=(r,e,t)=>{let n=Z(e);return ze([r,t,n])},Fu=r=>{let e=Z("ipns-signature:");return ze([e,r])},_n=r=>"signatureV1"in r?ot.encode({value:Z(r.value),signatureV1:r.signatureV1,validityType:r.validityType,validity:Z(r.validity),sequence:r.sequence,ttl:r.ttl,pubKey:r.pubKey,signatureV2:r.signatureV2,data:r.data}):ot.encode({pubKey:r.pubKey,signatureV2:r.signatureV2,data:r.data});function wt(r){let e=ot.decode(r);if(e.sequence!=null&&(e.sequence=BigInt(e.sequence)),e.ttl!=null&&(e.ttl=BigInt(e.ttl)),e.signatureV2==null||e.data==null)throw(0,Tt.default)(new Error("missing data or signatureV2"),Bn);let t=Fb(e.data),n=Ih(t.Value),i=oe(t.Validity);if(e.value!=null&&e.signatureV1!=null)return Bk(e),{value:n,validityType:ot.ValidityType.EOL,validity:i,sequence:t.Sequence,ttl:t.TTL,pubKey:e.pubKey,signatureV1:e.signatureV1,signatureV2:e.signatureV2,data:e.data};if(e.signatureV2!=null)return{value:n,validityType:ot.ValidityType.EOL,validity:i,sequence:t.Sequence,ttl:t.TTL,pubKey:e.pubKey,signatureV2:e.signatureV2,data:e.data};throw new Error("invalid record: does not include signatureV1 or signatureV2")}var hs=r=>ze([Db,r.toBytes()]),ms=r=>wa(r.slice(Db.length)),Ob=(r,e,t,n,i)=>{let o;if(e===ot.ValidityType.EOL)o=0;else throw(0,Tt.default)(new Error("Unknown validity type"),Oa);return vi({Value:r,Validity:t,ValidityType:o,Sequence:n,TTL:i})},Fb=r=>{let e=Kt(r);if(e.ValidityType===0)e.ValidityType=ot.ValidityType.EOL;else throw(0,Tt.default)(new Error("Unknown validity type"),Oa);return Number.isInteger(e.Sequence)&&(e.Sequence=BigInt(e.Sequence)),Number.isInteger(e.TTL)&&(e.TTL=BigInt(e.TTL)),e},Ih=r=>{if(r!=null){if(Vx(r))return`/ipns/${r.toCID().toString(oi)}`;if(r instanceof Uint8Array){let n=oe(r);n.startsWith("/")&&(r=n)}let e=r.toString().trim();if(e.startsWith("/")&&e.length>1)return e;let t=z.asCID(r);if(t!=null)return t.code===Sk?`/ipns/${t.toString(oi)}`:`/ipfs/${t.toV1().toString()}`;try{return r instanceof Uint8Array?`/ipfs/${z.decode(r).toV1().toString()}`:`/ipfs/${z.parse(e).toV1().toString()}`}catch{}}throw(0,Tt.default)(new Error("Value must be a valid content path starting with /"),kw)},Bk=r=>{if(r.data==null)throw(0,Tt.default)(new Error("Record data is missing"),Bw);let e=Fb(r.data);if(!ge(e.Value,r.value??new Uint8Array(0)))throw(0,Tt.default)(new Error('Field "value" did not match between protobuf and CBOR'),Bn);if(!ge(e.Validity,r.validity??new Uint8Array(0)))throw(0,Tt.default)(new Error('Field "validity" did not match between protobuf and CBOR'),Bn);if(e.ValidityType!==r.validityType)throw(0,Tt.default)(new Error('Field "validityType" did not match between protobuf and CBOR'),Bn);if(e.Sequence!==r.sequence)throw(0,Tt.default)(new Error('Field "sequence" did not match between protobuf and CBOR'),Bn);if(e.TTL!==r.ttl)throw(0,Tt.default)(new Error('Field "ttl" did not match between protobuf and CBOR'),Bn)};var kk=ne("ipns"),Ik=It.code,_k="/ipns/",x$=_k.length,Vb={v1Compatible:!0};async function Mb(r,e,t,n,i=Vb){let o=new zb.default(Date.now()+Number(n)),s=ot.ValidityType.EOL,[a,c]=n.toString().split("."),u=BigInt(a)*BigInt(1e5)+BigInt(c??"0");return Tk(r,e,t,s,o.toString(),u,i)}var Tk=async(r,e,t,n,i,o,s=Vb)=>{t=BigInt(t);let a=Z(i),c=Ih(e),u=Z(c);if(r.privateKey==null)throw(0,_h.default)(new Error("Missing private key"),_w);let l=await vw(r.privateKey),p=Ob(u,n,a,t,o),m=Fu(p),d=await l.sign(m),f;if(r.publicKey!=null){let h=Ot(r.toBytes());(h.code!==Ik||!ge(r.publicKey,h.digest))&&(f=r.publicKey)}if(s.v1Compatible===!0){let h=await Ck(l,u,n,a),x={value:c,signatureV1:h,validity:i,validityType:n,sequence:t,ttl:o,signatureV2:d,data:p};return f!=null&&(x.pubKey=f),x}else{let h={value:c,validity:i,validityType:n,sequence:t,ttl:o,signatureV2:d,data:p};return f!=null&&(h.pubKey=f),h}};var Ck=async(r,e,t,n)=>{try{let i=Pb(e,t,n);return await r.sign(i)}catch(i){throw kk.error("record signature creation failed",i),(0,_h.default)(new Error("record signature creation failed"),Sw)}};var qa=Q(ke(),1),$b=Q(Su(),1);var zu=ne("ipns:validator"),Rk=1024*10,Uk=async(r,e)=>{let t=wt(e),n;try{let i=Fu(t.data);n=await r.verify(i,t.signatureV2)}catch{n=!1}if(!n)throw zu.error("record signature verification failed"),(0,qa.default)(new Error("record signature verification failed"),Bn);if(t.validityType===ot.ValidityType.EOL){if($b.default.fromString(t.validity).toDate().getTime()<Date.now())throw zu.error("record has expired"),(0,qa.default)(new Error("record has expired"),Aw)}else if(t.validityType!=null)throw zu.error("unrecognized validity type"),(0,qa.default)(new Error("unrecognized validity type"),Oa);zu("ipns record for %s is valid",t.value)};async function Vu(r,e){if(e.byteLength>Rk)throw(0,qa.default)(new Error("record too large"),Tw);let t=ms(r),n=wt(e),i=await Lb(t,n);await Uk(i,e)}async function*Ka(r){let e=/\r?\n/,t=new TextDecoder("utf8"),n="";for await(let i of r){typeof i=="string"&&(i=new TextEncoder().encode(i)),n+=t.decode(i,{stream:!0});let o=n.split(e);n=o.pop()??"";for(let s=0;s<o.length;s++)yield JSON.parse(o[s])}n+=t.decode(),n!==""&&(yield JSON.parse(n))}var Ch=Q(Hb(),1);var Wa=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Rh=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},qb=r=>globalThis.DOMException===void 0?new Rh(r):new DOMException(r),Kb=r=>{let e=r.reason===void 0?qb("This operation was aborted."):r.reason;return e instanceof Error?e:qb(e)};function Ya(r,e){let{milliseconds:t,fallback:n,message:i,customTimers:o={setTimeout,clearTimeout}}=e,s,c=new Promise((u,l)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:m}=e;m.aborted&&l(Kb(m)),m.addEventListener("abort",()=>{l(Kb(m))})}if(t===Number.POSITIVE_INFINITY){r.then(u,l);return}let p=new Wa;s=o.setTimeout.call(void 0,()=>{if(n){try{u(n())}catch(m){l(m)}return}typeof r.cancel=="function"&&r.cancel(),i===!1?u():i instanceof Error?l(i):(p.message=i??`Promise timed out after ${t} milliseconds`,l(p))},t),(async()=>{try{u(await r)}catch(m){l(m)}})()}).finally(()=>{c.clear()});return c.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},c}function Uh(r,e,t){let n=0,i=r.length;for(;i>0;){let o=Math.trunc(i/2),s=n+o;t(r[s],e)<=0?(n=++s,i-=o+1):i=o}return n}var Xa=class{#e=[];enqueue(e,t){t={priority:0,...t};let n={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(n);return}let i=Uh(this.#e,n,(o,s)=>s.priority-o.priority);this.#e.splice(i,0,n)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var Ct=class extends Ch.default{#e;#t;#r=0;#n;#c;#h=0;#o;#l;#i;#m;#s=0;#u;#a;#g;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Xa,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#t=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#n=e.intervalCap,this.#c=e.interval,this.#i=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#a=e.autoStart===!1}get#w(){return this.#t||this.#r<this.#n}get#b(){return this.#s<this.#u}#v(){this.#s--,this.#p(),this.emit("next")}#E(){this.#y(),this.#x(),this.#l=void 0}get#A(){let e=Date.now();if(this.#o===void 0){let t=this.#h-e;if(t<0)this.#r=this.#e?this.#s:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#E()},t)),!0}return!1}#p(){if(this.#i.size===0)return this.#o&&clearInterval(this.#o),this.#o=void 0,this.emit("empty"),this.#s===0&&this.emit("idle"),!1;if(!this.#a){let e=!this.#A;if(this.#w&&this.#b){let t=this.#i.dequeue();return t?(this.emit("active"),t(),e&&this.#x(),!0):!1}}return!1}#x(){this.#t||this.#o!==void 0||(this.#o=setInterval(()=>{this.#y()},this.#c),this.#h=Date.now()+this.#c)}#y(){this.#r===0&&this.#s===0&&this.#o&&(clearInterval(this.#o),this.#o=void 0),this.#r=this.#e?this.#s:0,this.#d()}#d(){for(;this.#p(););}get concurrency(){return this.#u}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#u=e,this.#d()}async#S(e){return new Promise((t,n)=>{e.addEventListener("abort",()=>{n(e.reason)},{once:!0})})}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:this.#g,...t},new Promise((n,i)=>{this.#i.enqueue(async()=>{this.#s++,this.#r++;try{t.signal?.throwIfAborted();let o=e({signal:t.signal});t.timeout&&(o=Ya(Promise.resolve(o),{milliseconds:t.timeout})),t.signal&&(o=Promise.race([o,this.#S(t.signal)]));let s=await o;n(s),this.emit("completed",s)}catch(o){if(o instanceof Wa&&!t.throwOnTimeout){n();return}i(o),this.emit("error",o)}finally{this.#v()}},t),this.emit("add"),this.#p()})}async addAll(e,t){return Promise.all(e.map(async n=>this.add(n,t)))}start(){return this.#a?(this.#a=!1,this.#d(),this):this}pause(){this.#a=!0}clear(){this.#i=new this.#m}async onEmpty(){this.#i.size!==0&&await this.#f("empty")}async onSizeLessThan(e){this.#i.size<e||await this.#f("next",()=>this.#i.size<e)}async onIdle(){this.#s===0&&this.#i.size===0||await this.#f("idle")}async#f(e,t){return new Promise(n=>{let i=()=>{t&&!t()||(this.off(e,i),n())};this.on(e,i)})}get size(){return this.#i.size}sizeBy(e){return this.#i.filter(e).length}get pending(){return this.#s}get isPaused(){return this.#a}};function Lk(r){return r[Symbol.asyncIterator]!=null}function Pk(r){if(Lk(r))return(async()=>{for await(let e of r)return e})();for(let e of r)return e}var so=Pk;var Nh=Z("/ipns/");function Gb(r){return ge(r.subarray(0,Nh.byteLength),Nh)}var Wb=r=>wa(r.slice(Nh.length)),$u=class{client;constructor(e){this.client=e}async*findProviders(e,t={}){yield*fr(this.client.getProviders(e,t),n=>({id:n.ID,multiaddrs:n.Addrs??[]}))}async provide(){}async put(e,t,n){if(!Gb(e))return;let i=Wb(e),o=wt(t);await this.client.putIPNS(i,o,n)}async get(e,t){if(!Gb(e))throw new O("Not found","ERR_NOT_FOUND");let n=Wb(e);try{let i=await this.client.getIPNS(n,t);return _n(i)}catch(i){throw i.code==="ERR_BAD_RESPONSE"?new O("Not found","ERR_NOT_FOUND"):i}}},ju=class{client;constructor(e){this.client=e}async findPeer(e,t={}){let n=await so(this.client.getPeers(e,t));if(n!=null)return{id:n.ID,multiaddrs:n.Addrs??[]};throw new O("Not found","ERR_NOT_FOUND")}async*getClosestPeers(e,t={}){}};var Rt=ne("delegated-routing-v1-http-api-client"),Yb={concurrentRequests:4,timeout:3e4},Hu=class{started;httpQueue;shutDownController;clientUrl;timeout;contentRouting;peerRouting;constructor(e,t={}){this.started=!1,this.shutDownController=new AbortController,tl(1/0,this.shutDownController.signal),this.httpQueue=new Ct({concurrency:t.concurrentRequests??Yb.concurrentRequests}),this.clientUrl=e instanceof URL?e:new URL(e),this.timeout=t.timeout??Yb.timeout,this.contentRouting=new $u(this),this.peerRouting=new ju(this)}get[fa](){return this.contentRouting}get[ha](){return this.peerRouting}isStarted(){return this.started}start(){this.started=!0}stop(){this.httpQueue.clear(),this.shutDownController.abort(),this.started=!1}async*getProviders(e,t={}){Rt("getProviders starts: %c",e);let n=ji([this.shutDownController.signal,t.signal,AbortSignal.timeout(this.timeout)]),i=He(),o=He();this.httpQueue.add(async()=>(i.resolve(),o.promise));try{await i.promise;let s=`${this.clientUrl}routing/v1/providers/${e.toString()}`,c=await fetch(s,{headers:{Accept:"application/x-ndjson"},signal:n});if(c.status===404)throw new O("No matching records found.","ERR_NOT_FOUND");if(c.status===422)throw new O("Request does not conform to schema or semantic constraints.","ERR_INVALID_REQUEST");if(c.body==null)throw new O("Routing response had no body","ERR_BAD_RESPONSE");if(c.headers.get("Content-Type")==="application/json"){let l=await c.json();for(let p of l.Providers){let m=this.#e(p);m!=null&&(yield m)}}else for await(let l of Ka(yl(c.body))){let p=this.#e(l);p!=null&&(yield p)}}catch(s){Rt.error("getProviders errored:",s)}finally{n.clear(),o.resolve(),Rt("getProviders finished: %c",e)}}async*getPeers(e,t={}){Rt("getPeers starts: %c",e);let n=ji([this.shutDownController.signal,t.signal,AbortSignal.timeout(this.timeout)]),i=He(),o=He();this.httpQueue.add(async()=>(i.resolve(),o.promise));try{await i.promise;let s=`${this.clientUrl}routing/v1/peers/${e.toCID().toString()}`,c=await fetch(s,{headers:{Accept:"application/x-ndjson"},signal:n});if(c.status===404)throw new O("No matching records found.","ERR_NOT_FOUND");if(c.status===422)throw new O("Request does not conform to schema or semantic constraints.","ERR_INVALID_REQUEST");if(c.body==null)throw new O("Routing response had no body","ERR_BAD_RESPONSE");if(c.headers.get("Content-Type")==="application/json"){let l=await c.json();for(let p of l.Peers){let m=this.#e(p);m!=null&&(yield m)}}else for await(let l of Ka(yl(c.body))){let p=this.#e(l);p!=null&&(yield p)}}catch(s){Rt.error("getPeers errored:",s)}finally{n.clear(),o.resolve(),Rt("getPeers finished: %c",e)}}async getIPNS(e,t={}){Rt("getIPNS starts: %c",e);let n=ji([this.shutDownController.signal,t.signal,AbortSignal.timeout(this.timeout)]),i=He(),o=He();this.httpQueue.add(async()=>(i.resolve(),o.promise));let s=`${this.clientUrl}routing/v1/ipns/${e.toCID().toString()}`;try{await i.promise;let c=await fetch(s,{headers:{Accept:"application/vnd.ipfs.ipns-record"},signal:n});if(Rt("getIPNS GET %s %d",s,c.status),c.status===404)throw new O("No matching records found.","ERR_NOT_FOUND");if(c.status===422)throw new O("Request does not conform to schema or semantic constraints.","ERR_INVALID_REQUEST");if(c.body==null)throw new O("GET ipns response had no body","ERR_BAD_RESPONSE");let u=await c.arrayBuffer(),l=new Uint8Array(u,0,u.byteLength);return t.validate!==!1&&await Vu(hs(e),l),wt(l)}catch(a){throw Rt.error("getIPNS GET %s error:",s,a),a}finally{n.clear(),o.resolve(),Rt("getIPNS finished: %c",e)}}async putIPNS(e,t,n={}){Rt("putIPNS starts: %c",e);let i=ji([this.shutDownController.signal,n.signal,AbortSignal.timeout(this.timeout)]),o=He(),s=He();this.httpQueue.add(async()=>(o.resolve(),s.promise));let a=`${this.clientUrl}routing/v1/ipns/${e.toCID().toString()}`;try{await o.promise;let c=_n(t),l=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/vnd.ipfs.ipns-record"},body:c,signal:i});if(Rt("putIPNS PUT %s %d",a,l.status),l.status!==200)throw new O("PUT ipns response had status other than 200","ERR_BAD_RESPONSE")}catch(c){throw Rt.error("putIPNS PUT %s error:",a,c.stack),c}finally{i.clear(),s.resolve(),Rt("putIPNS finished: %c",e)}}#e(e){let t=[],n=e.Addrs?.map(Df)??[];return e.Protocols!=null&&t.push(...e.Protocols),e.Protocol!=null&&(t.push(e.Protocol),delete e.Protocol),{...e,Schema:"peer",ID:mr(e.ID),Addrs:n,Protocols:t}}};function Xb(r,e={}){return new Hu(new URL(r),e)}var Jb=Z("/ipns/");function Zb(r){return ge(r.subarray(0,Jb.byteLength),Jb)}var Dh=class{client;constructor(e){this.client=Xb(e)}async provide(e,t){}async*findProviders(e,t){yield*fr(this.client.getProviders(e,t),n=>({id:n.ID,multiaddrs:n.Addrs,protocols:n.Protocols}))}async put(e,t,n){if(!Zb(e))return;let i=ms(e),o=wt(t);await this.client.putIPNS(i,o,n)}async get(e,t){if(!Zb(e))throw new O("Not found","ERR_NOT_FOUND");let n=ms(e);try{let i=await this.client.getIPNS(n,t);return _n(i)}catch(i){throw i.code==="ERR_BAD_RESPONSE"?new O("Not found","ERR_NOT_FOUND"):i}}async findPeer(e,t){let n=await so(this.client.getPeers(e,t));if(n!=null)return{id:n.ID,multiaddrs:n.Addrs??[]};throw new O("Not found","ERR_NOT_FOUND")}async*getClosestPeers(e,t){}};function Ja(r){return new Dh(new URL(r))}var Lh=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=t??"ABORT_ERR"}};async function qu(r,e,t,n){let i=new Lh(n?.errorMessage,n?.errorCode);return t?.aborted===!0?Promise.reject(i):new Promise((o,s)=>{let a=u=>{n?.filter?.(u)!==!1&&(r.removeEventListener(e,a),t?.removeEventListener("abort",c),o(u))},c=()=>{r.removeEventListener(e,a),t?.removeEventListener("abort",c),s(i)};r.addEventListener(e,a),t?.addEventListener("abort",c)})}var Ku=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=t??"ABORT_ERR"}};async function Qb(r,e,t){if(e==null)return r;if(e.aborted)return Promise.reject(new Ku(t?.errorMessage,t?.errorCode));let n,i=new Ku(t?.errorMessage,t?.errorCode);try{return await Promise.race([r,new Promise((o,s)=>{n=()=>{s(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var Gu=class{deferred;signal;where;constructor(e,t){this.signal=t,this.deferred=He(),this.where=e,this.onAbort=this.onAbort.bind(this),this.signal?.addEventListener("abort",this.onAbort)}onAbort(){this.deferred.reject(new ei)}cleanup(){this.signal?.removeEventListener("abort",this.onAbort)}};function Ok(){return`${parseInt(String(Math.random()*1e9),10).toString()}${Date.now()}`}var Wu=class{id;fn;options;priority;recipients;status;timeline;controller;constructor(e,t,n=0){this.id=Ok(),this.status="queued",this.fn=e,this.priority=n,this.options=t,this.recipients=[],this.timeline={created:Date.now()},this.controller=new AbortController,tl(1/0,this.controller.signal),this.onAbort=this.onAbort.bind(this)}abort(e){this.controller.abort(e)}onAbort(){this.recipients.reduce((t,n)=>t&&n.signal?.aborted===!0,!0)&&this.controller.abort(new ei)}async join(e={}){let t=new Gu(new Error("where").stack,e.signal);return this.recipients.push(t),e.signal?.addEventListener("abort",this.onAbort),t.deferred.promise}async run(){this.status="running",this.timeline.started=Date.now();try{this.controller.signal.throwIfAborted();let e=await Qb(this.fn({...this.options??{},signal:this.controller.signal}),this.controller.signal);this.recipients.forEach(t=>{t.deferred.resolve(e)}),this.status="complete"}catch(e){this.recipients.forEach(t=>{t.deferred.reject(e)}),this.status="errored"}finally{this.timeline.finished=Date.now(),this.cleanup()}}cleanup(){this.recipients.forEach(e=>{e.signal?.removeEventListener("abort",this.onAbort)})}};function Fk(r,e,t){let n=0,i=r.length;for(;i>0;){let o=Math.trunc(i/2),s=n+o;t(r[s],e)<=0?(n=++s,i-=o+1):i=o}return n}var Za=class extends el{concurrency;queue;pending;constructor(e={}){super(),this.concurrency=e.concurrency??Number.POSITIVE_INFINITY,this.pending=0,e.metricName!=null&&e.metrics?.registerMetricGroup(e.metricName,{calculate:()=>({size:this.queue.length,running:this.pending,queued:this.queue.length-this.pending})}),this.queue=[]}tryToStartAnother(){if(this.size===0)return queueMicrotask(()=>{this.safeDispatchEvent("empty")}),this.running===0&&queueMicrotask(()=>{this.safeDispatchEvent("idle")}),!1;if(this.pending<this.concurrency){let e;for(let t of this.queue)if(t.status==="queued"){e=t;break}return e==null?!1:(this.safeDispatchEvent("active"),this.pending++,e.run().finally(()=>{for(let t=0;t<this.queue.length;t++)if(this.queue[t]===e){this.queue.splice(t,1);break}this.pending--,this.tryToStartAnother(),this.safeDispatchEvent("next")}),!0)}return!1}enqueue(e){if(this.queue[this.size-1]?.priority>=e.priority){this.queue.push(e);return}let t=Fk(this.queue,e,(n,i)=>i.priority-n.priority);this.queue.splice(t,0,e)}async add(e,t){t?.signal?.throwIfAborted();let n=new Wu(e,t,t?.priority),i=n.join(t).then(o=>(this.safeDispatchEvent("completed",{detail:o}),o)).catch(o=>{throw this.safeDispatchEvent("error",{detail:o}),o});return this.enqueue(n),this.safeDispatchEvent("add"),this.tryToStartAnother(),i}clear(){this.queue.splice(0,this.queue.length)}abort(){this.queue.forEach(e=>{e.abort(new ei)}),this.clear()}async onEmpty(e){this.size!==0&&await qu(this,"empty",e?.signal)}async onSizeLessThan(e,t){this.size<e||await qu(this,"next",t?.signal,{filter:()=>this.size<e})}async onIdle(e){this.pending===0&&this.size===0||await qu(this,"idle",e?.signal)}get size(){return this.queue.length}get queued(){return this.queue.length-this.pending}get running(){return this.pending}async*toGenerator(e){e?.signal?.throwIfAborted();let t=Or({objectMode:!0}),n=c=>{c!=null?this.abort():this.clear(),t.end(c)},i=c=>{c.detail!=null&&t.push(c.detail)},o=c=>{n(c.detail)},s=()=>{n()},a=()=>{n(new O("Queue aborted","ERR_QUEUE_ABORTED"))};this.addEventListener("completed",i),this.addEventListener("error",o),this.addEventListener("idle",s),e?.signal?.addEventListener("abort",a);try{yield*t}finally{this.removeEventListener("completed",i),this.removeEventListener("error",o),this.removeEventListener("idle",s),e?.signal?.removeEventListener("abort",a),n()}}};var nv="/pin/",ev="/pinned-block/",Ph=oi,tv=1;function rv(r){return r.version===0&&(r=r.toV1()),new Xe(`${nv}${r.toString(Ph)}`)}var Yu=class{datastore;blockstore;dagWalkers;constructor(e,t,n){this.datastore=e,this.blockstore=t,this.dagWalkers=n}async*add(e,t={}){let n=rv(e);if(await this.datastore.has(n))throw new Error("Already pinned");let i=Math.round(t.depth??1/0);if(i<0)throw new Error("Depth must be greater than or equal to 0");let o=new Za({concurrency:tv});for await(let a of this.#e(e,o,{...t,depth:i}))await this.#t(a,c=>c.pinnedBy.find(u=>ge(u,e.bytes))!=null?!1:(c.pinCount++,c.pinnedBy.push(e.bytes),!0),t),yield a;let s={depth:i,metadata:t.metadata??{}};await this.datastore.put(n,vi(s),t)}async*#e(e,t,n){if(n.depth===-1)return;let i=this.dagWalkers[e.code];if(i==null)throw new Error(`No dag walker found for cid codec ${e.code}`);let o=await this.blockstore.get(e,n);yield e;for await(let s of i.walk(o))yield*await t.add(async()=>this.#e(s,t,{...n,depth:n.depth-1}))}async#t(e,t,n){let i=new Xe(`${ev}${Ph.encode(e.multihash.bytes)}`),o={pinCount:0,pinnedBy:[]};try{o=Kt(await this.datastore.get(i,n))}catch(a){if(a.code!=="ERR_NOT_FOUND")throw a}if(t(o)){if(o.pinCount===0&&await this.datastore.has(i)){await this.datastore.delete(i);return}await this.datastore.put(i,vi(o),n),n.onProgress?.(new P("helia:pin:add",e))}}async*rm(e,t={}){let n=rv(e),i=await this.datastore.get(n,t),o=Kt(i);await this.datastore.delete(n,t);let s=new Za({concurrency:tv});for await(let a of this.#e(e,s,{...t,depth:o.depth}))await this.#t(a,c=>(c.pinCount--,c.pinnedBy=c.pinnedBy.filter(u=>ge(u,e.bytes)),!0),{...t,depth:o.depth}),yield a}async*ls(e={}){for await(let{key:t,value:n}of this.datastore.query({prefix:nv+(e.cid!=null?`${e.cid.toString(oi)}`:"")},e)){let i=z.parse(t.toString().substring(5),oi),o=Kt(n);yield{cid:i,...o}}}async isPinned(e,t={}){let n=new Xe(`${ev}${Ph.encode(e.multihash.bytes)}`);return this.datastore.has(n,t)}};function Oh(r,e){let t={[Symbol.iterator]:()=>t,next:()=>{let n=r.next(),i=n.value;return n.done===!0||i==null?{done:!0,value:void 0}:{done:!1,value:e(i)}}};return t}var gs=class r{set;constructor(e){if(this.set=new Set,e!=null)for(let t of e)this.set.add(t.toString())}get size(){return this.set.size}[Symbol.iterator](){return this.values()}add(e){this.set.add(e.toString())}clear(){this.set.clear()}delete(e){this.set.delete(e.toString())}entries(){return Oh(this.set.entries(),e=>{let t=mr(e[0]);return[t,t]})}forEach(e){this.set.forEach(t=>{let n=mr(t);e(n,n,this)})}has(e){return this.set.has(e.toString())}values(){return Oh(this.set.values(),e=>mr(e))}intersection(e){let t=new r;for(let n of e)this.has(n)&&t.add(n);return t}difference(e){let t=new r;for(let n of this)e.has(n)||t.add(n);return t}union(e){let t=new r;for(let n of e)t.add(n);for(let n of this)t.add(n);return t}};var Xu=class{log;routers;constructor(e,t){this.log=e.logger.forComponent("helia:routing"),this.routers=t.routers??[]}async start(){await ti(...this.routers)}async stop(){await ri(...this.routers)}async*findProviders(e,t={}){if(this.routers.length===0)throw new O("No content routers available","ERR_NO_ROUTERS_AVAILABLE");let n=new gs;for await(let i of ai(...xs(this.routers,"findProviders").map(o=>o.findProviders(e,t))))i!=null&&(n.has(i.id)||(n.add(i.id),yield i))}async provide(e,t={}){if(this.routers.length===0)throw new O("No content routers available","ERR_NO_ROUTERS_AVAILABLE");await Promise.all(xs(this.routers,"provide").map(async n=>{await n.provide(e,t)}))}async put(e,t,n){await Promise.all(xs(this.routers,"put").map(async i=>{await i.put(e,t,n)}))}async get(e,t){return Promise.any(xs(this.routers,"get").map(async n=>n.get(e,t)))}async findPeer(e,t){if(this.routers.length===0)throw new O("No peer routers available","ERR_NO_ROUTERS_AVAILABLE");let n=this,i=ai(...xs(this.routers,"findPeer").map(o=>async function*(){try{yield await o.findPeer(e,t)}catch(s){n.log.error(s)}}()));for await(let o of i)if(o!=null)return o;throw new O("Could not find peer in routing","ERR_NOT_FOUND")}async*getClosestPeers(e,t={}){if(this.routers.length===0)throw new O("No peer routers available","ERR_NO_ROUTERS_AVAILABLE");let n=new gs;for await(let i of ai(...xs(this.routers,"getClosestPeers").map(o=>o.getClosestPeers(e,t))))i!=null&&(n.has(i.id)||(n.add(i.id),yield i))}};function xs(r,e){return r.filter(t=>t[e]!=null)}var Ei={},ys=r=>{r.addEventListener("message",e=>{ys.dispatchEvent("message",r,e)}),r.port!=null&&r.port.addEventListener("message",e=>{ys.dispatchEvent("message",r,e)})};ys.addEventListener=(r,e)=>{Ei[r]==null&&(Ei[r]=[]),Ei[r].push(e)};ys.removeEventListener=(r,e)=>{Ei[r]!=null&&(Ei[r]=Ei[r].filter(t=>t===e))};ys.dispatchEvent=function(r,e,t){Ei[r]!=null&&Ei[r].forEach(n=>n(e,t))};var Fh=ys;var zh="lock:worker:request-read",Vh="lock:worker:release-read",Mh="lock:master:grant-read",$h="lock:worker:request-write",jh="lock:worker:release-write",Hh="lock:master:grant-write";var iv=(r=21)=>Math.random().toString().substring(2);var ov=(r,e,t,n,i)=>(o,s)=>{if(s.data.type!==t)return;let a={type:s.data.type,name:s.data.name,identifier:s.data.identifier};r.dispatchEvent(new MessageEvent(e,{data:{name:a.name,handler:async()=>{o.postMessage({type:i,name:a.name,identifier:a.identifier}),await new Promise(c=>{let u=l=>{if(l==null||l.data==null)return;let p={type:l.data.type,name:l.data.name,identifier:l.data.identifier};p.type===n&&p.identifier===a.identifier&&(o.removeEventListener("message",u),c())};o.addEventListener("message",u)})}}}))},sv=(r,e,t,n)=>async()=>{let i=iv();return globalThis.postMessage({type:e,identifier:i,name:r}),new Promise(o=>{let s=a=>{if(a==null||a.data==null)return;let c={type:a.data.type,identifier:a.data.identifier};c.type===t&&c.identifier===i&&(globalThis.removeEventListener("message",s),o(()=>{globalThis.postMessage({type:n,identifier:i,name:r})}))};globalThis.addEventListener("message",s)})},zk={singleProcess:!1},av=r=>{if(r=Object.assign({},zk,r),!!globalThis.document||r.singleProcess){let t=new EventTarget;return Fh.addEventListener("message",ov(t,"requestReadLock",zh,Vh,Mh)),Fh.addEventListener("message",ov(t,"requestWriteLock",$h,jh,Hh)),t}return{isWorker:!0,readLock:t=>sv(t,zh,Mh,Vh),writeLock:t=>sv(t,$h,Hh,jh)}};var ao={},Ai;async function qh(r,e){let t,n=new Promise(i=>{t=i});return r.add(async()=>Ya((async()=>{await new Promise(i=>{t(()=>{i()})})})(),{milliseconds:e.timeout})),n}var Vk=(r,e)=>{if(Ai.isWorker===!0)return{readLock:Ai.readLock(r,e),writeLock:Ai.writeLock(r,e)};let t=new Ct({concurrency:1}),n;return{async readLock(){if(n!=null)return qh(n,e);n=new Ct({concurrency:e.concurrency,autoStart:!1});let i=n,o=qh(n,e);return t.add(async()=>{i.start(),await i.onIdle().then(()=>{n===i&&(n=null)})}),o},async writeLock(){return n=null,qh(t,e)}}},Mk={name:"lock",concurrency:1/0,timeout:846e5,singleProcess:!1};function Kh(r){let e=Object.assign({},Mk,r);return Ai==null&&(Ai=av(e),Ai.isWorker!==!0&&(Ai.addEventListener("requestReadLock",t=>{ao[t.data.name]!=null&&ao[t.data.name].readLock().then(async n=>t.data.handler().finally(()=>{n()}))}),Ai.addEventListener("requestWriteLock",async t=>{ao[t.data.name]!=null&&ao[t.data.name].writeLock().then(async n=>t.data.handler().finally(()=>{n()}))}))),ao[e.name]==null&&(ao[e.name]=Vk(e.name,e)),ao[e.name]}var Ju=class{lock;child;pins;started;constructor(e,t,n={}){this.child=e,this.pins=t,this.lock=Kh({singleProcess:n.holdGcLock}),this.started=!1}isStarted(){return this.started}async start(){await ti(this.child),this.started=!0}async stop(){await ri(this.child),this.started=!1}unwrap(){return this.child}async put(e,t,n={}){let i=await this.lock.readLock();try{return await this.child.put(e,t,n)}finally{i()}}async*putMany(e,t={}){let n=await this.lock.readLock();try{yield*this.child.putMany(e,t)}finally{n()}}async get(e,t={}){let n=await this.lock.readLock();try{return await this.child.get(e,t)}finally{n()}}async*getMany(e,t={}){let n=await this.lock.readLock();try{yield*this.child.getMany(e,t)}finally{n()}}async delete(e,t={}){let n=await this.lock.writeLock();try{if(await this.pins.isPinned(e))throw new Error("CID was pinned");await this.child.delete(e,t)}finally{n()}}async*deleteMany(e,t={}){let n=await this.lock.writeLock();try{let i=this;yield*this.child.deleteMany(async function*(){for await(let o of e){if(await i.pins.isPinned(o))throw new Error("CID was pinned");yield o}}(),t)}finally{n()}}async has(e,t={}){let n=await this.lock.readLock();try{return await this.child.has(e,t)}finally{n()}}async*getAll(e={}){let t=await this.lock.readLock();try{yield*this.child.getAll(e)}finally{t()}}};var cv=42;function $k(r){if(r.asCID!==r&&r["/"]!==r.bytes)return null;let e=z.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new C(A.tag,cv),new C(A.bytes,t)]}function jk(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function Hk(r){if(Number.isNaN(r))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(r===1/0||r===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var Gh={float64:!0,typeEncoders:{Object:$k,undefined:jk,number:Hk}},yH={...Gh,typeEncoders:{...Gh.typeEncoders}};function qk(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return z.decode(r.subarray(1))}var Zu={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Zu.tags[cv]=qk;var wH={...Zu,tags:Zu.tags.slice()};var Si=113,lv=r=>vi(r,Gh),Qu=r=>Kt(r,Zu);var Wh=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===A.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===A.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[A.uint.major](e,t){this.prefix(e);let n=String(t.value),i=[];for(let o=0;o<n.length;o++)i[o]=n.charCodeAt(o);e.push(i)}[A.negint.major](e,t){this[A.uint.major](e,t)}[A.bytes.major](e,t){throw new Error(`${kn} unsupported type: Uint8Array`)}[A.string.major](e,t){this.prefix(e);let n=ku(JSON.stringify(t.value));e.push(n.length>32?Fa(n):n)}[A.array.major](e,t){this.prefix(e),this.inRecursive.push({type:A.array,elements:0}),e.push([91])}[A.map.major](e,t){this.prefix(e),this.inRecursive.push({type:A.map,elements:0}),e.push([123])}[A.tag.major](e,t){}[A.float.major](e,t){if(t.type.name==="break"){let s=this.inRecursive.pop();if(s){if(s.type===A.array)e.push([93]);else if(s.type===A.map)e.push([125]);else throw new Error("Unexpected recursive type; this should not happen!");return}throw new Error("Unexpected break; this should not happen!")}if(t.value===void 0)throw new Error(`${kn} unsupported type: undefined`);if(this.prefix(e),t.type.name==="true"){e.push([116,114,117,101]);return}else if(t.type.name==="false"){e.push([102,97,108,115,101]);return}else if(t.type.name==="null"){e.push([110,117,108,108]);return}let n=String(t.value),i=[],o=!1;for(let s=0;s<n.length;s++)i[s]=n.charCodeAt(s),!o&&(i[s]===46||i[s]===101||i[s]===69)&&(o=!0);o||(i.push(46),i.push(48)),e.push(i)}};function Kk(r,e){if(Array.isArray(r[0])||Array.isArray(e[0]))throw new Error(`${kn} complex map keys are not supported`);let t=r[0],n=e[0];if(t.type!==A.string||n.type!==A.string)throw new Error(`${kn} non-string map keys are not supported`);if(t<n)return-1;if(t>n)return 1;throw new Error(`${kn} unexpected duplicate map keys, this is not supported`)}var Gk={addBreakTokens:!0,mapSorter:Kk};function Yh(r,e){return e=Object.assign({},Gk,e),Sh(r,new Wh,e)}var Bi=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t,this.modeStack=["value"],this.lastToken=""}pos(){return this._pos}done(){return this._pos>=this.data.length}ch(){return this.data[this._pos]}currentMode(){return this.modeStack[this.modeStack.length-1]}skipWhitespace(){let e=this.ch();for(;e===32||e===9||e===13||e===10;)e=this.data[++this._pos]}expect(e){if(this.data.length-this._pos<e.length)throw new Error(`${q} unexpected end of input at position ${this._pos}`);for(let t=0;t<e.length;t++)if(this.data[this._pos++]!==e[t])throw new Error(`${q} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,n=!1,i=a=>{for(;!this.done();){let c=this.ch();if(a.includes(c))this._pos++;else break}};if(this.ch()===45&&(t=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,n=!0;else return new C(A.uint,0,this._pos-e);if(i([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${q} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(n)throw new Error(`${q} unexpected token at position ${this._pos}`);n=!0,this._pos++,i([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(n=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,i([48,49,50,51,52,53,54,55,56,57]));let o=String.fromCharCode.apply(null,this.data.subarray(e,this._pos)),s=parseFloat(o);return n?new C(A.float,s,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(s)?new C(s>=0?A.uint:A.negint,s,this._pos-e):new C(s>=0?A.uint:A.negint,BigInt(o),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${q} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let o=this._pos,s=0;o<this.data.length&&s<65536;o++,s++){let a=this.data[o];if(a===92||a<32||a>=128)break;if(a===34){let c=String.fromCharCode.apply(null,this.data.subarray(this._pos,o));return this._pos=o+1,new C(A.string,c,s)}}let e=this._pos,t=[],n=()=>{if(this._pos+4>=this.data.length)throw new Error(`${q} unexpected end of unicode escape sequence at position ${this._pos}`);let o=0;for(let s=0;s<4;s++){let a=this.ch();if(a>=48&&a<=57)a-=48;else if(a>=97&&a<=102)a=a-97+10;else if(a>=65&&a<=70)a=a-65+10;else throw new Error(`${q} unexpected unicode escape character at position ${this._pos}`);o=o*16+a,this._pos++}return o},i=()=>{let o=this.ch(),s=null,a=o>239?4:o>223?3:o>191?2:1;if(this._pos+a>this.data.length)throw new Error(`${q} unexpected unicode sequence at position ${this._pos}`);let c,u,l,p;switch(a){case 1:o<128&&(s=o);break;case 2:c=this.data[this._pos+1],(c&192)===128&&(p=(o&31)<<6|c&63,p>127&&(s=p));break;case 3:c=this.data[this._pos+1],u=this.data[this._pos+2],(c&192)===128&&(u&192)===128&&(p=(o&15)<<12|(c&63)<<6|u&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:c=this.data[this._pos+1],u=this.data[this._pos+2],l=this.data[this._pos+3],(c&192)===128&&(u&192)===128&&(l&192)===128&&(p=(o&15)<<18|(c&63)<<12|(u&63)<<6|l&63,p>65535&&p<1114112&&(s=p))}s===null?(s=65533,a=1):s>65535&&(s-=65536,t.push(s>>>10&1023|55296),s=56320|s&1023),t.push(s),this._pos+=a};for(;!this.done();){let o=this.ch(),s;switch(o){case 92:if(this._pos++,this.done())throw new Error(`${q} unexpected string termination at position ${this._pos}`);switch(s=this.ch(),this._pos++,s){case 34:case 39:case 92:case 47:t.push(s);break;case 98:t.push(8);break;case 116:t.push(9);break;case 110:t.push(10);break;case 102:t.push(12);break;case 114:t.push(13);break;case 117:t.push(n());break;default:throw new Error(`${q} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new C(A.string,yh(t),this._pos-e);default:if(o<32)throw new Error(`${q} invalid control character at position ${this._pos}`);o<128?(t.push(o),this._pos++):i()}}throw new Error(`${q} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new C(A.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new C(A.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new C(A.null,null,4);case 102:return this.expect([102,97,108,115,101]),new C(A.false,!1,5);case 116:return this.expect([116,114,117,101]),new C(A.true,!0,4);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:throw new Error(`${q} unexpected character at position ${this._pos}`)}}next(){switch(this.skipWhitespace(),this.currentMode()){case"value":return this.modeStack.pop(),this.parseValue();case"array-value":{if(this.modeStack.pop(),this.ch()===93)return this._pos++,this.skipWhitespace(),new C(A.break,void 0,1);if(this.ch()!==44)throw new Error(`${q} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue()}case"array-start":return this.modeStack.pop(),this.ch()===93?(this._pos++,this.skipWhitespace(),new C(A.break,void 0,1)):(this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue());case"obj-key":if(this.ch()===125)return this.modeStack.pop(),this._pos++,this.skipWhitespace(),new C(A.break,void 0,1);if(this.ch()!==44)throw new Error(`${q} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`);this._pos++,this.skipWhitespace();case"obj-start":{if(this.modeStack.pop(),this.ch()===125)return this._pos++,this.skipWhitespace(),new C(A.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${q} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("obj-value"),e}case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue();default:throw new Error(`${q} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function Qa(r,e){return e=Object.assign({tokenizer:new Bi(r,e)},e),Kt(r,e)}function Wk(r){if(r.asCID!==r&&r["/"]!==r.bytes)return null;let e=z.asCID(r);if(!e)return null;let t=e.toString();return[new C(A.map,1/0,1),new C(A.string,"/",1),new C(A.string,t,t.length),new C(A.break,void 0,1)]}function tp(r){let e=Pr.encode(r).slice(1);return[new C(A.map,1/0,1),new C(A.string,"/",1),new C(A.map,1/0,1),new C(A.string,"bytes",5),new C(A.string,e,e.length),new C(A.break,void 0,1),new C(A.break,void 0,1)]}function Sr(r){return tp(new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}function Yk(r){return tp(new Uint8Array(r))}function Xk(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function Jk(r){if(Number.isNaN(r))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(r===1/0||r===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var Zk={typeEncoders:{Object:Wk,Buffer:tp,Uint8Array:tp,Int8Array:Sr,Uint16Array:Sr,Int16Array:Sr,Uint32Array:Sr,Int32Array:Sr,Float32Array:Sr,Float64Array:Sr,Uint8ClampedArray:Sr,BigInt64Array:Sr,BigUint64Array:Sr,DataView:Sr,ArrayBuffer:Yk,undefined:Xk,number:Jk}},Xh=class extends Bi{constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===A.map){let t=this._next();if(t.type===A.string&&t.value==="/"){let n=this._next();if(n.type===A.string){if(this._next().type!==A.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(n),new C(A.tag,42,0)}if(n.type===A.map){let i=this._next();if(i.type===A.string&&i.value==="bytes"){let o=this._next();if(o.type===A.string){for(let a=0;a<2;a++)if(this._next().type!==A.break)throw new Error("Invalid encoded Bytes form");let s=Pr.decode(`m${o.value}`);return new C(A.bytes,s,o.value.length)}this.tokenBuffer.push(o)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(t)}return e}},Jh={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Jh.tags[42]=z.parse;var ki=297,pv=r=>Yh(r,Zk),rp=r=>{let e=Object.assign(Jh,{tokenizer:new Xh(r,Jh)});return Qa(r,e)};var PH=new TextDecoder;var OH=new TextEncoder;var Ke={};$(Ke,{code:()=>Ve,createLink:()=>vv,createNode:()=>bv,decode:()=>Ie,encode:()=>fe,name:()=>lI,prepare:()=>Ue,validate:()=>em});var Qk=new TextDecoder;function Zh(r,e){let t=0;for(let n=0;;n+=7){if(n>=64)throw new Error("protobuf: varint overflow");if(e>=r.length)throw new Error("protobuf: unexpected end of data");let i=r[e++];if(t+=n<28?(i&127)<<n:(i&127)*2**n,i<128)break}return[t,e]}function ip(r,e){let t;[t,e]=Zh(r,e);let n=e+t;if(t<0||n<0)throw new Error("protobuf: invalid length");if(n>r.length)throw new Error("protobuf: unexpected end of data");return[r.subarray(e,n),n]}function dv(r,e){let t;return[t,e]=Zh(r,e),[t&7,t>>3,e]}function eI(r){let e={},t=r.length,n=0;for(;n<t;){let i,o;if([i,o,n]=dv(r,n),o===1){if(e.Hash)throw new Error("protobuf: (PBLink) duplicate Hash section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Hash`);if(e.Name!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Name before Hash");if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Hash");[e.Hash,n]=ip(r,n)}else if(o===2){if(e.Name!==void 0)throw new Error("protobuf: (PBLink) duplicate Name section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Name`);if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Name");let s;[s,n]=ip(r,n),e.Name=Qk.decode(s)}else if(o===3){if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) duplicate Tsize section");if(i!==0)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Tsize`);[e.Tsize,n]=Zh(r,n)}else throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${o}`)}if(n>t)throw new Error("protobuf: (PBLink) unexpected end of data");return e}function fv(r){let e=r.length,t=0,n,i=!1,o;for(;t<e;){let a,c;if([a,c,t]=dv(r,t),a!==2)throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${a}`);if(c===1){if(o)throw new Error("protobuf: (PBNode) duplicate Data section");[o,t]=ip(r,t),n&&(i=!0)}else if(c===2){if(i)throw new Error("protobuf: (PBNode) duplicate Links section");n||(n=[]);let u;[u,t]=ip(r,t),n.push(eI(u))}else throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${c}`)}if(t>e)throw new Error("protobuf: (PBNode) unexpected end of data");let s={};return o&&(s.Data=o),s.Links=n||[],s}var mv=new TextEncoder,hv=2**32,tI=2**31;function rI(r,e){let t=e.length;if(typeof r.Tsize=="number"){if(r.Tsize<0)throw new Error("Tsize cannot be negative");if(!Number.isSafeInteger(r.Tsize))throw new Error("Tsize too large for encoding");t=ec(e,t,r.Tsize)-1,e[t]=24}if(typeof r.Name=="string"){let n=mv.encode(r.Name);t-=n.length,e.set(n,t),t=ec(e,t,n.length)-1,e[t]=18}return r.Hash&&(t-=r.Hash.length,e.set(r.Hash,t),t=ec(e,t,r.Hash.length)-1,e[t]=10),e.length-t}function gv(r){let e=iI(r),t=new Uint8Array(e),n=e;if(r.Data&&(n-=r.Data.length,t.set(r.Data,n),n=ec(t,n,r.Data.length)-1,t[n]=10),r.Links)for(let i=r.Links.length-1;i>=0;i--){let o=rI(r.Links[i],t.subarray(0,n));n-=o,n=ec(t,n,o)-1,t[n]=18}return t}function nI(r){let e=0;if(r.Hash){let t=r.Hash.length;e+=1+t+ws(t)}if(typeof r.Name=="string"){let t=mv.encode(r.Name).length;e+=1+t+ws(t)}return typeof r.Tsize=="number"&&(e+=1+ws(r.Tsize)),e}function iI(r){let e=0;if(r.Data){let t=r.Data.length;e+=1+t+ws(t)}if(r.Links)for(let t of r.Links){let n=nI(t);e+=1+n+ws(n)}return e}function ec(r,e,t){e-=ws(t);let n=e;for(;t>=tI;)r[e++]=t&127|128,t/=128;for(;t>=128;)r[e++]=t&127|128,t>>>=7;return r[e]=t,n}function ws(r){return r%2===0&&r++,Math.floor((oI(r)+6)/7)}function oI(r){let e=0;return r>=hv&&(r=Math.floor(r/hv),e=32),r>=65536&&(r>>>=16,e+=16),r>=256&&(r>>>=8,e+=8),e+sI[r]}var sI=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8];var aI=["Data","Links"],cI=["Hash","Name","Tsize"],Qh=new TextEncoder;function yv(r,e){if(r===e)return 0;let t=r.Name?Qh.encode(r.Name):[],n=e.Name?Qh.encode(e.Name):[],i=t.length,o=n.length;for(let s=0,a=Math.min(i,o);s<a;++s)if(t[s]!==n[s]){i=t[s],o=n[s];break}return i<o?-1:o<i?1:0}function xv(r,e){return!Object.keys(r).some(t=>!e.includes(t))}function wv(r){if(typeof r.asCID=="object"){let t=z.asCID(r);if(!t)throw new TypeError("Invalid DAG-PB form");return{Hash:t}}if(typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");let e={};if(r.Hash){let t=z.asCID(r.Hash);try{t||(typeof r.Hash=="string"?t=z.parse(r.Hash):r.Hash instanceof Uint8Array&&(t=z.decode(r.Hash)))}catch(n){throw new TypeError(`Invalid DAG-PB form: ${n.message}`)}t&&(e.Hash=t)}if(!e.Hash)throw new TypeError("Invalid DAG-PB form");return typeof r.Name=="string"&&(e.Name=r.Name),typeof r.Tsize=="number"&&(e.Tsize=r.Tsize),e}function Ue(r){if((r instanceof Uint8Array||typeof r=="string")&&(r={Data:r}),typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");let e={};if(r.Data!==void 0)if(typeof r.Data=="string")e.Data=Qh.encode(r.Data);else if(r.Data instanceof Uint8Array)e.Data=r.Data;else throw new TypeError("Invalid DAG-PB form");if(r.Links!==void 0)if(Array.isArray(r.Links))e.Links=r.Links.map(wv),e.Links.sort(yv);else throw new TypeError("Invalid DAG-PB form");else e.Links=[];return e}function em(r){if(!r||typeof r!="object"||Array.isArray(r)||r instanceof Uint8Array||r["/"]&&r["/"]===r.bytes)throw new TypeError("Invalid DAG-PB form");if(!xv(r,aI))throw new TypeError("Invalid DAG-PB form (extraneous properties)");if(r.Data!==void 0&&!(r.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be bytes)");if(!Array.isArray(r.Links))throw new TypeError("Invalid DAG-PB form (Links must be a list)");for(let e=0;e<r.Links.length;e++){let t=r.Links[e];if(!t||typeof t!="object"||Array.isArray(t)||t instanceof Uint8Array||t["/"]&&t["/"]===t.bytes)throw new TypeError("Invalid DAG-PB form (bad link)");if(!xv(t,cI))throw new TypeError("Invalid DAG-PB form (extraneous properties on link)");if(t.Hash===void 0)throw new TypeError("Invalid DAG-PB form (link must have a Hash)");if(t.Hash==null||!t.Hash["/"]||t.Hash["/"]!==t.Hash.bytes)throw new TypeError("Invalid DAG-PB form (link Hash must be a CID)");if(t.Name!==void 0&&typeof t.Name!="string")throw new TypeError("Invalid DAG-PB form (link Name must be a string)");if(t.Tsize!==void 0){if(typeof t.Tsize!="number"||t.Tsize%1!==0)throw new TypeError("Invalid DAG-PB form (link Tsize must be an integer)");if(t.Tsize<0)throw new TypeError("Invalid DAG-PB form (link Tsize cannot be negative)")}if(e>0&&yv(t,r.Links[e-1])===-1)throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}function bv(r,e=[]){return Ue({Data:r,Links:e})}function vv(r,e,t){return wv({Hash:t,Name:r,Tsize:e})}var lI="dag-pb",Ve=112;function fe(r){em(r);let e={};return r.Links&&(e.Links=r.Links.map(t=>{let n={};return t.Hash&&(n.Hash=t.Hash.bytes),t.Name!==void 0&&(n.Name=t.Name),t.Tsize!==void 0&&(n.Tsize=t.Tsize),n})),r.Data&&(e.Data=r.Data),gv(e)}function Ie(r){let e=fv(r),t={};return e.Data&&(t.Data=e.Data),e.Links&&(t.Links=e.Links.map(n=>{let i={};try{i.Hash=z.decode(n.Hash)}catch{}if(!i.Hash)throw new Error("Invalid Hash field found in link, expected CID");return n.Name!==void 0&&(i.Name=n.Name),n.Tsize!==void 0&&(i.Tsize=n.Tsize),i})),t}var uI={codec:Ve,*walk(r){yield*Ie(r).Links.map(t=>t.Hash)}},pI={codec:je,*walk(){}},Ev=42,dI={codec:Si,*walk(r){let e=[],t=[];t[Ev]=n=>{if(n[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");let i=z.decode(n.subarray(1));return e.push(i),i},Kt(r,{tags:t}),yield*e}},tm=class extends Bi{tokenBuffer;constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===A.map){let t=this._next();if(t.type===A.string&&t.value==="/"){let n=this._next();if(n.type===A.string){if(this._next().type!==A.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(n),new C(A.tag,42,0)}if(n.type===A.map){let i=this._next();if(i.type===A.string&&i.value==="bytes"){let o=this._next();if(o.type===A.string){for(let a=0;a<2;a++)if(this._next().type!==A.break)throw new Error("Invalid encoded Bytes form");let s=Pr.decode(`m${o.value}`);return new C(A.bytes,s,o.value.length)}this.tokenBuffer.push(o)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(t)}return e}},fI={codec:ki,*walk(r){let e=[],t=[];t[Ev]=n=>{let i=z.parse(n);return e.push(i),i},Qa(r,{tags:t,tokenizer:new tm(r,{tags:t,allowIndefinite:!0,allowUndefined:!0,allowNaN:!0,allowInfinity:!0,allowBigInt:!0,strict:!1,rejectDuplicateMapKeys:!1})}),yield*e}},hI={codec:Oo,*walk(){}};function Av(r=[]){let e={};return[uI,pI,dI,fI,hI,...r].forEach(t=>{e[t.codec]=t}),e}var rm=new Xe("/version"),Sv=1;async function Bv(r){if(!await r.has(rm)){await r.put(rm,Z(`${Sv}`));return}let e=await r.get(rm),t=oe(e);if(parseInt(t,10)!==Sv)throw new Error("Unknown datastore version, a datastore migration may be required")}function kv(r=[]){let e={};return[ce,Ld,It,...r].forEach(t=>{e[t.code]=t}),e}function mI(r){return r[Symbol.asyncIterator]!=null}function gI(r,e){if(mI(r))return async function*(){for await(let a of r)await e(a)&&(yield a)}();let t=_o(r),{value:n,done:i}=t.next();if(i===!0)return function*(){}();let o=e(n);if(typeof o.then=="function")return async function*(){await o&&(yield n);for await(let a of t)await e(a)&&(yield a)}();let s=e;return function*(){o===!0&&(yield n);for(let a of t)s(a)&&(yield a)}()}var Gt=gI;function xI(r){return typeof r.retrieve=="function"}function yI(r){return typeof r.announce=="function"}var op=class{child;blockRetrievers;blockAnnouncers;hashers;started;log;constructor(e){this.log=e.logger.forComponent("helia:networked-storage"),this.child=e.blockstore,this.blockRetrievers=(e.blockBrokers??[]).filter(xI),this.blockAnnouncers=(e.blockBrokers??[]).filter(yI),this.hashers=e.hashers??{},this.started=!1}isStarted(){return this.started}async start(){await ti(this.child,...new Set([...this.blockRetrievers,...this.blockAnnouncers])),this.started=!0}async stop(){await ri(this.child,...new Set([...this.blockRetrievers,...this.blockAnnouncers])),this.started=!1}unwrap(){return this.child}async put(e,t,n={}){return await this.child.has(e)?(n.onProgress?.(new P("blocks:put:duplicate",e)),e):(n.onProgress?.(new P("blocks:put:providers:notify",e)),this.blockAnnouncers.forEach(i=>{i.announce(e,t,n)}),n.onProgress?.(new P("blocks:put:blockstore:put",e)),this.child.put(e,t,n))}async*putMany(e,t={}){let n=Gt(e,async({cid:o})=>{let s=await this.child.has(o);return s&&t.onProgress?.(new P("blocks:put-many:duplicate",o)),!s}),i=bd(n,({cid:o,block:s})=>{t.onProgress?.(new P("blocks:put-many:providers:notify",o)),this.blockAnnouncers.forEach(a=>{a.announce(o,s,t)})});t.onProgress?.(new P("blocks:put-many:blockstore:put-many")),yield*this.child.putMany(i,t)}async get(e,t={}){if(t.offline!==!0&&!await this.child.has(e)){t.onProgress?.(new P("blocks:get:providers:get",e));let n=await Iv(e,this.blockRetrievers,this.hashers[e.multihash.code],{...t,log:this.log});return t.onProgress?.(new P("blocks:get:blockstore:put",e)),await this.child.put(e,n,t),t.onProgress?.(new P("blocks:get:providers:notify",e)),this.blockAnnouncers.forEach(i=>{i.announce(e,n,t)}),n}return t.onProgress?.(new P("blocks:get:blockstore:get",e)),this.child.get(e,t)}async*getMany(e,t={}){t.onProgress?.(new P("blocks:get-many:blockstore:get-many")),yield*this.child.getMany(bd(e,async n=>{if(t.offline!==!0&&!await this.child.has(n)){t.onProgress?.(new P("blocks:get-many:providers:get",n));let i=await Iv(n,this.blockRetrievers,this.hashers[n.multihash.code],{...t,log:this.log});t.onProgress?.(new P("blocks:get-many:blockstore:put",n)),await this.child.put(n,i,t),t.onProgress?.(new P("blocks:get-many:providers:notify",n)),this.blockAnnouncers.forEach(o=>{o.announce(n,i,t)})}}))}async delete(e,t={}){t.onProgress?.(new P("blocks:delete:blockstore:delete",e)),await this.child.delete(e,t)}async*deleteMany(e,t={}){t.onProgress?.(new P("blocks:delete-many:blockstore:delete-many")),yield*this.child.deleteMany(async function*(){for await(let n of e)yield n}(),t)}async has(e,t={}){return this.child.has(e,t)}async*getAll(e={}){e.onProgress?.(new P("blocks:get-all:blockstore:get-many")),yield*this.child.getAll(e)}},wI=(r,e)=>{if(e==null)throw new O(`No hasher configured for multihash code 0x${r.multihash.code.toString(16)}, please configure one. You can look up which hash this is at https://github.com/multiformats/multicodec/blob/master/table.csv`,"ERR_UNKNOWN_HASH_ALG");return async t=>{let n=await e.digest(t);if(!ge(n.digest,r.multihash.digest))throw new O("Hash of downloaded block did not match multihash from passed CID","ERR_HASH_MISMATCH")}};async function Iv(r,e,t,n){let i=wI(r,t),o=new AbortController,s=ji([o.signal,n.signal]);try{return await Promise.any(e.map(async a=>{try{let c=!1,u=await a.retrieve(r,{...n,signal:s,validateFn:async l=>{await i(l),c=!0}});return c||await i(u),u}catch(c){throw n.log.error("could not retrieve verified block for %c",r,c),c}}))}finally{s.clear()}}var sp=class{blockstore;datastore;pins;logger;routing;dagWalkers;hashers;log;constructor(e){this.logger=e.logger??Wx(),this.log=this.logger.forComponent("helia"),this.hashers=kv(e.hashers),this.dagWalkers=Av(e.dagWalkers);let t={blockstore:e.blockstore,datastore:e.datastore,hashers:this.hashers,dagWalkers:this.dagWalkers,logger:this.logger,blockBrokers:[],...e.components??{}};t.blockBrokers=e.blockBrokers.map(i=>i(t));let n=new op(t);this.pins=new Yu(e.datastore,n,this.dagWalkers),this.blockstore=new Ju(n,this.pins,{holdGcLock:e.holdGcLock??!0}),this.datastore=e.datastore,this.routing=new Xu(t,{routers:(e.routers??[]).flatMap(i=>{let o=[i];return i[fa]!=null&&o.push(i[fa]),i[ha]!=null&&o.push(i[ha]),o})})}async start(){await Bv(this.datastore),await ti(this.blockstore,this.datastore,this.routing)}async stop(){await ri(this.blockstore,this.datastore,this.routing)}async gc(e={}){let t=await this.blockstore.lock.writeLock();try{let n=this,i=this.blockstore.unwrap();this.log("gc start"),await Yi(i.deleteMany(async function*(){for await(let{cid:o}of i.getAll())try{if(await n.pins.isPinned(o,e))continue;yield o,e.onProgress?.(new P("helia:gc:deleted",o))}catch(s){n.log.error("Error during gc",s),e.onProgress?.(new P("helia:gc:error",s))}}()))}finally{t()}this.log("gc finished")}};var bs={};$(bs,{abortedError:()=>SI,closeFailedError:()=>vI,deleteFailedError:()=>Tv,getFailedError:()=>EI,hasFailedError:()=>AI,notFoundError:()=>tc,openFailedError:()=>bI,putFailedError:()=>_v});var Tn=Q(ke(),1);function bI(r){return r=r??new Error("Open failed"),(0,Tn.default)(r,"ERR_OPEN_FAILED")}function vI(r){return r=r??new Error("Close failed"),(0,Tn.default)(r,"ERR_CLOSE_FAILED")}function _v(r){return r=r??new Error("Put failed"),(0,Tn.default)(r,"ERR_PUT_FAILED")}function EI(r){return r=r??new Error("Get failed"),(0,Tn.default)(r,"ERR_GET_FAILED")}function Tv(r){return r=r??new Error("Delete failed"),(0,Tn.default)(r,"ERR_DELETE_FAILED")}function AI(r){return r=r??new Error("Has failed"),(0,Tn.default)(r,"ERR_HAS_FAILED")}function tc(r){return r=r??new Error("Not Found"),(0,Tn.default)(r,"ERR_NOT_FOUND")}function SI(r){return r=r??new Error("Aborted"),(0,Tn.default)(r,"ERR_ABORTED")}var co=class{has(e,t){return Promise.reject(new Error(".has is not implemented"))}put(e,t,n){return Promise.reject(new Error(".put is not implemented"))}async*putMany(e,t){for await(let{cid:n,block:i}of e)await this.put(n,i,t),yield n}get(e,t){return Promise.reject(new Error(".get is not implemented"))}async*getMany(e,t){for await(let n of e)yield{cid:n,block:await this.get(n,t)}}async delete(e,t){await Promise.reject(new Error(".delete is not implemented"))}async*deleteMany(e,t){for await(let n of e)await this.delete(n,t),yield n}async*getAll(e){throw new Error(".getAll is not implemented")}};var rc=class extends co{data;constructor(){super(),this.data=new Map}put(e,t){return this.data.set(nt.encode(e.multihash.bytes),t),e}get(e){let t=this.data.get(nt.encode(e.multihash.bytes));if(t==null)throw tc();return t}has(e){return this.data.has(nt.encode(e.multihash.bytes))}async delete(e){this.data.delete(nt.encode(e.multihash.bytes))}async*getAll(){for(let[e,t]of this.data.entries())yield{cid:z.createV1(je,Ot(nt.decode(e))),block:t}}};var Oq=ne("blockstore:core:tiered");var Mq={...bs};var Cv=Q(ke(),1);function ap(r){return r=r??new Error("Not Found"),(0,Cv.default)(r,"ERR_NOT_FOUND")}var Rv="SHARDING";function kI(r){return r[Symbol.asyncIterator]!=null}function II(r){if(kI(r))return(async()=>{let t=[];for await(let n of r)t.push(n);return t})();let e=[];for(let t of r)e.push(t);return e}var cp=II;function _I(r){return r[Symbol.asyncIterator]!=null}function TI(r,e){return _I(r)?async function*(){yield*(await cp(r)).sort(e)}():function*(){yield*cp(r).sort(e)}()}var lp=TI;var Cn=class{put(e,t,n){return Promise.reject(new Error(".put is not implemented"))}get(e,t){return Promise.reject(new Error(".get is not implemented"))}has(e,t){return Promise.reject(new Error(".has is not implemented"))}delete(e,t){return Promise.reject(new Error(".delete is not implemented"))}async*putMany(e,t={}){for await(let{key:n,value:i}of e)await this.put(n,i,t),yield n}async*getMany(e,t={}){for await(let n of e)yield{key:n,value:await this.get(n,t)}}async*deleteMany(e,t={}){for await(let n of e)await this.delete(n,t),yield n}batch(){let e=[],t=[];return{put(n,i){e.push({key:n,value:i})},delete(n){t.push(n)},commit:async n=>{await Yi(this.putMany(e,n)),e=[],await Yi(this.deleteMany(t,n)),t=[]}}}async*_all(e,t){throw new Error("._all is not implemented")}async*_allKeys(e,t){throw new Error("._allKeys is not implemented")}query(e,t){let n=this._all(e,t);if(e.prefix!=null){let i=e.prefix;n=Gt(n,o=>o.key.toString().startsWith(i))}if(Array.isArray(e.filters)&&(n=e.filters.reduce((i,o)=>Gt(i,o),n)),Array.isArray(e.orders)&&(n=e.orders.reduce((i,o)=>lp(i,o),n)),e.offset!=null){let i=0,o=e.offset;n=Gt(n,()=>i++>=o)}return e.limit!=null&&(n=dl(n,e.limit)),n}queryKeys(e,t){let n=this._allKeys(e,t);if(e.prefix!=null){let i=e.prefix;n=Gt(n,o=>o.toString().startsWith(i))}if(Array.isArray(e.filters)&&(n=e.filters.reduce((i,o)=>Gt(i,o),n)),Array.isArray(e.orders)&&(n=e.orders.reduce((i,o)=>lp(i,o),n)),e.offset!=null){let i=e.offset,o=0;n=Gt(n,()=>o++>=i)}return e.limit!=null&&(n=dl(n,e.limit)),n}};var ic=class extends Cn{data;constructor(){super(),this.data=new Map}put(e,t){return this.data.set(e.toString(),t),e}get(e){let t=this.data.get(e.toString());if(t==null)throw ap();return t}has(e){return this.data.has(e.toString())}delete(e){this.data.delete(e.toString())}*_all(){for(let[e,t]of this.data.entries())yield{key:new Xe(e),value:t}}*_allKeys(){for(let e of this.data.keys())yield new Xe(e)}};var mK=new Xe(Rv);var IK=ne("datastore:core:tiered");async function Nv(r={}){let e=r.datastore??new ic,t=r.blockstore??new rc,n=new sp({...r,datastore:e,blockstore:t,blockBrokers:r.blockBrokers??[xa()],routers:r.routers??[Ja("https://delegated-ipfs.dev")]});return r.start!==!1&&await n.start(),n}var nm=class{components;constructor(e){this.components=e}async add(e,t={}){let n=lv(e),i=await(t.hasher??ce).digest(n),o=z.createV1(Si,i);return await this.components.blockstore.put(o,n,t),o}async get(e,t={}){let n=await this.components.blockstore.get(e,t);return Qu(n)}};function Dv(r){return new nm(r)}var im=class{components;constructor(e){this.components=e}async add(e,t={}){let n=pv(e),i=await(t.hasher??ce).digest(n),o=z.createV1(ki,i);return await this.components.blockstore.put(o,n,t),o}async get(e,t={}){let n=await this.components.blockstore.get(e,t);return rp(n)}};function Lv(r){return new im(r)}var om=Q(Su(),1);function Pv(r,e){let t=e.map((n,i)=>({record:wt(n),index:i}));return t.sort((n,i)=>{let o=n.record.sequence,s=i.record.sequence;if(o>s)return-1;if(o<s)return 1;if(n.record.validityType===ot.ValidityType.EOL&&i.record.validityType===ot.ValidityType.EOL){let a=om.default.fromString(n.record.validity).toDate(),c=om.default.fromString(i.record.validity).toDate();if(a.getTime()>c.getTime())return-1;if(a.getTime()<c.getTime())return 1}return 0}),t[0].index}var um={};$(um,{base58btc:()=>vt,base58flickr:()=>OI});function UI(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function p(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var h=0,x=0,g=0,w=f.length;g!==w&&f[g]===0;)g++,h++;for(var y=(w-g)*l+1>>>0,E=new Uint8Array(y);g!==w;){for(var B=f[g],S=0,b=y-1;(B!==0||S<x)&&b!==-1;b--,S++)B+=256*E[b]>>>0,E[b]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");x=S,g++}for(var v=y-x;v!==y&&E[v]===0;)v++;for(var k=c.repeat(h);v<y;++v)k+=r.charAt(E[v]);return k}function m(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var h=0;if(f[h]!==" "){for(var x=0,g=0;f[h]===c;)x++,h++;for(var w=(f.length-h)*u+1>>>0,y=new Uint8Array(w);f[h];){var E=t[f.charCodeAt(h)];if(E===255)return;for(var B=0,S=w-1;(E!==0||B<g)&&S!==-1;S--,B++)E+=a*y[S]>>>0,y[S]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,h++}if(f[h]!==" "){for(var b=w-g;b!==w&&y[b]===0;)b++;for(var v=new Uint8Array(x+(w-b)),k=x;b!==w;)v[k++]=y[b++];return v}}}function d(f){var h=m(f);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:m,decode:d}}var NI=UI,DI=NI,Ov=DI;var uG=new Uint8Array(0);var Fv=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},Rn=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var zv=r=>new TextEncoder().encode(r),Vv=r=>new TextDecoder().decode(r);var sm=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},am=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return $v(this,e)}},cm=class{constructor(e){this.decoders=e}or(e){return $v(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},$v=(r,e)=>new cm({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),lm=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new sm(e,t,n),this.decoder=new am(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},vs=({name:r,prefix:e,encode:t,decode:n})=>new lm(r,e,t,n),Ii=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Ov(t,e);return vs({prefix:r,name:e,encode:n,decode:o=>Rn(i(o))})},LI=(r,e,t,n)=>{let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*t/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let p=i[r[l]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},PI=(r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,o+=e[i&a>>s];if(s&&(o+=e[i&a<<t-s]),n)for(;o.length*t&7;)o+="=";return o},Ne=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>vs({prefix:e,name:r,encode(i){return PI(i,n,t)},decode(i){return LI(i,n,t,r)}});var vt=Ii({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),OI=Ii({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var pm={};$(pm,{base32:()=>qr,base32hex:()=>MI,base32hexpad:()=>jI,base32hexpadupper:()=>HI,base32hexupper:()=>$I,base32pad:()=>zI,base32padupper:()=>VI,base32upper:()=>FI,base32z:()=>qI});var qr=Ne({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),FI=Ne({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),zI=Ne({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),VI=Ne({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),MI=Ne({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$I=Ne({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),jI=Ne({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),HI=Ne({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),qI=Ne({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var KI=qv,jv=128,GI=127,WI=~GI,YI=Math.pow(2,31);function qv(r,e,t){e=e||[],t=t||0;for(var n=t;r>=YI;)e[t++]=r&255|jv,r/=128;for(;r&WI;)e[t++]=r&255|jv,r>>>=7;return e[t]=r|0,qv.bytes=t-n+1,e}var XI=dm,JI=128,Hv=127;function dm(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw dm.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&Hv)<<i:(s&Hv)*Math.pow(2,i),i+=7}while(s>=JI);return dm.bytes=o-n,t}var ZI=Math.pow(2,7),QI=Math.pow(2,14),e_=Math.pow(2,21),t_=Math.pow(2,28),r_=Math.pow(2,35),n_=Math.pow(2,42),i_=Math.pow(2,49),o_=Math.pow(2,56),s_=Math.pow(2,63),a_=function(r){return r<ZI?1:r<QI?2:r<e_?3:r<t_?4:r<r_?5:r<n_?6:r<i_?7:r<o_?8:r<s_?9:10},c_={encode:KI,decode:XI,encodingLength:a_},l_=c_,oc=l_;var sc=(r,e=0)=>[oc.decode(r,e),oc.decode.bytes],Es=(r,e,t=0)=>(oc.encode(r,e,t),e),As=r=>oc.encodingLength(r);var lo=(r,e)=>{let t=e.byteLength,n=As(r),i=n+As(t),o=new Uint8Array(i+t);return Es(r,o,0),Es(t,o,n),o.set(e,i),new Ss(r,t,e,o)},ac=r=>{let e=Rn(r),[t,n]=sc(e),[i,o]=sc(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Ss(t,i,s,e)},Kv=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Fv(r.bytes,t.bytes)}},Ss=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};var xm={};$(xm,{base10:()=>m_});function u_(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function p(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var h=0,x=0,g=0,w=f.length;g!==w&&f[g]===0;)g++,h++;for(var y=(w-g)*l+1>>>0,E=new Uint8Array(y);g!==w;){for(var B=f[g],S=0,b=y-1;(B!==0||S<x)&&b!==-1;b--,S++)B+=256*E[b]>>>0,E[b]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");x=S,g++}for(var v=y-x;v!==y&&E[v]===0;)v++;for(var k=c.repeat(h);v<y;++v)k+=r.charAt(E[v]);return k}function m(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var h=0;if(f[h]!==" "){for(var x=0,g=0;f[h]===c;)x++,h++;for(var w=(f.length-h)*u+1>>>0,y=new Uint8Array(w);f[h];){var E=t[f.charCodeAt(h)];if(E===255)return;for(var B=0,S=w-1;(E!==0||B<g)&&S!==-1;S--,B++)E+=a*y[S]>>>0,y[S]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,h++}if(f[h]!==" "){for(var b=w-g;b!==w&&y[b]===0;)b++;for(var v=new Uint8Array(x+(w-b)),k=x;b!==w;)v[k++]=y[b++];return v}}}function d(f){var h=m(f);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:m,decode:d}}var p_=u_,d_=p_,Gv=d_;var bG=new Uint8Array(0);var Wv=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},Un=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var Yv=r=>new TextEncoder().encode(r),Xv=r=>new TextDecoder().decode(r);var fm=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},hm=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Zv(this,e)}},mm=class{constructor(e){this.decoders=e}or(e){return Zv(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Zv=(r,e)=>new mm({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),gm=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new fm(e,t,n),this.decoder=new hm(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Bs=({name:r,prefix:e,encode:t,decode:n})=>new gm(r,e,t,n),_i=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Gv(t,e);return Bs({prefix:r,name:e,encode:n,decode:o=>Un(i(o))})},f_=(r,e,t,n)=>{let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*t/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let p=i[r[l]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},h_=(r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,o+=e[i&a>>s];if(s&&(o+=e[i&a<<t-s]),n)for(;o.length*t&7;)o+="=";return o},De=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Bs({prefix:e,name:r,encode(i){return h_(i,n,t)},decode(i){return f_(i,n,t,r)}});var m_=_i({prefix:"9",name:"base10",alphabet:"0123456789"});var ym={};$(ym,{base16:()=>g_,base16upper:()=>x_});var g_=De({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),x_=De({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var wm={};$(wm,{base2:()=>y_});var y_=De({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var bm={};$(bm,{base256emoji:()=>A_});var Qv=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),w_=Qv.reduce((r,e,t)=>(r[t]=e,r),[]),b_=Qv.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function v_(r){return r.reduce((e,t)=>(e+=w_[t],e),"")}function E_(r){let e=[];for(let t of r){let n=b_[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var A_=Bs({prefix:"\u{1F680}",name:"base256emoji",encode:v_,decode:E_});var vm={};$(vm,{base32:()=>ks,base32hex:()=>I_,base32hexpad:()=>T_,base32hexpadupper:()=>C_,base32hexupper:()=>__,base32pad:()=>B_,base32padupper:()=>k_,base32upper:()=>S_,base32z:()=>R_});var ks=De({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),S_=De({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),B_=De({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),k_=De({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),I_=De({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),__=De({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),T_=De({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),C_=De({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),R_=De({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Em={};$(Em,{base36:()=>U_,base36upper:()=>N_});var U_=_i({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),N_=_i({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Am={};$(Am,{base58btc:()=>Kr,base58flickr:()=>D_});var Kr=_i({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),D_=_i({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Sm={};$(Sm,{base64:()=>L_,base64pad:()=>P_,base64url:()=>O_,base64urlpad:()=>F_});var L_=De({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),P_=De({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),O_=De({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),F_=De({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Bm={};$(Bm,{base8:()=>z_});var z_=De({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var km={};$(km,{identity:()=>V_});var V_=Bs({prefix:"\0",name:"identity",encode:r=>Xv(r),decode:r=>Yv(r)});var LG=new TextEncoder,PG=new TextDecoder;var _m={};$(_m,{identity:()=>lT});var j_=r2,e2=128,H_=127,q_=~H_,K_=Math.pow(2,31);function r2(r,e,t){e=e||[],t=t||0;for(var n=t;r>=K_;)e[t++]=r&255|e2,r/=128;for(;r&q_;)e[t++]=r&255|e2,r>>>=7;return e[t]=r|0,r2.bytes=t-n+1,e}var G_=Im,W_=128,t2=127;function Im(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw Im.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&t2)<<i:(s&t2)*Math.pow(2,i),i+=7}while(s>=W_);return Im.bytes=o-n,t}var Y_=Math.pow(2,7),X_=Math.pow(2,14),J_=Math.pow(2,21),Z_=Math.pow(2,28),Q_=Math.pow(2,35),eT=Math.pow(2,42),tT=Math.pow(2,49),rT=Math.pow(2,56),nT=Math.pow(2,63),iT=function(r){return r<Y_?1:r<X_?2:r<J_?3:r<Z_?4:r<Q_?5:r<eT?6:r<tT?7:r<rT?8:r<nT?9:10},oT={encode:j_,decode:G_,encodingLength:iT},sT=oT,cc=sT;var lc=(r,e=0)=>[cc.decode(r,e),cc.decode.bytes],Is=(r,e,t=0)=>(cc.encode(r,e,t),e),_s=r=>cc.encodingLength(r);var po=(r,e)=>{let t=e.byteLength,n=_s(r),i=n+_s(t),o=new Uint8Array(i+t);return Is(r,o,0),Is(t,o,n),o.set(e,i),new Ts(r,t,e,o)},n2=r=>{let e=Un(r),[t,n]=lc(e),[i,o]=lc(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Ts(t,i,s,e)},i2=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Wv(r.bytes,t.bytes)}},Ts=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};var o2=0,aT="identity",s2=Un,cT=r=>po(o2,s2(r)),lT={code:o2,name:aT,encode:s2,digest:cT};var Rm={};$(Rm,{sha256:()=>uT,sha512:()=>pT});var Cm=({name:r,code:e,encode:t})=>new Tm(r,e,t),Tm=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?po(this.code,t):t.then(n=>po(this.code,n))}else throw Error("Unknown type, must be binary type")}};var c2=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),uT=Cm({name:"sha2-256",code:18,encode:c2("SHA-256")}),pT=Cm({name:"sha2-512",code:19,encode:c2("SHA-512")});var l2=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return fT(t,Um(r),e||Kr.encoder);default:return hT(t,Um(r),e||ks.encoder)}};var u2=new WeakMap,Um=r=>{let e=u2.get(r);if(e==null){let t=new Map;return u2.set(r,t),t}return e},dp=class r{constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==pc)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==mT)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=po(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&i2(e.multihash,n.multihash)}toString(e){return l2(this,e)}toJSON(){return{"/":l2(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:o,bytes:s}=t;return new r(n,i,o,s||p2(n,i,o.bytes))}else if(t[gT]===!0){let{version:n,multihash:i,code:o}=t,s=n2(i);return r.create(n,o,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==pc)throw new Error(`Version 0 CID must use dag-pb (code: ${pc}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=p2(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,pc,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=Un(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new Ts(t.multihashCode,t.digestSize,o,i);return[t.version===0?r.createV0(s):r.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[p,m]=lc(e.subarray(t));return t+=m,p},i=n(),o=pc;if(i===18?(i=0,t=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,a=n(),c=n(),u=t+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,i]=dT(e,t),o=r.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Um(o).set(n,e),o}},dT=(r,e)=>{switch(r[0]){case"Q":{let t=e||Kr;return[Kr.prefix,t.decode(`${Kr.prefix}${r}`)]}case Kr.prefix:{let t=e||Kr;return[Kr.prefix,t.decode(r)]}case ks.prefix:{let t=e||ks;return[ks.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},fT=(r,e,t)=>{let{prefix:n}=t;if(n!==Kr.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let o=t.encode(r).slice(1);return e.set(n,o),o}else return i},hT=(r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let o=t.encode(r);return e.set(n,o),o}else return i},pc=112,mT=18,p2=(r,e,t)=>{let n=_s(r),i=n+_s(e),o=new Uint8Array(i+t.byteLength);return Is(r,o,0),Is(e,o,n),o.set(t,i),o},gT=Symbol.for("@ipld/js-cid/CID");var Nm={...km,...wm,...Bm,...xm,...ym,...vm,...Em,...Am,...Sm,...bm},ZG={...Rm,..._m};function Cs(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function fp(r=0){return globalThis.Buffer?.allocUnsafe!=null?Cs(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function f2(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var d2=f2("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Dm=f2("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=fp(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),xT={utf8:d2,"utf-8":d2,hex:Nm.base16,latin1:Dm,ascii:Dm,binary:Dm,...Nm},hp=xT;function Et(r,e="utf8"){let t=hp[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var h2=Ho,yT=qo,Lm=function(r){let e=0;if(r=r.toString().trim(),h2(r)){let t=new Uint8Array(e+4);return r.split(/\./g).forEach(n=>{t[e++]=parseInt(n,10)&255}),t}if(yT(r)){let t=r.split(":",8),n;for(n=0;n<t.length;n++){let o=h2(t[n]),s;o&&(s=Lm(t[n]),t[n]=Et(s.slice(0,2),"base16")),s!=null&&++n<8&&t.splice(n,0,Et(s.slice(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(n=0;n<t.length&&t[n]!=="";n++);let o=[n,1];for(n=9-t.length;n>0;n--)o.push("0");t.splice.apply(t,o)}let i=new Uint8Array(e+16);for(n=0;n<t.length;n++){let o=parseInt(t[n],16);i[e++]=o>>8&255,i[e++]=o&255}return i}throw new Error("invalid ip address")},m2=function(r,e=0,t){e=~~e,t=t??r.length-e;let n=new DataView(r.buffer);if(t===4){let i=[];for(let o=0;o<t;o++)i.push(r[e+o]);return i.join(".")}if(t===16){let i=[];for(let o=0;o<t;o+=2)i.push(n.getUint16(e+o).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var dc={},Pm={},bT=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc"],[281,0,"webrtc-w3c"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,-1,"memory"]];bT.forEach(r=>{let e=vT(...r);Pm[e.code]=e,dc[e.name]=e});function vT(r,e,t,n,i){return{code:r,size:e,name:t,resolvable:!!n,path:!!i}}function _e(r){if(typeof r=="number"){if(Pm[r]!=null)return Pm[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(dc[r]!=null)return dc[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var g2=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return AT(t,Om(r),e||vt.encoder);default:return ST(t,Om(r),e||qr.encoder)}};var x2=new WeakMap,Om=r=>{let e=x2.get(r);if(e==null){let t=new Map;return x2.set(r,t),t}return e},ur=class r{constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==fc)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==BT)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=lo(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&Kv(e.multihash,n.multihash)}toString(e){return g2(this,e)}toJSON(){return{"/":g2(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:o,bytes:s}=t;return new r(n,i,o,s||y2(n,i,o.bytes))}else if(t[kT]===!0){let{version:n,multihash:i,code:o}=t,s=ac(i);return r.create(n,o,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==fc)throw new Error(`Version 0 CID must use dag-pb (code: ${fc}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=y2(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,fc,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=Rn(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new Ss(t.multihashCode,t.digestSize,o,i);return[t.version===0?r.createV0(s):r.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[p,m]=sc(e.subarray(t));return t+=m,p},i=n(),o=fc;if(i===18?(i=0,t=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,a=n(),c=n(),u=t+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,i]=ET(e,t),o=r.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Om(o).set(n,e),o}},ET=(r,e)=>{switch(r[0]){case"Q":{let t=e||vt;return[vt.prefix,t.decode(`${vt.prefix}${r}`)]}case vt.prefix:{let t=e||vt;return[vt.prefix,t.decode(r)]}case qr.prefix:{let t=e||qr;return[qr.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},AT=(r,e,t)=>{let{prefix:n}=t;if(n!==vt.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let o=t.encode(r).slice(1);return e.set(n,o),o}else return i},ST=(r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let o=t.encode(r);return e.set(n,o),o}else return i},fc=112,BT=18,y2=(r,e,t)=>{let n=As(r),i=n+As(e),o=new Uint8Array(i+t.byteLength);return Es(r,o,0),Es(e,o,n),o.set(t,i),o},kT=Symbol.for("@ipld/js-cid/CID");var Fm={};$(Fm,{identity:()=>IT});var IT=vs({prefix:"\0",name:"identity",encode:r=>Vv(r),decode:r=>zv(r)});var zm={};$(zm,{base2:()=>_T});var _T=Ne({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Vm={};$(Vm,{base8:()=>TT});var TT=Ne({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Mm={};$(Mm,{base10:()=>CT});var CT=Ii({prefix:"9",name:"base10",alphabet:"0123456789"});var $m={};$($m,{base16:()=>RT,base16upper:()=>UT});var RT=Ne({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),UT=Ne({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var jm={};$(jm,{base36:()=>NT,base36upper:()=>DT});var NT=Ii({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),DT=Ii({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Hm={};$(Hm,{base64:()=>LT,base64pad:()=>PT,base64url:()=>OT,base64urlpad:()=>FT});var LT=Ne({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),PT=Ne({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),OT=Ne({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),FT=Ne({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var qm={};$(qm,{base256emoji:()=>jT});var w2=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),zT=w2.reduce((r,e,t)=>(r[t]=e,r),[]),VT=w2.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function MT(r){return r.reduce((e,t)=>(e+=zT[t],e),"")}function $T(r){let e=[];for(let t of r){let n=VT[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var jT=vs({prefix:"\u{1F680}",name:"base256emoji",encode:MT,decode:$T});var Wm={};$(Wm,{sha256:()=>HT,sha512:()=>qT});var Gm=({name:r,code:e,encode:t})=>new Km(r,e,t),Km=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?lo(this.code,t):t.then(n=>lo(this.code,n))}else throw Error("Unknown type, must be binary type")}};var v2=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),HT=Gm({name:"sha2-256",code:18,encode:v2("SHA-256")}),qT=Gm({name:"sha2-512",code:19,encode:v2("SHA-512")});var Ym={};$(Ym,{identity:()=>WT});var E2=0,KT="identity",A2=Rn,GT=r=>lo(E2,A2(r)),WT={code:E2,name:KT,encode:A2,digest:GT};var TW=new TextEncoder,CW=new TextDecoder;var S2={...Fm,...zm,...Vm,...Mm,...$m,...pm,...jm,...um,...Hm,...qm},LW={...Wm,...Ym};var Gr=Q(il(),1);function Xm(r,e="utf8"){let t=hp[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Cs(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}function Nn(r,e){e==null&&(e=r.reduce((i,o)=>i+o.length,0));let t=fp(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return Cs(t)}function T2(r,e){switch(_e(r).code){case 4:case 41:return ZT(e);case 42:return I2(e);case 6:case 273:case 33:case 132:return R2(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return I2(e);case 421:return rC(e);case 444:return _2(e);case 445:return _2(e);case 466:return tC(e);default:return Et(e,"base16")}}function C2(r,e){switch(_e(r).code){case 4:return B2(e);case 41:return B2(e);case 42:return k2(e);case 6:case 273:case 33:case 132:return Zm(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return k2(e);case 421:return QT(e);case 444:return nC(e);case 445:return iC(e);case 466:return eC(e);default:return Xm(e,"base16")}}var Jm=Object.values(S2).map(r=>r.decoder),JT=function(){let r=Jm[0].or(Jm[1]);return Jm.slice(2).forEach(e=>r=r.or(e)),r}();function B2(r){if(!ir(r))throw new Error("invalid ip address");return Lm(r)}function ZT(r){let e=m2(r,0,r.length);if(e==null)throw new Error("ipBuff is required");if(!ir(e))throw new Error("invalid ip address");return e}function Zm(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r),new Uint8Array(e)}function R2(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function k2(r){let e=Xm(r),t=Uint8Array.from(Gr.default.encode(e.length));return Nn([t,e],t.length+e.length)}function I2(r){let e=Gr.default.decode(r);if(r=r.slice(Gr.default.decode.bytes),r.length!==e)throw new Error("inconsistent lengths");return Et(r)}function QT(r){let e;r[0]==="Q"||r[0]==="1"?e=ac(vt.decode(`z${r}`)).bytes:e=ur.parse(r).multihash.bytes;let t=Uint8Array.from(Gr.default.encode(e.length));return Nn([t,e],t.length+e.length)}function eC(r){let e=JT.decode(r),t=Uint8Array.from(Gr.default.encode(e.length));return Nn([t,e],t.length+e.length)}function tC(r){let e=Gr.default.decode(r),t=r.slice(Gr.default.decode.bytes);if(t.length!==e)throw new Error("inconsistent lengths");return"u"+Et(t,"base64url")}function rC(r){let e=Gr.default.decode(r),t=r.slice(Gr.default.decode.bytes);if(t.length!==e)throw new Error("inconsistent lengths");return Et(t,"base58btc")}function nC(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=qr.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Zm(n);return Nn([t,i],t.length+i.length)}function iC(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=qr.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Zm(n);return Nn([t,i],t.length+i.length)}function _2(r){let e=r.slice(0,r.length-2),t=r.slice(r.length-2),n=Et(e,"base32"),i=R2(t);return`${n}:${i}`}var Rs=Q(il(),1);function oC(r){let e=[],t=r.split("/").slice(1);if(t.length===1&&t[0]==="")return[];for(let n=0;n<t.length;n++){let i=t[n],o=_e(i);if(o.size===0){e.push([i]);continue}if(n++,n>=t.length)throw N2("invalid address: "+r);if(o.path===!0){e.push([i,n0(t.slice(n).join("/"))]);break}e.push([i,t[n]])}return e}function sC(r){let e=[];return r.map(t=>{let n=xp(t);return e.push(n.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),n0(e.join("/"))}function aC(r){return r.map(e=>{Array.isArray(e)||(e=[e]);let t=xp(e);return e.length>1?[t.code,C2(t.code,e[1])]:[t.code]})}function Qm(r){return r.map(e=>{let t=xp(e);return e[1]!=null?[t.code,T2(t.code,e[1])]:[t.code]})}function e0(r){return gp(Nn(r.map(e=>{let t=xp(e),n=Uint8Array.from(Rs.default.encode(t.code));return e.length>1&&e[1]!=null&&(n=Nn([n,e[1]])),n})))}function t0(r,e){return r.size>0?r.size/8:r.size===0?0:Rs.default.decode(e)+(Rs.default.decode.bytes??0)}function mp(r){let e=[],t=0;for(;t<r.length;){let n=Rs.default.decode(r,t),i=Rs.default.decode.bytes??0,o=_e(n),s=t0(o,r.slice(t+i));if(s===0){e.push([n]),t+=i;continue}let a=r.slice(t+i,t+i+s);if(t+=s+i,t>r.length)throw N2("Invalid address Uint8Array: "+Et(r,"base16"));e.push([n,a])}return e}function r0(r){let e=mp(r),t=Qm(e);return sC(t)}function cC(r){r=n0(r);let e=oC(r),t=aC(e);return e0(t)}function U2(r){return cC(r)}function gp(r){let e=lC(r);if(e!=null)throw e;return Uint8Array.from(r)}function lC(r){try{mp(r)}catch(e){return e}}function n0(r){return"/"+r.trim().split("/").filter(e=>e).join("/")}function N2(r){return new Error("Error parsing address: "+r)}function xp(r){return _e(r[0])}var o0=Q(il(),1);var O2=Q(ke(),1);function D2(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}var Us=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},i0=function(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},hc,mc,gc,L2,pC=Symbol.for("nodejs.util.inspect.custom"),dC=[_e("dns").code,_e("dns4").code,_e("dns6").code,_e("dnsaddr").code],fC=new Map,F2=Symbol.for("@multiformats/js-multiaddr/multiaddr");function hC(r){return!!r?.[F2]}var P2=class r{constructor(e){if(hc.set(this,void 0),mc.set(this,void 0),gc.set(this,void 0),this[L2]=!0,e==null&&(e=""),e instanceof Uint8Array)this.bytes=gp(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);this.bytes=U2(e)}else if(hC(e))this.bytes=gp(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return Us(this,hc,"f")==null&&i0(this,hc,r0(this.bytes),"f"),Us(this,hc,"f")}toJSON(){return this.toString()}toOptions(){let e,t,n,i,o="",s=_e("tcp"),a=_e("udp"),c=_e("ip4"),u=_e("ip6"),l=_e("dns6"),p=_e("ip6zone");for(let[d,f]of this.stringTuples())d===p.code&&(o=`%${f??""}`),dC.includes(d)&&(t=s.name,i=443,n=`${f??""}${o}`,e=d===l.code?6:4),(d===s.code||d===a.code)&&(t=_e(d).name,i=parseInt(f??"")),(d===c.code||d===u.code)&&(t=_e(d).name,n=`${f??""}${o}`,e=d===u.code?6:4);if(e==null||t==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:t,port:i}}protos(){return this.protoCodes().map(e=>Object.assign({},_e(e)))}protoCodes(){let e=[],t=this.bytes,n=0;for(;n<t.length;){let i=o0.default.decode(t,n),o=o0.default.decode.bytes??0,s=_e(i),a=t0(s,t.slice(n+o));n+=a+o,e.push(i)}return e}protoNames(){return this.protos().map(e=>e.name)}tuples(){return Us(this,mc,"f")==null&&i0(this,mc,mp(this.bytes),"f"),Us(this,mc,"f")}stringTuples(){return Us(this,gc,"f")==null&&i0(this,gc,Qm(this.tuples()),"f"),Us(this,gc,"f")}encapsulate(e){return e=new r(e),new r(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),n=this.toString(),i=n.lastIndexOf(t);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new r(n.slice(0,i))}decapsulateCode(e){let t=this.tuples();for(let n=t.length-1;n>=0;n--)if(t[n][0]===e)return new r(e0(t.slice(0,n)));return this}getPeerId(){try{let t=this.stringTuples().filter(n=>n[0]===dc.ipfs.code).pop();if(t?.[1]!=null){let n=t[1];return n[0]==="Q"||n[0]==="1"?Et(vt.decode(`z${n}`),"base58btc"):Et(ur.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){let e=null;try{e=this.stringTuples().filter(t=>_e(t[0]).path===!0)[0][1],e==null&&(e=null)}catch{e=null}return e}equals(e){return D2(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(o=>o.resolvable);if(t==null)return[this];let n=fC.get(t.name);if(n==null)throw(0,O2.default)(new Error(`no available resolver for ${t.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(o=>new r(o))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let t=(e??this).protos();return!(t.length!==2||t[0].code!==4&&t[0].code!==41||t[1].code!==6&&t[1].code!==273)}[(hc=new WeakMap,mc=new WeakMap,gc=new WeakMap,L2=F2,pC)](){return`Multiaddr(${r0(this.bytes)})`}};var u0={};$(u0,{base58btc:()=>Ut,base58flickr:()=>bC});var lY=new Uint8Array(0);function z2(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function Dn(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function V2(r){return new TextEncoder().encode(r)}function M2(r){return new TextDecoder().decode(r)}function mC(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function p(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var h=0,x=0,g=0,w=f.length;g!==w&&f[g]===0;)g++,h++;for(var y=(w-g)*l+1>>>0,E=new Uint8Array(y);g!==w;){for(var B=f[g],S=0,b=y-1;(B!==0||S<x)&&b!==-1;b--,S++)B+=256*E[b]>>>0,E[b]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");x=S,g++}for(var v=y-x;v!==y&&E[v]===0;)v++;for(var k=c.repeat(h);v<y;++v)k+=r.charAt(E[v]);return k}function m(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var h=0;if(f[h]!==" "){for(var x=0,g=0;f[h]===c;)x++,h++;for(var w=(f.length-h)*u+1>>>0,y=new Uint8Array(w);f[h];){var E=t[f.charCodeAt(h)];if(E===255)return;for(var B=0,S=w-1;(E!==0||B<g)&&S!==-1;S--,B++)E+=a*y[S]>>>0,y[S]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,h++}if(f[h]!==" "){for(var b=w-g;b!==w&&y[b]===0;)b++;for(var v=new Uint8Array(x+(w-b)),k=x;b!==w;)v[k++]=y[b++];return v}}}function d(f){var h=m(f);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:m,decode:d}}var gC=mC,xC=gC,j2=xC;var s0=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},a0=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return H2(this,e)}},c0=class{decoders;constructor(e){this.decoders=e}or(e){return H2(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function H2(r,e){return new c0({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var l0=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new s0(e,t,n),this.decoder=new a0(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Ns({name:r,prefix:e,encode:t,decode:n}){return new l0(r,e,t,n)}function Ti({name:r,prefix:e,alphabet:t}){let{encode:n,decode:i}=j2(t,r);return Ns({prefix:e,name:r,encode:n,decode:o=>Dn(i(o))})}function yC(r,e,t,n){let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*t/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let p=i[r[l]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s}function wC(r,e,t){let n=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,o+=e[i&a>>s];if(s!==0&&(o+=e[i&a<<t-s]),n)for(;o.length*t&7;)o+="=";return o}function Le({name:r,prefix:e,bitsPerChar:t,alphabet:n}){return Ns({prefix:e,name:r,encode(i){return wC(i,n,t)},decode(i){return yC(i,n,t,r)}})}var Ut=Ti({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),bC=Ti({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var p0={};$(p0,{base32:()=>Ln,base32hex:()=>SC,base32hexpad:()=>kC,base32hexpadupper:()=>IC,base32hexupper:()=>BC,base32pad:()=>EC,base32padupper:()=>AC,base32upper:()=>vC,base32z:()=>_C});var Ln=Le({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),vC=Le({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),EC=Le({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),AC=Le({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),SC=Le({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),BC=Le({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),kC=Le({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),IC=Le({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),_C=Le({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var TC=G2,q2=128,CC=127,RC=~CC,UC=Math.pow(2,31);function G2(r,e,t){e=e||[],t=t||0;for(var n=t;r>=UC;)e[t++]=r&255|q2,r/=128;for(;r&RC;)e[t++]=r&255|q2,r>>>=7;return e[t]=r|0,G2.bytes=t-n+1,e}var NC=d0,DC=128,K2=127;function d0(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw d0.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&K2)<<i:(s&K2)*Math.pow(2,i),i+=7}while(s>=DC);return d0.bytes=o-n,t}var LC=Math.pow(2,7),PC=Math.pow(2,14),OC=Math.pow(2,21),FC=Math.pow(2,28),zC=Math.pow(2,35),VC=Math.pow(2,42),MC=Math.pow(2,49),$C=Math.pow(2,56),jC=Math.pow(2,63),HC=function(r){return r<LC?1:r<PC?2:r<OC?3:r<FC?4:r<zC?5:r<VC?6:r<MC?7:r<$C?8:r<jC?9:10},qC={encode:TC,decode:NC,encodingLength:HC},KC=qC,xc=KC;function yc(r,e=0){return[xc.decode(r,e),xc.decode.bytes]}function Ds(r,e,t=0){return xc.encode(r,e,t),e}function Ls(r){return xc.encodingLength(r)}function fo(r,e){let t=e.byteLength,n=Ls(r),i=n+Ls(t),o=new Uint8Array(i+t);return Ds(r,o,0),Ds(t,o,n),o.set(e,i),new Ps(r,t,e,o)}function wp(r){let e=Dn(r),[t,n]=yc(e),[i,o]=yc(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Ps(t,i,s,e)}function W2(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&z2(r.bytes,t.bytes)}}var Ps=class{code;size;digest;bytes;constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};function Y2(r,e){let{bytes:t,version:n}=r;switch(n){case 0:return WC(t,f0(r),e??Ut.encoder);default:return YC(t,f0(r),e??Ln.encoder)}}var X2=new WeakMap;function f0(r){let e=X2.get(r);if(e==null){let t=new Map;return X2.set(r,t),t}return e}var Ci=class r{code;version;multihash;bytes;"/";constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==wc)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==XC)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=fo(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&&W2(e.multihash,n.multihash)}toString(e){return Y2(this,e)}toJSON(){return{"/":Y2(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:o,bytes:s}=t;return new r(n,i,o,s??J2(n,i,o.bytes))}else if(t[JC]===!0){let{version:n,multihash:i,code:o}=t,s=wp(i);return r.create(n,o,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==wc)throw new Error(`Version 0 CID must use dag-pb (code: ${wc}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=J2(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,wc,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=Dn(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new Ps(t.multihashCode,t.digestSize,o,i);return[t.version===0?r.createV0(s):r.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[p,m]=yc(e.subarray(t));return t+=m,p},i=n(),o=wc;if(i===18?(i=0,t=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,a=n(),c=n(),u=t+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,i]=GC(e,t),o=r.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return f0(o).set(n,e),o}};function GC(r,e){switch(r[0]){case"Q":{let t=e??Ut;return[Ut.prefix,t.decode(`${Ut.prefix}${r}`)]}case Ut.prefix:{let t=e??Ut;return[Ut.prefix,t.decode(r)]}case Ln.prefix:{let t=e??Ln;return[Ln.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}}function WC(r,e,t){let{prefix:n}=t;if(n!==Ut.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let o=t.encode(r).slice(1);return e.set(n,o),o}else return i}function YC(r,e,t){let{prefix:n}=t,i=e.get(n);if(i==null){let o=t.encode(r);return e.set(n,o),o}else return i}var wc=112,XC=18;function J2(r,e,t){let n=Ls(r),i=n+Ls(e),o=new Uint8Array(i+t.byteLength);return Ds(r,o,0),Ds(e,o,n),o.set(t,i),o}var JC=Symbol.for("@ipld/js-cid/CID");function Z2(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}var h0={};$(h0,{base10:()=>ZC});var ZC=Ti({prefix:"9",name:"base10",alphabet:"0123456789"});var m0={};$(m0,{base16:()=>QC,base16upper:()=>eR});var QC=Le({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),eR=Le({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var g0={};$(g0,{base2:()=>tR});var tR=Le({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var x0={};$(x0,{base256emoji:()=>sR});var Q2=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),rR=Q2.reduce((r,e,t)=>(r[t]=e,r),[]),nR=Q2.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function iR(r){return r.reduce((e,t)=>(e+=rR[t],e),"")}function oR(r){let e=[];for(let t of r){let n=nR[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var sR=Ns({prefix:"\u{1F680}",name:"base256emoji",encode:iR,decode:oR});var y0={};$(y0,{base36:()=>aR,base36upper:()=>cR});var aR=Ti({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),cR=Ti({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var w0={};$(w0,{base64:()=>lR,base64pad:()=>uR,base64url:()=>pR,base64urlpad:()=>dR});var lR=Le({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),uR=Le({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),pR=Le({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),dR=Le({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var b0={};$(b0,{base8:()=>fR});var fR=Le({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var v0={};$(v0,{identity:()=>hR});var hR=Ns({prefix:"\0",name:"identity",encode:r=>M2(r),decode:r=>V2(r)});var DY=new TextEncoder,LY=new TextDecoder;var E0={};$(E0,{identity:()=>wR});var eE=0,xR="identity",tE=Dn;function yR(r){return fo(eE,tE(r))}var wR={code:eE,name:xR,encode:tE,digest:yR};var B0={};$(B0,{sha256:()=>bR,sha512:()=>vR});function S0({name:r,code:e,encode:t}){return new A0(r,e,t)}var A0=class{name;code;encode;constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?fo(this.code,t):t.then(n=>fo(this.code,n))}else throw Error("Unknown type, must be binary type")}};function nE(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var bR=S0({name:"sha2-256",code:18,encode:nE("SHA-256")}),vR=S0({name:"sha2-512",code:19,encode:nE("SHA-512")});var bc={...v0,...g0,...b0,...h0,...m0,...p0,...y0,...u0,...w0,...x0},WY={...B0,...E0};function ho(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function bp(r=0){return globalThis.Buffer?.allocUnsafe!=null?ho(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function oE(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var iE=oE("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),k0=oE("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=bp(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),ER={utf8:iE,"utf-8":iE,hex:bc.base16,latin1:k0,ascii:k0,binary:k0,...bc},vp=ER;function Nt(r,e="utf8"){let t=vp[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}function Pn(r,e){if(globalThis.Buffer!=null)return ho(globalThis.Buffer.concat(r,e));e==null&&(e=r.reduce((i,o)=>i+o.length,0));let t=bp(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return ho(t)}function I0(r,e="utf8"){let t=vp[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ho(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var sE=Ho,AR=qo,_0=function(r){let e=0;if(r=r.toString().trim(),sE(r)){let t=new Uint8Array(e+4);return r.split(/\./g).forEach(n=>{t[e++]=parseInt(n,10)&255}),t}if(AR(r)){let t=r.split(":",8),n;for(n=0;n<t.length;n++){let o=sE(t[n]),s;o&&(s=_0(t[n]),t[n]=Nt(s.slice(0,2),"base16")),s!=null&&++n<8&&t.splice(n,0,Nt(s.slice(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(n=0;n<t.length&&t[n]!=="";n++);let o=[n,1];for(n=9-t.length;n>0;n--)o.push("0");t.splice.apply(t,o)}let i=new Uint8Array(e+16);for(n=0;n<t.length;n++){let o=parseInt(t[n],16);i[e++]=o>>8&255,i[e++]=o&255}return i}throw new Error("invalid ip address")},aE=function(r,e=0,t){e=~~e,t=t??r.length-e;let n=new DataView(r.buffer);if(t===4){let i=[];for(let o=0;o<t;o++)i.push(r[e+o]);return i.join(".")}if(t===16){let i=[];for(let o=0;o<t;o+=2)i.push(n.getUint16(e+o).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Fs={},T0={},BR=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,-1,"memory"]];BR.forEach(r=>{let e=kR(...r);T0[e.code]=e,Fs[e.name]=e});function kR(r,e,t,n,i){return{code:r,size:e,name:t,resolvable:!!n,path:!!i}}function Ee(r){if(typeof r=="number"){if(T0[r]!=null)return T0[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Fs[r]!=null)return Fs[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var AX=Ee("ip4"),SX=Ee("ip6"),BX=Ee("ipcidr");function R0(r,e){switch(Ee(r).code){case 4:case 41:return _R(e);case 42:return uE(e);case 6:case 273:case 33:case 132:return dE(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return uE(e);case 421:return UR(e);case 444:return pE(e);case 445:return pE(e);case 466:return RR(e);default:return Nt(e,"base16")}}function U0(r,e){switch(Ee(r).code){case 4:return cE(e);case 41:return cE(e);case 42:return lE(e);case 6:case 273:case 33:case 132:return N0(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return lE(e);case 421:return TR(e);case 444:return NR(e);case 445:return DR(e);case 466:return CR(e);default:return I0(e,"base16")}}var C0=Object.values(bc).map(r=>r.decoder),IR=function(){let r=C0[0].or(C0[1]);return C0.slice(2).forEach(e=>r=r.or(e)),r}();function cE(r){if(!ir(r))throw new Error("invalid ip address");return _0(r)}function _R(r){let e=aE(r,0,r.length);if(e==null)throw new Error("ipBuff is required");if(!ir(e))throw new Error("invalid ip address");return e}function N0(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r),new Uint8Array(e)}function dE(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function lE(r){let e=I0(r),t=Uint8Array.from(Qt(e.length));return Pn([t,e],t.length+e.length)}function uE(r){let e=kt(r);if(r=r.slice(Fe(e)),r.length!==e)throw new Error("inconsistent lengths");return Nt(r)}function TR(r){let e;r[0]==="Q"||r[0]==="1"?e=wp(Ut.decode(`z${r}`)).bytes:e=Ci.parse(r).multihash.bytes;let t=Uint8Array.from(Qt(e.length));return Pn([t,e],t.length+e.length)}function CR(r){let e=IR.decode(r),t=Uint8Array.from(Qt(e.length));return Pn([t,e],t.length+e.length)}function RR(r){let e=kt(r),t=r.slice(Fe(e));if(t.length!==e)throw new Error("inconsistent lengths");return"u"+Nt(t,"base64url")}function UR(r){let e=kt(r),t=r.slice(Fe(e));if(t.length!==e)throw new Error("inconsistent lengths");return Nt(t,"base58btc")}function NR(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=Ln.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=N0(n);return Pn([t,i],t.length+i.length)}function DR(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=Ln.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=N0(n);return Pn([t,i],t.length+i.length)}function pE(r){let e=r.slice(0,r.length-2),t=r.slice(r.length-2),n=Nt(e,"base32"),i=dE(t);return`${n}:${i}`}function fE(r){r=D0(r);let e=[],t=[],n=null,i=r.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let o=0;o<i.length;o++){let s=i[o],a=Ee(s);if(a.size===0){e.push([a.code]),t.push([a.code]);continue}if(o++,o>=i.length)throw mE("invalid address: "+r);if(a.path===!0){n=D0(i.slice(o).join("/")),e.push([a.code,U0(a.code,n)]),t.push([a.code,n]);break}let c=U0(a.code,i[o]);e.push([a.code,c]),t.push([a.code,R0(a.code,c)])}return{string:hE(t),bytes:P0(e),tuples:e,stringTuples:t,path:n}}function L0(r){let e=[],t=[],n=null,i=0;for(;i<r.length;){let o=kt(r,i),s=Fe(o),a=Ee(o),c=LR(a,r.slice(i+s));if(c===0){e.push([o]),t.push([o]),i+=s;continue}let u=r.slice(i+s,i+s+c);if(i+=c+s,i>r.length)throw mE("Invalid address Uint8Array: "+Nt(r,"base16"));e.push([o,u]);let l=R0(o,u);if(t.push([o,l]),a.path===!0){n=l;break}}return{bytes:Uint8Array.from(r),string:hE(t),tuples:e,stringTuples:t,path:n}}function hE(r){let e=[];return r.map(t=>{let n=Ee(t[0]);return e.push(n.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),D0(e.join("/"))}function P0(r){return Pn(r.map(e=>{let t=Ee(e[0]),n=Uint8Array.from(Qt(t.code));return e.length>1&&e[1]!=null&&(n=Pn([n,e[1]])),n}))}function LR(r,e){if(r.size>0)return r.size/8;if(r.size===0)return 0;{let t=kt(e instanceof Uint8Array?e:Uint8Array.from(e));return t+Fe(t)}}function D0(r){return"/"+r.trim().split("/").filter(e=>e).join("/")}function mE(r){return new Error("Error parsing address: "+r)}var PR=Symbol.for("nodejs.util.inspect.custom"),O0=Symbol.for("@multiformats/js-multiaddr/multiaddr"),OR=[Ee("dns").code,Ee("dns4").code,Ee("dns6").code,Ee("dnsaddr").code],Ep=class r{bytes;#e;#t;#r;#n;[O0]=!0;constructor(e){e==null&&(e="");let t;if(e instanceof Uint8Array)t=L0(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);t=fE(e)}else if(xE(e))t=L0(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=t.bytes,this.#e=t.string,this.#t=t.tuples,this.#r=t.stringTuples,this.#n=t.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let e,t,n,i,o="",s=Ee("tcp"),a=Ee("udp"),c=Ee("ip4"),u=Ee("ip6"),l=Ee("dns6"),p=Ee("ip6zone");for(let[d,f]of this.stringTuples())d===p.code&&(o=`%${f??""}`),OR.includes(d)&&(t=s.name,i=443,n=`${f??""}${o}`,e=d===l.code?6:4),(d===s.code||d===a.code)&&(t=Ee(d).name,i=parseInt(f??"")),(d===c.code||d===u.code)&&(t=Ee(d).name,n=`${f??""}${o}`,e=d===u.code?6:4);if(e==null||t==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:t,port:i}}protos(){return this.#t.map(([e])=>Object.assign({},Ee(e)))}protoCodes(){return this.#t.map(([e])=>e)}protoNames(){return this.#t.map(([e])=>Ee(e).name)}tuples(){return this.#t}stringTuples(){return this.#r}encapsulate(e){return e=new r(e),new r(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),n=this.toString(),i=n.lastIndexOf(t);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new r(n.slice(0,i))}decapsulateCode(e){let t=this.tuples();for(let n=t.length-1;n>=0;n--)if(t[n][0]===e)return new r(P0(t.slice(0,n)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([n,i])=>{n===Fs.p2p.code&&e.push([n,i]),n===Fs["p2p-circuit"].code&&(e=[])});let t=e.pop();if(t?.[1]!=null){let n=t[1];return n[0]==="Q"||n[0]==="1"?Nt(Ut.decode(`z${n}`),"base58btc"):Nt(Ci.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(e){return Z2(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(o=>o.resolvable);if(t==null)return[this];let n=gE.get(t.name);if(n==null)throw new O(`no available resolver for ${t.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(o=>new r(o))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let t=(e??this).protos();return!(t.length!==2||t[0].code!==4&&t[0].code!==41||t[1].code!==6&&t[1].code!==273)}[PR](){return`Multiaddr(${this.#e})`}};var gE=new Map;function xE(r){return!!r?.[O0]}function Ap(r){return new Ep(r)}var FR=K("dns4"),zR=K("dns6"),VR=K("dnsaddr"),mo=at(K("dns"),VR,FR,zR),Sp=at(K("ip4"),K("ip6")),zs=at(te(Sp,K("tcp")),te(mo,K("tcp"))),V0=te(Sp,K("udp")),MR=te(V0,K("utp")),$R=te(V0,K("quic")),Ec=at(te(zs,K("ws")),te(mo,K("ws"))),Ac=at(te(zs,K("wss")),te(mo,K("wss")),te(zs,K("tls"),K("ws")),te(mo,K("tls"),K("ws"))),F0=at(te(zs,K("http")),te(Sp,K("http")),te(mo,K("http"))),z0=at(te(zs,K("https")),te(Sp,K("https")),te(mo,K("https"))),yE=te(V0,K("webrtc"),K("certhash")),bE=at(te(yE,K("p2p")),yE),vE=at(te(Ec,K("p2p-webrtc-star"),K("p2p")),te(Ac,K("p2p-webrtc-star"),K("p2p")),te(Ec,K("p2p-webrtc-star")),te(Ac,K("p2p-webrtc-star"))),JX=at(te(Ec,K("p2p-websocket-star"),K("p2p")),te(Ac,K("p2p-websocket-star"),K("p2p")),te(Ec,K("p2p-websocket-star")),te(Ac,K("p2p-websocket-star"))),EE=at(te(F0,K("p2p-webrtc-direct"),K("p2p")),te(z0,K("p2p-webrtc-direct"),K("p2p")),te(F0,K("p2p-webrtc-direct")),te(z0,K("p2p-webrtc-direct"))),Sc=at(Ec,Ac,F0,z0,vE,EE,zs,MR,$R,mo,bE),ZX=at(te(Sc,K("p2p-stardust"),K("p2p")),te(Sc,K("p2p-stardust"))),Ri=at(te(Sc,K("p2p")),vE,EE,bE,K("p2p")),wE=at(te(Ri,K("p2p-circuit"),Ri),te(Ri,K("p2p-circuit")),te(K("p2p-circuit"),Ri),te(Sc,K("p2p-circuit")),te(K("p2p-circuit"),Sc),K("p2p-circuit")),AE=()=>at(te(wE,AE),wE),vc=AE(),jR=at(te(vc,Ri,vc),te(Ri,vc),te(vc,Ri),vc,Ri);function SE(r){function e(t){let n;try{n=Ap(t)}catch{return!1}let i=r(n.protoNames());return i===null?!1:i===!0||i===!1?i:i.length===0}return e}function te(...r){function e(t){if(t.length<r.length)return null;let n=t;return r.some(i=>(n=typeof i=="function"?i().partialMatch(t):i.partialMatch(t),Array.isArray(n)&&(t=n),n===null)),n}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:SE(e),partialMatch:e}}function at(...r){function e(n){let i=null;return r.some(o=>{let s=typeof o=="function"?o().partialMatch(n):o.partialMatch(n);return s!=null?(i=s,!0):!1}),i}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:SE(e),partialMatch:e}}function K(r){let e=r;function t(i){let o;try{o=Ap(i)}catch{return!1}let s=o.protoNames();return s.length===1&&s[0]===e}function n(i){return i.length===0?null:i[0]===e?i.slice(1):null}return{toString:function(){return e},matches:t,partialMatch:n}}var eU=Q(RE(),1);function UE(r){try{return tU(r)?!!ur.parse(r):r instanceof Uint8Array?!!ur.decode(r):!!ur.asCID(r)}catch{return!1}}function tU(r){return typeof r=="string"}var nU=r=>{let e=r.data;return e.startsWith('"')&&(e=e.substring(1)),e.endsWith('"')&&(e=e.substring(0,e.length-1)),e.replace("dnslink=","")},j0=(r,e)=>{let t=iU(r,e);return{ipfsPath:nU(t),answer:t}},iU=(r,e)=>{let t=e.Answer?.filter(n=>n.data.includes("dnslink=/ipfs")||n.data.includes("dnslink=/ipns")).pop();if(t==null)throw new O(`No dnslink records found for domain: ${r}`,"ERR_DNSLINK_NOT_FOUND");return t},kc=32,Vs=async(r,e,t,n={})=>{if(e===0)throw new Error("recursion limit exceeded");let i;try{i=await t(r,n)}catch(c){if(c.code!=="ENOTFOUND"&&c.code!=="ERR_DNSLINK_NOT_FOUND"&&c.code!=="ENODATA")throw c;r.startsWith("_dnslink.")?r=r.replace("_dnslink.",""):r=`_dnslink.${r}`,i=await t(r,n)}let o=i.replace("dnslink=",""),s=o.split("/")[2];return UE(s)?o:Vs(s,e-1,t,n)},oU=/^dnslink=.+$/,NE=async(r,e)=>{let i=(await r.resolveTxt(e)).flat().filter(o=>oU.test(o))[0];if(i==null)throw new O(`No dnslink records found for domain: ${e}`,"ERR_DNSLINK_NOT_FOUND");return i};var q0=Q(Fd(),1),K0=Q(PE(),1);function Bp(r,e,t){return`${r}?name=${e}&type=${t}`}async function OE(r,e){return await(await fetch(r,{headers:new Headers({accept:"application/dns-json"}),signal:e})).json()}function go(r,e){return`${e}_${r}`}var H0=Object.assign((0,q0.default)("dns-over-http-resolver"),{error:(0,q0.default)("dns-over-http-resolver:error")}),G0=class{_cache;_TXTcache;_servers;_request;_abortControllers;constructor(e={}){this._cache=new K0.default({max:e?.maxCache??100}),this._TXTcache=new K0.default({max:e?.maxCache??100}),this._servers=["https://cloudflare-dns.com/dns-query","https://dns.google/resolve"],this._request=e.request??OE,this._abortControllers=[]}cancel(){this._abortControllers.forEach(e=>{e.abort()})}getServers(){return this._servers}_getShuffledServers(){let e=[...this._servers];for(let t=e.length-1;t>0;t--){let n=Math.floor(Math.random()*t),i=e[t];e[t]=e[n],e[n]=i}return e}setServers(e){this._servers=e}async resolve(e,t="A"){switch(t){case"A":return this.resolve4(e);case"AAAA":return this.resolve6(e);case"TXT":return this.resolveTxt(e);default:throw new Error(`${t} is not supported`)}}async resolve4(e){let t="A",n=this._cache.get(go(e,t));if(n!=null)return n;let i=!1;for(let o of this._getShuffledServers()){let s=new AbortController;this._abortControllers.push(s);try{let a=await this._request(Bp(o,e,t),s.signal),c=a.Answer.map(l=>l.data),u=Math.min(...a.Answer.map(l=>l.TTL));return this._cache.set(go(e,t),c,{ttl:u}),c}catch{s.signal.aborted&&(i=!0),H0.error(`${o} could not resolve ${e} record ${t}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==s)}}throw i?Object.assign(new Error("queryA ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${t}`)}async resolve6(e){let t="AAAA",n=this._cache.get(go(e,t));if(n!=null)return n;let i=!1;for(let o of this._getShuffledServers()){let s=new AbortController;this._abortControllers.push(s);try{let a=await this._request(Bp(o,e,t),s.signal),c=a.Answer.map(l=>l.data),u=Math.min(...a.Answer.map(l=>l.TTL));return this._cache.set(go(e,t),c,{ttl:u}),c}catch{s.signal.aborted&&(i=!0),H0.error(`${o} could not resolve ${e} record ${t}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==s)}}throw i?Object.assign(new Error("queryAaaa ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${t}`)}async resolveTxt(e){let t="TXT",n=this._TXTcache.get(go(e,t));if(n!=null)return n;let i=!1;for(let o of this._getShuffledServers()){let s=new AbortController;this._abortControllers.push(s);try{let a=await this._request(Bp(o,e,t),s.signal),c=a.Answer.map(l=>[l.data.replace(/['"]+/g,"")]),u=Math.min(...a.Answer.map(l=>l.TTL));return this._TXTcache.set(go(e,t),c,{ttl:u}),c}catch{s.signal.aborted&&(i=!0),H0.error(`${o} could not resolve ${e} record ${t}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==s)}}throw i?Object.assign(new Error("queryTxt ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${t}`)}clearCache(){this._cache.clear(),this._TXTcache.clear()}},FE=G0;var VE=Q(W0(),1),Ni=class{lru;constructor(e){this.lru=(0,VE.default)(e)}get(e){let t=this.lru.get(e);if(t!=null){if(t.expire!=null&&t.expire<Date.now()){this.lru.remove(e);return}return t.value}}set(e,t,n){this.lru.set(e,{value:t,expire:Date.now()+n})}has(e){return this.get(e)!=null}remove(e){this.lru.remove(e)}clear(){this.lru.clear()}};var Y0=new Ni(1e3),uU=60*1e3,pU=new Ct({concurrency:4}),dU=async function(e,t={}){let n=new FE({maxCache:0});if(t.nocache!==!0&&Y0.has(e)){let o=Y0.get(e);if(o!=null)return t?.onProgress?.(new P("dnslink:cache",{detail:o})),o}t.onProgress?.(new P("dnslink:query",{detail:e}));let i=await pU.add(async()=>{let o=await NE(n,e);return t.onProgress?.(new P("dnslink:answer",{detail:o})),Y0.set(e,o,uU),o},{signal:t?.signal});if(i==null)throw new Error("No DNS response received");return i},ME=dU;function $E(){return async(r,e={})=>Vs(r,kc,ME,e)}var X0=class{routing;constructor(e){this.routing=e}async put(e,t,n={}){try{await this.routing.put(e,t,n)}catch(i){n.onProgress?.(new P("ipns:routing:helia:error",i))}}async get(e,t={}){try{return await this.routing.get(e,t)}catch(n){t.onProgress?.(new P("ipns:routing:helia:error",n))}throw new Error("Not found")}};function jE(r){return new X0(r)}var kp=globalThis.CustomEvent??Event;async function*xo(r,e={}){let t=e.concurrency??1/0;t<1&&(t=1/0);let n=e.ordered==null?!1:e.ordered,i=new EventTarget,o=[],s=He(),a=He(),c=!1,u,l=!1;i.addEventListener("task-complete",()=>{a.resolve()}),Promise.resolve().then(async()=>{try{for await(let f of r){if(o.length===t&&(s=He(),await s.promise),l)break;let h={done:!1};o.push(h),f().then(x=>{h.done=!0,h.ok=!0,h.value=x,i.dispatchEvent(new kp("task-complete"))},x=>{h.done=!0,h.err=x,i.dispatchEvent(new kp("task-complete"))})}c=!0,i.dispatchEvent(new kp("task-complete"))}catch(f){u=f,i.dispatchEvent(new kp("task-complete"))}});function p(){return n?o[0]?.done:!!o.find(f=>f.done)}function*m(){for(;o.length>0&&o[0].done;){let f=o[0];if(o.shift(),f.ok)yield f.value;else throw l=!0,s.resolve(),f.err;s.resolve()}}function*d(){for(;p();)for(let f=0;f<o.length;f++)if(o[f].done){let h=o[f];if(o.splice(f,1),f--,h.ok)yield h.value;else throw l=!0,s.resolve(),h.err;s.resolve()}}for(;;){if(p()||(a=He(),await a.promise),u!=null)throw u;if(n?yield*m():yield*d(),c&&o.length===0)break}}var Ic;(function(r){let e;r.codec=()=>(e==null&&(e=nr((t,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),t.key!=null&&t.key.byteLength>0&&(n.uint32(10),n.bytes(t.key)),t.value!=null&&t.value.byteLength>0&&(n.uint32(18),n.bytes(t.value)),t.timeReceived!=null&&t.timeReceived!==""&&(n.uint32(42),n.string(t.timeReceived)),i.lengthDelimited!==!1&&n.ldelim()},(t,n)=>{let i={key:new Uint8Array(0),value:new Uint8Array(0),timeReceived:""},o=n==null?t.len:t.pos+n;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.key=t.bytes();break;case 2:i.value=t.bytes();break;case 5:i.timeReceived=t.string();break;default:t.skipType(s&7);break}}return i})),e),r.encode=t=>rr(t,r.codec()),r.decode=t=>er(t,r.codec())})(Ic||(Ic={}));function HE(r){let e=r.getUTCFullYear(),t=String(r.getUTCMonth()+1).padStart(2,"0"),n=String(r.getUTCDate()).padStart(2,"0"),i=String(r.getUTCHours()).padStart(2,"0"),o=String(r.getUTCMinutes()).padStart(2,"0"),s=String(r.getUTCSeconds()).padStart(2,"0"),a=r.getUTCMilliseconds(),c=String(a*1e3*1e3).padStart(9,"0");return`${e}-${t}-${n}T${i}:${o}:${s}.${c}Z`}function qE(r){let e=new RegExp("(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})\\.(\\d+)Z"),t=String(r).trim().match(e);if(t==null)throw new Error("Invalid format");let n=parseInt(t[1],10),i=parseInt(t[2],10)-1,o=parseInt(t[3],10),s=parseInt(t[4],10),a=parseInt(t[5],10),c=parseInt(t[6],10),u=parseInt(t[7].slice(0,-6),10);return new Date(Date.UTC(n,i,o,s,a,c,u))}var Ms=class r{key;value;timeReceived;constructor(e,t,n){if(!(e instanceof Uint8Array))throw new Error("key must be a Uint8Array");if(!(t instanceof Uint8Array))throw new Error("value must be a Uint8Array");this.key=e,this.value=t,this.timeReceived=n}serialize(){return Ic.encode(this.prepareSerialize())}prepareSerialize(){return{key:this.key,value:this.value,timeReceived:HE(this.timeReceived)}}static deserialize(e){let t=Ic.decode(e);return new r(t.key,t.value,new Date(t.timeReceived))}static fromDeserialized(e){let t=qE(e.timeReceived);if(e.key==null)throw new Error("key missing from deserialized object");if(e.value==null)throw new Error("value missing from deserialized object");return new r(e.key,e.value,t)}};var KE;(function(r){r[r.SEND_QUERY=0]="SEND_QUERY",r[r.PEER_RESPONSE=1]="PEER_RESPONSE",r[r.FINAL_PEER=2]="FINAL_PEER",r[r.QUERY_ERROR=3]="QUERY_ERROR",r[r.PROVIDER=4]="PROVIDER",r[r.VALUE=5]="VALUE",r[r.ADD_PEER=6]="ADD_PEER",r[r.DIAL_PEER=7]="DIAL_PEER"})(KE||(KE={}));var GE;(function(r){r[r.PUT_VALUE=0]="PUT_VALUE",r[r.GET_VALUE=1]="GET_VALUE",r[r.ADD_PROVIDER=2]="ADD_PROVIDER",r[r.GET_PROVIDERS=3]="GET_PROVIDERS",r[r.FIND_NODE=4]="FIND_NODE",r[r.PING=5]="PING"})(GE||(GE={}));function J0(r){return new Xe("/dht/record/"+oe(r,"base32"),!1)}function WE(r){return{async put(e,t,n={}){try{let i=J0(e),o=new Ms(e,t,new Date);n.onProgress?.(new P("ipns:routing:datastore:put")),await r.put(i,o.serialize(),n)}catch(i){throw n.onProgress?.(new P("ipns:routing:datastore:error",i)),i}},async get(e,t={}){try{let n=J0(e);t.onProgress?.(new P("ipns:routing:datastore:get"));let i=await r.get(n,t);return Ms.deserialize(i).value}catch(n){throw t.onProgress?.(new P("ipns:routing:datastore:error",n)),n}},async has(e,t={}){let n=J0(e);return r.has(n,t)}}}var yo=ne("helia:ipns"),hU=60*1e3,YE=60*hU,mU=24*YE,Z0=23*YE,Q0=class{routers;localStore;timeout;defaultResolvers;constructor(e,t=[],n=[]){this.routers=[jE(e.routing),...t],this.localStore=WE(e.datastore),this.defaultResolvers=n.length>0?n:[$E()]}async publish(e,t,n={}){try{let i=1n,o=hs(e);if(await this.localStore.has(o,n)){let c=await this.localStore.get(o,n);i=wt(c).sequence+1n}let s=await Mb(e,t,i,n.lifetime??mU,n),a=_n(s);return await this.localStore.put(o,a,n),n.offline!==!0&&await Promise.all(this.routers.map(async c=>{await c.put(o,a,n)})),s}catch(i){throw n.onProgress?.(new P("ipns:publish:error",i)),i}}async resolve(e,t={}){let n=hs(e),i=await this.#t(n,t);return this.#e(i.value,t)}async resolveDns(e,t={}){let n=t.resolvers??this.defaultResolvers,i=await Promise.any(n.map(async o=>o(e,t)));return this.#e(i,t)}republish(e={}){if(this.timeout!=null)throw new Error("Republish is already running");e.signal?.addEventListener("abort",()=>{clearTimeout(this.timeout)});async function t(){let n=Date.now();e.onProgress?.(new P("ipns:republish:start"));let o=Date.now()-n,s=Z0-o;s<0&&(s=e.interval??Z0),setTimeout(()=>{t().catch(a=>{yo.error("error republishing",a)})},s)}this.timeout=setTimeout(()=>{t().catch(n=>{yo.error("error republishing",n)})},e.interval??Z0)}async#e(e,t={}){let n=e.split("/");try{let i=n[1];if(i==="ipns"){let{cid:o}=await this.resolve(mr(n[2]),t),s=n.slice(3).join("/");return{cid:o,path:s}}else if(i==="ipfs"){let o=z.parse(n[2]),s=n.slice(3).join("/");return{cid:o,path:s}}}catch(i){yo.error("error parsing ipfs path",i)}throw yo.error("invalid ipfs path %s",e),new Error("Invalid value")}async#t(e,t={}){let n=[this.localStore,...this.routers];t.offline===!0&&(n=[this.localStore]);let i=[],o=0;if(await Promise.all(n.map(async a=>{let c;try{c=await a.get(e,{...t,validate:!1})}catch(u){a===this.localStore&&u.code==="ERR_NOT_FOUND"?yo("did not have record locally"):yo.error("error finding IPNS record",u);return}try{await Vu(e,c),i.push(c)}catch(u){o++,yo.error("error finding IPNS record",u)}})),i.length===0)throw o>0?new O(`${o>1?`${o} records`:"Record"} found for routing key ${o>1?"were":"was"} invalid`,"ERR_RECORDS_FAILED_VALIDATION"):new O("Could not find record for routing key","ERR_NOT_FOUND");let s=i[Pv(e,i)];return await this.localStore.put(e,s,t),wt(s)}};function XE(r,{routers:e=[],resolvers:t=[]}={}){return new Q0(r,e,t)}var tN=Q(ug(),1),rN=Q(I3(),1);var pZ=new Ni(1e3),dZ=60*1e3;var bg=new Ni(1e3),nN=60*1e3;function Up(r){let e=new Ct({concurrency:4}),t=async(n,i={})=>{let o=new URLSearchParams;o.set("name",n),o.set("type","TXT");let s=o.toString();if(i.nocache!==!0&&bg.has(s)){let c=bg.get(s);if(c!=null)return i.onProgress?.(new P("dnslink:cache",{detail:c})),c}i.onProgress?.(new P("dnslink:query",{detail:n}));let a=await e.add(async()=>{let c=await fetch(`${r}?${o}`,{headers:{accept:"application/dns-json"},signal:i.signal});if(c.status!==200)throw new Error(`Unexpected HTTP status: ${c.status} - ${c.statusText}`);let u=new URL(c.url).search.slice(1),l=await c.json();i.onProgress?.(new P("dnslink:answer",{detail:l}));let{ipfsPath:p,answer:m}=j0(n,l);return bg.set(u,p,m.TTL??nN),p},{signal:i.signal});if(a==null)throw new Error("No DNS response received");return a};return async(n,i={})=>Vs(n,kc,t,i)}var vg=class{components;constructor(e){this.components=e}async add(e,t={}){let n=f1(e),i=await(t.hasher??ce).digest(n),o=z.createV1(Oo,i);return await this.components.blockstore.put(o,n,t),o}async get(e,t={}){let n=await this.components.blockstore.get(e,t);return h1(n)}};function _3(r){return new vg(r)}var Yg=Q(ke(),1);function iN(r){return r[Symbol.asyncIterator]!=null}function oN(r,e=1){return e=Number(e),iN(r)?async function*(){let t=[];if(e<1&&(e=1),e!==Math.round(e))throw new Error("Batch size must be an integer");for await(let n of r)for(t.push(n);t.length>=e;)yield t.slice(0,e),t=t.slice(e);for(;t.length>0;)yield t.slice(0,e),t=t.slice(e)}():function*(){let t=[];if(e<1&&(e=1),e!==Math.round(e))throw new Error("Batch size must be an integer");for(let n of r)for(t.push(n);t.length>=e;)yield t.slice(0,e),t=t.slice(e);for(;t.length>0;)yield t.slice(0,e),t=t.slice(e)}()}var Cc=oN;async function*Rc(r,e=1){for await(let t of Cc(r,e)){let n=t.map(async i=>i().then(o=>({ok:!0,value:o}),o=>({ok:!1,err:o})));for(let i=0;i<n.length;i++){let o=await n[i];if(o.ok)yield o.value;else throw o.err}}}var sN=262144,Uc=(r={})=>{let e=r.chunkSize??sN;return async function*(n){let i=new Xi,o=0,s=!1;for await(let a of n)for(i.append(a),o+=a.length;o>=e;)if(yield i.slice(0,e),s=!0,e===i.length)i=new Xi,o=0;else{let c=new Xi;c.append(i.sublist(e)),i=c,o-=e}(!s||o>0)&&(yield i.subarray(0,o))}};var Eg=Q(ke(),1);var _r;(function(r){let e;(function(i){i.Raw="Raw",i.Directory="Directory",i.File="File",i.Metadata="Metadata",i.Symlink="Symlink",i.HAMTShard="HAMTShard"})(e=r.DataType||(r.DataType={}));let t;(function(i){i[i.Raw=0]="Raw",i[i.Directory=1]="Directory",i[i.File=2]="File",i[i.Metadata=3]="Metadata",i[i.Symlink=4]="Symlink",i[i.HAMTShard=5]="HAMTShard"})(t||(t={})),function(i){i.codec=()=>Wi(t)}(e=r.DataType||(r.DataType={}));let n;r.codec=()=>(n==null&&(n=nr((i,o,s={})=>{if(s.lengthDelimited!==!1&&o.fork(),i.Type!=null&&(o.uint32(8),r.DataType.codec().encode(i.Type,o)),i.Data!=null&&(o.uint32(18),o.bytes(i.Data)),i.filesize!=null&&(o.uint32(24),o.uint64(i.filesize)),i.blocksizes!=null)for(let a of i.blocksizes)o.uint32(32),o.uint64(a);i.hashType!=null&&(o.uint32(40),o.uint64(i.hashType)),i.fanout!=null&&(o.uint32(48),o.uint64(i.fanout)),i.mode!=null&&(o.uint32(56),o.uint32(i.mode)),i.mtime!=null&&(o.uint32(66),Np.codec().encode(i.mtime,o)),s.lengthDelimited!==!1&&o.ldelim()},(i,o)=>{let s={blocksizes:[]},a=o==null?i.len:i.pos+o;for(;i.pos<a;){let c=i.uint32();switch(c>>>3){case 1:s.Type=r.DataType.codec().decode(i);break;case 2:s.Data=i.bytes();break;case 3:s.filesize=i.uint64();break;case 4:s.blocksizes.push(i.uint64());break;case 5:s.hashType=i.uint64();break;case 6:s.fanout=i.uint64();break;case 7:s.mode=i.uint32();break;case 8:s.mtime=Np.codec().decode(i,i.uint32());break;default:i.skipType(c&7);break}}return s})),n),r.encode=i=>rr(i,r.codec()),r.decode=i=>er(i,r.codec())})(_r||(_r={}));var Np;(function(r){let e;r.codec=()=>(e==null&&(e=nr((t,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),t.Seconds!=null&&(n.uint32(8),n.int64(t.Seconds)),t.FractionalNanoseconds!=null&&(n.uint32(21),n.fixed32(t.FractionalNanoseconds)),i.lengthDelimited!==!1&&n.ldelim()},(t,n)=>{let i={},o=n==null?t.len:t.pos+n;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.Seconds=t.int64();break;case 2:i.FractionalNanoseconds=t.fixed32();break;default:t.skipType(s&7);break}}return i})),e),r.encode=t=>rr(t,r.codec()),r.decode=t=>er(t,r.codec())})(Np||(Np={}));var T3;(function(r){let e;r.codec=()=>(e==null&&(e=nr((t,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),t.MimeType!=null&&(n.uint32(10),n.string(t.MimeType)),i.lengthDelimited!==!1&&n.ldelim()},(t,n)=>{let i={},o=n==null?t.len:t.pos+n;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.MimeType=t.string();break;default:t.skipType(s&7);break}}return i})),e),r.encode=t=>rr(t,r.codec()),r.decode=t=>er(t,r.codec())})(T3||(T3={}));var C3={Raw:"raw",Directory:"directory",File:"file",Metadata:"metadata",Symlink:"symlink",HAMTShard:"hamt-sharded-directory"},aN=["directory","hamt-sharded-directory"],R3=parseInt("0644",8),U3=parseInt("0755",8),X=class r{static unmarshal(e){let t=_r.decode(e),n=new r({type:C3[t.Type!=null?t.Type.toString():"File"],data:t.Data,blockSizes:t.blocksizes,mode:t.mode,mtime:t.mtime!=null?{secs:t.mtime.Seconds??0n,nsecs:t.mtime.FractionalNanoseconds}:void 0,fanout:t.fanout});return n._originalMode=t.mode??0,n}type;data;blockSizes;hashType;fanout;mtime;_mode;_originalMode;constructor(e={type:"file"}){let{type:t,data:n,blockSizes:i,hashType:o,fanout:s,mtime:a,mode:c}=e;if(t!=null&&!Object.values(C3).includes(t))throw(0,Eg.default)(new Error("Type: "+t+" is not valid"),"ERR_INVALID_TYPE");this.type=t??"file",this.data=n,this.hashType=o,this.fanout=s,this.blockSizes=i??[],this._originalMode=0,this.mode=c,this.mtime=a}set mode(e){e==null?this._mode=this.isDirectory()?U3:R3:this._mode=e&4095}get mode(){return this._mode}isDirectory(){return aN.includes(this.type)}addBlockSize(e){this.blockSizes.push(e)}removeBlockSize(e){this.blockSizes.splice(e,1)}fileSize(){if(this.isDirectory())return 0n;let e=0n;return this.blockSizes.forEach(t=>{e+=t}),this.data!=null&&(e+=BigInt(this.data.length)),e}marshal(){let e;switch(this.type){case"raw":e=_r.DataType.Raw;break;case"directory":e=_r.DataType.Directory;break;case"file":e=_r.DataType.File;break;case"metadata":e=_r.DataType.Metadata;break;case"symlink":e=_r.DataType.Symlink;break;case"hamt-sharded-directory":e=_r.DataType.HAMTShard;break;default:throw(0,Eg.default)(new Error(`Type: ${e} is not valid`),"ERR_INVALID_TYPE")}let t=this.data;(this.data==null||this.data.length===0)&&(t=void 0);let n;this.mode!=null&&(n=this._originalMode&4294963200|(this.mode??0),n===R3&&!this.isDirectory()&&(n=void 0),n===U3&&this.isDirectory()&&(n=void 0));let i;return this.mtime!=null&&(i={Seconds:this.mtime.secs,FractionalNanoseconds:this.mtime.nsecs}),_r.encode({Type:e,Data:t,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:n,mtime:i})}};var Tr=async(r,e,t)=>{t.codec==null&&(t.codec=Ke);let n=await ce.digest(r),i=z.create(t.cidVersion,t.codec.code,n);return await e.put(i,r,t),i};function N3(r){return async function*(t,n){let i=0n;for await(let o of t.content)yield async()=>{let s,a={codec:Ke,cidVersion:r.cidVersion,onProgress:r.onProgress};r.rawLeaves?(a.codec=tr,a.cidVersion=1):(s=new X({type:r.leafType,data:o}),o=fe({Data:s.marshal(),Links:[]}));let c=await Tr(o,n,a);return i+=BigInt(o.byteLength),r.onProgress?.(new P("unixfs:importer:progress:file:write",{bytesWritten:i,cid:c,path:t.path})),{cid:c,unixfs:s,size:BigInt(o.length),block:o}}}}var Ag=Q(ke(),1);var D3=async(r,e,t)=>{let n=new X({type:"directory",mtime:r.mtime,mode:r.mode}),i=fe(Ue({Data:n.marshal()})),o=await Tr(i,e,t),s=r.path;return{cid:o,path:s,unixfs:n,size:BigInt(i.length),originalPath:r.originalPath,block:i}};async function*cN(r,e,t){let n=-1,i;for await(let o of Rc(t.bufferImporter(r,e),t.blockWriteConcurrency)){if(n++,n===0){i={...o,single:!0};continue}else n===1&&i!=null&&(yield{...i,block:void 0,single:void 0},i=void 0);yield{...o,block:void 0}}i!=null&&(yield i)}function L3(r){return r.single===!0}var lN=(r,e,t)=>async function(i){if(i.length===1&&L3(i[0])&&t.reduceSingleLeafToSelf){let l=i[0],p=l.block;return L3(l)&&(r.mtime!==void 0||r.mode!==void 0)&&(l.unixfs=new X({type:"file",mtime:r.mtime,mode:r.mode,data:l.block}),p={Data:l.unixfs.marshal(),Links:[]},l.block=fe(Ue(p)),l.cid=await Tr(l.block,e,{...t,cidVersion:t.cidVersion}),l.size=BigInt(l.block.length)),t.onProgress?.(new P("unixfs:importer:progress:file:layout",{cid:l.cid,path:l.originalPath})),{cid:l.cid,path:r.path,unixfs:l.unixfs,size:l.size,originalPath:l.originalPath}}let o=new X({type:"file",mtime:r.mtime,mode:r.mode}),s=i.filter(l=>l.cid.code===je&&l.size>0||l.unixfs!=null&&l.unixfs.data==null&&l.unixfs.fileSize()>0n?!0:!!l.unixfs?.data?.length).map(l=>l.cid.code===je?(o.addBlockSize(l.size),{Name:"",Tsize:Number(l.size),Hash:l.cid}):(l.unixfs==null||l.unixfs.data==null?o.addBlockSize(l.unixfs?.fileSize()??0n):o.addBlockSize(BigInt(l.unixfs.data.length)),{Name:"",Tsize:Number(l.size),Hash:l.cid})),a={Data:o.marshal(),Links:s},c=fe(Ue(a)),u=await Tr(c,e,t);return t.onProgress?.(new P("unixfs:importer:progress:file:layout",{cid:u,path:r.originalPath})),{cid:u,path:r.path,unixfs:o,size:BigInt(c.length+a.Links.reduce((l,p)=>l+(p.Tsize??0),0)),originalPath:r.originalPath,block:c}},P3=async(r,e,t)=>t.layout(cN(r,e,t),lN(r,e,t));function uN(r){return Symbol.iterator in r}function pN(r){return Symbol.asyncIterator in r}function dN(r){try{if(r instanceof Uint8Array)return async function*(){yield r}();if(uN(r))return async function*(){yield*r}();if(pN(r))return r}catch{throw(0,Ag.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}throw(0,Ag.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}function O3(r){return async function*(t,n){for await(let i of t){let o;if(i.path!=null&&(o=i.path,i.path=i.path.split("/").filter(s=>s!=null&&s!==".").join("/")),fN(i)){let s={path:i.path,mtime:i.mtime,mode:i.mode,content:async function*(){let a=0n;for await(let c of r.chunker(r.chunkValidator(dN(i.content)))){let u=BigInt(c.byteLength);a+=u,r.onProgress?.(new P("unixfs:importer:progress:file:read",{bytesRead:a,chunkSize:u,path:i.path})),yield c}}(),originalPath:o};yield async()=>P3(s,n,r)}else if(i.path!=null){let s={path:i.path,mtime:i.mtime,mode:i.mode,originalPath:o};yield async()=>D3(s,n,r)}else throw new Error("Import candidate must have content or path or both")}}}function fN(r){return r.content!=null}var Sg=Q(ke(),1);var F3=()=>async function*(e){for await(let t of e){if(t.length===void 0)throw(0,Sg.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT");if(typeof t=="string"||t instanceof String)yield Z(t.toString());else if(Array.isArray(t))yield Uint8Array.from(t);else if(t instanceof Uint8Array)yield t;else throw(0,Sg.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}};var hN=174;function Nc(r){let e=r?.maxChildrenPerNode??hN;return async function t(n,i){let o=[];for await(let s of Cc(n,e))o.push(await i(s));return o.length>1?t(o,i):o[0]}}var nn=class{options;root;dir;path;dirty;flat;parent;parentKey;unixfs;mode;mtime;cid;size;nodeSize;constructor(e,t){this.options=t??{},this.root=e.root,this.dir=e.dir,this.path=e.path,this.dirty=e.dirty,this.flat=e.flat,this.parent=e.parent,this.parentKey=e.parentKey,this.unixfs=e.unixfs,this.mode=e.mode,this.mtime=e.mtime}},Dc=z.parse("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"),Lc=z.parse("zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi");var Eo=class extends nn{_children;constructor(e,t){super(e,t),this._children=new Map}async put(e,t){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,this._children.set(e,t)}async get(e){return Promise.resolve(this._children.get(e))}childCount(){return this._children.size}directChildrenCount(){return this.childCount()}onlyChild(){return this._children.values().next().value}async*eachChildSeries(){for(let[e,t]of this._children.entries())yield{key:e,child:t}}estimateNodeSize(){if(this.nodeSize!==void 0)return this.nodeSize;this.nodeSize=0;for(let[e,t]of this._children.entries())t.size!=null&&t.cid!=null&&(this.nodeSize+=e.length+(this.options.cidVersion===1?Lc.bytes.byteLength:Dc.bytes.byteLength));return this.nodeSize}async*flush(e){let t=[];for(let[c,u]of this._children.entries()){let l=u;if(u instanceof nn)for await(let p of u.flush(e))l=p,yield p;l.size!=null&&l.cid!=null&&t.push({Name:c,Tsize:Number(l.size),Hash:l.cid})}let n=new X({type:"directory",mtime:this.mtime,mode:this.mode}),i={Data:n.marshal(),Links:t},o=fe(Ue(i)),s=await Tr(o,e,this.options),a=o.length+i.Links.reduce((c,u)=>c+(u.Tsize==null?0:u.Tsize),0);this.cid=s,this.size=a,yield{cid:s,unixfs:n,path:this.path,size:BigInt(a)}}};var Lp=Q(M3(),1);function mN(r){let e=new Array(4);for(let t=0;t<4;t++)e[t]=r&255,r=r>>8;return new Uint8Array(e)}var kQ=Hi({name:"murmur3-32",code:35,encode:r=>mN(Lp.default.x86.hash32(r))}),Ao=Hi({name:"murmur3-128",code:34,encode:r=>To.fromHex(Lp.default.x64.hash128(r))}),IQ=Hi({name:"murmur3-x64-64",code:34,encode:r=>To.fromHex(Lp.default.x64.hash128(r)).subarray(0,8)});var f6=Q(Pp(),1);function Gs(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}var Tg={};$(Tg,{base10:()=>SN});function wN(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function p(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var h=0,x=0,g=0,w=f.length;g!==w&&f[g]===0;)g++,h++;for(var y=(w-g)*l+1>>>0,E=new Uint8Array(y);g!==w;){for(var B=f[g],S=0,b=y-1;(B!==0||S<x)&&b!==-1;b--,S++)B+=256*E[b]>>>0,E[b]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");x=S,g++}for(var v=y-x;v!==y&&E[v]===0;)v++;for(var k=c.repeat(h);v<y;++v)k+=r.charAt(E[v]);return k}function m(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var h=0;if(f[h]!==" "){for(var x=0,g=0;f[h]===c;)x++,h++;for(var w=(f.length-h)*u+1>>>0,y=new Uint8Array(w);f[h];){var E=t[f.charCodeAt(h)];if(E===255)return;for(var B=0,S=w-1;(E!==0||B<g)&&S!==-1;S--,B++)E+=a*y[S]>>>0,y[S]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,h++}if(f[h]!==" "){for(var b=w-g;b!==w&&y[b]===0;)b++;for(var v=new Uint8Array(x+(w-b)),k=x;b!==w;)v[k++]=y[b++];return v}}}function d(f){var h=m(f);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:m,decode:d}}var bN=wN,vN=bN,H3=vN;var NQ=new Uint8Array(0);var q3=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},Wn=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var K3=r=>new TextEncoder().encode(r),G3=r=>new TextDecoder().decode(r);var Bg=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},kg=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Y3(this,e)}},Ig=class{constructor(e){this.decoders=e}or(e){return Y3(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Y3=(r,e)=>new Ig({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),_g=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Bg(e,t,n),this.decoder=new kg(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Ws=({name:r,prefix:e,encode:t,decode:n})=>new _g(r,e,t,n),Pi=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=H3(t,e);return Ws({prefix:r,name:e,encode:n,decode:o=>Wn(i(o))})},EN=(r,e,t,n)=>{let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*t/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let p=i[r[l]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|p,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},AN=(r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,o+=e[i&a>>s];if(s&&(o+=e[i&a<<t-s]),n)for(;o.length*t&7;)o+="=";return o},Pe=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Ws({prefix:e,name:r,encode(i){return AN(i,n,t)},decode(i){return EN(i,n,t,r)}});var SN=Pi({prefix:"9",name:"base10",alphabet:"0123456789"});var Cg={};$(Cg,{base16:()=>BN,base16upper:()=>kN});var BN=Pe({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),kN=Pe({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Rg={};$(Rg,{base2:()=>IN});var IN=Pe({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ug={};$(Ug,{base256emoji:()=>UN});var X3=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),_N=X3.reduce((r,e,t)=>(r[t]=e,r),[]),TN=X3.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function CN(r){return r.reduce((e,t)=>(e+=_N[t],e),"")}function RN(r){let e=[];for(let t of r){let n=TN[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var UN=Ws({prefix:"\u{1F680}",name:"base256emoji",encode:CN,decode:RN});var Ng={};$(Ng,{base32:()=>Ys,base32hex:()=>PN,base32hexpad:()=>FN,base32hexpadupper:()=>zN,base32hexupper:()=>ON,base32pad:()=>DN,base32padupper:()=>LN,base32upper:()=>NN,base32z:()=>VN});var Ys=Pe({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),NN=Pe({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),DN=Pe({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),LN=Pe({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),PN=Pe({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ON=Pe({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),FN=Pe({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),zN=Pe({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),VN=Pe({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Dg={};$(Dg,{base36:()=>MN,base36upper:()=>$N});var MN=Pi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),$N=Pi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Lg={};$(Lg,{base58btc:()=>on,base58flickr:()=>jN});var on=Pi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),jN=Pi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Pg={};$(Pg,{base64:()=>HN,base64pad:()=>qN,base64url:()=>KN,base64urlpad:()=>GN});var HN=Pe({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),qN=Pe({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),KN=Pe({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),GN=Pe({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Og={};$(Og,{base8:()=>WN});var WN=Pe({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Fg={};$(Fg,{identity:()=>YN});var YN=Ws({prefix:"\0",name:"identity",encode:r=>G3(r),decode:r=>K3(r)});var WQ=new TextEncoder,YQ=new TextDecoder;var Vg={};$(Vg,{identity:()=>yD});var ZN=Q3,J3=128,QN=127,eD=~QN,tD=Math.pow(2,31);function Q3(r,e,t){e=e||[],t=t||0;for(var n=t;r>=tD;)e[t++]=r&255|J3,r/=128;for(;r&eD;)e[t++]=r&255|J3,r>>>=7;return e[t]=r|0,Q3.bytes=t-n+1,e}var rD=zg,nD=128,Z3=127;function zg(r,n){var t=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw zg.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=i<28?(s&Z3)<<i:(s&Z3)*Math.pow(2,i),i+=7}while(s>=nD);return zg.bytes=o-n,t}var iD=Math.pow(2,7),oD=Math.pow(2,14),sD=Math.pow(2,21),aD=Math.pow(2,28),cD=Math.pow(2,35),lD=Math.pow(2,42),uD=Math.pow(2,49),pD=Math.pow(2,56),dD=Math.pow(2,63),fD=function(r){return r<iD?1:r<oD?2:r<sD?3:r<aD?4:r<cD?5:r<lD?6:r<uD?7:r<pD?8:r<dD?9:10},hD={encode:ZN,decode:rD,encodingLength:fD},mD=hD,Oc=mD;var Fc=(r,e=0)=>[Oc.decode(r,e),Oc.decode.bytes],Xs=(r,e,t=0)=>(Oc.encode(r,e,t),e),Js=r=>Oc.encodingLength(r);var So=(r,e)=>{let t=e.byteLength,n=Js(r),i=n+Js(t),o=new Uint8Array(i+t);return Xs(r,o,0),Xs(t,o,n),o.set(e,i),new Zs(r,t,e,o)},e6=r=>{let e=Wn(r),[t,n]=Fc(e),[i,o]=Fc(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Zs(t,i,s,e)},t6=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&q3(r.bytes,t.bytes)}},Zs=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};var r6=0,gD="identity",n6=Wn,xD=r=>So(r6,n6(r)),yD={code:r6,name:gD,encode:n6,digest:xD};var jg={};$(jg,{sha256:()=>wD,sha512:()=>bD});var $g=({name:r,code:e,encode:t})=>new Mg(r,e,t),Mg=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?So(this.code,t):t.then(n=>So(this.code,n))}else throw Error("Unknown type, must be binary type")}};var o6=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),wD=$g({name:"sha2-256",code:18,encode:o6("SHA-256")}),bD=$g({name:"sha2-512",code:19,encode:o6("SHA-512")});var s6=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return ED(t,Hg(r),e||on.encoder);default:return AD(t,Hg(r),e||Ys.encoder)}};var a6=new WeakMap,Hg=r=>{let e=a6.get(r);if(e==null){let t=new Map;return a6.set(r,t),t}return e},Fp=class r{constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==Vc)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==SD)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=So(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&t6(e.multihash,n.multihash)}toString(e){return s6(this,e)}toJSON(){return{"/":s6(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:o,bytes:s}=t;return new r(n,i,o,s||c6(n,i,o.bytes))}else if(t[BD]===!0){let{version:n,multihash:i,code:o}=t,s=e6(i);return r.create(n,o,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==Vc)throw new Error(`Version 0 CID must use dag-pb (code: ${Vc}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=c6(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,Vc,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=Wn(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new Zs(t.multihashCode,t.digestSize,o,i);return[t.version===0?r.createV0(s):r.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[p,m]=Fc(e.subarray(t));return t+=m,p},i=n(),o=Vc;if(i===18?(i=0,t=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,a=n(),c=n(),u=t+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[n,i]=vD(e,t),o=r.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Hg(o).set(n,e),o}},vD=(r,e)=>{switch(r[0]){case"Q":{let t=e||on;return[on.prefix,t.decode(`${on.prefix}${r}`)]}case on.prefix:{let t=e||on;return[on.prefix,t.decode(r)]}case Ys.prefix:{let t=e||Ys;return[Ys.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},ED=(r,e,t)=>{let{prefix:n}=t;if(n!==on.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let o=t.encode(r).slice(1);return e.set(n,o),o}else return i},AD=(r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let o=t.encode(r);return e.set(n,o),o}else return i},Vc=112,SD=18,c6=(r,e,t)=>{let n=Js(r),i=n+Js(e),o=new Uint8Array(i+t.byteLength);return Xs(r,o,0),Xs(e,o,n),o.set(t,i),o},BD=Symbol.for("@ipld/js-cid/CID");var qg={...Fg,...Rg,...Og,...Tg,...Cg,...Ng,...Dg,...Lg,...Pg,...Ug},pee={...jg,...Vg};function zp(r=0){return globalThis.Buffer?.allocUnsafe!=null?Gs(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function u6(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var l6=u6("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Kg=u6("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=zp(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),kD={utf8:l6,"utf-8":l6,hex:qg.base16,latin1:Kg,ascii:Kg,binary:Kg,...qg},p6=kD;function d6(r,e="utf8"){let t=p6[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Gs(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var Jt=class r{constructor(e,t,n=0){this._options=e,this._popCount=0,this._parent=t,this._posAtParent=n,this._children=new f6.default,this.key=null}async put(e,t){let n=await this._findNewBucketAndPos(e);await n.bucket._putAt(n,e,t)}async get(e){let t=await this._findChild(e);if(t!=null)return t.value}async del(e){let t=await this._findPlace(e),n=t.bucket._at(t.pos);n!=null&&n.key===e&&t.bucket._delAt(t.pos)}leafCount(){return this._children.compactArray().reduce((t,n)=>n instanceof r?t+n.leafCount():t+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){let e=this._children.compactArray();for(let t of e)t instanceof r?yield*t.eachLeafSeries():yield t}serialize(e,t){let n=[];return t(this._children.reduce((i,o,s)=>(o!=null&&(o instanceof r?i.push(o.serialize(e,t)):i.push(e(o,s))),i),n))}async asyncTransform(e,t){return await h6(this,e,t)}toJSON(){return this.serialize(_D,TD)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(e){let t=await this._findPlace(e),n=t.bucket._at(t.pos);if(!(n instanceof r)&&n!=null&&n.key===e)return n}async _findPlace(e){let t=this._options.hash(typeof e=="string"?d6(e):e),n=await t.take(this._options.bits),i=this._children.get(n);return i instanceof r?await i._findPlace(t):{bucket:this,pos:n,hash:t,existingChild:i}}async _findNewBucketAndPos(e){let t=await this._findPlace(e);if(t.existingChild!=null&&t.existingChild.key!==e){let n=new r(this._options,t.bucket,t.pos);t.bucket._putObjectAt(t.pos,n);let i=await n._findPlace(t.existingChild.hash);return i.bucket._putAt(i,t.existingChild.key,t.existingChild.value),await n._findNewBucketAndPos(t.hash)}return t}_putAt(e,t,n){this._putObjectAt(e.pos,{key:t,value:n,hash:e.hash})}_putObjectAt(e,t){this._children.get(e)==null&&this._popCount++,this._children.set(e,t)}_delAt(e){if(e===-1)throw new Error("Invalid position");this._children.get(e)!=null&&this._popCount--,this._children.unset(e),this._level()}_level(){if(this._parent!=null&&this._popCount<=1)if(this._popCount===1){let e=this._children.find(ID);if(e!=null&&!(e instanceof r)){let t=e.hash;t.untake(this._options.bits);let n={pos:this._posAtParent,hash:t,bucket:this._parent};this._parent._putAt(n,e.key,e.value)}}else this._parent._delAt(this._posAtParent)}_at(e){return this._children.get(e)}};function ID(r){return!!r}function _D(r,e){return r.key}function TD(r){return r}async function h6(r,e,t){let n=[];for(let i of r._children.compactArray())if(i instanceof Jt)await h6(i,e,t);else{let o=await e(i);n.push({bitField:r._children.bitField(),children:o})}return await t(n)}var CD=[255,254,252,248,240,224,192,128],RD=[1,3,7,15,31,63,127,255],Vp=class{constructor(e){this._value=e,this._currentBytePos=e.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take(e){let t=e,n=0;for(;t>0&&this._haveBits();){let i=this._value[this._currentBytePos],o=this._currentBitPos+1,s=Math.min(o,t),a=UD(i,o-s,s);n=(n<<s)+a,t-=s,this._currentBitPos-=s,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return n}untake(e){for(this._currentBitPos+=e;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function UD(r,e,t){let n=ND(e,t);return(r&n)>>>e}function ND(r,e){return CD[r]&RD[Math.min(e+r-1,7)]}function m6(r,e){e==null&&(e=r.reduce((i,o)=>i+o.length,0));let t=zp(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return Gs(t)}function g6(r){function e(t){return t instanceof Mp?t:new Mp(t,r)}return e}var Mp=class{constructor(e,t){if(!(e instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=e,this._hashFn=t,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(e){let t=e;for(;this._availableBits<t;)await this._produceMoreBits();let n=0;for(;t>0;){let i=this._buffers[this._currentBufferIndex],o=Math.min(i.availableBits(),t),s=i.take(o);n=(n<<o)+s,t-=o,this._availableBits-=o,i.availableBits()===0&&this._currentBufferIndex++}return n}untake(e){let t=e;for(;t>0;){let n=this._buffers[this._currentBufferIndex],i=Math.min(n.totalBits()-n.availableBits(),t);n.untake(i),t-=i,this._availableBits+=i,this._currentBufferIndex>0&&n.totalBits()===n.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;let e=this._depth>0?m6([this._value,Uint8Array.from([this._depth])]):this._value,t=await this._hashFn(e),n=new Vp(t);this._buffers.push(n),this._availableBits+=n.availableBits()}};function Qs(r){if(r==null||r.hashFn==null)throw new Error("please define an options.hashFn");let e={bits:r.bits??8,hash:g6(r.hashFn)};return new Jt(e)}async function DD(r){return(await Ao.encode(r)).slice(0,8).reverse()}var x6=BigInt(34),LD=8,Gg=class extends nn{_bucket;constructor(e,t){super(e,t),this._bucket=Qs({hashFn:DD,bits:t.shardFanoutBits??LD})}async put(e,t){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,await this._bucket.put(e,t)}async get(e){return this._bucket.get(e)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(let{key:e,value:t}of this._bucket.eachLeafSeries())yield{key:e,child:t}}estimateNodeSize(){return this.nodeSize!==void 0?this.nodeSize:(this.nodeSize=b6(this._bucket,this,this.options),this.nodeSize)}async*flush(e){for await(let t of w6(this._bucket,e,this,this.options))yield{...t,path:this.path}}},y6=Gg;async function*w6(r,e,t,n){let i=r._children,o=(r.tableSize()-1).toString(16).length,s=[],a=0n;for(let f=0;f<i.length;f++){let h=i.get(f);if(h==null)continue;let x=f.toString(16).toUpperCase().padStart(o,"0");if(h instanceof Jt){let g;for await(let w of w6(h,e,null,n))g=w;if(g==null)throw new Error("Could not flush sharded directory, no subshard found");s.push({Name:x,Tsize:Number(g.size),Hash:g.cid}),a+=g.size}else if(PD(h.value)){let g=h.value,w;for await(let E of g.flush(e))w=E,yield w;if(w==null)throw new Error("Did not flush dir");let y=x+h.key;s.push({Name:y,Tsize:Number(w.size),Hash:w.cid}),a+=w.size}else{let g=h.value;if(g.cid==null)continue;let w=x+h.key,y=g.size;s.push({Name:w,Tsize:Number(y),Hash:g.cid}),a+=BigInt(y??0)}}let c=Uint8Array.from(i.bitField().reverse()),u=new X({type:"hamt-sharded-directory",data:c,fanout:BigInt(r.tableSize()),hashType:x6,mtime:t?.mtime,mode:t?.mode}),l={Data:u.marshal(),Links:s},p=fe(Ue(l)),m=await Tr(p,e,n),d=BigInt(p.byteLength)+a;yield{cid:m,unixfs:u,size:d}}function PD(r){return typeof r.flush=="function"}function b6(r,e,t){let n=r._children,i=(r.tableSize()-1).toString(16).length,o=[];for(let u=0;u<n.length;u++){let l=n.get(u);if(l==null)continue;let p=u.toString(16).toUpperCase().padStart(i,"0");if(l instanceof Jt){let m=b6(l,null,t);o.push({Name:p,Tsize:Number(m),Hash:t.cidVersion===0?Dc:Lc})}else if(typeof l.value.flush=="function"){let d=l.value.nodeSize();o.push({Name:p+l.key,Tsize:Number(d),Hash:t.cidVersion===0?Dc:Lc})}else{let m=l.value;if(m.cid==null)continue;let d=p+l.key,f=m.size;o.push({Name:d,Tsize:Number(f),Hash:m.cid})}}let s=Uint8Array.from(n.bitField().reverse()),a=new X({type:"hamt-sharded-directory",data:s,fanout:BigInt(r.tableSize()),hashType:x6,mtime:e?.mtime,mode:e?.mode});return fe(Ue({Data:a.marshal(),Links:o})).length}async function Wg(r,e,t,n){let i=e;e instanceof Eo&&e.estimateNodeSize()>t&&(i=await OD(e,n));let o=i.parent;if(o!=null){if(i!==e){if(r!=null&&(r.parent=i),i.parentKey==null)throw new Error("No parent key found");await o.put(i.parentKey,i)}return Wg(i,o,t,n)}return i}async function OD(r,e){let t=new y6({root:r.root,dir:!0,parent:r.parent,parentKey:r.parentKey,path:r.path,dirty:r.dirty,flat:!1,mtime:r.mtime,mode:r.mode},e);for await(let{key:n,child:i}of r.eachChildSeries())await t.put(n,i);return t}var v6=(r="")=>r.split(/(?<!\\)\//).filter(Boolean);async function FD(r,e,t){let n=v6(r.path??""),i=n.length-1,o=e,s="";for(let a=0;a<n.length;a++){let c=n[a];s+=`${s!==""?"/":""}${c}`;let u=a===i;if(o.dirty=!0,o.cid=void 0,o.size=void 0,u)await o.put(c,r),e=await Wg(null,o,t.shardSplitThresholdBytes,t);else{let l=await o.get(c);(l==null||!(l instanceof nn))&&(l=new Eo({root:!1,dir:!0,parent:o,parentKey:c,path:s,dirty:!0,flat:!0,mtime:l?.unixfs?.mtime,mode:l?.unixfs?.mode},t)),await o.put(c,l),o=l}}return e}async function*E6(r,e){if(!(r instanceof nn)){r.unixfs?.isDirectory()===!0&&(yield r);return}yield*r.flush(e)}function A6(r){return async function*(t,n){let i=new Eo({root:!0,dir:!0,path:"",dirty:!0,flat:!0},r),o,s=!1;for await(let a of t){if(a==null)continue;let c=`${a.originalPath??""}`.split("/")[0];c!=null&&c!==""&&(o==null?(o=c,s=!0):o!==c&&(s=!1)),i=await FD(a,i,r),(a.unixfs==null||!a.unixfs.isDirectory())&&(yield a)}if(r.wrapWithDirectory||s&&i.childCount()>1)yield*E6(i,n);else for await(let a of i.eachChildSeries())a!=null&&(yield*E6(a.child,n))}}async function*Oi(r,e,t={}){let n;Symbol.asyncIterator in r||Symbol.iterator in r?n=r:n=[r];let i=t.wrapWithDirectory??!1,o=t.shardSplitThresholdBytes??262144,s=t.shardFanoutBits??8,a=t.cidVersion??1,c=t.rawLeaves??!0,u=t.leafType??"file",l=t.fileImportConcurrency??50,p=t.blockWriteConcurrency??10,m=t.reduceSingleLeafToSelf??!0,d=t.chunker??Uc(),f=t.chunkValidator??F3(),h=t.dagBuilder??O3({chunker:d,chunkValidator:f,wrapWithDirectory:i,layout:t.layout??Nc(),bufferImporter:t.bufferImporter??N3({cidVersion:a,rawLeaves:c,leafType:u,onProgress:t.onProgress}),blockWriteConcurrency:p,reduceSingleLeafToSelf:m,cidVersion:a,onProgress:t.onProgress}),x=t.treeBuilder??A6({wrapWithDirectory:i,shardSplitThresholdBytes:o,shardFanoutBits:s,cidVersion:a,onProgress:t.onProgress});for await(let g of x(Rc(h(n,e),l),e))yield{cid:g.cid,path:g.path,unixfs:g.unixfs,size:g.size}}async function $p(r,e,t={}){let n=await so(Oi([r],e,t));if(n==null)throw(0,Yg.default)(new Error("Nothing imported"),"ERR_INVALID_PARAMS");return n}async function S6(r,e,t={}){let n=await so(Oi([r],e,t));if(n==null)throw(0,Yg.default)(new Error("Nothing imported"),"ERR_INVALID_PARAMS");return n}async function B6(r,e,t={}){return $p({content:r},e,t)}async function k6(r,e,t={}){return $p({content:r},e,t)}var HD=Q(ke(),1),qD=Q(z6(),1);var Hc={cidVersion:1,rawLeaves:!0,layout:Nc({maxChildrenPerNode:1024}),chunker:Uc({chunkSize:1048576})};async function*V6(r,e,t={}){yield*Oi(r,e,{...Hc,...t})}async function M6(r,e,t={}){let{cid:n}=await B6(r,e,{...Hc,...t});return n}async function $6(r,e,t={}){let{cid:n}=await k6(r,e,{...Hc,...t});return n}async function j6(r,e,t={}){let{cid:n}=await $p(r,e,{...Hc,...t});return n}async function H6(r,e,t={}){let{cid:n}=await S6({...r,path:r.path??"-"},e,{...Hc,...t});return n}var Hp=Q(ke(),1);function KD(r){return r[Symbol.asyncIterator]!=null}function GD(r){if(KD(r))return(async()=>{let t;for await(let n of r)t=n;return t})();let e;for(let t of r)e=t;return e}var Fi=GD;var a4=Q(ke(),1);var q6=Q(ke(),1);var WD=async(r,e,t,n,i,o,s,a)=>{let c=await s.get(r,a),u=Qu(c),l=u,p=t;for(;n.length>0;){let m=n[0];if(m in l){n.shift(),p=`${p}/${m}`;let d=z.asCID(l[m]);if(d!=null)return{entry:{type:"object",name:e,path:t,cid:r,node:c,depth:o,size:BigInt(c.length),content:async function*(){yield u}},next:{cid:d,name:m,path:p,toResolve:n}};l=l[m]}else throw(0,q6.default)(new Error(`No property named ${m} found in cbor node ${r}`),"ERR_NO_PROP")}return{entry:{type:"object",name:e,path:t,cid:r,node:c,depth:o,size:BigInt(c.length),content:async function*(){yield u}}}},K6=WD;var G6=Q(ke(),1);var YD=async(r,e,t,n,i,o,s,a)=>{let c=await s.get(r,a),u=rp(c),l=u,p=t;for(;n.length>0;){let m=n[0];if(m in l){n.shift(),p=`${p}/${m}`;let d=z.asCID(l[m]);if(d!=null)return{entry:{type:"object",name:e,path:t,cid:r,node:c,depth:o,size:BigInt(c.length),content:async function*(){yield u}},next:{cid:d,name:m,path:p,toResolve:n}};l=l[m]}else throw(0,G6.default)(new Error(`No property named ${m} found in dag-json node ${r}`),"ERR_NO_PROP")}return{entry:{type:"object",name:e,path:t,cid:r,node:c,depth:o,size:BigInt(c.length),content:async function*(){yield u}}}},W6=YD;var Y6=Q(ke(),1);function XD(r,e,t,n){let i=BigInt(r.length),o=BigInt(e+i);return t>=o||n<e?new Uint8Array(0):(n>=e&&n<o&&(r=r.subarray(0,Number(n-e))),t>=e&&t<o&&(r=r.subarray(Number(t-e))),r)}var Bo=XD;var qc=Q(ke(),1),JD=(r,e=0,t=r)=>{let n=BigInt(r),i=BigInt(e??0),o=BigInt(t);if(o!==n&&(o=i+o),o>n&&(o=n),i<0n)throw(0,qc.default)(new Error("Offset must be greater than or equal to 0"),"ERR_INVALID_PARAMS");if(i>n)throw(0,qc.default)(new Error("Offset must be less than the file size"),"ERR_INVALID_PARAMS");if(o<0n)throw(0,qc.default)(new Error("Length must be greater than or equal to 0"),"ERR_INVALID_PARAMS");if(o>n)throw(0,qc.default)(new Error("Length must be less than the file size"),"ERR_INVALID_PARAMS");return{start:i,end:o}},ea=JD;var ZD=r=>{async function*e(t={}){let{start:n,end:i}=ea(r.length,t.offset,t.length),o=Bo(r,0n,n,i);t.onProgress?.(new P("unixfs:exporter:progress:identity",{bytesRead:BigInt(o.byteLength),totalBytes:i-n,fileSize:BigInt(r.byteLength)})),yield o}return e},QD=async(r,e,t,n,i,o,s,a)=>{if(n.length>0)throw(0,Y6.default)(new Error(`No link named ${t} found in raw node ${r}`),"ERR_NOT_FOUND");let c=Ot(r.multihash.bytes);return{entry:{type:"identity",name:e,path:t,cid:r,content:ZD(c.digest),depth:o,size:BigInt(c.digest.length),node:c.digest}}},X6=QD;var J6=Q(ke(),1);var eL=r=>{async function*e(t={}){let{start:n,end:i}=ea(r.length,t.offset,t.length),o=Bo(r,0n,n,i);t.onProgress?.(new P("unixfs:exporter:progress:raw",{bytesRead:BigInt(o.byteLength),totalBytes:i-n,fileSize:BigInt(r.byteLength)})),yield o}return e},tL=async(r,e,t,n,i,o,s,a)=>{if(n.length>0)throw(0,J6.default)(new Error(`No link named ${t} found in raw node ${r}`),"ERR_NOT_FOUND");let c=await s.get(r,a);return{entry:{type:"raw",name:e,path:t,cid:r,content:eL(c),depth:o,size:BigInt(c.length),node:c}}},Z6=tL;var Gc=Q(ke(),1);var Kc=Q(ke(),1);var rL=async function(r){return(await Ao.encode(r)).slice(0,8).reverse()},nL=async(r,e,t)=>{let n=(e.tableSize()-1).toString(16).length;await Promise.all(r.map(async i=>{if(i.Name==null)throw new Error("Unexpected Link without a Name");if(i.Name.length===n){let o=parseInt(i.Name,16);e._putObjectAt(o,new Jt({hash:t._options.hash,bits:t._options.bits},e,o));return}await t.put(i.Name.substring(2),!0)}))},Q6=(r,e)=>r.toString(16).toUpperCase().padStart(e,"0").substring(0,e),iL=r=>{let e=r.bucket,t=[];for(;e._parent!=null;)t.push(e),e=e._parent;return t.push(e),t.reverse()},e4=async(r,e,t,n,i)=>{if(n==null){if(r.Data==null)throw(0,Kc.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");let p;try{p=X.unmarshal(r.Data)}catch(d){throw(0,Kc.default)(d,"ERR_NOT_UNIXFS")}if(p.type!=="hamt-sharded-directory")throw(0,Kc.default)(new Error("not a HAMT"),"ERR_NOT_UNIXFS");if(p.fanout==null)throw(0,Kc.default)(new Error("missing fanout"),"ERR_NOT_UNIXFS");let m=Qs({hashFn:rL,bits:Math.log2(Number(p.fanout))});n={rootBucket:m,hamtDepth:1,lastBucket:m}}let o=(n.lastBucket.tableSize()-1).toString(16).length;await nL(r.Links,n.lastBucket,n.rootBucket);let s=await n.rootBucket._findNewBucketAndPos(e),a=Q6(s.pos,o),c=iL(s);c.length>n.hamtDepth&&(n.lastBucket=c[n.hamtDepth],a=Q6(n.lastBucket._posAtParent,o));let u=r.Links.find(p=>{if(p.Name==null)return!1;let m=p.Name.substring(0,o),d=p.Name.substring(o);return!(m!==a||d!==""&&d!==e)});if(u==null)return;if(u.Name!=null&&u.Name.substring(o)===e)return u.Hash;n.hamtDepth++;let l=await t.get(u.Hash,i);return r=Ie(l),e4(r,e,t,n,i)},t4=e4;var oL=(r,e,t,n,i,o,s)=>{async function*a(c={}){let u=c.offset??0,l=c.length??e.Links.length,p=e.Links.slice(u,l);c.onProgress?.(new P("unixfs:exporter:walk:directory",{cid:r})),yield*hr(p,m=>fr(m,d=>async()=>{let f=d.Name??"",h=`${n}/${f}`;return(await i(d.Hash,f,h,[],o+1,s,c)).entry}),m=>xo(m,{ordered:!0,concurrency:c.blockReadConcurrency}),m=>Gt(m,d=>d!=null))}return a},r4=oL;var ko=Q(ke(),1);async function n4(r,e,t,n,i,o,s){if(e instanceof Uint8Array){let u=Bo(e,n,i,o);t.push(u);return}if(e.Data==null)throw(0,ko.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");let a;try{a=X.unmarshal(e.Data)}catch(u){throw(0,ko.default)(u,"ERR_NOT_UNIXFS")}if(a.data!=null){let u=a.data,l=Bo(u,n,i,o);t.push(l),n+=BigInt(l.byteLength)}let c=[];if(e.Links.length!==a.blockSizes.length)throw(0,ko.default)(new Error("Inconsistent block sizes and dag links"),"ERR_NOT_UNIXFS");for(let u=0;u<e.Links.length;u++){let l=e.Links[u],p=n,m=p+a.blockSizes[u];if((i>=p&&i<m||o>=p&&o<=m||i<p&&o>m)&&c.push({link:l,blockStart:n}),n=m,n>o)break}await hr(c,u=>fr(u,l=>async()=>{let p=await r.get(l.link.Hash,s);return{...l,block:p}}),u=>xo(u,{ordered:!0,concurrency:s.blockReadConcurrency}),async u=>{for await(let{link:l,block:p,blockStart:m}of u){let d;switch(l.Hash.code){case Ve:d=Ie(p);break;case je:d=p;break;default:t.end((0,ko.default)(new Error(`Unsupported codec: ${l.Hash.code}`),"ERR_NOT_UNIXFS"));return}let f=new Ct({concurrency:1});f.on("error",h=>{t.end(h)}),f.add(async()=>{s.onProgress?.(new P("unixfs:exporter:walk:file",{cid:l.Hash})),await n4(r,d,t,m,i,o,s)}),await f.onIdle()}}),n>=o&&t.end()}var sL=(r,e,t,n,i,o,s)=>{async function*a(c={}){let u=t.fileSize();if(u===void 0)throw new Error("File was a directory");let{start:l,end:p}=ea(u,c.offset,c.length);if(p===0n)return;let m=0n,d=p-l,f=Or();c.onProgress?.(new P("unixfs:exporter:walk:file",{cid:r})),n4(s,e,f,0n,l,p,c).catch(h=>{f.end(h)});for await(let h of f)if(h!=null){if(m+=BigInt(h.byteLength),m>d)throw f.end(),(0,ko.default)(new Error("Read too many bytes - the file size reported by the UnixFS data in the root node may be incorrect"),"ERR_OVER_READ");m===d&&f.end(),c.onProgress?.(new P("unixfs:exporter:progress:unixfs:file",{bytesRead:m,totalBytes:d,fileSize:u})),yield h}if(m<d)throw(0,ko.default)(new Error("Traversed entire DAG but did not read enough bytes"),"ERR_UNDER_READ")}return a},ex=sL;var jp=Q(ke(),1);var aL=(r,e,t,n,i,o,s)=>{function a(c={}){return c.onProgress?.(new P("unixfs:exporter:walk:hamt-sharded-directory",{cid:r})),i4(e,n,i,o,s,c)}return a};async function*i4(r,e,t,n,i,o){let s=r.Links;if(r.Data==null)throw(0,jp.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");let a;try{a=X.unmarshal(r.Data)}catch(l){throw(0,jp.default)(l,"ERR_NOT_UNIXFS")}if(a.fanout==null)throw(0,jp.default)(new Error("missing fanout"),"ERR_NOT_UNIXFS");let c=(a.fanout-1n).toString(16).length,u=hr(s,l=>fr(l,p=>async()=>{let m=p.Name!=null?p.Name.substring(c):null;if(m!=null&&m!==""){let d=await t(p.Hash,m,`${e}/${m}`,[],n+1,i,o);return{entries:d.entry==null?[]:[d.entry]}}else{let d=await i.get(p.Hash,o);return r=Ie(d),o.onProgress?.(new P("unixfs:exporter:walk:hamt-sharded-directory",{cid:p.Hash})),{entries:i4(r,e,t,n,i,o)}}}),l=>xo(l,{ordered:!0,concurrency:o.blockReadConcurrency}));for await(let{entries:l}of u)yield*l}var o4=aL;var cL=(r,e)=>r.Links.find(n=>n.Name===e)?.Hash,lL={raw:ex,file:ex,directory:r4,"hamt-sharded-directory":o4,metadata:(r,e,t,n,i,o,s)=>()=>[],symlink:(r,e,t,n,i,o,s)=>()=>[]},uL=async(r,e,t,n,i,o,s,a)=>{let c=await s.get(r,a),u=Ie(c),l,p;if(e==null&&(e=r.toString()),u.Data==null)throw(0,Gc.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");try{l=X.unmarshal(u.Data)}catch(d){throw(0,Gc.default)(d,"ERR_NOT_UNIXFS")}if(t==null&&(t=e),n.length>0){let d;if(l?.type==="hamt-sharded-directory"?d=await t4(u,n[0],s):d=cL(u,n[0]),d==null)throw(0,Gc.default)(new Error("file does not exist"),"ERR_NOT_FOUND");let f=n.shift(),h=`${t}/${f}`;p={cid:d,toResolve:n,name:f??"",path:h}}let m=lL[l.type](r,u,l,t,i,o,s);if(m==null)throw(0,Gc.default)(new Error("could not find content exporter"),"ERR_NOT_FOUND");return l.isDirectory()?{entry:{type:"directory",name:e,path:t,cid:r,content:m,unixfs:l,depth:o,node:u,size:l.fileSize()},next:p}:{entry:{type:"file",name:e,path:t,cid:r,content:m,unixfs:l,depth:o,node:u,size:l.fileSize()},next:p}},s4=uL;var pL={[Ve]:s4,[je]:Z6,[Si]:K6,[ki]:W6,[It.code]:X6},c4=async(r,e,t,n,i,o,s)=>{let a=pL[r.code];if(a==null)throw(0,a4.default)(new Error(`No resolver for code ${r.code}`),"ERR_NO_RESOLVER");return a(r,e,t,n,c4,i,o,s)},l4=c4;var dL=(r="")=>(r.trim().match(/([^\\^/]|\\\/)+/g)??[]).filter(Boolean),fL=r=>{if(r instanceof Uint8Array)return{cid:z.decode(r),toResolve:[]};let e=z.asCID(r);if(e!=null)return{cid:e,toResolve:[]};if(typeof r=="string"){r.indexOf("/ipfs/")===0&&(r=r.substring(6));let t=dL(r);return{cid:z.parse(t[0]),toResolve:t.slice(1)}}throw(0,Hp.default)(new Error(`Unknown path type ${r}`),"ERR_BAD_PATH")};async function*tx(r,e,t={}){let{cid:n,toResolve:i}=fL(r),o=n.toString(),s=o,a=i.length;for(;;){let c=await l4(n,o,s,i,a,e,t);if(c.entry==null&&c.next==null)throw(0,Hp.default)(new Error(`Could not resolve ${r}`),"ERR_NOT_FOUND");if(c.entry!=null&&(yield c.entry),c.next==null)return;i=c.next.toResolve,n=c.next.cid,o=c.next.name,s=c.next.path}}async function lt(r,e,t={}){let n=await Fi(tx(r,e,t));if(n==null)throw(0,Hp.default)(new Error(`Could not resolve ${r}`),"ERR_NOT_FOUND");return n}async function*qp(r,e,t={}){let n=await lt(r,e,t);if(n==null)return;if(yield n,n.type==="directory")for await(let o of i(n,t))yield o;async function*i(o,s){for await(let a of o.content(s))yield a,!(a instanceof Uint8Array)&&a.type==="directory"&&(yield*i(a,s))}}var y4=Q(x4(),1),mt=y4.default;var Cr=class extends Error{name;code;constructor(e,t,n){super(e),this.name=t,this.code=n}},sn=class extends Cr{constructor(e="not a Unixfs node"){super(e,"NotUnixFSError","ERR_NOT_UNIXFS")}},St=class extends Cr{constructor(e="invalid PBNode"){super(e,"InvalidPBNodeError","ERR_INVALID_PBNODE")}},Yn=class extends Cr{constructor(e="unknown error"){super(e,"InvalidPBNodeError","ERR_UNKNOWN_ERROR")}},Wc=class extends Cr{constructor(e="path already exists"){super(e,"AlreadyExistsError","ERR_ALREADY_EXISTS")}},Wp=class extends Cr{constructor(e="path does not exist"){super(e,"DoesNotExistError","ERR_DOES_NOT_EXIST")}},na=class extends Cr{constructor(e="no content"){super(e,"NoContentError","ERR_NO_CONTENT")}},Yp=class extends Cr{constructor(e="not a file"){super(e,"NotAFileError","ERR_NOT_A_FILE")}},zi=class extends Cr{constructor(e="not a directory"){super(e,"NotADirectoryError","ERR_NOT_A_DIRECTORY")}},gt=class extends Cr{constructor(e="invalid parameters"){super(e,"InvalidParametersError","ERR_INVALID_PARAMETERS")}};var sx=Q(Pp(),1);function Jp(r){function e(t){return t instanceof Xp?t:new Xp(t,r)}return e}var Xp=class{_value;_hashFn;_depth;_availableBits;_currentBufferIndex;_buffers;constructor(e,t){if(!(e instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=e,this._hashFn=t,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(e){let t=e;for(;this._availableBits<t;)await this._produceMoreBits();let n=0;for(;t>0;){let i=this._buffers[this._currentBufferIndex],o=Math.min(i.availableBits(),t),s=i.take(o);n=(n<<o)+s,t-=o,this._availableBits-=o,i.availableBits()===0&&this._currentBufferIndex++}return n}untake(e){let t=e;for(;t>0;){let n=this._buffers[this._currentBufferIndex],i=Math.min(n.totalBits()-n.availableBits(),t);n.untake(i),t-=i,this._availableBits+=i,this._currentBufferIndex>0&&n.totalBits()===n.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;let e=this._depth>0?ze([this._value,Uint8Array.from([this._depth])]):this._value,t=await this._hashFn(e),n=new nx(t);this._buffers.push(n),this._availableBits+=n.availableBits()}},wL=[255,254,252,248,240,224,192,128],bL=[1,3,7,15,31,63,127,255],nx=class{_value;_currentBytePos;_currentBitPos;constructor(e){this._value=e,this._currentBytePos=e.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take(e){let t=e,n=0;for(;t>0&&this._haveBits();){let i=this._value[this._currentBytePos],o=this._currentBitPos+1,s=Math.min(o,t),a=vL(i,o-s,s);n=(n<<s)+a,t-=s,this._currentBitPos-=s,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return n}untake(e){for(this._currentBitPos+=e;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function vL(r,e,t){let n=EL(e,t);return(r&n)>>>e}function EL(r,e){return wL[r]&bL[Math.min(e+r-1,7)]}var Yc=BigInt(Ao.code),Io=8;async function ia(r){return(await Ao.encode(r)).subarray(0,8).reverse()}var v4=Q(Pp(),1);var Rr=async(r,e,t)=>{t.codec==null&&(t.codec=Ke);let n=await ce.digest(r),i=z.create(t.cidVersion,t.codec.code,n);return await e.put(i,r,{...t,signal:t.signal}),i};var ix=class{options;root;dir;path;dirty;flat;parent;parentKey;unixfs;mode;mtime;cid;size;nodeSize;constructor(e,t){this.options=t??{},this.root=e.root,this.dir=e.dir,this.path=e.path,this.dirty=e.dirty,this.flat=e.flat,this.parent=e.parent,this.parentKey=e.parentKey,this.unixfs=e.unixfs,this.mode=e.mode,this.mtime=e.mtime}},Zp=class extends ix{_bucket;constructor(e,t){super(e,t),this._bucket=Qs({hashFn:ia,bits:8})}async put(e,t){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,await this._bucket.put(e,t)}async get(e){return this._bucket.get(e)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(let{key:e,value:t}of this._bucket.eachLeafSeries())yield{key:e,child:t}}estimateNodeSize(){return this.nodeSize!==void 0?this.nodeSize:(this.nodeSize=b4(this._bucket,this,this.options),this.nodeSize)}async*flush(e){for await(let t of w4(this._bucket,e,this,this.options))yield{...t,path:this.path}}};async function*w4(r,e,t,n){let i=r._children,o=[],s=0n;for(let d=0;d<i.length;d++){let f=i.get(d);if(f==null)continue;let h=d.toString(16).toUpperCase().padStart(2,"0");if(f instanceof Jt){let x;for await(let g of w4(f,e,null,n))x=g;if(x==null)throw new Error("Could not flush sharded directory, no subshard found");o.push({Name:h,Tsize:Number(x.size),Hash:x.cid}),s+=x.size}else if(AL(f.value)){let x=f.value,g;for await(let y of x.flush(e))g=y,yield g;if(g==null)throw new Error("Did not flush dir");let w=h+f.key;o.push({Name:w,Tsize:Number(g.size),Hash:g.cid}),s+=g.size}else{let x=f.value;if(x.cid==null)continue;let g=h+f.key,w=x.size;o.push({Name:g,Tsize:Number(w),Hash:x.cid}),s+=BigInt(w??0)}}let a=Uint8Array.from(i.bitField().reverse()),c=new X({type:"hamt-sharded-directory",data:a,fanout:BigInt(r.tableSize()),hashType:Yc,mtime:t?.mtime,mode:t?.mode}),u={Data:c.marshal(),Links:o},l=fe(Ue(u)),p=await Rr(l,e,n),m=BigInt(l.byteLength)+s;yield{cid:p,unixfs:c,size:m}}function AL(r){return typeof r.flush=="function"}function b4(r,e,t){let n=r._children,i=[];for(let c=0;c<n.length;c++){let u=n.get(c);if(u==null)continue;let l=c.toString(16).toUpperCase().padStart(2,"0");if(u instanceof Jt){let p=b4(u,null,t);i.push({Name:l,Tsize:Number(p),Hash:t.cidVersion===0?Qp:ed})}else if(typeof u.value.flush=="function"){let m=u.value.nodeSize();i.push({Name:l+u.key,Tsize:Number(m),Hash:t.cidVersion===0?Qp:ed})}else{let p=u.value;if(p.cid==null)continue;let m=l+u.key,d=p.size;i.push({Name:m,Tsize:Number(d),Hash:p.cid})}}let o=Uint8Array.from(n.bitField().reverse()),s=new X({type:"hamt-sharded-directory",data:o,fanout:BigInt(r.tableSize()),hashType:Yc,mtime:e?.mtime,mode:e?.mode});return fe(Ue({Data:s.marshal(),Links:i})).length}var Qp=z.parse("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"),ed=z.parse("zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi");var ox=ne("helia:unixfs:commands:utils:hamt-utils"),td=r=>r.toString(16).toUpperCase().padStart(2,"0").substring(0,2),E4=async(r,e,t)=>{let n=new Zp({root:!0,dir:!0,parent:void 0,parentKey:void 0,path:"",dirty:!0,flat:!1,mtime:t.mtime,mode:t.mode},t);for(let o=0;o<e.length;o++)await n._bucket.put(e[o].name,{size:e[o].size,cid:e[o].cid});let i=await Fi(n.flush(r));if(i==null)throw new Error("Flushing shard yielded no result");return i},rd=async(r,e,t)=>{let n=X.unmarshal(r[0].node.Data??new Uint8Array(0)),i=BigInt(Math.pow(2,Io));r.reverse();let o,s;for(let a=0;a<r.length;a++){let c=a===r.length-1,u=r[a],l=Uint8Array.from(u.children.bitField().reverse()),p=new X({type:"hamt-sharded-directory",data:l,fanout:i,hashType:Yc});c&&(p.mtime=n.mtime,p.mode=n.mode),s={Data:p.marshal(),Links:u.node.Links};let m=fe(Ue(s));if(o=await Rr(m,e,t),!c){let d=r[a+1];if(d==null)throw new Error("Was not operating on shard root but also had no parent?");ox("updating link in parent sub-shard with prefix %s",d.prefix),d.node.Links=d.node.Links.filter(f=>f.Name!==d.prefix),d.node.Links.push({Name:d.prefix,Hash:o,Tsize:u.node.Links.reduce((f,h)=>f+(h.Tsize??0),m.byteLength)})}}if(o==null||s==null)throw new Error("Noting persisted");return{cid:o,node:s}},nd=async(r,e,t,n)=>{let o=Jp(ia)(Z(e)),s=[];for(;;){let a=await t.get(r,n),c=Ie(a),u=new v4.default,l=await o.take(Io),p=td(l);s.push({prefix:p,children:u,node:c});let m;for(let f of c.Links){let h=f.Name??"";if(h.length<2)throw new Error("Invalid HAMT - link name was too short");let x=parseInt(h.substring(0,2),16);u.set(x,!0),h.startsWith(p)&&(m=f)}if(m==null){ox("no link found with prefix %s for %s",p,e);break}let d=m.Name??"";if(d.length<2)throw new Error("Invalid HAMT - link name was too short");if(d.length===2){r=m.Hash,ox("descend into sub-shard with prefix %s",d);continue}break}return{path:s,hash:o}};async function id(r,e,t,n){if(r.Data==null)throw new Error("DagPB node had no data");let i=X.unmarshal(r.Data),o;if(i.type==="directory")o=SL(r);else if(i.type==="hamt-sharded-directory")o=await A4(r,0,t,e,n);else throw new Error("Can only estimate the size of directories or shards");return o>t}function SL(r){let e=0;for(let t of r.Links)e+=(t.Name??"").length,e+=t.Hash.version===1?ed.bytes.byteLength:Qp.bytes.byteLength;return e}async function A4(r,e,t,n,i){if(e>t)return t;if(r.Data==null||!X.unmarshal(r.Data).isDirectory())return e;for(let s of r.Links){let a=s.Name??"";if(a=a.substring(2),e+=a.length,e+=s.Hash.bytes.byteLength,s.Hash.code===Ve){let c=await n.get(s.Hash,i),u=Ie(c);e+=await A4(u,e,t,n,i)}}return e}var an=ne("helia:unixfs:components:utils:add-link");async function oa(r,e,t,n){if(r.node.Data==null)throw new gt("Invalid parent passed to addLink");if(X.unmarshal(r.node.Data).type==="hamt-sharded-directory")return an("adding link to sharded directory"),IL(r,e,t,n);an(`adding ${e.Name} (${e.Hash}) to regular directory`);let o=await kL(r,e,t,n);if(await id(o.node,t,n.shardSplitThresholdBytes,n)){an("converting directory to sharded directory");let s=await BL(o,t);o.cid=s.cid,o.node=Ie(await t.get(s.cid,n))}return o}var BL=async(r,e)=>{if(r.node.Data==null)throw new gt("Invalid parent passed to convertToShardedDirectory");let t=X.unmarshal(r.node.Data),n=await E4(e,r.node.Links.map(i=>({name:i.Name??"",size:BigInt(i.Tsize??0),cid:i.Hash})),{mode:t.mode,mtime:t.mtime,cidVersion:r.cid.version});return an(`converted directory to sharded directory ${n.cid}`),n},kL=async(r,e,t,n)=>{let i=r.node.Links.filter(l=>{let p=l.Name===e.Name;if(p&&!n.allowOverwriting)throw new Wc;return!p});if(i.push(e),r.node.Data==null)throw new St("Parent node with no data passed to addToDirectory");let o=X.unmarshal(r.node.Data),s;if(o.mtime!=null){let l=Date.now(),p=Math.floor(l/1e3);o.mtime={secs:BigInt(p),nsecs:(l-p*1e3)*1e3},s=o.marshal()}else s=r.node.Data;r.node=Ue({Data:s,Links:i});let a=fe(r.node),c=await ce.digest(a),u=z.create(r.cid.version,Ve,c);return await t.put(u,a),{node:r.node,cid:u}},IL=async(r,e,t,n)=>{let{path:i,hash:o}=await nd(r.cid,e.Name,t,n),s=i[i.length-1];if(s==null)throw new Error("Invalid HAMT, could not generate path");let a=s.prefix,c=parseInt(a,16);an("next prefix for %s is %s",e.Name,a);let u=`${a}${e.Name}`,l=s.node.Links.find(p=>(p.Name??"").startsWith(a));if(l!=null)if(an("link %s was present in shard",u),l.Name===u){if(!n.allowOverwriting)throw new Wc;an("overwriting %s in subshard",e.Name),s.node.Links=s.node.Links.filter(p=>p.Name!==u),s.node.Links.push({Name:u,Hash:e.Hash,Tsize:e.Tsize})}else{if(l.Name?.length===2)throw new Error("Existing link was subshard?!");{an("prefix %s already exists, creating new subshard",a);let p=s.node.Links.findIndex(x=>x.Name?.startsWith(a)),m=s.node.Links.splice(p,1)[0],d=(m.Name??"").substring(2),h=Jp(ia)(Z(d));for(let x=0;x<i.length;x++)await h.take(Io);for(;;){let x=await h.take(Io),g=td(x);m.Name=`${g}${d}`;let w=await o.take(Io),y=td(w);if(g===y){let B=new sx.default;B.set(w,!0),i.push({prefix:y,children:B,node:{Links:[]}});continue}let E=new sx.default;E.set(w,!0),E.set(x,!0),i.push({prefix:a,children:E,node:{Links:[m,{Name:`${y}${e.Name}`,Hash:e.Hash,Tsize:e.Tsize}]}});break}}}else an("link %s was not present in sub-shard",u),e.Name=u,s.node.Links.push(e),s.children.set(c,!0),an("adding %s to existing sub-shard",u);return rd(i,t,n)};async function Vi(r,e,t={}){let n=await lt(r,e,t);if(n.type!=="directory")throw new zi(`${r.toString()} was not a UnixFS directory`);return{cid:r,node:n.node}}async function sa(r,e,t,n){let i=await lt(r,t,n);if(i.type!=="directory"&&i.type!=="file"&&i.type!=="raw")throw new sn(`${r.toString()} was not a UnixFS node`);return{Name:e,Tsize:i.node instanceof Uint8Array?i.node.byteLength:_L(i.node),Hash:r}}function _L(r){let e=r.Links.reduce((t,n)=>t+(n.Tsize??0),0);return fe(r).byteLength+e}var ax=ne("helia:unixfs:components:utils:resolve");async function cn(r,e,t,n){if(e==null||e==="")return{cid:r};ax('resolve "%s" under %c',e,r);let i=e.split("/").filter(Boolean),o=[{name:"",cid:r,size:0n}];for(let s=0;s<i.length;s++){let a=i[s],c=await lt(r,t,n);if(ax('resolving "%s"',a,c),c.type==="file"){if(s<i.length-1)throw new gt("Path was invalid");r=c.cid}else if(c.type==="directory"){let u;for await(let l of c.content())if(l.name===a){u=l.cid;break}if(u==null)throw new Wp("Could not find path in directory");r=u,o.push({name:a,cid:r,size:c.size})}else throw new gt("Could not resolve path")}return ax("resolved %s to %c",e,r),{cid:r,path:e,segments:o}}async function aa(r,e,t,n){if(e.segments==null||e.segments.length===0)return r;let i=e.segments.pop();if(i==null)throw new Error("Insufficient segments");i.cid=r,e.segments.reverse();for(let o of e.segments){let[s,a]=await Promise.all([Vi(o.cid,t,n),sa(i.cid,i.name,t,n)]);r=(await oa(s,a,t,{...n,allowOverwriting:!0,cidVersion:r.version})).cid,o.cid=r,i=o}return r}var TL=mt.bind({ignoreUndefined:!0}),CL={};async function*S4(r,e,t={}){let n=TL(CL,t),i=await cn(r,n.path,e,n),o=await lt(i.cid,e,n);if(o.type!=="file"&&o.type!=="raw")throw new Yp;if(o.content==null)throw new na;yield*o.content(n)}var RL=mt.bind({ignoreUndefined:!0}),UL=ne("helia:unixfs:chmod"),NL={recursive:!1,shardSplitThresholdBytes:262144};async function B4(r,e,t,n={}){let i=RL(NL,n),o=await cn(r,i.path,t,n);if(UL("chmod %c %d",o.cid,e),i.recursive){let m=await hr(async function*(){for await(let d of qp(o.cid,t,n)){let f,h=[];if(d.type==="raw")f=new X({type:"file",data:d.node});else if(d.type==="file"||d.type==="directory")f=d.unixfs,h=d.node.Links;else throw new sn;f.mode=e;let x={Data:f.marshal(),Links:h};yield{path:d.path,content:x}}},d=>Oi(d,t,{...i,dagBuilder:async function*(f,h){for await(let x of f)yield async function(){let g=x.content,w=fe(g),y=await Rr(w,h,{...i,cidVersion:r.version});if(g.Data==null)throw new St(`${y} had no data`);let E=X.unmarshal(g.Data);return{cid:y,size:BigInt(w.length),path:x.path,unixfs:E}}}}),async d=>Fi(d));if(m==null)throw new Yn(`Could not chmod ${o.cid.toString()}`);return aa(m.cid,o,t,i)}let s=await t.get(o.cid,n),a,c=[];if(o.cid.code===je)a=new X({type:"file",data:s});else{let m=Ie(s);if(m.Data==null)throw new St(`${o.cid.toString()} had no data`);c=m.Links,a=X.unmarshal(m.Data)}a.mode=e;let u=fe({Data:a.marshal(),Links:c}),l=await ce.digest(u),p=z.create(o.cid.version,Ve,l);return await t.put(p,u),aa(p,o,t,i)}var DL=mt.bind({ignoreUndefined:!0}),LL=ne("helia:unixfs:cp"),PL={force:!1,shardSplitThresholdBytes:262144};async function k4(r,e,t,n,i={}){let o=DL(PL,i);if(t.includes("/"))throw new gt("Name must not have slashes");let[s,a]=await Promise.all([Vi(e,n,o),sa(r,t,n,o)]);return LL('Adding %c as "%s" to %c',r,t,e),(await oa(s,a,n,{allowOverwriting:o.force,cidVersion:e.version,...o})).cid}var OL=mt.bind({ignoreUndefined:!0}),FL={};async function*I4(r,e,t={}){let n=OL(FL,t),i=await cn(r,n.path,e,n),o=await lt(i.cid,e);if(o.type==="file"||o.type==="raw"){yield o;return}if(o.content==null)throw new na;if(o.type!=="directory")throw new zi;yield*o.content({offset:t.offset,length:t.length})}var zL=mt.bind({ignoreUndefined:!0}),_4=ne("helia:unixfs:mkdir"),VL={cidVersion:1,force:!1,shardSplitThresholdBytes:262144};async function T4(r,e,t,n={}){let i=zL(VL,n);if(e.includes("/"))throw new gt("Path must not have slashes");if((await lt(r,t,n)).type!=="directory")throw new zi(`${r.toString()} was not a UnixFS directory`);_4("creating %s",e);let a={Data:new X({type:"directory",mode:i.mode,mtime:i.mtime}).marshal(),Links:[]},c=fe(a),u=await ce.digest(c),l=z.create(i.cidVersion,Ve,u);await t.put(l,c);let[p,m]=await Promise.all([Vi(r,t,i),sa(l,e,t,i)]);return _4("adding empty dir called %s to %c",e,r),(await oa(p,m,t,{...i,allowOverwriting:i.force})).cid}var od=ne("helia:unixfs:utils:remove-link");async function C4(r,e,t,n){if(r.node.Data==null)throw new St("Parent node had no data");if(X.unmarshal(r.node.Data).type==="hamt-sharded-directory"){od(`removing ${e} from sharded directory`);let o=await $L(r,e,t,n);return await id(o.node,t,n.shardSplitThresholdBytes,n)?o:(od("converting shard to flat directory %c",r.cid),jL(o,t,n))}return od(`removing link ${e} regular directory`),ML(r,e,t,n)}var ML=async(r,e,t,n)=>{r.node.Links=r.node.Links.filter(s=>s.Name!==e);let i=fe(r.node),o=await Rr(i,t,{...n,cidVersion:r.cid.version});return od(`Updated regular directory ${o}`),{node:r.node,cid:o}},$L=async(r,e,t,n)=>{let{path:i}=await nd(r.cid,e,t,n),o=i[i.length-1];if(o==null)throw new Error("Invalid HAMT, could not generate path");let s=o.node.Links.filter(u=>(u.Name??"").substring(2)===e).map(u=>u.Name).pop();if(s==null)throw new Error("File not found");let a=s.substring(0,2),c=parseInt(a,16);if(o.node.Links=o.node.Links.filter(u=>u.Name!==s),o.children.unset(c),o.node.Links.length===1)for(;i.length!==1;){let u=i[i.length-1];if(u==null||u.node.Links.length>1)break;i.pop();let l=i[i.length-1];if(l==null)break;let p=u.node.Links[0];l.node.Links=l.node.Links.filter(m=>!(m.Name??"").startsWith(l.prefix)),l.node.Links.push({Hash:p.Hash,Name:`${l.prefix}${(p.Name??"").substring(2)}`,Tsize:p.Tsize})}return rd(i,t,n)},jL=async(r,e,t)=>{if(r.node.Data==null)throw new gt("Invalid parent passed to convertToFlatDirectory");let n={Links:[]},i=await lt(r.cid,e);if(i.type!=="directory")throw new Error("Unexpected node type");for await(let c of i.content()){let u=0;c.node instanceof Uint8Array?u=c.node.byteLength:u=fe(c.node).length,n.Links.push({Hash:c.cid,Name:c.name,Tsize:u})}let o=X.unmarshal(r.node.Data);n.Data=new X({type:"directory",mode:o.mode,mtime:o.mtime}).marshal();let s=fe(Ue(n));return{cid:await Rr(s,e,{codec:Ke,cidVersion:r.cid.version,signal:t.signal}),node:n}};var HL=mt.bind({ignoreUndefined:!0}),qL=ne("helia:unixfs:rm"),KL={shardSplitThresholdBytes:262144};async function R4(r,e,t,n={}){let i=HL(KL,n);if(e.includes("/"))throw new gt("Name must not have slashes");let o=await Vi(r,t,i);return qL("Removing %s from %c",e,r),(await C4(o,e,t,{...i,cidVersion:r.version})).cid}var GL=mt.bind({ignoreUndefined:!0}),WL=ne("helia:unixfs:stat"),YL={};async function U4(r,e,t={}){let n=GL(YL,t),i=await cn(r,t.path,e,n);WL("stat %c",i.cid);let o=await lt(i.cid,e,n);if(o.type!=="file"&&o.type!=="directory"&&o.type!=="raw")throw new sn;let s=0n,a=0n,c=0n,u=0n,l=0,p,m,d=o.type,f;if(o.type==="raw"&&(s=BigInt(o.node.byteLength),a=BigInt(o.node.byteLength),c=BigInt(o.node.byteLength),u=BigInt(o.node.byteLength),l=1),o.type==="directory"&&(s=0n,a=BigInt(o.unixfs.marshal().byteLength),c=0n,u=a,l=1,p=o.unixfs.mode,m=o.unixfs.mtime,f=o.unixfs),o.type==="file"){let h=await N4(i.cid,e,n);s=o.unixfs.fileSize(),a=BigInt((o.node.Data?.byteLength??0)+o.node.Links.reduce((x,g)=>x+(g.Tsize??0),0)),c=BigInt(h.localFileSize),u=BigInt(h.localDagSize),l=h.blocks,p=o.unixfs.mode,m=o.unixfs.mtime,f=o.unixfs}return{cid:i.cid,mode:p,mtime:m,fileSize:s,dagSize:a,localFileSize:c,localDagSize:u,blocks:l,type:d,unixfs:f}}async function N4(r,e,t){let n={localFileSize:0,localDagSize:0,blocks:0};if(await e.has(r,t)){let i=await e.get(r,t);if(n.blocks++,n.localDagSize+=i.byteLength,r.code===je)n.localFileSize+=i.byteLength;else if(r.code===Ve){let o=Ie(i);if(o.Links.length>0)for(let s of o.Links){let a=await N4(s.Hash,e,t);n.localFileSize+=a.localFileSize,n.localDagSize+=a.localDagSize,n.blocks+=a.blocks}else{if(o.Data==null)throw new St(`PBNode ${r.toString()} had no data`);let s=X.unmarshal(o.Data);if(s.data==null)throw new St(`UnixFS node ${r.toString()} had no data`);n.localFileSize+=s.data.byteLength??0}}else throw new Yn(`${r.toString()} was neither DAG_PB nor RAW`)}return n}var XL=mt.bind({ignoreUndefined:!0}),JL=ne("helia:unixfs:touch"),ZL={recursive:!1,shardSplitThresholdBytes:262144};async function D4(r,e,t={}){let n=XL(ZL,t),i=await cn(r,n.path,e,n),o=n.mtime??{secs:BigInt(Math.round(Date.now()/1e3)),nsecs:0};if(JL("touch %c %o",i.cid,o),n.recursive){let m=await hr(async function*(){for await(let d of qp(i.cid,e)){let f,h;if(d.type==="raw")f=new X({data:d.node}),h=[];else if(d.type==="file"||d.type==="directory")f=d.unixfs,h=d.node.Links;else throw new sn;f.mtime=o;let x={Data:f.marshal(),Links:h};yield{path:d.path,content:x}}},d=>Oi(d,e,{...n,dagBuilder:async function*(f,h){for await(let x of f)yield async function(){let g=x.content,w=fe(g),y=await Rr(w,h,{...n,cidVersion:r.version});if(g.Data==null)throw new St(`${y} had no data`);let E=X.unmarshal(g.Data);return{cid:y,size:BigInt(w.length),path:x.path,unixfs:E}}}}),async d=>Fi(d));if(m==null)throw new Yn(`Could not chmod ${i.cid.toString()}`);return aa(m.cid,i,e,n)}let s=await e.get(i.cid,t),a,c=[];if(i.cid.code===je)a=new X({data:s});else{let m=Ie(s);if(c=m.Links,m.Data==null)throw new St(`${i.cid.toString()} had no data`);a=X.unmarshal(m.Data)}a.mtime=o;let u=fe({Data:a.marshal(),Links:c}),l=await ce.digest(u),p=z.create(i.cid.version,Ve,l);return await e.put(p,u),aa(p,i,e,n)}var cx=class{components;constructor(e){this.components=e}async*addAll(e,t={}){yield*V6(e,this.components.blockstore,t)}async addBytes(e,t={}){return M6(e,this.components.blockstore,t)}async addByteStream(e,t={}){return $6(e,this.components.blockstore,t)}async addFile(e,t={}){return j6(e,this.components.blockstore,t)}async addDirectory(e={},t={}){return H6(e,this.components.blockstore,t)}async*cat(e,t={}){yield*S4(e,this.components.blockstore,t)}async chmod(e,t,n={}){return B4(e,t,this.components.blockstore,n)}async cp(e,t,n,i={}){return k4(e,t,n,this.components.blockstore,i)}async*ls(e,t={}){yield*I4(e,this.components.blockstore,t)}async mkdir(e,t,n={}){return T4(e,t,this.components.blockstore,n)}async rm(e,t,n={}){return R4(e,t,this.components.blockstore,n)}async stat(e,t={}){return U4(e,this.components.blockstore,t)}async touch(e,t={}){return D4(e,this.components.blockstore,t)}};function L4(r){return new cx(r)}var Z4=Q(J4(),1),vP="application/octet-stream",EP=/^(<\?xml[^>]+>)?[^<^\w]+<svg/ig,AP=[async({bytes:r})=>EP.test(new TextDecoder().decode(r.slice(0,64)))?"image/svg+xml":void 0,async({path:r})=>{let e=Z4.default.lookup(r);if(e!==!1)return e}],SP={"video/quicktime":"video/mp4"};function BP(r){return SP[r]??r}async function Q4(r){for(let e of AP){let t=await e(r);if(t!==void 0)return BP(t)}return vP}var kP=ne("helia:verified-fetch:get-stream-and-content-type");async function e8(r,e,t){let n=r[Symbol.asyncIterator](),{value:i,done:o}=await n.next();if(t?.onProgress?.(new P("verified-fetch:request:progress:chunk")),o===!0)throw kP.error("No content found for path",e),new Error("No content found");let s=await Q4({bytes:i,path:e}),a=new ReadableStream({async start(c){c.enqueue(i)},async pull(c){let{value:u,done:l}=await n.next();if(l===!0){u!=null&&(t?.onProgress?.(new P("verified-fetch:request:progress:chunk")),c.enqueue(u)),c.close();return}t?.onProgress?.(new P("verified-fetch:request:progress:chunk")),c.enqueue(u)}});return{contentType:s,stream:a}}var t8=Q(W0(),1),xd=class{lru;constructor(e){this.lru=(0,t8.default)(e)}get(e){let t=this.lru.get(e);if(t!=null){if(t.expire!=null&&t.expire<Date.now()){this.lru.remove(e);return}return t.value}}set(e,t,n){this.lru.set(e,{value:t,expire:Date.now()+n})}has(e){return this.get(e)!=null}remove(e){this.lru.remove(e)}clear(){this.lru.clear()}};var Zn=ne("helia:verified-fetch:parse-url-string"),yx=new xd(1e3),IP=/^(?<protocol>ip[fn]s):\/\/(?<cidOrPeerIdOrDnsLink>[^/$?]+)\/?(?<path>[^$?]*)\??(?<queryString>.*)$/;async function r8({urlString:r,ipns:e},t){let n=r.match(IP);if(n==null||n.groups==null)throw new TypeError(`Invalid URL: ${r}, please use ipfs:// or ipns:// URLs only.`);let{protocol:i,cidOrPeerIdOrDnsLink:o,path:s,queryString:a}=n.groups,c,u,l=[];if(i==="ipfs")try{c=z.parse(o)}catch(f){Zn.error(f),l.push(new TypeError("Invalid CID for ipfs://<cid> URL"))}else{let f=yx.get(o);if(f!=null)c=f.cid,u=f.path,Zn.trace("resolved %s to %c from cache",o,c);else{Zn.trace("Attempting to resolve PeerId for %s",o);let h=null;try{h=mr(o),f=await e.resolve(h,{onProgress:t?.onProgress}),c=f?.cid,u=f?.path,Zn.trace("resolved %s to %c",o,c),yx.set(o,f,60*1e3*2)}catch(x){h==null?(Zn.error('Could not parse PeerId string "%s"',o,x),l.push(new TypeError(`Could not parse PeerId in ipns url "${o}", ${x.message}`))):(Zn.error("Could not resolve PeerId %c",h,x),l.push(new TypeError(`Could not resolve PeerId "${o}", ${x.message}`)))}if(c==null){Zn.trace("Attempting to resolve DNSLink for %s",o);try{f=await e.resolveDns(o,{onProgress:t?.onProgress}),c=f?.cid,u=f?.path,Zn.trace("resolved %s to %c",o,c),yx.set(o,f,60*1e3*2)}catch(x){Zn.error('Could not resolve DnsLink for "%s"',o,x),l.push(x)}}}}if(c==null)throw new AggregateError(l,`Invalid resource. Cannot determine CID from URL "${r}"`);let p={};if(a!=null&&a.length>0){let f=a.split("&");for(let h of f){let[x,g]=h.split("=");p[x]=decodeURIComponent(g)}}let m=[];s.length>0&&m.push(s),u!=null&&u.length>0&&m.push(u);let d=m.join("/");return{protocol:i,cid:c,path:d,query:p}}async function n8(r,e,t){if(typeof r=="string")return r8({urlString:r,ipns:e},{onProgress:t?.onProgress});let n=z.asCID(r);if(n!=null)return{cid:n,protocol:"ipfs",path:"",query:{}};throw new TypeError(`Invalid resource. Cannot determine CID from resource: ${r}`)}async function i8(r,e,t){let n=[],i=[],o;for await(let s of tx(e,r,t))n.push(s),i.push(s.cid.toString()),o=s;if(o==null)throw new Error("No terminal element found");return{ipfsRoots:i,terminalElement:o}}var Nr=ne("helia:verified-fetch");function _P(r){if(r==null)return;let e;return r?.signal===null&&(e=void 0),{...r,signal:e}}var yd=class{helia;ipns;unixfs;dagJson;dagCbor;json;pathWalker;constructor({helia:e,ipns:t,unixfs:n,dagJson:i,json:o,dagCbor:s,pathWalker:a},c){this.helia=e,this.ipns=t??XE(e,{resolvers:[Up("https://mozilla.cloudflare-dns.com/dns-query"),Up("https://dns.google/resolve")]}),this.unixfs=n??L4(e),this.dagJson=i??Lv(e),this.json=o??_3(e),this.dagCbor=s??Dv(e),this.pathWalker=a??i8,Nr.trace("created VerifiedFetch instance")}async handleIPNSRecord({cid:e,path:t,options:n}){let i=new Response("vnd.ipfs.ipns-record support is not implemented",{status:501});return i.headers.set("X-Content-Type-Options","nosniff"),i}async handleIPLDCar({cid:e,path:t,options:n}){let i=new Response("vnd.ipld.car support is not implemented",{status:501});return i.headers.set("X-Content-Type-Options","nosniff"),i}async handleDagJson({cid:e,path:t,options:n}){Nr.trace("fetching %c/%s",e,t),n?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.dagJson.get(e,{signal:n?.signal,onProgress:n?.onProgress});n?.onProgress?.(new P("verified-fetch:request:end",{cid:e.toString(),path:t}));let o=new Response(JSON.stringify(i),{status:200});return o.headers.set("content-type","application/json"),o}async handleJson({cid:e,path:t,options:n}){Nr.trace("fetching %c/%s",e,t),n?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.json.get(e,{signal:n?.signal,onProgress:n?.onProgress});n?.onProgress?.(new P("verified-fetch:request:end",{cid:e.toString(),path:t}));let o=new Response(JSON.stringify(i),{status:200});return o.headers.set("content-type","application/json"),o}async handleDagCbor({cid:e,path:t,options:n}){Nr.trace("fetching %c/%s",e,t),n?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.dagCbor.get(e,{signal:n?.signal,onProgress:n?.onProgress});n?.onProgress?.(new P("verified-fetch:request:end",{cid:e.toString(),path:t}));let o=new Response(JSON.stringify(i),{status:200});return o.headers.set("content-type","application/json"),o}async handleDagPb({cid:e,path:t,options:n,terminalElement:i}){Nr.trace("fetching %c/%s",e,t);let o=i?.cid??e,s;if(i?.type==="directory"){let p=i.cid,m="index.html";try{Nr.trace("found directory at %c/%s, looking for index.html",e,t),n?.onProgress?.(new P("verified-fetch:request:start",{cid:p.toString(),path:m})),s=await this.unixfs.stat(p,{path:m,signal:n?.signal,onProgress:n?.onProgress}),Nr.trace("found root file at %c/%s with cid %c",p,m,s.cid),t=m,o=s.cid}catch(d){return Nr("error loading path %c/%s",p,m,d),new Response("Unable to find index.html for directory at given path. Support for directories with implicit root is not implemented",{status:501})}finally{n?.onProgress?.(new P("verified-fetch:request:end",{cid:p.toString(),path:m}))}}n?.onProgress?.(new P("verified-fetch:request:start",{cid:o.toString(),path:""}));let a=this.unixfs.cat(o,{signal:n?.signal,onProgress:n?.onProgress});n?.onProgress?.(new P("verified-fetch:request:end",{cid:o.toString(),path:""})),Nr("got async iterator for %c/%s",e,t);let{contentType:c,stream:u}=await e8(a,t??"",{onProgress:n?.onProgress}),l=new Response(u,{status:200});return l.headers.set("content-type",c),l}async handleRaw({cid:e,path:t,options:n}){Nr.trace("fetching %c/%s",e,t),n?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.helia.blockstore.get(e);n?.onProgress?.(new P("verified-fetch:request:end",{cid:e.toString(),path:t}));let o=new Response(cf(i),{status:200});return o.headers.set("content-type","application/octet-stream"),o}getFormat({headerFormat:e,queryFormat:t}){let n={"vnd.ipld.raw":"raw","vnd.ipld.car":"car","application/x-tar":"tar","application/vnd.ipld.dag-json":"dag-json","application/vnd.ipld.dag-cbor":"dag-cbor","application/json":"json","application/cbor":"cbor","vnd.ipfs.ipns-record":"ipns-record"};if(e!=null){for(let i in n)if(e.includes(i))return n[i]}else if(t!=null)return t;return null}formatHandlers={raw:async()=>new Response("application/vnd.ipld.raw support is not implemented",{status:501}),car:this.handleIPLDCar,"ipns-record":this.handleIPNSRecord,tar:async()=>new Response("application/x-tar support is not implemented",{status:501}),"dag-json":async()=>new Response("application/vnd.ipld.dag-json support is not implemented",{status:501}),"dag-cbor":async()=>new Response("application/vnd.ipld.dag-cbor support is not implemented",{status:501}),json:async()=>new Response("application/json support is not implemented",{status:501}),cbor:async()=>new Response("application/cbor support is not implemented",{status:501})};codecHandlers={[ki]:this.handleDagJson,[Ve]:this.handleDagPb,[Oo]:this.handleJson,[Si]:this.handleDagCbor,[je]:this.handleRaw};async fetch(e,t){let n=_P(t),{path:i,query:o,...s}=await n8(e,this.ipns,n),a=s.cid,c,u=this.getFormat({headerFormat:new Headers(n?.headers).get("accept"),queryFormat:o.format??null});if(u!=null){let m=this.formatHandlers[u];if(m!=null&&(c=await m.call(this,{cid:a,path:i,options:n}),c.status===501))return c}let l,p;try{let m=await this.pathWalker(this.helia.blockstore,`${a.toString()}/${i}`,n);p=m.ipfsRoots.join(","),l=m.terminalElement}catch(m){Nr.error("Error walking path %s",i,m)}if(c==null){let m=this.codecHandlers[a.code];if(m!=null)c=await m.call(this,{cid:a,path:i,options:n,terminalElement:l});else return new Response(`Support for codec with code ${a.code} is not yet implemented. Please open an issue at https://github.com/ipfs/helia/issues/new`,{status:501})}return c.headers.set("etag",a.toString()),c.headers.set("cache-cotrol","public, max-age=29030400, immutable"),c.headers.set("X-Ipfs-Path",e.toString()),p!=null&&c.headers.set("X-Ipfs-Roots",p),c}async start(){await this.helia.start()}async stop(){await this.helia.stop()}};async function TP(r){let e=null;if(CP(r))e=r;else{let i=r,o;i.routers!=null&&(o=i.routers.map(s=>Ja(s))),e=await Nv({blockBrokers:[xa({gateways:i.gateways})],routers:o})}let t=new yd({helia:e});async function n(i,o){return t.fetch(i,o)}return n.stop=t.stop.bind(t),n.start=t.start.bind(t),n}function CP(r){return r?.blockstore!=null&&r?.datastore!=null&&r?.gc!=null&&r?.stop!=null&&r?.start!=null}return y8(RP);})();
18
18
  /*! Bundled license information:
19
19
 
20
20
  pvtsutils/build/index.js: