Dorian 0d073fa89e Add comprehensive installation and setup documentation
- Add GETTING_STARTED.md with quick start guide and development modes
- Add INSTALL.sh automated installation script
- Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md
- Add QUICK_REFERENCE.md for common commands
- Add SETUP_GUIDE.md with detailed setup instructions
- Update README.md with improved project overview
- Add did-wallet app dependencies and node_modules
2026-01-27 17:18:21 +00:00

4 lines
103 KiB
JavaScript

(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.IpfsUnixfsExporter = factory()}(typeof self !== 'undefined' ? self : this, function () {
"use strict";var IpfsUnixfsExporter=(()=>{var Qs=Object.create;var Ct=Object.defineProperty;var qs=Object.getOwnPropertyDescriptor;var Ws=Object.getOwnPropertyNames;var Xs=Object.getPrototypeOf,Js=Object.prototype.hasOwnProperty;var O=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),W=(t,e)=>{for(var r in e)Ct(t,r,{get:e[r],enumerable:!0})},Tn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ws(e))!Js.call(t,i)&&i!==r&&Ct(t,i,{get:()=>e[i],enumerable:!(n=qs(e,i))||n.enumerable});return t};var H=(t,e,r)=>(r=t!=null?Qs(Xs(t)):{},Tn(e||!t||!t.__esModule?Ct(r,"default",{value:t,enumerable:!0}):r,t)),Ks=t=>Tn(Ct({},"__esModule",{value:!0}),t);var fe=O((Gu,Nn)=>{"use strict";function Sn(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Zs(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Sn(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),Sn(new i,r)}}Nn.exports=Zs});var oo=O((Hl,io)=>{"use strict";io.exports=Sc;function Sc(t,e){for(var r=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise(function(c,a){r[n]=function(l){if(o)if(o=!1,l)a(l);else{for(var m=new Array(arguments.length-1),A=0;A<m.length;)m[A++]=arguments[A];c.apply(null,m)}};try{t.apply(e||null,r)}catch(f){o&&(o=!1,a(f))}})}});var uo=O(co=>{"use strict";var Xt=co;Xt.length=function(e){var r=e.length;if(!r)return 0;for(var n=0;--r%4>1&&e.charAt(r)==="=";)++n;return Math.ceil(e.length*3)/4-n};var Ke=new Array(64),ao=new Array(123);for(se=0;se<64;)ao[Ke[se]=se<26?se+65:se<52?se+71:se<62?se-4:se-59|43]=se++;var se;Xt.encode=function(e,r,n){for(var i=null,o=[],s=0,c=0,a;r<n;){var f=e[r++];switch(c){case 0:o[s++]=Ke[f>>2],a=(f&3)<<4,c=1;break;case 1:o[s++]=Ke[a|f>>4],a=(f&15)<<2,c=2;break;case 2:o[s++]=Ke[a|f>>6],o[s++]=Ke[f&63],c=0;break}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0)}return c&&(o[s++]=Ke[a],o[s++]=61,c===1&&(o[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var so="invalid encoding";Xt.decode=function(e,r,n){for(var i=n,o=0,s,c=0;c<e.length;){var a=e.charCodeAt(c++);if(a===61&&o>1)break;if((a=ao[a])===void 0)throw Error(so);switch(o){case 0:s=a,o=1;break;case 1:r[n++]=s<<2|(a&48)>>4,s=a,o=2;break;case 2:r[n++]=(s&15)<<4|(a&60)>>2,s=a,o=3;break;case 3:r[n++]=(s&3)<<6|a,o=0;break}}if(o===1)throw Error(so);return n-i};Xt.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var lo=O((jl,fo)=>{"use strict";fo.exports=Jt;function Jt(){this._listeners={}}Jt.prototype.on=function(e,r,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:n||this}),this};Jt.prototype.off=function(e,r){if(e===void 0)this._listeners={};else if(r===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i<n.length;)n[i].fn===r?n.splice(i,1):++i;return this};Jt.prototype.emit=function(e){var r=this._listeners[e];if(r){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<r.length;)r[i].fn.apply(r[i++].ctx,n)}return this}});var bo=O((Gl,wo)=>{"use strict";wo.exports=ho(ho);function ho(t){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),n=r[3]===128;function i(a,f,l){e[0]=a,f[l]=r[0],f[l+1]=r[1],f[l+2]=r[2],f[l+3]=r[3]}function o(a,f,l){e[0]=a,f[l]=r[3],f[l+1]=r[2],f[l+2]=r[1],f[l+3]=r[0]}t.writeFloatLE=n?i:o,t.writeFloatBE=n?o:i;function s(a,f){return r[0]=a[f],r[1]=a[f+1],r[2]=a[f+2],r[3]=a[f+3],e[0]}function c(a,f){return r[3]=a[f],r[2]=a[f+1],r[1]=a[f+2],r[0]=a[f+3],e[0]}t.readFloatLE=n?s:c,t.readFloatBE=n?c:s}():function(){function e(n,i,o,s){var c=i<0?1:0;if(c&&(i=-i),i===0)n(1/i>0?0:2147483648,o,s);else if(isNaN(i))n(2143289344,o,s);else if(i>34028234663852886e22)n((c<<31|2139095040)>>>0,o,s);else if(i<11754943508222875e-54)n((c<<31|Math.round(i/1401298464324817e-60))>>>0,o,s);else{var a=Math.floor(Math.log(i)/Math.LN2),f=Math.round(i*Math.pow(2,-a)*8388608)&8388607;n((c<<31|a+127<<23|f)>>>0,o,s)}}t.writeFloatLE=e.bind(null,po),t.writeFloatBE=e.bind(null,mo);function r(n,i,o){var s=n(i,o),c=(s>>31)*2+1,a=s>>>23&255,f=s&8388607;return a===255?f?NaN:c*(1/0):a===0?c*1401298464324817e-60*f:c*Math.pow(2,a-150)*(f+8388608)}t.readFloatLE=r.bind(null,yo),t.readFloatBE=r.bind(null,go)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),n=r[7]===128;function i(a,f,l){e[0]=a,f[l]=r[0],f[l+1]=r[1],f[l+2]=r[2],f[l+3]=r[3],f[l+4]=r[4],f[l+5]=r[5],f[l+6]=r[6],f[l+7]=r[7]}function o(a,f,l){e[0]=a,f[l]=r[7],f[l+1]=r[6],f[l+2]=r[5],f[l+3]=r[4],f[l+4]=r[3],f[l+5]=r[2],f[l+6]=r[1],f[l+7]=r[0]}t.writeDoubleLE=n?i:o,t.writeDoubleBE=n?o:i;function s(a,f){return r[0]=a[f],r[1]=a[f+1],r[2]=a[f+2],r[3]=a[f+3],r[4]=a[f+4],r[5]=a[f+5],r[6]=a[f+6],r[7]=a[f+7],e[0]}function c(a,f){return r[7]=a[f],r[6]=a[f+1],r[5]=a[f+2],r[4]=a[f+3],r[3]=a[f+4],r[2]=a[f+5],r[1]=a[f+6],r[0]=a[f+7],e[0]}t.readDoubleLE=n?s:c,t.readDoubleBE=n?c:s}():function(){function e(n,i,o,s,c,a){var f=s<0?1:0;if(f&&(s=-s),s===0)n(0,c,a+i),n(1/s>0?0:2147483648,c,a+o);else if(isNaN(s))n(0,c,a+i),n(2146959360,c,a+o);else if(s>17976931348623157e292)n(0,c,a+i),n((f<<31|2146435072)>>>0,c,a+o);else{var l;if(s<22250738585072014e-324)l=s/5e-324,n(l>>>0,c,a+i),n((f<<31|l/4294967296)>>>0,c,a+o);else{var m=Math.floor(Math.log(s)/Math.LN2);m===1024&&(m=1023),l=s*Math.pow(2,-m),n(l*4503599627370496>>>0,c,a+i),n((f<<31|m+1023<<20|l*1048576&1048575)>>>0,c,a+o)}}}t.writeDoubleLE=e.bind(null,po,0,4),t.writeDoubleBE=e.bind(null,mo,4,0);function r(n,i,o,s,c){var a=n(s,c+i),f=n(s,c+o),l=(f>>31)*2+1,m=f>>>20&2047,A=4294967296*(f&1048575)+a;return m===2047?A?NaN:l*(1/0):m===0?l*5e-324*A:l*Math.pow(2,m-1075)*(A+4503599627370496)}t.readDoubleLE=r.bind(null,yo,0,4),t.readDoubleBE=r.bind(null,go,4,0)}(),t}function po(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function mo(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=t&255}function yo(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function go(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var xo=O((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}});var vo=O(_o=>{"use strict";var Hr=_o;Hr.length=function(e){for(var r=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?r+=1:n<2048?r+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,r+=4):r+=3;return r};Hr.read=function(e,r,n){var i=n-r;if(i<1)return"";for(var o=null,s=[],c=0,a;r<n;)a=e[r++],a<128?s[c++]=a:a>191&&a<224?s[c++]=(a&31)<<6|e[r++]&63:a>239&&a<365?(a=((a&7)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,s[c++]=55296+(a>>10),s[c++]=56320+(a&1023)):s[c++]=(a&15)<<12|(e[r++]&63)<<6|e[r++]&63,c>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),c=0);return o?(c&&o.push(String.fromCharCode.apply(String,s.slice(0,c))),o.join("")):String.fromCharCode.apply(String,s.slice(0,c))};Hr.write=function(e,r,n){for(var i=n,o,s,c=0;c<e.length;++c)o=e.charCodeAt(c),o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=o&63|128):(o&64512)===55296&&((s=e.charCodeAt(c+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++c,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128);return n-i}});var ko=O((ql,Eo)=>{"use strict";Eo.exports=Nc;function Nc(t,e,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(a){if(a<1||a>i)return t(a);s+a>n&&(o=t(n),s=0);var f=e.call(o,s,s+=a);return s&7&&(s=(s|7)+1),f}}});var Bo=O((Wl,Ao)=>{"use strict";Ao.exports=$;var pt=Pe();function $(t,e){this.lo=t>>>0,this.hi=e>>>0}var Ie=$.zero=new $(0,0);Ie.toNumber=function(){return 0};Ie.zzEncode=Ie.zzDecode=function(){return this};Ie.length=function(){return 1};var Ic=$.zeroHash="\0\0\0\0\0\0\0\0";$.fromNumber=function(e){if(e===0)return Ie;var r=e<0;r&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new $(n,i)};$.from=function(e){if(typeof e=="number")return $.fromNumber(e);if(pt.isString(e))if(pt.Long)e=pt.Long.fromString(e);else return $.fromNumber(parseInt(e,10));return e.low||e.high?new $(e.low>>>0,e.high>>>0):Ie};$.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var r=~this.lo+1>>>0,n=~this.hi>>>0;return r||(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296};$.prototype.toLong=function(e){return pt.Long?new pt.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var ve=String.prototype.charCodeAt;$.fromHash=function(e){return e===Ic?Ie:new $((ve.call(e,0)|ve.call(e,1)<<8|ve.call(e,2)<<16|ve.call(e,3)<<24)>>>0,(ve.call(e,4)|ve.call(e,5)<<8|ve.call(e,6)<<16|ve.call(e,7)<<24)>>>0)};$.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};$.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};$.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};$.prototype.length=function(){var e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}});var Pe=O(Vr=>{"use strict";var k=Vr;k.asPromise=oo();k.base64=uo();k.EventEmitter=lo();k.float=bo();k.inquire=xo();k.utf8=vo();k.pool=ko();k.LongBits=Bo();k.isNode=!!(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node);k.global=k.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||Vr;k.emptyArray=Object.freeze?Object.freeze([]):[];k.emptyObject=Object.freeze?Object.freeze({}):{};k.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};k.isString=function(e){return typeof e=="string"||e instanceof String};k.isObject=function(e){return e&&typeof e=="object"};k.isset=k.isSet=function(e,r){var n=e[r];return n!=null&&e.hasOwnProperty(r)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};k.Buffer=function(){try{var t=k.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch{return null}}();k._Buffer_from=null;k._Buffer_allocUnsafe=null;k.newBuffer=function(e){return typeof e=="number"?k.Buffer?k._Buffer_allocUnsafe(e):new k.Array(e):k.Buffer?k._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};k.Array=typeof Uint8Array<"u"?Uint8Array:Array;k.Long=k.global.dcodeIO&&k.global.dcodeIO.Long||k.global.Long||k.inquire("long");k.key2Re=/^true|false|0|1$/;k.key32Re=/^-?(?:0|[1-9][0-9]*)$/;k.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;k.longToHash=function(e){return e?k.LongBits.from(e).toHash():k.LongBits.zeroHash};k.longFromHash=function(e,r){var n=k.LongBits.fromHash(e);return k.Long?k.Long.fromBits(n.lo,n.hi,r):n.toNumber(!!r)};function To(t,e,r){for(var n=Object.keys(e),i=0;i<n.length;++i)(t[n[i]]===void 0||!r)&&(t[n[i]]=e[n[i]]);return t}k.merge=To;k.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function So(t){function e(r,n){if(!(this instanceof e))return new e(r,n);Object.defineProperty(this,"message",{get:function(){return r}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&To(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}k.newError=So;k.ProtocolError=So("ProtocolError");k.oneOfGetter=function(e){for(var r={},n=0;n<e.length;++n)r[e[n]]=1;return function(){for(var i=Object.keys(this),o=i.length-1;o>-1;--o)if(r[i[o]]===1&&this[i[o]]!==void 0&&this[i[o]]!==null)return i[o]}};k.oneOfSetter=function(e){return function(r){for(var n=0;n<e.length;++n)e[n]!==r&&delete this[e[n]]}};k.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};k._configure=function(){var t=k.Buffer;if(!t){k._Buffer_from=k._Buffer_allocUnsafe=null;return}k._Buffer_from=t.from!==Uint8Array.from&&t.from||function(r,n){return new t(r,n)},k._Buffer_allocUnsafe=t.allocUnsafe||function(r){return new t(r)}}});var Qr=O((Jl,Co)=>{"use strict";Co.exports=z;var de=Pe(),Gr,Po=de.LongBits,Pc=de.utf8;function ae(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function z(t){this.buf=t,this.pos=0,this.len=t.length}var No=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new z(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new z(e);throw Error("illegal buffer")},Do=function(){return de.Buffer?function(r){return(z.create=function(i){return de.Buffer.isBuffer(i)?new Gr(i):No(i)})(r)}:No};z.create=Do();z.prototype._slice=de.Array.prototype.subarray||de.Array.prototype.slice;z.prototype.uint32=function(){var e=4294967295;return function(){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,ae(this,10);return e}}();z.prototype.int32=function(){return this.uint32()|0};z.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function jr(){var t=new Po(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw ae(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw ae(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}z.prototype.bool=function(){return this.uint32()!==0};function Kt(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}z.prototype.fixed32=function(){if(this.pos+4>this.len)throw ae(this,4);return Kt(this.buf,this.pos+=4)};z.prototype.sfixed32=function(){if(this.pos+4>this.len)throw ae(this,4);return Kt(this.buf,this.pos+=4)|0};function Io(){if(this.pos+8>this.len)throw ae(this,8);return new Po(Kt(this.buf,this.pos+=4),Kt(this.buf,this.pos+=4))}z.prototype.float=function(){if(this.pos+4>this.len)throw ae(this,4);var e=de.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};z.prototype.double=function(){if(this.pos+8>this.len)throw ae(this,4);var e=de.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};z.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw ae(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(r,n):r===n?new this.buf.constructor(0):this._slice.call(this.buf,r,n)};z.prototype.string=function(){var e=this.bytes();return Pc.read(e,0,e.length)};z.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw ae(this,e);this.pos+=e}else do if(this.pos>=this.len)throw ae(this);while(this.buf[this.pos++]&128);return this};z.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t=this.uint32()&7)!==4;)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};z._configure=function(t){Gr=t,z.create=Do(),Gr._configure();var e=de.Long?"toLong":"toNumber";de.merge(z.prototype,{int64:function(){return jr.call(this)[e](!1)},uint64:function(){return jr.call(this)[e](!0)},sint64:function(){return jr.call(this).zzDecode()[e](!1)},fixed64:function(){return Io.call(this)[e](!0)},sfixed64:function(){return Io.call(this)[e](!1)}})}});var Fo=O((Kl,zo)=>{"use strict";zo.exports=De;var Lo=Qr();(De.prototype=Object.create(Lo.prototype)).constructor=De;var Uo=Pe();function De(t){Lo.call(this,t)}De._configure=function(){Uo.Buffer&&(De.prototype._slice=Uo.Buffer.prototype.slice)};De.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};De._configure()});var Yr=O((Zl,$o)=>{"use strict";$o.exports=I;var ne=Pe(),qr,Zt=ne.LongBits,Mo=ne.base64,Oo=ne.utf8;function mt(t,e,r){this.fn=t,this.len=e,this.next=void 0,this.val=r}function Xr(){}function Dc(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function I(){this.len=0,this.head=new mt(Xr,0,0),this.tail=this.head,this.states=null}var Ro=function(){return ne.Buffer?function(){return(I.create=function(){return new qr})()}:function(){return new I}};I.create=Ro();I.alloc=function(e){return new ne.Array(e)};ne.Array!==Array&&(I.alloc=ne.pool(I.alloc,ne.Array.prototype.subarray));I.prototype._push=function(e,r,n){return this.tail=this.tail.next=new mt(e,r,n),this.len+=r,this};function Jr(t,e,r){e[r]=t&255}function Cc(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}function Kr(t,e){this.len=t,this.next=void 0,this.val=e}Kr.prototype=Object.create(mt.prototype);Kr.prototype.fn=Cc;I.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Kr((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};I.prototype.int32=function(e){return e<0?this._push(Zr,10,Zt.fromNumber(e)):this.uint32(e)};I.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function Zr(t,e,r){for(;t.hi;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}I.prototype.uint64=function(e){var r=Zt.from(e);return this._push(Zr,r.length(),r)};I.prototype.int64=I.prototype.uint64;I.prototype.sint64=function(e){var r=Zt.from(e).zzEncode();return this._push(Zr,r.length(),r)};I.prototype.bool=function(e){return this._push(Jr,1,e?1:0)};function Wr(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}I.prototype.fixed32=function(e){return this._push(Wr,4,e>>>0)};I.prototype.sfixed32=I.prototype.fixed32;I.prototype.fixed64=function(e){var r=Zt.from(e);return this._push(Wr,4,r.lo)._push(Wr,4,r.hi)};I.prototype.sfixed64=I.prototype.fixed64;I.prototype.float=function(e){return this._push(ne.float.writeFloatLE,4,e)};I.prototype.double=function(e){return this._push(ne.float.writeDoubleLE,8,e)};var Uc=ne.Array.prototype.set?function(e,r,n){r.set(e,n)}:function(e,r,n){for(var i=0;i<e.length;++i)r[n+i]=e[i]};I.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(Jr,1,0);if(ne.isString(e)){var n=I.alloc(r=Mo.length(e));Mo.decode(e,n,0),e=n}return this.uint32(r)._push(Uc,r,e)};I.prototype.string=function(e){var r=Oo.length(e);return r?this.uint32(r)._push(Oo.write,r,e):this._push(Jr,1,0)};I.prototype.fork=function(){return this.states=new Dc(this),this.head=this.tail=new mt(Xr,0,0),this.len=0,this};I.prototype.reset=function(){return this.states?(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 mt(Xr,0,0),this.len=0),this};I.prototype.ldelim=function(){var e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=r,this.len+=n),this};I.prototype.finish=function(){for(var e=this.head.next,r=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r};I._configure=function(t){qr=t,I.create=Ro(),qr._configure()}});var jo=O((Yl,Vo)=>{"use strict";Vo.exports=pe;var Ho=Yr();(pe.prototype=Object.create(Ho.prototype)).constructor=pe;var Ee=Pe();function pe(){Ho.call(this)}pe._configure=function(){pe.alloc=Ee._Buffer_allocUnsafe,pe.writeBytesBuffer=Ee.Buffer&&Ee.Buffer.prototype instanceof Uint8Array&&Ee.Buffer.prototype.set.name==="set"?function(e,r,n){r.set(e,n)}:function(e,r,n){if(e.copy)e.copy(r,n,0,e.length);else for(var i=0;i<e.length;)r[n++]=e[i++]}};pe.prototype.bytes=function(e){Ee.isString(e)&&(e=Ee._Buffer_from(e,"base64"));var r=e.length>>>0;return this.uint32(r),r&&this._push(pe.writeBytesBuffer,r,e),this};function Lc(t,e,r){t.length<40?Ee.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}pe.prototype.string=function(e){var r=Ee.Buffer.byteLength(e);return this.uint32(r),r&&this._push(Lc,r,e),this};pe._configure()});var es=O((bt,tr)=>{(function(t,e){"use strict";var r={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function n(u){if(!Array.isArray(u)&&!ArrayBuffer.isView(u))return!1;for(var h=0;h<u.length;h++)if(!Number.isInteger(u[h])||u[h]<0||u[h]>255)return!1;return!0}function i(u,h){return(u&65535)*h+(((u>>>16)*h&65535)<<16)}function o(u,h){return u<<h|u>>>32-h}function s(u){return u^=u>>>16,u=i(u,2246822507),u^=u>>>13,u=i(u,3266489909),u^=u>>>16,u}function c(u,h){u=[u[0]>>>16,u[0]&65535,u[1]>>>16,u[1]&65535],h=[h[0]>>>16,h[0]&65535,h[1]>>>16,h[1]&65535];var d=[0,0,0,0];return d[3]+=u[3]+h[3],d[2]+=d[3]>>>16,d[3]&=65535,d[2]+=u[2]+h[2],d[1]+=d[2]>>>16,d[2]&=65535,d[1]+=u[1]+h[1],d[0]+=d[1]>>>16,d[1]&=65535,d[0]+=u[0]+h[0],d[0]&=65535,[d[0]<<16|d[1],d[2]<<16|d[3]]}function a(u,h){u=[u[0]>>>16,u[0]&65535,u[1]>>>16,u[1]&65535],h=[h[0]>>>16,h[0]&65535,h[1]>>>16,h[1]&65535];var d=[0,0,0,0];return d[3]+=u[3]*h[3],d[2]+=d[3]>>>16,d[3]&=65535,d[2]+=u[2]*h[3],d[1]+=d[2]>>>16,d[2]&=65535,d[2]+=u[3]*h[2],d[1]+=d[2]>>>16,d[2]&=65535,d[1]+=u[1]*h[3],d[0]+=d[1]>>>16,d[1]&=65535,d[1]+=u[2]*h[2],d[0]+=d[1]>>>16,d[1]&=65535,d[1]+=u[3]*h[1],d[0]+=d[1]>>>16,d[1]&=65535,d[0]+=u[0]*h[3]+u[1]*h[2]+u[2]*h[1]+u[3]*h[0],d[0]&=65535,[d[0]<<16|d[1],d[2]<<16|d[3]]}function f(u,h){return h%=64,h===32?[u[1],u[0]]:h<32?[u[0]<<h|u[1]>>>32-h,u[1]<<h|u[0]>>>32-h]:(h-=32,[u[1]<<h|u[0]>>>32-h,u[0]<<h|u[1]>>>32-h])}function l(u,h){return h%=64,h===0?u:h<32?[u[0]<<h|u[1]>>>32-h,u[1]<<h]:[u[1]<<h-32,0]}function m(u,h){return[u[0]^h[0],u[1]^h[1]]}function A(u){return u=m(u,[0,u[0]>>>1]),u=a(u,[4283543511,3981806797]),u=m(u,[0,u[0]>>>1]),u=a(u,[3301882366,444984403]),u=m(u,[0,u[0]>>>1]),u}r.x86.hash32=function(u,h){if(r.inputValidation&&!n(u))return e;h=h||0;for(var d=u.length%4,M=u.length-d,g=h,w=0,_=3432918353,v=461845907,B=0;B<M;B=B+4)w=u[B]|u[B+1]<<8|u[B+2]<<16|u[B+3]<<24,w=i(w,_),w=o(w,15),w=i(w,v),g^=w,g=o(g,13),g=i(g,5)+3864292196;switch(w=0,d){case 3:w^=u[B+2]<<16;case 2:w^=u[B+1]<<8;case 1:w^=u[B],w=i(w,_),w=o(w,15),w=i(w,v),g^=w}return g^=u.length,g=s(g),g>>>0},r.x86.hash128=function(u,h){if(r.inputValidation&&!n(u))return e;h=h||0;for(var d=u.length%16,M=u.length-d,g=h,w=h,_=h,v=h,B=0,S=0,x=0,C=0,me=597399067,It=2869860233,Pt=951274213,Dt=2716044179,N=0;N<M;N=N+16)B=u[N]|u[N+1]<<8|u[N+2]<<16|u[N+3]<<24,S=u[N+4]|u[N+5]<<8|u[N+6]<<16|u[N+7]<<24,x=u[N+8]|u[N+9]<<8|u[N+10]<<16|u[N+11]<<24,C=u[N+12]|u[N+13]<<8|u[N+14]<<16|u[N+15]<<24,B=i(B,me),B=o(B,15),B=i(B,It),g^=B,g=o(g,19),g+=w,g=i(g,5)+1444728091,S=i(S,It),S=o(S,16),S=i(S,Pt),w^=S,w=o(w,17),w+=_,w=i(w,5)+197830471,x=i(x,Pt),x=o(x,17),x=i(x,Dt),_^=x,_=o(_,15),_+=v,_=i(_,5)+2530024501,C=i(C,Dt),C=o(C,18),C=i(C,me),v^=C,v=o(v,13),v+=g,v=i(v,5)+850148119;switch(B=0,S=0,x=0,C=0,d){case 15:C^=u[N+14]<<16;case 14:C^=u[N+13]<<8;case 13:C^=u[N+12],C=i(C,Dt),C=o(C,18),C=i(C,me),v^=C;case 12:x^=u[N+11]<<24;case 11:x^=u[N+10]<<16;case 10:x^=u[N+9]<<8;case 9:x^=u[N+8],x=i(x,Pt),x=o(x,17),x=i(x,Dt),_^=x;case 8:S^=u[N+7]<<24;case 7:S^=u[N+6]<<16;case 6:S^=u[N+5]<<8;case 5:S^=u[N+4],S=i(S,It),S=o(S,16),S=i(S,Pt),w^=S;case 4:B^=u[N+3]<<24;case 3:B^=u[N+2]<<16;case 2:B^=u[N+1]<<8;case 1:B^=u[N],B=i(B,me),B=o(B,15),B=i(B,It),g^=B}return g^=u.length,w^=u.length,_^=u.length,v^=u.length,g+=w,g+=_,g+=v,w+=g,_+=g,v+=g,g=s(g),w=s(w),_=s(_),v=s(v),g+=w,g+=_,g+=v,w+=g,_+=g,v+=g,("00000000"+(g>>>0).toString(16)).slice(-8)+("00000000"+(w>>>0).toString(16)).slice(-8)+("00000000"+(_>>>0).toString(16)).slice(-8)+("00000000"+(v>>>0).toString(16)).slice(-8)},r.x64.hash128=function(u,h){if(r.inputValidation&&!n(u))return e;h=h||0;for(var d=u.length%16,M=u.length-d,g=[0,h],w=[0,h],_=[0,0],v=[0,0],B=[2277735313,289559509],S=[1291169091,658871167],x=0;x<M;x=x+16)_=[u[x+4]|u[x+5]<<8|u[x+6]<<16|u[x+7]<<24,u[x]|u[x+1]<<8|u[x+2]<<16|u[x+3]<<24],v=[u[x+12]|u[x+13]<<8|u[x+14]<<16|u[x+15]<<24,u[x+8]|u[x+9]<<8|u[x+10]<<16|u[x+11]<<24],_=a(_,B),_=f(_,31),_=a(_,S),g=m(g,_),g=f(g,27),g=c(g,w),g=c(a(g,[0,5]),[0,1390208809]),v=a(v,S),v=f(v,33),v=a(v,B),w=m(w,v),w=f(w,31),w=c(w,g),w=c(a(w,[0,5]),[0,944331445]);switch(_=[0,0],v=[0,0],d){case 15:v=m(v,l([0,u[x+14]],48));case 14:v=m(v,l([0,u[x+13]],40));case 13:v=m(v,l([0,u[x+12]],32));case 12:v=m(v,l([0,u[x+11]],24));case 11:v=m(v,l([0,u[x+10]],16));case 10:v=m(v,l([0,u[x+9]],8));case 9:v=m(v,[0,u[x+8]]),v=a(v,S),v=f(v,33),v=a(v,B),w=m(w,v);case 8:_=m(_,l([0,u[x+7]],56));case 7:_=m(_,l([0,u[x+6]],48));case 6:_=m(_,l([0,u[x+5]],40));case 5:_=m(_,l([0,u[x+4]],32));case 4:_=m(_,l([0,u[x+3]],24));case 3:_=m(_,l([0,u[x+2]],16));case 2:_=m(_,l([0,u[x+1]],8));case 1:_=m(_,[0,u[x]]),_=a(_,B),_=f(_,31),_=a(_,S),g=m(g,_)}return g=m(g,[0,u.length]),w=m(w,[0,u.length]),g=c(g,w),w=c(w,g),g=A(g),w=A(w),g=c(g,w),w=c(w,g),("00000000"+(g[0]>>>0).toString(16)).slice(-8)+("00000000"+(g[1]>>>0).toString(16)).slice(-8)+("00000000"+(w[0]>>>0).toString(16)).slice(-8)+("00000000"+(w[1]>>>0).toString(16)).slice(-8)},typeof bt<"u"?(typeof tr<"u"&&tr.exports&&(bt=tr.exports=r),bt.murmurHash3=r):typeof define=="function"&&define.amd?define([],function(){return r}):(r._murmurHash3=t.murmurHash3,r.noConflict=function(){return t.murmurHash3=r._murmurHash3,r._murmurHash3=e,r.noConflict=e,r},t.murmurHash3=r)})(bt)});var rs=O((Eh,ts)=>{ts.exports=es()});var ss=O((Ih,os)=>{"use strict";os.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(e,r){let n=this._internalPositionFor(e,!1);if(r===void 0)n!==-1&&(this._unsetInternalPos(n),this._unsetBit(e),this._changedLength=!0,this._changedData=!0);else{let i=!1;n===-1?(n=this._data.length,this._setBit(e),this._changedData=!0):i=!0,this._setInternalPos(n,e,r,i),this._changedLength=!0}}unset(e){this.set(e,void 0)}get(e){this._sortData();let r=this._internalPositionFor(e,!0);if(r!==-1)return this._data[r][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 r=0;for(;r<this.length;)e(this.get(r),r,this),r++}map(e){let r=0,n=new Array(this.length);for(;r<this.length;)n[r]=e(this.get(r),r,this),r++;return n}reduce(e,r){let n=0,i=r;for(;n<this.length;){let o=this.get(n);i=e(i,o,n),n++}return i}find(e){let r=0,n,i;for(;r<this.length&&!n;)i=this.get(r),n=e(i),r++;return n?i:void 0}_internalPositionFor(e,r){let n=this._bytePosFor(e,r);if(n>=this._bitArrays.length)return-1;let i=this._bitArrays[n],o=e-n*7;if(!((i&1<<o)>0))return-1;let c=this._bitArrays.slice(0,n).reduce($c,0),a=~(4294967295<<o+1),f=is(i&a);return c+f-1}_bytePosFor(e,r){let n=Math.floor(e/7),i=n+1;for(;!r&&this._bitArrays.length<i;)this._bitArrays.push(0);return n}_setBit(e){let r=this._bytePosFor(e,!1);this._bitArrays[r]|=1<<e-r*7}_unsetBit(e){let r=this._bytePosFor(e,!1);this._bitArrays[r]&=~(1<<e-r*7)}_setInternalPos(e,r,n,i){let o=this._data,s=[r,n];if(i)this._sortData(),o[e]=s;else{if(o.length)if(o[o.length-1][0]>=r)o.push(s);else if(o[0][0]<=r)o.unshift(s);else{let c=Math.round(o.length/2);this._data=o.slice(0,c).concat(s).concat(o.slice(c))}else this._data.push(s);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(e){this._data.splice(e,1)}_sortData(){this._changedData&&this._data.sort(Hc),this._changedData=!1}bitField(){let e=[],r=8,n=0,i=0,o,s=this._bitArrays.slice();for(;s.length||n;){n===0&&(o=s.shift(),n=7);let a=Math.min(n,r),f=~(255<<a),l=o&f;i|=l<<8-r,o=o>>>a,n-=a,r-=a,(!r||!n&&!s.length)&&(e.push(i),i=0,r=8)}for(var c=e.length-1;c>0&&e[c]===0;c--)e.pop();return e}compactArray(){return this._sortData(),this._data.map(Vc)}};function $c(t,e){return t+is(e)}function is(t){let e=t;return e=e-(e>>1&1431655765),e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}function Hc(t,e){return t[0]-e[0]}function Vc(t){return t[1]}});var Ts=O((Od,xn)=>{"use strict";var Du=Object.prototype.hasOwnProperty,q="~";function xt(){}Object.create&&(xt.prototype=Object.create(null),new xt().__proto__||(q=!1));function Cu(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Bs(t,e,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new Cu(r,n||t,i),s=q?q+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],o]:t._events[s].push(o):(t._events[s]=o,t._eventsCount++),t}function ur(t,e){--t._eventsCount===0?t._events=new xt:delete t._events[e]}function j(){this._events=new xt,this._eventsCount=0}j.prototype.eventNames=function(){var e=[],r,n;if(this._eventsCount===0)return e;for(n in r=this._events)Du.call(r,n)&&e.push(q?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};j.prototype.listeners=function(e){var r=q?q+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s};j.prototype.listenerCount=function(e){var r=q?q+e:e,n=this._events[r];return n?n.fn?1:n.length:0};j.prototype.emit=function(e,r,n,i,o,s){var c=q?q+e:e;if(!this._events[c])return!1;var a=this._events[c],f=arguments.length,l,m;if(a.fn){switch(a.once&&this.removeListener(e,a.fn,void 0,!0),f){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,r),!0;case 3:return a.fn.call(a.context,r,n),!0;case 4:return a.fn.call(a.context,r,n,i),!0;case 5:return a.fn.call(a.context,r,n,i,o),!0;case 6:return a.fn.call(a.context,r,n,i,o,s),!0}for(m=1,l=new Array(f-1);m<f;m++)l[m-1]=arguments[m];a.fn.apply(a.context,l)}else{var A=a.length,u;for(m=0;m<A;m++)switch(a[m].once&&this.removeListener(e,a[m].fn,void 0,!0),f){case 1:a[m].fn.call(a[m].context);break;case 2:a[m].fn.call(a[m].context,r);break;case 3:a[m].fn.call(a[m].context,r,n);break;case 4:a[m].fn.call(a[m].context,r,n,i);break;default:if(!l)for(u=1,l=new Array(f-1);u<f;u++)l[u-1]=arguments[u];a[m].fn.apply(a[m].context,l)}}return!0};j.prototype.on=function(e,r,n){return Bs(this,e,r,n,!1)};j.prototype.once=function(e,r,n){return Bs(this,e,r,n,!0)};j.prototype.removeListener=function(e,r,n,i){var o=q?q+e:e;if(!this._events[o])return this;if(!r)return ur(this,o),this;var s=this._events[o];if(s.fn)s.fn===r&&(!i||s.once)&&(!n||s.context===n)&&ur(this,o);else{for(var c=0,a=[],f=s.length;c<f;c++)(s[c].fn!==r||i&&!s[c].once||n&&s[c].context!==n)&&a.push(s[c]);a.length?this._events[o]=a.length===1?a[0]:a:ur(this,o)}return this};j.prototype.removeAllListeners=function(e){var r;return e?(r=q?q+e:e,this._events[r]&&ur(this,r)):(this._events=new xt,this._eventsCount=0),this};j.prototype.off=j.prototype.removeListener;j.prototype.addListener=j.prototype.on;j.prefixed=q;j.EventEmitter=j;typeof xn<"u"&&(xn.exports=j)});var Vu={};W(Vu,{exporter:()=>Gs,recursive:()=>Hu,walkPath:()=>js});var wr=H(fe(),1);function Ys(t){return t[Symbol.asyncIterator]!=null}function ea(t){if(Ys(t))return(async()=>{let r;for await(let n of t)r=n;return r})();let e;for(let r of t)e=r;return e}var In=ea;var ta=Cn,Pn=128,ra=127,na=~ra,ia=Math.pow(2,31);function Cn(t,e,r){e=e||[],r=r||0;for(var n=r;t>=ia;)e[r++]=t&255|Pn,t/=128;for(;t&na;)e[r++]=t&255|Pn,t>>>=7;return e[r]=t|0,Cn.bytes=r-n+1,e}var oa=br,sa=128,Dn=127;function br(t,n){var r=0,n=n||0,i=0,o=n,s,c=t.length;do{if(o>=c)throw br.bytes=0,new RangeError("Could not decode varint");s=t[o++],r+=i<28?(s&Dn)<<i:(s&Dn)*Math.pow(2,i),i+=7}while(s>=sa);return br.bytes=o-n,r}var aa=Math.pow(2,7),ca=Math.pow(2,14),ua=Math.pow(2,21),fa=Math.pow(2,28),la=Math.pow(2,35),ha=Math.pow(2,42),da=Math.pow(2,49),pa=Math.pow(2,56),ma=Math.pow(2,63),ya=function(t){return t<aa?1:t<ca?2:t<ua?3:t<fa?4:t<la?5:t<ha?6:t<da?7:t<pa?8:t<ma?9:10},ga={encode:ta,decode:oa,encodingLength:ya},wa=ga,ot=wa;var st=(t,e=0)=>[ot.decode(t,e),ot.decode.bytes],Fe=(t,e,r=0)=>(ot.encode(t,e,r),e),Me=t=>ot.encodingLength(t);var Oe={};W(Oe,{coerce:()=>le,empty:()=>Un,equals:()=>xr,fromHex:()=>xa,fromString:()=>_r,isBinary:()=>_a,toHex:()=>ba,toString:()=>vr});var Un=new Uint8Array(0),ba=t=>t.reduce((e,r)=>e+r.toString(16).padStart(2,"0"),""),xa=t=>{let e=t.match(/../g);return e?new Uint8Array(e.map(r=>parseInt(r,16))):Un},xr=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},le=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},_a=t=>t instanceof ArrayBuffer||ArrayBuffer.isView(t),_r=t=>new TextEncoder().encode(t),vr=t=>new TextDecoder().decode(t);var Te=(t,e)=>{let r=e.byteLength,n=Me(t),i=n+Me(r),o=new Uint8Array(i+r);return Fe(t,o,0),Fe(r,o,n),o.set(e,i),new Re(t,r,e,o)},Lt=t=>{let e=le(t),[r,n]=st(e),[i,o]=st(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Re(r,i,s,e)},Ln=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&xr(t.bytes,r.bytes)}},Re=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var Tr={};W(Tr,{base58btc:()=>he,base58flickr:()=>Ta});function va(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var c=t.length,a=t.charAt(0),f=Math.log(c)/Math.log(256),l=Math.log(256)/Math.log(c);function m(h){if(h instanceof Uint8Array||(ArrayBuffer.isView(h)?h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):Array.isArray(h)&&(h=Uint8Array.from(h))),!(h instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(h.length===0)return"";for(var d=0,M=0,g=0,w=h.length;g!==w&&h[g]===0;)g++,d++;for(var _=(w-g)*l+1>>>0,v=new Uint8Array(_);g!==w;){for(var B=h[g],S=0,x=_-1;(B!==0||S<M)&&x!==-1;x--,S++)B+=256*v[x]>>>0,v[x]=B%c>>>0,B=B/c>>>0;if(B!==0)throw new Error("Non-zero carry");M=S,g++}for(var C=_-M;C!==_&&v[C]===0;)C++;for(var me=a.repeat(d);C<_;++C)me+=t.charAt(v[C]);return me}function A(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;var d=0;if(h[d]!==" "){for(var M=0,g=0;h[d]===a;)M++,d++;for(var w=(h.length-d)*f+1>>>0,_=new Uint8Array(w);h[d];){var v=r[h.charCodeAt(d)];if(v===255)return;for(var B=0,S=w-1;(v!==0||B<g)&&S!==-1;S--,B++)v+=c*_[S]>>>0,_[S]=v%256>>>0,v=v/256>>>0;if(v!==0)throw new Error("Non-zero carry");g=B,d++}if(h[d]!==" "){for(var x=w-g;x!==w&&_[x]===0;)x++;for(var C=new Uint8Array(M+(w-x)),me=M;x!==w;)C[me++]=_[x++];return C}}}function u(h){var d=A(h);if(d)return d;throw new Error(`Non-${e} character`)}return{encode:m,decodeUnsafe:A,decode:u}}var Ea=va,ka=Ea,zn=ka;var Er=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},kr=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Fn(this,e)}},Ar=class{constructor(e){this.decoders=e}or(e){return Fn(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Fn=(t,e)=>new Ar({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),Br=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Er(e,r,n),this.decoder=new kr(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},He=({name:t,prefix:e,encode:r,decode:n})=>new Br(t,e,r,n),we=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=zn(r,e);return He({prefix:t,name:e,encode:n,decode:o=>le(i(o))})},Aa=(t,e,r,n)=>{let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=t.length;for(;t[o-1]==="=";)--o;let s=new Uint8Array(o*r/8|0),c=0,a=0,f=0;for(let l=0;l<o;++l){let m=i[t[l]];if(m===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|m,c+=r,c>=8&&(c-=8,s[f++]=255&a>>c)}if(c>=r||255&a<<8-c)throw new SyntaxError("Unexpected end of data");return s},Ba=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,o="",s=0,c=0;for(let a=0;a<t.length;++a)for(c=c<<8|t[a],s+=8;s>r;)s-=r,o+=e[i&c>>s];if(s&&(o+=e[i&c<<r-s]),n)for(;o.length*r&7;)o+="=";return o},L=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>He({prefix:e,name:t,encode(i){return Ba(i,n,r)},decode(i){return Aa(i,n,r,t)}});var he=we({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ta=we({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Sr={};W(Sr,{base32:()=>Ve,base32hex:()=>Pa,base32hexpad:()=>Ca,base32hexpadupper:()=>Ua,base32hexupper:()=>Da,base32pad:()=>Na,base32padupper:()=>Ia,base32upper:()=>Sa,base32z:()=>La});var Ve=L({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Sa=L({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Na=L({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ia=L({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Pa=L({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Da=L({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ca=L({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ua=L({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),La=L({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Mn=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Fa(r,Nr(t),e||he.encoder);default:return Ma(r,Nr(t),e||Ve.encoder)}};var On=new WeakMap,Nr=t=>{let e=On.get(t);if(e==null){let r=new Map;return On.set(t,r),r}return e},D=class{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==at)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Oa)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return D.createV0(r)}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:r}=this.multihash,n=Te(e,r);return D.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return D.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&Ln(e.multihash,n.multihash)}toString(e){return Mn(this,e)}toJSON(){return{"/":Mn(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof D)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:o,bytes:s}=r;return new D(n,i,o,s||Rn(n,i,o.bytes))}else if(r[Ra]===!0){let{version:n,multihash:i,code:o}=r,s=Lt(i);return D.create(n,o,s)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==at)throw new Error(`Version 0 CID must use dag-pb (code: ${at}) block encoding`);return new D(e,r,n,n.bytes)}case 1:{let i=Rn(e,r,n.bytes);return new D(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return D.create(0,at,e)}static createV1(e,r){return D.create(1,e,r)}static decode(e){let[r,n]=D.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=D.inspectBytes(e),n=r.size-r.multihashSize,i=le(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=i.subarray(r.multihashSize-r.digestSize),s=new Re(r.multihashCode,r.digestSize,o,i);return[r.version===0?D.createV0(s):D.createV1(r.codec,s),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[m,A]=st(e.subarray(r));return r+=A,m},i=n(),o=at;if(i===18?(i=0,r=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=r,c=n(),a=n(),f=r+a,l=f-s;return{version:i,codec:o,multihashCode:c,digestSize:a,multihashSize:l,size:f}}static parse(e,r){let[n,i]=za(e,r),o=D.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Nr(o).set(n,e),o}},za=(t,e)=>{switch(t[0]){case"Q":{let r=e||he;return[he.prefix,r.decode(`${he.prefix}${t}`)]}case he.prefix:{let r=e||he;return[he.prefix,r.decode(t)]}case Ve.prefix:{let r=e||Ve;return[Ve.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Fa=(t,e,r)=>{let{prefix:n}=r;if(n!==he.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let o=r.encode(t).slice(1);return e.set(n,o),o}else return i},Ma=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let o=r.encode(t);return e.set(n,o),o}else return i},at=112,Oa=18,Rn=(t,e,r)=>{let n=Me(t),i=n+Me(e),o=new Uint8Array(i+r.byteLength);return Fe(t,o,0),Fe(e,o,n),o.set(r,i),o},Ra=Symbol.for("@ipld/js-cid/CID");var $a=["string","number","bigint","symbol"],Ha=["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 $n(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";let e=typeof t;if($a.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(Va(t))return"Buffer";let r=ja(t);return r||"Object"}function Va(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function ja(t){let e=Object.prototype.toString.call(t).slice(8,-1);if(Ha.includes(e))return e}var p=class{constructor(e,r,n){this.major=e,this.majorEncoded=e<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};p.uint=new p(0,"uint",!0);p.negint=new p(1,"negint",!0);p.bytes=new p(2,"bytes",!0);p.string=new p(3,"string",!0);p.array=new p(4,"array",!1);p.map=new p(5,"map",!1);p.tag=new p(6,"tag",!1);p.float=new p(7,"float",!0);p.false=new p(7,"false",!0);p.true=new p(7,"true",!0);p.null=new p(7,"null",!0);p.undefined=new p(7,"undefined",!0);p.break=new p(7,"break",!0);var b=class{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};var je=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Ga=new TextDecoder,Qa=new TextEncoder;function zt(t){return je&&globalThis.Buffer.isBuffer(t)}function Gn(t){return t instanceof Uint8Array?zt(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}var Qn=je?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):Vn(t,e,r):(t,e,r)=>r-e>64?Ga.decode(t.subarray(e,r)):Vn(t,e,r),qn=je?t=>t.length>64?globalThis.Buffer.from(t):Hn(t):t=>t.length>64?Qa.encode(t):Hn(t);var Ge=je?(t,e,r)=>zt(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),Wn=je?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),Gn(globalThis.Buffer.concat(t,e))):(t,e)=>{let r=new Uint8Array(e),n=0;for(let i of t)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},Xn=je?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function Jn(t,e){if(zt(t)&&zt(e))return t.compare(e);for(let r=0;r<t.length;r++)if(t[r]!==e[r])return t[r]<e[r]?-1:1;return 0}function Hn(t,e=1/0){let r,n=t.length,i=null,o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Vn(t,e,r){let n=[];for(;e<r;){let i=t[e],o=null,s=i>239?4:i>223?3:i>191?2:1;if(e+s<=r){let c,a,f,l;switch(s){case 1:i<128&&(o=i);break;case 2:c=t[e+1],(c&192)===128&&(l=(i&31)<<6|c&63,l>127&&(o=l));break;case 3:c=t[e+1],a=t[e+2],(c&192)===128&&(a&192)===128&&(l=(i&15)<<12|(c&63)<<6|a&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:c=t[e+1],a=t[e+2],f=t[e+3],(c&192)===128&&(a&192)===128&&(f&192)===128&&(l=(i&15)<<18|(c&63)<<12|(a&63)<<6|f&63,l>65535&&l<1114112&&(o=l))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),e+=s}return qa(n)}var jn=4096;function qa(t){let e=t.length;if(e<=jn)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=jn));return r}var Wa=256,Ft=class{constructor(e=Wa){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 r=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let i=r.length-(this.maxCursor-this.cursor)-1;r.set(e,i)}else{if(r){let i=r.length-(this.maxCursor-this.cursor)-1;i<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,i),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(r=Xn(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=Ge(n,0,this.cursor)}else r=Wn(this.chunks,this.cursor);return e&&this.reset(),r}};var T="CBOR decode error:",Ir="CBOR encode error:",ct=[];ct[23]=1;ct[24]=2;ct[25]=3;ct[26]=5;ct[27]=9;function ye(t,e,r){if(t.length-e<r)throw new Error(`${T} not enough data for type`)}var R=[24,256,65536,4294967296,BigInt("18446744073709551616")];function X(t,e,r){ye(t,e,1);let n=t[e];if(r.strict===!0&&n<R[0])throw new Error(`${T} integer encoded in more bytes than necessary (strict decode)`);return n}function J(t,e,r){ye(t,e,2);let n=t[e]<<8|t[e+1];if(r.strict===!0&&n<R[1])throw new Error(`${T} integer encoded in more bytes than necessary (strict decode)`);return n}function K(t,e,r){ye(t,e,4);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3];if(r.strict===!0&&n<R[2])throw new Error(`${T} integer encoded in more bytes than necessary (strict decode)`);return n}function Z(t,e,r){ye(t,e,8);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3],i=t[e+4]*16777216+(t[e+5]<<16)+(t[e+6]<<8)+t[e+7],o=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&o<R[3])throw new Error(`${T} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(r.allowBigInt===!0)return o;throw new Error(`${T} integers outside of the safe integer range are not supported`)}function Kn(t,e,r,n){return new b(p.uint,X(t,e+1,n),2)}function Zn(t,e,r,n){return new b(p.uint,J(t,e+1,n),3)}function Yn(t,e,r,n){return new b(p.uint,K(t,e+1,n),5)}function ei(t,e,r,n){return new b(p.uint,Z(t,e+1,n),9)}function te(t,e){return V(t,0,e.value)}function V(t,e,r){if(r<R[0]){let n=Number(r);t.push([e|n])}else if(r<R[1]){let n=Number(r);t.push([e|24,n])}else if(r<R[2]){let n=Number(r);t.push([e|25,n>>>8,n&255])}else if(r<R[3]){let n=Number(r);t.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<R[4]){let i=[e|27,0,0,0,0,0,0,0],o=Number(n&BigInt(4294967295)),s=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=o&255,o=o>>8,i[7]=o&255,o=o>>8,i[6]=o&255,o=o>>8,i[5]=o&255,i[4]=s&255,s=s>>8,i[3]=s&255,s=s>>8,i[2]=s&255,s=s>>8,i[1]=s&255,t.push(i)}else throw new Error(`${T} encountered BigInt larger than allowable range`)}}te.encodedSize=function(e){return V.encodedSize(e.value)};V.encodedSize=function(e){return e<R[0]?1:e<R[1]?2:e<R[2]?3:e<R[3]?5:9};te.compareTokens=function(e,r){return e.value<r.value?-1:e.value>r.value?1:0};function ti(t,e,r,n){return new b(p.negint,-1-X(t,e+1,n),2)}function ri(t,e,r,n){return new b(p.negint,-1-J(t,e+1,n),3)}function ni(t,e,r,n){return new b(p.negint,-1-K(t,e+1,n),5)}var Pr=BigInt(-1),ii=BigInt(1);function oi(t,e,r,n){let i=Z(t,e+1,n);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new b(p.negint,o,9)}if(n.allowBigInt!==!0)throw new Error(`${T} integers outside of the safe integer range are not supported`);return new b(p.negint,Pr-BigInt(i),9)}function Mt(t,e){let r=e.value,n=typeof r=="bigint"?r*Pr-ii:r*-1-1;V(t,e.type.majorEncoded,n)}Mt.encodedSize=function(e){let r=e.value,n=typeof r=="bigint"?r*Pr-ii:r*-1-1;return n<R[0]?1:n<R[1]?2:n<R[2]?3:n<R[3]?5:9};Mt.compareTokens=function(e,r){return e.value<r.value?1:e.value>r.value?-1:0};function ut(t,e,r,n){ye(t,e,r+n);let i=Ge(t,e+r,e+r+n);return new b(p.bytes,i,r+n)}function si(t,e,r,n){return ut(t,e,1,r)}function ai(t,e,r,n){return ut(t,e,2,X(t,e+1,n))}function ci(t,e,r,n){return ut(t,e,3,J(t,e+1,n))}function ui(t,e,r,n){return ut(t,e,5,K(t,e+1,n))}function fi(t,e,r,n){let i=Z(t,e+1,n);if(typeof i=="bigint")throw new Error(`${T} 64-bit integer bytes lengths not supported`);return ut(t,e,9,i)}function Ot(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===p.string?qn(t.value):t.value),t.encodedBytes}function Qe(t,e){let r=Ot(e);V(t,e.type.majorEncoded,r.length),t.push(r)}Qe.encodedSize=function(e){let r=Ot(e);return V.encodedSize(r.length)+r.length};Qe.compareTokens=function(e,r){return Ja(Ot(e),Ot(r))};function Ja(t,e){return t.length<e.length?-1:t.length>e.length?1:Jn(t,e)}function ft(t,e,r,n,i){let o=r+n;ye(t,e,o);let s=new b(p.string,Qn(t,e+r,e+o),o);return i.retainStringBytes===!0&&(s.byteValue=Ge(t,e+r,e+o)),s}function li(t,e,r,n){return ft(t,e,1,r,n)}function hi(t,e,r,n){return ft(t,e,2,X(t,e+1,n),n)}function di(t,e,r,n){return ft(t,e,3,J(t,e+1,n),n)}function pi(t,e,r,n){return ft(t,e,5,K(t,e+1,n),n)}function mi(t,e,r,n){let i=Z(t,e+1,n);if(typeof i=="bigint")throw new Error(`${T} 64-bit integer string lengths not supported`);return ft(t,e,9,i,n)}var yi=Qe;function qe(t,e,r,n){return new b(p.array,n,r)}function gi(t,e,r,n){return qe(t,e,1,r)}function wi(t,e,r,n){return qe(t,e,2,X(t,e+1,n))}function bi(t,e,r,n){return qe(t,e,3,J(t,e+1,n))}function xi(t,e,r,n){return qe(t,e,5,K(t,e+1,n))}function _i(t,e,r,n){let i=Z(t,e+1,n);if(typeof i=="bigint")throw new Error(`${T} 64-bit integer array lengths not supported`);return qe(t,e,9,i)}function vi(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${T} indefinite length items not allowed`);return qe(t,e,1,1/0)}function Rt(t,e){V(t,p.array.majorEncoded,e.value)}Rt.compareTokens=te.compareTokens;Rt.encodedSize=function(e){return V.encodedSize(e.value)};function We(t,e,r,n){return new b(p.map,n,r)}function Ei(t,e,r,n){return We(t,e,1,r)}function ki(t,e,r,n){return We(t,e,2,X(t,e+1,n))}function Ai(t,e,r,n){return We(t,e,3,J(t,e+1,n))}function Bi(t,e,r,n){return We(t,e,5,K(t,e+1,n))}function Ti(t,e,r,n){let i=Z(t,e+1,n);if(typeof i=="bigint")throw new Error(`${T} 64-bit integer map lengths not supported`);return We(t,e,9,i)}function Si(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${T} indefinite length items not allowed`);return We(t,e,1,1/0)}function $t(t,e){V(t,p.map.majorEncoded,e.value)}$t.compareTokens=te.compareTokens;$t.encodedSize=function(e){return V.encodedSize(e.value)};function Ni(t,e,r,n){return new b(p.tag,r,1)}function Ii(t,e,r,n){return new b(p.tag,X(t,e+1,n),2)}function Pi(t,e,r,n){return new b(p.tag,J(t,e+1,n),3)}function Di(t,e,r,n){return new b(p.tag,K(t,e+1,n),5)}function Ci(t,e,r,n){return new b(p.tag,Z(t,e+1,n),9)}function Ht(t,e){V(t,p.tag.majorEncoded,e.value)}Ht.compareTokens=te.compareTokens;Ht.encodedSize=function(e){return V.encodedSize(e.value)};var rc=20,nc=21,ic=22,oc=23;function Ui(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${T} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new b(p.null,null,1):new b(p.undefined,void 0,1)}function Li(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${T} indefinite length items not allowed`);return new b(p.break,void 0,1)}function Dr(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${T} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${T} Infinity values are not supported`)}return new b(p.float,t,e)}function zi(t,e,r,n){return Dr(Cr(t,e+1),3,n)}function Fi(t,e,r,n){return Dr(Ur(t,e+1),5,n)}function Mi(t,e,r,n){return Dr(Hi(t,e+1),9,n)}function Vt(t,e,r){let n=e.value;if(n===!1)t.push([p.float.majorEncoded|rc]);else if(n===!0)t.push([p.float.majorEncoded|nc]);else if(n===null)t.push([p.float.majorEncoded|ic]);else if(n===void 0)t.push([p.float.majorEncoded|oc]);else{let i,o=!1;(!r||r.float64!==!0)&&(Ri(n),i=Cr(ie,1),n===i||Number.isNaN(n)?(ie[0]=249,t.push(ie.slice(0,3)),o=!0):($i(n),i=Ur(ie,1),n===i&&(ie[0]=250,t.push(ie.slice(0,5)),o=!0))),o||(sc(n),i=Hi(ie,1),ie[0]=251,t.push(ie.slice(0,9)))}}Vt.encodedSize=function(e,r){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){Ri(n);let i=Cr(ie,1);if(n===i||Number.isNaN(n))return 3;if($i(n),i=Ur(ie,1),n===i)return 5}return 9};var Oi=new ArrayBuffer(9),re=new DataView(Oi,1),ie=new Uint8Array(Oi,0);function Ri(t){if(t===1/0)re.setUint16(0,31744,!1);else if(t===-1/0)re.setUint16(0,64512,!1);else if(Number.isNaN(t))re.setUint16(0,32256,!1);else{re.setFloat32(0,t);let e=re.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)re.setUint16(0,31744,!1);else if(r===0)re.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?re.setUint16(0,0):i<-14?re.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):re.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}function Cr(t,e){if(t.length-e<2)throw new Error(`${T} not enough data for float16`);let r=(t[e]<<8)+t[e+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,o;return n===0?o=i*2**-24:n!==31?o=(i+1024)*2**(n-25):o=i===0?1/0:NaN,r&32768?-o:o}function $i(t){re.setFloat32(0,t,!1)}function Ur(t,e){if(t.length-e<4)throw new Error(`${T} not enough data for float32`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}function sc(t){re.setFloat64(0,t,!1)}function Hi(t,e){if(t.length-e<8)throw new Error(`${T} not enough data for float64`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}Vt.compareTokens=te.compareTokens;function P(t,e,r){throw new Error(`${T} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}function jt(t){return()=>{throw new Error(`${T} ${t}`)}}var y=[];for(let t=0;t<=23;t++)y[t]=P;y[24]=Kn;y[25]=Zn;y[26]=Yn;y[27]=ei;y[28]=P;y[29]=P;y[30]=P;y[31]=P;for(let t=32;t<=55;t++)y[t]=P;y[56]=ti;y[57]=ri;y[58]=ni;y[59]=oi;y[60]=P;y[61]=P;y[62]=P;y[63]=P;for(let t=64;t<=87;t++)y[t]=si;y[88]=ai;y[89]=ci;y[90]=ui;y[91]=fi;y[92]=P;y[93]=P;y[94]=P;y[95]=jt("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)y[t]=li;y[120]=hi;y[121]=di;y[122]=pi;y[123]=mi;y[124]=P;y[125]=P;y[126]=P;y[127]=jt("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)y[t]=gi;y[152]=wi;y[153]=bi;y[154]=xi;y[155]=_i;y[156]=P;y[157]=P;y[158]=P;y[159]=vi;for(let t=160;t<=183;t++)y[t]=Ei;y[184]=ki;y[185]=Ai;y[186]=Bi;y[187]=Ti;y[188]=P;y[189]=P;y[190]=P;y[191]=Si;for(let t=192;t<=215;t++)y[t]=Ni;y[216]=Ii;y[217]=Pi;y[218]=Di;y[219]=Ci;y[220]=P;y[221]=P;y[222]=P;y[223]=P;for(let t=224;t<=243;t++)y[t]=jt("simple values are not supported");y[244]=P;y[245]=P;y[246]=P;y[247]=Ui;y[248]=jt("simple values are not supported");y[249]=zi;y[250]=Fi;y[251]=Mi;y[252]=P;y[253]=P;y[254]=P;y[255]=Li;var oe=[];for(let t=0;t<24;t++)oe[t]=new b(p.uint,t,1);for(let t=-1;t>=-24;t--)oe[31-t]=new b(p.negint,t,1);oe[64]=new b(p.bytes,new Uint8Array(0),1);oe[96]=new b(p.string,"",1);oe[128]=new b(p.array,0,1);oe[160]=new b(p.map,0,1);oe[244]=new b(p.false,!1,1);oe[245]=new b(p.true,!0,1);oe[246]=new b(p.null,null,1);function cc(){let t=[];return t[p.uint.major]=te,t[p.negint.major]=Mt,t[p.bytes.major]=Qe,t[p.string.major]=yi,t[p.array.major]=Rt,t[p.map.major]=$t,t[p.tag.major]=Ht,t[p.float.major]=Vt,t}var Yf=cc(),el=new Ft,Xe=class{constructor(e,r){this.obj=e,this.parent=r}includes(e){let r=this;do if(r.obj===e)return!0;while(r=r.parent);return!1}static createCheck(e,r){if(e&&e.includes(r))throw new Error(`${Ir} object contains circular references`);return new Xe(r,e)}},be={null:new b(p.null,null),undefined:new b(p.undefined,void 0),true:new b(p.true,!0),false:new b(p.false,!1),emptyArray:new b(p.array,0),emptyMap:new b(p.map,0)},xe={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new b(p.float,t):t>=0?new b(p.uint,t):new b(p.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new b(p.uint,t):new b(p.negint,t)},Uint8Array(t,e,r,n){return new b(p.bytes,t)},string(t,e,r,n){return new b(p.string,t)},boolean(t,e,r,n){return t?be.true:be.false},null(t,e,r,n){return be.null},undefined(t,e,r,n){return be.undefined},ArrayBuffer(t,e,r,n){return new b(p.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new b(p.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[be.emptyArray,new b(p.break)]:be.emptyArray;n=Xe.createCheck(n,t);let i=[],o=0;for(let s of t)i[o++]=Lr(s,r,n);return r.addBreakTokens?[new b(p.array,t.length),i,new b(p.break)]:[new b(p.array,t.length),i]},Object(t,e,r,n){let i=e!=="Object",o=i?t.keys():Object.keys(t),s=i?t.size:o.length;if(!s)return r.addBreakTokens===!0?[be.emptyMap,new b(p.break)]:be.emptyMap;n=Xe.createCheck(n,t);let c=[],a=0;for(let f of o)c[a++]=[Lr(f,r,n),Lr(i?t.get(f):t[f],r,n)];return uc(c,r),r.addBreakTokens?[new b(p.map,s),c,new b(p.break)]:[new b(p.map,s),c]}};xe.Map=xe.Object;xe.Buffer=xe.Uint8Array;for(let t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))xe[`${t}Array`]=xe.DataView;function Lr(t,e={},r){let n=$n(t),i=e&&e.typeEncoders&&e.typeEncoders[n]||xe[n];if(typeof i=="function"){let s=i(t,n,e,r);if(s!=null)return s}let o=xe[n];if(!o)throw new Error(`${Ir} unsupported type: ${n}`);return o(t,n,e,r)}function uc(t,e){e.mapSorter&&t.sort(e.mapSorter)}var fc={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},zr=class{constructor(e,r={}){this.pos=0,this.data=e,this.options=r}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],r=oe[e];if(r===void 0){let n=y[e];if(!n)throw new Error(`${T} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let i=e&31;r=n(this.data,this.pos,i,this.options)}return this.pos+=r.encodedLength,r}},lt=Symbol.for("DONE"),Gt=Symbol.for("BREAK");function lc(t,e,r){let n=[];for(let i=0;i<t.value;i++){let o=ht(e,r);if(o===Gt){if(t.value===1/0)break;throw new Error(`${T} got unexpected break to lengthed array`)}if(o===lt)throw new Error(`${T} found array but not enough entries (got ${i}, expected ${t.value})`);n[i]=o}return n}function hc(t,e,r){let n=r.useMaps===!0,i=n?void 0:{},o=n?new Map:void 0;for(let s=0;s<t.value;s++){let c=ht(e,r);if(c===Gt){if(t.value===1/0)break;throw new Error(`${T} got unexpected break to lengthed map`)}if(c===lt)throw new Error(`${T} found map but not enough entries (got ${s} [no key], expected ${t.value})`);if(n!==!0&&typeof c!="string")throw new Error(`${T} non-string keys not supported (got ${typeof c})`);if(r.rejectDuplicateMapKeys===!0&&(n&&o.has(c)||!n&&c in i))throw new Error(`${T} found repeat map key "${c}"`);let a=ht(e,r);if(a===lt)throw new Error(`${T} found map but not enough entries (got ${s} [no value], expected ${t.value})`);n?o.set(c,a):i[c]=a}return n?o:i}function ht(t,e){if(t.done())return lt;let r=t.next();if(r.type===p.break)return Gt;if(r.type.terminal)return r.value;if(r.type===p.array)return lc(r,t,e);if(r.type===p.map)return hc(r,t,e);if(r.type===p.tag){if(e.tags&&typeof e.tags[r.value]=="function"){let n=ht(t,e);return e.tags[r.value](n)}throw new Error(`${T} tag not supported (${r.value})`)}throw new Error("unsupported")}function Fr(t,e){if(!(t instanceof Uint8Array))throw new Error(`${T} data to decode must be a Uint8Array`);e=Object.assign({},fc,e);let r=e.tokenizer||new zr(t,e),n=ht(r,e);if(n===lt)throw new Error(`${T} did not find any content to decode`);if(n===Gt)throw new Error(`${T} got unexpected break`);if(!r.done())throw new Error(`${T} too many terminals, data makes no sense`);return n}var mc=42;function yc(t){if(t[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return D.decode(t.subarray(1))}var Vi={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Vi.tags[mc]=yc;var ji=113;var Gi=t=>Fr(t,Vi);var gc=new TextDecoder;function Mr(t,e){let r=0;for(let n=0;;n+=7){if(n>=64)throw new Error("protobuf: varint overflow");if(e>=t.length)throw new Error("protobuf: unexpected end of data");let i=t[e++];if(r+=n<28?(i&127)<<n:(i&127)*2**n,i<128)break}return[r,e]}function Qt(t,e){let r;[r,e]=Mr(t,e);let n=e+r;if(r<0||n<0)throw new Error("protobuf: invalid length");if(n>t.length)throw new Error("protobuf: unexpected end of data");return[t.subarray(e,n),n]}function qi(t,e){let r;return[r,e]=Mr(t,e),[r&7,r>>3,e]}function wc(t){let e={},r=t.length,n=0;for(;n<r;){let i,o;if([i,o,n]=qi(t,n),o===1){if(e.Hash)throw new Error("protobuf: (PBLink) duplicate Hash section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Hash`);if(e.Name!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Name before Hash");if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Hash");[e.Hash,n]=Qt(t,n)}else if(o===2){if(e.Name!==void 0)throw new Error("protobuf: (PBLink) duplicate Name section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Name`);if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Name");let s;[s,n]=Qt(t,n),e.Name=gc.decode(s)}else if(o===3){if(e.Tsize!==void 0)throw new Error("protobuf: (PBLink) duplicate Tsize section");if(i!==0)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Tsize`);[e.Tsize,n]=Mr(t,n)}else throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${o}`)}if(n>r)throw new Error("protobuf: (PBLink) unexpected end of data");return e}function Wi(t){let e=t.length,r=0,n,i=!1,o;for(;r<e;){let c,a;if([c,a,r]=qi(t,r),c!==2)throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${c}`);if(a===1){if(o)throw new Error("protobuf: (PBNode) duplicate Data section");[o,r]=Qt(t,r),n&&(i=!0)}else if(a===2){if(i)throw new Error("protobuf: (PBNode) duplicate Links section");n||(n=[]);let f;[f,r]=Qt(t,r),n.push(wc(f))}else throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${a}`)}if(r>e)throw new Error("protobuf: (PBNode) unexpected end of data");let s={};return o&&(s.Data=o),s.Links=n||[],s}var ll=new TextEncoder,hl=2**32,dl=2**31;var yl=new TextEncoder;var qt=112;function _e(t){let e=Wi(t),r={};return e.Data&&(r.Data=e.Data),e.Links&&(r.Links=e.Links.map(n=>{let i={};try{i.Hash=D.decode(n.Hash)}catch{}if(!i.Hash)throw new Error("Invalid Hash field found in link, expected CID");return n.Name!==void 0&&(i.Name=n.Name),n.Tsize!==void 0&&(i.Tsize=n.Tsize),i})),r}var $s=H(fe(),1);var Wt=85;var $r={};W($r,{identity:()=>Rr});var Ji=0,bc="identity",Ki=le,xc=t=>Te(Ji,Ki(t)),Rr={code:Ji,name:bc,encode:Ki,digest:xc};var Zi=H(fe(),1);var _c=async(t,e,r,n,i,o,s,c)=>{let a=await s.get(t,c),f=Gi(a),l=f,m=r;for(;n.length>0;){let A=n[0];if(A in l){n.shift(),m=`${m}/${A}`;let u=D.asCID(l[A]);if(u!=null)return{entry:{type:"object",name:e,path:r,cid:t,node:a,depth:o,size:BigInt(a.length),content:async function*(){yield f}},next:{cid:u,name:A,path:m,toResolve:n}};l=l[A]}else throw(0,Zi.default)(new Error(`No property named ${A} found in cbor node ${t}`),"ERR_NO_PROP")}return{entry:{type:"object",name:e,path:r,cid:t,node:a,depth:o,size:BigInt(a.length),content:async function*(){yield f}}}},Yi=_c;var eo=H(fe(),1);var G=class extends Event{constructor(e,r){super(e),this.detail=r}};function vc(t,e,r,n){let i=BigInt(t.length),o=BigInt(e+i);return r>=o||n<e?new Uint8Array(0):(n>=e&&n<o&&(t=t.subarray(0,Number(n-e))),r>=e&&r<o&&(t=t.subarray(Number(r-e))),t)}var Ne=vc;var dt=H(fe(),1),Ec=(t,e=0,r=t)=>{let n=BigInt(t),i=BigInt(e??0),o=BigInt(r);if(o!==n&&(o=i+o),o>n&&(o=n),i<0n)throw(0,dt.default)(new Error("Offset must be greater than or equal to 0"),"ERR_INVALID_PARAMS");if(i>n)throw(0,dt.default)(new Error("Offset must be less than the file size"),"ERR_INVALID_PARAMS");if(o<0n)throw(0,dt.default)(new Error("Length must be greater than or equal to 0"),"ERR_INVALID_PARAMS");if(o>n)throw(0,dt.default)(new Error("Length must be less than the file size"),"ERR_INVALID_PARAMS");return{start:i,end:o}},Je=Ec;var kc=t=>{async function*e(r={}){let{start:n,end:i}=Je(t.length,r.offset,r.length),o=Ne(t,0n,n,i);r.onProgress?.(new G("unixfs:exporter:progress:identity",{bytesRead:BigInt(o.byteLength),totalBytes:i-n,fileSize:BigInt(t.byteLength)})),yield o}return e},Ac=async(t,e,r,n,i,o,s,c)=>{if(n.length>0)throw(0,eo.default)(new Error(`No link named ${r} found in raw node ${t}`),"ERR_NOT_FOUND");let a=Lt(t.multihash.bytes);return{entry:{type:"identity",name:e,path:r,cid:t,content:kc(a.digest),depth:o,size:BigInt(a.digest.length),node:a.digest}}},to=Ac;var ro=H(fe(),1);var Bc=t=>{async function*e(r={}){let{start:n,end:i}=Je(t.length,r.offset,r.length),o=Ne(t,0n,n,i);r.onProgress?.(new G("unixfs:exporter:progress:raw",{bytesRead:BigInt(o.byteLength),totalBytes:i-n,fileSize:BigInt(t.byteLength)})),yield o}return e},Tc=async(t,e,r,n,i,o,s,c)=>{if(n.length>0)throw(0,ro.default)(new Error(`No link named ${r} found in raw node ${t}`),"ERR_NOT_FOUND");let a=await s.get(t,c);return{entry:{type:"raw",name:e,path:r,cid:t,content:Bc(a),depth:o,size:BigInt(a.length),node:a}}},no=Tc;var Nt=H(fe(),1);var sn=H(fe(),1);var en=H(Qr(),1),Go=H(Fo(),1),Qo=H(Pe(),1),tn=H(Yr(),1),qo=H(jo(),1);function zc(){Qo.default._configure(),en.default._configure(Go.default),tn.default._configure(qo.default)}zc();var Wo=["uint64","int64","sint64","fixed64","sfixed64"];function Fc(t){for(let e of Wo){if(t[e]==null)continue;let r=t[e];t[e]=function(){return BigInt(r.call(this).toString())}}return t}function rn(t){return Fc(new en.default(t))}function Mc(t){for(let e of Wo){if(t[e]==null)continue;let r=t[e];t[e]=function(n){return r.call(this,n.toString())}}return t}function nn(){return Mc(tn.default.create())}function yt(t,e){let r=rn(t instanceof Uint8Array?t:t.subarray());return e.decode(r)}function gt(t,e){let r=nn();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Ze;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Ze||(Ze={}));function Yt(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function on(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(o,s){let c=e(o);s.int32(c)},n=function(o){let s=o.int32();return e(s)};return Yt("enum",Ze.VARINT,r,n)}function wt(t,e){return Yt("message",Ze.LENGTH_DELIMITED,t,e)}var ce;(function(t){let e;(function(i){i.Raw="Raw",i.Directory="Directory",i.File="File",i.Metadata="Metadata",i.Symlink="Symlink",i.HAMTShard="HAMTShard"})(e=t.DataType||(t.DataType={}));let r;(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"})(r||(r={})),function(i){i.codec=()=>on(r)}(e=t.DataType||(t.DataType={}));let n;t.codec=()=>(n==null&&(n=wt((i,o,s={})=>{if(s.lengthDelimited!==!1&&o.fork(),i.Type!=null&&(o.uint32(8),t.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 c of i.blocksizes)o.uint32(32),o.uint64(c);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),er.codec().encode(i.mtime,o)),s.lengthDelimited!==!1&&o.ldelim()},(i,o)=>{let s={blocksizes:[]},c=o==null?i.len:i.pos+o;for(;i.pos<c;){let a=i.uint32();switch(a>>>3){case 1:s.Type=t.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=er.codec().decode(i,i.uint32());break;default:i.skipType(a&7);break}}return s})),n),t.encode=i=>gt(i,t.codec()),t.decode=i=>yt(i,t.codec())})(ce||(ce={}));var er;(function(t){let e;t.codec=()=>(e==null&&(e=wt((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Seconds!=null&&(n.uint32(8),n.int64(r.Seconds)),r.FractionalNanoseconds!=null&&(n.uint32(21),n.fixed32(r.FractionalNanoseconds)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},o=n==null?r.len:r.pos+n;for(;r.pos<o;){let s=r.uint32();switch(s>>>3){case 1:i.Seconds=r.int64();break;case 2:i.FractionalNanoseconds=r.fixed32();break;default:r.skipType(s&7);break}}return i})),e),t.encode=r=>gt(r,t.codec()),t.decode=r=>yt(r,t.codec())})(er||(er={}));var Xo;(function(t){let e;t.codec=()=>(e==null&&(e=wt((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.MimeType!=null&&(n.uint32(10),n.string(r.MimeType)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},o=n==null?r.len:r.pos+n;for(;r.pos<o;){let s=r.uint32();switch(s>>>3){case 1:i.MimeType=r.string();break;default:r.skipType(s&7);break}}return i})),e),t.encode=r=>gt(r,t.codec()),t.decode=r=>yt(r,t.codec())})(Xo||(Xo={}));var Jo={Raw:"raw",Directory:"directory",File:"file",Metadata:"metadata",Symlink:"symlink",HAMTShard:"hamt-sharded-directory"},Oc=["directory","hamt-sharded-directory"],Ko=parseInt("0644",8),Zo=parseInt("0755",8),ke=class{static unmarshal(e){let r=ce.decode(e),n=new ke({type:Jo[r.Type!=null?r.Type.toString():"File"],data:r.Data,blockSizes:r.blocksizes,mode:r.mode,mtime:r.mtime!=null?{secs:r.mtime.Seconds??0n,nsecs:r.mtime.FractionalNanoseconds}:void 0});return n._originalMode=r.mode??0,n}type;data;blockSizes;hashType;fanout;mtime;_mode;_originalMode;constructor(e={type:"file"}){let{type:r,data:n,blockSizes:i,hashType:o,fanout:s,mtime:c,mode:a}=e;if(r!=null&&!Object.values(Jo).includes(r))throw(0,sn.default)(new Error("Type: "+r+" is not valid"),"ERR_INVALID_TYPE");this.type=r??"file",this.data=n,this.hashType=o,this.fanout=s,this.blockSizes=i??[],this._originalMode=0,this.mode=a,this.mtime=c}set mode(e){e==null?this._mode=this.isDirectory()?Zo:Ko:this._mode=e&4095}get mode(){return this._mode}isDirectory(){return Oc.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(r=>{e+=r}),this.data!=null&&(e+=BigInt(this.data.length)),e}marshal(){let e;switch(this.type){case"raw":e=ce.DataType.Raw;break;case"directory":e=ce.DataType.Directory;break;case"file":e=ce.DataType.File;break;case"metadata":e=ce.DataType.Metadata;break;case"symlink":e=ce.DataType.Symlink;break;case"hamt-sharded-directory":e=ce.DataType.HAMTShard;break;default:throw(0,sn.default)(new Error(`Type: ${e} is not valid`),"ERR_INVALID_TYPE")}let r=this.data;(this.data==null||this.data.length===0)&&(r=void 0);let n;this.mode!=null&&(n=this._originalMode&4294963200|(this.mode??0),n===Ko&&!this.isDirectory()&&(n=void 0),n===Zo&&this.isDirectory()&&(n=void 0));let i;return this.mtime!=null&&(i={Seconds:this.mtime.secs,FractionalNanoseconds:this.mtime.nsecs}),ce.encode({Type:e,Data:r,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:n,mtime:i})}};var Ce=({name:t,code:e,encode:r})=>new an(t,e,r),an=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Te(this.code,r):r.then(n=>Te(this.code,n))}else throw Error("Unknown type, must be binary type")}};var rr=H(rs(),1);function Rc(t){let e=new Array(4);for(let r=0;r<4;r++)e[r]=t&255,t=t>>8;return new Uint8Array(e)}var Bh=Ce({name:"murmur3-32",code:35,encode:t=>Rc(rr.default.x86.hash32(t))}),ns=Ce({name:"murmur3-128",code:34,encode:t=>Oe.fromHex(rr.default.x64.hash128(t))}),Th=Ce({name:"murmur3-x64-64",code:34,encode:t=>Oe.fromHex(rr.default.x64.hash128(t)).subarray(0,8)});var ds=H(ss(),1);var cn={};W(cn,{identity:()=>jc});var jc=He({prefix:"\0",name:"identity",encode:t=>vr(t),decode:t=>_r(t)});var un={};W(un,{base2:()=>Gc});var Gc=L({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var fn={};W(fn,{base8:()=>Qc});var Qc=L({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ln={};W(ln,{base10:()=>qc});var qc=we({prefix:"9",name:"base10",alphabet:"0123456789"});var hn={};W(hn,{base16:()=>Wc,base16upper:()=>Xc});var Wc=L({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Xc=L({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var dn={};W(dn,{base36:()=>Jc,base36upper:()=>Kc});var Jc=we({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Kc=we({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var pn={};W(pn,{base64:()=>Zc,base64pad:()=>Yc,base64url:()=>eu,base64urlpad:()=>tu});var Zc=L({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Yc=L({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),eu=L({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),tu=L({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var mn={};W(mn,{base256emoji:()=>su});var as=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}"),ru=as.reduce((t,e,r)=>(t[r]=e,t),[]),nu=as.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function iu(t){return t.reduce((e,r)=>(e+=ru[r],e),"")}function ou(t){let e=[];for(let r of t){let n=nu[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var su=He({prefix:"\u{1F680}",name:"base256emoji",encode:iu,decode:ou});var yn={};W(yn,{sha256:()=>au,sha512:()=>cu});var cs=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),au=Ce({name:"sha2-256",code:18,encode:cs("SHA-256")}),cu=Ce({name:"sha2-512",code:19,encode:cs("SHA-512")});var $h=new TextEncoder,Hh=new TextDecoder;var gn={...cn,...un,...fn,...ln,...hn,...Sr,...dn,...Tr,...pn,...mn},jh={...yn,...$r};function Ye(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function nr(t=0){return globalThis.Buffer?.allocUnsafe!=null?Ye(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function fs(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var us=fs("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),wn=fs("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=nr(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),fu={utf8:us,"utf-8":us,hex:gn.base16,latin1:wn,ascii:wn,binary:wn,...gn},ls=fu;function hs(t,e="utf8"){let r=ls[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ye(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}var Q=class{constructor(e,r,n=0){this._options=e,this._popCount=0,this._parent=r,this._posAtParent=n,this._children=new ds.default,this.key=null}async put(e,r){let n=await this._findNewBucketAndPos(e);await n.bucket._putAt(n,e,r)}async get(e){let r=await this._findChild(e);if(r!=null)return r.value}async del(e){let r=await this._findPlace(e),n=r.bucket._at(r.pos);n!=null&&n.key===e&&r.bucket._delAt(r.pos)}leafCount(){return this._children.compactArray().reduce((r,n)=>n instanceof Q?r+n.leafCount():r+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){let e=this._children.compactArray();for(let r of e)r instanceof Q?yield*r.eachLeafSeries():yield r}serialize(e,r){let n=[];return r(this._children.reduce((i,o,s)=>(o!=null&&(o instanceof Q?i.push(o.serialize(e,r)):i.push(e(o,s))),i),n))}async asyncTransform(e,r){return await ps(this,e,r)}toJSON(){return this.serialize(hu,du)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(e){let r=await this._findPlace(e),n=r.bucket._at(r.pos);if(!(n instanceof Q)&&n!=null&&n.key===e)return n}async _findPlace(e){let r=this._options.hash(typeof e=="string"?hs(e):e),n=await r.take(this._options.bits),i=this._children.get(n);return i instanceof Q?await i._findPlace(r):{bucket:this,pos:n,hash:r,existingChild:i}}async _findNewBucketAndPos(e){let r=await this._findPlace(e);if(r.existingChild!=null&&r.existingChild.key!==e){let n=new Q(this._options,r.bucket,r.pos);r.bucket._putObjectAt(r.pos,n);let i=await n._findPlace(r.existingChild.hash);return i.bucket._putAt(i,r.existingChild.key,r.existingChild.value),await n._findNewBucketAndPos(r.hash)}return r}_putAt(e,r,n){this._putObjectAt(e.pos,{key:r,value:n,hash:e.hash})}_putObjectAt(e,r){this._children.get(e)==null&&this._popCount++,this._children.set(e,r)}_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(lu);if(e!=null&&!(e instanceof Q)){let r=e.hash;r.untake(this._options.bits);let n={pos:this._posAtParent,hash:r,bucket:this._parent};this._parent._putAt(n,e.key,e.value)}}else this._parent._delAt(this._posAtParent)}_at(e){return this._children.get(e)}};function lu(t){return!!t}function hu(t,e){return t.key}function du(t){return t}async function ps(t,e,r){let n=[];for(let i of t._children.compactArray())if(i instanceof Q)await ps(i,e,r);else{let o=await e(i);n.push({bitField:t._children.bitField(),children:o})}return await r(n)}var pu=[255,254,252,248,240,224,192,128],mu=[1,3,7,15,31,63,127,255],ir=class{constructor(e){this._value=e,this._currentBytePos=e.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take(e){let r=e,n=0;for(;r>0&&this._haveBits();){let i=this._value[this._currentBytePos],o=this._currentBitPos+1,s=Math.min(o,r),c=yu(i,o-s,s);n=(n<<s)+c,r-=s,this._currentBitPos-=s,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return n}untake(e){for(this._currentBitPos+=e;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function yu(t,e,r){let n=gu(e,r);return(t&n)>>>e}function gu(t,e){return pu[t]&mu[Math.min(e+t-1,7)]}function ms(t,e){e==null&&(e=t.reduce((i,o)=>i+o.length,0));let r=nr(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Ye(r)}function ys(t){function e(r){return r instanceof or?r:new or(r,t)}return e}var or=class{constructor(e,r){if(!(e instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=e,this._hashFn=r,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(e){let r=e;for(;this._availableBits<r;)await this._produceMoreBits();let n=0;for(;r>0;){let i=this._buffers[this._currentBufferIndex],o=Math.min(i.availableBits(),r),s=i.take(o);n=(n<<o)+s,r-=o,this._availableBits-=o,i.availableBits()===0&&this._currentBufferIndex++}return n}untake(e){let r=e;for(;r>0;){let n=this._buffers[this._currentBufferIndex],i=Math.min(n.totalBits()-n.availableBits(),r);n.untake(i),r-=i,this._availableBits+=i,this._currentBufferIndex>0&&n.totalBits()===n.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;let e=this._depth>0?ms([this._value,Uint8Array.from([this._depth])]):this._value,r=await this._hashFn(e),n=new ir(r);this._buffers.push(n),this._availableBits+=n.availableBits()}};function gs(t){if(t==null||t.hashFn==null)throw new Error("please define an options.hashFn");let e={bits:t.bits??8,hash:ys(t.hashFn)};return new Q(e)}var wu=async function(t){return(await ns.encode(t)).slice(0,8).reverse()},bu=async(t,e,r)=>{await Promise.all(t.map(async n=>{if(n.Name==null)throw new Error("Unexpected Link without a Name");if(n.Name.length===2){let i=parseInt(n.Name,16);e._putObjectAt(i,new Q({hash:r._options.hash,bits:r._options.bits},e,i));return}await r.put(n.Name.substring(2),!0)}))},ws=t=>t.toString(16).toUpperCase().padStart(2,"0").substring(0,2),xu=t=>{let e=t.bucket,r=[];for(;e._parent!=null;)r.push(e),e=e._parent;return r.push(e),r.reverse()},bs=async(t,e,r,n,i)=>{if(n==null){let l=gs({hashFn:wu});n={rootBucket:l,hamtDepth:1,lastBucket:l}}await bu(t.Links,n.lastBucket,n.rootBucket);let o=await n.rootBucket._findNewBucketAndPos(e),s=ws(o.pos),c=xu(o);c.length>n.hamtDepth&&(n.lastBucket=c[n.hamtDepth],s=ws(n.lastBucket._posAtParent));let a=t.Links.find(l=>{if(l.Name==null)return!1;let m=l.Name.substring(0,2),A=l.Name.substring(2);return!(m!==s||A!==""&&A!==e)});if(a==null)return;if(a.Name!=null&&a.Name.substring(2)===e)return a.Hash;n.hamtDepth++;let f=await r.get(a.Hash,i);return t=_e(f),bs(t,e,r,n,i)},xs=bs;function _u(t){let[e,r]=t[Symbol.asyncIterator]!=null?[t[Symbol.asyncIterator](),Symbol.asyncIterator]:[t[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:i=>{n.push(i)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[r](){return this}}}var sr=_u;function vu(t){return t[Symbol.asyncIterator]!=null}function Eu(t,e){if(vu(t))return async function*(){for await(let c of t)await e(c)&&(yield c)}();let r=sr(t),{value:n,done:i}=r.next();if(i===!0)return function*(){}();let o=e(n);if(typeof o.then=="function")return async function*(){await o&&(yield n);for await(let c of r)await e(c)&&(yield c)}();let s=e;return function*(){o===!0&&(yield n);for(let c of r)s(c)&&(yield c)}()}var _s=Eu;function ku(t){return t[Symbol.asyncIterator]!=null}function Au(t,e){if(ku(t))return async function*(){for await(let c of t)yield e(c)}();let r=sr(t),{value:n,done:i}=r.next();if(i===!0)return function*(){}();let o=e(n);if(typeof o.then=="function")return async function*(){yield await o;for await(let c of r)yield e(c)}();let s=e;return function*(){yield o;for(let c of r)yield s(c)}()}var et=Au;function tt(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var ar=globalThis.CustomEvent??Event;async function*Ue(t,e={}){let r=e.concurrency??1/0;r<1&&(r=1/0);let n=e.ordered==null?!1:e.ordered,i=new EventTarget,o=[],s=tt(),c=tt(),a=!1,f,l=!1;i.addEventListener("task-complete",()=>{c.resolve()}),Promise.resolve().then(async()=>{try{for await(let h of t){if(o.length===r&&(s=tt(),await s.promise),l)break;let d={done:!1};o.push(d),h().then(M=>{d.done=!0,d.ok=!0,d.value=M,i.dispatchEvent(new ar("task-complete"))},M=>{d.done=!0,d.err=M,i.dispatchEvent(new ar("task-complete"))})}a=!0,i.dispatchEvent(new ar("task-complete"))}catch(h){f=h,i.dispatchEvent(new ar("task-complete"))}});function m(){return n?o[0]?.done:!!o.find(h=>h.done)}function*A(){for(;o.length>0&&o[0].done;){let h=o[0];if(o.shift(),h.ok)yield h.value;else throw l=!0,s.resolve(),h.err;s.resolve()}}function*u(){for(;m();)for(let h=0;h<o.length;h++)if(o[h].done){let d=o[h];if(o.splice(h,1),h--,d.ok)yield d.value;else throw l=!0,s.resolve(),d.err;s.resolve()}}for(;;){if(m()||(c=tt(),await c.promise),f!=null)throw f;if(n?yield*A():yield*u(),a&&o.length===0)break}}var cr=class{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}},rt=class{constructor(e={}){this.hwm=e.splitLimit??16,this.head=new cr(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 r=this.head;this.head=r.next=new cr(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};function nt(t={}){return Bu(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function Bu(t,e){e=e??{};let r=e.onEnd,n=new rt,i,o,s,c=async()=>n.isEmpty()?s?{done:!0}:await new Promise((d,M)=>{o=g=>{o=null,n.push(g);try{d(t(n))}catch(w){M(w)}return i}}):t(n),a=d=>o!=null?o(d):(n.push(d),i),f=d=>(n=new rt,o!=null?o({error:d}):(n.push({error:d}),i)),l=d=>{if(s)return i;if(e?.objectMode!==!0&&d?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return a({done:!1,value:d})},m=d=>s?i:(s=!0,d!=null?f(d):a({done:!0})),A=()=>(n=new rt,m(),{done:!0}),u=d=>(m(d),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:A,throw:u,push:l,end:m,get readableLength(){return n.size}},r==null)return i;let h=i;return i={[Symbol.asyncIterator](){return this},next(){return h.next()},throw(d){return h.throw(d),r!=null&&(r(d),r=void 0),{done:!0}},return(){return h.return(),r!=null&&(r(),r=void 0),{done:!0}},push:l,end(d){return h.end(d),r!=null&&(r(d),r=void 0),i},get readableLength(){return h.readableLength}},i}function Tu(t){return t[Symbol.asyncIterator]!=null}function Su(...t){let e=[];for(let r of t)Tu(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=nt({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var vs=Su;function it(t,...e){if(t==null)throw new Error("Empty pipeline");if(bn(t)){let n=t;t=()=>n.source}else if(ks(t)||Es(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&bn(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n<r.length-1;n++)bn(r[n])&&(r[n]=Iu(r[n]));return Nu(...r)}var Nu=(...t)=>{let e;for(;t.length>0;)e=t.shift()(e);return e},Es=t=>t?.[Symbol.asyncIterator]!=null,ks=t=>t?.[Symbol.iterator]!=null,bn=t=>t==null?!1:t.sink!=null&&t.source!=null,Iu=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=nt({objectMode:!0});r.then(()=>{n.end()},s=>{n.end(s)});let i,o=t.source;if(Es(o))i=async function*(){yield*o,n.end()};else if(ks(o))i=function*(){yield*o,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return vs(n,i())}return t.source};var Pu=(t,e,r,n,i,o,s)=>{async function*c(a={}){let f=a.offset??0,l=a.length??e.Links.length,m=e.Links.slice(f,l);a.onProgress?.(new G("unixfs:exporter:walk:directory",{cid:t})),yield*it(m,A=>et(A,u=>async()=>{let h=u.Name??"",d=`${n}/${h}`;return(await i(u.Hash,h,d,[],o+1,s,a)).entry}),A=>Ue(A,{ordered:!0}),A=>_s(A,u=>u!=null))}return c},As=Pu;var ze=H(fe(),1);var zs=H(Ts(),1);var _t=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},_n=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Ss=t=>globalThis.DOMException===void 0?new _n(t):new DOMException(t),Ns=t=>{let e=t.reason===void 0?Ss("This operation was aborted."):t.reason;return e instanceof Error?e:Ss(e)};function vn(t,e,r,n){let i,o=new Promise((s,c)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){s(t);return}if(n={customTimers:{setTimeout,clearTimeout},...n},n.signal){let{signal:a}=n;a.aborted&&c(Ns(a)),a.addEventListener("abort",()=>{c(Ns(a))})}i=n.customTimers.setTimeout.call(void 0,()=>{if(typeof r=="function"){try{s(r())}catch(l){c(l)}return}let a=typeof r=="string"?r:`Promise timed out after ${e} milliseconds`,f=r instanceof Error?r:new _t(a);typeof t.cancel=="function"&&t.cancel(),c(f)},e),(async()=>{try{s(await t)}catch(a){c(a)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()});return o.clear=()=>{clearTimeout(i),i=void 0},o}function En(t,e,r){let n=0,i=t.length;for(;i>0;){let o=Math.trunc(i/2),s=n+o;r(t[s],e)<=0?(n=++s,i-=o+1):i=o}return n}var Le=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ge,vt=class{constructor(){ge.set(this,[])}enqueue(e,r){r={priority:0,...r};let n={priority:r.priority,run:e};if(this.size&&Le(this,ge,"f")[this.size-1].priority>=r.priority){Le(this,ge,"f").push(n);return}let i=En(Le(this,ge,"f"),n,(o,s)=>s.priority-o.priority);Le(this,ge,"f").splice(i,0,n)}dequeue(){let e=Le(this,ge,"f").shift();return e?.run}filter(e){return Le(this,ge,"f").filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return Le(this,ge,"f").length}};ge=new WeakMap;var U=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},E=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},F,kt,At,Be,mr,Bt,fr,ue,Et,Y,lr,ee,Tt,Ae,hr,Is,Ps,Us,Ds,Cs,dr,kn,An,yr,Ls,pr,gr=class extends Error{},St=class extends zs.default{constructor(e){var r,n,i,o;if(super(),F.add(this),kt.set(this,void 0),At.set(this,void 0),Be.set(this,0),mr.set(this,void 0),Bt.set(this,void 0),fr.set(this,0),ue.set(this,void 0),Et.set(this,void 0),Y.set(this,void 0),lr.set(this,void 0),ee.set(this,0),Tt.set(this,void 0),Ae.set(this,void 0),hr.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:vt,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=e.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${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 \`${(o=(i=e.interval)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""}\` (${typeof e.interval})`);U(this,kt,e.carryoverConcurrencyCount,"f"),U(this,At,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),U(this,mr,e.intervalCap,"f"),U(this,Bt,e.interval,"f"),U(this,Y,new e.queueClass,"f"),U(this,lr,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,U(this,hr,e.throwOnTimeout===!0,"f"),U(this,Ae,e.autoStart===!1,"f")}get concurrency(){return E(this,Tt,"f")}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})`);U(this,Tt,e,"f"),E(this,F,"m",yr).call(this)}async add(e,r={}){return r={timeout:this.timeout,throwOnTimeout:E(this,hr,"f"),...r},new Promise((n,i)=>{E(this,Y,"f").enqueue(async()=>{var o,s,c;U(this,ee,(s=E(this,ee,"f"),s++,s),"f"),U(this,Be,(c=E(this,Be,"f"),c++,c),"f");try{if(!((o=r.signal)===null||o===void 0)&&o.aborted)throw new gr("The task was aborted.");let a=e({signal:r.signal});r.timeout&&(a=vn(Promise.resolve(a),r.timeout)),r.signal&&(a=Promise.race([a,E(this,F,"m",Ls).call(this,r.signal)]));let f=await a;n(f),this.emit("completed",f)}catch(a){if(a instanceof _t&&!r.throwOnTimeout){n();return}i(a),this.emit("error",a)}finally{E(this,F,"m",Us).call(this)}},r),this.emit("add"),E(this,F,"m",dr).call(this)})}async addAll(e,r){return Promise.all(e.map(async n=>this.add(n,r)))}start(){return E(this,Ae,"f")?(U(this,Ae,!1,"f"),E(this,F,"m",yr).call(this),this):this}pause(){U(this,Ae,!0,"f")}clear(){U(this,Y,new(E(this,lr,"f")),"f")}async onEmpty(){E(this,Y,"f").size!==0&&await E(this,F,"m",pr).call(this,"empty")}async onSizeLessThan(e){E(this,Y,"f").size<e||await E(this,F,"m",pr).call(this,"next",()=>E(this,Y,"f").size<e)}async onIdle(){E(this,ee,"f")===0&&E(this,Y,"f").size===0||await E(this,F,"m",pr).call(this,"idle")}get size(){return E(this,Y,"f").size}sizeBy(e){return E(this,Y,"f").filter(e).length}get pending(){return E(this,ee,"f")}get isPaused(){return E(this,Ae,"f")}};kt=new WeakMap,At=new WeakMap,Be=new WeakMap,mr=new WeakMap,Bt=new WeakMap,fr=new WeakMap,ue=new WeakMap,Et=new WeakMap,Y=new WeakMap,lr=new WeakMap,ee=new WeakMap,Tt=new WeakMap,Ae=new WeakMap,hr=new WeakMap,F=new WeakSet,Is=function(){return E(this,At,"f")||E(this,Be,"f")<E(this,mr,"f")},Ps=function(){return E(this,ee,"f")<E(this,Tt,"f")},Us=function(){var e;U(this,ee,(e=E(this,ee,"f"),e--,e),"f"),E(this,F,"m",dr).call(this),this.emit("next")},Ds=function(){E(this,F,"m",An).call(this),E(this,F,"m",kn).call(this),U(this,Et,void 0,"f")},Cs=function(){let e=Date.now();if(E(this,ue,"f")===void 0){let r=E(this,fr,"f")-e;if(r<0)U(this,Be,E(this,kt,"f")?E(this,ee,"f"):0,"f");else return E(this,Et,"f")===void 0&&U(this,Et,setTimeout(()=>{E(this,F,"m",Ds).call(this)},r),"f"),!0}return!1},dr=function(){if(E(this,Y,"f").size===0)return E(this,ue,"f")&&clearInterval(E(this,ue,"f")),U(this,ue,void 0,"f"),this.emit("empty"),E(this,ee,"f")===0&&this.emit("idle"),!1;if(!E(this,Ae,"f")){let e=!E(this,F,"a",Cs);if(E(this,F,"a",Is)&&E(this,F,"a",Ps)){let r=E(this,Y,"f").dequeue();return r?(this.emit("active"),r(),e&&E(this,F,"m",kn).call(this),!0):!1}}return!1},kn=function(){E(this,At,"f")||E(this,ue,"f")!==void 0||(U(this,ue,setInterval(()=>{E(this,F,"m",An).call(this)},E(this,Bt,"f")),"f"),U(this,fr,Date.now()+E(this,Bt,"f"),"f"))},An=function(){E(this,Be,"f")===0&&E(this,ee,"f")===0&&E(this,ue,"f")&&(clearInterval(E(this,ue,"f")),U(this,ue,void 0,"f")),U(this,Be,E(this,kt,"f")?E(this,ee,"f"):0,"f"),E(this,F,"m",yr).call(this)},yr=function(){for(;E(this,F,"m",dr).call(this););},Ls=async function(e){return new Promise((r,n)=>{e.addEventListener("abort",()=>{n(new gr("The task was aborted."))},{once:!0})})},pr=async function(e,r){return new Promise(n=>{let i=()=>{r&&!r()||(this.off(e,i),n())};this.on(e,i)})};async function Fs(t,e,r,n,i,o,s){if(e instanceof Uint8Array){let f=Ne(e,n,i,o);r.push(f);return}if(e.Data==null)throw(0,ze.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");let c;try{c=ke.unmarshal(e.Data)}catch(f){throw(0,ze.default)(f,"ERR_NOT_UNIXFS")}if(c.data!=null){let f=c.data,l=Ne(f,n,i,o);r.push(l),n+=BigInt(l.byteLength)}let a=[];if(e.Links.length!==c.blockSizes.length)throw(0,ze.default)(new Error("Inconsistent block sizes and dag links"),"ERR_NOT_UNIXFS");for(let f=0;f<e.Links.length;f++){let l=e.Links[f],m=n,A=m+c.blockSizes[f];if((i>=m&&i<A||o>=m&&o<=A||i<m&&o>A)&&a.push({link:l,blockStart:n}),n=A,n>o)break}await it(a,f=>et(f,l=>async()=>{let m=await t.get(l.link.Hash,s);return{...l,block:m}}),f=>Ue(f,{ordered:!0}),async f=>{for await(let{link:l,block:m,blockStart:A}of f){let u;switch(l.Hash.code){case qt:u=_e(m);break;case Wt:u=m;break;default:r.end((0,ze.default)(new Error(`Unsupported codec: ${l.Hash.code}`),"ERR_NOT_UNIXFS"));return}let h=new St({concurrency:1});h.on("error",d=>{r.end(d)}),h.add(async()=>{s.onProgress?.(new G("unixfs:exporter:walk:file",{cid:l.Hash})),await Fs(t,u,r,A,i,o,s)}),await h.onIdle()}}),n>=o&&r.end()}var Uu=(t,e,r,n,i,o,s)=>{async function*c(a={}){let f=r.fileSize();if(f===void 0)throw new Error("File was a directory");let{start:l,end:m}=Je(f,a.offset,a.length);if(m===0n)return;let A=0n,u=m-l,h=nt();a.onProgress?.(new G("unixfs:exporter:walk:file",{cid:t})),Fs(s,e,h,0n,l,m,a).catch(d=>{h.end(d)});for await(let d of h)if(d!=null){if(A+=BigInt(d.byteLength),A>u)throw h.end(),(0,ze.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");A===u&&h.end(),a.onProgress?.(new G("unixfs:exporter:progress:unixfs:file",{bytesRead:A,totalBytes:u,fileSize:f})),yield d}if(A<u)throw(0,ze.default)(new Error("Traversed entire DAG but did not read enough bytes"),"ERR_UNDER_READ")}return c},Bn=Uu;var Lu=(t,e,r,n,i,o,s)=>{function c(a={}){return a.onProgress?.(new G("unixfs:exporter:walk:hamt-sharded-directory",{cid:t})),Ms(e,n,i,o,s,a)}return c};async function*Ms(t,e,r,n,i,o){let s=t.Links,c=it(s,a=>et(a,f=>async()=>{let l=f.Name!=null?f.Name.substring(2):null;if(l!=null&&l!==""){let m=await r(f.Hash,l,`${e}/${l}`,[],n+1,i,o);return{entries:m.entry==null?[]:[m.entry]}}else{let m=await i.get(f.Hash,o);return t=_e(m),o.onProgress?.(new G("unixfs:exporter:walk:hamt-sharded-directory",{cid:f.Hash})),{entries:Ms(t,e,r,n,i,o)}}}),a=>Ue(a,{ordered:!0}));for await(let{entries:a}of c)yield*a}var Os=Lu;var zu=(t,e)=>t.Links.find(n=>n.Name===e)?.Hash,Fu={raw:Bn,file:Bn,directory:As,"hamt-sharded-directory":Os,metadata:(t,e,r,n,i,o,s)=>()=>[],symlink:(t,e,r,n,i,o,s)=>()=>[]},Mu=async(t,e,r,n,i,o,s,c)=>{let a=await s.get(t,c),f=_e(a),l,m;if(e==null&&(e=t.toString()),f.Data==null)throw(0,Nt.default)(new Error("no data in PBNode"),"ERR_NOT_UNIXFS");try{l=ke.unmarshal(f.Data)}catch(u){throw(0,Nt.default)(u,"ERR_NOT_UNIXFS")}if(r==null&&(r=e),n.length>0){let u;if(l?.type==="hamt-sharded-directory"?u=await xs(f,n[0],s):u=zu(f,n[0]),u==null)throw(0,Nt.default)(new Error("file does not exist"),"ERR_NOT_FOUND");let h=n.shift(),d=`${r}/${h}`;m={cid:u,toResolve:n,name:h??"",path:d}}let A=Fu[l.type](t,f,l,r,i,o,s);if(A==null)throw(0,Nt.default)(new Error("could not find content exporter"),"ERR_NOT_FOUND");return l.isDirectory()?{entry:{type:"directory",name:e,path:r,cid:t,content:A,unixfs:l,depth:o,node:f,size:l.fileSize()},next:m}:{entry:{type:"file",name:e,path:r,cid:t,content:A,unixfs:l,depth:o,node:f,size:l.fileSize()},next:m}},Rs=Mu;var Ou={[qt]:Rs,[Wt]:no,[ji]:Yi,[Rr.code]:to},Hs=async(t,e,r,n,i,o,s)=>{let c=Ou[t.code];if(c==null)throw(0,$s.default)(new Error(`No resolver for code ${t.code}`),"ERR_NO_RESOLVER");return c(t,e,r,n,Hs,i,o,s)},Vs=Hs;var Ru=(t="")=>(t.trim().match(/([^\\^/]|\\\/)+/g)??[]).filter(Boolean),$u=t=>{if(t instanceof Uint8Array)return{cid:D.decode(t),toResolve:[]};let e=D.asCID(t);if(e!=null)return{cid:e,toResolve:[]};if(typeof t=="string"){t.indexOf("/ipfs/")===0&&(t=t.substring(6));let r=Ru(t);return{cid:D.parse(r[0]),toResolve:r.slice(1)}}throw(0,wr.default)(new Error(`Unknown path type ${t}`),"ERR_BAD_PATH")};async function*js(t,e,r={}){let{cid:n,toResolve:i}=$u(t),o=n.toString(),s=o,c=i.length;for(;;){let a=await Vs(n,o,s,i,c,e,r);if(a.entry==null&&a.next==null)throw(0,wr.default)(new Error(`Could not resolve ${t}`),"ERR_NOT_FOUND");if(a.entry!=null&&(yield a.entry),a.next==null)return;i=a.next.toResolve,n=a.next.cid,o=a.next.name,s=a.next.path}}async function Gs(t,e,r={}){let n=await In(js(t,e,r));if(n==null)throw(0,wr.default)(new Error(`Could not resolve ${t}`),"ERR_NOT_FOUND");return n}async function*Hu(t,e,r={}){let n=await Gs(t,e,r);if(n==null)return;if(yield n,n.type==="directory")for await(let o of i(n,r))yield o;async function*i(o,s){for await(let c of o.content(s))yield c,!(c instanceof Uint8Array)&&c.type==="directory"&&(yield*i(c,s))}}return Ks(Vu);})();
return IpfsUnixfsExporter}));