@helia/verified-fetch 0.0.0-3851fe2
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/LICENSE +4 -0
- package/README.md +275 -0
- package/dist/index.min.js +140 -0
- package/dist/src/index.d.ts +271 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +263 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/singleton.d.ts +3 -0
- package/dist/src/singleton.d.ts.map +1 -0
- package/dist/src/singleton.js +15 -0
- package/dist/src/singleton.js.map +1 -0
- package/dist/src/utils/get-content-type.d.ts +11 -0
- package/dist/src/utils/get-content-type.d.ts.map +1 -0
- package/dist/src/utils/get-content-type.js +43 -0
- package/dist/src/utils/get-content-type.js.map +1 -0
- package/dist/src/utils/get-stream-and-content-type.d.ts +10 -0
- package/dist/src/utils/get-stream-and-content-type.d.ts.map +1 -0
- package/dist/src/utils/get-stream-and-content-type.js +37 -0
- package/dist/src/utils/get-stream-and-content-type.js.map +1 -0
- package/dist/src/utils/parse-resource.d.ts +18 -0
- package/dist/src/utils/parse-resource.d.ts.map +1 -0
- package/dist/src/utils/parse-resource.js +24 -0
- package/dist/src/utils/parse-resource.js.map +1 -0
- package/dist/src/utils/parse-url-string.d.ts +26 -0
- package/dist/src/utils/parse-url-string.d.ts.map +1 -0
- package/dist/src/utils/parse-url-string.js +109 -0
- package/dist/src/utils/parse-url-string.js.map +1 -0
- package/dist/src/utils/tlru.d.ts +15 -0
- package/dist/src/utils/tlru.d.ts.map +1 -0
- package/dist/src/utils/tlru.js +40 -0
- package/dist/src/utils/tlru.js.map +1 -0
- package/dist/src/utils/walk-path.d.ts +13 -0
- package/dist/src/utils/walk-path.d.ts.map +1 -0
- package/dist/src/utils/walk-path.js +17 -0
- package/dist/src/utils/walk-path.js.map +1 -0
- package/dist/src/verified-fetch.d.ts +64 -0
- package/dist/src/verified-fetch.d.ts.map +1 -0
- package/dist/src/verified-fetch.js +261 -0
- package/dist/src/verified-fetch.js.map +1 -0
- package/package.json +175 -0
- package/src/index.ts +323 -0
- package/src/singleton.ts +20 -0
- package/src/utils/get-content-type.ts +55 -0
- package/src/utils/get-stream-and-content-type.ts +44 -0
- package/src/utils/parse-resource.ts +40 -0
- package/src/utils/parse-url-string.ts +139 -0
- package/src/utils/tlru.ts +52 -0
- package/src/utils/walk-path.ts +34 -0
- package/src/verified-fetch.ts +323 -0
|
@@ -0,0 +1,140 @@
|
|
|
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 Lb=Object.create;var ga=Object.defineProperty;var Db=Object.getOwnPropertyDescriptor;var Pb=Object.getOwnPropertyNames;var Ob=Object.getPrototypeOf,Fb=Object.prototype.hasOwnProperty;var se=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Be=(n,e)=>{for(var t in e)ga(n,t,{get:e[t],enumerable:!0})},bh=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pb(e))!Fb.call(n,i)&&i!==t&&ga(n,i,{get:()=>e[i],enumerable:!(r=Db(e,i))||r.enumerable});return n};var ee=(n,e,t)=>(t=n!=null?Lb(Ob(n)):{},bh(e||!n||!n.__esModule?ga(t,"default",{value:n,enumerable:!0}):t,n)),Vb=n=>bh(ga({},"__esModule",{value:!0}),n);var Fu=se((U8,Oh)=>{var qi=1e3,Gi=qi*60,Wi=Gi*60,ui=Wi*24,Rv=ui*7,Tv=ui*365.25;Oh.exports=function(n,e){e=e||{};var t=typeof n;if(t==="string"&&n.length>0)return Cv(n);if(t==="number"&&isFinite(n))return e.long?Uv(n):Nv(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function Cv(n){if(n=String(n),!(n.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(n);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*Tv;case"weeks":case"week":case"w":return t*Rv;case"days":case"day":case"d":return t*ui;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Wi;case"minutes":case"minute":case"mins":case"min":case"m":return t*Gi;case"seconds":case"second":case"secs":case"sec":case"s":return t*qi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Nv(n){var e=Math.abs(n);return e>=ui?Math.round(n/ui)+"d":e>=Wi?Math.round(n/Wi)+"h":e>=Gi?Math.round(n/Gi)+"m":e>=qi?Math.round(n/qi)+"s":n+"ms"}function Uv(n){var e=Math.abs(n);return e>=ui?ba(n,e,ui,"day"):e>=Wi?ba(n,e,Wi,"hour"):e>=Gi?ba(n,e,Gi,"minute"):e>=qi?ba(n,e,qi,"second"):n+" ms"}function ba(n,e,t,r){var i=e>=t*1.5;return Math.round(n/t)+" "+r+(i?"s":"")}});var Vh=se((L8,Fh)=>{function Lv(n){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=s,t.humanize=Fu(),t.destroy=u,Object.keys(n).forEach(l=>{t[l]=n[l]}),t.names=[],t.skips=[],t.formatters={};function e(l){let p=0;for(let h=0;h<l.length;h++)p=(p<<5)-p+l.charCodeAt(h),p|=0;return t.colors[Math.abs(p)%t.colors.length]}t.selectColor=e;function t(l){let p,h=null,d,f;function m(...g){if(!m.enabled)return;let x=m,w=Number(new Date),b=w-(p||w);x.diff=b,x.prev=p,x.curr=w,p=w,g[0]=t.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let A=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(k,E)=>{if(k==="%%")return"%";A++;let v=t.formatters[E];if(typeof v=="function"){let R=g[A];k=v.call(x,R),g.splice(A,1),A--}return k}),t.formatArgs.call(x,g),(x.log||t.log).apply(x,g)}return m.namespace=l,m.useColors=t.useColors(),m.color=t.selectColor(l),m.extend=r,m.destroy=t.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==t.namespaces&&(d=t.namespaces,f=t.enabled(l)),f),set:g=>{h=g}}),typeof t.init=="function"&&t.init(m),m}function r(l,p){let h=t(this.namespace+(typeof p>"u"?":":p)+l);return h.log=this.log,h}function i(l){t.save(l),t.namespaces=l,t.names=[],t.skips=[];let p,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(p=0;p<d;p++)h[p]&&(l=h[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,h;for(p=0,h=t.skips.length;p<h;p++)if(t.skips[p].test(l))return!1;for(p=0,h=t.names.length;p<h;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}Fh.exports=Lv});var Vu=se((At,va)=>{At.formatArgs=Pv;At.save=Ov;At.load=Fv;At.useColors=Dv;At.storage=Vv();At.destroy=(()=>{let n=!1;return()=>{n||(n=!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`."))}})();At.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 Dv(){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 Pv(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+va.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;n.splice(1,0,e,"color: inherit");let t=0,r=0;n[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(r=t))}),n.splice(r,0,e)}At.log=console.debug||console.log||(()=>{});function Ov(n){try{n?At.storage.setItem("debug",n):At.storage.removeItem("debug")}catch{}}function Fv(){let n;try{n=At.storage.getItem("debug")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=process.env.DEBUG),n}function Vv(){try{return localStorage}catch{}}va.exports=Vh()(At);var{formatters:zv}=va.exports;zv.j=function(n){try{return JSON.stringify(n)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Te=se((rI,sm)=>{"use strict";function om(n,e){for(let t in e)Object.defineProperty(n,t,{value:e[t],enumerable:!0,configurable:!0});return n}function A2(n,e,t){if(!n||typeof n=="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 om(n,t)}catch{t.message=n.message,t.stack=n.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(n)),om(new i,t)}}sm.exports=A2});var n0=se(mo=>{"use strict";var m3="[object ArrayBuffer]",Yn=class n{static isArrayBuffer(e){return Object.prototype.toString.call(e)===m3}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 r=n.toUint8Array(e),i=n.toUint8Array(t);if(r.length!==i.byteLength)return!1;for(let o=0;o<r.length;o++)if(r[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 r=0;for(let s of t)r+=s.byteLength;let i=new Uint8Array(r),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}},Xp="string",g3=/^[0-9a-f]+$/i,x3=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,y3=/^[a-zA-Z0-9-_]+$/,Ja=class{static fromString(e){let t=unescape(encodeURIComponent(e)),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r.buffer}static toString(e){let t=Yn.toUint8Array(e),r="";for(let o=0;o<t.length;o++)r+=String.fromCharCode(t[o]);return decodeURIComponent(escape(r))}},$t=class{static toString(e,t=!1){let r=Yn.toArrayBuffer(e),i=new DataView(r),o="";for(let s=0;s<r.byteLength;s+=2){let a=i.getUint16(s,t);o+=String.fromCharCode(a)}return o}static fromString(e,t=!1){let r=new ArrayBuffer(e.length*2),i=new DataView(r);for(let o=0;o<e.length;o++)i.setUint16(o*2,e.charCodeAt(o),t);return r}},Qa=class n{static isHex(e){return typeof e===Xp&&g3.test(e)}static isBase64(e){return typeof e===Xp&&x3.test(e)}static isBase64Url(e){return typeof e===Xp&&y3.test(e)}static ToString(e,t="utf8"){let r=Yn.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(r);case"binary":return this.ToBinary(r);case"hex":return this.ToHex(r);case"base64":return this.ToBase64(r);case"base64url":return this.ToBase64Url(r);case"utf16le":return $t.toString(r,!0);case"utf16":case"utf16be":return $t.toString(r);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 $t.fromString(e,!0);case"utf16":case"utf16be":return $t.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=Yn.toUint8Array(e);if(typeof btoa<"u"){let r=this.ToString(t,"binary");return btoa(r)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!n.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(!n.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=n.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return Ja.fromString(e);case"utf16":case"utf16be":return $t.fromString(e);case"utf16le":case"usc2":return $t.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=n.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return Ja.toString(e);case"utf16":case"utf16be":return $t.toString(e);case"utf16le":case"usc2":return $t.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e.charCodeAt(i);return r.buffer}static ToBinary(e){let t=Yn.toUint8Array(e),r="";for(let i=0;i<t.length;i++)r+=String.fromCharCode(t[i]);return r}static ToHex(e){let t=Yn.toUint8Array(e),r="",i=t.length;for(let o=0;o<i;o++){let s=t[o];s<16&&(r+="0"),r+=s.toString(16)}return r}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!n.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i=i+2){let o=t.slice(i,i+2);r[i/2]=parseInt(o,16)}return r.buffer}static ToUtf16String(e,t=!1){return $t.toString(e,t)}static FromUtf16String(e,t=!1){return $t.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let r=0;r<t;r++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Qa.DEFAULT_UTF8_ENCODING="utf8";function w3(n,...e){let t=arguments[0];for(let r=1;r<arguments.length;r++){let i=arguments[r];for(let o in i)t[o]=i[o]}return t}function b3(...n){let e=n.map(i=>i.byteLength).reduce((i,o)=>i+o),t=new Uint8Array(e),r=0;return n.map(i=>new Uint8Array(i)).forEach(i=>{for(let o of i)t[r++]=o}),t.buffer}function v3(n,e){if(!(n&&e)||n.byteLength!==e.byteLength)return!1;let t=new Uint8Array(n),r=new Uint8Array(e);for(let i=0;i<n.byteLength;i++)if(t[i]!==r[i])return!1;return!0}mo.BufferSourceConverter=Yn;mo.Convert=Qa;mo.assign=w3;mo.combine=b3;mo.isEqual=v3});var jc=se((bT,pd)=>{var wT=function(){typeof pd<"u"&&(pd.exports=m);var n=86400,e=3200,t=146097*e/400,r=n*t,i=1e3*r,o=864e13,s=4294967296,a=1e6,c="000000000",u=Math.trunc||function(v){var R=v-v%1;return R==0&&(v<0||v===0&&1/v!=1/0)?-0:R},l=m.prototype,p=(m.fromDate=function(v){return new m(+v)},m.fromInt64BE=A(0,1,2,3,0,4),m.fromInt64LE=A(3,2,1,0,4,0),m.fromString=function(C){var R,N=new m,C=(C+="").replace(/^\s*[+\-]?\d+/,function(D){var D=+D,ie=1970+(D-1970)%400;return N.year=D-ie,ie}).replace(/(?:Z|([+\-]\d{2}):?(\d{2}))$/,function(M,D,ie){return D<0&&(ie*=-1),R=6e4*(60*+D+ +ie),""}).replace(/\.\d+$/,function(M){return N.nano=+(M+c).substr(1,9),""}).split(/\D+/);if(1<C.length?C[1]--:C[1]=0,N.time=R=Date.UTC.apply(Date,C)-(R||0),isNaN(R))throw new TypeError("Invalid Date");return g(N)},m.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=g(this);return(v.time%1e3*a+ +v.nano+1e9)%1e9},l.getTimeT=function(){var R=g(this),v=Math.floor(R.time/1e3),R=R.year;return R&&(v+=R*t*n/e),v},l.getYear=function(){return this.toDate().getUTCFullYear()+this.year},l.toDate=function(){return x(g(this).time)},l.toJSON=function(){return this.toString().replace(/0{1,6}Z$/,"Z")},l.toString=function(v){var R=this,N=R.toDate(),C={H:function(){return k(N.getUTCHours())},L:function(){return E(N.getUTCMilliseconds(),3)},M:function(){return k(N.getUTCMinutes())},N:function(){return E(R.getNano(),9)},S:function(){return k(N.getUTCSeconds())},Y:function(){var M=R.getYear();return 999999<M?"+"+M:9999<M?"+"+E(M,6):0<=M?E(M,4):-999999<=M?"-"+E(-M,6):M},a:function(){return d[N.getUTCDay()]},b:function(){return h[N.getUTCMonth()]},d:function(){return k(N.getUTCDate())},e:function(){return function(M){return(9<M?"":" ")+(0|M)}(N.getUTCDate())},m:function(){return k(N.getUTCMonth()+1)}};return function M(D){return D.replace(/%./g,function(ie){var L=ie[1],S=f[L],L=C[L];return S?M(S):L?L():ie})}(v||p)},l.writeInt64BE=b(0,1,2,3,0,4),l.writeInt64LE=b(3,2,1,0,4,0),"%Y-%m-%dT%H:%M:%S.%NZ"),h=["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 m;function m(v,R,N){var C=this;if(!(C instanceof m))return new m(v,R,N);C.time=+v||0,C.nano=+R||0,C.year=+N||0,g(C)}function g(v){var R,N,C,M=v.year,D=v.time,ie=v.nano,S=((ie<0||a<=ie)&&(ie-=(N=Math.floor(ie/a))*a,D+=N,N=1),M%e);return(D<-o||o<D||S)&&((R=u(D/i))&&(M+=R*e,D-=R*i),(C=x(D)).setUTCFullYear(S+C.getUTCFullYear()),C=(D=+C)+(R=u((M-=S)/e))*i,R&&-o<=C&&C<=o&&(M-=R*e,D=C),N=1),N&&(v.year=M,v.time=D,v.nano=ie),v}function x(v){var R=new Date(0);return R.setTime(v),R}function w(M,C){M=+M||0;var N=u((C=(C|0)*s)/r)+u(M/r),C=C%r+M%r,M=u(C/r);return M&&(N+=M,C-=M*r),new m(1e3*C,0,N*e)}function b(v,R,N,C,M,D){return function(S,L){var U=g(this);S=S||new Array(8),B(S,L|=0);var _=Math.floor(U.time/1e3),U=U.year*(t*n/e),X=u(U/s)+u(_/s),U=U%s+_%s,_=Math.floor(U/s);return _&&(X+=_,U-=_*s),ie(S,L+M,X),ie(S,L+D,U),S};function ie(S,L,X){S[L+v]=X>>24&255,S[L+R]=X>>16&255,S[L+N]=X>>8&255,S[L+C]=255&X}}function A(v,R,N,C,M,D){return function(S,L){B(S,L|=0);var X=ie(S,L+M);return w(ie(S,L+D),X)};function ie(S,L){return 16777216*S[L+v]+(S[L+R]<<16|S[L+N]<<8|S[L+C])}}function B(v,R){if(v=v&&v.length,v==null)throw new TypeError("Invalid Buffer");if(v<R+8)throw new RangeError("Out of range")}function k(v){return(9<v?"":"0")+(0|v)}function E(v,R){return(c+(0|v)).substr(-R)}}()});var C1=se((rN,Bd)=>{"use strict";var M6=Object.prototype.hasOwnProperty,ut="~";function Ds(){}Object.create&&(Ds.prototype=Object.create(null),new Ds().__proto__||(ut=!1));function j6(n,e,t){this.fn=n,this.context=e,this.once=t||!1}function T1(n,e,t,r,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var o=new j6(t,r||n,i),s=ut?ut+e:e;return n._events[s]?n._events[s].fn?n._events[s]=[n._events[s],o]:n._events[s].push(o):(n._events[s]=o,n._eventsCount++),n}function ol(n,e){--n._eventsCount===0?n._events=new Ds:delete n._events[e]}function it(){this._events=new Ds,this._eventsCount=0}it.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)M6.call(t,r)&&e.push(ut?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};it.prototype.listeners=function(e){var t=ut?ut+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i<o;i++)s[i]=r[i].fn;return s};it.prototype.listenerCount=function(e){var t=ut?ut+e:e,r=this._events[t];return r?r.fn?1:r.length:0};it.prototype.emit=function(e,t,r,i,o,s){var a=ut?ut+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,r),!0;case 4:return c.fn.call(c.context,t,r,i),!0;case 5:return c.fn.call(c.context,t,r,i,o),!0;case 6:return c.fn.call(c.context,t,r,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 h=c.length,d;for(p=0;p<h;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,r);break;case 4:c[p].fn.call(c[p].context,t,r,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};it.prototype.on=function(e,t,r){return T1(this,e,t,r,!1)};it.prototype.once=function(e,t,r){return T1(this,e,t,r,!0)};it.prototype.removeListener=function(e,t,r,i){var o=ut?ut+e:e;if(!this._events[o])return this;if(!t)return ol(this,o),this;var s=this._events[o];if(s.fn)s.fn===t&&(!i||s.once)&&(!r||s.context===r)&&ol(this,o);else{for(var a=0,c=[],u=s.length;a<u;a++)(s[a].fn!==t||i&&!s[a].once||r&&s[a].context!==r)&&c.push(s[a]);c.length?this._events[o]=c.length===1?c[0]:c:ol(this,o)}return this};it.prototype.removeAllListeners=function(e){var t;return e?(t=ut?ut+e:e,this._events[t]&&ol(this,t)):(this._events=new Ds,this._eventsCount=0),this};it.prototype.off=it.prototype.removeListener;it.prototype.addListener=it.prototype.on;it.prefixed=ut;it.EventEmitter=it;typeof Bd<"u"&&(Bd.exports=it)});var Sx=se((PP,Ix)=>{"use strict";Ix.exports=Bx;var H4=Fu(),Jr=Bx.prototype,$4=new Date%1e9;function K4(){return(Math.random()*1e9>>>0)+$4++}function Bx(n){n=n||{},this.id=n.id||K4(),this.max=n.max||1/0,this.items=n.items||[],this._lookup={},this.size=this.items.length,this.lastModified=new Date(n.lastModified||new Date);for(var e,t,r=this.items.length;r--;)e=this.items[r],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)}Jr.has=function(n){return n in this._lookup};Jr.get=function(n){if(!this.has(n))return null;var e=this._lookup[n];return e.refresh&&this.expire(n,e.refresh),this.items.splice(this.items.indexOf(e),1),this.items.push(e),e.value};Jr.meta=function(n){if(!this.has(n))return null;var e=this._lookup[n];return"meta"in e?e.meta:null};Jr.set=function(n,e,t){var r=this._lookup[n],i=this._lookup[n]={key:n,value:e};return this.lastModified=new Date,r?(clearTimeout(r.timeout),this.items.splice(this.items.indexOf(r),1,i)):(this.size>=this.max&&this.delete(this.items[0].key),this.items.push(i),this.size++),t&&("ttl"in t&&this.expire(n,t.ttl),"meta"in t&&(i.meta=t.meta),t.refresh&&(i.refresh=t.ttl)),this};Jr.delete=function(n){var e=this._lookup[n];return e?(this.lastModified=new Date,this.items.splice(this.items.indexOf(e),1),clearTimeout(e.timeout),delete this._lookup[n],this.size--,this):!1};Jr.expire=function(n,e){var t=e||0,r=this._lookup[n];if(!r)return this;if(typeof t=="string"&&(t=H4(e)),typeof t!="number")throw new TypeError("Expiration time must be a string or number.");return clearTimeout(r.timeout),r.timeout=setTimeout(this.delete.bind(this,r.key),t),r.expires=Number(new Date)+t,this};Jr.clear=function(){for(var n=this.items.length;n--;)this.delete(this.items[n].key);return this};Jr.toJSON=function(){for(var n=new Array(this.items.length),e,t=n.length;t--;)e=this.items[t],n[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:n}}});var cf=se((FP,Tx)=>{Tx.exports=function(n){if(!n)throw Error("hashlru must have a max value, of type number, greater than 0");var e=0,t=Object.create(null),r=Object.create(null);function i(o,s){t[o]=s,e++,e>=n&&(e=0,r=t,t=Object.create(null))}return{has:function(o){return t[o]!==void 0||r[o]!==void 0},remove:function(o){t[o]!==void 0&&(t[o]=void 0),r[o]!==void 0&&(r[o]=void 0)},get:function(o){var s=t[o];if(s!==void 0)return s;if((s=r[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),r=Object.create(null)}}}});var $x=se(Tl=>{"use strict";Tl.byteLength=ek;Tl.toByteArray=nk;Tl.fromByteArray=ok;var _n=[],Wt=[],Q4=typeof Uint8Array<"u"?Uint8Array:Array,hf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ni=0,jx=hf.length;Ni<jx;++Ni)_n[Ni]=hf[Ni],Wt[hf.charCodeAt(Ni)]=Ni;var Ni,jx;Wt[45]=62;Wt[95]=63;function Hx(n){var e=n.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=e);var r=t===e?0:4-t%4;return[t,r]}function ek(n){var e=Hx(n),t=e[0],r=e[1];return(t+r)*3/4-r}function tk(n,e,t){return(e+t)*3/4-t}function nk(n){var e,t=Hx(n),r=t[0],i=t[1],o=new Q4(tk(n,r,i)),s=0,a=i>0?r-4:r,c;for(c=0;c<a;c+=4)e=Wt[n.charCodeAt(c)]<<18|Wt[n.charCodeAt(c+1)]<<12|Wt[n.charCodeAt(c+2)]<<6|Wt[n.charCodeAt(c+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=Wt[n.charCodeAt(c)]<<2|Wt[n.charCodeAt(c+1)]>>4,o[s++]=e&255),i===1&&(e=Wt[n.charCodeAt(c)]<<10|Wt[n.charCodeAt(c+1)]<<4|Wt[n.charCodeAt(c+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function rk(n){return _n[n>>18&63]+_n[n>>12&63]+_n[n>>6&63]+_n[n&63]}function ik(n,e,t){for(var r,i=[],o=e;o<t;o+=3)r=(n[o]<<16&16711680)+(n[o+1]<<8&65280)+(n[o+2]&255),i.push(rk(r));return i.join("")}function ok(n){for(var e,t=n.length,r=t%3,i=[],o=16383,s=0,a=t-r;s<a;s+=o)i.push(ik(n,s,s+o>a?a:s+o));return r===1?(e=n[t-1],i.push(_n[e>>2]+_n[e<<4&63]+"==")):r===2&&(e=(n[t-2]<<8)+n[t-1],i.push(_n[e>>10]+_n[e>>4&63]+_n[e<<2&63]+"=")),i.join("")}});var Kx=se(mf=>{mf.read=function(n,e,t,r,i){var o,s,a=i*8-r-1,c=(1<<a)-1,u=c>>1,l=-7,p=t?i-1:0,h=t?-1:1,d=n[e+p];for(p+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=o*256+n[e+p],p+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=s*256+n[e+p],p+=h,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,r),o=o-u}return(d?-1:1)*s*Math.pow(2,o-r)};mf.write=function(n,e,t,r,i,o){var s,a,c,u=o*8-i-1,l=(1<<u)-1,p=l>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,f=r?1:-1,m=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+=h/c:e+=h*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;n[t+d]=a&255,d+=f,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;n[t+d]=s&255,d+=f,s/=256,u-=8);n[t+d-f]|=m*128}});var Af=se(Oo=>{"use strict";var gf=$x(),Do=Kx(),qx=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Oo.Buffer=I;Oo.SlowBuffer=pk;Oo.INSPECT_MAX_BYTES=50;var Cl=2147483647;Oo.kMaxLength=Cl;I.TYPED_ARRAY_SUPPORT=sk();!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 sk(){try{let n=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(n,e),n.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 lr(n){if(n>Cl)throw new RangeError('The value "'+n+'" is invalid for option "size"');let e=new Uint8Array(n);return Object.setPrototypeOf(e,I.prototype),e}function I(n,e,t){if(typeof n=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return bf(n)}return Xx(n,e,t)}I.poolSize=8192;function Xx(n,e,t){if(typeof n=="string")return ck(n,e);if(ArrayBuffer.isView(n))return lk(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(Rn(n,ArrayBuffer)||n&&Rn(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Rn(n,SharedArrayBuffer)||n&&Rn(n.buffer,SharedArrayBuffer)))return yf(n,e,t);if(typeof n=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=n.valueOf&&n.valueOf();if(r!=null&&r!==n)return I.from(r,e,t);let i=uk(n);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return I.from(n[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 n)}I.from=function(n,e,t){return Xx(n,e,t)};Object.setPrototypeOf(I.prototype,Uint8Array.prototype);Object.setPrototypeOf(I,Uint8Array);function Zx(n){if(typeof n!="number")throw new TypeError('"size" argument must be of type number');if(n<0)throw new RangeError('The value "'+n+'" is invalid for option "size"')}function ak(n,e,t){return Zx(n),n<=0?lr(n):e!==void 0?typeof t=="string"?lr(n).fill(e,t):lr(n).fill(e):lr(n)}I.alloc=function(n,e,t){return ak(n,e,t)};function bf(n){return Zx(n),lr(n<0?0:vf(n)|0)}I.allocUnsafe=function(n){return bf(n)};I.allocUnsafeSlow=function(n){return bf(n)};function ck(n,e){if((typeof e!="string"||e==="")&&(e="utf8"),!I.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Jx(n,e)|0,r=lr(t),i=r.write(n,e);return i!==t&&(r=r.slice(0,i)),r}function xf(n){let e=n.length<0?0:vf(n.length)|0,t=lr(e);for(let r=0;r<e;r+=1)t[r]=n[r]&255;return t}function lk(n){if(Rn(n,Uint8Array)){let e=new Uint8Array(n);return yf(e.buffer,e.byteOffset,e.byteLength)}return xf(n)}function yf(n,e,t){if(e<0||n.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(n.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&t===void 0?r=new Uint8Array(n):t===void 0?r=new Uint8Array(n,e):r=new Uint8Array(n,e,t),Object.setPrototypeOf(r,I.prototype),r}function uk(n){if(I.isBuffer(n)){let e=vf(n.length)|0,t=lr(e);return t.length===0||n.copy(t,0,0,e),t}if(n.length!==void 0)return typeof n.length!="number"||kf(n.length)?lr(0):xf(n);if(n.type==="Buffer"&&Array.isArray(n.data))return xf(n.data)}function vf(n){if(n>=Cl)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Cl.toString(16)+" bytes");return n|0}function pk(n){return+n!=n&&(n=0),I.alloc(+n)}I.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==I.prototype};I.compare=function(e,t){if(Rn(e,Uint8Array)&&(e=I.from(e,e.offset,e.byteLength)),Rn(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 r=e.length,i=t.length;for(let o=0,s=Math.min(r,i);o<s;++o)if(e[o]!==t[o]){r=e[o],i=t[o];break}return r<i?-1:i<r?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 r;if(t===void 0)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let i=I.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){let s=e[r];if(Rn(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 Jx(n,e){if(I.isBuffer(n))return n.length;if(ArrayBuffer.isView(n)||Rn(n,ArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);let t=n.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&t===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return wf(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return ay(n).length;default:if(i)return r?-1:wf(n).length;e=(""+e).toLowerCase(),i=!0}}I.byteLength=Jx;function dk(n,e,t){let r=!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(n||(n="utf8");;)switch(n){case"hex":return Ek(this,e,t);case"utf8":case"utf-8":return ey(this,e,t);case"ascii":return bk(this,e,t);case"latin1":case"binary":return vk(this,e,t);case"base64":return yk(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kk(this,e,t);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}I.prototype._isBuffer=!0;function Ui(n,e,t){let r=n[e];n[e]=n[t],n[t]=r}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)Ui(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)Ui(this,t,t+3),Ui(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)Ui(this,t,t+7),Ui(this,t+1,t+6),Ui(this,t+2,t+5),Ui(this,t+3,t+4);return this};I.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?ey(this,0,e):dk.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=Oo.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};qx&&(I.prototype[qx]=I.prototype.inspect);I.prototype.compare=function(e,t,r,i,o){if(Rn(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),r===void 0&&(r=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),t<0||r>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=r)return 0;if(i>=o)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,o>>>=0,this===e)return 0;let s=o-i,a=r-t,c=Math.min(s,a),u=this.slice(i,o),l=e.slice(t,r);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 Qx(n,e,t,r,i){if(n.length===0)return-1;if(typeof t=="string"?(r=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,kf(t)&&(t=i?0:n.length-1),t<0&&(t=n.length+t),t>=n.length){if(i)return-1;t=n.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=I.from(e,r)),I.isBuffer(e))return e.length===0?-1:Gx(n,e,t,r,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,e,t):Uint8Array.prototype.lastIndexOf.call(n,e,t):Gx(n,[e],t,r,i);throw new TypeError("val must be string, number or Buffer")}function Gx(n,e,t,r,i){let o=1,s=n.length,a=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.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(n,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(n,u+p)!==c(e,p)){l=!1;break}if(l)return u}return-1}I.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1};I.prototype.indexOf=function(e,t,r){return Qx(this,e,t,r,!0)};I.prototype.lastIndexOf=function(e,t,r){return Qx(this,e,t,r,!1)};function fk(n,e,t,r){t=Number(t)||0;let i=n.length-t;r?(r=Number(r),r>i&&(r=i)):r=i;let o=e.length;r>o/2&&(r=o/2);let s;for(s=0;s<r;++s){let a=parseInt(e.substr(s*2,2),16);if(kf(a))return s;n[t+s]=a}return s}function hk(n,e,t,r){return Nl(wf(e,n.length-t),n,t,r)}function mk(n,e,t,r){return Nl(Sk(e),n,t,r)}function gk(n,e,t,r){return Nl(ay(e),n,t,r)}function xk(n,e,t,r){return Nl(_k(e,n.length-t),n,t,r)}I.prototype.write=function(e,t,r,i){if(t===void 0)i="utf8",r=this.length,t=0;else if(r===void 0&&typeof t=="string")i=t,r=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(r)?(r=r>>>0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((r===void 0||r>o)&&(r=o),e.length>0&&(r<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 fk(this,e,t,r);case"utf8":case"utf-8":return hk(this,e,t,r);case"ascii":case"latin1":case"binary":return mk(this,e,t,r);case"base64":return gk(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xk(this,e,t,r);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 yk(n,e,t){return e===0&&t===n.length?gf.fromByteArray(n):gf.fromByteArray(n.slice(e,t))}function ey(n,e,t){t=Math.min(n.length,t);let r=[],i=e;for(;i<t;){let o=n[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=n[i+1],(c&192)===128&&(p=(o&31)<<6|c&63,p>127&&(s=p));break;case 3:c=n[i+1],u=n[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=n[i+1],u=n[i+2],l=n[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,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),i+=a}return wk(r)}var Wx=4096;function wk(n){let e=n.length;if(e<=Wx)return String.fromCharCode.apply(String,n);let t="",r=0;for(;r<e;)t+=String.fromCharCode.apply(String,n.slice(r,r+=Wx));return t}function bk(n,e,t){let r="";t=Math.min(n.length,t);for(let i=e;i<t;++i)r+=String.fromCharCode(n[i]&127);return r}function vk(n,e,t){let r="";t=Math.min(n.length,t);for(let i=e;i<t;++i)r+=String.fromCharCode(n[i]);return r}function Ek(n,e,t){let r=n.length;(!e||e<0)&&(e=0),(!t||t<0||t>r)&&(t=r);let i="";for(let o=e;o<t;++o)i+=Rk[n[o]];return i}function kk(n,e,t){let r=n.slice(e,t),i="";for(let o=0;o<r.length-1;o+=2)i+=String.fromCharCode(r[o]+r[o+1]*256);return i}I.prototype.slice=function(e,t){let r=this.length;e=~~e,t=t===void 0?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t<e&&(t=e);let i=this.subarray(e,t);return Object.setPrototypeOf(i,I.prototype),i};function $e(n,e,t){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+e>t)throw new RangeError("Trying to access beyond buffer length")}I.prototype.readUintLE=I.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||$e(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,r){e=e>>>0,t=t>>>0,r||$e(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||$e(e,1,this.length),this[e]};I.prototype.readUint16LE=I.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||$e(e,2,this.length),this[e]|this[e+1]<<8};I.prototype.readUint16BE=I.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||$e(e,2,this.length),this[e]<<8|this[e+1]};I.prototype.readUint32LE=I.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||$e(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||$e(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};I.prototype.readBigUInt64LE=ei(function(e){e=e>>>0,Po(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Ys(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+r*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});I.prototype.readBigUInt64BE=ei(function(e){e=e>>>0,Po(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Ys(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+r;return(BigInt(i)<<BigInt(32))+BigInt(o)});I.prototype.readIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||$e(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,r){e=e>>>0,t=t>>>0,r||$e(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||$e(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};I.prototype.readInt16LE=function(e,t){e=e>>>0,t||$e(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};I.prototype.readInt16BE=function(e,t){e=e>>>0,t||$e(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};I.prototype.readInt32LE=function(e,t){return e=e>>>0,t||$e(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||$e(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};I.prototype.readBigInt64LE=ei(function(e){e=e>>>0,Po(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Ys(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});I.prototype.readBigInt64BE=ei(function(e){e=e>>>0,Po(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Ys(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+r)});I.prototype.readFloatLE=function(e,t){return e=e>>>0,t||$e(e,4,this.length),Do.read(this,e,!0,23,4)};I.prototype.readFloatBE=function(e,t){return e=e>>>0,t||$e(e,4,this.length),Do.read(this,e,!1,23,4)};I.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||$e(e,8,this.length),Do.read(this,e,!0,52,8)};I.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||$e(e,8,this.length),Do.read(this,e,!1,52,8)};function bt(n,e,t,r,i,o){if(!I.isBuffer(n))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+r>n.length)throw new RangeError("Index out of range")}I.prototype.writeUintLE=I.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t=t>>>0,r=r>>>0,!i){let a=Math.pow(2,8*r)-1;bt(this,e,t,r,a,0)}let o=1,s=0;for(this[t]=e&255;++s<r&&(o*=256);)this[t+s]=e/o&255;return t+r};I.prototype.writeUintBE=I.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t=t>>>0,r=r>>>0,!i){let a=Math.pow(2,8*r)-1;bt(this,e,t,r,a,0)}let o=r-1,s=1;for(this[t+o]=e&255;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+r};I.prototype.writeUint8=I.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||bt(this,e,t,1,255,0),this[t]=e&255,t+1};I.prototype.writeUint16LE=I.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||bt(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,r){return e=+e,t=t>>>0,r||bt(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,r){return e=+e,t=t>>>0,r||bt(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,r){return e=+e,t=t>>>0,r||bt(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 ty(n,e,t,r,i){sy(e,r,i,n,t,7);let o=Number(e&BigInt(4294967295));n[t++]=o,o=o>>8,n[t++]=o,o=o>>8,n[t++]=o,o=o>>8,n[t++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return n[t++]=s,s=s>>8,n[t++]=s,s=s>>8,n[t++]=s,s=s>>8,n[t++]=s,t}function ny(n,e,t,r,i){sy(e,r,i,n,t,7);let o=Number(e&BigInt(4294967295));n[t+7]=o,o=o>>8,n[t+6]=o,o=o>>8,n[t+5]=o,o=o>>8,n[t+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return n[t+3]=s,s=s>>8,n[t+2]=s,s=s>>8,n[t+1]=s,s=s>>8,n[t]=s,t+8}I.prototype.writeBigUInt64LE=ei(function(e,t=0){return ty(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});I.prototype.writeBigUInt64BE=ei(function(e,t=0){return ny(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});I.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*r-1);bt(this,e,t,r,c-1,-c)}let o=0,s=1,a=0;for(this[t]=e&255;++o<r&&(s*=256);)e<0&&a===0&&this[t+o-1]!==0&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r};I.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*r-1);bt(this,e,t,r,c-1,-c)}let o=r-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+r};I.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||bt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};I.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||bt(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};I.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||bt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};I.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||bt(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,r){return e=+e,t=t>>>0,r||bt(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=ei(function(e,t=0){return ty(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});I.prototype.writeBigInt64BE=ei(function(e,t=0){return ny(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ry(n,e,t,r,i,o){if(t+r>n.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function iy(n,e,t,r,i){return e=+e,t=t>>>0,i||ry(n,e,t,4,34028234663852886e22,-34028234663852886e22),Do.write(n,e,t,r,23,4),t+4}I.prototype.writeFloatLE=function(e,t,r){return iy(this,e,t,!0,r)};I.prototype.writeFloatBE=function(e,t,r){return iy(this,e,t,!1,r)};function oy(n,e,t,r,i){return e=+e,t=t>>>0,i||ry(n,e,t,8,17976931348623157e292,-17976931348623157e292),Do.write(n,e,t,r,52,8),t+8}I.prototype.writeDoubleLE=function(e,t,r){return oy(this,e,t,!0,r)};I.prototype.writeDoubleBE=function(e,t,r){return oy(this,e,t,!1,r)};I.prototype.copy=function(e,t,r,i){if(!I.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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-r&&(i=e.length-t+r);let o=i-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,r,i):Uint8Array.prototype.set.call(e,this.subarray(r,i),t),o};I.prototype.fill=function(e,t,r,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,r=this.length):typeof r=="string"&&(i=r,r=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<r)throw new RangeError("Out of range index");if(r<=t)return this;t=t>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let o;if(typeof e=="number")for(o=t;o<r;++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<r-t;++o)this[o+t]=s[o%a]}return this};var Lo={};function Ef(n,e,t){Lo[n]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${n}]`,this.stack,delete this.name}get code(){return n}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${n}]: ${this.message}`}}}Ef("ERR_BUFFER_OUT_OF_BOUNDS",function(n){return n?`${n} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Ef("ERR_INVALID_ARG_TYPE",function(n,e){return`The "${n}" argument must be of type number. Received type ${typeof e}`},TypeError);Ef("ERR_OUT_OF_RANGE",function(n,e,t){let r=`The value of "${n}" is out of range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Yx(String(t)):typeof t=="bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Yx(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r},RangeError);function Yx(n){let e="",t=n.length,r=n[0]==="-"?1:0;for(;t>=r+4;t-=3)e=`_${n.slice(t-3,t)}${e}`;return`${n.slice(0,t)}${e}`}function Ak(n,e,t){Po(e,"offset"),(n[e]===void 0||n[e+t]===void 0)&&Ys(e,n.length-(t+1))}function sy(n,e,t,r,i,o){if(n>t||n<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 Lo.ERR_OUT_OF_RANGE("value",a,n)}Ak(r,i,o)}function Po(n,e){if(typeof n!="number")throw new Lo.ERR_INVALID_ARG_TYPE(e,"number",n)}function Ys(n,e,t){throw Math.floor(n)!==n?(Po(n,t),new Lo.ERR_OUT_OF_RANGE(t||"offset","an integer",n)):e<0?new Lo.ERR_BUFFER_OUT_OF_BOUNDS:new Lo.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,n)}var Bk=/[^+/0-9A-Za-z-_]/g;function Ik(n){if(n=n.split("=")[0],n=n.trim().replace(Bk,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function wf(n,e){e=e||1/0;let t,r=n.length,i=null,o=[];for(let s=0;s<r;++s){if(t=n.charCodeAt(s),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===r){(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 Sk(n){let e=[];for(let t=0;t<n.length;++t)e.push(n.charCodeAt(t)&255);return e}function _k(n,e){let t,r,i,o=[];for(let s=0;s<n.length&&!((e-=2)<0);++s)t=n.charCodeAt(s),r=t>>8,i=t%256,o.push(i),o.push(r);return o}function ay(n){return gf.toByteArray(Ik(n))}function Nl(n,e,t,r){let i;for(i=0;i<r&&!(i+t>=e.length||i>=n.length);++i)e[i+t]=n[i];return i}function Rn(n,e){return n instanceof e||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===e.name}function kf(n){return n!==n}var Rk=function(){let n="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let r=t*16;for(let i=0;i<16;++i)e[r+i]=n[t]+n[i]}return e}();function ei(n){return typeof BigInt>"u"?Tk:n}function Tk(){throw new Error("BigInt not supported")}});var cy=se(Bf=>{"use strict";Bf.toString=function(n){switch(n){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_"+n};Bf.toType=function(n){switch(n.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 n.toUpperCase().startsWith("UNKNOWN_")?parseInt(n.slice(8)):0}});var ly=se(If=>{"use strict";If.toString=function(n){switch(n){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_"+n};If.toRcode=function(n){switch(n.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 uy=se(Sf=>{"use strict";Sf.toString=function(n){switch(n){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_"+n};Sf.toOpcode=function(n){switch(n.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 py=se(_f=>{"use strict";_f.toString=function(n){switch(n){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+n};_f.toClass=function(n){switch(n.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var dy=se(Rf=>{"use strict";Rf.toString=function(n){switch(n){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 n<0?null:`OPTION_${n}`};Rf.toCode=function(n){if(typeof n=="number")return n;if(!n)return-1;switch(n.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=n.match(/_(\d+)$/);return e?parseInt(e[1],10):-1}});var my=se((hy,Tf)=>{var fy=function(n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.decode=p,n.encode=l,n.familyOf=u,n.name=void 0,n.sizeOf=c,n.v6=n.v4=void 0;let e=/^(\d{1,3}\.){3,3}\d{1,3}$/,t=4,r=/^(::)?(((\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:h=>e.test(h),encode(h,d,f){f=~~f,d=d||new Uint8Array(f+t);let m=h.length,g=0;for(let x=0;x<m;){let w=h.charCodeAt(x++);w===46?(d[f++]=g,g=0):g=g*10+(w-48)}return d[f]=g,d},decode(h,d){return d=~~d,`${h[d++]}.${h[d++]}.${h[d++]}.${h[d]}`}};n.v4=o;let s={name:"v6",size:i,isFormat:h=>h.length>0&&r.test(h),encode(h,d,f){f=~~f;let m=f+i,g=-1,x=0,w=0,b=!0,A=!1;d=d||new Uint8Array(f+i);for(let B=0;B<h.length;B++){let k=h.charCodeAt(B);k===58?(b?g!==-1?(f<m&&(d[f]=0),f<m-1&&(d[f+1]=0),f+=2):f<m&&(g=f):(A===!0?(f<m&&(d[f]=w),f++):(f<m&&(d[f]=x>>8),f<m-1&&(d[f+1]=x&255),f+=2),x=0,w=0),b=!0,A=!1):k===46?(f<m&&(d[f]=w),f++,w=0,x=0,b=!1,A=!0):(b=!1,k>=97?k-=87:k>=65?k-=55:(k-=48,w=w*10+k),x=(x<<4)+k)}if(b===!1)A===!0?(f<m&&(d[f]=w),f++):(f<m&&(d[f]=x>>8),f<m-1&&(d[f+1]=x&255),f+=2);else if(g===0)f<m&&(d[f]=0),f<m-1&&(d[f+1]=0),f+=2;else if(g!==-1){f+=2;for(let B=Math.min(f-1,m-1);B>=g+2;B--)d[B]=d[B-2];d[g]=0,d[g+1]=0,g=f}if(g!==f&&g!==-1)for(f>m-2&&(f=m-2);m>g;)d[--m]=f<m&&f>g?d[--f]:0;else for(;f<m;)d[f++]=0;return d},decode(h,d){d=~~d;let f="";for(let m=0;m<i;m+=2)m!==0&&(f+=":"),f+=(h[d+m]<<8|h[d+m+1]).toString(16);return f.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};n.v6=s;let a="ip";n.name=a;function c(h){if(o.isFormat(h))return o.size;if(s.isFormat(h))return s.size;throw Error(`Invalid ip address: ${h}`)}function u(h){return c(h)===o.size?1:2}function l(h,d,f){f=~~f;let m=c(h);return typeof d=="function"&&(d=d(f+m)),m===o.size?o.encode(h,d,f):s.encode(h,d,f)}function p(h,d,f){if(d=~~d,f=f||h.length-d,f===o.size)return o.decode(h,d,f);if(f===s.size)return s.decode(h,d,f);throw Error(`Invalid buffer size needs to be ${o.size} for v4 or ${s.size} for v6.`)}return"default"in n?n.default:n}({});typeof define=="function"&&define.amd?define([],function(){return fy}):typeof Tf=="object"&&typeof hy=="object"&&(Tf.exports=fy)});var yy=se(K=>{"use strict";var q=Af().Buffer,wr=cy(),Ck=ly(),Nk=uy(),Ll=py(),Cf=dy(),Li=my(),Uk=0,gy=32768,Nf=32768,Lk=~Nf,xy=32768,Dk=~xy,z=K.name={};z.encode=function(n,e,t,{mail:r=!1}={}){e||(e=q.alloc(z.encodingLength(n))),t||(t=0);let i=t,o=n.replace(/^\.|\.$/gm,"");if(o.length){let s=[];if(r){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,z.encode.bytes=t-i,e};z.encode.bytes=0;z.decode=function(n,e,{mail:t=!1}={}){e||(e=0);let r=[],i=e,o=0,s=0,a=!1;for(;;){if(e>=n.length)throw new Error("Cannot decode name (buffer overflow)");let c=n[e++];if(s+=a?0:1,c===0)break;if(c&192)if((c&192)===192){if(e+1>n.length)throw new Error("Cannot decode name (buffer overflow)");let u=n.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>n.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=n.toString("utf-8",e,e+c);t&&(u=u.replace(/\./g,"\\.")),r.push(u),e+=c,s+=a?0:c}}return z.decode.bytes=s,r.length===0?".":r.join(".")};z.decode.bytes=0;z.encodingLength=function(n){return n==="."||n===".."?1:q.byteLength(n.replace(/^\.|\.$/gm,""))+2};var te={};te.encode=function(n,e,t){e||(e=q.alloc(te.encodingLength(n))),t||(t=0);let r=e.write(n,t+1);return e[t]=r,te.encode.bytes=r+1,e};te.encode.bytes=0;te.decode=function(n,e){e||(e=0);let t=n[e],r=n.toString("utf-8",e+1,e+1+t);return te.decode.bytes=t+1,r};te.decode.bytes=0;te.encodingLength=function(n){return q.byteLength(n)+1};var pn={};pn.encode=function(n,e,t){e||(e=pn.encodingLength(n)),t||(t=0);let r=(n.flags||0)&32767,i=n.type==="response"?gy:Uk;return e.writeUInt16BE(n.id||0,t),e.writeUInt16BE(r|i,t+2),e.writeUInt16BE(n.questions.length,t+4),e.writeUInt16BE(n.answers.length,t+6),e.writeUInt16BE(n.authorities.length,t+8),e.writeUInt16BE(n.additionals.length,t+10),e};pn.encode.bytes=12;pn.decode=function(n,e){if(e||(e=0),n.length<12)throw new Error("Header must be 12 bytes");let t=n.readUInt16BE(e+2);return{id:n.readUInt16BE(e),type:t&gy?"response":"query",flags:t&32767,flag_qr:(t>>15&1)===1,opcode:Nk.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:Ck.toString(t&15),questions:new Array(n.readUInt16BE(e+4)),answers:new Array(n.readUInt16BE(e+6)),authorities:new Array(n.readUInt16BE(e+8)),additionals:new Array(n.readUInt16BE(e+10))}};pn.decode.bytes=12;pn.encodingLength=function(){return 12};var ur=K.unknown={};ur.encode=function(n,e,t){return e||(e=q.alloc(ur.encodingLength(n))),t||(t=0),e.writeUInt16BE(n.length,t),n.copy(e,t+2),ur.encode.bytes=n.length+2,e};ur.encode.bytes=0;ur.decode=function(n,e){e||(e=0);let t=n.readUInt16BE(e),r=n.slice(e+2,e+2+t);return ur.decode.bytes=t+2,r};ur.decode.bytes=0;ur.encodingLength=function(n){return n.length+2};var pr=K.ns={};pr.encode=function(n,e,t){return e||(e=q.alloc(pr.encodingLength(n))),t||(t=0),z.encode(n,e,t+2),e.writeUInt16BE(z.encode.bytes,t),pr.encode.bytes=z.encode.bytes+2,e};pr.encode.bytes=0;pr.decode=function(n,e){e||(e=0);let t=n.readUInt16BE(e),r=z.decode(n,e+2);return pr.decode.bytes=t+2,r};pr.decode.bytes=0;pr.encodingLength=function(n){return z.encodingLength(n)+2};var dr=K.soa={};dr.encode=function(n,e,t){e||(e=q.alloc(dr.encodingLength(n))),t||(t=0);let r=t;return t+=2,z.encode(n.mname,e,t),t+=z.encode.bytes,z.encode(n.rname,e,t,{mail:!0}),t+=z.encode.bytes,e.writeUInt32BE(n.serial||0,t),t+=4,e.writeUInt32BE(n.refresh||0,t),t+=4,e.writeUInt32BE(n.retry||0,t),t+=4,e.writeUInt32BE(n.expire||0,t),t+=4,e.writeUInt32BE(n.minimum||0,t),t+=4,e.writeUInt16BE(t-r-2,r),dr.encode.bytes=t-r,e};dr.encode.bytes=0;dr.decode=function(n,e){e||(e=0);let t=e,r={};return e+=2,r.mname=z.decode(n,e),e+=z.decode.bytes,r.rname=z.decode(n,e,{mail:!0}),e+=z.decode.bytes,r.serial=n.readUInt32BE(e),e+=4,r.refresh=n.readUInt32BE(e),e+=4,r.retry=n.readUInt32BE(e),e+=4,r.expire=n.readUInt32BE(e),e+=4,r.minimum=n.readUInt32BE(e),e+=4,dr.decode.bytes=e-t,r};dr.decode.bytes=0;dr.encodingLength=function(n){return 22+z.encodingLength(n.mname)+z.encodingLength(n.rname)};var fr=K.txt={};fr.encode=function(n,e,t){Array.isArray(n)||(n=[n]);for(let i=0;i<n.length;i++)if(typeof n[i]=="string"&&(n[i]=q.from(n[i])),!q.isBuffer(n[i]))throw new Error("Must be a Buffer");e||(e=q.alloc(fr.encodingLength(n))),t||(t=0);let r=t;return t+=2,n.forEach(function(i){e[t++]=i.length,i.copy(e,t,0,i.length),t+=i.length}),e.writeUInt16BE(t-r-2,r),fr.encode.bytes=t-r,e};fr.encode.bytes=0;fr.decode=function(n,e){e||(e=0);let t=e,r=n.readUInt16BE(e);e+=2;let i=[];for(;r>0;){let o=n[e++];if(--r,r<o)throw new Error("Buffer overflow");i.push(n.slice(e,e+o)),e+=o,r-=o}return fr.decode.bytes=e-t,i};fr.decode.bytes=0;fr.encodingLength=function(n){Array.isArray(n)||(n=[n]);let e=2;return n.forEach(function(t){typeof t=="string"?e+=q.byteLength(t)+1:e+=t.length+1}),e};var hr=K.null={};hr.encode=function(n,e,t){e||(e=q.alloc(hr.encodingLength(n))),t||(t=0),typeof n=="string"&&(n=q.from(n)),n||(n=q.alloc(0));let r=t;t+=2;let i=n.length;return n.copy(e,t,0,i),t+=i,e.writeUInt16BE(t-r-2,r),hr.encode.bytes=t-r,e};hr.encode.bytes=0;hr.decode=function(n,e){e||(e=0);let t=e,r=n.readUInt16BE(e);e+=2;let i=n.slice(e,e+r);return e+=r,hr.decode.bytes=e-t,i};hr.decode.bytes=0;hr.encodingLength=function(n){return n?(q.isBuffer(n)?n.length:q.byteLength(n))+2:2};var mr=K.hinfo={};mr.encode=function(n,e,t){e||(e=q.alloc(mr.encodingLength(n))),t||(t=0);let r=t;return t+=2,te.encode(n.cpu,e,t),t+=te.encode.bytes,te.encode(n.os,e,t),t+=te.encode.bytes,e.writeUInt16BE(t-r-2,r),mr.encode.bytes=t-r,e};mr.encode.bytes=0;mr.decode=function(n,e){e||(e=0);let t=e,r={};return e+=2,r.cpu=te.decode(n,e),e+=te.decode.bytes,r.os=te.decode(n,e),e+=te.decode.bytes,mr.decode.bytes=e-t,r};mr.decode.bytes=0;mr.encodingLength=function(n){return te.encodingLength(n.cpu)+te.encodingLength(n.os)+2};var ln=K.ptr={},Pk=K.cname=ln,Ok=K.dname=ln;ln.encode=function(n,e,t){return e||(e=q.alloc(ln.encodingLength(n))),t||(t=0),z.encode(n,e,t+2),e.writeUInt16BE(z.encode.bytes,t),ln.encode.bytes=z.encode.bytes+2,e};ln.encode.bytes=0;ln.decode=function(n,e){e||(e=0);let t=z.decode(n,e+2);return ln.decode.bytes=z.decode.bytes+2,t};ln.decode.bytes=0;ln.encodingLength=function(n){return z.encodingLength(n)+2};var gr=K.srv={};gr.encode=function(n,e,t){e||(e=q.alloc(gr.encodingLength(n))),t||(t=0),e.writeUInt16BE(n.priority||0,t+2),e.writeUInt16BE(n.weight||0,t+4),e.writeUInt16BE(n.port||0,t+6),z.encode(n.target,e,t+8);let r=z.encode.bytes+6;return e.writeUInt16BE(r,t),gr.encode.bytes=r+2,e};gr.encode.bytes=0;gr.decode=function(n,e){e||(e=0);let t=n.readUInt16BE(e),r={};return r.priority=n.readUInt16BE(e+2),r.weight=n.readUInt16BE(e+4),r.port=n.readUInt16BE(e+6),r.target=z.decode(n,e+8),gr.decode.bytes=t+2,r};gr.decode.bytes=0;gr.encodingLength=function(n){return 8+z.encodingLength(n.target)};var Lt=K.caa={};Lt.ISSUER_CRITICAL=128;Lt.encode=function(n,e,t){let r=Lt.encodingLength(n);return e||(e=q.alloc(Lt.encodingLength(n))),t||(t=0),n.issuerCritical&&(n.flags=Lt.ISSUER_CRITICAL),e.writeUInt16BE(r-2,t),t+=2,e.writeUInt8(n.flags||0,t),t+=1,te.encode(n.tag,e,t),t+=te.encode.bytes,e.write(n.value,t),t+=q.byteLength(n.value),Lt.encode.bytes=r,e};Lt.encode.bytes=0;Lt.decode=function(n,e){e||(e=0);let t=n.readUInt16BE(e);e+=2;let r=e,i={};return i.flags=n.readUInt8(e),e+=1,i.tag=te.decode(n,e),e+=te.decode.bytes,i.value=n.toString("utf-8",e,r+t),i.issuerCritical=!!(i.flags&Lt.ISSUER_CRITICAL),Lt.decode.bytes=t+2,i};Lt.decode.bytes=0;Lt.encodingLength=function(n){return te.encodingLength(n.tag)+te.encodingLength(n.value)+2};var ti=K.mx={};ti.encode=function(n,e,t){e||(e=q.alloc(ti.encodingLength(n))),t||(t=0);let r=t;return t+=2,e.writeUInt16BE(n.preference||0,t),t+=2,z.encode(n.exchange,e,t),t+=z.encode.bytes,e.writeUInt16BE(t-r-2,r),ti.encode.bytes=t-r,e};ti.encode.bytes=0;ti.decode=function(n,e){e||(e=0);let t=e,r={};return e+=2,r.preference=n.readUInt16BE(e),e+=2,r.exchange=z.decode(n,e),e+=z.decode.bytes,ti.decode.bytes=e-t,r};ti.encodingLength=function(n){return 4+z.encodingLength(n.exchange)};var xr=K.a={};xr.encode=function(n,e,t){return e||(e=q.alloc(xr.encodingLength(n))),t||(t=0),e.writeUInt16BE(4,t),t+=2,Li.v4.encode(n,e,t),xr.encode.bytes=6,e};xr.encode.bytes=0;xr.decode=function(n,e){e||(e=0),e+=2;let t=Li.v4.decode(n,e);return xr.decode.bytes=6,t};xr.decode.bytes=0;xr.encodingLength=function(){return 6};var yr=K.aaaa={};yr.encode=function(n,e,t){return e||(e=q.alloc(yr.encodingLength(n))),t||(t=0),e.writeUInt16BE(16,t),t+=2,Li.v6.encode(n,e,t),yr.encode.bytes=18,e};yr.encode.bytes=0;yr.decode=function(n,e){e||(e=0),e+=2;let t=Li.v6.decode(n,e);return yr.decode.bytes=18,t};yr.decode.bytes=0;yr.encodingLength=function(){return 18};var vt=K.option={};vt.encode=function(n,e,t){e||(e=q.alloc(vt.encodingLength(n))),t||(t=0);let r=t,i=Cf.toCode(n.code);if(e.writeUInt16BE(i,t),t+=2,n.data)e.writeUInt16BE(n.data.length,t),t+=2,n.data.copy(e,t),t+=n.data.length;else switch(i){case 8:let o=n.sourcePrefixLength||0,s=n.family||Li.familyOf(n.ip),a=Li.encode(n.ip,q.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(n.scopePrefixLength||0,t++),a.copy(e,t,0,c),t+=c;break;case 11:n.timeout?(e.writeUInt16BE(2,t),t+=2,e.writeUInt16BE(n.timeout,t),t+=2):(e.writeUInt16BE(0,t),t+=2);break;case 12:let u=n.length||0;e.writeUInt16BE(u,t),t+=2,e.fill(0,t,t+u),t+=u;break;case 14:let l=n.tags.length*2;e.writeUInt16BE(l,t),t+=2;for(let p of n.tags)e.writeUInt16BE(p,t),t+=2;break;default:throw new Error(`Unknown roption code: ${n.code}`)}return vt.encode.bytes=t-r,e};vt.encode.bytes=0;vt.decode=function(n,e){e||(e=0);let t={};t.code=n.readUInt16BE(e),t.type=Cf.toString(t.code),e+=2;let r=n.readUInt16BE(e);switch(e+=2,t.data=n.slice(e,e+r),t.code){case 8:t.family=n.readUInt16BE(e),e+=2,t.sourcePrefixLength=n.readUInt8(e++),t.scopePrefixLength=n.readUInt8(e++);let i=q.alloc(t.family===1?4:16);n.copy(i,0,e,e+r-4),t.ip=Li.decode(i);break;case 11:r>0&&(t.timeout=n.readUInt16BE(e),e+=2);break;case 14:t.tags=[];for(let o=0;o<r;o+=2)t.tags.push(n.readUInt16BE(e)),e+=2}return vt.decode.bytes=r+4,t};vt.decode.bytes=0;vt.encodingLength=function(n){if(n.data)return n.data.length+4;switch(Cf.toCode(n.code)){case 8:let t=n.sourcePrefixLength||0;return Math.ceil(t/8)+8;case 11:return typeof n.timeout=="number"?6:4;case 12:return n.length+4;case 14:return 4+n.tags.length*2}throw new Error(`Unknown roption code: ${n.code}`)};var Pt=K.opt={};Pt.encode=function(n,e,t){e||(e=q.alloc(Pt.encodingLength(n))),t||(t=0);let r=t,i=Fo(n,vt);return e.writeUInt16BE(i,t),t=Xs(n,vt,e,t+2),Pt.encode.bytes=t-r,e};Pt.encode.bytes=0;Pt.decode=function(n,e){e||(e=0);let t=e,r=[],i=n.readUInt16BE(e);e+=2;let o=0;for(;i>0;)r[o++]=vt.decode(n,e),e+=vt.decode.bytes,i-=vt.decode.bytes;return Pt.decode.bytes=e-t,r};Pt.decode.bytes=0;Pt.encodingLength=function(n){return 2+Fo(n||[],vt)};var pt=K.dnskey={};pt.PROTOCOL_DNSSEC=3;pt.ZONE_KEY=128;pt.SECURE_ENTRYPOINT=32768;pt.encode=function(n,e,t){e||(e=q.alloc(pt.encodingLength(n))),t||(t=0);let r=t,i=n.key;if(!q.isBuffer(i))throw new Error("Key must be a Buffer");return t+=2,e.writeUInt16BE(n.flags,t),t+=2,e.writeUInt8(pt.PROTOCOL_DNSSEC,t),t+=1,e.writeUInt8(n.algorithm,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,pt.encode.bytes=t-r,e.writeUInt16BE(pt.encode.bytes-2,r),e};pt.encode.bytes=0;pt.decode=function(n,e){e||(e=0);let t=e;var r={},i=n.readUInt16BE(e);if(e+=2,r.flags=n.readUInt16BE(e),e+=2,n.readUInt8(e)!==pt.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return e+=1,r.algorithm=n.readUInt8(e),e+=1,r.key=n.slice(e,t+i+2),e+=r.key.length,pt.decode.bytes=e-t,r};pt.decode.bytes=0;pt.encodingLength=function(n){return 6+q.byteLength(n.key)};var Tn=K.rrsig={};Tn.encode=function(n,e,t){e||(e=q.alloc(Tn.encodingLength(n))),t||(t=0);let r=t,i=n.signature;if(!q.isBuffer(i))throw new Error("Signature must be a Buffer");return t+=2,e.writeUInt16BE(wr.toType(n.typeCovered),t),t+=2,e.writeUInt8(n.algorithm,t),t+=1,e.writeUInt8(n.labels,t),t+=1,e.writeUInt32BE(n.originalTTL,t),t+=4,e.writeUInt32BE(n.expiration,t),t+=4,e.writeUInt32BE(n.inception,t),t+=4,e.writeUInt16BE(n.keyTag,t),t+=2,z.encode(n.signersName,e,t),t+=z.encode.bytes,i.copy(e,t,0,i.length),t+=i.length,Tn.encode.bytes=t-r,e.writeUInt16BE(Tn.encode.bytes-2,r),e};Tn.encode.bytes=0;Tn.decode=function(n,e){e||(e=0);let t=e;var r={},i=n.readUInt16BE(e);return e+=2,r.typeCovered=wr.toString(n.readUInt16BE(e)),e+=2,r.algorithm=n.readUInt8(e),e+=1,r.labels=n.readUInt8(e),e+=1,r.originalTTL=n.readUInt32BE(e),e+=4,r.expiration=n.readUInt32BE(e),e+=4,r.inception=n.readUInt32BE(e),e+=4,r.keyTag=n.readUInt16BE(e),e+=2,r.signersName=z.decode(n,e),e+=z.decode.bytes,r.signature=n.slice(e,t+i+2),e+=r.signature.length,Tn.decode.bytes=e-t,r};Tn.decode.bytes=0;Tn.encodingLength=function(n){return 20+z.encodingLength(n.signersName)+q.byteLength(n.signature)};var Cn=K.rp={};Cn.encode=function(n,e,t){e||(e=q.alloc(Cn.encodingLength(n))),t||(t=0);let r=t;return t+=2,z.encode(n.mbox||".",e,t,{mail:!0}),t+=z.encode.bytes,z.encode(n.txt||".",e,t),t+=z.encode.bytes,Cn.encode.bytes=t-r,e.writeUInt16BE(Cn.encode.bytes-2,r),e};Cn.encode.bytes=0;Cn.decode=function(n,e){e||(e=0);let t=e,r={};return e+=2,r.mbox=z.decode(n,e,{mail:!0})||".",e+=z.decode.bytes,r.txt=z.decode(n,e)||".",e+=z.decode.bytes,Cn.decode.bytes=e-t,r};Cn.decode.bytes=0;Cn.encodingLength=function(n){return 2+z.encodingLength(n.mbox||".")+z.encodingLength(n.txt||".")};var Ke={};Ke.encode=function(n,e,t){e||(e=q.alloc(Ke.encodingLength(n))),t||(t=0);let r=t;for(var i=[],o=0;o<n.length;o++){var s=wr.toType(n[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=q.from(i[o]);e.writeUInt8(o,t),t+=1,e.writeUInt8(a.length,t),t+=1,a.copy(e,t),t+=a.length}return Ke.encode.bytes=t-r,e};Ke.encode.bytes=0;Ke.decode=function(n,e,t){e||(e=0);let r=e;for(var i=[];e-r<t;){var o=n.readUInt8(e);e+=1;var s=n.readUInt8(e);e+=1;for(var a=0;a<s;a++)for(var c=n.readUInt8(e+a),u=0;u<8;u++)if(c&1<<7-u){var l=wr.toString(o<<8|a<<3|u);i.push(l)}e+=s}return Ke.decode.bytes=e-r,i};Ke.decode.bytes=0;Ke.encodingLength=function(n){for(var e=[],t=0;t<n.length;t++){var r=wr.toType(n[t]);e[r>>8]=Math.max(e[r>>8]||0,r&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 Nn=K.nsec={};Nn.encode=function(n,e,t){e||(e=q.alloc(Nn.encodingLength(n))),t||(t=0);let r=t;return t+=2,z.encode(n.nextDomain,e,t),t+=z.encode.bytes,Ke.encode(n.rrtypes,e,t),t+=Ke.encode.bytes,Nn.encode.bytes=t-r,e.writeUInt16BE(Nn.encode.bytes-2,r),e};Nn.encode.bytes=0;Nn.decode=function(n,e){e||(e=0);let t=e;var r={},i=n.readUInt16BE(e);return e+=2,r.nextDomain=z.decode(n,e),e+=z.decode.bytes,r.rrtypes=Ke.decode(n,e,i-(e-t)),e+=Ke.decode.bytes,Nn.decode.bytes=e-t,r};Nn.decode.bytes=0;Nn.encodingLength=function(n){return 2+z.encodingLength(n.nextDomain)+Ke.encodingLength(n.rrtypes)};var Un=K.nsec3={};Un.encode=function(n,e,t){e||(e=q.alloc(Un.encodingLength(n))),t||(t=0);let r=t,i=n.salt;if(!q.isBuffer(i))throw new Error("salt must be a Buffer");let o=n.nextDomain;if(!q.isBuffer(o))throw new Error("nextDomain must be a Buffer");return t+=2,e.writeUInt8(n.algorithm,t),t+=1,e.writeUInt8(n.flags,t),t+=1,e.writeUInt16BE(n.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,Ke.encode(n.rrtypes,e,t),t+=Ke.encode.bytes,Un.encode.bytes=t-r,e.writeUInt16BE(Un.encode.bytes-2,r),e};Un.encode.bytes=0;Un.decode=function(n,e){e||(e=0);let t=e;var r={},i=n.readUInt16BE(e);e+=2,r.algorithm=n.readUInt8(e),e+=1,r.flags=n.readUInt8(e),e+=1,r.iterations=n.readUInt16BE(e),e+=2;let o=n.readUInt8(e);e+=1,r.salt=n.slice(e,e+o),e+=o;let s=n.readUInt8(e);return e+=1,r.nextDomain=n.slice(e,e+s),e+=s,r.rrtypes=Ke.decode(n,e,i-(e-t)),e+=Ke.decode.bytes,Un.decode.bytes=e-t,r};Un.decode.bytes=0;Un.encodingLength=function(n){return 8+n.salt.length+n.nextDomain.length+Ke.encodingLength(n.rrtypes)};var Ln=K.ds={};Ln.encode=function(n,e,t){e||(e=q.alloc(Ln.encodingLength(n))),t||(t=0);let r=t,i=n.digest;if(!q.isBuffer(i))throw new Error("Digest must be a Buffer");return t+=2,e.writeUInt16BE(n.keyTag,t),t+=2,e.writeUInt8(n.algorithm,t),t+=1,e.writeUInt8(n.digestType,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,Ln.encode.bytes=t-r,e.writeUInt16BE(Ln.encode.bytes-2,r),e};Ln.encode.bytes=0;Ln.decode=function(n,e){e||(e=0);let t=e;var r={},i=n.readUInt16BE(e);return e+=2,r.keyTag=n.readUInt16BE(e),e+=2,r.algorithm=n.readUInt8(e),e+=1,r.digestType=n.readUInt8(e),e+=1,r.digest=n.slice(e,t+i+2),e+=r.digest.length,Ln.decode.bytes=e-t,r};Ln.decode.bytes=0;Ln.encodingLength=function(n){return 6+q.byteLength(n.digest)};var Dt=K.sshfp={};Dt.getFingerprintLengthForHashType=function(e){switch(e){case 1:return 20;case 2:return 32}};Dt.encode=function(e,t,r){t||(t=q.alloc(Dt.encodingLength(e))),r||(r=0);let i=r;r+=2,t[r]=e.algorithm,r+=1,t[r]=e.hash,r+=1;let o=q.from(e.fingerprint.toUpperCase(),"hex");if(o.length!==Dt.getFingerprintLengthForHashType(e.hash))throw new Error("Invalid fingerprint length");return o.copy(t,r),r+=o.byteLength,Dt.encode.bytes=r-i,t.writeUInt16BE(Dt.encode.bytes-2,i),t};Dt.encode.bytes=0;Dt.decode=function(e,t){t||(t=0);let r=t,i={};t+=2,i.algorithm=e[t],t+=1,i.hash=e[t],t+=1;let o=Dt.getFingerprintLengthForHashType(i.hash);return i.fingerprint=e.slice(t,t+o).toString("hex").toUpperCase(),t+=o,Dt.decode.bytes=t-r,i};Dt.decode.bytes=0;Dt.encodingLength=function(n){return 4+q.from(n.fingerprint,"hex").byteLength};var Dn=K.naptr={};Dn.encode=function(n,e,t){e||(e=q.alloc(Dn.encodingLength(n))),t||(t=0);let r=t;return t+=2,e.writeUInt16BE(n.order||0,t),t+=2,e.writeUInt16BE(n.preference||0,t),t+=2,te.encode(n.flags,e,t),t+=te.encode.bytes,te.encode(n.services,e,t),t+=te.encode.bytes,te.encode(n.regexp,e,t),t+=te.encode.bytes,z.encode(n.replacement,e,t),t+=z.encode.bytes,Dn.encode.bytes=t-r,e.writeUInt16BE(Dn.encode.bytes-2,r),e};Dn.encode.bytes=0;Dn.decode=function(n,e){e||(e=0);let t=e,r={};return e+=2,r.order=n.readUInt16BE(e),e+=2,r.preference=n.readUInt16BE(e),e+=2,r.flags=te.decode(n,e),e+=te.decode.bytes,r.services=te.decode(n,e),e+=te.decode.bytes,r.regexp=te.decode(n,e),e+=te.decode.bytes,r.replacement=z.decode(n,e),e+=z.decode.bytes,Dn.decode.bytes=e-t,r};Dn.decode.bytes=0;Dn.encodingLength=function(n){return te.encodingLength(n.flags)+te.encodingLength(n.services)+te.encodingLength(n.regexp)+z.encodingLength(n.replacement)+6};var Pn=K.tlsa={};Pn.encode=function(n,e,t){e||(e=q.alloc(Pn.encodingLength(n))),t||(t=0);let r=t,i=n.certificate;if(!q.isBuffer(i))throw new Error("Certificate must be a Buffer");return t+=2,e.writeUInt8(n.usage,t),t+=1,e.writeUInt8(n.selector,t),t+=1,e.writeUInt8(n.matchingType,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,Pn.encode.bytes=t-r,e.writeUInt16BE(Pn.encode.bytes-2,r),e};Pn.encode.bytes=0;Pn.decode=function(n,e){e||(e=0);let t=e,r={},i=n.readUInt16BE(e);return e+=2,r.usage=n.readUInt8(e),e+=1,r.selector=n.readUInt8(e),e+=1,r.matchingType=n.readUInt8(e),e+=1,r.certificate=n.slice(e,t+i+2),e+=r.certificate.length,Pn.decode.bytes=e-t,r};Pn.decode.bytes=0;Pn.encodingLength=function(n){return 5+q.byteLength(n.certificate)};var Uf=K.record=function(n){switch(n.toUpperCase()){case"A":return xr;case"PTR":return ln;case"CNAME":return Pk;case"DNAME":return Ok;case"TXT":return fr;case"NULL":return hr;case"AAAA":return yr;case"SRV":return gr;case"HINFO":return mr;case"CAA":return Lt;case"NS":return pr;case"SOA":return dr;case"MX":return ti;case"OPT":return Pt;case"DNSKEY":return pt;case"RRSIG":return Tn;case"RP":return Cn;case"NSEC":return Nn;case"NSEC3":return Un;case"SSHFP":return Dt;case"DS":return Ln;case"NAPTR":return Dn;case"TLSA":return Pn}return ur},Je=K.answer={};Je.encode=function(n,e,t){e||(e=q.alloc(Je.encodingLength(n))),t||(t=0);let r=t;if(z.encode(n.name,e,t),t+=z.encode.bytes,e.writeUInt16BE(wr.toType(n.type),t),n.type.toUpperCase()==="OPT"){if(n.name!==".")throw new Error("OPT name must be root.");e.writeUInt16BE(n.udpPayloadSize||4096,t+2),e.writeUInt8(n.extendedRcode||0,t+4),e.writeUInt8(n.ednsVersion||0,t+5),e.writeUInt16BE(n.flags||0,t+6),t+=8,Pt.encode(n.options||[],e,t),t+=Pt.encode.bytes}else{let i=Ll.toClass(n.class===void 0?"IN":n.class);n.flush&&(i|=Nf),e.writeUInt16BE(i,t+2),e.writeUInt32BE(n.ttl||0,t+4),t+=8;let o=Uf(n.type);o.encode(n.data,e,t),t+=o.encode.bytes}return Je.encode.bytes=t-r,e};Je.encode.bytes=0;Je.decode=function(n,e){e||(e=0);let t={},r=e;if(t.name=z.decode(n,e),e+=z.decode.bytes,t.type=wr.toString(n.readUInt16BE(e)),t.type==="OPT")t.udpPayloadSize=n.readUInt16BE(e+2),t.extendedRcode=n.readUInt8(e+4),t.ednsVersion=n.readUInt8(e+5),t.flags=n.readUInt16BE(e+6),t.flag_do=(t.flags>>15&1)===1,t.options=Pt.decode(n,e+8),e+=8+Pt.decode.bytes;else{let i=n.readUInt16BE(e+2);t.ttl=n.readUInt32BE(e+4),t.class=Ll.toString(i&Lk),t.flush=!!(i&Nf);let o=Uf(t.type);t.data=o.decode(n,e+8),e+=8+o.decode.bytes}return Je.decode.bytes=e-r,t};Je.decode.bytes=0;Je.encodingLength=function(n){let e=n.data!==null&&n.data!==void 0?n.data:n.options;return z.encodingLength(n.name)+8+Uf(n.type).encodingLength(e)};var un=K.question={};un.encode=function(n,e,t){e||(e=q.alloc(un.encodingLength(n))),t||(t=0);let r=t;return z.encode(n.name,e,t),t+=z.encode.bytes,e.writeUInt16BE(wr.toType(n.type),t),t+=2,e.writeUInt16BE(Ll.toClass(n.class===void 0?"IN":n.class),t),t+=2,un.encode.bytes=t-r,n};un.encode.bytes=0;un.decode=function(n,e){e||(e=0);let t=e,r={};return r.name=z.decode(n,e),e+=z.decode.bytes,r.type=wr.toString(n.readUInt16BE(e)),e+=2,r.class=Ll.toString(n.readUInt16BE(e)),e+=2,!!(r.class&xy)&&(r.class&=Dk),un.decode.bytes=e-t,r};un.decode.bytes=0;un.encodingLength=function(n){return z.encodingLength(n.name)+4};K.AUTHORITATIVE_ANSWER=1024;K.TRUNCATED_RESPONSE=512;K.RECURSION_DESIRED=256;K.RECURSION_AVAILABLE=128;K.AUTHENTIC_DATA=32;K.CHECKING_DISABLED=16;K.DNSSEC_OK=32768;K.encode=function(n,e,t){let r=!e;r&&(e=q.alloc(K.encodingLength(n))),t||(t=0);let i=t;return n.questions||(n.questions=[]),n.answers||(n.answers=[]),n.authorities||(n.authorities=[]),n.additionals||(n.additionals=[]),pn.encode(n,e,t),t+=pn.encode.bytes,t=Xs(n.questions,un,e,t),t=Xs(n.answers,Je,e,t),t=Xs(n.authorities,Je,e,t),t=Xs(n.additionals,Je,e,t),K.encode.bytes=t-i,r&&K.encode.bytes!==e.length?e.slice(0,K.encode.bytes):e};K.encode.bytes=0;K.decode=function(n,e){e||(e=0);let t=e,r=pn.decode(n,e);return e+=pn.decode.bytes,e=Ul(r.questions,un,n,e),e=Ul(r.answers,Je,n,e),e=Ul(r.authorities,Je,n,e),e=Ul(r.additionals,Je,n,e),K.decode.bytes=e-t,r};K.decode.bytes=0;K.encodingLength=function(n){return pn.encodingLength(n)+Fo(n.questions||[],un)+Fo(n.answers||[],Je)+Fo(n.authorities||[],Je)+Fo(n.additionals||[],Je)};K.streamEncode=function(n){let e=K.encode(n),t=q.alloc(2);t.writeUInt16BE(e.byteLength);let r=q.concat([t,e]);return K.streamEncode.bytes=r.byteLength,r};K.streamEncode.bytes=0;K.streamDecode=function(n){let e=n.readUInt16BE(0);if(n.byteLength<e+2)return null;let t=K.decode(n.slice(2));return K.streamDecode.bytes=K.decode.bytes,t};K.streamDecode.bytes=0;function Fo(n,e){let t=0;for(let r=0;r<n.length;r++)t+=e.encodingLength(n[r]);return t}function Xs(n,e,t,r){for(let i=0;i<n.length;i++)e.encode(n[i],t,r),r+=e.encode.bytes;return r}function Ul(n,e,t,r){for(let i=0;i<n.length;i++)n[i]=e.decode(t,r),r+=e.decode.bytes;return r}});var Ty=se((ra,Ol)=>{(function(n,e){"use strict";var t={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function r(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 m=[0,0,0,0];return m[3]+=d[3]+f[3],m[2]+=m[3]>>>16,m[3]&=65535,m[2]+=d[2]+f[2],m[1]+=m[2]>>>16,m[2]&=65535,m[1]+=d[1]+f[1],m[0]+=m[1]>>>16,m[1]&=65535,m[0]+=d[0]+f[0],m[0]&=65535,[m[0]<<16|m[1],m[2]<<16|m[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 m=[0,0,0,0];return m[3]+=d[3]*f[3],m[2]+=m[3]>>>16,m[3]&=65535,m[2]+=d[2]*f[3],m[1]+=m[2]>>>16,m[2]&=65535,m[2]+=d[3]*f[2],m[1]+=m[2]>>>16,m[2]&=65535,m[1]+=d[1]*f[3],m[0]+=m[1]>>>16,m[1]&=65535,m[1]+=d[2]*f[2],m[0]+=m[1]>>>16,m[1]&=65535,m[1]+=d[3]*f[1],m[0]+=m[1]>>>16,m[1]&=65535,m[0]+=d[0]*f[3]+d[1]*f[2]+d[2]*f[1]+d[3]*f[0],m[0]&=65535,[m[0]<<16|m[1],m[2]<<16|m[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 h(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&&!r(d))return e;f=f||0;for(var m=d.length%4,g=d.length-m,x=f,w=0,b=3432918353,A=461845907,B=0;B<g;B=B+4)w=d[B]|d[B+1]<<8|d[B+2]<<16|d[B+3]<<24,w=i(w,b),w=o(w,15),w=i(w,A),x^=w,x=o(x,13),x=i(x,5)+3864292196;switch(w=0,m){case 3:w^=d[B+2]<<16;case 2:w^=d[B+1]<<8;case 1:w^=d[B],w=i(w,b),w=o(w,15),w=i(w,A),x^=w}return x^=d.length,x=s(x),x>>>0},t.x86.hash128=function(d,f){if(t.inputValidation&&!r(d))return e;f=f||0;for(var m=d.length%16,g=d.length-m,x=f,w=f,b=f,A=f,B=0,k=0,E=0,v=0,R=597399067,N=2869860233,C=951274213,M=2716044179,D=0;D<g;D=D+16)B=d[D]|d[D+1]<<8|d[D+2]<<16|d[D+3]<<24,k=d[D+4]|d[D+5]<<8|d[D+6]<<16|d[D+7]<<24,E=d[D+8]|d[D+9]<<8|d[D+10]<<16|d[D+11]<<24,v=d[D+12]|d[D+13]<<8|d[D+14]<<16|d[D+15]<<24,B=i(B,R),B=o(B,15),B=i(B,N),x^=B,x=o(x,19),x+=w,x=i(x,5)+1444728091,k=i(k,N),k=o(k,16),k=i(k,C),w^=k,w=o(w,17),w+=b,w=i(w,5)+197830471,E=i(E,C),E=o(E,17),E=i(E,M),b^=E,b=o(b,15),b+=A,b=i(b,5)+2530024501,v=i(v,M),v=o(v,18),v=i(v,R),A^=v,A=o(A,13),A+=x,A=i(A,5)+850148119;switch(B=0,k=0,E=0,v=0,m){case 15:v^=d[D+14]<<16;case 14:v^=d[D+13]<<8;case 13:v^=d[D+12],v=i(v,M),v=o(v,18),v=i(v,R),A^=v;case 12:E^=d[D+11]<<24;case 11:E^=d[D+10]<<16;case 10:E^=d[D+9]<<8;case 9:E^=d[D+8],E=i(E,C),E=o(E,17),E=i(E,M),b^=E;case 8:k^=d[D+7]<<24;case 7:k^=d[D+6]<<16;case 6:k^=d[D+5]<<8;case 5:k^=d[D+4],k=i(k,N),k=o(k,16),k=i(k,C),w^=k;case 4:B^=d[D+3]<<24;case 3:B^=d[D+2]<<16;case 2:B^=d[D+1]<<8;case 1:B^=d[D],B=i(B,R),B=o(B,15),B=i(B,N),x^=B}return x^=d.length,w^=d.length,b^=d.length,A^=d.length,x+=w,x+=b,x+=A,w+=x,b+=x,A+=x,x=s(x),w=s(w),b=s(b),A=s(A),x+=w,x+=b,x+=A,w+=x,b+=x,A+=x,("00000000"+(x>>>0).toString(16)).slice(-8)+("00000000"+(w>>>0).toString(16)).slice(-8)+("00000000"+(b>>>0).toString(16)).slice(-8)+("00000000"+(A>>>0).toString(16)).slice(-8)},t.x64.hash128=function(d,f){if(t.inputValidation&&!r(d))return e;f=f||0;for(var m=d.length%16,g=d.length-m,x=[0,f],w=[0,f],b=[0,0],A=[0,0],B=[2277735313,289559509],k=[1291169091,658871167],E=0;E<g;E=E+16)b=[d[E+4]|d[E+5]<<8|d[E+6]<<16|d[E+7]<<24,d[E]|d[E+1]<<8|d[E+2]<<16|d[E+3]<<24],A=[d[E+12]|d[E+13]<<8|d[E+14]<<16|d[E+15]<<24,d[E+8]|d[E+9]<<8|d[E+10]<<16|d[E+11]<<24],b=c(b,B),b=u(b,31),b=c(b,k),x=p(x,b),x=u(x,27),x=a(x,w),x=a(c(x,[0,5]),[0,1390208809]),A=c(A,k),A=u(A,33),A=c(A,B),w=p(w,A),w=u(w,31),w=a(w,x),w=a(c(w,[0,5]),[0,944331445]);switch(b=[0,0],A=[0,0],m){case 15:A=p(A,l([0,d[E+14]],48));case 14:A=p(A,l([0,d[E+13]],40));case 13:A=p(A,l([0,d[E+12]],32));case 12:A=p(A,l([0,d[E+11]],24));case 11:A=p(A,l([0,d[E+10]],16));case 10:A=p(A,l([0,d[E+9]],8));case 9:A=p(A,[0,d[E+8]]),A=c(A,k),A=u(A,33),A=c(A,B),w=p(w,A);case 8:b=p(b,l([0,d[E+7]],56));case 7:b=p(b,l([0,d[E+6]],48));case 6:b=p(b,l([0,d[E+5]],40));case 5:b=p(b,l([0,d[E+4]],32));case 4:b=p(b,l([0,d[E+3]],24));case 3:b=p(b,l([0,d[E+2]],16));case 2:b=p(b,l([0,d[E+1]],8));case 1:b=p(b,[0,d[E]]),b=c(b,B),b=u(b,31),b=c(b,k),x=p(x,b)}return x=p(x,[0,d.length]),w=p(w,[0,d.length]),x=a(x,w),w=a(w,x),x=h(x),w=h(w),x=a(x,w),w=a(w,x),("00000000"+(x[0]>>>0).toString(16)).slice(-8)+("00000000"+(x[1]>>>0).toString(16)).slice(-8)+("00000000"+(w[0]>>>0).toString(16)).slice(-8)+("00000000"+(w[1]>>>0).toString(16)).slice(-8)},typeof ra<"u"?(typeof Ol<"u"&&Ol.exports&&(ra=Ol.exports=t),ra.murmurHash3=t):typeof define=="function"&&define.amd?define([],function(){return t}):(t._murmurHash3=n.murmurHash3,t.noConflict=function(){return n.murmurHash3=t._murmurHash3,t._murmurHash3=e,t.noConflict=e,t},n.murmurHash3=t)})(ra)});var Ny=se((YO,Cy)=>{Cy.exports=Ty()});var Vl=se((nF,Ly)=>{"use strict";Ly.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(e,t){let r=this._internalPositionFor(e,!1);if(t===void 0)r!==-1&&(this._unsetInternalPos(r),this._unsetBit(e),this._changedLength=!0,this._changedData=!0);else{let i=!1;r===-1?(r=this._data.length,this._setBit(e),this._changedData=!0):i=!0,this._setInternalPos(r,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,r=new Array(this.length);for(;t<this.length;)r[t]=e(this.get(t),t,this),t++;return r}reduce(e,t){let r=0,i=t;for(;r<this.length;){let o=this.get(r);i=e(i,o,r),r++}return i}find(e){let t=0,r,i;for(;t<this.length&&!r;)i=this.get(t),r=e(i),t++;return r?i:void 0}_internalPositionFor(e,t){let r=this._bytePosFor(e,t);if(r>=this._bitArrays.length)return-1;let i=this._bitArrays[r],o=e-r*7;if(!((i&1<<o)>0))return-1;let a=this._bitArrays.slice(0,r).reduce(Qk,0),c=~(4294967295<<o+1),u=Uy(i&c);return a+u-1}_bytePosFor(e,t){let r=Math.floor(e/7),i=r+1;for(;!t&&this._bitArrays.length<i;)this._bitArrays.push(0);return r}_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,r,i){let o=this._data,s=[t,r];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(eA),this._changedData=!1}bitField(){let e=[],t=8,r=0,i=0,o,s=this._bitArrays.slice();for(;s.length||r;){r===0&&(o=s.shift(),r=7);let c=Math.min(r,t),u=~(255<<c),l=o&u;i|=l<<8-t,o=o>>>c,r-=c,t-=c,(!t||!r&&!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(tA)}};function Qk(n,e){return n+Uy(e)}function Uy(n){let e=n;return e=e-(e>>1&1431655765),e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}function eA(n,e){return n[0]-e[0]}function tA(n){return n[1]}});var Yy=se((OF,Wy)=>{var jf=class{constructor(e,t=12,r=8*1024,i=32*1024,o=64,s){this.bits=t,this.min=r,this.max=i,this.asModule=e,this.rabin=new e.Rabin(t,r,i,o,s),this.polynomial=s}fingerprint(e){let{__retain:t,__release:r,__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),h=o(p);r(l),r(u);let d=h.indexOf(0);return d>=0?h.subarray(0,d):h}};Wy.exports=jf});var tw=se(sa=>{"use strict";var hA=typeof BigUint64Array<"u",ia=Symbol(),oa=1024;function Xy(n,e){let t=new Uint32Array(n),r=new Uint16Array(n);var i=t[e+-4>>>2]>>>1,o=e>>>1;if(i<=oa)return String.fromCharCode.apply(String,r.subarray(o,o+i));let s=[];do{let a=r[o+oa-1],c=a>=55296&&a<56320?oa-1:oa;s.push(String.fromCharCode.apply(String,r.subarray(o,o+=c))),i-=c}while(i>oa);return s.join("")+String.fromCharCode.apply(String,r.subarray(o,o+i))}function Hf(n){let e={};function t(i,o){return i?Xy(i.buffer,o):"<yet unknown>"}let r=n.env=n.env||{};return r.abort=r.abort||function(o,s,a,c){let u=e.memory||r.memory;throw Error("abort: "+t(u,o)+" at "+t(u,s)+":"+a+":"+c)},r.trace=r.trace||function(o,s){let a=e.memory||r.memory;console.log("trace: "+t(a,o)+(s?" ":"")+Array.prototype.slice.call(arguments,2,2+s).join(", "))},n.Math=n.Math||Math,n.Date=n.Date||Date,e}function $f(n,e){let t=e.exports,r=t.memory,i=t.table,o=t.__alloc,s=t.__retain,a=t.__rtti_base||-1;function c(k){let E=new Uint32Array(r.buffer),v=E[a>>>2];if((k>>>=0)>=v)throw Error("invalid id: "+k);return E[(a+4>>>2)+k*2]}function u(k){let E=new Uint32Array(r.buffer),v=E[a>>>2];if((k>>>=0)>=v)throw Error("invalid id: "+k);return E[(a+4>>>2)+k*2+1]}function l(k){return 31-Math.clz32(k>>>5&31)}function p(k){return 31-Math.clz32(k>>>14&31)}function h(k){let E=k.length,v=o(E<<1,1),R=new Uint16Array(r.buffer);for(var N=0,C=v>>>1;N<E;++N)R[C+N]=k.charCodeAt(N);return v}n.__allocString=h;function d(k){let E=r.buffer;if(new Uint32Array(E)[k+-8>>>2]!==1)throw Error("not a string: "+k);return Xy(E,k)}n.__getString=d;function f(k,E,v){let R=r.buffer;if(v)switch(k){case 2:return new Float32Array(R);case 3:return new Float64Array(R)}else switch(k){case 0:return new(E?Int8Array:Uint8Array)(R);case 1:return new(E?Int16Array:Uint16Array)(R);case 2:return new(E?Int32Array:Uint32Array)(R);case 3:return new(E?BigInt64Array:BigUint64Array)(R)}throw Error("unsupported align: "+k)}function m(k,E){let v=c(k);if(!(v&3))throw Error("not an array: "+k+" @ "+v);let R=l(v),N=E.length,C=o(N<<R,0),M=o(v&2?16:12,k),D=new Uint32Array(r.buffer);D[M+0>>>2]=s(C),D[M+4>>>2]=C,D[M+8>>>2]=N<<R,v&2&&(D[M+12>>>2]=N);let ie=f(R,v&1024,v&2048);if(v&8192)for(let S=0;S<N;++S)ie[(C>>>R)+S]=s(E[S]);else ie.set(E,C>>>R);return M}n.__allocArray=m;function g(k){let E=new Uint32Array(r.buffer),v=E[k+-8>>>2],R=c(v);if(!(R&1))throw Error("not an array: "+v);let N=l(R);var C=E[k+4>>>2];let M=R&2?E[k+12>>>2]:E[C+-4>>>2]>>>N;return f(N,R&1024,R&2048).subarray(C>>>=N,C+M)}n.__getArrayView=g;function x(k){let E=g(k),v=E.length,R=new Array(v);for(let N=0;N<v;N++)R[N]=E[N];return R}n.__getArray=x;function w(k){let E=r.buffer,v=new Uint32Array(E)[k+-4>>>2];return E.slice(k,k+v)}n.__getArrayBuffer=w;function b(k,E,v){return new k(A(k,E,v))}function A(k,E,v){let R=r.buffer,N=new Uint32Array(R),C=N[v+4>>>2];return new k(R,C,N[C+-4>>>2]>>>E)}n.__getInt8Array=b.bind(null,Int8Array,0),n.__getInt8ArrayView=A.bind(null,Int8Array,0),n.__getUint8Array=b.bind(null,Uint8Array,0),n.__getUint8ArrayView=A.bind(null,Uint8Array,0),n.__getUint8ClampedArray=b.bind(null,Uint8ClampedArray,0),n.__getUint8ClampedArrayView=A.bind(null,Uint8ClampedArray,0),n.__getInt16Array=b.bind(null,Int16Array,1),n.__getInt16ArrayView=A.bind(null,Int16Array,1),n.__getUint16Array=b.bind(null,Uint16Array,1),n.__getUint16ArrayView=A.bind(null,Uint16Array,1),n.__getInt32Array=b.bind(null,Int32Array,2),n.__getInt32ArrayView=A.bind(null,Int32Array,2),n.__getUint32Array=b.bind(null,Uint32Array,2),n.__getUint32ArrayView=A.bind(null,Uint32Array,2),hA&&(n.__getInt64Array=b.bind(null,BigInt64Array,3),n.__getInt64ArrayView=A.bind(null,BigInt64Array,3),n.__getUint64Array=b.bind(null,BigUint64Array,3),n.__getUint64ArrayView=A.bind(null,BigUint64Array,3)),n.__getFloat32Array=b.bind(null,Float32Array,2),n.__getFloat32ArrayView=A.bind(null,Float32Array,2),n.__getFloat64Array=b.bind(null,Float64Array,3),n.__getFloat64ArrayView=A.bind(null,Float64Array,3);function B(k,E){let v=new Uint32Array(r.buffer);var R=v[k+-8>>>2];if(R<=v[a>>>2])do if(R==E)return!0;while(R=u(R));return!1}return n.__instanceof=B,n.memory=n.memory||r,n.table=n.table||i,ew(t,n)}function Zy(n){return typeof Response<"u"&&n instanceof Response}async function Jy(n,e){return Zy(n=await n)?Qy(n,e):$f(Hf(e||(e={})),await WebAssembly.instantiate(n instanceof WebAssembly.Module?n:await WebAssembly.compile(n),e))}sa.instantiate=Jy;function mA(n,e){return $f(Hf(e||(e={})),new WebAssembly.Instance(n instanceof WebAssembly.Module?n:new WebAssembly.Module(n),e))}sa.instantiateSync=mA;async function Qy(n,e){return WebAssembly.instantiateStreaming?$f(Hf(e||(e={})),(await WebAssembly.instantiateStreaming(n,e)).instance):Jy(Zy(n=await n)?n.arrayBuffer():n,e)}sa.instantiateStreaming=Qy;function ew(n,e){var t=e?Object.create(e):{},r=n.__argumentsLength?function(i){n.__argumentsLength.value=i}:n.__setArgumentsLength||n.__setargc||function(){};for(let i in n){if(!Object.prototype.hasOwnProperty.call(n,i))continue;let o=n[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 h=function(...d){return h.wrap(h.prototype.constructor(0,...d))};h.prototype={valueOf:function(){return this[ia]}},h.wrap=function(d){return Object.create(h.prototype,{[ia]:{value:d,writable:!1}})},p&&Object.getOwnPropertyNames(p).forEach(d=>Object.defineProperty(h,d,Object.getOwnPropertyDescriptor(p,d))),a[l]=h}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 h=n[i.replace("set:","get:")],d=n[i.replace("get:","set:")];Object.defineProperty(a,c,{get:function(){return h(this[ia])},set:function(f){d(this[ia],f)},enumerable:!0})}}else c==="constructor"?(a[c]=(...h)=>(r(h.length),o(...h))).original=o:(a[c]=function(...h){return r(h.length),o(this[ia],...h)}).original=o}else/^(get|set):/.test(c)?Object.prototype.hasOwnProperty.call(a,c=c.substring(4))||Object.defineProperty(a,c,{get:n[i.replace("set:","get:")],set:n[i.replace("get:","set:")],enumerable:!0}):typeof o=="function"&&o!==r?(a[c]=(...l)=>(r(l.length),o(...l))).original=o:a[c]=o}return t}sa.demangle=ew});var rw=se((VF,nw)=>{var{instantiate:gA}=tw();Kf.supported=typeof WebAssembly<"u";function Kf(n={}){if(!Kf.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 gA(new Response(new Blob([e],{type:"application/wasm"})),n)}nw.exports=Kf});var sw=se((zF,ow)=>{var iw=Yy(),xA=rw(),yA=async(n,e,t,r,i)=>{let o=await xA();return new iw(o,n,e,t,r,i)};ow.exports={Rabin:iw,create:yA}});var Nw=se((lV,Cw)=>{"use strict";Cw.exports=n=>{if(Object.prototype.toString.call(n)!=="[object Object]")return!1;let e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}});var Fw=se((Pw,Ow)=>{"use strict";var ql=Nw(),{hasOwnProperty:Lw}=Object.prototype,{propertyIsEnumerable:$A}=Object,jo=(n,e,t)=>Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0}),KA=Pw,Uw={concatArrays:!1,ignoreUndefined:!1},Gl=n=>{let e=[];for(let t in n)Lw.call(n,t)&&e.push(t);if(Object.getOwnPropertySymbols){let t=Object.getOwnPropertySymbols(n);for(let r of t)$A.call(n,r)&&e.push(r)}return e};function Ho(n){return Array.isArray(n)?qA(n):ql(n)?GA(n):n}function qA(n){let e=n.slice(0,0);return Gl(n).forEach(t=>{jo(e,t,Ho(n[t]))}),e}function GA(n){let e=Object.getPrototypeOf(n)===null?Object.create(null):{};return Gl(n).forEach(t=>{jo(e,t,Ho(n[t]))}),e}var Dw=(n,e,t,r)=>(t.forEach(i=>{typeof e[i]>"u"&&r.ignoreUndefined||(i in n&&n[i]!==Object.getPrototypeOf(n)?jo(n,i,Wf(n[i],e[i],r)):jo(n,i,Ho(e[i])))}),n),WA=(n,e,t)=>{let r=n.slice(0,0),i=0;return[n,e].forEach(o=>{let s=[];for(let a=0;a<o.length;a++)Lw.call(o,a)&&(s.push(String(a)),o===n?jo(r,i++,o[a]):jo(r,i++,Ho(o[a])));r=Dw(r,o,Gl(o).filter(a=>!s.includes(a)),t)}),r};function Wf(n,e,t){return t.concatArrays&&Array.isArray(n)&&Array.isArray(e)?WA(n,e,t):!ql(e)||!ql(n)?Ho(e):Dw(n,e,Gl(e),t)}Ow.exports=function(...n){let e=Wf(Ho(Uw),this!==KA&&this||{},Uw),t={_:{}};for(let r of n)if(r!==void 0){if(!ql(r))throw new TypeError("`"+r+"` is not an Option Object");t=Wf(t,{_:r},e)}return t._}});var rb=se((YM,RB)=>{RB.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 ob=se((XM,ib)=>{ib.exports=rb()});var ab=se((ZM,sb)=>{sb.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var cb=se((JM,th)=>{typeof Object.create=="function"?th.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:th.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}});var db=se(me=>{var TB=/%[sdj%]/g;me.format=function(n){if(!du(n)){for(var e=[],t=0;t<arguments.length;t++)e.push(si(arguments[t]));return e.join(" ")}for(var t=1,r=arguments,i=r.length,o=String(n).replace(TB,function(a){if(a==="%%")return"%";if(t>=i)return a;switch(a){case"%s":return String(r[t++]);case"%d":return Number(r[t++]);case"%j":try{return JSON.stringify(r[t++])}catch{return"[Circular]"}default:return a}}),s=r[t];t<i;s=r[++t])pu(s)||!Yo(s)?o+=" "+s:o+=" "+si(s);return o};me.deprecate=function(n,e){if(Er(globalThis.process))return function(){return me.deprecate(n,e).apply(this,arguments)};if(process.noDeprecation===!0)return n;var t=!1;function r(){if(!t){if(process.throwDeprecation)throw new Error(e);process.traceDeprecation?console.trace(e):console.error(e),t=!0}return n.apply(this,arguments)}return r};var su={},nh;me.debuglog=function(n){if(Er(nh)&&(nh=process.env.NODE_DEBUG||""),n=n.toUpperCase(),!su[n])if(new RegExp("\\b"+n+"\\b","i").test(nh)){var e=process.pid;su[n]=function(){var t=me.format.apply(me,arguments);console.error("%s %d: %s",n,e,t)}}else su[n]=function(){};return su[n]};function si(n,e){var t={seen:[],stylize:NB};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),ah(e)?t.showHidden=e:e&&me._extend(t,e),Er(t.showHidden)&&(t.showHidden=!1),Er(t.depth)&&(t.depth=2),Er(t.colors)&&(t.colors=!1),Er(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=CB),uu(t,n,t.depth)}me.inspect=si;si.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]};si.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function CB(n,e){var t=si.styles[e];return t?"\x1B["+si.colors[t][0]+"m"+n+"\x1B["+si.colors[t][1]+"m":n}function NB(n,e){return n}function UB(n){var e={};return n.forEach(function(t,r){e[t]=!0}),e}function uu(n,e,t){if(n.customInspect&&e&&lu(e.inspect)&&e.inspect!==me.inspect&&!(e.constructor&&e.constructor.prototype===e)){var r=e.inspect(t,n);return du(r)||(r=uu(n,r,t)),r}var i=LB(n,e);if(i)return i;var o=Object.keys(e),s=UB(o);if(n.showHidden&&(o=Object.getOwnPropertyNames(e)),cu(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return rh(e);if(o.length===0){if(lu(e)){var a=e.name?": "+e.name:"";return n.stylize("[Function"+a+"]","special")}if(au(e))return n.stylize(RegExp.prototype.toString.call(e),"regexp");if(sh(e))return n.stylize(Date.prototype.toString.call(e),"date");if(cu(e))return rh(e)}var c="",u=!1,l=["{","}"];if(lb(e)&&(u=!0,l=["[","]"]),lu(e)){var p=e.name?": "+e.name:"";c=" [Function"+p+"]"}if(au(e)&&(c=" "+RegExp.prototype.toString.call(e)),sh(e)&&(c=" "+Date.prototype.toUTCString.call(e)),cu(e)&&(c=" "+rh(e)),o.length===0&&(!u||e.length==0))return l[0]+c+l[1];if(t<0)return au(e)?n.stylize(RegExp.prototype.toString.call(e),"regexp"):n.stylize("[Object]","special");n.seen.push(e);var h;return u?h=DB(n,e,t,s,o):h=o.map(function(d){return oh(n,e,t,s,d,u)}),n.seen.pop(),PB(h,c,l)}function LB(n,e){if(Er(e))return n.stylize("undefined","undefined");if(du(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return n.stylize(t,"string")}if(ub(e))return n.stylize(""+e,"number");if(ah(e))return n.stylize(""+e,"boolean");if(pu(e))return n.stylize("null","null")}function rh(n){return"["+Error.prototype.toString.call(n)+"]"}function DB(n,e,t,r,i){for(var o=[],s=0,a=e.length;s<a;++s)pb(e,String(s))?o.push(oh(n,e,t,r,String(s),!0)):o.push("");return i.forEach(function(c){c.match(/^\d+$/)||o.push(oh(n,e,t,r,c,!0))}),o}function oh(n,e,t,r,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?c.set?a=n.stylize("[Getter/Setter]","special"):a=n.stylize("[Getter]","special"):c.set&&(a=n.stylize("[Setter]","special")),pb(r,i)||(s="["+i+"]"),a||(n.seen.indexOf(c.value)<0?(pu(t)?a=uu(n,c.value,null):a=uu(n,c.value,t-1),a.indexOf(`
|
|
4
|
+
`)>-1&&(o?a=a.split(`
|
|
5
|
+
`).map(function(u){return" "+u}).join(`
|
|
6
|
+
`).substr(2):a=`
|
|
7
|
+
`+a.split(`
|
|
8
|
+
`).map(function(u){return" "+u}).join(`
|
|
9
|
+
`))):a=n.stylize("[Circular]","special")),Er(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=n.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=n.stylize(s,"string"))}return s+": "+a}function PB(n,e,t){var r=0,i=n.reduce(function(o,s){return r++,s.indexOf(`
|
|
10
|
+
`)>=0&&r++,o+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?t[0]+(e===""?"":e+`
|
|
11
|
+
`)+" "+n.join(`,
|
|
12
|
+
`)+" "+t[1]:t[0]+e+" "+n.join(", ")+" "+t[1]}function lb(n){return Array.isArray(n)}me.isArray=lb;function ah(n){return typeof n=="boolean"}me.isBoolean=ah;function pu(n){return n===null}me.isNull=pu;function OB(n){return n==null}me.isNullOrUndefined=OB;function ub(n){return typeof n=="number"}me.isNumber=ub;function du(n){return typeof n=="string"}me.isString=du;function FB(n){return typeof n=="symbol"}me.isSymbol=FB;function Er(n){return n===void 0}me.isUndefined=Er;function au(n){return Yo(n)&&ch(n)==="[object RegExp]"}me.isRegExp=au;function Yo(n){return typeof n=="object"&&n!==null}me.isObject=Yo;function sh(n){return Yo(n)&&ch(n)==="[object Date]"}me.isDate=sh;function cu(n){return Yo(n)&&(ch(n)==="[object Error]"||n instanceof Error)}me.isError=cu;function lu(n){return typeof n=="function"}me.isFunction=lu;function VB(n){return n===null||typeof n=="boolean"||typeof n=="number"||typeof n=="string"||typeof n=="symbol"||typeof n>"u"}me.isPrimitive=VB;me.isBuffer=ab();function ch(n){return Object.prototype.toString.call(n)}function ih(n){return n<10?"0"+n.toString(10):n.toString(10)}var zB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function MB(){var n=new Date,e=[ih(n.getHours()),ih(n.getMinutes()),ih(n.getSeconds())].join(":");return[n.getDate(),zB[n.getMonth()],e].join(" ")}me.log=function(){console.log("%s - %s",MB(),me.format.apply(me,arguments))};me.inherits=cb();me._extend=function(n,e){if(!e||!Yo(e))return n;for(var t=Object.keys(e),r=t.length;r--;)n[t[r]]=e[t[r]];return n};function pb(n,e){return Object.prototype.hasOwnProperty.call(n,e)}});var mb=se((ej,ha)=>{"use strict";var jB=process.platform==="win32",gn=db();function fu(n,e){for(var t=[],r=0;r<n.length;r++){var i=n[r];!i||i==="."||(i===".."?t.length&&t[t.length-1]!==".."?t.pop():e&&t.push(".."):t.push(i))}return t}function fa(n){for(var e=n.length-1,t=0;t<=e&&!n[t];t++);for(var r=e;r>=0&&!n[r];r--);return t===0&&r===e?n:t>r?[]:n.slice(t,r+1)}var fb=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,HB=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,Ne={};function hu(n){var e=fb.exec(n),t=(e[1]||"")+(e[2]||""),r=e[3]||"",i=HB.exec(r),o=i[1],s=i[2],a=i[3];return[t,o,s,a]}function lh(n){var e=fb.exec(n),t=e[1]||"",r=!!t&&t[1]!==":";return{device:t,isUnc:r,isAbsolute:r||!!e[2],tail:e[3]}}function hb(n){return"\\\\"+n.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")}Ne.resolve=function(){for(var n="",e="",t=!1,r=arguments.length-1;r>=-1;r--){var i;if(r>=0?i=arguments[r]:n?(i=process.env["="+n],(!i||i.substr(0,3).toLowerCase()!==n.toLowerCase()+"\\")&&(i=n+"\\")):i=process.cwd(),gn.isString(i)){if(!i)continue}else throw new TypeError("Arguments to path.resolve must be strings");var o=lh(i),s=o.device,a=o.isUnc,c=o.isAbsolute,u=o.tail;if(!(s&&n&&s.toLowerCase()!==n.toLowerCase())&&(n||(n=s),t||(e=u+"\\"+e,t=c),n&&t))break}return a&&(n=hb(n)),e=fu(e.split(/[\\\/]+/),!t).join("\\"),n+(t?"\\":"")+e||"."};Ne.normalize=function(n){var e=lh(n),t=e.device,r=e.isUnc,i=e.isAbsolute,o=e.tail,s=/[\\\/]$/.test(o);return o=fu(o.split(/[\\\/]+/),!i).join("\\"),!o&&!i&&(o="."),o&&s&&(o+="\\"),r&&(t=hb(t)),t+(i?"\\":"")+o};Ne.isAbsolute=function(n){return lh(n).isAbsolute};Ne.join=function(){for(var n=[],e=0;e<arguments.length;e++){var t=arguments[e];if(!gn.isString(t))throw new TypeError("Arguments to path.join must be strings");t&&n.push(t)}var r=n.join("\\");return/^[\\\/]{2}[^\\\/]/.test(n[0])||(r=r.replace(/^[\\\/]{2,}/,"\\")),Ne.normalize(r)};Ne.relative=function(n,e){n=Ne.resolve(n),e=Ne.resolve(e);for(var t=n.toLowerCase(),r=e.toLowerCase(),i=fa(e.split("\\")),o=fa(t.split("\\")),s=fa(r.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("\\")};Ne._makeLong=function(n){if(!gn.isString(n))return n;if(!n)return"";var e=Ne.resolve(n);return/^[a-zA-Z]\:\\/.test(e)?"\\\\?\\"+e:/^\\\\[^?.]/.test(e)?"\\\\?\\UNC\\"+e.substring(2):n};Ne.dirname=function(n){var e=hu(n),t=e[0],r=e[1];return!t&&!r?".":(r&&(r=r.substr(0,r.length-1)),t+r)};Ne.basename=function(n,e){var t=hu(n)[2];return e&&t.substr(-1*e.length)===e&&(t=t.substr(0,t.length-e.length)),t};Ne.extname=function(n){return hu(n)[3]};Ne.format=function(n){if(!gn.isObject(n))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof n);var e=n.root||"";if(!gn.isString(e))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof n.root);var t=n.dir,r=n.base||"";return t?t[t.length-1]===Ne.sep?t+r:t+Ne.sep+r:r};Ne.parse=function(n){if(!gn.isString(n))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof n);var e=hu(n);if(!e||e.length!==4)throw new TypeError("Invalid path '"+n+"'");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)}};Ne.sep="\\";Ne.delimiter=";";var $B=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Fe={};function mu(n){return $B.exec(n).slice(1)}Fe.resolve=function(){for(var n="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var r=t>=0?arguments[t]:process.cwd();if(gn.isString(r)){if(!r)continue}else throw new TypeError("Arguments to path.resolve must be strings");n=r+"/"+n,e=r[0]==="/"}return n=fu(n.split("/"),!e).join("/"),(e?"/":"")+n||"."};Fe.normalize=function(n){var e=Fe.isAbsolute(n),t=n&&n[n.length-1]==="/";return n=fu(n.split("/"),!e).join("/"),!n&&!e&&(n="."),n&&t&&(n+="/"),(e?"/":"")+n};Fe.isAbsolute=function(n){return n.charAt(0)==="/"};Fe.join=function(){for(var n="",e=0;e<arguments.length;e++){var t=arguments[e];if(!gn.isString(t))throw new TypeError("Arguments to path.join must be strings");t&&(n?n+="/"+t:n+=t)}return Fe.normalize(n)};Fe.relative=function(n,e){n=Fe.resolve(n).substr(1),e=Fe.resolve(e).substr(1);for(var t=fa(n.split("/")),r=fa(e.split("/")),i=Math.min(t.length,r.length),o=i,s=0;s<i;s++)if(t[s]!==r[s]){o=s;break}for(var a=[],s=o;s<t.length;s++)a.push("..");return a=a.concat(r.slice(o)),a.join("/")};Fe._makeLong=function(n){return n};Fe.dirname=function(n){var e=mu(n),t=e[0],r=e[1];return!t&&!r?".":(r&&(r=r.substr(0,r.length-1)),t+r)};Fe.basename=function(n,e){var t=mu(n)[2];return e&&t.substr(-1*e.length)===e&&(t=t.substr(0,t.length-e.length)),t};Fe.extname=function(n){return mu(n)[3]};Fe.format=function(n){if(!gn.isObject(n))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof n);var e=n.root||"";if(!gn.isString(e))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof n.root);var t=n.dir?n.dir+Fe.sep:"",r=n.base||"";return t+r};Fe.parse=function(n){if(!gn.isString(n))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof n);var e=mu(n);if(!e||e.length!==4)throw new TypeError("Invalid path '"+n+"'");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)}};Fe.sep="/";Fe.delimiter=":";jB?ha.exports=Ne:ha.exports=Fe;ha.exports.posix=Fe;ha.exports.win32=Ne});var yb=se(Et=>{"use strict";var gu=ob(),KB=mb().extname,gb=/^\s*([^;\s]*)(?:;|\s|$)/,qB=/^text\//i;Et.charset=xb;Et.charsets={lookup:xb};Et.contentType=GB;Et.extension=WB;Et.extensions=Object.create(null);Et.lookup=YB;Et.types=Object.create(null);XB(Et.extensions,Et.types);function xb(n){if(!n||typeof n!="string")return!1;var e=gb.exec(n),t=e&&gu[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&qB.test(e[1])?"UTF-8":!1}function GB(n){if(!n||typeof n!="string")return!1;var e=n.indexOf("/")===-1?Et.lookup(n):n;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Et.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function WB(n){if(!n||typeof n!="string")return!1;var e=gb.exec(n),t=e&&Et.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function YB(n){if(!n||typeof n!="string")return!1;var e=KB("x."+n).toLowerCase().substr(1);return e&&Et.types[e]||!1}function XB(n,e){var t=["nginx","apache",void 0,"iana"];Object.keys(gu).forEach(function(i){var o=gu[i],s=o.extensions;if(!(!s||!s.length)){n[i]=s;for(var a=0;a<s.length;a++){var c=s[a];if(e[c]){var u=t.indexOf(gu[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 o8={};Be(o8,{createVerifiedFetch:()=>ph,verifiedFetch:()=>wu});function ci(n){let e=new globalThis.AbortController;function t(){e.abort();for(let o of n)o?.removeEventListener!=null&&o.removeEventListener("abort",t)}for(let o of n){if(o?.aborted===!0){t();break}o?.addEventListener!=null&&o.addEventListener("abort",t)}function r(){for(let o of n)o?.removeEventListener!=null&&o.removeEventListener("abort",t)}let i=e.signal;return i.clear=r,i}function zb(n){let[e,t]=n[Symbol.asyncIterator]!=null?[n[Symbol.asyncIterator](),Symbol.asyncIterator]:[n[Symbol.iterator](),Symbol.iterator],r=[];return{peek:()=>e.next(),push:i=>{r.push(i)},next:()=>r.length>0?{done:!1,value:r.shift()}:e.next(),[t](){return this}}}var zi=zb;function Mb(n){return n[Symbol.asyncIterator]!=null}function vh(n){return n?.then!=null}function jb(n,e){if(Mb(n))return async function*(){for await(let a of n){let c=e(a);vh(c)&&await c,yield a}}();let t=zi(n),{value:r,done:i}=t.next();if(i===!0)return function*(){}();if(typeof e(r)?.then=="function")return async function*(){yield r;for await(let a of t){let c=e(a);vh(c)&&await c,yield a}}();let s=e;return function*(){yield r;for(let a of t)s(a),yield a}()}var vu=jb;var Ru={};Be(Ru,{base32:()=>We,base32hex:()=>Qb,base32hexpad:()=>tv,base32hexpadupper:()=>nv,base32hexupper:()=>ev,base32pad:()=>Zb,base32padupper:()=>Jb,base32upper:()=>Bh,base32z:()=>rv});var Mi={};Be(Mi,{coerce:()=>Ft,empty:()=>Eh,equals:()=>Eu,fromHex:()=>$b,fromString:()=>ku,isBinary:()=>Kb,toHex:()=>Hb,toString:()=>Au});var Eh=new Uint8Array(0);function Hb(n){return n.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),"")}function $b(n){let e=n.match(/../g);return e!=null?new Uint8Array(e.map(t=>parseInt(t,16))):Eh}function Eu(n,e){if(n===e)return!0;if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0}function Ft(n){if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("Unknown type, must be binary type")}function Kb(n){return n instanceof ArrayBuffer||ArrayBuffer.isView(n)}function ku(n){return new TextEncoder().encode(n)}function Au(n){return new TextDecoder().decode(n)}function qb(n,e){if(n.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<n.length;i++){var o=n.charAt(i),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=i}var a=n.length,c=n.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 m=0,g=0,x=0,w=f.length;x!==w&&f[x]===0;)x++,m++;for(var b=(w-x)*l+1>>>0,A=new Uint8Array(b);x!==w;){for(var B=f[x],k=0,E=b-1;(B!==0||k<g)&&E!==-1;E--,k++)B+=256*A[E]>>>0,A[E]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");g=k,x++}for(var v=b-g;v!==b&&A[v]===0;)v++;for(var R=c.repeat(m);v<b;++v)R+=n.charAt(A[v]);return R}function h(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var m=0;if(f[m]!==" "){for(var g=0,x=0;f[m]===c;)g++,m++;for(var w=(f.length-m)*u+1>>>0,b=new Uint8Array(w);f[m];){var A=t[f.charCodeAt(m)];if(A===255)return;for(var B=0,k=w-1;(A!==0||B<x)&&k!==-1;k--,B++)A+=a*b[k]>>>0,b[k]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");x=B,m++}if(f[m]!==" "){for(var E=w-x;E!==w&&b[E]===0;)E++;for(var v=new Uint8Array(g+(w-E)),R=g;E!==w;)v[R++]=b[E++];return v}}}function d(f){var m=h(f);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:h,decode:d}}var Gb=qb,Wb=Gb,kh=Wb;var Bu=class{name;prefix;baseEncode;constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Iu=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){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=r}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 Ah(this,e)}},Su=class{decoders;constructor(e){this.decoders=e}or(e){return Ah(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Ah(n,e){return new Su({...n.decoders??{[n.prefix]:n},...e.decoders??{[e.prefix]:e}})}var _u=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new Bu(e,t,r),this.decoder=new Iu(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function ji({name:n,prefix:e,encode:t,decode:r}){return new _u(n,e,t,r)}function kr({name:n,prefix:e,alphabet:t}){let{encode:r,decode:i}=kh(t,n);return ji({prefix:e,name:n,encode:r,decode:o=>Ft(i(o))})}function Yb(n,e,t,r){let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=n.length;for(;n[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[n[l]];if(p===void 0)throw new SyntaxError(`Non-${r} 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 Xb(n,e,t){let r=e[e.length-1]==="=",i=(1<<t)-1,o="",s=0,a=0;for(let c=0;c<n.length;++c)for(a=a<<8|n[c],s+=8;s>t;)s-=t,o+=e[i&a>>s];if(s!==0&&(o+=e[i&a<<t-s]),r)for(;o.length*t&7;)o+="=";return o}function Ie({name:n,prefix:e,bitsPerChar:t,alphabet:r}){return ji({prefix:e,name:n,encode(i){return Xb(i,r,t)},decode(i){return Yb(i,r,t,n)}})}var We=Ie({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Bh=Ie({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Zb=Ie({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Jb=Ie({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Qb=Ie({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ev=Ie({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),tv=Ie({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),nv=Ie({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rv=Ie({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Tu={};Be(Tu,{base58btc:()=>Re,base58flickr:()=>iv});var Re=kr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),iv=kr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var ov=_h,Ih=128,sv=127,av=~sv,cv=Math.pow(2,31);function _h(n,e,t){e=e||[],t=t||0;for(var r=t;n>=cv;)e[t++]=n&255|Ih,n/=128;for(;n&av;)e[t++]=n&255|Ih,n>>>=7;return e[t]=n|0,_h.bytes=t-r+1,e}var lv=Cu,uv=128,Sh=127;function Cu(n,r){var t=0,r=r||0,i=0,o=r,s,a=n.length;do{if(o>=a)throw Cu.bytes=0,new RangeError("Could not decode varint");s=n[o++],t+=i<28?(s&Sh)<<i:(s&Sh)*Math.pow(2,i),i+=7}while(s>=uv);return Cu.bytes=o-r,t}var pv=Math.pow(2,7),dv=Math.pow(2,14),fv=Math.pow(2,21),hv=Math.pow(2,28),mv=Math.pow(2,35),gv=Math.pow(2,42),xv=Math.pow(2,49),yv=Math.pow(2,56),wv=Math.pow(2,63),bv=function(n){return n<pv?1:n<dv?2:n<fv?3:n<hv?4:n<mv?5:n<gv?6:n<xv?7:n<yv?8:n<wv?9:10},vv={encode:ov,decode:lv,encodingLength:bv},Ev=vv,Zo=Ev;function Jo(n,e=0){return[Zo.decode(n,e),Zo.decode.bytes]}function Hi(n,e,t=0){return Zo.encode(n,e,t),e}function $i(n){return Zo.encodingLength(n)}function xn(n,e){let t=e.byteLength,r=$i(n),i=r+$i(t),o=new Uint8Array(i+t);return Hi(n,o,0),Hi(t,o,r),o.set(e,i),new Ki(n,t,e,o)}function kt(n){let e=Ft(n),[t,r]=Jo(e),[i,o]=Jo(e.subarray(r)),s=e.subarray(r+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Ki(t,i,s,e)}function Rh(n,e){if(n===e)return!0;{let t=e;return n.code===t.code&&n.size===t.size&&t.bytes instanceof Uint8Array&&Eu(n.bytes,t.bytes)}}var Ki=class{code;size;digest;bytes;constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}};function Th(n,e){let{bytes:t,version:r}=n;switch(r){case 0:return Av(t,Nu(n),e??Re.encoder);default:return Bv(t,Nu(n),e??We.encoder)}}var Ch=new WeakMap;function Nu(n){let e=Ch.get(n);if(e==null){let t=new Map;return Ch.set(n,t),t}return e}var V=class n{code;version;multihash;bytes;"/";constructor(e,t,r,i){this.code=t,this.version=e,this.multihash=r,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!==Qo)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Iv)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return n.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,r=xn(e,t);return n.createV1(this.code,r)}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 n.equals(this,e)}static equals(e,t){let r=t;return r!=null&&e.code===r.code&&e.version===r.version&&Rh(e.multihash,r.multihash)}toString(e){return Th(this,e)}toJSON(){return{"/":Th(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 n)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:r,code:i,multihash:o,bytes:s}=t;return new n(r,i,o,s??Nh(r,i,o.bytes))}else if(t[Sv]===!0){let{version:r,multihash:i,code:o}=t,s=kt(i);return n.create(r,o,s)}else return null}static create(e,t,r){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==Qo)throw new Error(`Version 0 CID must use dag-pb (code: ${Qo}) block encoding`);return new n(e,t,r,r.bytes)}case 1:{let i=Nh(e,t,r.bytes);return new n(e,t,r,i)}default:throw new Error("Invalid version")}}static createV0(e){return n.create(0,Qo,e)}static createV1(e,t){return n.create(1,e,t)}static decode(e){let[t,r]=n.decodeFirst(e);if(r.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=n.inspectBytes(e),r=t.size-t.multihashSize,i=Ft(e.subarray(r,r+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let o=i.subarray(t.multihashSize-t.digestSize),s=new Ki(t.multihashCode,t.digestSize,o,i);return[t.version===0?n.createV0(s):n.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[p,h]=Jo(e.subarray(t));return t+=h,p},i=r(),o=Qo;if(i===18?(i=0,t=0):o=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=t,a=r(),c=r(),u=t+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,t){let[r,i]=kv(e,t),o=n.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Nu(o).set(r,e),o}};function kv(n,e){switch(n[0]){case"Q":{let t=e??Re;return[Re.prefix,t.decode(`${Re.prefix}${n}`)]}case Re.prefix:{let t=e??Re;return[Re.prefix,t.decode(n)]}case We.prefix:{let t=e??We;return[We.prefix,t.decode(n)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[n[0],e.decode(n)]}}}function Av(n,e,t){let{prefix:r}=t;if(r!==Re.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(r);if(i==null){let o=t.encode(n).slice(1);return e.set(r,o),o}else return i}function Bv(n,e,t){let{prefix:r}=t,i=e.get(r);if(i==null){let o=t.encode(n);return e.set(r,o),o}else return i}var Qo=112,Iv=18;function Nh(n,e,t){let r=$i(n),i=r+$i(e),o=new Uint8Array(i+t.byteLength);return Hi(n,o,0),Hi(e,o,r),o.set(t,i),o}var Sv=Symbol.for("@ipld/js-cid/CID");var es=Symbol.for("@libp2p/content-routing");var Uu=Symbol.for("@libp2p/peer-id");function Uh(n){return n!=null&&!!n[Uu]}var ts=Symbol.for("@libp2p/peer-routing");var Ar=class n extends Error{code;type;constructor(e="The operation was aborted"){super(e),this.code=n.code,this.type=n.type}static code="ABORT_ERR";static type="aborted"},F=class extends Error{code;props;constructor(e,t,r){super(e),this.code=t,this.name=r?.name??"CodeError",this.props=r??{}}};var ya=class extends EventTarget{#e=new Map;listenerCount(e){let t=this.#e.get(e);return t==null?0:t.length}addEventListener(e,t,r){super.addEventListener(e,t,r);let i=this.#e.get(e);i==null&&(i=[],this.#e.set(e,i)),i.push({callback:t,once:(r!==!0&&r!==!1&&r?.once)??!1})}removeEventListener(e,t,r){super.removeEventListener(e.toString(),t??null,r);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),r=this.#e.get(e.type);return r==null||(r=r.filter(({once:i})=>!i),this.#e.set(e.type,r)),t}safeDispatchEvent(e,t={}){return this.dispatchEvent(new _v(e,t))}},Lu=class extends Event{detail;constructor(e,t){super(e,t),this.detail=t?.detail}},_v=globalThis.CustomEvent??Lu;var wa=(n,...e)=>{try{[...e]}catch{}};function Lh(n){return n!=null&&typeof n.start=="function"&&typeof n.stop=="function"}async function Br(...n){let e=[];for(let t of n)Lh(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 Ir(...n){let e=[];for(let t of n)Lh(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 Ou={};Be(Ou,{sha256:()=>re,sha512:()=>Pu});function li({name:n,code:e,encode:t}){return new Du(n,e,t)}var Du=class{name;code;encode;constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?xn(this.code,t):t.then(r=>xn(this.code,r))}else throw Error("Unknown type, must be binary type")}};function Ph(n){return async e=>new Uint8Array(await crypto.subtle.digest(n,e))}var re=li({name:"sha2-256",code:18,encode:Ph("SHA-256")}),Pu=li({name:"sha2-512",code:19,encode:Ph("SHA-512")});var Bt=ee(Vu(),1);var zu={};Be(zu,{base64:()=>wn,base64pad:()=>Mv,base64url:()=>zh,base64urlpad:()=>jv});var wn=Ie({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Mv=Ie({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),zh=Ie({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),jv=Ie({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});Bt.default.formatters.b=n=>n==null?"undefined":Re.baseEncode(n);Bt.default.formatters.t=n=>n==null?"undefined":We.baseEncode(n);Bt.default.formatters.m=n=>n==null?"undefined":wn.baseEncode(n);Bt.default.formatters.p=n=>n==null?"undefined":n.toString();Bt.default.formatters.c=n=>n==null?"undefined":n.toString();Bt.default.formatters.k=n=>n==null?"undefined":n.toString();Bt.default.formatters.a=n=>n==null?"undefined":n.toString();function Hv(n){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=n,e.destroy=()=>!0,e.extend=()=>e,e}function Mh(){return{forComponent(n){return ae(n)}}}function ae(n){let e=Hv(`${n}:trace`);return Bt.default.enabled(`${n}:trace`)&&Bt.default.names.map(t=>t.toString()).find(t=>t.includes(":trace"))!=null&&(e=(0,Bt.default)(`${n}:trace`)),Object.assign((0,Bt.default)(n),{error:(0,Bt.default)(`${n}:error`),trace:e})}function fe(n,e){if(n===e)return!0;if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0}function Sr(n){return globalThis.Buffer!=null?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):n}function jn(n=0){return globalThis.Buffer?.alloc!=null?Sr(globalThis.Buffer.alloc(n)):new Uint8Array(n)}function ft(n=0){return globalThis.Buffer?.allocUnsafe!=null?Sr(globalThis.Buffer.allocUnsafe(n)):new Uint8Array(n)}var $v=Math.pow(2,7),Kv=Math.pow(2,14),qv=Math.pow(2,21),Mu=Math.pow(2,28),ju=Math.pow(2,35),Hu=Math.pow(2,42),$u=Math.pow(2,49),he=128,tt=127;function ht(n){if(n<$v)return 1;if(n<Kv)return 2;if(n<qv)return 3;if(n<Mu)return 4;if(n<ju)return 5;if(n<Hu)return 6;if(n<$u)return 7;if(Number.MAX_SAFE_INTEGER!=null&&n>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Ku(n,e,t=0){switch(ht(n)){case 8:e[t++]=n&255|he,n/=128;case 7:e[t++]=n&255|he,n/=128;case 6:e[t++]=n&255|he,n/=128;case 5:e[t++]=n&255|he,n/=128;case 4:e[t++]=n&255|he,n>>>=7;case 3:e[t++]=n&255|he,n>>>=7;case 2:e[t++]=n&255|he,n>>>=7;case 1:{e[t++]=n&255,n>>>=7;break}default:throw new Error("unreachable")}return e}function Gv(n,e,t=0){switch(ht(n)){case 8:e.set(t++,n&255|he),n/=128;case 7:e.set(t++,n&255|he),n/=128;case 6:e.set(t++,n&255|he),n/=128;case 5:e.set(t++,n&255|he),n/=128;case 4:e.set(t++,n&255|he),n>>>=7;case 3:e.set(t++,n&255|he),n>>>=7;case 2:e.set(t++,n&255|he),n>>>=7;case 1:{e.set(t++,n&255),n>>>=7;break}default:throw new Error("unreachable")}return e}function qu(n,e){let t=n[e],r=0;if(r+=t&tt,t<he||(t=n[e+1],r+=(t&tt)<<7,t<he)||(t=n[e+2],r+=(t&tt)<<14,t<he)||(t=n[e+3],r+=(t&tt)<<21,t<he)||(t=n[e+4],r+=(t&tt)*Mu,t<he)||(t=n[e+5],r+=(t&tt)*ju,t<he)||(t=n[e+6],r+=(t&tt)*Hu,t<he)||(t=n[e+7],r+=(t&tt)*$u,t<he))return r;throw new RangeError("Could not decode varint")}function Wv(n,e){let t=n.get(e),r=0;if(r+=t&tt,t<he||(t=n.get(e+1),r+=(t&tt)<<7,t<he)||(t=n.get(e+2),r+=(t&tt)<<14,t<he)||(t=n.get(e+3),r+=(t&tt)<<21,t<he)||(t=n.get(e+4),r+=(t&tt)*Mu,t<he)||(t=n.get(e+5),r+=(t&tt)*ju,t<he)||(t=n.get(e+6),r+=(t&tt)*Hu,t<he)||(t=n.get(e+7),r+=(t&tt)*$u,t<he))return r;throw new RangeError("Could not decode varint")}function Yi(n,e,t=0){return e==null&&(e=ft(ht(n))),e instanceof Uint8Array?Ku(n,e,t):Gv(n,e,t)}function pi(n,e=0){return n instanceof Uint8Array?qu(n,e):Wv(n,e)}var Gu=new Float32Array([-0]),_r=new Uint8Array(Gu.buffer);function Hh(n,e,t){Gu[0]=n,e[t]=_r[0],e[t+1]=_r[1],e[t+2]=_r[2],e[t+3]=_r[3]}function $h(n,e){return _r[0]=n[e],_r[1]=n[e+1],_r[2]=n[e+2],_r[3]=n[e+3],Gu[0]}var Wu=new Float64Array([-0]),nt=new Uint8Array(Wu.buffer);function Kh(n,e,t){Wu[0]=n,e[t]=nt[0],e[t+1]=nt[1],e[t+2]=nt[2],e[t+3]=nt[3],e[t+4]=nt[4],e[t+5]=nt[5],e[t+6]=nt[6],e[t+7]=nt[7]}function qh(n,e){return nt[0]=n[e],nt[1]=n[e+1],nt[2]=n[e+2],nt[3]=n[e+3],nt[4]=n[e+4],nt[5]=n[e+5],nt[6]=n[e+6],nt[7]=n[e+7],Wu[0]}var Yv=BigInt(Number.MAX_SAFE_INTEGER),Xv=BigInt(Number.MIN_SAFE_INTEGER),It=class n{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,r=~this.hi>>>0;return t===0&&(r=r+1>>>0),-(t+r*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,r=~this.hi>>>0;return t===0&&(r=r+1>>>0),-(BigInt(t)+(BigInt(r)<<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,r=this.hi>>>24;return r===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}static fromBigInt(e){if(e===0n)return di;if(e<Yv&&e>Xv)return this.fromNumber(Number(e));let t=e<0n;t&&(e=-e);let r=e>>32n,i=e-(r<<32n);return t&&(r=~r|0n,i=~i|0n,++i>Gh&&(i=0n,++r>Gh&&(r=0n))),new n(Number(i),Number(r))}static fromNumber(e){if(e===0)return di;let t=e<0;t&&(e=-e);let r=e>>>0,i=(e-r)/4294967296>>>0;return t&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new n(r,i)}static from(e){return typeof e=="number"?n.fromNumber(e):typeof e=="bigint"?n.fromBigInt(e):typeof e=="string"?n.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new n(e.low>>>0,e.high>>>0):di}},di=new It(0,0);di.toBigInt=function(){return 0n};di.zzEncode=di.zzDecode=function(){return this};di.length=function(){return 1};var Gh=4294967296n;function Wh(n){let e=0,t=0;for(let r=0;r<n.length;++r)t=n.charCodeAt(r),t<128?e+=1:t<2048?e+=2:(t&64512)===55296&&(n.charCodeAt(r+1)&64512)===56320?(++r,e+=4):e+=3;return e}function Yh(n,e,t){if(t-e<1)return"";let i,o=[],s=0,a;for(;e<t;)a=n[e++],a<128?o[s++]=a:a>191&&a<224?o[s++]=(a&31)<<6|n[e++]&63:a>239&&a<365?(a=((a&7)<<18|(n[e++]&63)<<12|(n[e++]&63)<<6|n[e++]&63)-65536,o[s++]=55296+(a>>10),o[s++]=56320+(a&1023)):o[s++]=(a&15)<<12|(n[e++]&63)<<6|n[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 Yu(n,e,t){let r=t,i,o;for(let s=0;s<n.length;++s)i=n.charCodeAt(s),i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&((o=n.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-r}function Yt(n,e){return RangeError(`index out of range: ${n.pos} + ${e??1} > ${n.len}`)}function Ea(n,e){return(n[e-4]|n[e-3]<<8|n[e-2]<<16|n[e-1]<<24)>>>0}var Xu=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,Yt(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 Yt(this,4);return Ea(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw Yt(this,4);return Ea(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw Yt(this,4);let e=$h(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw Yt(this,4);let e=qh(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw Yt(this,e);return this.pos+=e,t===r?new Uint8Array(0):this.buf.subarray(t,r)}string(){let e=this.bytes();return Yh(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Yt(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Yt(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 It(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 Yt(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 Yt(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 Yt(this,8);let e=Ea(this.buf,this.pos+=4),t=Ea(this.buf,this.pos+=4);return new It(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=qu(this.buf,this.pos);return this.pos+=ht(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 Zu(n){return new Xu(n instanceof Uint8Array?n:n.subarray())}function Vt(n,e,t){let r=Zu(n);return e.decode(r,void 0,t)}var Ju={};Be(Ju,{base10:()=>Zv});var Zv=kr({prefix:"9",name:"base10",alphabet:"0123456789"});var Qu={};Be(Qu,{base16:()=>Jv,base16upper:()=>Qv});var Jv=Ie({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Qv=Ie({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var ep={};Be(ep,{base2:()=>e2});var e2=Ie({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var tp={};Be(tp,{base256emoji:()=>o2});var Zh=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}"),t2=Zh.reduce((n,e,t)=>(n[t]=e,n),[]),n2=Zh.reduce((n,e,t)=>(n[e.codePointAt(0)]=t,n),[]);function r2(n){return n.reduce((e,t)=>(e+=t2[t],e),"")}function i2(n){let e=[];for(let t of n){let r=n2[t.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(r)}return new Uint8Array(e)}var o2=ji({prefix:"\u{1F680}",name:"base256emoji",encode:r2,decode:i2});var np={};Be(np,{base36:()=>Rr,base36upper:()=>s2});var Rr=kr({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),s2=kr({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var rp={};Be(rp,{base8:()=>a2});var a2=Ie({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ip={};Be(ip,{identity:()=>c2});var c2=ji({prefix:"\0",name:"identity",encode:n=>Au(n),decode:n=>ku(n)});var l2=new TextEncoder,u2=new TextDecoder;var Tr=512;function Jh(n){return l2.encode(JSON.stringify(n))}function ka(n){return JSON.parse(u2.decode(n))}var zt={};Be(zt,{code:()=>Le,decode:()=>op,encode:()=>d2,name:()=>p2});var p2="raw",Le=85;function d2(n){return Ft(n)}function op(n){return Ft(n)}var sp={};Be(sp,{identity:()=>mt});var Qh=0,f2="identity",em=Ft;function h2(n){return xn(Qh,em(n))}var mt={code:Qh,name:f2,encode:em,digest:h2};var Cr={...ip,...ep,...rp,...Ju,...Qu,...Ru,...np,...Tu,...zu,...tp},y5={...Ou,...sp};function nm(n,e,t,r){return{name:n,prefix:e,encoder:{name:n,prefix:e,encode:t},decoder:{decode:r}}}var tm=nm("utf8","u",n=>"u"+new TextDecoder("utf8").decode(n),n=>new TextEncoder().encode(n.substring(1))),ap=nm("ascii","a",n=>{let e="a";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e},n=>{n=n.substring(1);let e=ft(n.length);for(let t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e}),m2={utf8:tm,"utf-8":tm,hex:Cr.base16,latin1:ap,ascii:ap,binary:ap,...Cr},Aa=m2;function Y(n,e="utf8"){let t=Aa[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Sr(globalThis.Buffer.from(n,"utf-8")):t.decoder.decode(`${t.prefix}${n}`)}function cp(n){let e=n??8192,t=e>>>1,r,i=e;return function(s){if(s<1||s>t)return ft(s);i+s>e&&(r=ft(e),i=0);let a=r.subarray(i,i+=s);return i&7&&(i=(i|7)+1),a}}var fi=class{fn;len;next;val;constructor(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}};function lp(){}var pp=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},g2=cp();function x2(n){return globalThis.Buffer!=null?ft(n):g2(n)}var is=class{len;head;tail;states;constructor(){this.len=0,this.head=new fi(lp,0,0),this.tail=this.head,this.states=null}_push(e,t,r){return this.tail=this.tail.next=new fi(e,t,r),this.len+=t,this}uint32(e){return this.len+=(this.tail=this.tail.next=new dp((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(Ba,10,It.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let t=It.fromBigInt(e);return this._push(Ba,t.length(),t)}uint64Number(e){return this._push(Ku,ht(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=It.fromBigInt(e).zzEncode();return this._push(Ba,t.length(),t)}sint64Number(e){let t=It.fromNumber(e).zzEncode();return this._push(Ba,t.length(),t)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(up,1,e?1:0)}fixed32(e){return this._push(rs,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let t=It.fromBigInt(e);return this._push(rs,4,t.lo)._push(rs,4,t.hi)}fixed64Number(e){let t=It.fromNumber(e);return this._push(rs,4,t.lo)._push(rs,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(Hh,4,e)}double(e){return this._push(Kh,8,e)}bytes(e){let t=e.length>>>0;return t===0?this._push(up,1,0):this.uint32(t)._push(w2,t,e)}string(e){let t=Wh(e);return t!==0?this.uint32(t)._push(Yu,t,e):this._push(up,1,0)}fork(){return this.states=new pp(this),this.head=this.tail=new fi(lp,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 fi(lp,0,0),this.len=0),this}ldelim(){let e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r!==0&&(this.tail.next=e.next,this.tail=t,this.len+=r),this}finish(){let e=this.head.next,t=x2(this.len),r=0;for(;e!=null;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t}};function up(n,e,t){e[t]=n&255}function y2(n,e,t){for(;n>127;)e[t++]=n&127|128,n>>>=7;e[t]=n}var dp=class extends fi{next;constructor(e,t){super(y2,e,t),this.next=void 0}};function Ba(n,e,t){for(;n.hi!==0;)e[t++]=n.lo&127|128,n.lo=(n.lo>>>7|n.hi<<25)>>>0,n.hi>>>=7;for(;n.lo>127;)e[t++]=n.lo&127|128,n.lo=n.lo>>>7;e[t++]=n.lo}function rs(n,e,t){e[t]=n&255,e[t+1]=n>>>8&255,e[t+2]=n>>>16&255,e[t+3]=n>>>24}function w2(n,e,t){e.set(n,t)}globalThis.Buffer!=null&&(is.prototype.bytes=function(n){let e=n.length>>>0;return this.uint32(e),e>0&&this._push(b2,e,n),this},is.prototype.string=function(n){let e=globalThis.Buffer.byteLength(n);return this.uint32(e),e>0&&this._push(v2,e,n),this});function b2(n,e,t){e.set(n,t)}function v2(n,e,t){n.length<40?Yu(n,e,t):e.utf8Write!=null?e.utf8Write(n,t):e.set(Y(n),t)}function fp(){return new is}function Mt(n,e){let t=fp();return e.encode(n,t,{lengthDelimited:!1}),t.finish()}var Xi;(function(n){n[n.VARINT=0]="VARINT",n[n.BIT64=1]="BIT64",n[n.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",n[n.START_GROUP=3]="START_GROUP",n[n.END_GROUP=4]="END_GROUP",n[n.BIT32=5]="BIT32"})(Xi||(Xi={}));function Ia(n,e,t,r){return{name:n,type:e,encode:t,decode:r}}function hi(n){function e(i){if(n[i.toString()]==null)throw new Error("Invalid enum value");return n[i]}let t=function(o,s){let a=e(o);s.int32(a)},r=function(o){let s=o.int32();return e(s)};return Ia("enum",Xi.VARINT,t,r)}function jt(n,e){return Ia("message",Xi.LENGTH_DELIMITED,n,e)}function E2(n){return n[Symbol.asyncIterator]!=null}function k2(n){if(E2(n))return(async()=>{for await(let e of n);})();for(let e of n);}var mi=k2;function Ee(n,e){if(globalThis.Buffer!=null)return Sr(globalThis.Buffer.concat(n,e));e==null&&(e=n.reduce((i,o)=>i+o.length,0));let t=ft(e),r=0;for(let i of n)t.set(i,r),r+=i.length;return Sr(t)}var im=Symbol.for("@achingbrain/uint8arraylist");function rm(n,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let t=0;for(let r of n){let i=t+r.byteLength;if(e<i)return{buf:r,index:e-t};t=i}throw new RangeError("index is out of bounds")}function Sa(n){return!!n?.[im]}var gi=class n{bufs;length;[im]=!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 r of e)if(r instanceof Uint8Array)t+=r.byteLength,this.bufs.push(r);else if(Sa(r))t+=r.byteLength,this.bufs.push(...r.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 r of e.reverse())if(r instanceof Uint8Array)t+=r.byteLength,this.bufs.unshift(r);else if(Sa(r))t+=r.byteLength,this.bufs.unshift(...r.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=rm(this.bufs,e);return t.buf[t.index]}set(e,t){let r=rm(this.bufs,e);r.buf[r.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let r=0;r<e.length;r++)this.set(t+r,e[r]);else if(Sa(e))for(let r=0;r<e.length;r++)this.set(t+r,e.get(r));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:r,length:i}=this._subList(e,t);return Ee(r,i)}subarray(e,t){let{bufs:r,length:i}=this._subList(e,t);return r.length===1?r[0]:Ee(r,i)}sublist(e,t){let{bufs:r,length:i}=this._subList(e,t),o=new n;return o.length=i,o.bufs=[...r],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 r=[],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){r.push(s);break}let p=e-a;r.push(s.subarray(p,p+(t-e)));break}if(u){if(e===0){r.push(s);continue}r.push(s.subarray(e-a));continue}if(l){if(t===c){r.push(s);break}r.push(s.subarray(0,t-a));break}r.push(s)}return{bufs:r,length:t-e}}indexOf(e,t=0){if(!Sa(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let r=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=r.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[r[p]]=p;let a=s,c=this.byteLength-r.byteLength,u=r.byteLength-1,l;for(let p=t;p<=c;p+=l){l=0;for(let h=u;h>=0;h--){let d=this.get(p+h);if(r[h]!==d){l=Math.max(1,h-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 r=ft(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setInt8(0,t),this.write(r,e)}getInt16(e,t){let r=this.subarray(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt16(0,t)}setInt16(e,t,r){let i=jn(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,t,r),this.write(i,e)}getInt32(e,t){let r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt32(0,t)}setInt32(e,t,r){let i=jn(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,t,r),this.write(i,e)}getBigInt64(e,t){let r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigInt64(0,t)}setBigInt64(e,t,r){let i=jn(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,t,r),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 r=ft(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setUint8(0,t),this.write(r,e)}getUint16(e,t){let r=this.subarray(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint16(0,t)}setUint16(e,t,r){let i=jn(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,t,r),this.write(i,e)}getUint32(e,t){let r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint32(0,t)}setUint32(e,t,r){let i=jn(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,t,r),this.write(i,e)}getBigUint64(e,t){let r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigUint64(0,t)}setBigUint64(e,t,r){let i=jn(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,t,r),this.write(i,e)}getFloat32(e,t){let r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat32(0,t)}setFloat32(e,t,r){let i=jn(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,t,r),this.write(i,e)}getFloat64(e,t){let r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat64(0,t)}setFloat64(e,t,r){let i=jn(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,t,r),this.write(i,e)}equals(e){if(e==null||!(e instanceof n)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;t<this.bufs.length;t++)if(!fe(this.bufs[t],e.bufs[t]))return!1;return!0}static fromUint8Arrays(e,t){let r=new n;return r.bufs=e,t==null&&(t=e.reduce((i,o)=>i+o.byteLength,0)),r.length=t,r}};function B2(n){return n[Symbol.asyncIterator]!=null}function I2(n,e){if(B2(n))return async function*(){for await(let a of n)yield e(a)}();let t=zi(n),{value:r,done:i}=t.next();if(i===!0)return function*(){}();let o=e(r);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 Xt=I2;function De(){let n={};return n.promise=new Promise((e,t)=>{n.resolve=e,n.reject=t}),n}var _a=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}},Zi=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new _a(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 _a(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 hp=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function bn(n={}){return S2(t=>{let r=t.shift();if(r==null)return{done:!0};if(r.error!=null)throw r.error;return{done:r.done===!0,value:r.value}},n)}function S2(n,e){e=e??{};let t=e.onEnd,r=new Zi,i,o,s,a=De(),c=async()=>{try{return r.isEmpty()?s?{done:!0}:await new Promise((g,x)=>{o=w=>{o=null,r.push(w);try{g(n(r))}catch(b){x(b)}return i}}):n(r)}finally{r.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=De()})}},u=g=>o!=null?o(g):(r.push(g),i),l=g=>(r=new Zi,o!=null?o({error:g}):(r.push({error:g}),i)),p=g=>{if(s)return i;if(e?.objectMode!==!0&&g?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return u({done:!1,value:g})},h=g=>s?i:(s=!0,g!=null?l(g):u({done:!0})),d=()=>(r=new Zi,h(),{done:!0}),f=g=>(h(g),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:d,throw:f,push:p,end:h,get readableLength(){return r.size},onEmpty:async g=>{let x=g?.signal;if(x?.throwIfAborted(),r.isEmpty())return;let w,b;x!=null&&(w=new Promise((A,B)=>{b=()=>{B(new hp)},x.addEventListener("abort",b)}));try{await Promise.race([a.promise,w])}finally{b!=null&&x!=null&&x?.removeEventListener("abort",b)}}},t==null)return i;let m=i;return i={[Symbol.asyncIterator](){return this},next(){return m.next()},throw(g){return m.throw(g),t!=null&&(t(g),t=void 0),{done:!0}},return(){return m.return(),t!=null&&(t(),t=void 0),{done:!0}},push:p,end(g){return m.end(g),t!=null&&(t(g),t=void 0),i},get readableLength(){return m.readableLength},onEmpty:g=>m.onEmpty(g)},i}function _2(n){return n[Symbol.asyncIterator]!=null}function R2(...n){let e=[];for(let t of n)_2(t)||e.push(t);return e.length===n.length?function*(){for(let t of e)yield*t}():async function*(){let t=bn({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(n.map(async r=>{for await(let i of r)t.push(i)})),t.end()}catch(r){t.end(r)}}),yield*t}()}var Nr=R2;function Zt(n,...e){if(n==null)throw new Error("Empty pipeline");if(mp(n)){let r=n;n=()=>r.source}else if(cm(n)||am(n)){let r=n;n=()=>r}let t=[n,...e];if(t.length>1&&mp(t[t.length-1])&&(t[t.length-1]=t[t.length-1].sink),t.length>2)for(let r=1;r<t.length-1;r++)mp(t[r])&&(t[r]=C2(t[r]));return T2(...t)}var T2=(...n)=>{let e;for(;n.length>0;)e=n.shift()(e);return e},am=n=>n?.[Symbol.asyncIterator]!=null,cm=n=>n?.[Symbol.iterator]!=null,mp=n=>n==null?!1:n.sink!=null&&n.source!=null,C2=n=>e=>{let t=n.sink(e);if(t?.then!=null){let r=bn({objectMode:!0});t.then(()=>{r.end()},s=>{r.end(s)});let i,o=n.source;if(am(o))i=async function*(){yield*o,r.end()};else if(cm(o))i=function*(){yield*o,r.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Nr(r,i())}return n.source};function N2(n){return n[Symbol.asyncIterator]!=null}function U2(n,e){return N2(n)?async function*(){let t=0;if(!(e<1)){for await(let r of n)if(yield r,t++,t===e)return}}():function*(){let t=0;if(!(e<1)){for(let r of n)if(yield r,t++,t===e)return}}()}var Ra=U2;var P=class extends Event{constructor(e,t){super(e),this.detail=t}};function Q(n,e="utf8"){let t=Aa[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(n.buffer,n.byteOffset,n.byteLength).toString("utf8"):t.encoder.encode(n).substring(1)}var Ta=class{url;#e=0;#t=0;#n=0;#s=0;constructor(e){this.url=e instanceof URL?e:new URL(e)}async getRawBlock(e,t){let r=this.url;if(r.pathname=`/ipfs/${e.toString()}`,r.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(r.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.#s++,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.#n>0?-1/0:this.#s/(this.#e+this.#t*3)}incrementInvalidBlocks(){this.#n++}};var Ca=class{gateways;log;constructor(e,t={}){this.log=e.logger.forComponent("helia:trustless-gateway-block-broker"),this.gateways=(t.gateways??lm).map(r=>new Ta(r))}async retrieve(e,t={}){let r=this.gateways.sort((o,s)=>s.reliability()-o.reliability()),i=[];for(let o of r){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 lm=["https://trustless-gateway.link","https://cloudflare-ipfs.com","https://4everland.io"];function os(n={}){return e=>new Ca(e,n)}var L2=Symbol.for("nodejs.util.inspect.custom"),um=Object.values(Cr).map(n=>n.decoder).reduce((n,e)=>n.or(e),Cr.identity.decoder),pm=114,gp=36,xp=37,ss=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()})`}[Uu]=!0;toString(){return this.string==null&&(this.string=Re.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return V.createV1(pm,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e==null)return!1;if(e instanceof Uint8Array)return fe(this.multihash.bytes,e);if(typeof e=="string")return Jt(e).equals(this);if(e?.multihash?.bytes!=null)return fe(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[L2](){return`PeerId(${this.toString()})`}},Ji=class extends ss{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Qi=class extends ss{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},eo=class extends ss{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function Jt(n,e){if(e=e??um,n.charAt(0)==="1"||n.charAt(0)==="Q"){let t=kt(Re.decode(`z${n}`));return n.startsWith("12D")?new Qi({multihash:t}):n.startsWith("16U")?new eo({multihash:t}):new Ji({multihash:t})}return as(um.decode(n))}function as(n){try{let e=kt(n);if(e.code===mt.code){if(e.digest.length===gp)return new Qi({multihash:e});if(e.digest.length===xp)return new eo({multihash:e})}if(e.code===re.code)return new Ji({multihash:e})}catch{return D2(V.decode(n))}throw new Error("Supplied PeerID CID is invalid")}function D2(n){if(n==null||n.multihash==null||n.version==null||n.version===1&&n.code!==pm)throw new Error("Supplied PeerID CID is invalid");let e=n.multihash;if(e.code===re.code)return new Ji({multihash:n.multihash});if(e.code===mt.code){if(e.digest.length===gp)return new Qi({multihash:n.multihash});if(e.digest.length===xp)return new eo({multihash:n.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function dm(n,e){return n.length===gp?new Qi({multihash:xn(mt.code,n),privateKey:e}):n.length===xp?new eo({multihash:xn(mt.code,n),privateKey:e}):new Ji({multihash:await re.digest(n),publicKey:n,privateKey:e})}var Na=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let t=this.index,r=e();return r===void 0&&(this.index=t),r}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,r){return this.readAtomically(()=>{if(!(t>0&&this.readGivenChar(e)===void 0))return r()})}readNumber(e,t,r,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 h=Number.parseInt(p,e);if(!Number.isNaN(h))return h});if(l===void 0)break;if(o*=e,o+=l,o>u||(s+=1,t!==void 0&&s>t))return}if(s!==0)return!r&&c&&s>1?void 0:o})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let t=0;t<e.length;t++){let r=this.readSeparator(".",t,()=>this.readNumber(10,3,!1,1));if(r===void 0)return;e[t]=r}return e})}readIPv6Addr(){let e=t=>{for(let r=0;r<t.length/2;r++){let i=r*2;if(r<t.length-3){let s=this.readSeparator(":",r,()=>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(":",r,()=>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),[r,i]=e(t);if(r===16)return t;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let o=new Uint8Array(14),s=16-(r+2),[a]=e(o.subarray(0,s));return t.set(o.subarray(0,a),16-a),t})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var fm=45,P2=15,to=new Na;function yp(n){if(!(n.length>P2))return to.new(n).parseWith(()=>to.readIPv4Addr())}function wp(n){if(n.includes("%")&&(n=n.split("%")[0]),!(n.length>fm))return to.new(n).parseWith(()=>to.readIPv6Addr())}function Ua(n){if(n.includes("%")&&(n=n.split("%")[0]),!(n.length>fm))return to.new(n).parseWith(()=>to.readIPAddr())}var WI=parseInt("0xFFFF",16),YI=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function gm(n){return!!yp(n)}function xm(n){return!!wp(n)}function La(n){return!!Ua(n)}var ym=gm,M2=xm,bp=function(n){let e=0;if(n=n.toString().trim(),ym(n)){let t=new Uint8Array(e+4);return n.split(/\./g).forEach(r=>{t[e++]=parseInt(r,10)&255}),t}if(M2(n)){let t=n.split(":",8),r;for(r=0;r<t.length;r++){let o=ym(t[r]),s;o&&(s=bp(t[r]),t[r]=Q(s.slice(0,2),"base16")),s!=null&&++r<8&&t.splice(r,0,Q(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(r=0;r<t.length&&t[r]!=="";r++);let o=[r,1];for(r=9-t.length;r>0;r--)o.push("0");t.splice.apply(t,o)}let i=new Uint8Array(e+16);for(r=0;r<t.length;r++){let o=parseInt(t[r],16);i[e++]=o>>8&255,i[e++]=o&255}return i}throw new Error("invalid ip address")},wm=function(n,e=0,t){e=~~e,t=t??n.length-e;let r=new DataView(n.buffer);if(t===4){let i=[];for(let o=0;o<t;o++)i.push(n[e+o]);return i.join(".")}if(t===16){let i=[];for(let o=0;o<t;o+=2)i.push(r.getUint16(e+o).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var no={},vp={},H2=[[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"]];H2.forEach(n=>{let e=$2(...n);vp[e.code]=e,no[e.name]=e});function $2(n,e,t,r,i){return{code:n,size:e,name:t,resolvable:!!r,path:!!i}}function ye(n){if(typeof n=="number"){if(vp[n]!=null)return vp[n];throw new Error(`no protocol with code: ${n}`)}else if(typeof n=="string"){if(no[n]!=null)return no[n];throw new Error(`no protocol with name: ${n}`)}throw new Error(`invalid protocol id type: ${typeof n}`)}var NS=ye("ip4"),US=ye("ip6"),LS=ye("ipcidr");function kp(n,e){switch(ye(n).code){case 4:case 41:return q2(e);case 42:return Em(e);case 6:case 273:case 33:case 132:return Am(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Em(e);case 421:return X2(e);case 444:return km(e);case 445:return km(e);case 466:return Y2(e);default:return Q(e,"base16")}}function Ap(n,e){switch(ye(n).code){case 4:return bm(e);case 41:return bm(e);case 42:return vm(e);case 6:case 273:case 33:case 132:return Bp(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return vm(e);case 421:return G2(e);case 444:return Z2(e);case 445:return J2(e);case 466:return W2(e);default:return Y(e,"base16")}}var Ep=Object.values(Cr).map(n=>n.decoder),K2=function(){let n=Ep[0].or(Ep[1]);return Ep.slice(2).forEach(e=>n=n.or(e)),n}();function bm(n){if(!La(n))throw new Error("invalid ip address");return bp(n)}function q2(n){let e=wm(n,0,n.length);if(e==null)throw new Error("ipBuff is required");if(!La(e))throw new Error("invalid ip address");return e}function Bp(n){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,n),new Uint8Array(e)}function Am(n){return new DataView(n.buffer).getUint16(n.byteOffset)}function vm(n){let e=Y(n),t=Uint8Array.from(Yi(e.length));return Ee([t,e],t.length+e.length)}function Em(n){let e=pi(n);if(n=n.slice(ht(e)),n.length!==e)throw new Error("inconsistent lengths");return Q(n)}function G2(n){let e;n[0]==="Q"||n[0]==="1"?e=kt(Re.decode(`z${n}`)).bytes:e=V.parse(n).multihash.bytes;let t=Uint8Array.from(Yi(e.length));return Ee([t,e],t.length+e.length)}function W2(n){let e=K2.decode(n),t=Uint8Array.from(Yi(e.length));return Ee([t,e],t.length+e.length)}function Y2(n){let e=pi(n),t=n.slice(ht(e));if(t.length!==e)throw new Error("inconsistent lengths");return"u"+Q(t,"base64url")}function X2(n){let e=pi(n),t=n.slice(ht(e));if(t.length!==e)throw new Error("inconsistent lengths");return Q(t,"base58btc")}function Z2(n){let e=n.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=We.decode("b"+e[0]),r=parseInt(e[1],10);if(r<1||r>65536)throw new Error("Port number is not in range(1, 65536)");let i=Bp(r);return Ee([t,i],t.length+i.length)}function J2(n){let e=n.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=We.decode(`b${e[0]}`),r=parseInt(e[1],10);if(r<1||r>65536)throw new Error("Port number is not in range(1, 65536)");let i=Bp(r);return Ee([t,i],t.length+i.length)}function km(n){let e=n.slice(0,n.length-2),t=n.slice(n.length-2),r=Q(e,"base32"),i=Am(t);return`${r}:${i}`}function Bm(n){n=Ip(n);let e=[],t=[],r=null,i=n.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=ye(s);if(a.size===0){e.push([a.code]),t.push([a.code]);continue}if(o++,o>=i.length)throw Sm("invalid address: "+n);if(a.path===!0){r=Ip(i.slice(o).join("/")),e.push([a.code,Ap(a.code,r)]),t.push([a.code,r]);break}let c=Ap(a.code,i[o]);e.push([a.code,c]),t.push([a.code,kp(a.code,c)])}return{string:Im(t),bytes:_p(e),tuples:e,stringTuples:t,path:r}}function Sp(n){let e=[],t=[],r=null,i=0;for(;i<n.length;){let o=pi(n,i),s=ht(o),a=ye(o),c=Q2(a,n.slice(i+s));if(c===0){e.push([o]),t.push([o]),i+=s;continue}let u=n.slice(i+s,i+s+c);if(i+=c+s,i>n.length)throw Sm("Invalid address Uint8Array: "+Q(n,"base16"));e.push([o,u]);let l=kp(o,u);if(t.push([o,l]),a.path===!0){r=l;break}}return{bytes:Uint8Array.from(n),string:Im(t),tuples:e,stringTuples:t,path:r}}function Im(n){let e=[];return n.map(t=>{let r=ye(t[0]);return e.push(r.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),Ip(e.join("/"))}function _p(n){return Ee(n.map(e=>{let t=ye(e[0]),r=Uint8Array.from(Yi(t.code));return e.length>1&&e[1]!=null&&(r=Ee([r,e[1]])),r}))}function Q2(n,e){if(n.size>0)return n.size/8;if(n.size===0)return 0;{let t=pi(e instanceof Uint8Array?e:Uint8Array.from(e));return t+ht(t)}}function Ip(n){return"/"+n.trim().split("/").filter(e=>e).join("/")}function Sm(n){return new Error("Error parsing address: "+n)}var eE=Symbol.for("nodejs.util.inspect.custom"),Rp=Symbol.for("@multiformats/js-multiaddr/multiaddr"),tE=[ye("dns").code,ye("dns4").code,ye("dns6").code,ye("dnsaddr").code],Da=class n{bytes;#e;#t;#n;#s;[Rp]=!0;constructor(e){e==null&&(e="");let t;if(e instanceof Uint8Array)t=Sp(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);t=Bm(e)}else if(Rm(e))t=Sp(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.#n=t.stringTuples,this.#s=t.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let e,t,r,i,o="",s=ye("tcp"),a=ye("udp"),c=ye("ip4"),u=ye("ip6"),l=ye("dns6"),p=ye("ip6zone");for(let[d,f]of this.stringTuples())d===p.code&&(o=`%${f??""}`),tE.includes(d)&&(t=s.name,i=443,r=`${f??""}${o}`,e=d===l.code?6:4),(d===s.code||d===a.code)&&(t=ye(d).name,i=parseInt(f??"")),(d===c.code||d===u.code)&&(t=ye(d).name,r=`${f??""}${o}`,e=d===u.code?6:4);if(e==null||t==null||r==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:r,transport:t,port:i}}protos(){return this.#t.map(([e])=>Object.assign({},ye(e)))}protoCodes(){return this.#t.map(([e])=>e)}protoNames(){return this.#t.map(([e])=>ye(e).name)}tuples(){return this.#t}stringTuples(){return this.#n}encapsulate(e){return e=new n(e),new n(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),r=this.toString(),i=r.lastIndexOf(t);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new n(r.slice(0,i))}decapsulateCode(e){let t=this.tuples();for(let r=t.length-1;r>=0;r--)if(t[r][0]===e)return new n(_p(t.slice(0,r)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([r,i])=>{r===no.p2p.code&&e.push([r,i]),r===no["p2p-circuit"].code&&(e=[])});let t=e.pop();if(t?.[1]!=null){let r=t[1];return r[0]==="Q"||r[0]==="1"?Q(Re.decode(`z${r}`),"base58btc"):Q(V.parse(r).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#s}equals(e){return fe(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(o=>o.resolvable);if(t==null)return[this];let r=_m.get(t.name);if(r==null)throw new F(`no available resolver for ${t.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await r(this,e)).map(o=>new n(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)}[eE](){return`Multiaddr(${this.#e})`}};var _m=new Map;function Rm(n){return!!n?.[Rp]}function Tp(n){return new Da(n)}async function*Pa(n,e={}){let t=n.getReader();try{for(;;){let r=await t.read();if(r.done)return;yield r.value}}finally{e.preventCancel!==!0&&await t.cancel(),t.releaseLock()}}var Wp={};Be(Wp,{Ed25519PrivateKey:()=>bi,Ed25519PublicKey:()=>us,generateKeyPair:()=>d3,generateKeyPairFromSeed:()=>t0,unmarshalEd25519PrivateKey:()=>u3,unmarshalEd25519PublicKey:()=>p3});function Ht(n){return n==null?!1:typeof n.then=="function"&&typeof n.catch=="function"&&typeof n.finally=="function"}function ro(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function nE(n){return n instanceof Uint8Array||n!=null&&typeof n=="object"&&n.constructor.name==="Uint8Array"}function Cp(n,...e){if(!nE(n))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(n.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${n.length}`)}function Oa(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ro(n.outputLen),ro(n.blockLen)}function io(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function Tm(n,e){Cp(n);let t=e.outputLen;if(n.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}var Fa=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function Cm(n){return n instanceof Uint8Array||n!=null&&typeof n=="object"&&n.constructor.name==="Uint8Array"}var so=n=>new DataView(n.buffer,n.byteOffset,n.byteLength),Qt=(n,e)=>n<<32-e|n>>>e,rE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!rE)throw new Error("Non little-endian hardware is not supported");var iE=async()=>{};async function Nm(n,e,t){let r=Date.now();for(let i=0;i<n;i++){t(i);let o=Date.now()-r;o>=0&&o<e||(await iE(),r+=o)}}function Np(n){if(typeof n!="string")throw new Error(`utf8ToBytes expected string, got ${typeof n}`);return new Uint8Array(new TextEncoder().encode(n))}function Ur(n){if(typeof n=="string"&&(n=Np(n)),!Cm(n))throw new Error(`expected Uint8Array, got ${typeof n}`);return n}function Va(...n){let e=0;for(let r=0;r<n.length;r++){let i=n[r];if(!Cm(i))throw new Error("Uint8Array expected");e+=i.length}let t=new Uint8Array(e);for(let r=0,i=0;r<n.length;r++){let o=n[r];t.set(o,i),i+=o.length}return t}var oo=class{clone(){return this._cloneInto()}},oE={}.toString;function Um(n,e){if(e!==void 0&&oE.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(n,e)}function za(n){let e=r=>n().update(Ur(r)).digest(),t=n();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>n(),e}function ao(n=32){if(Fa&&typeof Fa.getRandomValues=="function")return Fa.getRandomValues(new Uint8Array(n));throw new Error("crypto.getRandomValues must be defined")}function sE(n,e,t,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(e,t,r);let i=BigInt(32),o=BigInt(4294967295),s=Number(t>>i&o),a=Number(t&o),c=r?4:0,u=r?0:4;n.setUint32(e+c,s,r),n.setUint32(e+u,a,r)}var co=class extends oo{constructor(e,t,r,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=so(this.buffer)}update(e){io(this);let{view:t,buffer:r,blockLen:i}=this;e=Ur(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=so(e);for(;i<=o-s;s+=i)this.process(c,s);continue}r.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){io(this),Tm(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:i,isLE:o}=this,{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let p=s;p<i;p++)t[p]=0;sE(r,i-8,BigInt(this.length*8),o),this.process(r,0);let a=so(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 r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,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(r),e}};var Ma=BigInt(4294967295),Up=BigInt(32);function Lm(n,e=!1){return e?{h:Number(n&Ma),l:Number(n>>Up&Ma)}:{h:Number(n>>Up&Ma)|0,l:Number(n&Ma)|0}}function aE(n,e=!1){let t=new Uint32Array(n.length),r=new Uint32Array(n.length);for(let i=0;i<n.length;i++){let{h:o,l:s}=Lm(n[i],e);[t[i],r[i]]=[o,s]}return[t,r]}var cE=(n,e)=>BigInt(n>>>0)<<Up|BigInt(e>>>0),lE=(n,e,t)=>n>>>t,uE=(n,e,t)=>n<<32-t|e>>>t,pE=(n,e,t)=>n>>>t|e<<32-t,dE=(n,e,t)=>n<<32-t|e>>>t,fE=(n,e,t)=>n<<64-t|e>>>t-32,hE=(n,e,t)=>n>>>t-32|e<<64-t,mE=(n,e)=>e,gE=(n,e)=>n,xE=(n,e,t)=>n<<t|e>>>32-t,yE=(n,e,t)=>e<<t|n>>>32-t,wE=(n,e,t)=>e<<t-32|n>>>64-t,bE=(n,e,t)=>n<<t-32|e>>>64-t;function vE(n,e,t,r){let i=(e>>>0)+(r>>>0);return{h:n+t+(i/2**32|0)|0,l:i|0}}var EE=(n,e,t)=>(n>>>0)+(e>>>0)+(t>>>0),kE=(n,e,t,r)=>e+t+r+(n/2**32|0)|0,AE=(n,e,t,r)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0),BE=(n,e,t,r,i)=>e+t+r+i+(n/2**32|0)|0,IE=(n,e,t,r,i)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),SE=(n,e,t,r,i,o)=>e+t+r+i+o+(n/2**32|0)|0;var _E={fromBig:Lm,split:aE,toBig:cE,shrSH:lE,shrSL:uE,rotrSH:pE,rotrSL:dE,rotrBH:fE,rotrBL:hE,rotr32H:mE,rotr32L:gE,rotlSH:xE,rotlSL:yE,rotlBH:wE,rotlBL:bE,add:vE,add3L:EE,add3H:kE,add4L:AE,add4H:BE,add5H:SE,add5L:IE},J=_E;var[RE,TE]=J.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(n=>BigInt(n))),Lr=new Uint32Array(80),Dr=new Uint32Array(80),Lp=class extends co{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:r,Bl:i,Ch:o,Cl:s,Dh:a,Dl:c,Eh:u,El:l,Fh:p,Fl:h,Gh:d,Gl:f,Hh:m,Hl:g}=this;return[e,t,r,i,o,s,a,c,u,l,p,h,d,f,m,g]}set(e,t,r,i,o,s,a,c,u,l,p,h,d,f,m,g){this.Ah=e|0,this.Al=t|0,this.Bh=r|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=h|0,this.Gh=d|0,this.Gl=f|0,this.Hh=m|0,this.Hl=g|0}process(e,t){for(let b=0;b<16;b++,t+=4)Lr[b]=e.getUint32(t),Dr[b]=e.getUint32(t+=4);for(let b=16;b<80;b++){let A=Lr[b-15]|0,B=Dr[b-15]|0,k=J.rotrSH(A,B,1)^J.rotrSH(A,B,8)^J.shrSH(A,B,7),E=J.rotrSL(A,B,1)^J.rotrSL(A,B,8)^J.shrSL(A,B,7),v=Lr[b-2]|0,R=Dr[b-2]|0,N=J.rotrSH(v,R,19)^J.rotrBH(v,R,61)^J.shrSH(v,R,6),C=J.rotrSL(v,R,19)^J.rotrBL(v,R,61)^J.shrSL(v,R,6),M=J.add4L(E,C,Dr[b-7],Dr[b-16]),D=J.add4H(M,k,N,Lr[b-7],Lr[b-16]);Lr[b]=D|0,Dr[b]=M|0}let{Ah:r,Al:i,Bh:o,Bl:s,Ch:a,Cl:c,Dh:u,Dl:l,Eh:p,El:h,Fh:d,Fl:f,Gh:m,Gl:g,Hh:x,Hl:w}=this;for(let b=0;b<80;b++){let A=J.rotrSH(p,h,14)^J.rotrSH(p,h,18)^J.rotrBH(p,h,41),B=J.rotrSL(p,h,14)^J.rotrSL(p,h,18)^J.rotrBL(p,h,41),k=p&d^~p&m,E=h&f^~h&g,v=J.add5L(w,B,E,TE[b],Dr[b]),R=J.add5H(v,x,A,k,RE[b],Lr[b]),N=v|0,C=J.rotrSH(r,i,28)^J.rotrBH(r,i,34)^J.rotrBH(r,i,39),M=J.rotrSL(r,i,28)^J.rotrBL(r,i,34)^J.rotrBL(r,i,39),D=r&o^r&a^o&a,ie=i&s^i&c^s&c;x=m|0,w=g|0,m=d|0,g=f|0,d=p|0,f=h|0,{h:p,l:h}=J.add(u|0,l|0,R|0,N|0),u=a|0,l=c|0,a=o|0,c=s|0,o=r|0,s=i|0;let S=J.add3L(N,M,ie);r=J.add3H(S,R,C,D),i=S|0}({h:r,l:i}=J.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:o,l:s}=J.add(this.Bh|0,this.Bl|0,o|0,s|0),{h:a,l:c}=J.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=J.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:p,l:h}=J.add(this.Eh|0,this.El|0,p|0,h|0),{h:d,l:f}=J.add(this.Fh|0,this.Fl|0,d|0,f|0),{h:m,l:g}=J.add(this.Gh|0,this.Gl|0,m|0,g|0),{h:x,l:w}=J.add(this.Hh|0,this.Hl|0,x|0,w|0),this.set(r,i,o,s,a,c,u,l,p,h,d,f,m,g,x,w)}roundClean(){Lr.fill(0),Dr.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 lo=za(()=>new Lp);var Ha={};Be(Ha,{bitGet:()=>OE,bitLen:()=>PE,bitMask:()=>cs,bitSet:()=>FE,bytesToHex:()=>$n,bytesToNumberBE:()=>Kn,bytesToNumberLE:()=>Pr,concatBytes:()=>qn,createHmacDrbg:()=>Op,ensureBytes:()=>Se,equalBytes:()=>LE,hexToBytes:()=>xi,hexToNumber:()=>Pp,isBytes:()=>en,numberToBytesBE:()=>Or,numberToBytesLE:()=>yi,numberToHexUnpadded:()=>Fm,numberToVarBytesBE:()=>UE,utf8ToBytes:()=>DE,validateObject:()=>vn});var Om=BigInt(0),ja=BigInt(1),CE=BigInt(2);function en(n){return n instanceof Uint8Array||n!=null&&typeof n=="object"&&n.constructor.name==="Uint8Array"}var NE=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function $n(n){if(!en(n))throw new Error("Uint8Array expected");let e="";for(let t=0;t<n.length;t++)e+=NE[n[t]];return e}function Fm(n){let e=n.toString(16);return e.length&1?`0${e}`:e}function Pp(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return BigInt(n===""?"0":`0x${n}`)}var Hn={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Dm(n){if(n>=Hn._0&&n<=Hn._9)return n-Hn._0;if(n>=Hn._A&&n<=Hn._F)return n-(Hn._A-10);if(n>=Hn._a&&n<=Hn._f)return n-(Hn._a-10)}function xi(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);let e=n.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let r=new Uint8Array(t);for(let i=0,o=0;i<t;i++,o+=2){let s=Dm(n.charCodeAt(o)),a=Dm(n.charCodeAt(o+1));if(s===void 0||a===void 0){let c=n[o]+n[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}r[i]=s*16+a}return r}function Kn(n){return Pp($n(n))}function Pr(n){if(!en(n))throw new Error("Uint8Array expected");return Pp($n(Uint8Array.from(n).reverse()))}function Or(n,e){return xi(n.toString(16).padStart(e*2,"0"))}function yi(n,e){return Or(n,e).reverse()}function UE(n){return xi(Fm(n))}function Se(n,e,t){let r;if(typeof e=="string")try{r=xi(e)}catch(o){throw new Error(`${n} must be valid hex string, got "${e}". Cause: ${o}`)}else if(en(e))r=Uint8Array.from(e);else throw new Error(`${n} must be hex string or Uint8Array`);let i=r.length;if(typeof t=="number"&&i!==t)throw new Error(`${n} expected ${t} bytes, got ${i}`);return r}function qn(...n){let e=0;for(let i=0;i<n.length;i++){let o=n[i];if(!en(o))throw new Error("Uint8Array expected");e+=o.length}let t=new Uint8Array(e),r=0;for(let i=0;i<n.length;i++){let o=n[i];t.set(o,r),r+=o.length}return t}function LE(n,e){if(n.length!==e.length)return!1;let t=0;for(let r=0;r<n.length;r++)t|=n[r]^e[r];return t===0}function DE(n){if(typeof n!="string")throw new Error(`utf8ToBytes expected string, got ${typeof n}`);return new Uint8Array(new TextEncoder().encode(n))}function PE(n){let e;for(e=0;n>Om;n>>=ja,e+=1);return e}function OE(n,e){return n>>BigInt(e)&ja}var FE=(n,e,t)=>n|(t?ja:Om)<<BigInt(e),cs=n=>(CE<<BigInt(n-1))-ja,Dp=n=>new Uint8Array(n),Pm=n=>Uint8Array.from(n);function Op(n,e,t){if(typeof n!="number"||n<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 r=Dp(n),i=Dp(n),o=0,s=()=>{r.fill(1),i.fill(0),o=0},a=(...p)=>t(i,r,...p),c=(p=Dp())=>{i=a(Pm([0]),p),r=a(),p.length!==0&&(i=a(Pm([1]),p),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let p=0,h=[];for(;p<e;){r=a();let d=r.slice();h.push(d),p+=r.length}return qn(...h)};return(p,h)=>{s(),c(p);let d;for(;!(d=h(u()));)c();return s(),d}}var VE={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||en(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,e)=>e.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};function vn(n,e,t={}){let r=(i,o,s)=>{let a=VE[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);let c=n[i];if(!(s&&c===void 0)&&!a(c,n))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${o}`)};for(let[i,o]of Object.entries(e))r(i,o,!1);for(let[i,o]of Object.entries(t))r(i,o,!0);return n}var ze=BigInt(0),we=BigInt(1),wi=BigInt(2),zE=BigInt(3),Fp=BigInt(4),Vm=BigInt(5),zm=BigInt(8),ME=BigInt(9),jE=BigInt(16);function xe(n,e){let t=n%e;return t>=ze?t:e+t}function HE(n,e,t){if(t<=ze||e<ze)throw new Error("Expected power/modulo > 0");if(t===we)return ze;let r=we;for(;e>ze;)e&we&&(r=r*n%t),n=n*n%t,e>>=we;return r}function be(n,e,t){let r=n;for(;e-- >ze;)r*=r,r%=t;return r}function $a(n,e){if(n===ze||e<=ze)throw new Error(`invert: expected positive integers, got n=${n} mod=${e}`);let t=xe(n,e),r=e,i=ze,o=we,s=we,a=ze;for(;t!==ze;){let u=r/t,l=r%t,p=i-s*u,h=o-a*u;r=t,t=l,i=s,o=a,s=p,a=h}if(r!==we)throw new Error("invert: does not exist");return xe(i,e)}function $E(n){let e=(n-we)/wi,t,r,i;for(t=n-we,r=0;t%wi===ze;t/=wi,r++);for(i=wi;i<n&&HE(i,e,n)!==n-we;i++);if(r===1){let s=(n+we)/Fp;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+we)/wi;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=r,l=a.pow(a.mul(a.ONE,i),t),p=a.pow(c,o),h=a.pow(c,t);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let d=1;for(let m=a.sqr(h);d<u&&!a.eql(m,a.ONE);d++)m=a.sqr(m);let f=a.pow(l,we<<BigInt(u-d-1));l=a.sqr(f),p=a.mul(p,f),h=a.mul(h,l),u=d}return p}}function KE(n){if(n%Fp===zE){let e=(n+we)/Fp;return function(r,i){let o=r.pow(i,e);if(!r.eql(r.sqr(o),i))throw new Error("Cannot find square root");return o}}if(n%zm===Vm){let e=(n-Vm)/zm;return function(r,i){let o=r.mul(i,wi),s=r.pow(o,e),a=r.mul(i,s),c=r.mul(r.mul(a,wi),s),u=r.mul(a,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),i))throw new Error("Cannot find square root");return u}}return n%jE,$E(n)}var Mm=(n,e)=>(xe(n,e)&we)===we,qE=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Vp(n){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=qE.reduce((r,i)=>(r[i]="function",r),e);return vn(n,t)}function GE(n,e,t){if(t<ze)throw new Error("Expected power > 0");if(t===ze)return n.ONE;if(t===we)return e;let r=n.ONE,i=e;for(;t>ze;)t&we&&(r=n.mul(r,i)),i=n.sqr(i),t>>=we;return r}function WE(n,e){let t=new Array(e.length),r=e.reduce((o,s,a)=>n.is0(s)?o:(t[a]=o,n.mul(o,s)),n.ONE),i=n.inv(r);return e.reduceRight((o,s,a)=>n.is0(s)?o:(t[a]=n.mul(o,t[a]),n.mul(o,s)),i),t}function zp(n,e){let t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function Ka(n,e,t=!1,r={}){if(n<=ze)throw new Error(`Expected Field ORDER > 0, got ${n}`);let{nBitLength:i,nByteLength:o}=zp(n,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");let s=KE(n),a=Object.freeze({ORDER:n,BITS:i,BYTES:o,MASK:cs(i),ZERO:ze,ONE:we,create:c=>xe(c,n),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return ze<=c&&c<n},is0:c=>c===ze,isOdd:c=>(c&we)===we,neg:c=>xe(-c,n),eql:(c,u)=>c===u,sqr:c=>xe(c*c,n),add:(c,u)=>xe(c+u,n),sub:(c,u)=>xe(c-u,n),mul:(c,u)=>xe(c*u,n),pow:(c,u)=>GE(a,c,u),div:(c,u)=>xe(c*$a(u,n),n),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>$a(c,n),sqrt:r.sqrt||(c=>s(a,c)),invertBatch:c=>WE(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>t?yi(c,o):Or(c,o),fromBytes:c=>{if(c.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${c.length}`);return t?Pr(c):Kn(c)}});return Object.freeze(a)}function jm(n,e){if(!n.isOdd)throw new Error("Field doesn't have isOdd");let t=n.sqrt(e);return n.isOdd(t)?n.neg(t):t}function Hm(n){if(typeof n!="bigint")throw new Error("field order must be bigint");let e=n.toString(2).length;return Math.ceil(e/8)}function Mp(n){let e=Hm(n);return e+Math.ceil(e/2)}function $m(n,e,t=!1){let r=n.length,i=Hm(e),o=Mp(e);if(r<16||r<o||r>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);let s=t?Kn(n):Pr(n),a=xe(s,e-we)+we;return t?yi(a,i):Or(a,i)}var XE=BigInt(0),jp=BigInt(1);function qa(n,e){let t=(i,o)=>{let s=o.negate();return i?s:o},r=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=n.ZERO,a=i;for(;o>XE;)o&jp&&(s=s.add(a)),a=a.double(),o>>=jp;return s},precomputeWindow(i,o){let{windows:s,windowSize:a}=r(o),c=[],u=i,l=u;for(let p=0;p<s;p++){l=u,c.push(l);for(let h=1;h<a;h++)l=l.add(u),c.push(l);u=l.double()}return c},wNAF(i,o,s){let{windows:a,windowSize:c}=r(i),u=n.ZERO,l=n.BASE,p=BigInt(2**i-1),h=2**i,d=BigInt(i);for(let f=0;f<a;f++){let m=f*c,g=Number(s&p);s>>=d,g>c&&(g-=h,s+=jp);let x=m,w=m+Math.abs(g)-1,b=f%2!==0,A=g<0;g===0?l=l.add(t(b,o[x])):u=u.add(t(A,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 ls(n){return Vp(n.Fp),vn(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...zp(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}var tn=BigInt(0),St=BigInt(1),Ga=BigInt(2),ZE=BigInt(8),JE={zip215:!0};function QE(n){let e=ls(n);return vn(n,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Wa(n){let e=QE(n),{Fp:t,n:r,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:c}=e,u=Ga<<BigInt(a*8)-St,l=t.create,p=e.uvRatio||((U,_)=>{try{return{isValid:!0,value:t.sqrt(U*t.inv(_))}}catch{return{isValid:!1,value:tn}}}),h=e.adjustScalarBytes||(U=>U),d=e.domain||((U,_,H)=>{if(_.length||H)throw new Error("Contexts/pre-hash are not supported");return U}),f=U=>typeof U=="bigint"&&tn<U,m=(U,_)=>f(U)&&f(_)&&U<_,g=U=>U===tn||m(U,u);function x(U,_){if(m(U,_))return U;throw new Error(`Expected valid scalar < ${_}, got ${typeof U} ${U}`)}function w(U){return U===tn?U:x(U,r)}let b=new Map;function A(U){if(!(U instanceof B))throw new Error("ExtendedPoint expected")}class B{constructor(_,H,G,Z){if(this.ex=_,this.ey=H,this.ez=G,this.et=Z,!g(_))throw new Error("x required");if(!g(H))throw new Error("y required");if(!g(G))throw new Error("z required");if(!g(Z))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(_){if(_ instanceof B)throw new Error("extended point not allowed");let{x:H,y:G}=_||{};if(!g(H)||!g(G))throw new Error("invalid affine point");return new B(H,G,St,l(H*G))}static normalizeZ(_){let H=t.invertBatch(_.map(G=>G.ez));return _.map((G,Z)=>G.toAffine(H[Z])).map(B.fromAffine)}_setWindowSize(_){this._WINDOW_SIZE=_,b.delete(this)}assertValidity(){let{a:_,d:H}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:G,ey:Z,ez:ne,et:oe}=this,ge=l(G*G),le=l(Z*Z),pe=l(ne*ne),Ue=l(pe*pe),Ae=l(ge*_),qe=l(pe*l(Ae+le)),Ge=l(Ue+l(H*l(ge*le)));if(qe!==Ge)throw new Error("bad point: equation left != right (1)");let Ve=l(G*Z),et=l(ne*oe);if(Ve!==et)throw new Error("bad point: equation left != right (2)")}equals(_){A(_);let{ex:H,ey:G,ez:Z}=this,{ex:ne,ey:oe,ez:ge}=_,le=l(H*ge),pe=l(ne*Z),Ue=l(G*ge),Ae=l(oe*Z);return le===pe&&Ue===Ae}is0(){return this.equals(B.ZERO)}negate(){return new B(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:_}=e,{ex:H,ey:G,ez:Z}=this,ne=l(H*H),oe=l(G*G),ge=l(Ga*l(Z*Z)),le=l(_*ne),pe=H+G,Ue=l(l(pe*pe)-ne-oe),Ae=le+oe,qe=Ae-ge,Ge=le-oe,Ve=l(Ue*qe),et=l(Ae*Ge),Mn=l(Ue*Ge),ai=l(qe*Ae);return new B(Ve,et,ai,Mn)}add(_){A(_);let{a:H,d:G}=e,{ex:Z,ey:ne,ez:oe,et:ge}=this,{ex:le,ey:pe,ez:Ue,et:Ae}=_;if(H===BigInt(-1)){let fh=l((ne-Z)*(pe+le)),hh=l((ne+Z)*(pe-le)),bu=l(hh-fh);if(bu===tn)return this.double();let mh=l(oe*Ga*Ae),gh=l(ge*Ga*Ue),xh=gh+mh,yh=hh+fh,wh=gh-mh,Tb=l(xh*bu),Cb=l(yh*wh),Nb=l(xh*wh),Ub=l(bu*yh);return new B(Tb,Cb,Ub,Nb)}let qe=l(Z*le),Ge=l(ne*pe),Ve=l(ge*G*Ae),et=l(oe*Ue),Mn=l((Z+ne)*(le+pe)-qe-Ge),ai=et-Ve,Xo=et+Ve,dh=l(Ge-H*qe),Ib=l(Mn*ai),Sb=l(Xo*dh),_b=l(Mn*dh),Rb=l(ai*Xo);return new B(Ib,Sb,Rb,_b)}subtract(_){return this.add(_.negate())}wNAF(_){return v.wNAFCached(this,b,_,B.normalizeZ)}multiply(_){let{p:H,f:G}=this.wNAF(x(_,r));return B.normalizeZ([H,G])[0]}multiplyUnsafe(_){let H=w(_);return H===tn?E:this.equals(E)||H===St?this:this.equals(k)?this.wNAF(H).p:v.unsafeLadder(this,H)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return v.unsafeLadder(this,r).is0()}toAffine(_){let{ex:H,ey:G,ez:Z}=this,ne=this.is0();_==null&&(_=ne?ZE:t.inv(Z));let oe=l(H*_),ge=l(G*_),le=l(Z*_);if(ne)return{x:tn,y:St};if(le!==St)throw new Error("invZ was invalid");return{x:oe,y:ge}}clearCofactor(){let{h:_}=e;return _===St?this:this.multiplyUnsafe(_)}static fromHex(_,H=!1){let{d:G,a:Z}=e,ne=t.BYTES;_=Se("pointHex",_,ne);let oe=_.slice(),ge=_[ne-1];oe[ne-1]=ge&-129;let le=Pr(oe);le===tn||(H?x(le,u):x(le,t.ORDER));let pe=l(le*le),Ue=l(pe-St),Ae=l(G*pe-Z),{isValid:qe,value:Ge}=p(Ue,Ae);if(!qe)throw new Error("Point.fromHex: invalid y coordinate");let Ve=(Ge&St)===St,et=(ge&128)!==0;if(!H&&Ge===tn&&et)throw new Error("Point.fromHex: x=0 and x_0=1");return et!==Ve&&(Ge=l(-Ge)),B.fromAffine({x:Ge,y:le})}static fromPrivateKey(_){return C(_).point}toRawBytes(){let{x:_,y:H}=this.toAffine(),G=yi(H,t.BYTES);return G[G.length-1]|=_&St?128:0,G}toHex(){return $n(this.toRawBytes())}}B.BASE=new B(e.Gx,e.Gy,St,l(e.Gx*e.Gy)),B.ZERO=new B(tn,St,St,tn);let{BASE:k,ZERO:E}=B,v=qa(B,a*8);function R(U){return xe(U,r)}function N(U){return R(Pr(U))}function C(U){let _=a;U=Se("private key",U,_);let H=Se("hashed private key",o(U),2*_),G=h(H.slice(0,_)),Z=H.slice(_,2*_),ne=N(G),oe=k.multiply(ne),ge=oe.toRawBytes();return{head:G,prefix:Z,scalar:ne,point:oe,pointBytes:ge}}function M(U){return C(U).pointBytes}function D(U=new Uint8Array,..._){let H=qn(..._);return N(o(d(H,Se("context",U),!!i)))}function ie(U,_,H={}){U=Se("message",U),i&&(U=i(U));let{prefix:G,scalar:Z,pointBytes:ne}=C(_),oe=D(H.context,G,U),ge=k.multiply(oe).toRawBytes(),le=D(H.context,ge,ne,U),pe=R(oe+le*Z);w(pe);let Ue=qn(ge,yi(pe,t.BYTES));return Se("result",Ue,a*2)}let S=JE;function L(U,_,H,G=S){let{context:Z,zip215:ne}=G,oe=t.BYTES;U=Se("signature",U,2*oe),_=Se("message",_),i&&(_=i(_));let ge=Pr(U.slice(oe,2*oe)),le,pe,Ue;try{le=B.fromHex(H,ne),pe=B.fromHex(U.slice(0,oe),ne),Ue=k.multiplyUnsafe(ge)}catch{return!1}if(!ne&&le.isSmallOrder())return!1;let Ae=D(Z,pe.toRawBytes(),le.toRawBytes(),_);return pe.add(le.multiplyUnsafe(Ae)).subtract(Ue).clearCofactor().equals(B.ZERO)}return k._setWindowSize(8),{CURVE:e,getPublicKey:M,sign:ie,verify:L,ExtendedPoint:B,utils:{getExtendedPublicKey:C,randomPrivateKey:()=>s(t.BYTES),precompute(U=8,_=B.BASE){return _._setWindowSize(U),_.multiply(BigInt(3)),_}}}}var $p=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Km=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),U_=BigInt(0),e3=BigInt(1),Hp=BigInt(2),t3=BigInt(5),qm=BigInt(10),n3=BigInt(20),r3=BigInt(40),Gm=BigInt(80);function i3(n){let e=$p,r=n*n%e*n%e,i=be(r,Hp,e)*r%e,o=be(i,e3,e)*n%e,s=be(o,t3,e)*o%e,a=be(s,qm,e)*s%e,c=be(a,n3,e)*a%e,u=be(c,r3,e)*c%e,l=be(u,Gm,e)*u%e,p=be(l,Gm,e)*u%e,h=be(p,qm,e)*s%e;return{pow_p_5_8:be(h,Hp,e)*n%e,b2:r}}function o3(n){return n[0]&=248,n[31]&=127,n[31]|=64,n}function s3(n,e){let t=$p,r=xe(e*e*e,t),i=xe(r*r*e,t),o=i3(n*i).pow_p_5_8,s=xe(n*r*o,t),a=xe(e*s*s,t),c=s,u=xe(s*Km,t),l=a===n,p=a===xe(-n,t),h=a===xe(-n*Km,t);return l&&(s=c),(p||h)&&(s=u),Mm(s,t)&&(s=xe(-s,t)),{isValid:l||p,value:s}}var Gn=Ka($p,void 0,!0),Kp={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Gn,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:lo,randomBytes:ao,adjustScalarBytes:o3,uvRatio:s3},uo=Wa(Kp);function Wm(n,e,t){if(e.length>255)throw new Error("Context is too big");return Va(Np("SigEd25519 no Ed25519 collisions"),new Uint8Array([t?1:0,e.length]),e,n)}var L_=Wa({...Kp,domain:Wm}),D_=Wa({...Kp,domain:Wm,prehash:lo});var a3=(Gn.ORDER+BigInt(3))/BigInt(8),P_=Gn.pow(Hp,a3),O_=Gn.sqrt(Gn.neg(Gn.ONE)),F_=(Gn.ORDER-BigInt(5))/BigInt(8),V_=BigInt(486662);var z_=jm(Gn,Gn.neg(BigInt(486664)));var M_=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),j_=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),H_=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),$_=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var K_=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var po=32,Wn=64,Ya=32;function Ym(){let n=uo.utils.randomPrivateKey(),e=uo.getPublicKey(n);return{privateKey:Qm(n,e),publicKey:e}}function Xm(n){if(n.length!==Ya)throw new TypeError('"seed" must be 32 bytes in length.');if(!(n instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=n,t=uo.getPublicKey(e);return{privateKey:Qm(e,t),publicKey:t}}function Zm(n,e){let t=n.subarray(0,Ya);return uo.sign(e instanceof Uint8Array?e:e.subarray(),t)}function Jm(n,e,t){return uo.verify(e,t instanceof Uint8Array?t:t.subarray(),n)}function Qm(n,e){let t=new Uint8Array(Wn);for(let r=0;r<Ya;r++)t[r]=n[r],t[Ya+r]=e[r];return t}var at={get(n=globalThis){let e=n.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 qp={alg:"A128GCM",ext:!0,k:"scm9jmO_4BJAgdwWGVulLg",key_ops:["encrypt","decrypt"],kty:"oct"};function e0(n){let e=n?.algorithm??"AES-GCM",t=n?.keyLength??16,r=n?.nonceLength??12,i=n?.digest??"SHA-256",o=n?.saltLength??16,s=n?.iterations??32767,a=at.get();t*=8;async function c(p,h){let d=a.getRandomValues(new Uint8Array(o)),f=a.getRandomValues(new Uint8Array(r)),m={name:e,iv:f};typeof h=="string"&&(h=Y(h));let g;if(h.length===0){g=await a.subtle.importKey("jwk",qp,{name:"AES-GCM"},!0,["encrypt"]);try{let w={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},b=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(w,b,{name:e,length:t},!0,["encrypt"])}catch{g=await a.subtle.importKey("jwk",qp,{name:"AES-GCM"},!0,["encrypt"])}}else{let w={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},b=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(w,b,{name:e,length:t},!0,["encrypt"])}let x=await a.subtle.encrypt(m,g,p);return Ee([d,m.iv,new Uint8Array(x)])}async function u(p,h){let d=p.subarray(0,o),f=p.subarray(o,o+r),m=p.subarray(o+r),g={name:e,iv:f};typeof h=="string"&&(h=Y(h));let x;if(h.length===0)try{let b={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},A=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);x=await a.subtle.deriveKey(b,A,{name:e,length:t},!0,["decrypt"])}catch{x=await a.subtle.importKey("jwk",qp,{name:"AES-GCM"},!0,["decrypt"])}else{let b={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},A=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);x=await a.subtle.deriveKey(b,A,{name:e,length:t},!0,["decrypt"])}let w=await a.subtle.decrypt(g,x,m);return new Uint8Array(w)}return{encrypt:c,decrypt:u}}async function fo(n,e){let r=await e0().encrypt(n,e);return wn.encode(r)}var ve;(function(n){n.RSA="RSA",n.Ed25519="Ed25519",n.Secp256k1="Secp256k1"})(ve||(ve={}));var Gp;(function(n){n[n.RSA=0]="RSA",n[n.Ed25519=1]="Ed25519",n[n.Secp256k1=2]="Secp256k1"})(Gp||(Gp={}));(function(n){n.codec=()=>hi(Gp)})(ve||(ve={}));var En;(function(n){let e;n.codec=()=>(e==null&&(e=jt((t,r,i={})=>{i.lengthDelimited!==!1&&r.fork(),t.Type!=null&&(r.uint32(8),ve.codec().encode(t.Type,r)),t.Data!=null&&(r.uint32(18),r.bytes(t.Data)),i.lengthDelimited!==!1&&r.ldelim()},(t,r)=>{let i={},o=r==null?t.len:t.pos+r;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.Type=ve.codec().decode(t);break;case 2:i.Data=t.bytes();break;default:t.skipType(s&7);break}}return i})),e),n.encode=t=>Mt(t,n.codec()),n.decode=t=>Vt(t,n.codec())})(En||(En={}));var kn;(function(n){let e;n.codec=()=>(e==null&&(e=jt((t,r,i={})=>{i.lengthDelimited!==!1&&r.fork(),t.Type!=null&&(r.uint32(8),ve.codec().encode(t.Type,r)),t.Data!=null&&(r.uint32(18),r.bytes(t.Data)),i.lengthDelimited!==!1&&r.ldelim()},(t,r)=>{let i={},o=r==null?t.len:t.pos+r;for(;t.pos<o;){let s=t.uint32();switch(s>>>3){case 1:i.Type=ve.codec().decode(t);break;case 2:i.Data=t.bytes();break;default:t.skipType(s&7);break}}return i})),e),n.encode=t=>Mt(t,n.codec()),n.decode=t=>Vt(t,n.codec())})(kn||(kn={}));var us=class{_key;constructor(e){this._key=ho(e,po)}verify(e,t){return Jm(this._key,t,e)}marshal(){return this._key}get bytes(){return En.encode({Type:ve.Ed25519,Data:this.marshal()}).subarray()}equals(e){return fe(this.bytes,e.bytes)}hash(){let e=re.digest(this.bytes);return Ht(e)?e.then(({bytes:t})=>t):e.bytes}},bi=class{_key;_publicKey;constructor(e,t){this._key=ho(e,Wn),this._publicKey=ho(t,po)}sign(e){return Zm(this._key,e)}get public(){return new us(this._publicKey)}marshal(){return this._key}get bytes(){return kn.encode({Type:ve.Ed25519,Data:this.marshal()}).subarray()}equals(e){return fe(this.bytes,e.bytes)}async hash(){let e=re.digest(this.bytes),t;return Ht(e)?{bytes:t}=await e:t=e.bytes,t}async id(){let e=mt.digest(this.public.bytes);return Re.encode(e.bytes).substring(1)}async export(e,t="libp2p-key"){if(t==="libp2p-key")return fo(this.bytes,e);throw new F(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function u3(n){if(n.length>Wn){n=ho(n,Wn+po);let r=n.subarray(0,Wn),i=n.subarray(Wn,n.length);return new bi(r,i)}n=ho(n,Wn);let e=n.subarray(0,Wn),t=n.subarray(po);return new bi(e,t)}function p3(n){return n=ho(n,po),new us(n)}async function d3(){let{privateKey:n,publicKey:e}=Ym();return new bi(n,e)}async function t0(n){let{privateKey:e,publicKey:t}=Xm(n);return new bi(e,t)}function ho(n,e){if(n=Uint8Array.from(n??[]),n.length!==e)throw new F(`Key must be a Uint8Array of length ${e}, got ${n.length}`,"ERR_INVALID_KEY_TYPE");return n}var id={};Be(id,{MAX_RSA_KEY_SIZE:()=>Es,RsaPrivateKey:()=>wo,RsaPublicKey:()=>vs,fromJwk:()=>V3,generateKeyPair:()=>z3,unmarshalRsaPrivateKey:()=>nd,unmarshalRsaPublicKey:()=>F3});function vi(n){if(isNaN(n)||n<=0)throw new F("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return ao(n)}var Mr={};Be(Mr,{exportToPem:()=>U3,importFromPem:()=>L3,jwkToPkcs1:()=>R3,jwkToPkix:()=>C3,pkcs1ToJwk:()=>_3,pkixToJwk:()=>T3});var Za=class extends oo{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Oa(e);let r=Ur(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(r.length>i?e.create().update(r).digest():r);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 io(this),this.iHash.update(e),this}digestInto(e){io(this),Cp(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:r,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=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},ps=(n,e,t)=>new Za(n,e).update(t).digest();ps.create=(n,e)=>new Za(n,e);function f3(n,e,t,r){Oa(n);let i=Um({dkLen:32,asyncTick:10},r),{c:o,dkLen:s,asyncTick:a}=i;if(ro(o),ro(s),ro(a),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let c=Ur(e),u=Ur(t),l=new Uint8Array(s),p=ps.create(n,c),h=p._cloneInto().update(u);return{c:o,dkLen:s,asyncTick:a,DK:l,PRF:p,PRFSalt:h}}function h3(n,e,t,r,i){return n.destroy(),e.destroy(),r&&r.destroy(),i.fill(0),t}async function Yp(n,e,t,r){let{c:i,dkLen:o,asyncTick:s,DK:a,PRF:c,PRFSalt:u}=f3(n,e,t,r),l,p=new Uint8Array(4),h=so(p),d=new Uint8Array(c.outputLen);for(let f=1,m=0;m<o;f++,m+=c.outputLen){let g=a.subarray(m,m+c.outputLen);h.setInt32(0,f,!1),(l=u._cloneInto(l)).update(p).digestInto(d),g.set(d.subarray(0,g.length)),await Nm(i-1,s,()=>{c._cloneInto(l).update(d).digestInto(d);for(let x=0;x<g.length;x++)g[x]^=d[x]})}return h3(c,u,a,l,d)}var ce=ee(n0());function Ei(n,e){let t=0;if(n.length===1)return n[0];for(let r=n.length-1;r>=0;r--)t+=n[n.length-1-r]*Math.pow(2,e*r);return t}function Fr(n,e,t=-1){let r=t,i=n,o=0,s=Math.pow(2,e);for(let a=1;a<8;a++){if(n<s){let c;if(r<0)c=new ArrayBuffer(a),o=a;else{if(r<a)return new ArrayBuffer(0);c=new ArrayBuffer(r),o=r}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 ec(...n){let e=0,t=0;for(let o of n)e+=o.length;let r=new ArrayBuffer(e),i=new Uint8Array(r);for(let o of n)i.set(o,t),t+=o.length;return i}function Zp(){let n=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=n[0]===255&&n[1]&128,c=n[0]===0&&(n[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]=n[0]&128;let r=Ei(t,8),i=new ArrayBuffer(this.valueHex.byteLength),o=new Uint8Array(i);for(let a=0;a<this.valueHex.byteLength;a++)o[a]=n[a];return o[0]&=127,Ei(o,8)-r}function r0(n){let e=n<0?n*-1:n,t=128;for(let r=1;r<8;r++){if(e<=t){if(n<0){let s=t-e,a=Fr(s,8,r),c=new Uint8Array(a);return c[0]|=128,a}let i=Fr(e,8,r),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 i0(n,e){if(n.byteLength!==e.byteLength)return!1;let t=new Uint8Array(n),r=new Uint8Array(e);for(let i=0;i<t.length;i++)if(t[i]!==r[i])return!1;return!0}function gt(n,e){let t=n.toString(10);if(e<t.length)return"";let r=e-t.length,i=new Array(r);for(let s=0;s<r;s++)i[s]="0";return i.join("").concat(t)}var wR=Math.log(2);function tc(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Jp(n){let e=0,t=0;for(let i=0;i<n.length;i++){let o=n[i];e+=o.byteLength}let r=new Uint8Array(e);for(let i=0;i<n.length;i++){let o=n[i];r.set(new Uint8Array(o),t),t+=o.byteLength}return r.buffer}function Qn(n,e,t,r){return e instanceof Uint8Array?e.byteLength?t<0?(n.error="Wrong parameter: inputOffset less than zero",!1):r<0?(n.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-r<0?(n.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(n.error="Wrong parameter: inputBuffer has zero length",!1):(n.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}var fs=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Jp(this.items)}},ds=[new Uint8Array([1])],o0="0123456789";var xo="",rn=new ArrayBuffer(0),Qp=new Uint8Array(0),hs="EndOfContent",a0="OCTET STRING",c0="BIT STRING";function er(n){var e;return e=class extends n{constructor(...r){var i;super(...r);let o=r[0]||{};this.isHexOnly=(i=o.isHexOnly)!==null&&i!==void 0?i:!1,this.valueHexView=o.valueHex?ce.BufferSourceConverter.toUint8Array(o.valueHex):Qp}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(r){this.valueHexView=new Uint8Array(r)}fromBER(r,i,o){let s=r instanceof ArrayBuffer?new Uint8Array(r):r;if(!Qn(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(r=!1){return this.isHexOnly?r?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",rn)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:ce.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var Xn=class{constructor({blockLength:e=0,error:t=xo,warnings:r=[],valueBeforeDecode:i=Qp}={}){this.blockLength=e,this.error=t,this.warnings=r,this.valueBeforeDecodeView=ce.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:ce.Convert.ToHex(this.valueBeforeDecodeView)}}};Xn.NAME="baseBlock";var rt=class extends Xn{fromBER(e,t,r){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'")}};rt.NAME="valueBlock";var nc=class extends er(Xn){constructor({idBlock:e={}}={}){var t,r,i,o;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?ce.BufferSourceConverter.toUint8Array(e.valueHex):Qp,this.tagClass=(r=e.tagClass)!==null&&r!==void 0?r:-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",rn}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=Fr(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 r=new Uint8Array(this.valueHexView.byteLength+1);if(r[0]=t|31,!e){let i=this.valueHexView;for(let o=0;o<i.length-1;o++)r[o+1]=i[o]|128;r[this.valueHexView.byteLength]=i[i.length-1]}return r.buffer}fromBER(e,t,r){let i=ce.BufferSourceConverter.toUint8Array(e);if(!Qn(this,i,t,r))return-1;let o=i.subarray(t,t+r);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 h=new Uint8Array(l);for(let d=0;d<u.length;d++)h[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 h=0;h<c;h++)p[h]=u[h];u=this.valueHexView=new Uint8Array(c),u.set(p),this.blockLength<=9?this.tagNumber=Ei(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}}};nc.NAME="identificationBlock";var rc=class extends Xn{constructor({lenBlock:e={}}={}){var t,r,i;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(r=e.longFormUsed)!==null&&r!==void 0?r:!1,this.length=(i=e.length)!==null&&i!==void 0?i:0}fromBER(e,t,r){let i=ce.BufferSourceConverter.toUint8Array(e);if(!Qn(this,i,t,r))return-1;let o=i.subarray(t,t+r);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=Ei(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,r;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(r=new Uint8Array(t),r[0]=128),t;if(this.longFormUsed){let i=Fr(this.length,8);if(i.byteLength>127)return this.error="Too big length",rn;if(t=new ArrayBuffer(i.byteLength+1),e)return t;let o=new Uint8Array(i);r=new Uint8Array(t),r[0]=i.byteLength|128;for(let s=0;s<i.byteLength;s++)r[s+1]=o[s];return t}return t=new ArrayBuffer(1),e===!1&&(r=new Uint8Array(t),r[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};rc.NAME="lengthBlock";var j={},Ye=class extends Xn{constructor({name:e=xo,optional:t=!1,primitiveSchema:r,...i}={},o){super(i),this.name=e,this.optional=t,r&&(this.primitiveSchema=r),this.idBlock=new nc(i),this.lenBlock=new rc(i),this.valueBlock=o?new o(i):new rt(i)}fromBER(e,t,r){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r: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 r=t||new fs;t||l0(this);let i=this.idBlock.toBER(e);if(r.write(i),this.lenBlock.isIndefiniteForm)r.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,r),r.write(new ArrayBuffer(2));else{let o=this.valueBlock.toBER(e);this.lenBlock.length=o.byteLength;let s=this.lenBlock.toBER(e);r.write(s),r.write(o)}return t?rn:r.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():ce.Convert.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${ce.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),r=e.toBER();return i0(t,r)}};Ye.NAME="BaseBlock";function l0(n){if(n instanceof j.Constructed)for(let e of n.valueBlock.value)l0(e)&&(n.lenBlock.isIndefiniteForm=!0);return!!n.lenBlock.isIndefiniteForm}var ic=class extends Ye{constructor({value:e=xo,...t}={},r){super(t,r),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,r){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r: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}'`}};ic.NAME="BaseStringBlock";var oc=class extends er(rt){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};oc.NAME="PrimitiveValueBlock";var u0,sc=class extends Ye{constructor(e={}){super(e,oc),this.idBlock.isConstructed=!1}};u0=sc;j.Primitive=u0;sc.NAME="PRIMITIVE";function k3(n,e){if(n instanceof e)return n;let t=new e;return t.idBlock=n.idBlock,t.lenBlock=n.lenBlock,t.warnings=n.warnings,t.valueBeforeDecodeView=n.valueBeforeDecodeView,t}function Vc(n,e=0,t=n.length){let r=e,i=new Ye({},rt),o=new Xn;if(!Qn(o,n,e,t))return i.error=o.error,{offset:-1,result:i};if(!n.subarray(e,e+t).length)return i.error="Zero buffer length",{offset:-1,result:i};let a=i.idBlock.fromBER(n,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(n,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=Ye;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=k3(i,c),a=i.fromBER(n,e,i.lenBlock.isIndefiniteForm?t:i.lenBlock.length),i.valueBeforeDecodeView=n.subarray(r,r+i.blockLength),{offset:a,result:i}}function yo(n){if(!n.byteLength){let e=new Ye({},rt);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Vc(ce.BufferSourceConverter.toUint8Array(n).slice(),0,n.byteLength)}function A3(n,e){return n?1:e}var An=class extends rt{constructor({value:e=[],isIndefiniteForm:t=!1,...r}={}){super(r),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,r){let i=ce.BufferSourceConverter.toUint8Array(e);if(!Qn(this,i,t,r))return-1;if(this.valueBeforeDecodeView=i.subarray(t,t+r),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let o=t;for(;A3(this.isIndefiniteForm,r)>0;){let s=Vc(i,o,r);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,r-=s.result.blockLength,this.value.push(s.result),this.isIndefiniteForm&&s.result.constructor.NAME===hs)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===hs?this.value.pop():this.warnings.push("No EndOfContent block encoded")),o}toBER(e,t){let r=t||new fs;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,r);return t?rn:r.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};An.NAME="ConstructedValueBlock";var p0,Vr=class extends Ye{constructor(e={}){super(e,An),this.idBlock.isConstructed=!0}fromBER(e,t,r){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r: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 r of this.valueBlock.value)e.push(r.toString("ascii").split(`
|
|
13
|
+
`).map(i=>` ${i}`).join(`
|
|
14
|
+
`));let t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
|
|
15
|
+
${e.join(`
|
|
16
|
+
`)}`:`${t} :`}};p0=Vr;j.Constructed=p0;Vr.NAME="CONSTRUCTED";var ac=class extends rt{fromBER(e,t,r){return t}toBER(e){return rn}};ac.override="EndOfContentValueBlock";var d0,cc=class extends Ye{constructor(e={}){super(e,ac),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};d0=cc;j.EndOfContent=d0;cc.NAME=hs;var f0,zr=class extends Ye{constructor(e={}){super(e,rt),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,r){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+=r,t+r>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+r}toBER(e,t){let r=new ArrayBuffer(2);if(!e){let i=new Uint8Array(r);i[0]=5,i[1]=0}return t&&t.write(r),r}onAsciiEncoding(){return`${this.constructor.NAME}`}};f0=zr;j.Null=f0;zr.NAME="NULL";var lc=class extends er(rt){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=ce.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,r){let i=ce.BufferSourceConverter.toUint8Array(e);return Qn(this,i,t,r)?(this.valueHexView=i.subarray(t,t+r),r>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,Zp.call(this),this.blockLength=r,t+r):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};lc.NAME="BooleanValueBlock";var h0,uc=class extends Ye{constructor(e={}){super(e,lc),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}`}};h0=uc;j.Boolean=h0;uc.NAME="BOOLEAN";var pc=class extends er(An){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,r){let i=0;if(this.isConstructed){if(this.isHexOnly=!1,i=An.prototype.fromBER.call(this,e,t,r),i===-1)return i;for(let o=0;o<this.value.length;o++){let s=this.value[o].constructor.NAME;if(s===hs){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(s!==a0)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,i=super.fromBER(e,t,r),this.blockLength=r;return i}toBER(e,t){return this.isConstructed?An.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};pc.NAME="OctetStringValueBlock";var m0,Zn=class n extends Ye{constructor({idBlock:e={},lenBlock:t={},...r}={}){var i,o;(i=r.isConstructed)!==null&&i!==void 0||(r.isConstructed=!!(!((o=r.value)===null||o===void 0)&&o.length)),super({idBlock:{isConstructed:r.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!r.isIndefiniteForm},...r},pc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,r){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,r===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+r);try{if(o.byteLength){let s=Vc(o,0,o.byteLength);s.offset!==-1&&s.offset===r&&(this.valueBlock.value=[s.result])}}catch{}}return super.fromBER(e,t,r)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Vr.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${ce.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 n&&e.push(t.valueBlock.valueHexView);return ce.BufferSourceConverter.concat(e)}};m0=Zn;j.OctetString=m0;Zn.NAME=a0;var dc=class extends er(An){constructor({unusedBits:e=0,isConstructed:t=!1,...r}={}){super(r),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,r){if(!r)return t;let i=-1;if(this.isConstructed){if(i=An.prototype.fromBER.call(this,e,t,r),i===-1)return i;for(let a of this.value){let c=a.constructor.NAME;if(c===hs){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==c0)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=ce.BufferSourceConverter.toUint8Array(e);if(!Qn(this,o,t,r))return-1;let s=o.subarray(t,t+r);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=Vc(a,0,a.byteLength);c.offset!==-1&&c.offset===r-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=s.subarray(1),this.blockLength=s.length,t+r}toBER(e,t){if(this.isConstructed)return An.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return rn;let r=new Uint8Array(this.valueHexView.length+1);return r[0]=this.unusedBits,r.set(this.valueHexView,1),r.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};dc.NAME="BitStringValueBlock";var g0,go=class extends Ye{constructor({idBlock:e={},lenBlock:t={},...r}={}){var i,o;(i=r.isConstructed)!==null&&i!==void 0||(r.isConstructed=!!(!((o=r.value)===null||o===void 0)&&o.length)),super({idBlock:{isConstructed:r.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!r.isIndefiniteForm},...r},dc),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,r){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,r)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Vr.prototype.onAsciiEncoding.call(this);{let e=[],t=this.valueBlock.valueHexView;for(let i of t)e.push(i.toString(2).padStart(8,"0"));let r=e.join("");return`${this.constructor.NAME} : ${r.substring(0,r.length-this.valueBlock.unusedBits)}`}}};g0=go;j.BitString=g0;go.NAME=c0;var x0;function B3(n,e){let t=new Uint8Array([0]),r=new Uint8Array(n),i=new Uint8Array(e),o=r.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 h=l;h>=0;h--,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=ec(new Uint8Array([u%10]),o);break;default:o[s-p]=u%10}}return t[0]>0&&(o=ec(t,o)),o}function s0(n){if(n>=ds.length)for(let e=ds.length;e<=n;e++){let t=new Uint8Array([0]),r=ds[e-1].slice(0);for(let i=r.length-1;i>=0;i--){let o=new Uint8Array([(r[i]<<1)+t[0]]);t[0]=o[0]/10,r[i]=o[0]%10}t[0]>0&&(r=ec(t,r)),ds.push(r)}return ds[n]}function I3(n,e){let t=0,r=new Uint8Array(n),i=new Uint8Array(e),o=r.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 ms=class extends er(rt){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=Zp.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(r0(e))}get valueDec(){return this._valueDec}fromDER(e,t,r,i=0){let o=this.fromBER(e,t,r);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 r=new Uint8Array(this.valueHexView.length+1);r[0]=0,r.set(t,1),this.valueHexView=r}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,r){let i=super.fromBER(e,t,r);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),r=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(r){case e:t=I3(s0(r),t),s="-";break;default:t=B3(t,s0(r))}r++,i>>=1}}for(let c=0;c<t.length;c++)t[c]&&(a=!0),a&&(s+=o0.charAt(t[c]));return a===!1&&(s+=o0.charAt(0)),s}};x0=ms;ms.NAME="IntegerValueBlock";Object.defineProperty(x0.prototype,"valueHex",{set:function(n){this.valueHexView=new Uint8Array(n),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var y0,Pe=class n extends Ye{constructor(e={}){super(e,ms),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return tc(),BigInt(this.valueBlock.toString())}static fromBigInt(e){tc();let t=BigInt(e),r=new fs,i=t.toString(16).replace(/^-/,""),o=new Uint8Array(ce.Convert.FromHex(i));if(t<0){let a=new Uint8Array(o.length+(o[0]&128?1:0));a[0]|=128;let u=BigInt(`0x${ce.Convert.ToHex(a)}`)+t,l=ce.BufferSourceConverter.toUint8Array(ce.Convert.FromHex(u.toString(16)));l[0]|=128,r.write(l)}else o[0]&128&&r.write(new Uint8Array([0])),r.write(o);return new n({valueHex:r.final()})}convertToDER(){let e=new n({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new n({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};y0=Pe;j.Integer=y0;Pe.NAME="INTEGER";var w0,fc=class extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};w0=fc;j.Enumerated=w0;fc.NAME="ENUMERATED";var gs=class extends er(rt){constructor({valueDec:e=-1,isFirstSid:t=!1,...r}={}){super(r),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,r){if(!r)return t;let i=ce.BufferSourceConverter.toUint8Array(e);if(!Qn(this,i,t,r))return-1;let o=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(let a=0;a<r&&(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=Ei(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){tc();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;let r=new Uint8Array(t.length/7);for(let i=0;i<r.length;i++)r[i]=parseInt(t.slice(i*7,i*7+7),2)+(i+1<r.length?128:0);this.fromBER(r.buffer,0,r.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=Fr(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",rn;let r=new Uint8Array(t.byteLength);if(!e){let i=new Uint8Array(t),o=t.byteLength-1;for(let s=0;s<o;s++)r[s]=i[s]|128;r[o]=i[o]}return r}toString(){let e="";if(this.isHexOnly)e=ce.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}}};gs.NAME="sidBlock";var hc=class extends rt{constructor({value:e=xo,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,r){let i=t;for(;r>0;){let o=new gs;if(i=o.fromBER(e,i,r),i===-1)return this.blockLength=0,this.error=o.error,i;this.value.length===0&&(o.isFirstSid=!0),this.blockLength+=o.blockLength,r-=o.blockLength,this.value.push(o)}return i}toBER(e){let t=[];for(let r=0;r<this.value.length;r++){let i=this.value[r].toBER(e);if(i.byteLength===0)return this.error=this.value[r].error,rn;t.push(i)}return Jp(t)}fromString(e){this.value=[];let t=0,r=0,i="",o=!1;do if(r=e.indexOf(".",t),r===-1?i=e.substring(t):i=e.substring(t,r),t=r+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 gs;if(i>Number.MAX_SAFE_INTEGER){tc();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(r!==-1)}toString(){let e="",t=!1;for(let r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;let i=this.value[r].toString();r!==0&&(e=`${e}.`),t?(i=`{${i}}`,this.value[r].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}};hc.NAME="ObjectIdentifierValueBlock";var b0,nn=class extends Ye{constructor(e={}){super(e,hc),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()}}};b0=nn;j.ObjectIdentifier=b0;nn.NAME="OBJECT IDENTIFIER";var xs=class extends er(Xn){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,r){if(r===0)return t;let i=ce.BufferSourceConverter.toUint8Array(e);if(!Qn(this,i,t,r))return-1;let o=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(let a=0;a<r&&(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=Ei(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=Fr(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",rn;let r=new Uint8Array(t.byteLength);if(!e){let i=new Uint8Array(t),o=t.byteLength-1;for(let s=0;s<o;s++)r[s]=i[s]|128;r[o]=i[o]}return r.buffer}toString(){let e="";return this.isHexOnly?e=ce.Convert.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};xs.NAME="relativeSidBlock";var mc=class extends rt{constructor({value:e=xo,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,r){let i=t;for(;r>0;){let o=new xs;if(i=o.fromBER(e,i,r),i===-1)return this.blockLength=0,this.error=o.error,i;this.blockLength+=o.blockLength,r-=o.blockLength,this.value.push(o)}return i}toBER(e,t){let r=[];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,rn;r.push(o)}return Jp(r)}fromString(e){this.value=[];let t=0,r=0,i="";do{r=e.indexOf(".",t),r===-1?i=e.substring(t):i=e.substring(t,r),t=r+1;let o=new xs;if(o.valueDec=parseInt(i,10),isNaN(o.valueDec))return!0;this.value.push(o)}while(r!==-1);return!0}toString(){let e="",t=!1;for(let r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;let i=this.value[r].toString();r!==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}};mc.NAME="RelativeObjectIdentifierValueBlock";var v0,gc=class extends Ye{constructor(e={}){super(e,mc),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()}}};v0=gc;j.RelativeObjectIdentifier=v0;gc.NAME="RelativeObjectIdentifier";var E0,je=class extends Vr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};E0=je;j.Sequence=E0;je.NAME="SEQUENCE";var k0,xc=class extends Vr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};k0=xc;j.Set=k0;xc.NAME="SET";var yc=class extends er(rt){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=xo}toJSON(){return{...super.toJSON(),value:this.value}}};yc.NAME="StringValueBlock";var wc=class extends yc{};wc.NAME="SimpleStringValueBlock";var ct=class extends ic{constructor({...e}={}){super(e,wc)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,ce.BufferSourceConverter.toUint8Array(e))}fromString(e){let t=e.length,r=this.valueBlock.valueHexView=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e.charCodeAt(i);this.valueBlock.value=e}};ct.NAME="SIMPLE STRING";var bc=class extends ct{fromBuffer(e){this.valueBlock.valueHexView=ce.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=ce.Convert.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=ce.Convert.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(ce.Convert.FromUtf8String(e)),this.valueBlock.value=e}};bc.NAME="Utf8StringValueBlock";var A0,Jn=class extends bc{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};A0=Jn;j.Utf8String=A0;Jn.NAME="UTF8String";var vc=class extends ct{fromBuffer(e){this.valueBlock.value=ce.Convert.ToUtf16String(e),this.valueBlock.valueHexView=ce.BufferSourceConverter.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(ce.Convert.FromUtf16String(e))}};vc.NAME="BmpStringValueBlock";var B0,Ec=class extends vc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};B0=Ec;j.BmpString=B0;Ec.NAME="BMPString";var kc=class extends ct{fromBuffer(e){let t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),r=new Uint8Array(t);for(let i=0;i<r.length;i+=4)r[i]=r[i+3],r[i+1]=r[i+2],r[i+2]=0,r[i+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){let t=e.length,r=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let i=0;i<t;i++){let o=Fr(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--)r[i*4+c+a]=s[c]}this.valueBlock.value=e}};kc.NAME="UniversalStringValueBlock";var I0,Ac=class extends kc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};I0=Ac;j.UniversalString=I0;Ac.NAME="UniversalString";var S0,Bc=class extends ct{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};S0=Bc;j.NumericString=S0;Bc.NAME="NumericString";var _0,Ic=class extends ct{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};_0=Ic;j.PrintableString=_0;Ic.NAME="PrintableString";var R0,Sc=class extends ct{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};R0=Sc;j.TeletexString=R0;Sc.NAME="TeletexString";var T0,_c=class extends ct{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};T0=_c;j.VideotexString=T0;_c.NAME="VideotexString";var C0,Rc=class extends ct{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};C0=Rc;j.IA5String=C0;Rc.NAME="IA5String";var N0,Tc=class extends ct{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};N0=Tc;j.GraphicString=N0;Tc.NAME="GraphicString";var U0,ys=class extends ct{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};U0=ys;j.VisibleString=U0;ys.NAME="VisibleString";var L0,Cc=class extends ct{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};L0=Cc;j.GeneralString=L0;Cc.NAME="GeneralString";var D0,Nc=class extends ct{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};D0=Nc;j.CharacterString=D0;Nc.NAME="CharacterString";var P0,ws=class extends ys{constructor({value:e,valueDate:t,...r}={}){if(super(r),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,ce.BufferSourceConverter.toUint8Array(e)))}toBuffer(){let e=this.toString(),t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let i=0;i<e.length;i++)r[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 r=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(r===null){this.error="Wrong input string for conversion";return}let i=parseInt(r[1],10);i>=50?this.year=1900+i:this.year=2e3+i,this.month=parseInt(r[2],10),this.day=parseInt(r[3],10),this.hour=parseInt(r[4],10),this.minute=parseInt(r[5],10),this.second=parseInt(r[6],10)}toString(e="iso"){if(e==="iso"){let t=new Array(7);return t[0]=gt(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=gt(this.month,2),t[2]=gt(this.day,2),t[3]=gt(this.hour,2),t[4]=gt(this.minute,2),t[5]=gt(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}}};P0=ws;j.UTCTime=P0;ws.NAME="UTCTime";var O0,Uc=class extends ws{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,r="",i="",o=0,s,a=0,c=0;if(e[e.length-1]==="Z")r=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");r=e}if(t){if(r.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(r.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,h=r.indexOf("+"),d="";if(h===-1&&(h=r.indexOf("-"),p=-1),h!==-1){if(d=r.substring(h+1),r=r.substring(0,h),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=r.indexOf(".");if(u===-1&&(u=r.indexOf(",")),u!==-1){let p=new Number(`0${r.substring(u)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");o=p.valueOf(),i=r.substring(0,u)}else i=r;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(gt(this.year,4)),t.push(gt(this.month,2)),t.push(gt(this.day,2)),t.push(gt(this.hour,2)),t.push(gt(this.minute,2)),t.push(gt(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(gt(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};O0=Uc;j.GeneralizedTime=O0;Uc.NAME="GeneralizedTime";var F0,Lc=class extends Jn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};F0=Lc;j.DATE=F0;Lc.NAME="DATE";var V0,Dc=class extends Jn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};V0=Dc;j.TimeOfDay=V0;Dc.NAME="TimeOfDay";var z0,Pc=class extends Jn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};z0=Pc;j.DateTime=z0;Pc.NAME="DateTime";var M0,Oc=class extends Jn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};M0=Oc;j.Duration=M0;Oc.NAME="Duration";var j0,Fc=class extends Jn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};j0=Fc;j.TIME=j0;Fc.NAME="TIME";function _3(n){let{result:e}=yo(n),t=e.valueBlock.value;return{n:Q(Bn(t[1].toBigInt()),"base64url"),e:Q(Bn(t[2].toBigInt()),"base64url"),d:Q(Bn(t[3].toBigInt()),"base64url"),p:Q(Bn(t[4].toBigInt()),"base64url"),q:Q(Bn(t[5].toBigInt()),"base64url"),dp:Q(Bn(t[6].toBigInt()),"base64url"),dq:Q(Bn(t[7].toBigInt()),"base64url"),qi:Q(Bn(t[8].toBigInt()),"base64url"),kty:"RSA",alg:"RS256"}}function R3(n){if(n.n==null||n.e==null||n.d==null||n.p==null||n.q==null||n.dp==null||n.dq==null||n.qi==null)throw new F("JWK was missing components","ERR_INVALID_PARAMETERS");let t=new je({value:[new Pe({value:0}),Pe.fromBigInt(In(Y(n.n,"base64url"))),Pe.fromBigInt(In(Y(n.e,"base64url"))),Pe.fromBigInt(In(Y(n.d,"base64url"))),Pe.fromBigInt(In(Y(n.p,"base64url"))),Pe.fromBigInt(In(Y(n.q,"base64url"))),Pe.fromBigInt(In(Y(n.dp,"base64url"))),Pe.fromBigInt(In(Y(n.dq,"base64url"))),Pe.fromBigInt(In(Y(n.qi,"base64url")))]}).toBER();return new Uint8Array(t,0,t.byteLength)}function T3(n){let{result:e}=yo(n),t=e.valueBlock.value[1].valueBlock.value[0].valueBlock.value;return{kty:"RSA",n:Q(Bn(t[0].toBigInt()),"base64url"),e:Q(Bn(t[1].toBigInt()),"base64url")}}function C3(n){if(n.n==null||n.e==null)throw new F("JWK was missing components","ERR_INVALID_PARAMETERS");let t=new je({value:[new je({value:[new nn({value:"1.2.840.113549.1.1.1"}),new zr]}),new go({valueHex:new je({value:[Pe.fromBigInt(In(Y(n.n,"base64url"))),Pe.fromBigInt(In(Y(n.e,"base64url")))]}).toBER()})]}).toBER();return new Uint8Array(t,0,t.byteLength)}function Bn(n){let e=n.toString(16);e.length%2>0&&(e=`0${e}`);let t=e.length/2,r=new Uint8Array(t),i=0,o=0;for(;i<t;)r[i]=parseInt(e.slice(o,o+2),16),i+=1,o+=2;return r}function In(n){let e=[];return n.forEach(function(t){let r=t.toString(16);r.length%2>0&&(r=`0${r}`),e.push(r)}),BigInt("0x"+e.join(""))}var N3=16,ed=32,td=1e4;async function U3(n,e){let t=at.get(),i=new je({value:[new Pe({value:0}),new je({value:[new nn({value:"1.2.840.113549.1.1.1"}),new zr]}),new Zn({valueHex:n.marshal()})]}).toBER(),o=new Uint8Array(i,0,i.byteLength),s=vi(N3),a=await Yp(lo,e,s,{c:td,dkLen:ed}),c=vi(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 Zn({valueHex:s}),new Pe({value:td}),new Pe({value:ed}),new je({value:[new nn({value:"1.2.840.113549.2.11"}),new zr]})]}),h=new je({value:[new nn({value:"1.2.840.113549.1.5.13"}),new je({value:[new je({value:[new nn({value:"1.2.840.113549.1.5.12"}),p]}),new je({value:[new nn({value:"2.16.840.1.101.3.4.1.42"}),new Zn({valueHex:c})]})]})]}),f=new je({value:[h,new Zn({valueHex:l})]}).toBER(),m=new Uint8Array(f,0,f.byteLength);return["-----BEGIN ENCRYPTED PRIVATE KEY-----",...Q(m,"base64pad").split(/(.{64})/).filter(Boolean),"-----END ENCRYPTED PRIVATE KEY-----"].join(`
|
|
17
|
+
`)}async function L3(n,e){let t=at.get(),r;if(n.includes("-----BEGIN ENCRYPTED PRIVATE KEY-----")){let i=Y(n.replace("-----BEGIN ENCRYPTED PRIVATE KEY-----","").replace("-----END ENCRYPTED PRIVATE KEY-----","").replace(/\n/g,"").trim(),"base64pad"),{result:o}=yo(i),{iv:s,salt:a,iterations:c,keySize:u,cipherText:l}=D3(o),p=await Yp(lo,e,a,{c,dkLen:u}),h=await t.subtle.importKey("raw",p,"AES-CBC",!1,["decrypt"]),d=bs(await t.subtle.decrypt({name:"AES-CBC",iv:s},h,l)),{result:f}=yo(d);r=H0(f)}else if(n.includes("-----BEGIN PRIVATE KEY-----")){let i=Y(n.replace("-----BEGIN PRIVATE KEY-----","").replace("-----END PRIVATE KEY-----","").replace(/\n/g,"").trim(),"base64pad"),{result:o}=yo(i);r=H0(o)}else throw new F("Could not parse private key from PEM data","ERR_INVALID_PARAMETERS");return nd(r)}function D3(n){let e=n.valueBlock.value[0];if(e.valueBlock.value[0].toString()!=="OBJECT IDENTIFIER : 1.2.840.113549.1.5.13")throw new F("Only pkcs5PBES2 encrypted private keys are supported","ERR_INVALID_PARAMS");let r=e.valueBlock.value[1].valueBlock.value[0];if(r.valueBlock.value[0].toString()!=="OBJECT IDENTIFIER : 1.2.840.113549.1.5.12")throw new F("Only pkcs5PBKDF2 key derivation functions are supported","ERR_INVALID_PARAMS");let o=r.valueBlock.value[1],s=bs(o.valueBlock.value[0].getValue()),a=td,c=ed;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 F("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 F("Only AES-CBC encryption schemes are supported","ERR_INVALID_PARAMS")}}}}let p=bs(u.valueBlock.value[1].getValue());return{cipherText:bs(n.valueBlock.value[1].getValue()),salt:s,iterations:a,keySize:c,iv:p}}function H0(n){return bs(n.valueBlock.value[2].getValue())}function bs(n){return new Uint8Array(n,0,n.byteLength)}async function $0(n){let e=await at.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:n,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),t=await G0(e);return{privateKey:t[0],publicKey:t[1]}}async function rd(n){let t=[await at.get().subtle.importKey("jwk",n,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await P3(n)],r=await G0({privateKey:t[0],publicKey:t[1]});return{privateKey:r[0],publicKey:r[1]}}async function K0(n,e){let t=await at.get().subtle.importKey("jwk",n,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),r=await at.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},t,e instanceof Uint8Array?e:e.subarray());return new Uint8Array(r,0,r.byteLength)}async function q0(n,e,t){let r=await at.get().subtle.importKey("jwk",n,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return at.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},r,e,t instanceof Uint8Array?t:t.subarray())}async function G0(n){if(n.privateKey==null||n.publicKey==null)throw new F("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([at.get().subtle.exportKey("jwk",n.privateKey),at.get().subtle.exportKey("jwk",n.publicKey)])}async function P3(n){return at.get().subtle.importKey("jwk",{kty:n.kty,n:n.n,e:n.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function zc(n){if(n.kty!=="RSA")throw new F("invalid key type","ERR_INVALID_KEY_TYPE");if(n.n==null)throw new F("invalid key modulus","ERR_INVALID_KEY_MODULUS");return Y(n.n,"base64url").length*8}var Es=8192,vs=class{_key;constructor(e){this._key=e}verify(e,t){return q0(this._key,t,e)}marshal(){return Mr.jwkToPkix(this._key)}get bytes(){return En.encode({Type:ve.RSA,Data:this.marshal()}).subarray()}equals(e){return fe(this.bytes,e.bytes)}hash(){let e=re.digest(this.bytes);return Ht(e)?e.then(({bytes:t})=>t):e.bytes}},wo=class{_key;_publicKey;constructor(e,t){this._key=e,this._publicKey=t}genSecret(){return vi(16)}sign(e){return K0(this._key,e)}get public(){if(this._publicKey==null)throw new F("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new vs(this._publicKey)}marshal(){return Mr.jwkToPkcs1(this._key)}get bytes(){return kn.encode({Type:ve.RSA,Data:this.marshal()}).subarray()}equals(e){return fe(this.bytes,e.bytes)}hash(){let e=re.digest(this.bytes);return Ht(e)?e.then(({bytes:t})=>t):e.bytes}async id(){let e=await this.public.hash();return Q(e,"base58btc")}async export(e,t="pkcs-8"){if(t==="pkcs-8")return Mr.exportToPem(this,e);if(t==="libp2p-key")return fo(this.bytes,e);throw new F(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};async function nd(n){let e=Mr.pkcs1ToJwk(n);if(zc(e)>Es)throw new F("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let t=await rd(e);return new wo(t.privateKey,t.publicKey)}function F3(n){let e=Mr.pkixToJwk(n);if(zc(e)>Es)throw new F("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new vs(e)}async function V3(n){if(zc(n)>Es)throw new F("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await rd(n);return new wo(e.privateKey,e.publicKey)}async function z3(n){if(n>Es)throw new F("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await $0(n);return new wo(e.privateKey,e.publicKey)}var ld={};Be(ld,{Secp256k1PrivateKey:()=>As,Secp256k1PublicKey:()=>ks,generateKeyPair:()=>t6,unmarshalSecp256k1PrivateKey:()=>Q3,unmarshalSecp256k1PublicKey:()=>e6});var M3=(n,e,t)=>n&e^~n&t,j3=(n,e,t)=>n&e^n&t^e&t,H3=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]),jr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Hr=new Uint32Array(64),od=class extends co{constructor(){super(64,32,8,!1),this.A=jr[0]|0,this.B=jr[1]|0,this.C=jr[2]|0,this.D=jr[3]|0,this.E=jr[4]|0,this.F=jr[5]|0,this.G=jr[6]|0,this.H=jr[7]|0}get(){let{A:e,B:t,C:r,D:i,E:o,F:s,G:a,H:c}=this;return[e,t,r,i,o,s,a,c]}set(e,t,r,i,o,s,a,c){this.A=e|0,this.B=t|0,this.C=r|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)Hr[p]=e.getUint32(t,!1);for(let p=16;p<64;p++){let h=Hr[p-15],d=Hr[p-2],f=Qt(h,7)^Qt(h,18)^h>>>3,m=Qt(d,17)^Qt(d,19)^d>>>10;Hr[p]=m+Hr[p-7]+f+Hr[p-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:c,G:u,H:l}=this;for(let p=0;p<64;p++){let h=Qt(a,6)^Qt(a,11)^Qt(a,25),d=l+h+M3(a,c,u)+H3[p]+Hr[p]|0,m=(Qt(r,2)^Qt(r,13)^Qt(r,22))+j3(r,i,o)|0;l=u,u=c,c=a,a=s+d|0,s=o,o=i,i=r,r=d+m|0}r=r+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(r,i,o,s,a,c,u,l)}roundClean(){Hr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var W0=za(()=>new od);function $3(n){let e=ls(n);vn(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:r,a:i}=e;if(t){if(!r.eql(i,r.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:K3,hexToBytes:q3}=Ha,ki={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(n){let{Err:e}=ki;if(n.length<2||n[0]!==2)throw new e("Invalid signature integer tag");let t=n[1],r=n.subarray(2,t+2);if(!t||r.length!==t)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:K3(r),l:n.subarray(t+2)}},toSig(n){let{Err:e}=ki,t=typeof n=="string"?q3(n):n;if(!en(t))throw new Error("ui8a expected");let r=t.length;if(r<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==r-2)throw new e("Invalid signature: incorrect length");let{d:i,l:o}=ki._parseInt(t.subarray(2)),{d:s,l:a}=ki._parseInt(o);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(n){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},r=e(t(n.s)),i=e(t(n.r)),o=r.length/2,s=i.length/2,a=t(o),c=t(s);return`30${t(s+o+4)}02${c}${i}02${a}${r}`}},tr=BigInt(0),Kt=BigInt(1),KR=BigInt(2),Y0=BigInt(3),qR=BigInt(4);function G3(n){let e=$3(n),{Fp:t}=e,r=e.toBytes||((f,m,g)=>{let x=m.toAffine();return qn(Uint8Array.from([4]),t.toBytes(x.x),t.toBytes(x.y))}),i=e.fromBytes||(f=>{let m=f.subarray(1),g=t.fromBytes(m.subarray(0,t.BYTES)),x=t.fromBytes(m.subarray(t.BYTES,2*t.BYTES));return{x:g,y:x}});function o(f){let{a:m,b:g}=e,x=t.sqr(f),w=t.mul(x,f);return t.add(t.add(w,t.mul(f,m)),g)}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"&&tr<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:m,nByteLength:g,wrapPrivateKey:x,n:w}=e;if(m&&typeof f!="bigint"){if(en(f)&&(f=$n(f)),typeof f!="string"||!m.includes(f.length))throw new Error("Invalid key");f=f.padStart(g*2,"0")}let b;try{b=typeof f=="bigint"?f:Kn(Se("private key",f,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof f}`)}return x&&(b=xe(b,w)),a(b),b}let u=new Map;function l(f){if(!(f instanceof p))throw new Error("ProjectivePoint expected")}class p{constructor(m,g,x){if(this.px=m,this.py=g,this.pz=x,m==null||!t.isValid(m))throw new Error("x required");if(g==null||!t.isValid(g))throw new Error("y required");if(x==null||!t.isValid(x))throw new Error("z required")}static fromAffine(m){let{x:g,y:x}=m||{};if(!m||!t.isValid(g)||!t.isValid(x))throw new Error("invalid affine point");if(m instanceof p)throw new Error("projective point not allowed");let w=b=>t.eql(b,t.ZERO);return w(g)&&w(x)?p.ZERO:new p(g,x,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){let g=t.invertBatch(m.map(x=>x.pz));return m.map((x,w)=>x.toAffine(g[w])).map(p.fromAffine)}static fromHex(m){let g=p.fromAffine(i(Se("pointHex",m)));return g.assertValidity(),g}static fromPrivateKey(m){return p.BASE.multiply(c(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:m,y:g}=this.toAffine();if(!t.isValid(m)||!t.isValid(g))throw new Error("bad point: x or y not FE");let x=t.sqr(g),w=o(m);if(!t.eql(x,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:m}=this.toAffine();if(t.isOdd)return!t.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){l(m);let{px:g,py:x,pz:w}=this,{px:b,py:A,pz:B}=m,k=t.eql(t.mul(g,B),t.mul(b,w)),E=t.eql(t.mul(x,B),t.mul(A,w));return k&&E}negate(){return new p(this.px,t.neg(this.py),this.pz)}double(){let{a:m,b:g}=e,x=t.mul(g,Y0),{px:w,py:b,pz:A}=this,B=t.ZERO,k=t.ZERO,E=t.ZERO,v=t.mul(w,w),R=t.mul(b,b),N=t.mul(A,A),C=t.mul(w,b);return C=t.add(C,C),E=t.mul(w,A),E=t.add(E,E),B=t.mul(m,E),k=t.mul(x,N),k=t.add(B,k),B=t.sub(R,k),k=t.add(R,k),k=t.mul(B,k),B=t.mul(C,B),E=t.mul(x,E),N=t.mul(m,N),C=t.sub(v,N),C=t.mul(m,C),C=t.add(C,E),E=t.add(v,v),v=t.add(E,v),v=t.add(v,N),v=t.mul(v,C),k=t.add(k,v),N=t.mul(b,A),N=t.add(N,N),v=t.mul(N,C),B=t.sub(B,v),E=t.mul(N,R),E=t.add(E,E),E=t.add(E,E),new p(B,k,E)}add(m){l(m);let{px:g,py:x,pz:w}=this,{px:b,py:A,pz:B}=m,k=t.ZERO,E=t.ZERO,v=t.ZERO,R=e.a,N=t.mul(e.b,Y0),C=t.mul(g,b),M=t.mul(x,A),D=t.mul(w,B),ie=t.add(g,x),S=t.add(b,A);ie=t.mul(ie,S),S=t.add(C,M),ie=t.sub(ie,S),S=t.add(g,w);let L=t.add(b,B);return S=t.mul(S,L),L=t.add(C,D),S=t.sub(S,L),L=t.add(x,w),k=t.add(A,B),L=t.mul(L,k),k=t.add(M,D),L=t.sub(L,k),v=t.mul(R,S),k=t.mul(N,D),v=t.add(k,v),k=t.sub(M,v),v=t.add(M,v),E=t.mul(k,v),M=t.add(C,C),M=t.add(M,C),D=t.mul(R,D),S=t.mul(N,S),M=t.add(M,D),D=t.sub(C,D),D=t.mul(R,D),S=t.add(S,D),C=t.mul(M,S),E=t.add(E,C),C=t.mul(L,S),k=t.mul(ie,k),k=t.sub(k,C),C=t.mul(ie,M),v=t.mul(L,v),v=t.add(v,C),new p(k,E,v)}subtract(m){return this.add(m.negate())}is0(){return this.equals(p.ZERO)}wNAF(m){return d.wNAFCached(this,u,m,g=>{let x=t.invertBatch(g.map(w=>w.pz));return g.map((w,b)=>w.toAffine(x[b])).map(p.fromAffine)})}multiplyUnsafe(m){let g=p.ZERO;if(m===tr)return g;if(a(m),m===Kt)return this;let{endo:x}=e;if(!x)return d.unsafeLadder(this,m);let{k1neg:w,k1:b,k2neg:A,k2:B}=x.splitScalar(m),k=g,E=g,v=this;for(;b>tr||B>tr;)b&Kt&&(k=k.add(v)),B&Kt&&(E=E.add(v)),v=v.double(),b>>=Kt,B>>=Kt;return w&&(k=k.negate()),A&&(E=E.negate()),E=new p(t.mul(E.px,x.beta),E.py,E.pz),k.add(E)}multiply(m){a(m);let g=m,x,w,{endo:b}=e;if(b){let{k1neg:A,k1:B,k2neg:k,k2:E}=b.splitScalar(g),{p:v,f:R}=this.wNAF(B),{p:N,f:C}=this.wNAF(E);v=d.constTimeNegate(A,v),N=d.constTimeNegate(k,N),N=new p(t.mul(N.px,b.beta),N.py,N.pz),x=v.add(N),w=R.add(C)}else{let{p:A,f:B}=this.wNAF(g);x=A,w=B}return p.normalizeZ([x,w])[0]}multiplyAndAddUnsafe(m,g,x){let w=p.BASE,b=(B,k)=>k===tr||k===Kt||!B.equals(w)?B.multiplyUnsafe(k):B.multiply(k),A=b(this,g).add(b(m,x));return A.is0()?void 0:A}toAffine(m){let{px:g,py:x,pz:w}=this,b=this.is0();m==null&&(m=b?t.ONE:t.inv(w));let A=t.mul(g,m),B=t.mul(x,m),k=t.mul(w,m);if(b)return{x:t.ZERO,y:t.ZERO};if(!t.eql(k,t.ONE))throw new Error("invZ was invalid");return{x:A,y:B}}isTorsionFree(){let{h:m,isTorsionFree:g}=e;if(m===Kt)return!0;if(g)return g(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:m,clearCofactor:g}=e;return m===Kt?this:g?g(p,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),r(p,this,m)}toHex(m=!0){return $n(this.toRawBytes(m))}}p.BASE=new p(e.Gx,e.Gy,t.ONE),p.ZERO=new p(t.ZERO,t.ONE,t.ZERO);let h=e.nBitLength,d=qa(p,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:p,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:s}}function W3(n){let e=ls(n);return vn(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function X0(n){let e=W3(n),{Fp:t,n:r}=e,i=t.BYTES+1,o=2*t.BYTES+1;function s(S){return tr<S&&S<t.ORDER}function a(S){return xe(S,r)}function c(S){return $a(S,r)}let{ProjectivePoint:u,normPrivateKeyToScalar:l,weierstrassEquation:p,isWithinCurveOrder:h}=G3({...e,toBytes(S,L,X){let U=L.toAffine(),_=t.toBytes(U.x),H=qn;return X?H(Uint8Array.from([L.hasEvenY()?2:3]),_):H(Uint8Array.from([4]),_,t.toBytes(U.y))},fromBytes(S){let L=S.length,X=S[0],U=S.subarray(1);if(L===i&&(X===2||X===3)){let _=Kn(U);if(!s(_))throw new Error("Point is not on curve");let H=p(_),G=t.sqrt(H),Z=(G&Kt)===Kt;return(X&1)===1!==Z&&(G=t.neg(G)),{x:_,y:G}}else if(L===o&&X===4){let _=t.fromBytes(U.subarray(0,t.BYTES)),H=t.fromBytes(U.subarray(t.BYTES,2*t.BYTES));return{x:_,y:H}}else throw new Error(`Point of length ${L} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}}),d=S=>$n(Or(S,e.nByteLength));function f(S){let L=r>>Kt;return S>L}function m(S){return f(S)?a(-S):S}let g=(S,L,X)=>Kn(S.slice(L,X));class x{constructor(L,X,U){this.r=L,this.s=X,this.recovery=U,this.assertValidity()}static fromCompact(L){let X=e.nByteLength;return L=Se("compactSignature",L,X*2),new x(g(L,0,X),g(L,X,2*X))}static fromDER(L){let{r:X,s:U}=ki.toSig(Se("DER",L));return new x(X,U)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(L){return new x(this.r,this.s,L)}recoverPublicKey(L){let{r:X,s:U,recovery:_}=this,H=E(Se("msgHash",L));if(_==null||![0,1,2,3].includes(_))throw new Error("recovery id invalid");let G=_===2||_===3?X+e.n:X;if(G>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let Z=_&1?"03":"02",ne=u.fromHex(Z+d(G)),oe=c(G),ge=a(-H*oe),le=a(U*oe),pe=u.BASE.multiplyAndAddUnsafe(ne,ge,le);if(!pe)throw new Error("point at infinify");return pe.assertValidity(),pe}hasHighS(){return f(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return xi(this.toDERHex())}toDERHex(){return ki.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return xi(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}let w={isValidPrivateKey(S){try{return l(S),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let S=Mp(e.n);return $m(e.randomBytes(S),e.n)},precompute(S=8,L=u.BASE){return L._setWindowSize(S),L.multiply(BigInt(3)),L}};function b(S,L=!0){return u.fromPrivateKey(S).toRawBytes(L)}function A(S){let L=en(S),X=typeof S=="string",U=(L||X)&&S.length;return L?U===i||U===o:X?U===2*i||U===2*o:S instanceof u}function B(S,L,X=!0){if(A(S))throw new Error("first arg must be private key");if(!A(L))throw new Error("second arg must be public key");return u.fromHex(L).multiply(l(S)).toRawBytes(X)}let k=e.bits2int||function(S){let L=Kn(S),X=S.length*8-e.nBitLength;return X>0?L>>BigInt(X):L},E=e.bits2int_modN||function(S){return a(k(S))},v=cs(e.nBitLength);function R(S){if(typeof S!="bigint")throw new Error("bigint expected");if(!(tr<=S&&S<v))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Or(S,e.nByteLength)}function N(S,L,X=C){if(["recovered","canonical"].some(Ae=>Ae in X))throw new Error("sign() legacy options not supported");let{hash:U,randomBytes:_}=e,{lowS:H,prehash:G,extraEntropy:Z}=X;H==null&&(H=!0),S=Se("msgHash",S),G&&(S=Se("prehashed msgHash",U(S)));let ne=E(S),oe=l(L),ge=[R(oe),R(ne)];if(Z!=null){let Ae=Z===!0?_(t.BYTES):Z;ge.push(Se("extraEntropy",Ae))}let le=qn(...ge),pe=ne;function Ue(Ae){let qe=k(Ae);if(!h(qe))return;let Ge=c(qe),Ve=u.BASE.multiply(qe).toAffine(),et=a(Ve.x);if(et===tr)return;let Mn=a(Ge*a(pe+et*oe));if(Mn===tr)return;let ai=(Ve.x===et?0:2)|Number(Ve.y&Kt),Xo=Mn;return H&&f(Mn)&&(Xo=m(Mn),ai^=1),new x(et,Xo,ai)}return{seed:le,k2sig:Ue}}let C={lowS:e.lowS,prehash:!1},M={lowS:e.lowS,prehash:!1};function D(S,L,X=C){let{seed:U,k2sig:_}=N(S,L,X),H=e;return Op(H.hash.outputLen,H.nByteLength,H.hmac)(U,_)}u.BASE._setWindowSize(8);function ie(S,L,X,U=M){let _=S;if(L=Se("msgHash",L),X=Se("publicKey",X),"strict"in U)throw new Error("options.strict was renamed to lowS");let{lowS:H,prehash:G}=U,Z,ne;try{if(typeof _=="string"||en(_))try{Z=x.fromDER(_)}catch(Ve){if(!(Ve instanceof ki.Err))throw Ve;Z=x.fromCompact(_)}else if(typeof _=="object"&&typeof _.r=="bigint"&&typeof _.s=="bigint"){let{r:Ve,s:et}=_;Z=new x(Ve,et)}else throw new Error("PARSE");ne=u.fromHex(X)}catch(Ve){if(Ve.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&Z.hasHighS())return!1;G&&(L=e.hash(L));let{r:oe,s:ge}=Z,le=E(L),pe=c(ge),Ue=a(le*pe),Ae=a(oe*pe),qe=u.BASE.multiplyAndAddUnsafe(ne,Ue,Ae)?.toAffine();return qe?a(qe.x)===oe:!1}return{CURVE:e,getPublicKey:b,getSharedSecret:B,sign:D,verify:ie,ProjectivePoint:u,Signature:x,utils:w}}function Y3(n){return{hash:n,hmac:(e,...t)=>ps(n,e,Va(...t)),randomBytes:ao}}function Z0(n,e){let t=r=>X0({...n,...Y3(r)});return Object.freeze({...t(e),create:t})}var eg=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),J0=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),X3=BigInt(1),sd=BigInt(2),Q0=(n,e)=>(n+e/sd)/e;function Z3(n){let e=eg,t=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=n*n*n%e,l=u*u*n%e,p=be(l,t,e)*l%e,h=be(p,t,e)*l%e,d=be(h,sd,e)*u%e,f=be(d,i,e)*d%e,m=be(f,o,e)*f%e,g=be(m,a,e)*m%e,x=be(g,c,e)*g%e,w=be(x,a,e)*m%e,b=be(w,t,e)*l%e,A=be(b,s,e)*f%e,B=be(A,r,e)*u%e,k=be(B,sd,e);if(!ad.eql(ad.sqr(k),n))throw new Error("Cannot find square root");return k}var ad=Ka(eg,void 0,void 0,{sqrt:Z3}),on=Z0({a:BigInt(0),b:BigInt(7),Fp:ad,n:J0,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:n=>{let e=J0,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-X3*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=t,s=BigInt("0x100000000000000000000000000000000"),a=Q0(o*n,e),c=Q0(-r*n,e),u=xe(n-a*t-c*i,e),l=xe(-a*r-c*o,e),p=u>s,h=l>s;if(p&&(u=e-u),h&&(l=e-l),u>s||l>s)throw new Error("splitScalar: Endomorphism failed, k="+n);return{k1neg:p,k1:u,k2neg:h,k2:l}}}},W0),tT=BigInt(0);var nT=on.ProjectivePoint;function tg(){return on.utils.randomPrivateKey()}function ng(n,e){let t=re.digest(e instanceof Uint8Array?e:e.subarray());if(Ht(t))return t.then(({digest:r})=>on.sign(r,n).toDERRawBytes()).catch(r=>{throw new F(String(r),"ERR_INVALID_INPUT")});try{return on.sign(t.digest,n).toDERRawBytes()}catch(r){throw new F(String(r),"ERR_INVALID_INPUT")}}function rg(n,e,t){let r=re.digest(t instanceof Uint8Array?t:t.subarray());if(Ht(r))return r.then(({digest:i})=>on.verify(e,i,n)).catch(i=>{throw new F(String(i),"ERR_INVALID_INPUT")});try{return on.verify(e,r.digest,n)}catch(i){throw new F(String(i),"ERR_INVALID_INPUT")}}function ig(n){return on.ProjectivePoint.fromHex(n).toRawBytes(!0)}function og(n){try{on.getPublicKey(n,!0)}catch(e){throw new F(String(e),"ERR_INVALID_PRIVATE_KEY")}}function cd(n){try{on.ProjectivePoint.fromHex(n)}catch(e){throw new F(String(e),"ERR_INVALID_PUBLIC_KEY")}}function sg(n){try{return on.getPublicKey(n,!0)}catch(e){throw new F(String(e),"ERR_INVALID_PRIVATE_KEY")}}var ks=class{_key;constructor(e){cd(e),this._key=e}verify(e,t){return rg(this._key,t,e)}marshal(){return ig(this._key)}get bytes(){return En.encode({Type:ve.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return fe(this.bytes,e.bytes)}async hash(){let e=re.digest(this.bytes),t;return Ht(e)?{bytes:t}=await e:t=e.bytes,t}},As=class{_key;_publicKey;constructor(e,t){this._key=e,this._publicKey=t??sg(e),og(this._key),cd(this._publicKey)}sign(e){return ng(this._key,e)}get public(){return new ks(this._publicKey)}marshal(){return this._key}get bytes(){return kn.encode({Type:ve.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return fe(this.bytes,e.bytes)}hash(){let e=re.digest(this.bytes);return Ht(e)?e.then(({bytes:t})=>t):e.bytes}async id(){let e=await this.public.hash();return Q(e,"base58btc")}async export(e,t="libp2p-key"){if(t==="libp2p-key")return fo(this.bytes,e);throw new F(`export format '${t}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Q3(n){return new As(n)}function e6(n){return new ks(n)}async function t6(){let n=tg();return new As(n)}var Ai={rsa:id,ed25519:Wp,secp256k1:ld};function ag(n){let e=Object.keys(Ai).join(" / ");return new F(`invalid or unsupported key type ${n}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function ud(n){let e=En.decode(n),t=e.Data??new Uint8Array;switch(e.Type){case ve.RSA:return Ai.rsa.unmarshalRsaPublicKey(t);case ve.Ed25519:return Ai.ed25519.unmarshalEd25519PublicKey(t);case ve.Secp256k1:return Ai.secp256k1.unmarshalSecp256k1PublicKey(t);default:throw ag(e.Type??"unknown")}}async function cg(n){let e=kn.decode(n),t=e.Data??new Uint8Array;switch(e.Type){case ve.RSA:return Ai.rsa.unmarshalRsaPrivateKey(t);case ve.Ed25519:return Ai.ed25519.unmarshalEd25519PrivateKey(t);case ve.Secp256k1:return Ai.secp256k1.unmarshalSecp256k1PrivateKey(t);default:throw ag(e.Type??"RSA")}}var Ad=ee(Te(),1);var nr="/",lg=new TextEncoder().encode(nr),Mc=lg[0],Me=class n{_buf;constructor(e,t){if(typeof e=="string")this._buf=Y(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]!==Mc)throw new Error("Invalid key")}toString(e="utf8"){return Q(this._buf,e)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return`Key(${this.toString()})`}static withNamespaces(e){return new n(e.join(nr))}static random(){return new n(Math.random().toString().substring(2))}static asKey(e){return e instanceof Uint8Array||typeof e=="string"?new n(e):typeof e.uint8Array=="function"?new n(e.uint8Array()):null}clean(){if((this._buf==null||this._buf.byteLength===0)&&(this._buf=lg),this._buf[0]!==Mc){let e=new Uint8Array(this._buf.byteLength+1);e.fill(Mc,0,1),e.set(this._buf,1),this._buf=e}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===Mc;)this._buf=this._buf.subarray(0,-1)}less(e){let t=this.list(),r=e.list();for(let i=0;i<t.length;i++){if(r.length<i+1)return!1;let o=t[i],s=r[i];if(o<s)return!0;if(o>s)return!1}return t.length<r.length}reverse(){return n.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){let e=this.namespaces();return e[e.length-1]}list(){return this.toString().split(nr).slice(1)}type(){return n6(this.baseNamespace())}name(){return r6(this.baseNamespace())}instance(e){return new n(this.toString()+":"+e)}path(){let e=this.parent().toString();return e.endsWith(nr)||(e+=nr),e+=this.type(),new n(e)}parent(){let e=this.list();return e.length===1?new n(nr):new n(e.slice(0,-1).join(nr))}child(e){return this.toString()===nr?e:e.toString()===nr?this:new n(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 n.withNamespaces([...this.namespaces(),...i6(e.map(t=>t.namespaces()))])}};function n6(n){let e=n.split(":");return e.length<2?"":e.slice(0,-1).join(":")}function r6(n){let e=n.split(":");return e[e.length-1]}function i6(n){return[].concat(...n)}var I1=ee(jc(),1);var ug="ERR_IPNS_EXPIRED_RECORD",Bs="ERR_UNRECOGNIZED_VALIDITY",pg="ERR_SIGNATURE_CREATION",rr="ERR_SIGNATURE_VERIFICATION";var dd="ERR_UNDEFINED_PARAMETER",dg="ERR_INVALID_RECORD_DATA",fg="ERR_INVALID_VALUE",hg="ERR_INVALID_EMBEDDED_KEY",mg="ERR_MISSING_PRIVATE_KEY",gg="ERR_RECORD_TOO_LARGE";var Xe;(function(n){let e;(function(i){i.EOL="EOL"})(e=n.ValidityType||(n.ValidityType={}));let t;(function(i){i[i.EOL=0]="EOL"})(t||(t={})),function(i){i.codec=()=>hi(t)}(e=n.ValidityType||(n.ValidityType={}));let r;n.codec=()=>(r==null&&(r=jt((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),n.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=n.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})),r),n.encode=i=>Mt(i,n.codec()),n.decode=i=>Vt(i,n.codec())})(Xe||(Xe={}));var o6=["string","number","bigint","symbol"],s6=["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 xg(n){if(n===null)return"null";if(n===void 0)return"undefined";if(n===!0||n===!1)return"boolean";let e=typeof n;if(o6.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(n))return"Array";if(a6(n))return"Buffer";let t=c6(n);return t||"Object"}function a6(n){return n&&n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer.call(null,n)}function c6(n){let e=Object.prototype.toString.call(n).slice(8,-1);if(s6.includes(e))return e}var y=class{constructor(e,t,r){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};y.uint=new y(0,"uint",!0);y.negint=new y(1,"negint",!0);y.bytes=new y(2,"bytes",!0);y.string=new y(3,"string",!0);y.array=new y(4,"array",!1);y.map=new y(5,"map",!1);y.tag=new y(6,"tag",!1);y.float=new y(7,"float",!0);y.false=new y(7,"false",!0);y.true=new y(7,"true",!0);y.null=new y(7,"null",!0);y.undefined=new y(7,"undefined",!0);y.break=new y(7,"break",!0);var T=class{constructor(e,t,r){this.type=e,this.value=t,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};var bo=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",l6=new TextDecoder,u6=new TextEncoder;function Hc(n){return bo&&globalThis.Buffer.isBuffer(n)}function Is(n){return n instanceof Uint8Array?Hc(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):n:Uint8Array.from(n)}var vg=bo?(n,e,t)=>t-e>64?globalThis.Buffer.from(n.subarray(e,t)).toString("utf8"):wg(n,e,t):(n,e,t)=>t-e>64?l6.decode(n.subarray(e,t)):wg(n,e,t),$c=bo?n=>n.length>64?globalThis.Buffer.from(n):yg(n):n=>n.length>64?u6.encode(n):yg(n),Sn=n=>Uint8Array.from(n),vo=bo?(n,e,t)=>Hc(n)?new Uint8Array(n.subarray(e,t)):n.slice(e,t):(n,e,t)=>n.slice(e,t),Eg=bo?(n,e)=>(n=n.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),Is(globalThis.Buffer.concat(n,e))):(n,e)=>{let t=new Uint8Array(e),r=0;for(let i of n)r+i.length>t.length&&(i=i.subarray(0,t.length-r)),t.set(i,r),r+=i.length;return t},kg=bo?n=>globalThis.Buffer.allocUnsafe(n):n=>new Uint8Array(n);function Ag(n,e){if(Hc(n)&&Hc(e))return n.compare(e);for(let t=0;t<n.length;t++)if(n[t]!==e[t])return n[t]<e[t]?-1:1;return 0}function yg(n){let e=[],t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&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 wg(n,e,t){let r=[];for(;e<t;){let i=n[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=n[e+1],(a&192)===128&&(l=(i&31)<<6|a&63,l>127&&(o=l));break;case 3:a=n[e+1],c=n[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=n[e+1],c=n[e+2],u=n[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,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),e+=s}return hd(r)}var bg=4096;function hd(n){let e=n.length;if(e<=bg)return String.fromCharCode.apply(String,n);let t="",r=0;for(;r<e;)t+=String.fromCharCode.apply(String,n.slice(r,r+=bg));return t}var p6=256,Ss=class{constructor(e=p6){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=kg(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 r=this.chunks[0];e&&this.cursor>r.length/2?(t=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=vo(r,0,this.cursor)}else t=Eg(this.chunks,this.cursor);return e&&this.reset(),t}};var $="CBOR decode error:",ir="CBOR encode error:",_s=[];_s[23]=1;_s[24]=2;_s[25]=3;_s[26]=5;_s[27]=9;function or(n,e,t){if(n.length-e<t)throw new Error(`${$} not enough data for type`)}var He=[24,256,65536,4294967296,BigInt("18446744073709551616")];function _t(n,e,t){or(n,e,1);let r=n[e];if(t.strict===!0&&r<He[0])throw new Error(`${$} integer encoded in more bytes than necessary (strict decode)`);return r}function Rt(n,e,t){or(n,e,2);let r=n[e]<<8|n[e+1];if(t.strict===!0&&r<He[1])throw new Error(`${$} integer encoded in more bytes than necessary (strict decode)`);return r}function Tt(n,e,t){or(n,e,4);let r=n[e]*16777216+(n[e+1]<<16)+(n[e+2]<<8)+n[e+3];if(t.strict===!0&&r<He[2])throw new Error(`${$} integer encoded in more bytes than necessary (strict decode)`);return r}function Ct(n,e,t){or(n,e,8);let r=n[e]*16777216+(n[e+1]<<16)+(n[e+2]<<8)+n[e+3],i=n[e+4]*16777216+(n[e+5]<<16)+(n[e+6]<<8)+n[e+7],o=(BigInt(r)<<BigInt(32))+BigInt(i);if(t.strict===!0&&o<He[3])throw new Error(`${$} 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(`${$} integers outside of the safe integer range are not supported`)}function Bg(n,e,t,r){return new T(y.uint,_t(n,e+1,r),2)}function Ig(n,e,t,r){return new T(y.uint,Rt(n,e+1,r),3)}function Sg(n,e,t,r){return new T(y.uint,Tt(n,e+1,r),5)}function _g(n,e,t,r){return new T(y.uint,Ct(n,e+1,r),9)}function qt(n,e){return Ze(n,0,e.value)}function Ze(n,e,t){if(t<He[0]){let r=Number(t);n.push([e|r])}else if(t<He[1]){let r=Number(t);n.push([e|24,r])}else if(t<He[2]){let r=Number(t);n.push([e|25,r>>>8,r&255])}else if(t<He[3]){let r=Number(t);n.push([e|26,r>>>24&255,r>>>16&255,r>>>8&255,r&255])}else{let r=BigInt(t);if(r<He[4]){let i=[e|27,0,0,0,0,0,0,0],o=Number(r&BigInt(4294967295)),s=Number(r>>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,n.push(i)}else throw new Error(`${$} encountered BigInt larger than allowable range`)}}qt.encodedSize=function(e){return Ze.encodedSize(e.value)};Ze.encodedSize=function(e){return e<He[0]?1:e<He[1]?2:e<He[2]?3:e<He[3]?5:9};qt.compareTokens=function(e,t){return e.value<t.value?-1:e.value>t.value?1:0};function Rg(n,e,t,r){return new T(y.negint,-1-_t(n,e+1,r),2)}function Tg(n,e,t,r){return new T(y.negint,-1-Rt(n,e+1,r),3)}function Cg(n,e,t,r){return new T(y.negint,-1-Tt(n,e+1,r),5)}var md=BigInt(-1),Ng=BigInt(1);function Ug(n,e,t,r){let i=Ct(n,e+1,r);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new T(y.negint,o,9)}if(r.allowBigInt!==!0)throw new Error(`${$} integers outside of the safe integer range are not supported`);return new T(y.negint,md-BigInt(i),9)}function Kc(n,e){let t=e.value,r=typeof t=="bigint"?t*md-Ng:t*-1-1;Ze(n,e.type.majorEncoded,r)}Kc.encodedSize=function(e){let t=e.value,r=typeof t=="bigint"?t*md-Ng:t*-1-1;return r<He[0]?1:r<He[1]?2:r<He[2]?3:r<He[3]?5:9};Kc.compareTokens=function(e,t){return e.value<t.value?1:e.value>t.value?-1:0};function Rs(n,e,t,r){or(n,e,t+r);let i=vo(n,e+t,e+t+r);return new T(y.bytes,i,t+r)}function Lg(n,e,t,r){return Rs(n,e,1,t)}function Dg(n,e,t,r){return Rs(n,e,2,_t(n,e+1,r))}function Pg(n,e,t,r){return Rs(n,e,3,Rt(n,e+1,r))}function Og(n,e,t,r){return Rs(n,e,5,Tt(n,e+1,r))}function Fg(n,e,t,r){let i=Ct(n,e+1,r);if(typeof i=="bigint")throw new Error(`${$} 64-bit integer bytes lengths not supported`);return Rs(n,e,9,i)}function qc(n){return n.encodedBytes===void 0&&(n.encodedBytes=n.type===y.string?$c(n.value):n.value),n.encodedBytes}function Eo(n,e){let t=qc(e);Ze(n,e.type.majorEncoded,t.length),n.push(t)}Eo.encodedSize=function(e){let t=qc(e);return Ze.encodedSize(t.length)+t.length};Eo.compareTokens=function(e,t){return f6(qc(e),qc(t))};function f6(n,e){return n.length<e.length?-1:n.length>e.length?1:Ag(n,e)}function Ts(n,e,t,r,i){let o=t+r;or(n,e,o);let s=new T(y.string,vg(n,e+t,e+o),o);return i.retainStringBytes===!0&&(s.byteValue=vo(n,e+t,e+o)),s}function Vg(n,e,t,r){return Ts(n,e,1,t,r)}function zg(n,e,t,r){return Ts(n,e,2,_t(n,e+1,r),r)}function Mg(n,e,t,r){return Ts(n,e,3,Rt(n,e+1,r),r)}function jg(n,e,t,r){return Ts(n,e,5,Tt(n,e+1,r),r)}function Hg(n,e,t,r){let i=Ct(n,e+1,r);if(typeof i=="bigint")throw new Error(`${$} 64-bit integer string lengths not supported`);return Ts(n,e,9,i,r)}var $g=Eo;function ko(n,e,t,r){return new T(y.array,r,t)}function Kg(n,e,t,r){return ko(n,e,1,t)}function qg(n,e,t,r){return ko(n,e,2,_t(n,e+1,r))}function Gg(n,e,t,r){return ko(n,e,3,Rt(n,e+1,r))}function Wg(n,e,t,r){return ko(n,e,5,Tt(n,e+1,r))}function Yg(n,e,t,r){let i=Ct(n,e+1,r);if(typeof i=="bigint")throw new Error(`${$} 64-bit integer array lengths not supported`);return ko(n,e,9,i)}function Xg(n,e,t,r){if(r.allowIndefinite===!1)throw new Error(`${$} indefinite length items not allowed`);return ko(n,e,1,1/0)}function Gc(n,e){Ze(n,y.array.majorEncoded,e.value)}Gc.compareTokens=qt.compareTokens;Gc.encodedSize=function(e){return Ze.encodedSize(e.value)};function Ao(n,e,t,r){return new T(y.map,r,t)}function Zg(n,e,t,r){return Ao(n,e,1,t)}function Jg(n,e,t,r){return Ao(n,e,2,_t(n,e+1,r))}function Qg(n,e,t,r){return Ao(n,e,3,Rt(n,e+1,r))}function e1(n,e,t,r){return Ao(n,e,5,Tt(n,e+1,r))}function t1(n,e,t,r){let i=Ct(n,e+1,r);if(typeof i=="bigint")throw new Error(`${$} 64-bit integer map lengths not supported`);return Ao(n,e,9,i)}function n1(n,e,t,r){if(r.allowIndefinite===!1)throw new Error(`${$} indefinite length items not allowed`);return Ao(n,e,1,1/0)}function Wc(n,e){Ze(n,y.map.majorEncoded,e.value)}Wc.compareTokens=qt.compareTokens;Wc.encodedSize=function(e){return Ze.encodedSize(e.value)};function r1(n,e,t,r){return new T(y.tag,t,1)}function i1(n,e,t,r){return new T(y.tag,_t(n,e+1,r),2)}function o1(n,e,t,r){return new T(y.tag,Rt(n,e+1,r),3)}function s1(n,e,t,r){return new T(y.tag,Tt(n,e+1,r),5)}function a1(n,e,t,r){return new T(y.tag,Ct(n,e+1,r),9)}function Yc(n,e){Ze(n,y.tag.majorEncoded,e.value)}Yc.compareTokens=qt.compareTokens;Yc.encodedSize=function(e){return Ze.encodedSize(e.value)};var w6=20,b6=21,v6=22,E6=23;function c1(n,e,t,r){if(r.allowUndefined===!1)throw new Error(`${$} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new T(y.null,null,1):new T(y.undefined,void 0,1)}function l1(n,e,t,r){if(r.allowIndefinite===!1)throw new Error(`${$} indefinite length items not allowed`);return new T(y.break,void 0,1)}function gd(n,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(n))throw new Error(`${$} NaN values are not supported`);if(t.allowInfinity===!1&&(n===1/0||n===-1/0))throw new Error(`${$} Infinity values are not supported`)}return new T(y.float,n,e)}function u1(n,e,t,r){return gd(xd(n,e+1),3,r)}function p1(n,e,t,r){return gd(yd(n,e+1),5,r)}function d1(n,e,t,r){return gd(g1(n,e+1),9,r)}function Xc(n,e,t){let r=e.value;if(r===!1)n.push([y.float.majorEncoded|w6]);else if(r===!0)n.push([y.float.majorEncoded|b6]);else if(r===null)n.push([y.float.majorEncoded|v6]);else if(r===void 0)n.push([y.float.majorEncoded|E6]);else{let i,o=!1;(!t||t.float64!==!0)&&(h1(r),i=xd(sn,1),r===i||Number.isNaN(r)?(sn[0]=249,n.push(sn.slice(0,3)),o=!0):(m1(r),i=yd(sn,1),r===i&&(sn[0]=250,n.push(sn.slice(0,5)),o=!0))),o||(k6(r),i=g1(sn,1),sn[0]=251,n.push(sn.slice(0,9)))}}Xc.encodedSize=function(e,t){let r=e.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!t||t.float64!==!0){h1(r);let i=xd(sn,1);if(r===i||Number.isNaN(r))return 3;if(m1(r),i=yd(sn,1),r===i)return 5}return 9};var f1=new ArrayBuffer(9),Gt=new DataView(f1,1),sn=new Uint8Array(f1,0);function h1(n){if(n===1/0)Gt.setUint16(0,31744,!1);else if(n===-1/0)Gt.setUint16(0,64512,!1);else if(Number.isNaN(n))Gt.setUint16(0,32256,!1);else{Gt.setFloat32(0,n);let e=Gt.getUint32(0),t=(e&2139095040)>>23,r=e&8388607;if(t===255)Gt.setUint16(0,31744,!1);else if(t===0)Gt.setUint16(0,(n&2147483648)>>16|r>>13,!1);else{let i=t-127;i<-24?Gt.setUint16(0,0):i<-14?Gt.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):Gt.setUint16(0,(e&2147483648)>>16|i+15<<10|r>>13,!1)}}}function xd(n,e){if(n.length-e<2)throw new Error(`${$} not enough data for float16`);let t=(n[e]<<8)+n[e+1];if(t===31744)return 1/0;if(t===64512)return-1/0;if(t===32256)return NaN;let r=t>>10&31,i=t&1023,o;return r===0?o=i*2**-24:r!==31?o=(i+1024)*2**(r-25):o=i===0?1/0:NaN,t&32768?-o:o}function m1(n){Gt.setFloat32(0,n,!1)}function yd(n,e){if(n.length-e<4)throw new Error(`${$} not enough data for float32`);let t=(n.byteOffset||0)+e;return new DataView(n.buffer,t,4).getFloat32(0,!1)}function k6(n){Gt.setFloat64(0,n,!1)}function g1(n,e){if(n.length-e<8)throw new Error(`${$} not enough data for float64`);let t=(n.byteOffset||0)+e;return new DataView(n.buffer,t,8).getFloat64(0,!1)}Xc.compareTokens=qt.compareTokens;function de(n,e,t){throw new Error(`${$} encountered invalid minor (${t}) for major ${n[e]>>>5}`)}function Zc(n){return()=>{throw new Error(`${$} ${n}`)}}var O=[];for(let n=0;n<=23;n++)O[n]=de;O[24]=Bg;O[25]=Ig;O[26]=Sg;O[27]=_g;O[28]=de;O[29]=de;O[30]=de;O[31]=de;for(let n=32;n<=55;n++)O[n]=de;O[56]=Rg;O[57]=Tg;O[58]=Cg;O[59]=Ug;O[60]=de;O[61]=de;O[62]=de;O[63]=de;for(let n=64;n<=87;n++)O[n]=Lg;O[88]=Dg;O[89]=Pg;O[90]=Og;O[91]=Fg;O[92]=de;O[93]=de;O[94]=de;O[95]=Zc("indefinite length bytes/strings are not supported");for(let n=96;n<=119;n++)O[n]=Vg;O[120]=zg;O[121]=Mg;O[122]=jg;O[123]=Hg;O[124]=de;O[125]=de;O[126]=de;O[127]=Zc("indefinite length bytes/strings are not supported");for(let n=128;n<=151;n++)O[n]=Kg;O[152]=qg;O[153]=Gg;O[154]=Wg;O[155]=Yg;O[156]=de;O[157]=de;O[158]=de;O[159]=Xg;for(let n=160;n<=183;n++)O[n]=Zg;O[184]=Jg;O[185]=Qg;O[186]=e1;O[187]=t1;O[188]=de;O[189]=de;O[190]=de;O[191]=n1;for(let n=192;n<=215;n++)O[n]=r1;O[216]=i1;O[217]=o1;O[218]=s1;O[219]=a1;O[220]=de;O[221]=de;O[222]=de;O[223]=de;for(let n=224;n<=243;n++)O[n]=Zc("simple values are not supported");O[244]=de;O[245]=de;O[246]=de;O[247]=c1;O[248]=Zc("simple values are not supported");O[249]=u1;O[250]=p1;O[251]=d1;O[252]=de;O[253]=de;O[254]=de;O[255]=l1;var an=[];for(let n=0;n<24;n++)an[n]=new T(y.uint,n,1);for(let n=-1;n>=-24;n--)an[31-n]=new T(y.negint,n,1);an[64]=new T(y.bytes,new Uint8Array(0),1);an[96]=new T(y.string,"",1);an[128]=new T(y.array,0,1);an[160]=new T(y.map,0,1);an[244]=new T(y.false,!1,1);an[245]=new T(y.true,!0,1);an[246]=new T(y.null,null,1);function x1(n){switch(n.type){case y.false:return Sn([244]);case y.true:return Sn([245]);case y.null:return Sn([246]);case y.bytes:return n.value.length?void 0:Sn([64]);case y.string:return n.value===""?Sn([96]):void 0;case y.array:return n.value===0?Sn([128]):void 0;case y.map:return n.value===0?Sn([160]):void 0;case y.uint:return n.value<24?Sn([Number(n.value)]):void 0;case y.negint:if(n.value>=-24)return Sn([31-Number(n.value)])}}var B6={float64:!1,mapSorter:_6,quickEncodeToken:x1};function I6(){let n=[];return n[y.uint.major]=qt,n[y.negint.major]=Kc,n[y.bytes.major]=Eo,n[y.string.major]=$g,n[y.array.major]=Gc,n[y.map.major]=Wc,n[y.tag.major]=Yc,n[y.float.major]=Xc,n}var y1=I6(),wd=new Ss,Qc=class n{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(`${ir} object contains circular references`);return new n(t,e)}},$r={null:new T(y.null,null),undefined:new T(y.undefined,void 0),true:new T(y.true,!0),false:new T(y.false,!1),emptyArray:new T(y.array,0),emptyMap:new T(y.map,0)},Kr={number(n,e,t,r){return!Number.isInteger(n)||!Number.isSafeInteger(n)?new T(y.float,n):n>=0?new T(y.uint,n):new T(y.negint,n)},bigint(n,e,t,r){return n>=BigInt(0)?new T(y.uint,n):new T(y.negint,n)},Uint8Array(n,e,t,r){return new T(y.bytes,n)},string(n,e,t,r){return new T(y.string,n)},boolean(n,e,t,r){return n?$r.true:$r.false},null(n,e,t,r){return $r.null},undefined(n,e,t,r){return $r.undefined},ArrayBuffer(n,e,t,r){return new T(y.bytes,new Uint8Array(n))},DataView(n,e,t,r){return new T(y.bytes,new Uint8Array(n.buffer,n.byteOffset,n.byteLength))},Array(n,e,t,r){if(!n.length)return t.addBreakTokens===!0?[$r.emptyArray,new T(y.break)]:$r.emptyArray;r=Qc.createCheck(r,n);let i=[],o=0;for(let s of n)i[o++]=Jc(s,t,r);return t.addBreakTokens?[new T(y.array,n.length),i,new T(y.break)]:[new T(y.array,n.length),i]},Object(n,e,t,r){let i=e!=="Object",o=i?n.keys():Object.keys(n),s=i?n.size:o.length;if(!s)return t.addBreakTokens===!0?[$r.emptyMap,new T(y.break)]:$r.emptyMap;r=Qc.createCheck(r,n);let a=[],c=0;for(let u of o)a[c++]=[Jc(u,t,r),Jc(i?n.get(u):n[u],t,r)];return S6(a,t),t.addBreakTokens?[new T(y.map,s),a,new T(y.break)]:[new T(y.map,s),a]}};Kr.Map=Kr.Object;Kr.Buffer=Kr.Uint8Array;for(let n of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Kr[`${n}Array`]=Kr.DataView;function Jc(n,e={},t){let r=xg(n),i=e&&e.typeEncoders&&e.typeEncoders[r]||Kr[r];if(typeof i=="function"){let s=i(n,r,e,t);if(s!=null)return s}let o=Kr[r];if(!o)throw new Error(`${ir} unsupported type: ${r}`);return o(n,r,e,t)}function S6(n,e){e.mapSorter&&n.sort(e.mapSorter)}function _6(n,e){let t=Array.isArray(n[0])?n[0][0]:n[0],r=Array.isArray(e[0])?e[0][0]:e[0];if(t.type!==r.type)return t.type.compare(r.type);let i=t.type.major,o=y1[i].compareTokens(t,r);return o===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),o}function w1(n,e,t,r){if(Array.isArray(e))for(let i of e)w1(n,i,t,r);else t[e.type.major](n,e,r)}function bd(n,e,t){let r=Jc(n,t);if(!Array.isArray(r)&&t.quickEncodeToken){let i=t.quickEncodeToken(r);if(i)return i;let o=e[r.type.major];if(o.encodedSize){let s=o.encodedSize(r,t),a=new Ss(s);if(o(a,r,t),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return Is(a.chunks[0])}}return wd.reset(),w1(wd,r,e,t),wd.toBytes(!0)}function qr(n,e){return e=Object.assign({},B6,e),bd(n,y1,e)}var R6={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},vd=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=an[e];if(t===void 0){let r=O[e];if(!r)throw new Error(`${$} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let i=e&31;t=r(this.data,this._pos,i,this.options)}return this._pos+=t.encodedLength,t}},Cs=Symbol.for("DONE"),el=Symbol.for("BREAK");function T6(n,e,t){let r=[];for(let i=0;i<n.value;i++){let o=Ns(e,t);if(o===el){if(n.value===1/0)break;throw new Error(`${$} got unexpected break to lengthed array`)}if(o===Cs)throw new Error(`${$} found array but not enough entries (got ${i}, expected ${n.value})`);r[i]=o}return r}function C6(n,e,t){let r=t.useMaps===!0,i=r?void 0:{},o=r?new Map:void 0;for(let s=0;s<n.value;s++){let a=Ns(e,t);if(a===el){if(n.value===1/0)break;throw new Error(`${$} got unexpected break to lengthed map`)}if(a===Cs)throw new Error(`${$} found map but not enough entries (got ${s} [no key], expected ${n.value})`);if(r!==!0&&typeof a!="string")throw new Error(`${$} non-string keys not supported (got ${typeof a})`);if(t.rejectDuplicateMapKeys===!0&&(r&&o.has(a)||!r&&a in i))throw new Error(`${$} found repeat map key "${a}"`);let c=Ns(e,t);if(c===Cs)throw new Error(`${$} found map but not enough entries (got ${s} [no value], expected ${n.value})`);r?o.set(a,c):i[a]=c}return r?o:i}function Ns(n,e){if(n.done())return Cs;let t=n.next();if(t.type===y.break)return el;if(t.type.terminal)return t.value;if(t.type===y.array)return T6(t,n,e);if(t.type===y.map)return C6(t,n,e);if(t.type===y.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let r=Ns(n,e);return e.tags[t.value](r)}throw new Error(`${$} tag not supported (${t.value})`)}throw new Error("unsupported")}function Ed(n,e){if(!(n instanceof Uint8Array))throw new Error(`${$} data to decode must be a Uint8Array`);e=Object.assign({},R6,e);let t=e.tokenizer||new vd(n,e),r=Ns(t,e);if(r===Cs)throw new Error(`${$} did not find any content to decode`);if(r===el)throw new Error(`${$} got unexpected break`);return[r,n.subarray(t.pos())]}function Nt(n,e){let[t,r]=Ed(n,e);if(r.length>0)throw new Error(`${$} too many terminals, data makes no sense`);return t}var xt=ee(Te(),1);var b1=ae("ipns:utils"),v1=Y("/ipns/"),N6=114,E1=async(n,e)=>{if(e==null||n==null){let r=new Error("one or more of the provided parameters are not defined");throw b1.error(r),(0,xt.default)(r,dd)}let t;if(e.pubKey!=null){try{t=ud(e.pubKey)}catch(i){throw b1.error(i),i}if(!(await dm(e.pubKey)).equals(n))throw(0,xt.default)(new Error("Embedded public key did not match PeerID"),hg)}else n.publicKey!=null&&(t=ud(n.publicKey));if(t!=null)return t;throw(0,xt.default)(new Error("no public key is available"),dd)},k1=(n,e,t)=>{let r=Y(e);return Ee([n,t,r])},nl=n=>{let e=Y("ipns-signature:");return Ee([e,n])},sr=n=>"signatureV1"in n?Xe.encode({value:Y(n.value),signatureV1:n.signatureV1,validityType:n.validityType,validity:Y(n.validity),sequence:n.sequence,ttl:n.ttl,pubKey:n.pubKey,signatureV2:n.signatureV2,data:n.data}):Xe.encode({pubKey:n.pubKey,signatureV2:n.signatureV2,data:n.data});function lt(n){let e=Xe.decode(n);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,xt.default)(new Error("missing data or signatureV2"),rr);let t=B1(e.data),r=kd(t.Value),i=Q(t.Validity);if(e.value!=null&&e.signatureV1!=null)return U6(e),{value:r,validityType:Xe.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:r,validityType:Xe.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 Bo=n=>Ee([v1,n.toBytes()]),Io=n=>as(n.slice(v1.length)),A1=(n,e,t,r,i)=>{let o;if(e===Xe.ValidityType.EOL)o=0;else throw(0,xt.default)(new Error("Unknown validity type"),Bs);return qr({Value:n,Validity:t,ValidityType:o,Sequence:r,TTL:i})},B1=n=>{let e=Nt(n);if(e.ValidityType===0)e.ValidityType=Xe.ValidityType.EOL;else throw(0,xt.default)(new Error("Unknown validity type"),Bs);return Number.isInteger(e.Sequence)&&(e.Sequence=BigInt(e.Sequence)),Number.isInteger(e.TTL)&&(e.TTL=BigInt(e.TTL)),e},kd=n=>{if(n!=null){if(Uh(n))return`/ipns/${n.toCID().toString(Rr)}`;if(n instanceof Uint8Array){let r=Q(n);r.startsWith("/")&&(n=r)}let e=n.toString().trim();if(e.startsWith("/")&&e.length>1)return e;let t=V.asCID(n);if(t!=null)return t.code===N6?`/ipns/${t.toString(Rr)}`:`/ipfs/${t.toV1().toString()}`;try{return n instanceof Uint8Array?`/ipfs/${V.decode(n).toV1().toString()}`:`/ipfs/${V.parse(e).toV1().toString()}`}catch{}}throw(0,xt.default)(new Error("Value must be a valid content path starting with /"),fg)},U6=n=>{if(n.data==null)throw(0,xt.default)(new Error("Record data is missing"),dg);let e=B1(n.data);if(!fe(e.Value,n.value??new Uint8Array(0)))throw(0,xt.default)(new Error('Field "value" did not match between protobuf and CBOR'),rr);if(!fe(e.Validity,n.validity??new Uint8Array(0)))throw(0,xt.default)(new Error('Field "validity" did not match between protobuf and CBOR'),rr);if(e.ValidityType!==n.validityType)throw(0,xt.default)(new Error('Field "validityType" did not match between protobuf and CBOR'),rr);if(e.Sequence!==n.sequence)throw(0,xt.default)(new Error('Field "sequence" did not match between protobuf and CBOR'),rr);if(e.TTL!==n.ttl)throw(0,xt.default)(new Error('Field "ttl" did not match between protobuf and CBOR'),rr)};var L6=ae("ipns"),D6=mt.code,P6="/ipns/",MC=P6.length,S1={v1Compatible:!0};async function _1(n,e,t,r,i=S1){let o=new I1.default(Date.now()+Number(r)),s=Xe.ValidityType.EOL,[a,c]=r.toString().split("."),u=BigInt(a)*BigInt(1e5)+BigInt(c??"0");return O6(n,e,t,s,o.toString(),u,i)}var O6=async(n,e,t,r,i,o,s=S1)=>{t=BigInt(t);let a=Y(i),c=kd(e),u=Y(c);if(n.privateKey==null)throw(0,Ad.default)(new Error("Missing private key"),mg);let l=await cg(n.privateKey),p=A1(u,r,a,t,o),h=nl(p),d=await l.sign(h),f;if(n.publicKey!=null){let m=kt(n.toBytes());(m.code!==D6||!fe(n.publicKey,m.digest))&&(f=n.publicKey)}if(s.v1Compatible===!0){let m=await F6(l,u,r,a),g={value:c,signatureV1:m,validity:i,validityType:r,sequence:t,ttl:o,signatureV2:d,data:p};return f!=null&&(g.pubKey=f),g}else{let m={value:c,validity:i,validityType:r,sequence:t,ttl:o,signatureV2:d,data:p};return f!=null&&(m.pubKey=f),m}};var F6=async(n,e,t,r)=>{try{let i=k1(e,t,r);return await n.sign(i)}catch(i){throw L6.error("record signature creation failed",i),(0,Ad.default)(new Error("record signature creation failed"),pg)}};var Us=ee(Te(),1),R1=ee(jc(),1);var rl=ae("ipns:validator"),V6=1024*10,z6=async(n,e)=>{let t=lt(e),r;try{let i=nl(t.data);r=await n.verify(i,t.signatureV2)}catch{r=!1}if(!r)throw rl.error("record signature verification failed"),(0,Us.default)(new Error("record signature verification failed"),rr);if(t.validityType===Xe.ValidityType.EOL){if(R1.default.fromString(t.validity).toDate().getTime()<Date.now())throw rl.error("record has expired"),(0,Us.default)(new Error("record has expired"),ug)}else if(t.validityType!=null)throw rl.error("unrecognized validity type"),(0,Us.default)(new Error("unrecognized validity type"),Bs);rl("ipns record for %s is valid",t.value)};async function il(n,e){if(e.byteLength>V6)throw(0,Us.default)(new Error("record too large"),gg);let t=Io(n),r=lt(e),i=await E1(t,r);await z6(i,e)}async function*Ls(n){let e=/\r?\n/,t=new TextDecoder("utf8"),r="";for await(let i of n){typeof i=="string"&&(i=new TextEncoder().encode(i)),r+=t.decode(i,{stream:!0});let o=r.split(e);r=o.pop()??"";for(let s=0;s<o.length;s++)yield JSON.parse(o[s])}r+=t.decode(),r!==""&&(yield JSON.parse(r))}var Id=ee(C1(),1);var Ps=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Sd=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},N1=n=>globalThis.DOMException===void 0?new Sd(n):new DOMException(n),U1=n=>{let e=n.reason===void 0?N1("This operation was aborted."):n.reason;return e instanceof Error?e:N1(e)};function Os(n,e){let{milliseconds:t,fallback:r,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:h}=e;h.aborted&&l(U1(h)),h.addEventListener("abort",()=>{l(U1(h))})}if(t===Number.POSITIVE_INFINITY){n.then(u,l);return}let p=new Ps;s=o.setTimeout.call(void 0,()=>{if(r){try{u(r())}catch(h){l(h)}return}typeof n.cancel=="function"&&n.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 n)}catch(h){l(h)}})()}).finally(()=>{c.clear()});return c.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},c}function _d(n,e,t){let r=0,i=n.length;for(;i>0;){let o=Math.trunc(i/2),s=r+o;t(n[s],e)<=0?(r=++s,i-=o+1):i=o}return r}var Fs=class{#e=[];enqueue(e,t){t={priority:0,...t};let r={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(r);return}let i=_d(this.#e,r,(o,s)=>s.priority-o.priority);this.#e.splice(i,0,r)}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 yt=class extends Id.default{#e;#t;#n=0;#s;#c;#h=0;#i;#l;#r;#m;#o=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:Fs,...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.#s=e.intervalCap,this.#c=e.interval,this.#r=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.#n<this.#s}get#b(){return this.#o<this.#u}#v(){this.#o--,this.#p(),this.emit("next")}#E(){this.#y(),this.#x(),this.#l=void 0}get#k(){let e=Date.now();if(this.#i===void 0){let t=this.#h-e;if(t<0)this.#n=this.#e?this.#o:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#E()},t)),!0}return!1}#p(){if(this.#r.size===0)return this.#i&&clearInterval(this.#i),this.#i=void 0,this.emit("empty"),this.#o===0&&this.emit("idle"),!1;if(!this.#a){let e=!this.#k;if(this.#w&&this.#b){let t=this.#r.dequeue();return t?(this.emit("active"),t(),e&&this.#x(),!0):!1}}return!1}#x(){this.#t||this.#i!==void 0||(this.#i=setInterval(()=>{this.#y()},this.#c),this.#h=Date.now()+this.#c)}#y(){this.#n===0&&this.#o===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#n=this.#e?this.#o: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#A(e){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(e.reason)},{once:!0})})}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:this.#g,...t},new Promise((r,i)=>{this.#r.enqueue(async()=>{this.#o++,this.#n++;try{t.signal?.throwIfAborted();let o=e({signal:t.signal});t.timeout&&(o=Os(Promise.resolve(o),{milliseconds:t.timeout})),t.signal&&(o=Promise.race([o,this.#A(t.signal)]));let s=await o;r(s),this.emit("completed",s)}catch(o){if(o instanceof Ps&&!t.throwOnTimeout){r();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 r=>this.add(r,t)))}start(){return this.#a?(this.#a=!1,this.#d(),this):this}pause(){this.#a=!0}clear(){this.#r=new this.#m}async onEmpty(){this.#r.size!==0&&await this.#f("empty")}async onSizeLessThan(e){this.#r.size<e||await this.#f("next",()=>this.#r.size<e)}async onIdle(){this.#o===0&&this.#r.size===0||await this.#f("idle")}async#f(e,t){return new Promise(r=>{let i=()=>{t&&!t()||(this.off(e,i),r())};this.on(e,i)})}get size(){return this.#r.size}sizeBy(e){return this.#r.filter(e).length}get pending(){return this.#o}get isPaused(){return this.#a}};function H6(n){return n[Symbol.asyncIterator]!=null}function $6(n){if(H6(n))return(async()=>{for await(let e of n)return e})();for(let e of n)return e}var Ii=$6;var Rd=Y("/ipns/");function L1(n){return fe(n.subarray(0,Rd.byteLength),Rd)}var D1=n=>as(n.slice(Rd.length)),sl=class{client;constructor(e){this.client=e}async*findProviders(e,t={}){yield*Xt(this.client.getProviders(e,t),r=>({id:r.ID,multiaddrs:r.Addrs??[]}))}async provide(){}async put(e,t,r){if(!L1(e))return;let i=D1(e),o=lt(t);await this.client.putIPNS(i,o,r)}async get(e,t){if(!L1(e))throw new F("Not found","ERR_NOT_FOUND");let r=D1(e);try{let i=await this.client.getIPNS(r,t);return sr(i)}catch(i){throw i.code==="ERR_BAD_RESPONSE"?new F("Not found","ERR_NOT_FOUND"):i}}},al=class{client;constructor(e){this.client=e}async findPeer(e,t={}){let r=await Ii(this.client.getPeers(e,t));if(r!=null)return{id:r.ID,multiaddrs:r.Addrs??[]};throw new F("Not found","ERR_NOT_FOUND")}async*getClosestPeers(e,t={}){}};var wt=ae("delegated-routing-v1-http-api-client"),P1={concurrentRequests:4,timeout:3e4},cl=class{started;httpQueue;shutDownController;clientUrl;timeout;contentRouting;peerRouting;constructor(e,t={}){this.started=!1,this.shutDownController=new AbortController,wa(1/0,this.shutDownController.signal),this.httpQueue=new yt({concurrency:t.concurrentRequests??P1.concurrentRequests}),this.clientUrl=e instanceof URL?e:new URL(e),this.timeout=t.timeout??P1.timeout,this.contentRouting=new sl(this),this.peerRouting=new al(this)}get[es](){return this.contentRouting}get[ts](){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={}){wt("getProviders starts: %c",e);let r=ci([this.shutDownController.signal,t.signal,AbortSignal.timeout(this.timeout)]),i=De(),o=De();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:r});if(c.status===404)throw new F("No matching records found.","ERR_NOT_FOUND");if(c.status===422)throw new F("Request does not conform to schema or semantic constraints.","ERR_INVALID_REQUEST");if(c.body==null)throw new F("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 h=this.#e(p);h!=null&&(yield h)}}else for await(let l of Ls(Pa(c.body))){let p=this.#e(l);p!=null&&(yield p)}}catch(s){wt.error("getProviders errored:",s)}finally{r.clear(),o.resolve(),wt("getProviders finished: %c",e)}}async*getPeers(e,t={}){wt("getPeers starts: %c",e);let r=ci([this.shutDownController.signal,t.signal,AbortSignal.timeout(this.timeout)]),i=De(),o=De();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:r});if(c.status===404)throw new F("No matching records found.","ERR_NOT_FOUND");if(c.status===422)throw new F("Request does not conform to schema or semantic constraints.","ERR_INVALID_REQUEST");if(c.body==null)throw new F("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 h=this.#e(p);h!=null&&(yield h)}}else for await(let l of Ls(Pa(c.body))){let p=this.#e(l);p!=null&&(yield p)}}catch(s){wt.error("getPeers errored:",s)}finally{r.clear(),o.resolve(),wt("getPeers finished: %c",e)}}async getIPNS(e,t={}){wt("getIPNS starts: %c",e);let r=ci([this.shutDownController.signal,t.signal,AbortSignal.timeout(this.timeout)]),i=De(),o=De();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:r});if(wt("getIPNS GET %s %d",s,c.status),c.status===404)throw new F("No matching records found.","ERR_NOT_FOUND");if(c.status===422)throw new F("Request does not conform to schema or semantic constraints.","ERR_INVALID_REQUEST");if(c.body==null)throw new F("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 il(Bo(e),l),lt(l)}catch(a){throw wt.error("getIPNS GET %s error:",s,a),a}finally{r.clear(),o.resolve(),wt("getIPNS finished: %c",e)}}async putIPNS(e,t,r={}){wt("putIPNS starts: %c",e);let i=ci([this.shutDownController.signal,r.signal,AbortSignal.timeout(this.timeout)]),o=De(),s=De();this.httpQueue.add(async()=>(o.resolve(),s.promise));let a=`${this.clientUrl}routing/v1/ipns/${e.toCID().toString()}`;try{await o.promise;let c=sr(t),l=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/vnd.ipfs.ipns-record"},body:c,signal:i});if(wt("putIPNS PUT %s %d",a,l.status),l.status!==200)throw new F("PUT ipns response had status other than 200","ERR_BAD_RESPONSE")}catch(c){throw wt.error("putIPNS PUT %s error:",a,c.stack),c}finally{i.clear(),s.resolve(),wt("putIPNS finished: %c",e)}}#e(e){let t=[],r=e.Addrs?.map(Tp)??[];return e.Protocols!=null&&t.push(...e.Protocols),e.Protocol!=null&&(t.push(e.Protocol),delete e.Protocol),{...e,Schema:"peer",ID:Jt(e.ID),Addrs:r,Protocols:t}}};function O1(n,e={}){return new cl(new URL(n),e)}var F1=Y("/ipns/");function V1(n){return fe(n.subarray(0,F1.byteLength),F1)}var Td=class{client;constructor(e){this.client=O1(e)}async provide(e,t){}async*findProviders(e,t){yield*Xt(this.client.getProviders(e,t),r=>({id:r.ID,multiaddrs:r.Addrs,protocols:r.Protocols}))}async put(e,t,r){if(!V1(e))return;let i=Io(e),o=lt(t);await this.client.putIPNS(i,o,r)}async get(e,t){if(!V1(e))throw new F("Not found","ERR_NOT_FOUND");let r=Io(e);try{let i=await this.client.getIPNS(r,t);return sr(i)}catch(i){throw i.code==="ERR_BAD_RESPONSE"?new F("Not found","ERR_NOT_FOUND"):i}}async findPeer(e,t){let r=await Ii(this.client.getPeers(e,t));if(r!=null)return{id:r.ID,multiaddrs:r.Addrs??[]};throw new F("Not found","ERR_NOT_FOUND")}async*getClosestPeers(e,t){}};function Vs(n){return new Td(new URL(n))}var Cd=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 ll(n,e,t,r){let i=new Cd(r?.errorMessage,r?.errorCode);return t?.aborted===!0?Promise.reject(i):new Promise((o,s)=>{let a=u=>{r?.filter?.(u)!==!1&&(n.removeEventListener(e,a),t?.removeEventListener("abort",c),o(u))},c=()=>{n.removeEventListener(e,a),t?.removeEventListener("abort",c),s(i)};n.addEventListener(e,a),t?.addEventListener("abort",c)})}var ul=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 z1(n,e,t){if(e==null)return n;if(e.aborted)return Promise.reject(new ul(t?.errorMessage,t?.errorCode));let r,i=new ul(t?.errorMessage,t?.errorCode);try{return await Promise.race([n,new Promise((o,s)=>{r=()=>{s(i)},e.addEventListener("abort",r)})])}finally{r!=null&&e.removeEventListener("abort",r)}}var pl=class{deferred;signal;where;constructor(e,t){this.signal=t,this.deferred=De(),this.where=e,this.onAbort=this.onAbort.bind(this),this.signal?.addEventListener("abort",this.onAbort)}onAbort(){this.deferred.reject(new Ar)}cleanup(){this.signal?.removeEventListener("abort",this.onAbort)}};function K6(){return`${parseInt(String(Math.random()*1e9),10).toString()}${Date.now()}`}var dl=class{id;fn;options;priority;recipients;status;timeline;controller;constructor(e,t,r=0){this.id=K6(),this.status="queued",this.fn=e,this.priority=r,this.options=t,this.recipients=[],this.timeline={created:Date.now()},this.controller=new AbortController,wa(1/0,this.controller.signal),this.onAbort=this.onAbort.bind(this)}abort(e){this.controller.abort(e)}onAbort(){this.recipients.reduce((t,r)=>t&&r.signal?.aborted===!0,!0)&&this.controller.abort(new Ar)}async join(e={}){let t=new pl(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 z1(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 q6(n,e,t){let r=0,i=n.length;for(;i>0;){let o=Math.trunc(i/2),s=r+o;t(n[s],e)<=0?(r=++s,i-=o+1):i=o}return r}var zs=class extends ya{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=q6(this.queue,e,(r,i)=>i.priority-r.priority);this.queue.splice(t,0,e)}async add(e,t){t?.signal?.throwIfAborted();let r=new dl(e,t,t?.priority),i=r.join(t).then(o=>(this.safeDispatchEvent("completed",{detail:o}),o)).catch(o=>{throw this.safeDispatchEvent("error",{detail:o}),o});return this.enqueue(r),this.safeDispatchEvent("add"),this.tryToStartAnother(),i}clear(){this.queue.splice(0,this.queue.length)}abort(){this.queue.forEach(e=>{e.abort(new Ar)}),this.clear()}async onEmpty(e){this.size!==0&&await ll(this,"empty",e?.signal)}async onSizeLessThan(e,t){this.size<e||await ll(this,"next",t?.signal,{filter:()=>this.size<e})}async onIdle(e){this.pending===0&&this.size===0||await ll(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=bn({objectMode:!0}),r=c=>{c!=null?this.abort():this.clear(),t.end(c)},i=c=>{c.detail!=null&&t.push(c.detail)},o=c=>{r(c.detail)},s=()=>{r()},a=()=>{r(new F("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),r()}}};var $1="/pin/",M1="/pinned-block/",Nd=Rr,j1=1;function H1(n){return n.version===0&&(n=n.toV1()),new Me(`${$1}${n.toString(Nd)}`)}var fl=class{datastore;blockstore;dagWalkers;constructor(e,t,r){this.datastore=e,this.blockstore=t,this.dagWalkers=r}async*add(e,t={}){let r=H1(e);if(await this.datastore.has(r))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 zs({concurrency:j1});for await(let a of this.#e(e,o,{...t,depth:i}))await this.#t(a,c=>c.pinnedBy.find(u=>fe(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(r,qr(s),t)}async*#e(e,t,r){if(r.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,r);yield e;for await(let s of i.walk(o))yield*await t.add(async()=>this.#e(s,t,{...r,depth:r.depth-1}))}async#t(e,t,r){let i=new Me(`${M1}${Nd.encode(e.multihash.bytes)}`),o={pinCount:0,pinnedBy:[]};try{o=Nt(await this.datastore.get(i,r))}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,qr(o),r),r.onProgress?.(new P("helia:pin:add",e))}}async*rm(e,t={}){let r=H1(e),i=await this.datastore.get(r,t),o=Nt(i);await this.datastore.delete(r,t);let s=new zs({concurrency:j1});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=>fe(u,e.bytes)),!0),{...t,depth:o.depth}),yield a}async*ls(e={}){for await(let{key:t,value:r}of this.datastore.query({prefix:$1+(e.cid!=null?`${e.cid.toString(Rr)}`:"")},e)){let i=V.parse(t.toString().substring(5),Rr),o=Nt(r);yield{cid:i,...o}}}async isPinned(e,t={}){let r=new Me(`${M1}${Nd.encode(e.multihash.bytes)}`);return this.datastore.has(r,t)}};function Ud(n,e){let t={[Symbol.iterator]:()=>t,next:()=>{let r=n.next(),i=r.value;return r.done===!0||i==null?{done:!0,value:void 0}:{done:!1,value:e(i)}}};return t}var So=class n{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 Ud(this.set.entries(),e=>{let t=Jt(e[0]);return[t,t]})}forEach(e){this.set.forEach(t=>{let r=Jt(t);e(r,r,this)})}has(e){return this.set.has(e.toString())}values(){return Ud(this.set.values(),e=>Jt(e))}intersection(e){let t=new n;for(let r of e)this.has(r)&&t.add(r);return t}difference(e){let t=new n;for(let r of this)e.has(r)||t.add(r);return t}union(e){let t=new n;for(let r of e)t.add(r);for(let r of this)t.add(r);return t}};var hl=class{log;routers;constructor(e,t){this.log=e.logger.forComponent("helia:routing"),this.routers=t.routers??[]}async start(){await Br(...this.routers)}async stop(){await Ir(...this.routers)}async*findProviders(e,t={}){if(this.routers.length===0)throw new F("No content routers available","ERR_NO_ROUTERS_AVAILABLE");let r=new So;for await(let i of Nr(..._o(this.routers,"findProviders").map(o=>o.findProviders(e,t))))i!=null&&(r.has(i.id)||(r.add(i.id),yield i))}async provide(e,t={}){if(this.routers.length===0)throw new F("No content routers available","ERR_NO_ROUTERS_AVAILABLE");await Promise.all(_o(this.routers,"provide").map(async r=>{await r.provide(e,t)}))}async put(e,t,r){await Promise.all(_o(this.routers,"put").map(async i=>{await i.put(e,t,r)}))}async get(e,t){return Promise.any(_o(this.routers,"get").map(async r=>r.get(e,t)))}async findPeer(e,t){if(this.routers.length===0)throw new F("No peer routers available","ERR_NO_ROUTERS_AVAILABLE");let r=this,i=Nr(..._o(this.routers,"findPeer").map(o=>async function*(){try{yield await o.findPeer(e,t)}catch(s){r.log.error(s)}}()));for await(let o of i)if(o!=null)return o;throw new F("Could not find peer in routing","ERR_NOT_FOUND")}async*getClosestPeers(e,t={}){if(this.routers.length===0)throw new F("No peer routers available","ERR_NO_ROUTERS_AVAILABLE");let r=new So;for await(let i of Nr(..._o(this.routers,"getClosestPeers").map(o=>o.getClosestPeers(e,t))))i!=null&&(r.has(i.id)||(r.add(i.id),yield i))}};function _o(n,e){return n.filter(t=>t[e]!=null)}var Gr={},Ro=n=>{n.addEventListener("message",e=>{Ro.dispatchEvent("message",n,e)}),n.port!=null&&n.port.addEventListener("message",e=>{Ro.dispatchEvent("message",n,e)})};Ro.addEventListener=(n,e)=>{Gr[n]==null&&(Gr[n]=[]),Gr[n].push(e)};Ro.removeEventListener=(n,e)=>{Gr[n]!=null&&(Gr[n]=Gr[n].filter(t=>t===e))};Ro.dispatchEvent=function(n,e,t){Gr[n]!=null&&Gr[n].forEach(r=>r(e,t))};var Ld=Ro;var Dd="lock:worker:request-read",Pd="lock:worker:release-read",Od="lock:master:grant-read",Fd="lock:worker:request-write",Vd="lock:worker:release-write",zd="lock:master:grant-write";var K1=(n=21)=>Math.random().toString().substring(2);var q1=(n,e,t,r,i)=>(o,s)=>{if(s.data.type!==t)return;let a={type:s.data.type,name:s.data.name,identifier:s.data.identifier};n.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===r&&p.identifier===a.identifier&&(o.removeEventListener("message",u),c())};o.addEventListener("message",u)})}}}))},G1=(n,e,t,r)=>async()=>{let i=K1();return globalThis.postMessage({type:e,identifier:i,name:n}),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:r,identifier:i,name:n})}))};globalThis.addEventListener("message",s)})},G6={singleProcess:!1},W1=n=>{if(n=Object.assign({},G6,n),!!globalThis.document||n.singleProcess){let t=new EventTarget;return Ld.addEventListener("message",q1(t,"requestReadLock",Dd,Pd,Od)),Ld.addEventListener("message",q1(t,"requestWriteLock",Fd,Vd,zd)),t}return{isWorker:!0,readLock:t=>G1(t,Dd,Od,Pd),writeLock:t=>G1(t,Fd,zd,Vd)}};var Si={},Wr;async function Md(n,e){let t,r=new Promise(i=>{t=i});return n.add(async()=>Os((async()=>{await new Promise(i=>{t(()=>{i()})})})(),{milliseconds:e.timeout})),r}var W6=(n,e)=>{if(Wr.isWorker===!0)return{readLock:Wr.readLock(n,e),writeLock:Wr.writeLock(n,e)};let t=new yt({concurrency:1}),r;return{async readLock(){if(r!=null)return Md(r,e);r=new yt({concurrency:e.concurrency,autoStart:!1});let i=r,o=Md(r,e);return t.add(async()=>{i.start(),await i.onIdle().then(()=>{r===i&&(r=null)})}),o},async writeLock(){return r=null,Md(t,e)}}},Y6={name:"lock",concurrency:1/0,timeout:846e5,singleProcess:!1};function jd(n){let e=Object.assign({},Y6,n);return Wr==null&&(Wr=W1(e),Wr.isWorker!==!0&&(Wr.addEventListener("requestReadLock",t=>{Si[t.data.name]!=null&&Si[t.data.name].readLock().then(async r=>t.data.handler().finally(()=>{r()}))}),Wr.addEventListener("requestWriteLock",async t=>{Si[t.data.name]!=null&&Si[t.data.name].writeLock().then(async r=>t.data.handler().finally(()=>{r()}))}))),Si[e.name]==null&&(Si[e.name]=W6(e.name,e)),Si[e.name]}var ml=class{lock;child;pins;started;constructor(e,t,r={}){this.child=e,this.pins=t,this.lock=jd({singleProcess:r.holdGcLock}),this.started=!1}isStarted(){return this.started}async start(){await Br(this.child),this.started=!0}async stop(){await Ir(this.child),this.started=!1}unwrap(){return this.child}async put(e,t,r={}){let i=await this.lock.readLock();try{return await this.child.put(e,t,r)}finally{i()}}async*putMany(e,t={}){let r=await this.lock.readLock();try{yield*this.child.putMany(e,t)}finally{r()}}async get(e,t={}){let r=await this.lock.readLock();try{return await this.child.get(e,t)}finally{r()}}async*getMany(e,t={}){let r=await this.lock.readLock();try{yield*this.child.getMany(e,t)}finally{r()}}async delete(e,t={}){let r=await this.lock.writeLock();try{if(await this.pins.isPinned(e))throw new Error("CID was pinned");await this.child.delete(e,t)}finally{r()}}async*deleteMany(e,t={}){let r=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{r()}}async has(e,t={}){let r=await this.lock.readLock();try{return await this.child.has(e,t)}finally{r()}}async*getAll(e={}){let t=await this.lock.readLock();try{yield*this.child.getAll(e)}finally{t()}}};var Y1=42;function X6(n){if(n.asCID!==n&&n["/"]!==n.bytes)return null;let e=V.asCID(n);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new T(y.tag,Y1),new T(y.bytes,t)]}function Z6(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function J6(n){if(Number.isNaN(n))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(n===1/0||n===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var Hd={float64:!0,typeEncoders:{Object:X6,undefined:Z6,number:J6}},jU={...Hd,typeEncoders:{...Hd.typeEncoders}};function Q6(n){if(n[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return V.decode(n.subarray(1))}var gl={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};gl.tags[Y1]=Q6;var HU={...gl,tags:gl.tags.slice()};var Yr=113,X1=n=>qr(n,Hd),xl=n=>Nt(n,gl);var $d=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===y.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===y.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[y.uint.major](e,t){this.prefix(e);let r=String(t.value),i=[];for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);e.push(i)}[y.negint.major](e,t){this[y.uint.major](e,t)}[y.bytes.major](e,t){throw new Error(`${ir} unsupported type: Uint8Array`)}[y.string.major](e,t){this.prefix(e);let r=$c(JSON.stringify(t.value));e.push(r.length>32?Is(r):r)}[y.array.major](e,t){this.prefix(e),this.inRecursive.push({type:y.array,elements:0}),e.push([91])}[y.map.major](e,t){this.prefix(e),this.inRecursive.push({type:y.map,elements:0}),e.push([123])}[y.tag.major](e,t){}[y.float.major](e,t){if(t.type.name==="break"){let s=this.inRecursive.pop();if(s){if(s.type===y.array)e.push([93]);else if(s.type===y.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(`${ir} 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 r=String(t.value),i=[],o=!1;for(let s=0;s<r.length;s++)i[s]=r.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 e4(n,e){if(Array.isArray(n[0])||Array.isArray(e[0]))throw new Error(`${ir} complex map keys are not supported`);let t=n[0],r=e[0];if(t.type!==y.string||r.type!==y.string)throw new Error(`${ir} non-string map keys are not supported`);if(t<r)return-1;if(t>r)return 1;throw new Error(`${ir} unexpected duplicate map keys, this is not supported`)}var t4={addBreakTokens:!0,mapSorter:e4};function Kd(n,e){return e=Object.assign({},t4,e),bd(n,new $d,e)}var Xr=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(`${$} 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(`${$} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,r=!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++,r=!0;else return new T(y.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(`${$} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(r)throw new Error(`${$} unexpected token at position ${this._pos}`);r=!0,this._pos++,i([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(r=!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 r?new T(y.float,s,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(s)?new T(s>=0?y.uint:y.negint,s,this._pos-e):new T(s>=0?y.uint:y.negint,BigInt(o),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${$} 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 T(y.string,c,s)}}let e=this._pos,t=[],r=()=>{if(this._pos+4>=this.data.length)throw new Error(`${$} 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(`${$} 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(`${$} 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(`${$} 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(r());break;default:throw new Error(`${$} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new T(y.string,hd(t),this._pos-e);default:if(o<32)throw new Error(`${$} invalid control character at position ${this._pos}`);o<128?(t.push(o),this._pos++):i()}}throw new Error(`${$} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new T(y.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new T(y.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new T(y.null,null,4);case 102:return this.expect([102,97,108,115,101]),new T(y.false,!1,5);case 116:return this.expect([116,114,117,101]),new T(y.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(`${$} 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 T(y.break,void 0,1);if(this.ch()!==44)throw new Error(`${$} 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 T(y.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 T(y.break,void 0,1);if(this.ch()!==44)throw new Error(`${$} 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 T(y.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${$} 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(`${$} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function Ms(n,e){return e=Object.assign({tokenizer:new Xr(n,e)},e),Nt(n,e)}function n4(n){if(n.asCID!==n&&n["/"]!==n.bytes)return null;let e=V.asCID(n);if(!e)return null;let t=e.toString();return[new T(y.map,1/0,1),new T(y.string,"/",1),new T(y.string,t,t.length),new T(y.break,void 0,1)]}function wl(n){let e=wn.encode(n).slice(1);return[new T(y.map,1/0,1),new T(y.string,"/",1),new T(y.map,1/0,1),new T(y.string,"bytes",5),new T(y.string,e,e.length),new T(y.break,void 0,1),new T(y.break,void 0,1)]}function cn(n){return wl(new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}function r4(n){return wl(new Uint8Array(n))}function i4(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function o4(n){if(Number.isNaN(n))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(n===1/0||n===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var s4={typeEncoders:{Object:n4,Buffer:wl,Uint8Array:wl,Int8Array:cn,Uint16Array:cn,Int16Array:cn,Uint32Array:cn,Int32Array:cn,Float32Array:cn,Float64Array:cn,Uint8ClampedArray:cn,BigInt64Array:cn,BigUint64Array:cn,DataView:cn,ArrayBuffer:r4,undefined:i4,number:o4}},qd=class extends Xr{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===y.map){let t=this._next();if(t.type===y.string&&t.value==="/"){let r=this._next();if(r.type===y.string){if(this._next().type!==y.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(r),new T(y.tag,42,0)}if(r.type===y.map){let i=this._next();if(i.type===y.string&&i.value==="bytes"){let o=this._next();if(o.type===y.string){for(let a=0;a<2;a++)if(this._next().type!==y.break)throw new Error("Invalid encoded Bytes form");let s=wn.decode(`m${o.value}`);return new T(y.bytes,s,o.value.length)}this.tokenBuffer.push(o)}this.tokenBuffer.push(i)}this.tokenBuffer.push(r)}this.tokenBuffer.push(t)}return e}},Gd={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Gd.tags[42]=V.parse;var Zr=297,J1=n=>Kd(n,s4),bl=n=>{let e=Object.assign(Gd,{tokenizer:new qd(n,Gd)});return Ms(n,e)};var sL=new TextDecoder;var aL=new TextEncoder;var Oe={};Be(Oe,{code:()=>Ce,createLink:()=>cx,createNode:()=>ax,decode:()=>ke,encode:()=>ue,name:()=>x4,prepare:()=>_e,validate:()=>Xd});var a4=new TextDecoder;function Wd(n,e){let t=0;for(let r=0;;r+=7){if(r>=64)throw new Error("protobuf: varint overflow");if(e>=n.length)throw new Error("protobuf: unexpected end of data");let i=n[e++];if(t+=r<28?(i&127)<<r:(i&127)*2**r,i<128)break}return[t,e]}function El(n,e){let t;[t,e]=Wd(n,e);let r=e+t;if(t<0||r<0)throw new Error("protobuf: invalid length");if(r>n.length)throw new Error("protobuf: unexpected end of data");return[n.subarray(e,r),r]}function Q1(n,e){let t;return[t,e]=Wd(n,e),[t&7,t>>3,e]}function c4(n){let e={},t=n.length,r=0;for(;r<t;){let i,o;if([i,o,r]=Q1(n,r),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,r]=El(n,r)}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,r]=El(n,r),e.Name=a4.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,r]=Wd(n,r)}else throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${o}`)}if(r>t)throw new Error("protobuf: (PBLink) unexpected end of data");return e}function ex(n){let e=n.length,t=0,r,i=!1,o;for(;t<e;){let a,c;if([a,c,t]=Q1(n,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]=El(n,t),r&&(i=!0)}else if(c===2){if(i)throw new Error("protobuf: (PBNode) duplicate Links section");r||(r=[]);let u;[u,t]=El(n,t),r.push(c4(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=r||[],s}var nx=new TextEncoder,tx=2**32,l4=2**31;function u4(n,e){let t=e.length;if(typeof n.Tsize=="number"){if(n.Tsize<0)throw new Error("Tsize cannot be negative");if(!Number.isSafeInteger(n.Tsize))throw new Error("Tsize too large for encoding");t=js(e,t,n.Tsize)-1,e[t]=24}if(typeof n.Name=="string"){let r=nx.encode(n.Name);t-=r.length,e.set(r,t),t=js(e,t,r.length)-1,e[t]=18}return n.Hash&&(t-=n.Hash.length,e.set(n.Hash,t),t=js(e,t,n.Hash.length)-1,e[t]=10),e.length-t}function rx(n){let e=d4(n),t=new Uint8Array(e),r=e;if(n.Data&&(r-=n.Data.length,t.set(n.Data,r),r=js(t,r,n.Data.length)-1,t[r]=10),n.Links)for(let i=n.Links.length-1;i>=0;i--){let o=u4(n.Links[i],t.subarray(0,r));r-=o,r=js(t,r,o)-1,t[r]=18}return t}function p4(n){let e=0;if(n.Hash){let t=n.Hash.length;e+=1+t+To(t)}if(typeof n.Name=="string"){let t=nx.encode(n.Name).length;e+=1+t+To(t)}return typeof n.Tsize=="number"&&(e+=1+To(n.Tsize)),e}function d4(n){let e=0;if(n.Data){let t=n.Data.length;e+=1+t+To(t)}if(n.Links)for(let t of n.Links){let r=p4(t);e+=1+r+To(r)}return e}function js(n,e,t){e-=To(t);let r=e;for(;t>=l4;)n[e++]=t&127|128,t/=128;for(;t>=128;)n[e++]=t&127|128,t>>>=7;return n[e]=t,r}function To(n){return n%2===0&&n++,Math.floor((f4(n)+6)/7)}function f4(n){let e=0;return n>=tx&&(n=Math.floor(n/tx),e=32),n>=65536&&(n>>>=16,e+=16),n>=256&&(n>>>=8,e+=8),e+h4[n]}var h4=[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 m4=["Data","Links"],g4=["Hash","Name","Tsize"],Yd=new TextEncoder;function ox(n,e){if(n===e)return 0;let t=n.Name?Yd.encode(n.Name):[],r=e.Name?Yd.encode(e.Name):[],i=t.length,o=r.length;for(let s=0,a=Math.min(i,o);s<a;++s)if(t[s]!==r[s]){i=t[s],o=r[s];break}return i<o?-1:o<i?1:0}function ix(n,e){return!Object.keys(n).some(t=>!e.includes(t))}function sx(n){if(typeof n.asCID=="object"){let t=V.asCID(n);if(!t)throw new TypeError("Invalid DAG-PB form");return{Hash:t}}if(typeof n!="object"||Array.isArray(n))throw new TypeError("Invalid DAG-PB form");let e={};if(n.Hash){let t=V.asCID(n.Hash);try{t||(typeof n.Hash=="string"?t=V.parse(n.Hash):n.Hash instanceof Uint8Array&&(t=V.decode(n.Hash)))}catch(r){throw new TypeError(`Invalid DAG-PB form: ${r.message}`)}t&&(e.Hash=t)}if(!e.Hash)throw new TypeError("Invalid DAG-PB form");return typeof n.Name=="string"&&(e.Name=n.Name),typeof n.Tsize=="number"&&(e.Tsize=n.Tsize),e}function _e(n){if((n instanceof Uint8Array||typeof n=="string")&&(n={Data:n}),typeof n!="object"||Array.isArray(n))throw new TypeError("Invalid DAG-PB form");let e={};if(n.Data!==void 0)if(typeof n.Data=="string")e.Data=Yd.encode(n.Data);else if(n.Data instanceof Uint8Array)e.Data=n.Data;else throw new TypeError("Invalid DAG-PB form");if(n.Links!==void 0)if(Array.isArray(n.Links))e.Links=n.Links.map(sx),e.Links.sort(ox);else throw new TypeError("Invalid DAG-PB form");else e.Links=[];return e}function Xd(n){if(!n||typeof n!="object"||Array.isArray(n)||n instanceof Uint8Array||n["/"]&&n["/"]===n.bytes)throw new TypeError("Invalid DAG-PB form");if(!ix(n,m4))throw new TypeError("Invalid DAG-PB form (extraneous properties)");if(n.Data!==void 0&&!(n.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be bytes)");if(!Array.isArray(n.Links))throw new TypeError("Invalid DAG-PB form (Links must be a list)");for(let e=0;e<n.Links.length;e++){let t=n.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(!ix(t,g4))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&&ox(t,n.Links[e-1])===-1)throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}function ax(n,e=[]){return _e({Data:n,Links:e})}function cx(n,e,t){return sx({Hash:t,Name:n,Tsize:e})}var x4="dag-pb",Ce=112;function ue(n){Xd(n);let e={};return n.Links&&(e.Links=n.Links.map(t=>{let r={};return t.Hash&&(r.Hash=t.Hash.bytes),t.Name!==void 0&&(r.Name=t.Name),t.Tsize!==void 0&&(r.Tsize=t.Tsize),r})),n.Data&&(e.Data=n.Data),rx(e)}function ke(n){let e=ex(n),t={};return e.Data&&(t.Data=e.Data),e.Links&&(t.Links=e.Links.map(r=>{let i={};try{i.Hash=V.decode(r.Hash)}catch{}if(!i.Hash)throw new Error("Invalid Hash field found in link, expected CID");return r.Name!==void 0&&(i.Name=r.Name),r.Tsize!==void 0&&(i.Tsize=r.Tsize),i})),t}var y4={codec:Ce,*walk(n){yield*ke(n).Links.map(t=>t.Hash)}},w4={codec:Le,*walk(){}},lx=42,b4={codec:Yr,*walk(n){let e=[],t=[];t[lx]=r=>{if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");let i=V.decode(r.subarray(1));return e.push(i),i},Nt(n,{tags:t}),yield*e}},Zd=class extends Xr{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===y.map){let t=this._next();if(t.type===y.string&&t.value==="/"){let r=this._next();if(r.type===y.string){if(this._next().type!==y.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(r),new T(y.tag,42,0)}if(r.type===y.map){let i=this._next();if(i.type===y.string&&i.value==="bytes"){let o=this._next();if(o.type===y.string){for(let a=0;a<2;a++)if(this._next().type!==y.break)throw new Error("Invalid encoded Bytes form");let s=wn.decode(`m${o.value}`);return new T(y.bytes,s,o.value.length)}this.tokenBuffer.push(o)}this.tokenBuffer.push(i)}this.tokenBuffer.push(r)}this.tokenBuffer.push(t)}return e}},v4={codec:Zr,*walk(n){let e=[],t=[];t[lx]=r=>{let i=V.parse(r);return e.push(i),i},Ms(n,{tags:t,tokenizer:new Zd(n,{tags:t,allowIndefinite:!0,allowUndefined:!0,allowNaN:!0,allowInfinity:!0,allowBigInt:!0,strict:!1,rejectDuplicateMapKeys:!1})}),yield*e}},E4={codec:Tr,*walk(){}};function ux(n=[]){let e={};return[y4,w4,b4,v4,E4,...n].forEach(t=>{e[t.codec]=t}),e}var Jd=new Me("/version"),px=1;async function dx(n){if(!await n.has(Jd)){await n.put(Jd,Y(`${px}`));return}let e=await n.get(Jd),t=Q(e);if(parseInt(t,10)!==px)throw new Error("Unknown datastore version, a datastore migration may be required")}function fx(n=[]){let e={};return[re,Pu,mt,...n].forEach(t=>{e[t.code]=t}),e}function k4(n){return n[Symbol.asyncIterator]!=null}function A4(n,e){if(k4(n))return async function*(){for await(let a of n)await e(a)&&(yield a)}();let t=zi(n),{value:r,done:i}=t.next();if(i===!0)return function*(){}();let o=e(r);if(typeof o.then=="function")return async function*(){await o&&(yield r);for await(let a of t)await e(a)&&(yield a)}();let s=e;return function*(){o===!0&&(yield r);for(let a of t)s(a)&&(yield a)}()}var Ut=A4;function B4(n){return typeof n.retrieve=="function"}function I4(n){return typeof n.announce=="function"}var kl=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(B4),this.blockAnnouncers=(e.blockBrokers??[]).filter(I4),this.hashers=e.hashers??{},this.started=!1}isStarted(){return this.started}async start(){await Br(this.child,...new Set([...this.blockRetrievers,...this.blockAnnouncers])),this.started=!0}async stop(){await Ir(this.child,...new Set([...this.blockRetrievers,...this.blockAnnouncers])),this.started=!1}unwrap(){return this.child}async put(e,t,r={}){return await this.child.has(e)?(r.onProgress?.(new P("blocks:put:duplicate",e)),e):(r.onProgress?.(new P("blocks:put:providers:notify",e)),this.blockAnnouncers.forEach(i=>{i.announce(e,t,r)}),r.onProgress?.(new P("blocks:put:blockstore:put",e)),this.child.put(e,t,r))}async*putMany(e,t={}){let r=Ut(e,async({cid:o})=>{let s=await this.child.has(o);return s&&t.onProgress?.(new P("blocks:put-many:duplicate",o)),!s}),i=vu(r,({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 r=await hx(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,r,t),t.onProgress?.(new P("blocks:get:providers:notify",e)),this.blockAnnouncers.forEach(i=>{i.announce(e,r,t)}),r}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(vu(e,async r=>{if(t.offline!==!0&&!await this.child.has(r)){t.onProgress?.(new P("blocks:get-many:providers:get",r));let i=await hx(r,this.blockRetrievers,this.hashers[r.multihash.code],{...t,log:this.log});t.onProgress?.(new P("blocks:get-many:blockstore:put",r)),await this.child.put(r,i,t),t.onProgress?.(new P("blocks:get-many:providers:notify",r)),this.blockAnnouncers.forEach(o=>{o.announce(r,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 r of e)yield r}(),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)}},S4=(n,e)=>{if(e==null)throw new F(`No hasher configured for multihash code 0x${n.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 r=await e.digest(t);if(!fe(r.digest,n.multihash.digest))throw new F("Hash of downloaded block did not match multihash from passed CID","ERR_HASH_MISMATCH")}};async function hx(n,e,t,r){let i=S4(n,t),o=new AbortController,s=ci([o.signal,r.signal]);try{return await Promise.any(e.map(async a=>{try{let c=!1,u=await a.retrieve(n,{...r,signal:s,validateFn:async l=>{await i(l),c=!0}});return c||await i(u),u}catch(c){throw r.log.error("could not retrieve verified block for %c",n,c),c}}))}finally{s.clear()}}var Al=class{blockstore;datastore;pins;logger;routing;dagWalkers;hashers;log;constructor(e){this.logger=e.logger??Mh(),this.log=this.logger.forComponent("helia"),this.hashers=fx(e.hashers),this.dagWalkers=ux(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 r=new kl(t);this.pins=new fl(e.datastore,r,this.dagWalkers),this.blockstore=new ml(r,this.pins,{holdGcLock:e.holdGcLock??!0}),this.datastore=e.datastore,this.routing=new hl(t,{routers:(e.routers??[]).flatMap(i=>{let o=[i];return i[es]!=null&&o.push(i[es]),i[ts]!=null&&o.push(i[ts]),o})})}async start(){await dx(this.datastore),await Br(this.blockstore,this.datastore,this.routing)}async stop(){await Ir(this.blockstore,this.datastore,this.routing)}async gc(e={}){let t=await this.blockstore.lock.writeLock();try{let r=this,i=this.blockstore.unwrap();this.log("gc start"),await mi(i.deleteMany(async function*(){for await(let{cid:o}of i.getAll())try{if(await r.pins.isPinned(o,e))continue;yield o,e.onProgress?.(new P("helia:gc:deleted",o))}catch(s){r.log.error("Error during gc",s),e.onProgress?.(new P("helia:gc:error",s))}}()))}finally{t()}this.log("gc finished")}};var Co={};Be(Co,{abortedError:()=>N4,closeFailedError:()=>R4,deleteFailedError:()=>gx,getFailedError:()=>T4,hasFailedError:()=>C4,notFoundError:()=>Hs,openFailedError:()=>_4,putFailedError:()=>mx});var ar=ee(Te(),1);function _4(n){return n=n??new Error("Open failed"),(0,ar.default)(n,"ERR_OPEN_FAILED")}function R4(n){return n=n??new Error("Close failed"),(0,ar.default)(n,"ERR_CLOSE_FAILED")}function mx(n){return n=n??new Error("Put failed"),(0,ar.default)(n,"ERR_PUT_FAILED")}function T4(n){return n=n??new Error("Get failed"),(0,ar.default)(n,"ERR_GET_FAILED")}function gx(n){return n=n??new Error("Delete failed"),(0,ar.default)(n,"ERR_DELETE_FAILED")}function C4(n){return n=n??new Error("Has failed"),(0,ar.default)(n,"ERR_HAS_FAILED")}function Hs(n){return n=n??new Error("Not Found"),(0,ar.default)(n,"ERR_NOT_FOUND")}function N4(n){return n=n??new Error("Aborted"),(0,ar.default)(n,"ERR_ABORTED")}var _i=class{has(e,t){return Promise.reject(new Error(".has is not implemented"))}put(e,t,r){return Promise.reject(new Error(".put is not implemented"))}async*putMany(e,t){for await(let{cid:r,block:i}of e)await this.put(r,i,t),yield r}get(e,t){return Promise.reject(new Error(".get is not implemented"))}async*getMany(e,t){for await(let r of e)yield{cid:r,block:await this.get(r,t)}}async delete(e,t){await Promise.reject(new Error(".delete is not implemented"))}async*deleteMany(e,t){for await(let r of e)await this.delete(r,t),yield r}async*getAll(e){throw new Error(".getAll is not implemented")}};var $s=class extends _i{data;constructor(){super(),this.data=new Map}put(e,t){return this.data.set(We.encode(e.multihash.bytes),t),e}get(e){let t=this.data.get(We.encode(e.multihash.bytes));if(t==null)throw Hs();return t}has(e){return this.data.has(We.encode(e.multihash.bytes))}async delete(e){this.data.delete(We.encode(e.multihash.bytes))}async*getAll(){for(let[e,t]of this.data.entries())yield{cid:V.createV1(Le,kt(We.decode(e))),block:t}}};var aD=ae("blockstore:core:tiered");var pD={...Co};var xx=ee(Te(),1);function Bl(n){return n=n??new Error("Not Found"),(0,xx.default)(n,"ERR_NOT_FOUND")}var yx="SHARDING";function L4(n){return n[Symbol.asyncIterator]!=null}function D4(n){if(L4(n))return(async()=>{let t=[];for await(let r of n)t.push(r);return t})();let e=[];for(let t of n)e.push(t);return e}var Il=D4;function P4(n){return n[Symbol.asyncIterator]!=null}function O4(n,e){return P4(n)?async function*(){yield*(await Il(n)).sort(e)}():function*(){yield*Il(n).sort(e)}()}var Sl=O4;var cr=class{put(e,t,r){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:r,value:i}of e)await this.put(r,i,t),yield r}async*getMany(e,t={}){for await(let r of e)yield{key:r,value:await this.get(r,t)}}async*deleteMany(e,t={}){for await(let r of e)await this.delete(r,t),yield r}batch(){let e=[],t=[];return{put(r,i){e.push({key:r,value:i})},delete(r){t.push(r)},commit:async r=>{await mi(this.putMany(e,r)),e=[],await mi(this.deleteMany(t,r)),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 r=this._all(e,t);if(e.prefix!=null){let i=e.prefix;r=Ut(r,o=>o.key.toString().startsWith(i))}if(Array.isArray(e.filters)&&(r=e.filters.reduce((i,o)=>Ut(i,o),r)),Array.isArray(e.orders)&&(r=e.orders.reduce((i,o)=>Sl(i,o),r)),e.offset!=null){let i=0,o=e.offset;r=Ut(r,()=>i++>=o)}return e.limit!=null&&(r=Ra(r,e.limit)),r}queryKeys(e,t){let r=this._allKeys(e,t);if(e.prefix!=null){let i=e.prefix;r=Ut(r,o=>o.toString().startsWith(i))}if(Array.isArray(e.filters)&&(r=e.filters.reduce((i,o)=>Ut(i,o),r)),Array.isArray(e.orders)&&(r=e.orders.reduce((i,o)=>Sl(i,o),r)),e.offset!=null){let i=e.offset,o=0;r=Ut(r,()=>o++>=i)}return e.limit!=null&&(r=Ra(r,e.limit)),r}};var qs=class extends cr{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 Bl();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 Me(e),value:t}}*_allKeys(){for(let e of this.data.keys())yield new Me(e)}};var VD=new Me(yx);var ZD=ae("datastore:core:tiered");async function bx(n={}){let e=n.datastore??new qs,t=n.blockstore??new $s,r=new Al({...n,datastore:e,blockstore:t,blockBrokers:n.blockBrokers??[os()],routers:n.routers??[Vs("https://delegated-ipfs.dev")]});return n.start!==!1&&await r.start(),r}var Qd=class{components;constructor(e){this.components=e}async add(e,t={}){let r=X1(e),i=await(t.hasher??re).digest(r),o=V.createV1(Yr,i);return await this.components.blockstore.put(o,r,t),o}async get(e,t={}){let r=await this.components.blockstore.get(e,t);return xl(r)}};function vx(n){return new Qd(n)}var ef=class{components;constructor(e){this.components=e}async add(e,t={}){let r=J1(e),i=await(t.hasher??re).digest(r),o=V.createV1(Zr,i);return await this.components.blockstore.put(o,r,t),o}async get(e,t={}){let r=await this.components.blockstore.get(e,t);return bl(r)}};function Ex(n){return new ef(n)}var tf=ee(jc(),1);function kx(n,e){let t=e.map((r,i)=>({record:lt(r),index:i}));return t.sort((r,i)=>{let o=r.record.sequence,s=i.record.sequence;if(o>s)return-1;if(o<s)return 1;if(r.record.validityType===Xe.ValidityType.EOL&&i.record.validityType===Xe.ValidityType.EOL){let a=tf.default.fromString(r.record.validity).toDate(),c=tf.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 z4=n=>{let e=n.data;return e.startsWith('"')&&(e=e.substring(1)),e.endsWith('"')&&(e=e.substring(0,e.length-1)),e.replace("dnslink=","")},nf=(n,e)=>{let t=M4(n,e);return{ipfsPath:z4(t),answer:t}},M4=(n,e)=>{let t=e.Answer?.filter(r=>r.data.includes("dnslink=/ipfs")||r.data.includes("dnslink=/ipns")).pop();if(t==null)throw new F(`No dnslink records found for domain: ${n}`,"ERR_DNSLINK_NOT_FOUND");return t},Gs=32,No=async(n,e,t,r={})=>{if(e===0)throw new Error("recursion limit exceeded");let i;try{i=await t(n,r)}catch(a){if(a.code!=="ENOTFOUND"&&a.code!=="ERR_DNSLINK_NOT_FOUND"&&a.code!=="ENODATA")throw a;n.startsWith("_dnslink.")?n=n.replace("_dnslink.",""):n=`_dnslink.${n}`,i=await t(n,r)}let o=i.replace("dnslink=",""),s=o.split("/")[2];try{return V.parse(s),o}catch{}return No(s,e-1,t,r)},j4=/^dnslink=.+$/,Ax=async(n,e)=>{let i=(await n.resolveTxt(e)).flat().filter(o=>j4.test(o))[0];if(i==null)throw new F(`No dnslink records found for domain: ${e}`,"ERR_DNSLINK_NOT_FOUND");return i};var of=ee(Vu(),1),sf=ee(Sx(),1);function _l(n,e,t){return`${n}?name=${e}&type=${t}`}async function _x(n,e){return await(await fetch(n,{headers:new Headers({accept:"application/dns-json"}),signal:e})).json()}function Ri(n,e){return`${e}_${n}`}var rf=Object.assign((0,of.default)("dns-over-http-resolver"),{error:(0,of.default)("dns-over-http-resolver:error")}),af=class{_cache;_TXTcache;_servers;_request;_abortControllers;constructor(e={}){this._cache=new sf.default({max:e?.maxCache??100}),this._TXTcache=new sf.default({max:e?.maxCache??100}),this._servers=["https://cloudflare-dns.com/dns-query","https://dns.google/resolve"],this._request=e.request??_x,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 r=Math.floor(Math.random()*t),i=e[t];e[t]=e[r],e[r]=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",r=this._cache.get(Ri(e,t));if(r!=null)return r;let i=!1;for(let o of this._getShuffledServers()){let s=new AbortController;this._abortControllers.push(s);try{let a=await this._request(_l(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(Ri(e,t),c,{ttl:u}),c}catch{s.signal.aborted&&(i=!0),rf.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",r=this._cache.get(Ri(e,t));if(r!=null)return r;let i=!1;for(let o of this._getShuffledServers()){let s=new AbortController;this._abortControllers.push(s);try{let a=await this._request(_l(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(Ri(e,t),c,{ttl:u}),c}catch{s.signal.aborted&&(i=!0),rf.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",r=this._TXTcache.get(Ri(e,t));if(r!=null)return r;let i=!1;for(let o of this._getShuffledServers()){let s=new AbortController;this._abortControllers.push(s);try{let a=await this._request(_l(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(Ri(e,t),c,{ttl:u}),c}catch{s.signal.aborted&&(i=!0),rf.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()}},Rx=af;var Cx=ee(cf(),1),Qr=class{lru;constructor(e){this.lru=(0,Cx.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,r){this.lru.set(e,{value:t,expire:Date.now()+r})}has(e){return this.get(e)!=null}remove(e){this.lru.remove(e)}clear(){this.lru.clear()}};var lf=new Qr(1e3),G4=60*1e3,W4=new yt({concurrency:4}),Y4=async function(e,t={}){let r=new Rx({maxCache:0});if(t.nocache!==!0&&lf.has(e)){let o=lf.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 W4.add(async()=>{let o=await Ax(r,e);return t.onProgress?.(new P("dnslink:answer",{detail:o})),lf.set(e,o,G4),o},{signal:t?.signal});if(i==null)throw new Error("No DNS response received");return i},Nx=Y4;function Ux(){return async(n,e={})=>No(n,Gs,Nx,e)}var uf=class{routing;constructor(e){this.routing=e}async put(e,t,r={}){try{await this.routing.put(e,t,r)}catch(i){r.onProgress?.(new P("ipns:routing:helia:error",i))}}async get(e,t={}){try{return await this.routing.get(e,t)}catch(r){t.onProgress?.(new P("ipns:routing:helia:error",r))}throw new Error("Not found")}};function Lx(n){return new uf(n)}var Rl=globalThis.CustomEvent??Event;async function*Ti(n,e={}){let t=e.concurrency??1/0;t<1&&(t=1/0);let r=e.ordered==null?!1:e.ordered,i=new EventTarget,o=[],s=De(),a=De(),c=!1,u,l=!1;i.addEventListener("task-complete",()=>{a.resolve()}),Promise.resolve().then(async()=>{try{for await(let f of n){if(o.length===t&&(s=De(),await s.promise),l)break;let m={done:!1};o.push(m),f().then(g=>{m.done=!0,m.ok=!0,m.value=g,i.dispatchEvent(new Rl("task-complete"))},g=>{m.done=!0,m.err=g,i.dispatchEvent(new Rl("task-complete"))})}c=!0,i.dispatchEvent(new Rl("task-complete"))}catch(f){u=f,i.dispatchEvent(new Rl("task-complete"))}});function p(){return r?o[0]?.done:!!o.find(f=>f.done)}function*h(){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 m=o[f];if(o.splice(f,1),f--,m.ok)yield m.value;else throw l=!0,s.resolve(),m.err;s.resolve()}}for(;;){if(p()||(a=De(),await a.promise),u!=null)throw u;if(r?yield*h():yield*d(),c&&o.length===0)break}}var Ws;(function(n){let e;n.codec=()=>(e==null&&(e=jt((t,r,i={})=>{i.lengthDelimited!==!1&&r.fork(),t.key!=null&&t.key.byteLength>0&&(r.uint32(10),r.bytes(t.key)),t.value!=null&&t.value.byteLength>0&&(r.uint32(18),r.bytes(t.value)),t.timeReceived!=null&&t.timeReceived!==""&&(r.uint32(42),r.string(t.timeReceived)),i.lengthDelimited!==!1&&r.ldelim()},(t,r)=>{let i={key:new Uint8Array(0),value:new Uint8Array(0),timeReceived:""},o=r==null?t.len:t.pos+r;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),n.encode=t=>Mt(t,n.codec()),n.decode=t=>Vt(t,n.codec())})(Ws||(Ws={}));function Dx(n){let e=n.getUTCFullYear(),t=String(n.getUTCMonth()+1).padStart(2,"0"),r=String(n.getUTCDate()).padStart(2,"0"),i=String(n.getUTCHours()).padStart(2,"0"),o=String(n.getUTCMinutes()).padStart(2,"0"),s=String(n.getUTCSeconds()).padStart(2,"0"),a=n.getUTCMilliseconds(),c=String(a*1e3*1e3).padStart(9,"0");return`${e}-${t}-${r}T${i}:${o}:${s}.${c}Z`}function Px(n){let e=new RegExp("(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})\\.(\\d+)Z"),t=String(n).trim().match(e);if(t==null)throw new Error("Invalid format");let r=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(r,i,o,s,a,c,u))}var Uo=class n{key;value;timeReceived;constructor(e,t,r){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=r}serialize(){return Ws.encode(this.prepareSerialize())}prepareSerialize(){return{key:this.key,value:this.value,timeReceived:Dx(this.timeReceived)}}static deserialize(e){let t=Ws.decode(e);return new n(t.key,t.value,new Date(t.timeReceived))}static fromDeserialized(e){let t=Px(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 n(e.key,e.value,t)}};var Ox;(function(n){n[n.SEND_QUERY=0]="SEND_QUERY",n[n.PEER_RESPONSE=1]="PEER_RESPONSE",n[n.FINAL_PEER=2]="FINAL_PEER",n[n.QUERY_ERROR=3]="QUERY_ERROR",n[n.PROVIDER=4]="PROVIDER",n[n.VALUE=5]="VALUE",n[n.ADD_PEER=6]="ADD_PEER",n[n.DIAL_PEER=7]="DIAL_PEER"})(Ox||(Ox={}));var Fx;(function(n){n[n.PUT_VALUE=0]="PUT_VALUE",n[n.GET_VALUE=1]="GET_VALUE",n[n.ADD_PROVIDER=2]="ADD_PROVIDER",n[n.GET_PROVIDERS=3]="GET_PROVIDERS",n[n.FIND_NODE=4]="FIND_NODE",n[n.PING=5]="PING"})(Fx||(Fx={}));function pf(n){return new Me("/dht/record/"+Q(n,"base32"),!1)}function Vx(n){return{async put(e,t,r={}){try{let i=pf(e),o=new Uo(e,t,new Date);r.onProgress?.(new P("ipns:routing:datastore:put")),await n.put(i,o.serialize(),r)}catch(i){throw r.onProgress?.(new P("ipns:routing:datastore:error",i)),i}},async get(e,t={}){try{let r=pf(e);t.onProgress?.(new P("ipns:routing:datastore:get"));let i=await n.get(r,t);return Uo.deserialize(i).value}catch(r){throw t.onProgress?.(new P("ipns:routing:datastore:error",r)),r}},async has(e,t={}){let r=pf(e);return n.has(r,t)}}}var Ci=ae("helia:ipns"),Z4=60*1e3,zx=60*Z4,J4=24*zx,df=23*zx,ff=class{routers;localStore;timeout;defaultResolvers;constructor(e,t=[],r=[]){this.routers=[Lx(e.routing),...t],this.localStore=Vx(e.datastore),this.defaultResolvers=r.length>0?r:[Ux()]}async publish(e,t,r={}){try{let i=1n,o=Bo(e);if(await this.localStore.has(o,r)){let c=await this.localStore.get(o,r);i=lt(c).sequence+1n}let s=await _1(e,t,i,r.lifetime??J4,r),a=sr(s);return await this.localStore.put(o,a,r),r.offline!==!0&&await Promise.all(this.routers.map(async c=>{await c.put(o,a,r)})),s}catch(i){throw r.onProgress?.(new P("ipns:publish:error",i)),i}}async resolve(e,t={}){let r=Bo(e),i=await this.#t(r,t);return this.#e(i.value,t)}async resolveDns(e,t={}){let r=t.resolvers??this.defaultResolvers,i=await Promise.any(r.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 r=Date.now();e.onProgress?.(new P("ipns:republish:start"));let o=Date.now()-r,s=df-o;s<0&&(s=e.interval??df),setTimeout(()=>{t().catch(a=>{Ci.error("error republishing",a)})},s)}this.timeout=setTimeout(()=>{t().catch(r=>{Ci.error("error republishing",r)})},e.interval??df)}async#e(e,t={}){let r=e.split("/");try{let i=r[1];if(i==="ipns"){let{cid:o}=await this.resolve(Jt(r[2]),t),s=r.slice(3).join("/");return{cid:o,path:s}}else if(i==="ipfs"){let o=V.parse(r[2]),s=r.slice(3).join("/");return{cid:o,path:s}}}catch(i){Ci.error("error parsing ipfs path",i)}throw Ci.error("invalid ipfs path %s",e),new Error("Invalid value")}async#t(e,t={}){let r=[this.localStore,...this.routers];t.offline===!0&&(r=[this.localStore]);let i=[],o=0;if(await Promise.all(r.map(async a=>{let c;try{c=await a.get(e,{...t,validate:!1})}catch(u){a===this.localStore&&u.code==="ERR_NOT_FOUND"?Ci("did not have record locally"):Ci.error("error finding IPNS record",u);return}try{await il(e,c),i.push(c)}catch(u){o++,Ci.error("error finding IPNS record",u)}})),i.length===0)throw o>0?new F(`${o>1?`${o} records`:"Record"} found for routing key ${o>1?"were":"was"} invalid`,"ERR_RECORDS_FAILED_VALIDATION"):new F("Could not find record for routing key","ERR_NOT_FOUND");let s=i[kx(e,i)];return await this.localStore.put(e,s,t),lt(s)}};function Mx(n,{routers:e=[],resolvers:t=[]}={}){return new ff(n,e,t)}var Fk=ee(Af(),1),Vk=ee(yy(),1);var O7=new Qr(1e3),F7=60*1e3;var Lf=new Qr(1e3),zk=60*1e3;function Dl(n){let e=new yt({concurrency:4}),t=async(r,i={})=>{let o=new URLSearchParams;o.set("name",r),o.set("type","TXT");let s=o.toString();if(i.nocache!==!0&&Lf.has(s)){let c=Lf.get(s);if(c!=null)return i.onProgress?.(new P("dnslink:cache",{detail:c})),c}i.onProgress?.(new P("dnslink:query",{detail:r}));let a=await e.add(async()=>{let c=await fetch(`${n}?${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:h}=nf(r,l);return Lf.set(u,p,h.TTL??zk),p},{signal:i.signal});if(a==null)throw new Error("No DNS response received");return a};return async(r,i={})=>No(r,Gs,t,i)}var Df=class{components;constructor(e){this.components=e}async add(e,t={}){let r=Jh(e),i=await(t.hasher??re).digest(r),o=V.createV1(Tr,i);return await this.components.blockstore.put(o,r,t),o}async get(e,t={}){let r=await this.components.blockstore.get(e,t);return ka(r)}};function wy(n){return new Df(n)}var Mf=ee(Te(),1);function Mk(n){return n[Symbol.asyncIterator]!=null}function jk(n,e=1){return e=Number(e),Mk(n)?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 r of n)for(t.push(r);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 r of n)for(t.push(r);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 Zs=jk;async function*Js(n,e=1){for await(let t of Zs(n,e)){let r=t.map(async i=>i().then(o=>({ok:!0,value:o}),o=>({ok:!1,err:o})));for(let i=0;i<r.length;i++){let o=await r[i];if(o.ok)yield o.value;else throw o.err}}}var Hk=262144,Qs=(n={})=>{let e=n.chunkSize??Hk;return async function*(r){let i=new gi,o=0,s=!1;for await(let a of r)for(i.append(a),o+=a.length;o>=e;)if(yield i.slice(0,e),s=!0,e===i.length)i=new gi,o=0;else{let c=new gi;c.append(i.sublist(e)),i=c,o-=e}(!s||o>0)&&(yield i.subarray(0,o))}};var Pf=ee(Te(),1);var dn;(function(n){let e;(function(i){i.Raw="Raw",i.Directory="Directory",i.File="File",i.Metadata="Metadata",i.Symlink="Symlink",i.HAMTShard="HAMTShard"})(e=n.DataType||(n.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=()=>hi(t)}(e=n.DataType||(n.DataType={}));let r;n.codec=()=>(r==null&&(r=jt((i,o,s={})=>{if(s.lengthDelimited!==!1&&o.fork(),i.Type!=null&&(o.uint32(8),n.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),Pl.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=n.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=Pl.codec().decode(i,i.uint32());break;default:i.skipType(c&7);break}}return s})),r),n.encode=i=>Mt(i,n.codec()),n.decode=i=>Vt(i,n.codec())})(dn||(dn={}));var Pl;(function(n){let e;n.codec=()=>(e==null&&(e=jt((t,r,i={})=>{i.lengthDelimited!==!1&&r.fork(),t.Seconds!=null&&(r.uint32(8),r.int64(t.Seconds)),t.FractionalNanoseconds!=null&&(r.uint32(21),r.fixed32(t.FractionalNanoseconds)),i.lengthDelimited!==!1&&r.ldelim()},(t,r)=>{let i={},o=r==null?t.len:t.pos+r;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),n.encode=t=>Mt(t,n.codec()),n.decode=t=>Vt(t,n.codec())})(Pl||(Pl={}));var by;(function(n){let e;n.codec=()=>(e==null&&(e=jt((t,r,i={})=>{i.lengthDelimited!==!1&&r.fork(),t.MimeType!=null&&(r.uint32(10),r.string(t.MimeType)),i.lengthDelimited!==!1&&r.ldelim()},(t,r)=>{let i={},o=r==null?t.len:t.pos+r;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),n.encode=t=>Mt(t,n.codec()),n.decode=t=>Vt(t,n.codec())})(by||(by={}));var vy={Raw:"raw",Directory:"directory",File:"file",Metadata:"metadata",Symlink:"symlink",HAMTShard:"hamt-sharded-directory"},$k=["directory","hamt-sharded-directory"],Ey=parseInt("0644",8),ky=parseInt("0755",8),W=class n{static unmarshal(e){let t=dn.decode(e),r=new n({type:vy[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 r._originalMode=t.mode??0,r}type;data;blockSizes;hashType;fanout;mtime;_mode;_originalMode;constructor(e={type:"file"}){let{type:t,data:r,blockSizes:i,hashType:o,fanout:s,mtime:a,mode:c}=e;if(t!=null&&!Object.values(vy).includes(t))throw(0,Pf.default)(new Error("Type: "+t+" is not valid"),"ERR_INVALID_TYPE");this.type=t??"file",this.data=r,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()?ky:Ey:this._mode=e&4095}get mode(){return this._mode}isDirectory(){return $k.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=dn.DataType.Raw;break;case"directory":e=dn.DataType.Directory;break;case"file":e=dn.DataType.File;break;case"metadata":e=dn.DataType.Metadata;break;case"symlink":e=dn.DataType.Symlink;break;case"hamt-sharded-directory":e=dn.DataType.HAMTShard;break;default:throw(0,Pf.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 r;this.mode!=null&&(r=this._originalMode&4294963200|(this.mode??0),r===Ey&&!this.isDirectory()&&(r=void 0),r===ky&&this.isDirectory()&&(r=void 0));let i;return this.mtime!=null&&(i={Seconds:this.mtime.secs,FractionalNanoseconds:this.mtime.nsecs}),dn.encode({Type:e,Data:t,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:r,mtime:i})}};var fn=async(n,e,t)=>{t.codec==null&&(t.codec=Oe);let r=await re.digest(n),i=V.create(t.cidVersion,t.codec.code,r);return await e.put(i,n,t),i};function Ay(n){return async function*(t,r){let i=0n;for await(let o of t.content)yield async()=>{let s,a={codec:Oe,cidVersion:n.cidVersion,onProgress:n.onProgress};n.rawLeaves?(a.codec=zt,a.cidVersion=1):(s=new W({type:n.leafType,data:o}),o=ue({Data:s.marshal(),Links:[]}));let c=await fn(o,r,a);return i+=BigInt(o.byteLength),n.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 Of=ee(Te(),1);var By=async(n,e,t)=>{let r=new W({type:"directory",mtime:n.mtime,mode:n.mode}),i=ue(_e({Data:r.marshal()})),o=await fn(i,e,t),s=n.path;return{cid:o,path:s,unixfs:r,size:BigInt(i.length),originalPath:n.originalPath,block:i}};async function*Kk(n,e,t){let r=-1,i;for await(let o of Js(t.bufferImporter(n,e),t.blockWriteConcurrency)){if(r++,r===0){i={...o,single:!0};continue}else r===1&&i!=null&&(yield{...i,block:void 0,single:void 0},i=void 0);yield{...o,block:void 0}}i!=null&&(yield i)}function Iy(n){return n.single===!0}var qk=(n,e,t)=>async function(i){if(i.length===1&&Iy(i[0])&&t.reduceSingleLeafToSelf){let l=i[0],p=l.block;return Iy(l)&&(n.mtime!==void 0||n.mode!==void 0)&&(l.unixfs=new W({type:"file",mtime:n.mtime,mode:n.mode,data:l.block}),p={Data:l.unixfs.marshal(),Links:[]},l.block=ue(_e(p)),l.cid=await fn(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:n.path,unixfs:l.unixfs,size:l.size,originalPath:l.originalPath}}let o=new W({type:"file",mtime:n.mtime,mode:n.mode}),s=i.filter(l=>l.cid.code===Le&&l.size>0||l.unixfs!=null&&l.unixfs.data==null&&l.unixfs.fileSize()>0n?!0:!!l.unixfs?.data?.length).map(l=>l.cid.code===Le?(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=ue(_e(a)),u=await fn(c,e,t);return t.onProgress?.(new P("unixfs:importer:progress:file:layout",{cid:u,path:n.originalPath})),{cid:u,path:n.path,unixfs:o,size:BigInt(c.length+a.Links.reduce((l,p)=>l+(p.Tsize??0),0)),originalPath:n.originalPath,block:c}},Sy=async(n,e,t)=>t.layout(Kk(n,e,t),qk(n,e,t));function Gk(n){return Symbol.iterator in n}function Wk(n){return Symbol.asyncIterator in n}function Yk(n){try{if(n instanceof Uint8Array)return async function*(){yield n}();if(Gk(n))return async function*(){yield*n}();if(Wk(n))return n}catch{throw(0,Of.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}throw(0,Of.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}function _y(n){return async function*(t,r){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("/")),Xk(i)){let s={path:i.path,mtime:i.mtime,mode:i.mode,content:async function*(){let a=0n;for await(let c of n.chunker(n.chunkValidator(Yk(i.content)))){let u=BigInt(c.byteLength);a+=u,n.onProgress?.(new P("unixfs:importer:progress:file:read",{bytesRead:a,chunkSize:u,path:i.path})),yield c}}(),originalPath:o};yield async()=>Sy(s,r,n)}else if(i.path!=null){let s={path:i.path,mtime:i.mtime,mode:i.mode,originalPath:o};yield async()=>By(s,r,n)}else throw new Error("Import candidate must have content or path or both")}}}function Xk(n){return n.content!=null}var Ff=ee(Te(),1);var Ry=()=>async function*(e){for await(let t of e){if(t.length===void 0)throw(0,Ff.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT");if(typeof t=="string"||t instanceof String)yield Y(t.toString());else if(Array.isArray(t))yield Uint8Array.from(t);else if(t instanceof Uint8Array)yield t;else throw(0,Ff.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}};var Zk=174;function ea(n){let e=n?.maxChildrenPerNode??Zk;return async function t(r,i){let o=[];for await(let s of Zs(r,e))o.push(await i(s));return o.length>1?t(o,i):o[0]}}var On=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}},ta=V.parse("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"),na=V.parse("zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi");var Di=class extends On{_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?na.bytes.byteLength:ta.bytes.byteLength));return this.nodeSize}async*flush(e){let t=[];for(let[c,u]of this._children.entries()){let l=u;if(u instanceof On)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 r=new W({type:"directory",mtime:this.mtime,mode:this.mode}),i={Data:r.marshal(),Links:t},o=ue(_e(i)),s=await fn(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:r,path:this.path,size:BigInt(a)}}};var Fl=ee(Ny(),1);function Jk(n){let e=new Array(4);for(let t=0;t<4;t++)e[t]=n&255,n=n>>8;return new Uint8Array(e)}var JO=li({name:"murmur3-32",code:35,encode:n=>Jk(Fl.default.x86.hash32(n))}),Pi=li({name:"murmur3-128",code:34,encode:n=>Mi.fromHex(Fl.default.x64.hash128(n))}),QO=li({name:"murmur3-x64-64",code:34,encode:n=>Mi.fromHex(Fl.default.x64.hash128(n)).subarray(0,8)});var Dy=ee(Vl(),1);var Ot=class n{_options;_popCount;_parent;_posAtParent;_children;key;constructor(e,t,r=0){this._options=e,this._popCount=0,this._parent=t,this._posAtParent=r,this._children=new Dy.default,this.key=null}async put(e,t){let r=await this._findNewBucketAndPos(e);r.bucket._putAt(r,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),r=t.bucket._at(t.pos);r!=null&&r.key===e&&t.bucket._delAt(t.pos)}leafCount(){return this._children.compactArray().reduce((t,r)=>r instanceof n?t+r.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 n?yield*t.eachLeafSeries():yield t}serialize(e,t){let r=[];return t(this._children.reduce((i,o,s)=>(o!=null&&(o instanceof n?i.push(o.serialize(e,t)):i.push(e(o,s))),i),r))}async asyncTransform(e,t){return Py(this,e,t)}toJSON(){return this.serialize(rA,iA)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(e){let t=await this._findPlace(e),r=t.bucket._at(t.pos);if(!(r instanceof n)&&r!=null&&r.key===e)return r}async _findPlace(e){let t=this._options.hash(typeof e=="string"?Y(e):e),r=await t.take(this._options.bits),i=this._children.get(r);return i instanceof n?i._findPlace(t):{bucket:this,pos:r,hash:t,existingChild:i}}async _findNewBucketAndPos(e){let t=await this._findPlace(e);if(t.existingChild!=null&&t.existingChild.key!==e){let r=new n(this._options,t.bucket,t.pos);t.bucket._putObjectAt(t.pos,r);let i=await r._findPlace(t.existingChild.hash);return i.bucket._putAt(i,t.existingChild.key,t.existingChild.value),r._findNewBucketAndPos(t.hash)}return t}_putAt(e,t,r){this._putObjectAt(e.pos,{key:t,value:r,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(nA);if(e!=null&&!(e instanceof n)){let t=e.hash;t.untake(this._options.bits);let r={pos:this._posAtParent,hash:t,bucket:this._parent};this._parent._putAt(r,e.key,e.value)}}else this._parent._delAt(this._posAtParent)}_at(e){return this._children.get(e)}};function nA(n){return!!n}function rA(n,e){return n.key}function iA(n){return n}async function Py(n,e,t){let r=[];for(let i of n._children.compactArray())if(i instanceof Ot)await Py(i,e,t);else{let o=await e(i);r.push({bitField:n._children.bitField(),children:o})}return t(r)}var oA=[255,254,252,248,240,224,192,128],sA=[1,3,7,15,31,63,127,255],zl=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,r=0;for(;t>0&&this._haveBits();){let i=this._value[this._currentBytePos],o=this._currentBitPos+1,s=Math.min(o,t),a=aA(i,o-s,s);r=(r<<s)+a,t-=s,this._currentBitPos-=s,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return r}untake(e){for(this._currentBitPos+=e;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function aA(n,e,t){let r=cA(e,t);return(n&r)>>>e}function cA(n,e){return oA[n]&sA[Math.min(e+n-1,7)]}function Oy(n){function e(t){return t instanceof Ml?t:new Ml(t,n)}return e}var Ml=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 r=0;for(;t>0;){let i=this._buffers[this._currentBufferIndex],o=Math.min(i.availableBits(),t),s=i.take(o);r=(r<<o)+s,t-=o,this._availableBits-=o,i.availableBits()===0&&this._currentBufferIndex++}return r}untake(e){let t=e;for(;t>0;){let r=this._buffers[this._currentBufferIndex],i=Math.min(r.totalBits()-r.availableBits(),t);r.untake(i),t-=i,this._availableBits+=i,this._currentBufferIndex>0&&r.totalBits()===r.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;let e=this._depth>0?Ee([this._value,Uint8Array.from([this._depth])]):this._value,t=await this._hashFn(e),r=new zl(t);this._buffers.push(r),this._availableBits+=r.availableBits()}};function Vo(n){if(n==null||n.hashFn==null)throw new Error("please define an options.hashFn");let e={bits:n.bits??8,hash:Oy(n.hashFn)};return new Ot(e)}async function lA(n){return(await Pi.encode(n)).slice(0,8).reverse()}var Fy=BigInt(34),uA=8,Vf=class extends On{_bucket;constructor(e,t){super(e,t),this._bucket=Vo({hashFn:lA,bits:t.shardFanoutBits??uA})}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=My(this._bucket,this,this.options),this.nodeSize)}async*flush(e){for await(let t of zy(this._bucket,e,this,this.options))yield{...t,path:this.path}}},Vy=Vf;async function*zy(n,e,t,r){let i=n._children,o=(n.tableSize()-1).toString(16).length,s=[],a=0n;for(let f=0;f<i.length;f++){let m=i.get(f);if(m==null)continue;let g=f.toString(16).toUpperCase().padStart(o,"0");if(m instanceof Ot){let x;for await(let w of zy(m,e,null,r))x=w;if(x==null)throw new Error("Could not flush sharded directory, no subshard found");s.push({Name:g,Tsize:Number(x.size),Hash:x.cid}),a+=x.size}else if(pA(m.value)){let x=m.value,w;for await(let A of x.flush(e))w=A,yield w;if(w==null)throw new Error("Did not flush dir");let b=g+m.key;s.push({Name:b,Tsize:Number(w.size),Hash:w.cid}),a+=w.size}else{let x=m.value;if(x.cid==null)continue;let w=g+m.key,b=x.size;s.push({Name:w,Tsize:Number(b),Hash:x.cid}),a+=BigInt(b??0)}}let c=Uint8Array.from(i.bitField().reverse()),u=new W({type:"hamt-sharded-directory",data:c,fanout:BigInt(n.tableSize()),hashType:Fy,mtime:t?.mtime,mode:t?.mode}),l={Data:u.marshal(),Links:s},p=ue(_e(l)),h=await fn(p,e,r),d=BigInt(p.byteLength)+a;yield{cid:h,unixfs:u,size:d}}function pA(n){return typeof n.flush=="function"}function My(n,e,t){let r=n._children,i=(n.tableSize()-1).toString(16).length,o=[];for(let u=0;u<r.length;u++){let l=r.get(u);if(l==null)continue;let p=u.toString(16).toUpperCase().padStart(i,"0");if(l instanceof Ot){let h=My(l,null,t);o.push({Name:p,Tsize:Number(h),Hash:t.cidVersion===0?ta:na})}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?ta:na})}else{let h=l.value;if(h.cid==null)continue;let d=p+l.key,f=h.size;o.push({Name:d,Tsize:Number(f),Hash:h.cid})}}let s=Uint8Array.from(r.bitField().reverse()),a=new W({type:"hamt-sharded-directory",data:s,fanout:BigInt(n.tableSize()),hashType:Fy,mtime:e?.mtime,mode:e?.mode});return ue(_e({Data:a.marshal(),Links:o})).length}async function zf(n,e,t,r){let i=e;e instanceof Di&&e.estimateNodeSize()>t&&(i=await dA(e,r));let o=i.parent;if(o!=null){if(i!==e){if(n!=null&&(n.parent=i),i.parentKey==null)throw new Error("No parent key found");await o.put(i.parentKey,i)}return zf(i,o,t,r)}return i}async function dA(n,e){let t=new Vy({root:n.root,dir:!0,parent:n.parent,parentKey:n.parentKey,path:n.path,dirty:n.dirty,flat:!1,mtime:n.mtime,mode:n.mode},e);for await(let{key:r,child:i}of n.eachChildSeries())await t.put(r,i);return t}var jy=(n="")=>n.split(/(?<!\\)\//).filter(Boolean);async function fA(n,e,t){let r=jy(n.path??""),i=r.length-1,o=e,s="";for(let a=0;a<r.length;a++){let c=r[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,n),e=await zf(null,o,t.shardSplitThresholdBytes,t);else{let l=await o.get(c);(l==null||!(l instanceof On))&&(l=new Di({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*Hy(n,e){if(!(n instanceof On)){n.unixfs?.isDirectory()===!0&&(yield n);return}yield*n.flush(e)}function $y(n){return async function*(t,r){let i=new Di({root:!0,dir:!0,path:"",dirty:!0,flat:!0},n),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 fA(a,i,n),(a.unixfs==null||!a.unixfs.isDirectory())&&(yield a)}if(n.wrapWithDirectory||s&&i.childCount()>1)yield*Hy(i,r);else for await(let a of i.eachChildSeries())a!=null&&(yield*Hy(a.child,r))}}async function*ni(n,e,t={}){let r;Symbol.asyncIterator in n||Symbol.iterator in n?r=n:r=[n];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,h=t.reduceSingleLeafToSelf??!0,d=t.chunker??Qs(),f=t.chunkValidator??Ry(),m=t.dagBuilder??_y({chunker:d,chunkValidator:f,wrapWithDirectory:i,layout:t.layout??ea(),bufferImporter:t.bufferImporter??Ay({cidVersion:a,rawLeaves:c,leafType:u,onProgress:t.onProgress}),blockWriteConcurrency:p,reduceSingleLeafToSelf:h,cidVersion:a,onProgress:t.onProgress}),g=t.treeBuilder??$y({wrapWithDirectory:i,shardSplitThresholdBytes:o,shardFanoutBits:s,cidVersion:a,onProgress:t.onProgress});for await(let x of g(Js(m(r,e),l),e))yield{cid:x.cid,path:x.path,unixfs:x.unixfs,size:x.size}}async function jl(n,e,t={}){let r=await Ii(ni([n],e,t));if(r==null)throw(0,Mf.default)(new Error("Nothing imported"),"ERR_INVALID_PARAMS");return r}async function Ky(n,e,t={}){let r=await Ii(ni([n],e,t));if(r==null)throw(0,Mf.default)(new Error("Nothing imported"),"ERR_INVALID_PARAMS");return r}async function qy(n,e,t={}){return jl({content:n},e,t)}async function Gy(n,e,t={}){return jl({content:n},e,t)}var wA=ee(Te(),1),bA=ee(sw(),1);var aa={cidVersion:1,rawLeaves:!0,layout:ea({maxChildrenPerNode:1024}),chunker:Qs({chunkSize:1048576})};async function*aw(n,e,t={}){yield*ni(n,e,{...aa,...t})}async function cw(n,e,t={}){let{cid:r}=await qy(n,e,{...aa,...t});return r}async function lw(n,e,t={}){let{cid:r}=await Gy(n,e,{...aa,...t});return r}async function uw(n,e,t={}){let{cid:r}=await jl(n,e,{...aa,...t});return r}async function pw(n,e,t={}){let{cid:r}=await Ky({...n,path:n.path??"-"},e,{...aa,...t});return r}var $l=ee(Te(),1);function vA(n){return n[Symbol.asyncIterator]!=null}function EA(n){if(vA(n))return(async()=>{let t;for await(let r of n)t=r;return t})();let e;for(let t of n)e=t;return e}var ri=EA;var _w=ee(Te(),1);var dw=ee(Te(),1);function zo(n,e,t,r,i,o,s){let a=n,c=i;for(;o.length>0;){let u=o[0];if(u in a){o.shift(),c=`${c}/${u}`;let l=V.asCID(a[u]);if(l!=null)return{entry:{type:"object",name:r,path:i,cid:t,node:e,depth:s,size:BigInt(e.length),content:async function*(){yield n}},next:{cid:l,name:u,path:c,toResolve:o}};a=a[u]}else throw(0,dw.default)(new Error(`No property named ${u} found in node ${t}`),"ERR_NO_PROP")}return{entry:{type:"object",name:r,path:i,cid:t,node:e,depth:s,size:BigInt(e.length),content:async function*(){yield n}}}}var kA=async(n,e,t,r,i,o,s,a)=>{let c=await s.get(n,a),u=xl(c);return zo(u,c,n,e,t,r,o)},fw=kA;var AA=async(n,e,t,r,i,o,s,a)=>{let c=await s.get(n,a),u=bl(c);return zo(u,c,n,e,t,r,o)},hw=AA;var mw=ee(Te(),1);function BA(n,e,t,r){let i=BigInt(n.length),o=BigInt(e+i);return t>=o||r<e?new Uint8Array(0):(r>=e&&r<o&&(n=n.subarray(0,Number(r-e))),t>=e&&t<o&&(n=n.subarray(Number(t-e))),n)}var Oi=BA;var ca=ee(Te(),1),IA=(n,e=0,t=n)=>{let r=BigInt(n),i=BigInt(e??0),o=BigInt(t);if(o!==r&&(o=i+o),o>r&&(o=r),i<0n)throw(0,ca.default)(new Error("Offset must be greater than or equal to 0"),"ERR_INVALID_PARAMS");if(i>r)throw(0,ca.default)(new Error("Offset must be less than the file size"),"ERR_INVALID_PARAMS");if(o<0n)throw(0,ca.default)(new Error("Length must be greater than or equal to 0"),"ERR_INVALID_PARAMS");if(o>r)throw(0,ca.default)(new Error("Length must be less than the file size"),"ERR_INVALID_PARAMS");return{start:i,end:o}},Mo=IA;var SA=n=>{async function*e(t={}){let{start:r,end:i}=Mo(n.length,t.offset,t.length),o=Oi(n,0n,r,i);t.onProgress?.(new P("unixfs:exporter:progress:identity",{bytesRead:BigInt(o.byteLength),totalBytes:i-r,fileSize:BigInt(n.byteLength)})),yield o}return e},_A=async(n,e,t,r,i,o,s,a)=>{if(r.length>0)throw(0,mw.default)(new Error(`No link named ${t} found in raw node ${n}`),"ERR_NOT_FOUND");let c=kt(n.multihash.bytes);return{entry:{type:"identity",name:e,path:t,cid:n,content:SA(c.digest),depth:o,size:BigInt(c.digest.length),node:c.digest}}},gw=_A;var RA=async(n,e,t,r,i,o,s,a)=>{let c=await s.get(n,a),u=ka(c);return zo(u,c,n,e,t,r,o)},xw=RA;var yw=ee(Te(),1);var TA=n=>{async function*e(t={}){let{start:r,end:i}=Mo(n.length,t.offset,t.length),o=Oi(n,0n,r,i);t.onProgress?.(new P("unixfs:exporter:progress:raw",{bytesRead:BigInt(o.byteLength),totalBytes:i-r,fileSize:BigInt(n.byteLength)})),yield o}return e},CA=async(n,e,t,r,i,o,s,a)=>{if(r.length>0)throw(0,yw.default)(new Error(`No link named ${t} found in raw node ${n}`),"ERR_NOT_FOUND");let c=await s.get(n,a);return{entry:{type:"raw",name:e,path:t,cid:n,content:TA(c),depth:o,size:BigInt(c.length),node:c}}},ww=CA;var ua=ee(Te(),1);var la=ee(Te(),1);var NA=async function(n){return(await Pi.encode(n)).slice(0,8).reverse()},UA=async(n,e,t)=>{let r=(e.tableSize()-1).toString(16).length;await Promise.all(n.map(async i=>{if(i.Name==null)throw new Error("Unexpected Link without a Name");if(i.Name.length===r){let o=parseInt(i.Name,16);e._putObjectAt(o,new Ot({hash:t._options.hash,bits:t._options.bits},e,o));return}await t.put(i.Name.substring(2),!0)}))},bw=(n,e)=>n.toString(16).toUpperCase().padStart(e,"0").substring(0,e),LA=n=>{let e=n.bucket,t=[];for(;e._parent!=null;)t.push(e),e=e._parent;return t.push(e),t.reverse()},vw=async(n,e,t,r,i)=>{if(r==null){if(n.Data==null)throw(0,la.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");let p;try{p=W.unmarshal(n.Data)}catch(d){throw(0,la.default)(d,"ERR_NOT_UNIXFS")}if(p.type!=="hamt-sharded-directory")throw(0,la.default)(new Error("not a HAMT"),"ERR_NOT_UNIXFS");if(p.fanout==null)throw(0,la.default)(new Error("missing fanout"),"ERR_NOT_UNIXFS");let h=Vo({hashFn:NA,bits:Math.log2(Number(p.fanout))});r={rootBucket:h,hamtDepth:1,lastBucket:h}}let o=(r.lastBucket.tableSize()-1).toString(16).length;await UA(n.Links,r.lastBucket,r.rootBucket);let s=await r.rootBucket._findNewBucketAndPos(e),a=bw(s.pos,o),c=LA(s);c.length>r.hamtDepth&&(r.lastBucket=c[r.hamtDepth],a=bw(r.lastBucket._posAtParent,o));let u=n.Links.find(p=>{if(p.Name==null)return!1;let h=p.Name.substring(0,o),d=p.Name.substring(o);return!(h!==a||d!==""&&d!==e)});if(u==null)return;if(u.Name!=null&&u.Name.substring(o)===e)return u.Hash;r.hamtDepth++;let l=await t.get(u.Hash,i);return n=ke(l),vw(n,e,t,r,i)},Ew=vw;var DA=(n,e,t,r,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:n})),yield*Zt(p,h=>Xt(h,d=>async()=>{let f=d.Name??"",m=`${r}/${f}`;return(await i(d.Hash,f,m,[],o+1,s,c)).entry}),h=>Ti(h,{ordered:!0,concurrency:c.blockReadConcurrency}),h=>Ut(h,d=>d!=null))}return a},kw=DA;var Fi=ee(Te(),1);async function Aw(n,e,t,r,i,o,s){if(e instanceof Uint8Array){let u=Oi(e,r,i,o);t.push(u);return}if(e.Data==null)throw(0,Fi.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");let a;try{a=W.unmarshal(e.Data)}catch(u){throw(0,Fi.default)(u,"ERR_NOT_UNIXFS")}if(a.data!=null){let u=a.data,l=Oi(u,r,i,o);t.push(l),r+=BigInt(l.byteLength)}let c=[];if(e.Links.length!==a.blockSizes.length)throw(0,Fi.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=r,h=p+a.blockSizes[u];if((i>=p&&i<h||o>=p&&o<=h||i<p&&o>h)&&c.push({link:l,blockStart:r}),r=h,r>o)break}await Zt(c,u=>Xt(u,l=>async()=>{let p=await n.get(l.link.Hash,s);return{...l,block:p}}),u=>Ti(u,{ordered:!0,concurrency:s.blockReadConcurrency}),async u=>{for await(let{link:l,block:p,blockStart:h}of u){let d;switch(l.Hash.code){case Ce:d=ke(p);break;case Le:d=p;break;default:t.end((0,Fi.default)(new Error(`Unsupported codec: ${l.Hash.code}`),"ERR_NOT_UNIXFS"));return}let f=new yt({concurrency:1});f.on("error",m=>{t.end(m)}),f.add(async()=>{s.onProgress?.(new P("unixfs:exporter:walk:file",{cid:l.Hash})),await Aw(n,d,t,h,i,o,s)}),await f.onIdle()}}),r>=o&&t.end()}var PA=(n,e,t,r,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}=Mo(u,c.offset,c.length);if(p===0n)return;let h=0n,d=p-l,f=bn();c.onProgress?.(new P("unixfs:exporter:walk:file",{cid:n})),Aw(s,e,f,0n,l,p,c).catch(m=>{f.end(m)});for await(let m of f)if(m!=null){if(h+=BigInt(m.byteLength),h>d)throw f.end(),(0,Fi.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");h===d&&f.end(),c.onProgress?.(new P("unixfs:exporter:progress:unixfs:file",{bytesRead:h,totalBytes:d,fileSize:u})),yield m}if(h<d)throw(0,Fi.default)(new Error("Traversed entire DAG but did not read enough bytes"),"ERR_UNDER_READ")}return a},qf=PA;var Hl=ee(Te(),1);var OA=(n,e,t,r,i,o,s)=>{function a(c={}){return c.onProgress?.(new P("unixfs:exporter:walk:hamt-sharded-directory",{cid:n})),Bw(e,r,i,o,s,c)}return a};async function*Bw(n,e,t,r,i,o){let s=n.Links;if(n.Data==null)throw(0,Hl.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");let a;try{a=W.unmarshal(n.Data)}catch(l){throw(0,Hl.default)(l,"ERR_NOT_UNIXFS")}if(a.fanout==null)throw(0,Hl.default)(new Error("missing fanout"),"ERR_NOT_UNIXFS");let c=(a.fanout-1n).toString(16).length,u=Zt(s,l=>Xt(l,p=>async()=>{let h=p.Name!=null?p.Name.substring(c):null;if(h!=null&&h!==""){let d=await t(p.Hash,h,`${e}/${h}`,[],r+1,i,o);return{entries:d.entry==null?[]:[d.entry]}}else{let d=await i.get(p.Hash,o);return n=ke(d),o.onProgress?.(new P("unixfs:exporter:walk:hamt-sharded-directory",{cid:p.Hash})),{entries:Bw(n,e,t,r,i,o)}}}),l=>Ti(l,{ordered:!0,concurrency:o.blockReadConcurrency}));for await(let{entries:l}of u)yield*l}var Iw=OA;var FA=(n,e)=>n.Links.find(r=>r.Name===e)?.Hash,VA={raw:qf,file:qf,directory:kw,"hamt-sharded-directory":Iw,metadata:(n,e,t,r,i,o,s)=>()=>[],symlink:(n,e,t,r,i,o,s)=>()=>[]},zA=async(n,e,t,r,i,o,s,a)=>{let c=await s.get(n,a),u=ke(c),l,p;if(e==null&&(e=n.toString()),u.Data==null)throw(0,ua.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");try{l=W.unmarshal(u.Data)}catch(d){throw(0,ua.default)(d,"ERR_NOT_UNIXFS")}if(t==null&&(t=e),r.length>0){let d;if(l?.type==="hamt-sharded-directory"?d=await Ew(u,r[0],s):d=FA(u,r[0]),d==null)throw(0,ua.default)(new Error("file does not exist"),"ERR_NOT_FOUND");let f=r.shift(),m=`${t}/${f}`;p={cid:d,toResolve:r,name:f??"",path:m}}let h=VA[l.type](n,u,l,t,i,o,s);if(h==null)throw(0,ua.default)(new Error("could not find content exporter"),"ERR_NOT_FOUND");return l.isDirectory()?{entry:{type:"directory",name:e,path:t,cid:n,content:h,unixfs:l,depth:o,node:u,size:l.fileSize()},next:p}:{entry:{type:"file",name:e,path:t,cid:n,content:h,unixfs:l,depth:o,node:u,size:l.fileSize()},next:p}},Sw=zA;var MA={[Ce]:Sw,[Le]:ww,[Yr]:fw,[Zr]:hw,[mt.code]:gw,[Tr]:xw},Rw=async(n,e,t,r,i,o,s)=>{let a=MA[n.code];if(a==null)throw(0,_w.default)(new Error(`No resolver for code ${n.code}`),"ERR_NO_RESOLVER");return a(n,e,t,r,Rw,i,o,s)},Tw=Rw;var jA=(n="")=>(n.trim().match(/([^\\^/]|\\\/)+/g)??[]).filter(Boolean),HA=n=>{if(n instanceof Uint8Array)return{cid:V.decode(n),toResolve:[]};let e=V.asCID(n);if(e!=null)return{cid:e,toResolve:[]};if(typeof n=="string"){n.indexOf("/ipfs/")===0&&(n=n.substring(6));let t=jA(n);return{cid:V.parse(t[0]),toResolve:t.slice(1)}}throw(0,$l.default)(new Error(`Unknown path type ${n}`),"ERR_BAD_PATH")};async function*Gf(n,e,t={}){let{cid:r,toResolve:i}=HA(n),o=r.toString(),s=o,a=i.length;for(;;){let c=await Tw(r,o,s,i,a,e,t);if(c.entry==null&&c.next==null)throw(0,$l.default)(new Error(`Could not resolve ${n}`),"ERR_NOT_FOUND");if(c.entry!=null&&(yield c.entry),c.next==null)return;i=c.next.toResolve,r=c.next.cid,o=c.next.name,s=c.next.path}}async function Qe(n,e,t={}){let r=await ri(Gf(n,e,t));if(r==null)throw(0,$l.default)(new Error(`Could not resolve ${n}`),"ERR_NOT_FOUND");return r}async function*Kl(n,e,t={}){let r=await Qe(n,e,t);if(r==null)return;if(yield r,r.type==="directory")for await(let o of i(r,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 Vw=ee(Fw(),1),ot=Vw.default;var hn=class extends Error{name;code;constructor(e,t,r){super(e),this.name=t,this.code=r}},Fn=class extends hn{constructor(e="not a Unixfs node"){super(e,"NotUnixFSError","ERR_NOT_UNIXFS")}},dt=class extends hn{constructor(e="invalid PBNode"){super(e,"InvalidPBNodeError","ERR_INVALID_PBNODE")}},br=class extends hn{constructor(e="unknown error"){super(e,"InvalidPBNodeError","ERR_UNKNOWN_ERROR")}},pa=class extends hn{constructor(e="path already exists"){super(e,"AlreadyExistsError","ERR_ALREADY_EXISTS")}},Wl=class extends hn{constructor(e="path does not exist"){super(e,"DoesNotExistError","ERR_DOES_NOT_EXIST")}},$o=class extends hn{constructor(e="no content"){super(e,"NoContentError","ERR_NO_CONTENT")}},Yl=class extends hn{constructor(e="not a file"){super(e,"NotAFileError","ERR_NOT_A_FILE")}},ii=class extends hn{constructor(e="not a directory"){super(e,"NotADirectoryError","ERR_NOT_A_DIRECTORY")}},st=class extends hn{constructor(e="invalid parameters"){super(e,"InvalidParametersError","ERR_INVALID_PARAMETERS")}};var Jf=ee(Vl(),1);function Zl(n){function e(t){return t instanceof Xl?t:new Xl(t,n)}return e}var Xl=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 r=0;for(;t>0;){let i=this._buffers[this._currentBufferIndex],o=Math.min(i.availableBits(),t),s=i.take(o);r=(r<<o)+s,t-=o,this._availableBits-=o,i.availableBits()===0&&this._currentBufferIndex++}return r}untake(e){let t=e;for(;t>0;){let r=this._buffers[this._currentBufferIndex],i=Math.min(r.totalBits()-r.availableBits(),t);r.untake(i),t-=i,this._availableBits+=i,this._currentBufferIndex>0&&r.totalBits()===r.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;let e=this._depth>0?Ee([this._value,Uint8Array.from([this._depth])]):this._value,t=await this._hashFn(e),r=new Yf(t);this._buffers.push(r),this._availableBits+=r.availableBits()}},YA=[255,254,252,248,240,224,192,128],XA=[1,3,7,15,31,63,127,255],Yf=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,r=0;for(;t>0&&this._haveBits();){let i=this._value[this._currentBytePos],o=this._currentBitPos+1,s=Math.min(o,t),a=ZA(i,o-s,s);r=(r<<s)+a,t-=s,this._currentBitPos-=s,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return r}untake(e){for(this._currentBitPos+=e;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function ZA(n,e,t){let r=JA(e,t);return(n&r)>>>e}function JA(n,e){return YA[n]&XA[Math.min(e+n-1,7)]}var da=BigInt(Pi.code),Vi=8;async function Ko(n){return(await Pi.encode(n)).subarray(0,8).reverse()}var jw=ee(Vl(),1);var mn=async(n,e,t)=>{t.codec==null&&(t.codec=Oe);let r=await re.digest(n),i=V.create(t.cidVersion,t.codec.code,r);return await e.put(i,n,{...t,signal:t.signal}),i};var Xf=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}},Jl=class extends Xf{_bucket;constructor(e,t){super(e,t),this._bucket=Vo({hashFn:Ko,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=Mw(this._bucket,this,this.options),this.nodeSize)}async*flush(e){for await(let t of zw(this._bucket,e,this,this.options))yield{...t,path:this.path}}};async function*zw(n,e,t,r){let i=n._children,o=[],s=0n;for(let d=0;d<i.length;d++){let f=i.get(d);if(f==null)continue;let m=d.toString(16).toUpperCase().padStart(2,"0");if(f instanceof Ot){let g;for await(let x of zw(f,e,null,r))g=x;if(g==null)throw new Error("Could not flush sharded directory, no subshard found");o.push({Name:m,Tsize:Number(g.size),Hash:g.cid}),s+=g.size}else if(QA(f.value)){let g=f.value,x;for await(let b of g.flush(e))x=b,yield x;if(x==null)throw new Error("Did not flush dir");let w=m+f.key;o.push({Name:w,Tsize:Number(x.size),Hash:x.cid}),s+=x.size}else{let g=f.value;if(g.cid==null)continue;let x=m+f.key,w=g.size;o.push({Name:x,Tsize:Number(w),Hash:g.cid}),s+=BigInt(w??0)}}let a=Uint8Array.from(i.bitField().reverse()),c=new W({type:"hamt-sharded-directory",data:a,fanout:BigInt(n.tableSize()),hashType:da,mtime:t?.mtime,mode:t?.mode}),u={Data:c.marshal(),Links:o},l=ue(_e(u)),p=await mn(l,e,r),h=BigInt(l.byteLength)+s;yield{cid:p,unixfs:c,size:h}}function QA(n){return typeof n.flush=="function"}function Mw(n,e,t){let r=n._children,i=[];for(let c=0;c<r.length;c++){let u=r.get(c);if(u==null)continue;let l=c.toString(16).toUpperCase().padStart(2,"0");if(u instanceof Ot){let p=Mw(u,null,t);i.push({Name:l,Tsize:Number(p),Hash:t.cidVersion===0?Ql:eu})}else if(typeof u.value.flush=="function"){let h=u.value.nodeSize();i.push({Name:l+u.key,Tsize:Number(h),Hash:t.cidVersion===0?Ql:eu})}else{let p=u.value;if(p.cid==null)continue;let h=l+u.key,d=p.size;i.push({Name:h,Tsize:Number(d),Hash:p.cid})}}let o=Uint8Array.from(r.bitField().reverse()),s=new W({type:"hamt-sharded-directory",data:o,fanout:BigInt(n.tableSize()),hashType:da,mtime:e?.mtime,mode:e?.mode});return ue(_e({Data:s.marshal(),Links:i})).length}var Ql=V.parse("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"),eu=V.parse("zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi");var Zf=ae("helia:unixfs:commands:utils:hamt-utils"),tu=n=>n.toString(16).toUpperCase().padStart(2,"0").substring(0,2),Hw=async(n,e,t)=>{let r=new Jl({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 r._bucket.put(e[o].name,{size:e[o].size,cid:e[o].cid});let i=await ri(r.flush(n));if(i==null)throw new Error("Flushing shard yielded no result");return i},nu=async(n,e,t)=>{let r=W.unmarshal(n[0].node.Data??new Uint8Array(0)),i=BigInt(Math.pow(2,Vi));n.reverse();let o,s;for(let a=0;a<n.length;a++){let c=a===n.length-1,u=n[a],l=Uint8Array.from(u.children.bitField().reverse()),p=new W({type:"hamt-sharded-directory",data:l,fanout:i,hashType:da});c&&(p.mtime=r.mtime,p.mode=r.mode),s={Data:p.marshal(),Links:u.node.Links};let h=ue(_e(s));if(o=await mn(h,e,t),!c){let d=n[a+1];if(d==null)throw new Error("Was not operating on shard root but also had no parent?");Zf("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,m)=>f+(m.Tsize??0),h.byteLength)})}}if(o==null||s==null)throw new Error("Noting persisted");return{cid:o,node:s}},ru=async(n,e,t,r)=>{let o=Zl(Ko)(Y(e)),s=[];for(;;){let a=await t.get(n,r),c=ke(a),u=new jw.default,l=await o.take(Vi),p=tu(l);s.push({prefix:p,children:u,node:c});let h;for(let f of c.Links){let m=f.Name??"";if(m.length<2)throw new Error("Invalid HAMT - link name was too short");let g=parseInt(m.substring(0,2),16);u.set(g,!0),m.startsWith(p)&&(h=f)}if(h==null){Zf("no link found with prefix %s for %s",p,e);break}let d=h.Name??"";if(d.length<2)throw new Error("Invalid HAMT - link name was too short");if(d.length===2){n=h.Hash,Zf("descend into sub-shard with prefix %s",d);continue}break}return{path:s,hash:o}};async function iu(n,e,t,r){if(n.Data==null)throw new Error("DagPB node had no data");let i=W.unmarshal(n.Data),o;if(i.type==="directory")o=eB(n);else if(i.type==="hamt-sharded-directory")o=await $w(n,0,t,e,r);else throw new Error("Can only estimate the size of directories or shards");return o>t}function eB(n){let e=0;for(let t of n.Links)e+=(t.Name??"").length,e+=t.Hash.version===1?eu.bytes.byteLength:Ql.bytes.byteLength;return e}async function $w(n,e,t,r,i){if(e>t)return t;if(n.Data==null||!W.unmarshal(n.Data).isDirectory())return e;for(let s of n.Links){let a=s.Name??"";if(a=a.substring(2),e+=a.length,e+=s.Hash.bytes.byteLength,s.Hash.code===Ce){let c=await r.get(s.Hash,i),u=ke(c);e+=await $w(u,e,t,r,i)}}return e}var Vn=ae("helia:unixfs:components:utils:add-link");async function qo(n,e,t,r){if(n.node.Data==null)throw new st("Invalid parent passed to addLink");if(W.unmarshal(n.node.Data).type==="hamt-sharded-directory")return Vn("adding link to sharded directory"),rB(n,e,t,r);Vn(`adding ${e.Name} (${e.Hash}) to regular directory`);let o=await nB(n,e,t,r);if(await iu(o.node,t,r.shardSplitThresholdBytes,r)){Vn("converting directory to sharded directory");let s=await tB(o,t);o.cid=s.cid,o.node=ke(await t.get(s.cid,r))}return o}var tB=async(n,e)=>{if(n.node.Data==null)throw new st("Invalid parent passed to convertToShardedDirectory");let t=W.unmarshal(n.node.Data),r=await Hw(e,n.node.Links.map(i=>({name:i.Name??"",size:BigInt(i.Tsize??0),cid:i.Hash})),{mode:t.mode,mtime:t.mtime,cidVersion:n.cid.version});return Vn(`converted directory to sharded directory ${r.cid}`),r},nB=async(n,e,t,r)=>{let i=n.node.Links.filter(l=>{let p=l.Name===e.Name;if(p&&!r.allowOverwriting)throw new pa;return!p});if(i.push(e),n.node.Data==null)throw new dt("Parent node with no data passed to addToDirectory");let o=W.unmarshal(n.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=n.node.Data;n.node=_e({Data:s,Links:i});let a=ue(n.node),c=await re.digest(a),u=V.create(n.cid.version,Ce,c);return await t.put(u,a),{node:n.node,cid:u}},rB=async(n,e,t,r)=>{let{path:i,hash:o}=await ru(n.cid,e.Name,t,r),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);Vn("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(Vn("link %s was present in shard",u),l.Name===u){if(!r.allowOverwriting)throw new pa;Vn("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?!");{Vn("prefix %s already exists, creating new subshard",a);let p=s.node.Links.findIndex(g=>g.Name?.startsWith(a)),h=s.node.Links.splice(p,1)[0],d=(h.Name??"").substring(2),m=Zl(Ko)(Y(d));for(let g=0;g<i.length;g++)await m.take(Vi);for(;;){let g=await m.take(Vi),x=tu(g);h.Name=`${x}${d}`;let w=await o.take(Vi),b=tu(w);if(x===b){let B=new Jf.default;B.set(w,!0),i.push({prefix:b,children:B,node:{Links:[]}});continue}let A=new Jf.default;A.set(w,!0),A.set(g,!0),i.push({prefix:a,children:A,node:{Links:[h,{Name:`${b}${e.Name}`,Hash:e.Hash,Tsize:e.Tsize}]}});break}}}else Vn("link %s was not present in sub-shard",u),e.Name=u,s.node.Links.push(e),s.children.set(c,!0),Vn("adding %s to existing sub-shard",u);return nu(i,t,r)};async function oi(n,e,t={}){let r=await Qe(n,e,t);if(r.type!=="directory")throw new ii(`${n.toString()} was not a UnixFS directory`);return{cid:n,node:r.node}}async function Go(n,e,t,r){let i=await Qe(n,t,r);if(i.type!=="directory"&&i.type!=="file"&&i.type!=="raw")throw new Fn(`${n.toString()} was not a UnixFS node`);return{Name:e,Tsize:i.node instanceof Uint8Array?i.node.byteLength:iB(i.node),Hash:n}}function iB(n){let e=n.Links.reduce((t,r)=>t+(r.Tsize??0),0);return ue(n).byteLength+e}var Qf=ae("helia:unixfs:components:utils:resolve");async function zn(n,e,t,r){if(e==null||e==="")return{cid:n};Qf('resolve "%s" under %c',e,n);let i=e.split("/").filter(Boolean),o=[{name:"",cid:n,size:0n}];for(let s=0;s<i.length;s++){let a=i[s],c=await Qe(n,t,r);if(Qf('resolving "%s"',a,c),c.type==="file"){if(s<i.length-1)throw new st("Path was invalid");n=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 Wl("Could not find path in directory");n=u,o.push({name:a,cid:n,size:c.size})}else throw new st("Could not resolve path")}return Qf("resolved %s to %c",e,n),{cid:n,path:e,segments:o}}async function Wo(n,e,t,r){if(e.segments==null||e.segments.length===0)return n;let i=e.segments.pop();if(i==null)throw new Error("Insufficient segments");i.cid=n,e.segments.reverse();for(let o of e.segments){let[s,a]=await Promise.all([oi(o.cid,t,r),Go(i.cid,i.name,t,r)]);n=(await qo(s,a,t,{...r,allowOverwriting:!0,cidVersion:n.version})).cid,o.cid=n,i=o}return n}var oB=ot.bind({ignoreUndefined:!0}),sB={};async function*Kw(n,e,t={}){let r=oB(sB,t),i=await zn(n,r.path,e,r),o=await Qe(i.cid,e,r);if(o.type!=="file"&&o.type!=="raw")throw new Yl;if(o.content==null)throw new $o;yield*o.content(r)}var aB=ot.bind({ignoreUndefined:!0}),cB=ae("helia:unixfs:chmod"),lB={recursive:!1,shardSplitThresholdBytes:262144};async function qw(n,e,t,r={}){let i=aB(lB,r),o=await zn(n,i.path,t,r);if(cB("chmod %c %d",o.cid,e),i.recursive){let h=await Zt(async function*(){for await(let d of Kl(o.cid,t,r)){let f,m=[];if(d.type==="raw")f=new W({type:"file",data:d.node});else if(d.type==="file"||d.type==="directory")f=d.unixfs,m=d.node.Links;else throw new Fn;f.mode=e;let g={Data:f.marshal(),Links:m};yield{path:d.path,content:g}}},d=>ni(d,t,{...i,dagBuilder:async function*(f,m){for await(let g of f)yield async function(){let x=g.content,w=ue(x),b=await mn(w,m,{...i,cidVersion:n.version});if(x.Data==null)throw new dt(`${b} had no data`);let A=W.unmarshal(x.Data);return{cid:b,size:BigInt(w.length),path:g.path,unixfs:A}}}}),async d=>ri(d));if(h==null)throw new br(`Could not chmod ${o.cid.toString()}`);return Wo(h.cid,o,t,i)}let s=await t.get(o.cid,r),a,c=[];if(o.cid.code===Le)a=new W({type:"file",data:s});else{let h=ke(s);if(h.Data==null)throw new dt(`${o.cid.toString()} had no data`);c=h.Links,a=W.unmarshal(h.Data)}a.mode=e;let u=ue({Data:a.marshal(),Links:c}),l=await re.digest(u),p=V.create(o.cid.version,Ce,l);return await t.put(p,u),Wo(p,o,t,i)}var uB=ot.bind({ignoreUndefined:!0}),pB=ae("helia:unixfs:cp"),dB={force:!1,shardSplitThresholdBytes:262144};async function Gw(n,e,t,r,i={}){let o=uB(dB,i);if(t.includes("/"))throw new st("Name must not have slashes");let[s,a]=await Promise.all([oi(e,r,o),Go(n,t,r,o)]);return pB('Adding %c as "%s" to %c',n,t,e),(await qo(s,a,r,{allowOverwriting:o.force,cidVersion:e.version,...o})).cid}var fB=ot.bind({ignoreUndefined:!0}),hB={};async function*Ww(n,e,t={}){let r=fB(hB,t),i=await zn(n,r.path,e,r),o=await Qe(i.cid,e);if(o.type==="file"||o.type==="raw"){yield o;return}if(o.content==null)throw new $o;if(o.type!=="directory")throw new ii;yield*o.content({offset:t.offset,length:t.length})}var mB=ot.bind({ignoreUndefined:!0}),Yw=ae("helia:unixfs:mkdir"),gB={cidVersion:1,force:!1,shardSplitThresholdBytes:262144};async function Xw(n,e,t,r={}){let i=mB(gB,r);if(e.includes("/"))throw new st("Path must not have slashes");if((await Qe(n,t,r)).type!=="directory")throw new ii(`${n.toString()} was not a UnixFS directory`);Yw("creating %s",e);let a={Data:new W({type:"directory",mode:i.mode,mtime:i.mtime}).marshal(),Links:[]},c=ue(a),u=await re.digest(c),l=V.create(i.cidVersion,Ce,u);await t.put(l,c);let[p,h]=await Promise.all([oi(n,t,i),Go(l,e,t,i)]);return Yw("adding empty dir called %s to %c",e,n),(await qo(p,h,t,{...i,allowOverwriting:i.force})).cid}var ou=ae("helia:unixfs:utils:remove-link");async function Zw(n,e,t,r){if(n.node.Data==null)throw new dt("Parent node had no data");if(W.unmarshal(n.node.Data).type==="hamt-sharded-directory"){ou(`removing ${e} from sharded directory`);let o=await yB(n,e,t,r);return await iu(o.node,t,r.shardSplitThresholdBytes,r)?o:(ou("converting shard to flat directory %c",n.cid),wB(o,t,r))}return ou(`removing link ${e} regular directory`),xB(n,e,t,r)}var xB=async(n,e,t,r)=>{n.node.Links=n.node.Links.filter(s=>s.Name!==e);let i=ue(n.node),o=await mn(i,t,{...r,cidVersion:n.cid.version});return ou(`Updated regular directory ${o}`),{node:n.node,cid:o}},yB=async(n,e,t,r)=>{let{path:i}=await ru(n.cid,e,t,r),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(h=>!(h.Name??"").startsWith(l.prefix)),l.node.Links.push({Hash:p.Hash,Name:`${l.prefix}${(p.Name??"").substring(2)}`,Tsize:p.Tsize})}return nu(i,t,r)},wB=async(n,e,t)=>{if(n.node.Data==null)throw new st("Invalid parent passed to convertToFlatDirectory");let r={Links:[]},i=await Qe(n.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=ue(c.node).length,r.Links.push({Hash:c.cid,Name:c.name,Tsize:u})}let o=W.unmarshal(n.node.Data);r.Data=new W({type:"directory",mode:o.mode,mtime:o.mtime}).marshal();let s=ue(_e(r));return{cid:await mn(s,e,{codec:Oe,cidVersion:n.cid.version,signal:t.signal}),node:r}};var bB=ot.bind({ignoreUndefined:!0}),vB=ae("helia:unixfs:rm"),EB={shardSplitThresholdBytes:262144};async function Jw(n,e,t,r={}){let i=bB(EB,r);if(e.includes("/"))throw new st("Name must not have slashes");let o=await oi(n,t,i);return vB("Removing %s from %c",e,n),(await Zw(o,e,t,{...i,cidVersion:n.version})).cid}var kB=ot.bind({ignoreUndefined:!0}),AB=ae("helia:unixfs:stat"),BB={};async function Qw(n,e,t={}){let r=kB(BB,t),i=await zn(n,t.path,e,r);AB("stat %c",i.cid);let o=await Qe(i.cid,e,r);if(o.type!=="file"&&o.type!=="directory"&&o.type!=="raw")throw new Fn;let s=0n,a=0n,c=0n,u=0n,l=0,p,h,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,h=o.unixfs.mtime,f=o.unixfs),o.type==="file"){let m=await eb(i.cid,e,r);s=o.unixfs.fileSize(),a=BigInt((o.node.Data?.byteLength??0)+o.node.Links.reduce((g,x)=>g+(x.Tsize??0),0)),c=BigInt(m.localFileSize),u=BigInt(m.localDagSize),l=m.blocks,p=o.unixfs.mode,h=o.unixfs.mtime,f=o.unixfs}return{cid:i.cid,mode:p,mtime:h,fileSize:s,dagSize:a,localFileSize:c,localDagSize:u,blocks:l,type:d,unixfs:f}}async function eb(n,e,t){let r={localFileSize:0,localDagSize:0,blocks:0};if(await e.has(n,t)){let i=await e.get(n,t);if(r.blocks++,r.localDagSize+=i.byteLength,n.code===Le)r.localFileSize+=i.byteLength;else if(n.code===Ce){let o=ke(i);if(o.Links.length>0)for(let s of o.Links){let a=await eb(s.Hash,e,t);r.localFileSize+=a.localFileSize,r.localDagSize+=a.localDagSize,r.blocks+=a.blocks}else{if(o.Data==null)throw new dt(`PBNode ${n.toString()} had no data`);let s=W.unmarshal(o.Data);if(s.data==null)throw new dt(`UnixFS node ${n.toString()} had no data`);r.localFileSize+=s.data.byteLength??0}}else throw new br(`${n.toString()} was neither DAG_PB nor RAW`)}return r}var IB=ot.bind({ignoreUndefined:!0}),SB=ae("helia:unixfs:touch"),_B={recursive:!1,shardSplitThresholdBytes:262144};async function tb(n,e,t={}){let r=IB(_B,t),i=await zn(n,r.path,e,r),o=r.mtime??{secs:BigInt(Math.round(Date.now()/1e3)),nsecs:0};if(SB("touch %c %o",i.cid,o),r.recursive){let h=await Zt(async function*(){for await(let d of Kl(i.cid,e)){let f,m;if(d.type==="raw")f=new W({data:d.node}),m=[];else if(d.type==="file"||d.type==="directory")f=d.unixfs,m=d.node.Links;else throw new Fn;f.mtime=o;let g={Data:f.marshal(),Links:m};yield{path:d.path,content:g}}},d=>ni(d,e,{...r,dagBuilder:async function*(f,m){for await(let g of f)yield async function(){let x=g.content,w=ue(x),b=await mn(w,m,{...r,cidVersion:n.version});if(x.Data==null)throw new dt(`${b} had no data`);let A=W.unmarshal(x.Data);return{cid:b,size:BigInt(w.length),path:g.path,unixfs:A}}}}),async d=>ri(d));if(h==null)throw new br(`Could not chmod ${i.cid.toString()}`);return Wo(h.cid,i,e,r)}let s=await e.get(i.cid,t),a,c=[];if(i.cid.code===Le)a=new W({data:s});else{let h=ke(s);if(c=h.Links,h.Data==null)throw new dt(`${i.cid.toString()} had no data`);a=W.unmarshal(h.Data)}a.mtime=o;let u=ue({Data:a.marshal(),Links:c}),l=await re.digest(u),p=V.create(i.cid.version,Ce,l);return await e.put(p,u),Wo(p,i,e,r)}var eh=class{components;constructor(e){this.components=e}async*addAll(e,t={}){yield*aw(e,this.components.blockstore,t)}async addBytes(e,t={}){return cw(e,this.components.blockstore,t)}async addByteStream(e,t={}){return lw(e,this.components.blockstore,t)}async addFile(e,t={}){return uw(e,this.components.blockstore,t)}async addDirectory(e={},t={}){return pw(e,this.components.blockstore,t)}async*cat(e,t={}){yield*Kw(e,this.components.blockstore,t)}async chmod(e,t,r={}){return qw(e,t,this.components.blockstore,r)}async cp(e,t,r,i={}){return Gw(e,t,r,this.components.blockstore,i)}async*ls(e,t={}){yield*Ww(e,this.components.blockstore,t)}async mkdir(e,t,r={}){return Xw(e,t,this.components.blockstore,r)}async rm(e,t,r={}){return Jw(e,t,this.components.blockstore,r)}async stat(e,t={}){return Qw(e,this.components.blockstore,t)}async touch(e,t={}){return tb(e,this.components.blockstore,t)}};function nb(n){return new eh(n)}var wb=ee(yb(),1),ZB="application/octet-stream",JB=/^(<\?xml[^>]+>)?[^<^\w]+<svg/ig,QB=[async({bytes:n})=>JB.test(new TextDecoder().decode(n.slice(0,64)))?"image/svg+xml":void 0,async({path:n})=>{let e=wb.default.lookup(n);if(e!==!1)return e}],e8={"video/quicktime":"video/mp4"};function t8(n){return e8[n]??n}async function bb(n){for(let e of QB){let t=await e(n);if(t!==void 0)return t8(t)}return ZB}async function vb(n,e,t,r){let i=t.forComponent("helia:verified-fetch:get-stream-and-content-type"),o=n[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 bb({bytes:s,path:e}),u=new ReadableStream({async start(l){r?.onProgress?.(new P("verified-fetch:request:progress:chunk")),l.enqueue(s)},async pull(l){let{value:p,done:h}=await o.next();if(h===!0){p!=null&&(r?.onProgress?.(new P("verified-fetch:request:progress:chunk")),l.enqueue(p)),l.close();return}r?.onProgress?.(new P("verified-fetch:request:progress:chunk")),l.enqueue(p)}});return{contentType:c,stream:u}}var Eb=ee(cf(),1),xu=class{lru;constructor(e){this.lru=(0,Eb.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,r){this.lru.set(e,{value:t,expire:Date.now()+r})}has(e){return this.get(e)!=null}remove(e){this.lru.remove(e)}clear(){this.lru.clear()}};var uh=new xu(1e3),n8=/^(?<protocol>ip[fn]s):\/\/(?<cidOrPeerIdOrDnsLink>[^/$?]+)\/?(?<path>[^$?]*)\??(?<queryString>.*)$/;async function kb({urlString:n,ipns:e,logger:t},r){let i=t.forComponent("helia:verified-fetch:parse-url-string"),o=n.match(n8);if(o==null||o.groups==null)throw new TypeError(`Invalid URL: ${n}, please use ipfs:// or ipns:// URLs only.`);let{protocol:s,cidOrPeerIdOrDnsLink:a,path:c,queryString:u}=o.groups,l,p,h=[];if(s==="ipfs")try{l=V.parse(a)}catch(g){i.error(g),h.push(new TypeError("Invalid CID for ipfs://<cid> URL"))}else{let g=uh.get(a);if(g!=null)l=g.cid,p=g.path,i.trace("resolved %s to %c from cache",a,l);else{i.trace("Attempting to resolve PeerId for %s",a);let x=null;try{x=Jt(a),g=await e.resolve(x,{onProgress:r?.onProgress}),l=g?.cid,p=g?.path,i.trace("resolved %s to %c",a,l),uh.set(a,g,60*1e3*2)}catch(w){x==null?(i.error('Could not parse PeerId string "%s"',a,w),h.push(new TypeError(`Could not parse PeerId in ipns url "${a}", ${w.message}`))):(i.error("Could not resolve PeerId %c",x,w),h.push(new TypeError(`Could not resolve PeerId "${a}", ${w.message}`)))}if(l==null){i.trace("Attempting to resolve DNSLink for %s",a);try{g=await e.resolveDns(a,{onProgress:r?.onProgress}),l=g?.cid,p=g?.path,i.trace("resolved %s to %c",a,l),uh.set(a,g,60*1e3*2)}catch(w){i.error('Could not resolve DnsLink for "%s"',a,w),h.push(w)}}}}if(l==null)throw new AggregateError(h,`Invalid resource. Cannot determine CID from URL "${n}"`);let d={};if(u!=null&&u.length>0){let g=u.split("&");for(let x of g){let[w,b]=x.split("=");d[w]=decodeURIComponent(b)}}let f=[];c.length>0&&f.push(c),p!=null&&p.length>0&&f.push(p);let m=f.join("/");return{protocol:s,cid:l,path:m,query:d}}async function Ab(n,{ipns:e,logger:t},r){if(typeof n=="string")return kb({urlString:n,ipns:e,logger:t},{onProgress:r?.onProgress});let i=V.asCID(n);if(i!=null)return{cid:i,protocol:"ipfs",path:"",query:{}};throw new TypeError(`Invalid resource. Cannot determine CID from resource: ${n}`)}async function Bb(n,e,t){let r=[],i;for await(let o of Gf(e,n,t))r.push(o.cid),i=o;if(i==null)throw new Error("No terminal element found");return{ipfsRoots:r,terminalElement:i}}function r8(n){if(n==null)return;let e;return n?.signal===null&&(e=void 0),{...n,signal:e}}var yu=class{helia;ipns;unixfs;dagJson;dagCbor;json;pathWalker;log;constructor({helia:e,ipns:t,unixfs:r,dagJson:i,json:o,dagCbor:s,pathWalker:a},c){this.helia=e,this.log=e.logger.forComponent("helia:verified-fetch"),this.ipns=t??Mx(e,{resolvers:[Dl("https://mozilla.cloudflare-dns.com/dns-query"),Dl("https://dns.google/resolve")]}),this.unixfs=r??nb(e),this.dagJson=i??Ex(e),this.json=o??wy(e),this.dagCbor=s??vx(e),this.pathWalker=a??Bb,this.log.trace("created VerifiedFetch instance")}async handleIPNSRecord({cid:e,path:t,options:r}){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:r}){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:r}){this.log.trace("fetching %c/%s",e,t),r?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.dagJson.get(e,{signal:r?.signal,onProgress:r?.onProgress});r?.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:r}){this.log.trace("fetching %c/%s",e,t),r?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.json.get(e,{signal:r?.signal,onProgress:r?.onProgress});r?.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:r}){this.log.trace("fetching %c/%s",e,t),r?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.dagCbor.get(e,{signal:r?.signal,onProgress:r?.onProgress});r?.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:r,terminalElement:i}){this.log.trace("fetching %c/%s",e,t);let o=i?.cid??e,s;if(i?.type==="directory"){let p=i.cid,h="index.html";try{this.log.trace("found directory at %c/%s, looking for index.html",e,t),r?.onProgress?.(new P("verified-fetch:request:start",{cid:p.toString(),path:h})),s=await this.unixfs.stat(p,{path:h,signal:r?.signal,onProgress:r?.onProgress}),this.log.trace("found root file at %c/%s with cid %c",p,h,s.cid),t=h,o=s.cid}catch(d){return this.log("error loading path %c/%s",p,h,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{r?.onProgress?.(new P("verified-fetch:request:end",{cid:p.toString(),path:h}))}}r?.onProgress?.(new P("verified-fetch:request:start",{cid:o.toString(),path:""}));let a=this.unixfs.cat(o,{signal:r?.signal,onProgress:r?.onProgress});r?.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 vb(a,t??"",this.helia.logger,{onProgress:r?.onProgress}),l=new Response(u,{status:200});return l.headers.set("content-type",c),l}async handleRaw({cid:e,path:t,options:r}){this.log.trace("fetching %c/%s",e,t),r?.onProgress?.(new P("verified-fetch:request:start",{cid:e.toString(),path:t}));let i=await this.helia.blockstore.get(e);r?.onProgress?.(new P("verified-fetch:request:end",{cid:e.toString(),path:t}));let o=new Response(op(i),{status:200});return o.headers.set("content-type","application/octet-stream"),o}getFormat({headerFormat:e,queryFormat:t}){let r={"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 r)if(e.includes(i))return r[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={[Zr]:this.handleDagJson,[Ce]:this.handleDagPb,[Tr]:this.handleJson,[Yr]:this.handleDagCbor,[Le]:this.handleRaw};async fetch(e,t){let r=r8(t),{path:i,query:o,...s}=await Ab(e,{ipns:this.ipns,logger:this.helia.logger},r),a=s.cid,c,u=this.getFormat({headerFormat:new Headers(r?.headers).get("accept"),queryFormat:o.format??null});if(u!=null){let h=this.formatHandlers[u];if(h!=null&&(c=await h.call(this,{cid:a,path:i,options:r}),c.status===501))return c}let l,p;try{let h=await this.pathWalker(this.helia.blockstore,`${a.toString()}/${i}`,r);p=h.ipfsRoots,l=h.terminalElement}catch(h){this.log.error("Error walking path %s",i,h)}if(c==null){let h=this.codecHandlers[a.code];if(h!=null)c=await h.call(this,{cid:a,path:i,options:r,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(h=>h.toV1().toString()).join(",")),c}async start(){await this.helia.start()}async stop(){await this.helia.stop()}};var ma,wu=async function(e,t){return ma==null&&(ma=await ph()),ma(e,t)};wu.start=async function(){await ma?.start()};wu.stop=async function(){await ma?.stop()};async function ph(n){i8(n)||(n=await bx({blockBrokers:[os({gateways:n?.gateways})],routers:(n?.routers??["https://delegated-ipfs.dev"]).map(r=>Vs(r))}));let e=new yu({helia:n});async function t(r,i){return e.fetch(r,i)}return t.stop=e.stop.bind(e),t.start=e.start.bind(e),t}function i8(n){return n?.blockstore!=null&&n?.datastore!=null&&n?.gc!=null&&n?.stop!=null&&n?.start!=null}return Vb(o8);})();
|
|
18
|
+
/*! Bundled license information:
|
|
19
|
+
|
|
20
|
+
pvtsutils/build/index.js:
|
|
21
|
+
(*!
|
|
22
|
+
* MIT License
|
|
23
|
+
*
|
|
24
|
+
* Copyright (c) 2017-2022 Peculiar Ventures, LLC
|
|
25
|
+
*
|
|
26
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
27
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
28
|
+
* in the Software without restriction, including without limitation the rights
|
|
29
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
30
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
31
|
+
* furnished to do so, subject to the following conditions:
|
|
32
|
+
*
|
|
33
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
34
|
+
* copies or substantial portions of the Software.
|
|
35
|
+
*
|
|
36
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
37
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
38
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
39
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
40
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
41
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
42
|
+
* SOFTWARE.
|
|
43
|
+
*
|
|
44
|
+
*)
|
|
45
|
+
|
|
46
|
+
ieee754/index.js:
|
|
47
|
+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
48
|
+
|
|
49
|
+
buffer/index.js:
|
|
50
|
+
(*!
|
|
51
|
+
* The buffer module from node.js, for the browser.
|
|
52
|
+
*
|
|
53
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
54
|
+
* @license MIT
|
|
55
|
+
*)
|
|
56
|
+
|
|
57
|
+
mime-db/index.js:
|
|
58
|
+
(*!
|
|
59
|
+
* mime-db
|
|
60
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
61
|
+
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|
62
|
+
* MIT Licensed
|
|
63
|
+
*)
|
|
64
|
+
|
|
65
|
+
mime-types/index.js:
|
|
66
|
+
(*!
|
|
67
|
+
* mime-types
|
|
68
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
69
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
70
|
+
* MIT Licensed
|
|
71
|
+
*)
|
|
72
|
+
|
|
73
|
+
@noble/hashes/esm/utils.js:
|
|
74
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
75
|
+
|
|
76
|
+
@noble/curves/esm/abstract/utils.js:
|
|
77
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
78
|
+
|
|
79
|
+
@noble/curves/esm/abstract/modular.js:
|
|
80
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
81
|
+
|
|
82
|
+
@noble/curves/esm/abstract/curve.js:
|
|
83
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
84
|
+
|
|
85
|
+
@noble/curves/esm/abstract/edwards.js:
|
|
86
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
87
|
+
|
|
88
|
+
@noble/curves/esm/ed25519.js:
|
|
89
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
90
|
+
|
|
91
|
+
pvutils/build/utils.es.js:
|
|
92
|
+
(*!
|
|
93
|
+
Copyright (c) Peculiar Ventures, LLC
|
|
94
|
+
*)
|
|
95
|
+
|
|
96
|
+
asn1js/build/index.es.js:
|
|
97
|
+
(*!
|
|
98
|
+
* Copyright (c) 2014, GMO GlobalSign
|
|
99
|
+
* Copyright (c) 2015-2022, Peculiar Ventures
|
|
100
|
+
* All rights reserved.
|
|
101
|
+
*
|
|
102
|
+
* Author 2014-2019, Yury Strozhevsky
|
|
103
|
+
*
|
|
104
|
+
* Redistribution and use in source and binary forms, with or without modification,
|
|
105
|
+
* are permitted provided that the following conditions are met:
|
|
106
|
+
*
|
|
107
|
+
* * Redistributions of source code must retain the above copyright notice, this
|
|
108
|
+
* list of conditions and the following disclaimer.
|
|
109
|
+
*
|
|
110
|
+
* * Redistributions in binary form must reproduce the above copyright notice, this
|
|
111
|
+
* list of conditions and the following disclaimer in the documentation and/or
|
|
112
|
+
* other materials provided with the distribution.
|
|
113
|
+
*
|
|
114
|
+
* * Neither the name of the copyright holder nor the names of its
|
|
115
|
+
* contributors may be used to endorse or promote products derived from
|
|
116
|
+
* this software without specific prior written permission.
|
|
117
|
+
*
|
|
118
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
119
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
120
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
121
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
122
|
+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
123
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
124
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
125
|
+
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
126
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
127
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
128
|
+
*
|
|
129
|
+
*)
|
|
130
|
+
|
|
131
|
+
@noble/curves/esm/abstract/weierstrass.js:
|
|
132
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
133
|
+
|
|
134
|
+
@noble/curves/esm/_shortw_utils.js:
|
|
135
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
136
|
+
|
|
137
|
+
@noble/curves/esm/secp256k1.js:
|
|
138
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
139
|
+
*/
|
|
140
|
+
return HeliaVerifiedFetch}));
|