ipfs-unixfs
Advanced tools
Comparing version 11.1.5 to 11.2.0
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.IpfsUnixfs = factory()}(typeof self !== 'undefined' ? self : this, function () { | ||
"use strict";var IpfsUnixfs=(()=>{var ve=Object.create;var it=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var $e=Object.getPrototypeOf,Ge=Object.prototype.hasOwnProperty;var Xe=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),p=(r,t)=>{for(var e in t)it(r,e,{get:t[e],enumerable:!0})},Jt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Pe(t))!Ge.call(r,i)&&i!==e&&it(r,i,{get:()=>t[i],enumerable:!(n=Ve(t,i))||n.enumerable});return r};var qe=(r,t,e)=>(e=r!=null?ve($e(r)):{},Jt(t||!r||!r.__esModule?it(e,"default",{value:r,enumerable:!0}):e,r)),He=r=>Jt(it({},"__esModule",{value:!0}),r);var Kt=Xe((xn,Qt)=>{"use strict";function Wt(r,t){for(let e in t)Object.defineProperty(r,e,{value:t[e],enumerable:!0,configurable:!0});return r}function Je(r,t,e){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");e||(e={}),typeof t=="object"&&(e=t,t=""),t&&(e.code=t);try{return Wt(r,e)}catch{e.message=r.message,e.stack=r.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(r)),Wt(new i,e)}}Qt.exports=Je});var pn={};p(pn,{UnixFS:()=>Ht});var qt=qe(Kt(),1);function T(r=0){return new Uint8Array(r)}var We=Math.pow(2,7),Qe=Math.pow(2,14),Ke=Math.pow(2,21),Zt=Math.pow(2,28),jt=Math.pow(2,35),Yt=Math.pow(2,42),te=Math.pow(2,49),f=128,B=127;function q(r){if(r<We)return 1;if(r<Qe)return 2;if(r<Ke)return 3;if(r<Zt)return 4;if(r<jt)return 5;if(r<Yt)return 6;if(r<te)return 7;if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function ee(r,t,e=0){switch(q(r)){case 8:t[e++]=r&255|f,r/=128;case 7:t[e++]=r&255|f,r/=128;case 6:t[e++]=r&255|f,r/=128;case 5:t[e++]=r&255|f,r/=128;case 4:t[e++]=r&255|f,r>>>=7;case 3:t[e++]=r&255|f,r>>>=7;case 2:t[e++]=r&255|f,r>>>=7;case 1:{t[e++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return t}function re(r,t){let e=r[t],n=0;if(n+=e&B,e<f||(e=r[t+1],n+=(e&B)<<7,e<f)||(e=r[t+2],n+=(e&B)<<14,e<f)||(e=r[t+3],n+=(e&B)<<21,e<f)||(e=r[t+4],n+=(e&B)*Zt,e<f)||(e=r[t+5],n+=(e&B)*jt,e<f)||(e=r[t+6],n+=(e&B)*Yt,e<f)||(e=r[t+7],n+=(e&B)*te,e<f))return n;throw new RangeError("Could not decode varint")}var ut=new Float32Array([-0]),M=new Uint8Array(ut.buffer);function ne(r,t,e){ut[0]=r,t[e]=M[0],t[e+1]=M[1],t[e+2]=M[2],t[e+3]=M[3]}function ie(r,t){return M[0]=r[t],M[1]=r[t+1],M[2]=r[t+2],M[3]=r[t+3],ut[0]}var ft=new Float64Array([-0]),u=new Uint8Array(ft.buffer);function oe(r,t,e){ft[0]=r,t[e]=u[0],t[e+1]=u[1],t[e+2]=u[2],t[e+3]=u[3],t[e+4]=u[4],t[e+5]=u[5],t[e+6]=u[6],t[e+7]=u[7]}function se(r,t){return u[0]=r[t],u[1]=r[t+1],u[2]=r[t+2],u[3]=r[t+3],u[4]=r[t+4],u[5]=r[t+5],u[6]=r[t+6],u[7]=r[t+7],ft[0]}var Ze=BigInt(Number.MAX_SAFE_INTEGER),je=BigInt(Number.MIN_SAFE_INTEGER),m=class r{lo;hi;constructor(t,e){this.lo=t|0,this.hi=e|0}toNumber(t=!1){if(!t&&this.hi>>>31>0){let e=~this.lo+1>>>0,n=~this.hi>>>0;return e===0&&(n=n+1>>>0),-(e+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(t=!1){if(t)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let e=~this.lo+1>>>0,n=~this.hi>>>0;return e===0&&(n=n+1>>>0),-(BigInt(e)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(t=!1){return this.toBigInt(t).toString()}zzEncode(){let t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this}zzDecode(){let t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this}length(){let t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?e===0?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}static fromBigInt(t){if(t===0n)return U;if(t<Ze&&t>je)return this.fromNumber(Number(t));let e=t<0n;e&&(t=-t);let n=t>>32n,i=t-(n<<32n);return e&&(n=~n|0n,i=~i|0n,++i>ce&&(i=0n,++n>ce&&(n=0n))),new r(Number(i),Number(n))}static fromNumber(t){if(t===0)return U;let e=t<0;e&&(t=-t);let n=t>>>0,i=(t-n)/4294967296>>>0;return e&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new r(n,i)}static from(t){return typeof t=="number"?r.fromNumber(t):typeof t=="bigint"?r.fromBigInt(t):typeof t=="string"?r.fromBigInt(BigInt(t)):t.low!=null||t.high!=null?new r(t.low>>>0,t.high>>>0):U}},U=new m(0,0);U.toBigInt=function(){return 0n};U.zzEncode=U.zzDecode=function(){return this};U.length=function(){return 1};var ce=4294967296n;function ae(r){let t=0,e=0;for(let n=0;n<r.length;++n)e=r.charCodeAt(n),e<128?t+=1:e<2048?t+=2:(e&64512)===55296&&(r.charCodeAt(n+1)&64512)===56320?(++n,t+=4):t+=3;return t}function he(r,t,e){if(e-t<1)return"";let i,o=[],s=0,c;for(;t<e;)c=r[t++],c<128?o[s++]=c:c>191&&c<224?o[s++]=(c&31)<<6|r[t++]&63:c>239&&c<365?(c=((c&7)<<18|(r[t++]&63)<<12|(r[t++]&63)<<6|r[t++]&63)-65536,o[s++]=55296+(c>>10),o[s++]=56320+(c&1023)):o[s++]=(c&15)<<12|(r[t++]&63)<<6|r[t++]&63,s>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i!=null?(s>0&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))}function lt(r,t,e){let n=e,i,o;for(let s=0;s<r.length;++s)i=r.charCodeAt(s),i<128?t[e++]=i:i<2048?(t[e++]=i>>6|192,t[e++]=i&63|128):(i&64512)===55296&&((o=r.charCodeAt(s+1))&64512)===56320?(i=65536+((i&1023)<<10)+(o&1023),++s,t[e++]=i>>18|240,t[e++]=i>>12&63|128,t[e++]=i>>6&63|128,t[e++]=i&63|128):(t[e++]=i>>12|224,t[e++]=i>>6&63|128,t[e++]=i&63|128);return e-n}function w(r,t){return RangeError(`index out of range: ${r.pos} + ${t??1} > ${r.len}`)}function ot(r,t){return(r[t-4]|r[t-3]<<8|r[t-2]<<16|r[t-1]<<24)>>>0}var pt=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(t){this.buf=t,this.pos=0,this.len=t.length}uint32(){let t=4294967295;if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,w(this,10);return t}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw w(this,4);return ot(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw w(this,4);return ot(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw w(this,4);let t=ie(this.buf,this.pos);return this.pos+=4,t}double(){if(this.pos+8>this.len)throw w(this,4);let t=se(this.buf,this.pos);return this.pos+=8,t}bytes(){let t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw w(this,t);return this.pos+=t,e===n?new Uint8Array(0):this.buf.subarray(e,n)}string(){let t=this.bytes();return he(t,0,t.length)}skip(t){if(typeof t=="number"){if(this.pos+t>this.len)throw w(this,t);this.pos+=t}else do if(this.pos>=this.len)throw w(this);while(this.buf[this.pos++]&128);return this}skipType(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}readLongVarint(){let t=new m(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 w(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 w(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")}readFixed64(){if(this.pos+8>this.len)throw w(this,8);let t=ot(this.buf,this.pos+=4),e=ot(this.buf,this.pos+=4);return new m(t,e)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let t=re(this.buf,this.pos);return this.pos+=q(t),t}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function mt(r){return new pt(r instanceof Uint8Array?r:r.subarray())}function H(r,t,e){let n=mt(r);return t.decode(n,void 0,e)}var wt={};p(wt,{base10:()=>ir});var Dn=new Uint8Array(0);function ue(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0}function k(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function fe(r){return new TextEncoder().encode(r)}function le(r){return new TextDecoder().decode(r)}function Ye(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=i}var c=r.length,d=r.charAt(0),O=Math.log(c)/Math.log(256),x=Math.log(256)/Math.log(c);function _(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(a.length===0)return"";for(var l=0,C=0,b=0,S=a.length;b!==S&&a[b]===0;)b++,l++;for(var A=(S-b)*x+1>>>0,g=new Uint8Array(A);b!==S;){for(var F=a[b],D=0,y=A-1;(F!==0||D<C)&&y!==-1;y--,D++)F+=256*g[y]>>>0,g[y]=F%c>>>0,F=F/c>>>0;if(F!==0)throw new Error("Non-zero carry");C=D,b++}for(var I=A-C;I!==A&&g[I]===0;)I++;for(var nt=d.repeat(l);I<A;++I)nt+=r.charAt(g[I]);return nt}function rt(a){if(typeof a!="string")throw new TypeError("Expected String");if(a.length===0)return new Uint8Array;var l=0;if(a[l]!==" "){for(var C=0,b=0;a[l]===d;)C++,l++;for(var S=(a.length-l)*O+1>>>0,A=new Uint8Array(S);a[l];){var g=e[a.charCodeAt(l)];if(g===255)return;for(var F=0,D=S-1;(g!==0||F<b)&&D!==-1;D--,F++)g+=c*A[D]>>>0,A[D]=g%256>>>0,g=g/256>>>0;if(g!==0)throw new Error("Non-zero carry");b=F,l++}if(a[l]!==" "){for(var y=S-b;y!==S&&A[y]===0;)y++;for(var I=new Uint8Array(C+(S-y)),nt=C;y!==S;)I[nt++]=A[y++];return I}}}function _e(a){var l=rt(a);if(l)return l;throw new Error(`Non-${t} character`)}return{encode:_,decodeUnsafe:rt,decode:_e}}var tr=Ye,er=tr,me=er;var xt=class{name;prefix;baseEncode;constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},gt=class{name;prefix;baseDecode;prefixCodePoint;constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return xe(this,t)}},bt=class{decoders;constructor(t){this.decoders=t}or(t){return xe(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n!=null)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function xe(r,t){return new bt({...r.decoders??{[r.prefix]:r},...t.decoders??{[t.prefix]:t}})}var yt=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(t,e,n,i){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new xt(t,e,n),this.decoder=new gt(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};function v({name:r,prefix:t,encode:e,decode:n}){return new yt(r,t,e,n)}function z({name:r,prefix:t,alphabet:e}){let{encode:n,decode:i}=me(e,r);return v({prefix:t,name:r,encode:n,decode:o=>k(i(o))})}function rr(r,t,e,n){let i={};for(let x=0;x<t.length;++x)i[t[x]]=x;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*e/8|0),c=0,d=0,O=0;for(let x=0;x<o;++x){let _=i[r[x]];if(_===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<e|_,c+=e,c>=8&&(c-=8,s[O++]=255&d>>c)}if(c>=e||255&d<<8-c)throw new SyntaxError("Unexpected end of data");return s}function nr(r,t,e){let n=t[t.length-1]==="=",i=(1<<e)-1,o="",s=0,c=0;for(let d=0;d<r.length;++d)for(c=c<<8|r[d],s+=8;s>e;)s-=e,o+=t[i&c>>s];if(s!==0&&(o+=t[i&c<<e-s]),n)for(;o.length*e&7;)o+="=";return o}function h({name:r,prefix:t,bitsPerChar:e,alphabet:n}){return v({prefix:t,name:r,encode(i){return nr(i,n,e)},decode(i){return rr(i,n,e,r)}})}var ir=z({prefix:"9",name:"base10",alphabet:"0123456789"});var Et={};p(Et,{base16:()=>or,base16upper:()=>sr});var or=h({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),sr=h({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var St={};p(St,{base2:()=>cr});var cr=h({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var At={};p(At,{base256emoji:()=>fr});var ge=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}"),ar=ge.reduce((r,t,e)=>(r[e]=t,r),[]),hr=ge.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function dr(r){return r.reduce((t,e)=>(t+=ar[e],t),"")}function ur(r){let t=[];for(let e of r){let n=hr[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var fr=v({prefix:"\u{1F680}",name:"base256emoji",encode:dr,decode:ur});var Ft={};p(Ft,{base32:()=>V,base32hex:()=>xr,base32hexpad:()=>br,base32hexpadupper:()=>yr,base32hexupper:()=>gr,base32pad:()=>pr,base32padupper:()=>mr,base32upper:()=>lr,base32z:()=>wr});var V=h({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),lr=h({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),pr=h({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),mr=h({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),xr=h({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),gr=h({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),br=h({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),yr=h({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),wr=h({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Nt={};p(Nt,{base36:()=>J,base36upper:()=>Er});var J=z({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Er=z({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var It={};p(It,{base58btc:()=>N,base58flickr:()=>Sr});var N=z({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Sr=z({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var kt={};p(kt,{base64:()=>Ar,base64pad:()=>Fr,base64url:()=>Nr,base64urlpad:()=>Ir});var Ar=h({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Fr=h({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Nr=h({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ir=h({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Dt={};p(Dt,{base8:()=>kr});var kr=h({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Tt={};p(Tt,{identity:()=>Dr});var Dr=v({prefix:"\0",name:"identity",encode:r=>le(r),decode:r=>fe(r)});var Xn=new TextEncoder,qn=new TextDecoder;var Mt={};p(Mt,{identity:()=>Zr});var Mr=we,be=128,zr=127,Cr=~zr,Ur=Math.pow(2,31);function we(r,t,e){t=t||[],e=e||0;for(var n=e;r>=Ur;)t[e++]=r&255|be,r/=128;for(;r&Cr;)t[e++]=r&255|be,r>>>=7;return t[e]=r|0,we.bytes=e-n+1,t}var Rr=Bt,Lr=128,ye=127;function Bt(r,n){var e=0,n=n||0,i=0,o=n,s,c=r.length;do{if(o>=c)throw Bt.bytes=0,new RangeError("Could not decode varint");s=r[o++],e+=i<28?(s&ye)<<i:(s&ye)*Math.pow(2,i),i+=7}while(s>=Lr);return Bt.bytes=o-n,e}var Or=Math.pow(2,7),_r=Math.pow(2,14),vr=Math.pow(2,21),Vr=Math.pow(2,28),Pr=Math.pow(2,35),$r=Math.pow(2,42),Gr=Math.pow(2,49),Xr=Math.pow(2,56),qr=Math.pow(2,63),Hr=function(r){return r<Or?1:r<_r?2:r<vr?3:r<Vr?4:r<Pr?5:r<$r?6:r<Gr?7:r<Xr?8:r<qr?9:10},Jr={encode:Mr,decode:Rr,encodingLength:Hr},Wr=Jr,W=Wr;function Q(r,t=0){return[W.decode(r,t),W.decode.bytes]}function P(r,t,e=0){return W.encode(r,t,e),t}function $(r){return W.encodingLength(r)}function R(r,t){let e=t.byteLength,n=$(r),i=n+$(e),o=new Uint8Array(i+e);return P(r,o,0),P(e,o,n),o.set(t,i),new G(r,e,t,o)}function Ee(r){let t=k(r),[e,n]=Q(t),[i,o]=Q(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new G(e,i,s,t)}function Se(r,t){if(r===t)return!0;{let e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&ue(r.bytes,e.bytes)}}var G=class{code;size;digest;bytes;constructor(t,e,n,i){this.code=t,this.size=e,this.digest=n,this.bytes=i}};var Ae=0,Qr="identity",Fe=k;function Kr(r){return R(Ae,Fe(r))}var Zr={code:Ae,name:Qr,encode:Fe,digest:Kr};var Ut={};p(Ut,{sha256:()=>jr,sha512:()=>Yr});function Ct({name:r,code:t,encode:e}){return new zt(r,t,e)}var zt=class{name;code;encode;constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?R(this.code,e):e.then(n=>R(this.code,n))}else throw Error("Unknown type, must be binary type")}};function Ie(r){return async t=>new Uint8Array(await crypto.subtle.digest(r,t))}var jr=Ct({name:"sha2-256",code:18,encode:Ie("SHA-256")}),Yr=Ct({name:"sha2-512",code:19,encode:Ie("SHA-512")});function ke(r,t){let{bytes:e,version:n}=r;switch(n){case 0:return en(e,Rt(r),t??N.encoder);default:return rn(e,Rt(r),t??V.encoder)}}var De=new WeakMap;function Rt(r){let t=De.get(r);if(t==null){let e=new Map;return De.set(r,e),e}return t}var ct=class r{code;version;multihash;bytes;"/";constructor(t,e,n,i){this.code=e,this.version=t,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:t,multihash:e}=this;if(t!==Z)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==nn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(e)}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:t,digest:e}=this.multihash,n=R(t,e);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return r.equals(this,t)}static equals(t,e){let n=e;return n!=null&&t.code===n.code&&t.version===n.version&&Se(t.multihash,n.multihash)}toString(t){return ke(this,t)}toJSON(){return{"/":ke(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof r)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:i,multihash:o,bytes:s}=e;return new r(n,i,o,s??Te(n,i,o.bytes))}else if(e[on]===!0){let{version:n,multihash:i,code:o}=e,s=Ee(i);return r.create(n,o,s)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==Z)throw new Error(`Version 0 CID must use dag-pb (code: ${Z}) block encoding`);return new r(t,e,n,n.bytes)}case 1:{let i=Te(t,e,n.bytes);return new r(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return r.create(0,Z,t)}static createV1(t,e){return r.create(1,t,e)}static decode(t){let[e,n]=r.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=r.inspectBytes(t),n=e.size-e.multihashSize,i=k(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let o=i.subarray(e.multihashSize-e.digestSize),s=new G(e.multihashCode,e.digestSize,o,i);return[e.version===0?r.createV0(s):r.createV1(e.codec,s),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[_,rt]=Q(t.subarray(e));return e+=rt,_},i=n(),o=Z;if(i===18?(i=0,e=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=e,c=n(),d=n(),O=e+d,x=O-s;return{version:i,codec:o,multihashCode:c,digestSize:d,multihashSize:x,size:O}}static parse(t,e){let[n,i]=tn(t,e),o=r.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Rt(o).set(n,t),o}};function tn(r,t){switch(r[0]){case"Q":{let e=t??N;return[N.prefix,e.decode(`${N.prefix}${r}`)]}case N.prefix:{let e=t??N;return[N.prefix,e.decode(r)]}case V.prefix:{let e=t??V;return[V.prefix,e.decode(r)]}case J.prefix:{let e=t??J;return[J.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}}function en(r,t,e){let{prefix:n}=e;if(n!==N.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=t.get(n);if(i==null){let o=e.encode(r).slice(1);return t.set(n,o),o}else return i}function rn(r,t,e){let{prefix:n}=e,i=t.get(n);if(i==null){let o=e.encode(r);return t.set(n,o),o}else return i}var Z=112,nn=18;function Te(r,t,e){let n=$(r),i=n+$(t),o=new Uint8Array(i+e.byteLength);return P(r,o,0),P(t,o,n),o.set(e,i),o}var on=Symbol.for("@ipld/js-cid/CID");var Lt={...Tt,...St,...Dt,...wt,...Et,...Ft,...Nt,...It,...kt,...At},li={...Ut,...Mt};function Me(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Be=Me("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Ot=Me("ascii","a",r=>{let t="a";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},r=>{r=r.substring(1);let t=T(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),sn={utf8:Be,"utf-8":Be,hex:Lt.base16,latin1:Ot,ascii:Ot,binary:Ot,...Lt},ze=sn;function Ce(r,t="utf8"){let e=ze[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return e.decoder.decode(`${e.prefix}${r}`)}function _t(r){let t=r??8192,e=t>>>1,n,i=t;return function(s){if(s<1||s>e)return T(s);i+s>t&&(n=T(t),i=0);let c=n.subarray(i,i+=s);return i&7&&(i=(i|7)+1),c}}var L=class{fn;len;next;val;constructor(t,e,n){this.fn=t,this.len=e,this.next=void 0,this.val=n}};function vt(){}var Pt=class{head;tail;len;next;constructor(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}},cn=_t();function an(r){return globalThis.Buffer!=null?T(r):cn(r)}var Y=class{len;head;tail;states;constructor(){this.len=0,this.head=new L(vt,0,0),this.tail=this.head,this.states=null}_push(t,e,n){return this.tail=this.tail.next=new L(t,e,n),this.len+=e,this}uint32(t){return this.len+=(this.tail=this.tail.next=new $t((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this}int32(t){return t<0?this._push(at,10,m.fromNumber(t)):this.uint32(t)}sint32(t){return this.uint32((t<<1^t>>31)>>>0)}uint64(t){let e=m.fromBigInt(t);return this._push(at,e.length(),e)}uint64Number(t){return this._push(ee,q(t),t)}uint64String(t){return this.uint64(BigInt(t))}int64(t){return this.uint64(t)}int64Number(t){return this.uint64Number(t)}int64String(t){return this.uint64String(t)}sint64(t){let e=m.fromBigInt(t).zzEncode();return this._push(at,e.length(),e)}sint64Number(t){let e=m.fromNumber(t).zzEncode();return this._push(at,e.length(),e)}sint64String(t){return this.sint64(BigInt(t))}bool(t){return this._push(Vt,1,t?1:0)}fixed32(t){return this._push(j,4,t>>>0)}sfixed32(t){return this.fixed32(t)}fixed64(t){let e=m.fromBigInt(t);return this._push(j,4,e.lo)._push(j,4,e.hi)}fixed64Number(t){let e=m.fromNumber(t);return this._push(j,4,e.lo)._push(j,4,e.hi)}fixed64String(t){return this.fixed64(BigInt(t))}sfixed64(t){return this.fixed64(t)}sfixed64Number(t){return this.fixed64Number(t)}sfixed64String(t){return this.fixed64String(t)}float(t){return this._push(ne,4,t)}double(t){return this._push(oe,8,t)}bytes(t){let e=t.length>>>0;return e===0?this._push(Vt,1,0):this.uint32(e)._push(dn,e,t)}string(t){let e=ae(t);return e!==0?this.uint32(e)._push(lt,e,t):this._push(Vt,1,0)}fork(){return this.states=new Pt(this),this.head=this.tail=new L(vt,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new L(vt,0,0),this.len=0),this}ldelim(){let t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=t.next,this.tail=e,this.len+=n),this}finish(){let t=this.head.next,e=an(this.len),n=0;for(;t!=null;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e}};function Vt(r,t,e){t[e]=r&255}function hn(r,t,e){for(;r>127;)t[e++]=r&127|128,r>>>=7;t[e]=r}var $t=class extends L{next;constructor(t,e){super(hn,t,e),this.next=void 0}};function at(r,t,e){for(;r.hi!==0;)t[e++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)t[e++]=r.lo&127|128,r.lo=r.lo>>>7;t[e++]=r.lo}function j(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}function dn(r,t,e){t.set(r,e)}globalThis.Buffer!=null&&(Y.prototype.bytes=function(r){let t=r.length>>>0;return this.uint32(t),t>0&&this._push(un,t,r),this},Y.prototype.string=function(r){let t=globalThis.Buffer.byteLength(r);return this.uint32(t),t>0&&this._push(fn,t,r),this});function un(r,t,e){t.set(r,e)}function fn(r,t,e){r.length<40?lt(r,t,e):t.utf8Write!=null?t.utf8Write(r,e):t.set(Ce(r),e)}function Gt(){return new Y}function tt(r,t){let e=Gt();return t.encode(r,e,{lengthDelimited:!1}),e.finish()}var X;(function(r){r[r.VARINT=0]="VARINT",r[r.BIT64=1]="BIT64",r[r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",r[r.START_GROUP=3]="START_GROUP",r[r.END_GROUP=4]="END_GROUP",r[r.BIT32=5]="BIT32"})(X||(X={}));function ht(r,t,e,n){return{name:r,type:t,encode:e,decode:n}}function Xt(r){function t(i){if(r[i.toString()]==null)throw new Error("Invalid enum value");return r[i]}let e=function(o,s){let c=t(o);s.int32(c)},n=function(o){let s=o.int32();return t(s)};return ht("enum",X.VARINT,e,n)}function et(r,t){return ht("message",X.LENGTH_DELIMITED,r,t)}var E;(function(r){let t;(function(i){i.Raw="Raw",i.Directory="Directory",i.File="File",i.Metadata="Metadata",i.Symlink="Symlink",i.HAMTShard="HAMTShard"})(t=r.DataType||(r.DataType={}));let e;(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"})(e||(e={})),function(i){i.codec=()=>Xt(e)}(t=r.DataType||(r.DataType={}));let n;r.codec=()=>(n==null&&(n=et((i,o,s={})=>{if(s.lengthDelimited!==!1&&o.fork(),i.Type!=null&&(o.uint32(8),r.DataType.codec().encode(i.Type,o)),i.Data!=null&&(o.uint32(18),o.bytes(i.Data)),i.filesize!=null&&(o.uint32(24),o.uint64(i.filesize)),i.blocksizes!=null)for(let 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),dt.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 d=i.uint32();switch(d>>>3){case 1:s.Type=r.DataType.codec().decode(i);break;case 2:s.Data=i.bytes();break;case 3:s.filesize=i.uint64();break;case 4:s.blocksizes.push(i.uint64());break;case 5:s.hashType=i.uint64();break;case 6:s.fanout=i.uint64();break;case 7:s.mode=i.uint32();break;case 8:s.mtime=dt.codec().decode(i,i.uint32());break;default:i.skipType(d&7);break}}return s})),n),r.encode=i=>tt(i,r.codec()),r.decode=i=>H(i,r.codec())})(E||(E={}));var dt;(function(r){let t;r.codec=()=>(t==null&&(t=et((e,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),e.Seconds!=null&&(n.uint32(8),n.int64(e.Seconds)),e.FractionalNanoseconds!=null&&(n.uint32(21),n.fixed32(e.FractionalNanoseconds)),i.lengthDelimited!==!1&&n.ldelim()},(e,n)=>{let i={},o=n==null?e.len:e.pos+n;for(;e.pos<o;){let s=e.uint32();switch(s>>>3){case 1:i.Seconds=e.int64();break;case 2:i.FractionalNanoseconds=e.fixed32();break;default:e.skipType(s&7);break}}return i})),t),r.encode=e=>tt(e,r.codec()),r.decode=e=>H(e,r.codec())})(dt||(dt={}));var Ue;(function(r){let t;r.codec=()=>(t==null&&(t=et((e,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),e.MimeType!=null&&(n.uint32(10),n.string(e.MimeType)),i.lengthDelimited!==!1&&n.ldelim()},(e,n)=>{let i={},o=n==null?e.len:e.pos+n;for(;e.pos<o;){let s=e.uint32();switch(s>>>3){case 1:i.MimeType=e.string();break;default:e.skipType(s&7);break}}return i})),t),r.encode=e=>tt(e,r.codec()),r.decode=e=>H(e,r.codec())})(Ue||(Ue={}));var Re={Raw:"raw",Directory:"directory",File:"file",Metadata:"metadata",Symlink:"symlink",HAMTShard:"hamt-sharded-directory"},ln=["directory","hamt-sharded-directory"],Le=parseInt("0644",8),Oe=parseInt("0755",8),Ht=class r{static unmarshal(t){let e=E.decode(t),n=new r({type:Re[e.Type!=null?e.Type.toString():"File"],data:e.Data,blockSizes:e.blocksizes,mode:e.mode,mtime:e.mtime!=null?{secs:e.mtime.Seconds??0n,nsecs:e.mtime.FractionalNanoseconds}:void 0,fanout:e.fanout});return n._originalMode=e.mode??0,n}type;data;blockSizes;hashType;fanout;mtime;_mode;_originalMode;constructor(t={type:"file"}){let{type:e,data:n,blockSizes:i,hashType:o,fanout:s,mtime:c,mode:d}=t;if(e!=null&&!Object.values(Re).includes(e))throw(0,qt.default)(new Error("Type: "+e+" is not valid"),"ERR_INVALID_TYPE");this.type=e??"file",this.data=n,this.hashType=o,this.fanout=s,this.blockSizes=i??[],this._originalMode=0,this.mode=d,this.mtime=c}set mode(t){t==null?this._mode=this.isDirectory()?Oe:Le:this._mode=t&4095}get mode(){return this._mode}isDirectory(){return ln.includes(this.type)}addBlockSize(t){this.blockSizes.push(t)}removeBlockSize(t){this.blockSizes.splice(t,1)}fileSize(){if(this.isDirectory())return 0n;let t=0n;return this.blockSizes.forEach(e=>{t+=e}),this.data!=null&&(t+=BigInt(this.data.length)),t}marshal(){let t;switch(this.type){case"raw":t=E.DataType.Raw;break;case"directory":t=E.DataType.Directory;break;case"file":t=E.DataType.File;break;case"metadata":t=E.DataType.Metadata;break;case"symlink":t=E.DataType.Symlink;break;case"hamt-sharded-directory":t=E.DataType.HAMTShard;break;default:throw(0,qt.default)(new Error(`Type: ${t} is not valid`),"ERR_INVALID_TYPE")}let e=this.data;(this.data==null||this.data.length===0)&&(e=void 0);let n;this.mode!=null&&(n=this._originalMode&4294963200|(this.mode??0),n===Le&&!this.isDirectory()&&(n=void 0),n===Oe&&this.isDirectory()&&(n=void 0));let i;return this.mtime!=null&&(i={Seconds:this.mtime.secs,FractionalNanoseconds:this.mtime.nsecs}),E.encode({Type:t,Data:e,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:n,mtime:i})}};return He(pn);})(); | ||
"use strict";var IpfsUnixfs=(()=>{var ut=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var ve=Object.prototype.hasOwnProperty;var p=(r,t)=>{for(var e in t)ut(r,e,{get:t[e],enumerable:!0})},Oe=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Le(t))!ve.call(r,i)&&i!==e&&ut(r,i,{get:()=>t[i],enumerable:!(n=Re(t,i))||n.enumerable});return r};var Ve=r=>Oe(ut({},"__esModule",{value:!0}),r);var sn={};p(sn,{InvalidTypeError:()=>V,UnixFS:()=>Ht});var V=class r extends Error{static name="InvalidTypeError";static code="ERR_INVALID_TYPE";name=r.name;code=r.code;constructor(t="Invalid type"){super(t)}};function T(r=0){return new Uint8Array(r)}var _e=Math.pow(2,7),$e=Math.pow(2,14),Ge=Math.pow(2,21),Jt=Math.pow(2,28),Wt=Math.pow(2,35),Qt=Math.pow(2,42),Kt=Math.pow(2,49),l=128,B=127;function H(r){if(r<_e)return 1;if(r<$e)return 2;if(r<Ge)return 3;if(r<Jt)return 4;if(r<Wt)return 5;if(r<Qt)return 6;if(r<Kt)return 7;if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Zt(r,t,e=0){switch(H(r)){case 8:t[e++]=r&255|l,r/=128;case 7:t[e++]=r&255|l,r/=128;case 6:t[e++]=r&255|l,r/=128;case 5:t[e++]=r&255|l,r/=128;case 4:t[e++]=r&255|l,r>>>=7;case 3:t[e++]=r&255|l,r>>>=7;case 2:t[e++]=r&255|l,r>>>=7;case 1:{t[e++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return t}function jt(r,t){let e=r[t],n=0;if(n+=e&B,e<l||(e=r[t+1],n+=(e&B)<<7,e<l)||(e=r[t+2],n+=(e&B)<<14,e<l)||(e=r[t+3],n+=(e&B)<<21,e<l)||(e=r[t+4],n+=(e&B)*Jt,e<l)||(e=r[t+5],n+=(e&B)*Wt,e<l)||(e=r[t+6],n+=(e&B)*Qt,e<l)||(e=r[t+7],n+=(e&B)*Kt,e<l))return n;throw new RangeError("Could not decode varint")}var lt=new Float32Array([-0]),M=new Uint8Array(lt.buffer);function Yt(r,t,e){lt[0]=r,t[e]=M[0],t[e+1]=M[1],t[e+2]=M[2],t[e+3]=M[3]}function te(r,t){return M[0]=r[t],M[1]=r[t+1],M[2]=r[t+2],M[3]=r[t+3],lt[0]}var ft=new Float64Array([-0]),u=new Uint8Array(ft.buffer);function ee(r,t,e){ft[0]=r,t[e]=u[0],t[e+1]=u[1],t[e+2]=u[2],t[e+3]=u[3],t[e+4]=u[4],t[e+5]=u[5],t[e+6]=u[6],t[e+7]=u[7]}function re(r,t){return u[0]=r[t],u[1]=r[t+1],u[2]=r[t+2],u[3]=r[t+3],u[4]=r[t+4],u[5]=r[t+5],u[6]=r[t+6],u[7]=r[t+7],ft[0]}var Pe=BigInt(Number.MAX_SAFE_INTEGER),Xe=BigInt(Number.MIN_SAFE_INTEGER),m=class r{lo;hi;constructor(t,e){this.lo=t|0,this.hi=e|0}toNumber(t=!1){if(!t&&this.hi>>>31>0){let e=~this.lo+1>>>0,n=~this.hi>>>0;return e===0&&(n=n+1>>>0),-(e+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(t=!1){if(t)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let e=~this.lo+1>>>0,n=~this.hi>>>0;return e===0&&(n=n+1>>>0),-(BigInt(e)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(t=!1){return this.toBigInt(t).toString()}zzEncode(){let t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this}zzDecode(){let t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this}length(){let t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?e===0?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}static fromBigInt(t){if(t===0n)return U;if(t<Pe&&t>Xe)return this.fromNumber(Number(t));let e=t<0n;e&&(t=-t);let n=t>>32n,i=t-(n<<32n);return e&&(n=~n|0n,i=~i|0n,++i>ne&&(i=0n,++n>ne&&(n=0n))),new r(Number(i),Number(n))}static fromNumber(t){if(t===0)return U;let e=t<0;e&&(t=-t);let n=t>>>0,i=(t-n)/4294967296>>>0;return e&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new r(n,i)}static from(t){return typeof t=="number"?r.fromNumber(t):typeof t=="bigint"?r.fromBigInt(t):typeof t=="string"?r.fromBigInt(BigInt(t)):t.low!=null||t.high!=null?new r(t.low>>>0,t.high>>>0):U}},U=new m(0,0);U.toBigInt=function(){return 0n};U.zzEncode=U.zzDecode=function(){return this};U.length=function(){return 1};var ne=4294967296n;function ie(r){let t=0,e=0;for(let n=0;n<r.length;++n)e=r.charCodeAt(n),e<128?t+=1:e<2048?t+=2:(e&64512)===55296&&(r.charCodeAt(n+1)&64512)===56320?(++n,t+=4):t+=3;return t}function oe(r,t,e){if(e-t<1)return"";let i,o=[],s=0,c;for(;t<e;)c=r[t++],c<128?o[s++]=c:c>191&&c<224?o[s++]=(c&31)<<6|r[t++]&63:c>239&&c<365?(c=((c&7)<<18|(r[t++]&63)<<12|(r[t++]&63)<<6|r[t++]&63)-65536,o[s++]=55296+(c>>10),o[s++]=56320+(c&1023)):o[s++]=(c&15)<<12|(r[t++]&63)<<6|r[t++]&63,s>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i!=null?(s>0&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))}function pt(r,t,e){let n=e,i,o;for(let s=0;s<r.length;++s)i=r.charCodeAt(s),i<128?t[e++]=i:i<2048?(t[e++]=i>>6|192,t[e++]=i&63|128):(i&64512)===55296&&((o=r.charCodeAt(s+1))&64512)===56320?(i=65536+((i&1023)<<10)+(o&1023),++s,t[e++]=i>>18|240,t[e++]=i>>12&63|128,t[e++]=i>>6&63|128,t[e++]=i&63|128):(t[e++]=i>>12|224,t[e++]=i>>6&63|128,t[e++]=i&63|128);return e-n}function w(r,t){return RangeError(`index out of range: ${r.pos} + ${t??1} > ${r.len}`)}function ot(r,t){return(r[t-4]|r[t-3]<<8|r[t-2]<<16|r[t-1]<<24)>>>0}var mt=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(t){this.buf=t,this.pos=0,this.len=t.length}uint32(){let t=4294967295;if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,w(this,10);return t}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw w(this,4);return ot(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw w(this,4);return ot(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw w(this,4);let t=te(this.buf,this.pos);return this.pos+=4,t}double(){if(this.pos+8>this.len)throw w(this,4);let t=re(this.buf,this.pos);return this.pos+=8,t}bytes(){let t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw w(this,t);return this.pos+=t,e===n?new Uint8Array(0):this.buf.subarray(e,n)}string(){let t=this.bytes();return oe(t,0,t.length)}skip(t){if(typeof t=="number"){if(this.pos+t>this.len)throw w(this,t);this.pos+=t}else do if(this.pos>=this.len)throw w(this);while(this.buf[this.pos++]&128);return this}skipType(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}readLongVarint(){let t=new m(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 w(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 w(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")}readFixed64(){if(this.pos+8>this.len)throw w(this,8);let t=ot(this.buf,this.pos+=4),e=ot(this.buf,this.pos+=4);return new m(t,e)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let t=jt(this.buf,this.pos);return this.pos+=H(t),t}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function xt(r){return new mt(r instanceof Uint8Array?r:r.subarray())}function J(r,t,e){let n=xt(r);return t.decode(n,void 0,e)}var Et={};p(Et,{base10:()=>Ke});var wn=new Uint8Array(0);function ce(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0}function D(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function ae(r){return new TextEncoder().encode(r)}function he(r){return new TextDecoder().decode(r)}function qe(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=i}var c=r.length,d=r.charAt(0),v=Math.log(c)/Math.log(256),x=Math.log(256)/Math.log(c);function O(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(a.length===0)return"";for(var f=0,C=0,b=0,S=a.length;b!==S&&a[b]===0;)b++,f++;for(var A=(S-b)*x+1>>>0,g=new Uint8Array(A);b!==S;){for(var F=a[b],k=0,y=A-1;(F!==0||k<C)&&y!==-1;y--,k++)F+=256*g[y]>>>0,g[y]=F%c>>>0,F=F/c>>>0;if(F!==0)throw new Error("Non-zero carry");C=k,b++}for(var I=A-C;I!==A&&g[I]===0;)I++;for(var it=d.repeat(f);I<A;++I)it+=r.charAt(g[I]);return it}function nt(a){if(typeof a!="string")throw new TypeError("Expected String");if(a.length===0)return new Uint8Array;var f=0;if(a[f]!==" "){for(var C=0,b=0;a[f]===d;)C++,f++;for(var S=(a.length-f)*v+1>>>0,A=new Uint8Array(S);a[f];){var g=e[a.charCodeAt(f)];if(g===255)return;for(var F=0,k=S-1;(g!==0||F<b)&&k!==-1;k--,F++)g+=c*A[k]>>>0,A[k]=g%256>>>0,g=g/256>>>0;if(g!==0)throw new Error("Non-zero carry");b=F,f++}if(a[f]!==" "){for(var y=S-b;y!==S&&A[y]===0;)y++;for(var I=new Uint8Array(C+(S-y)),it=C;y!==S;)I[it++]=A[y++];return I}}}function Ue(a){var f=nt(a);if(f)return f;throw new Error(`Non-${t} character`)}return{encode:O,decodeUnsafe:nt,decode:Ue}}var He=qe,Je=He,ue=Je;var gt=class{name;prefix;baseEncode;constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},bt=class{name;prefix;baseDecode;prefixCodePoint;constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return le(this,t)}},yt=class{decoders;constructor(t){this.decoders=t}or(t){return le(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n!=null)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function le(r,t){return new yt({...r.decoders??{[r.prefix]:r},...t.decoders??{[t.prefix]:t}})}var wt=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(t,e,n,i){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new gt(t,e,n),this.decoder=new bt(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};function _({name:r,prefix:t,encode:e,decode:n}){return new wt(r,t,e,n)}function z({name:r,prefix:t,alphabet:e}){let{encode:n,decode:i}=ue(e,r);return _({prefix:t,name:r,encode:n,decode:o=>D(i(o))})}function We(r,t,e,n){let i={};for(let x=0;x<t.length;++x)i[t[x]]=x;let o=r.length;for(;r[o-1]==="=";)--o;let s=new Uint8Array(o*e/8|0),c=0,d=0,v=0;for(let x=0;x<o;++x){let O=i[r[x]];if(O===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<e|O,c+=e,c>=8&&(c-=8,s[v++]=255&d>>c)}if(c>=e||255&d<<8-c)throw new SyntaxError("Unexpected end of data");return s}function Qe(r,t,e){let n=t[t.length-1]==="=",i=(1<<e)-1,o="",s=0,c=0;for(let d=0;d<r.length;++d)for(c=c<<8|r[d],s+=8;s>e;)s-=e,o+=t[i&c>>s];if(s!==0&&(o+=t[i&c<<e-s]),n)for(;o.length*e&7;)o+="=";return o}function h({name:r,prefix:t,bitsPerChar:e,alphabet:n}){return _({prefix:t,name:r,encode(i){return Qe(i,n,e)},decode(i){return We(i,n,e,r)}})}var Ke=z({prefix:"9",name:"base10",alphabet:"0123456789"});var St={};p(St,{base16:()=>Ze,base16upper:()=>je});var Ze=h({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),je=h({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var At={};p(At,{base2:()=>Ye});var Ye=h({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ft={};p(Ft,{base256emoji:()=>ir});var fe=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}"),tr=fe.reduce((r,t,e)=>(r[e]=t,r),[]),er=fe.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function rr(r){return r.reduce((t,e)=>(t+=tr[e],t),"")}function nr(r){let t=[];for(let e of r){let n=er[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var ir=_({prefix:"\u{1F680}",name:"base256emoji",encode:rr,decode:nr});var Nt={};p(Nt,{base32:()=>$,base32hex:()=>ar,base32hexpad:()=>dr,base32hexpadupper:()=>ur,base32hexupper:()=>hr,base32pad:()=>sr,base32padupper:()=>cr,base32upper:()=>or,base32z:()=>lr});var $=h({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),or=h({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),sr=h({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),cr=h({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ar=h({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),hr=h({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),dr=h({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ur=h({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),lr=h({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var It={};p(It,{base36:()=>W,base36upper:()=>fr});var W=z({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),fr=z({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Dt={};p(Dt,{base58btc:()=>N,base58flickr:()=>pr});var N=z({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),pr=z({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var kt={};p(kt,{base64:()=>mr,base64pad:()=>xr,base64url:()=>gr,base64urlpad:()=>br});var mr=h({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),xr=h({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),gr=h({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),br=h({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Tt={};p(Tt,{base8:()=>yr});var yr=h({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Bt={};p(Bt,{identity:()=>wr});var wr=_({prefix:"\0",name:"identity",encode:r=>he(r),decode:r=>ae(r)});var Ln=new TextEncoder,vn=new TextDecoder;var zt={};p(zt,{identity:()=>Pr});var Ar=xe,pe=128,Fr=127,Nr=~Fr,Ir=Math.pow(2,31);function xe(r,t,e){t=t||[],e=e||0;for(var n=e;r>=Ir;)t[e++]=r&255|pe,r/=128;for(;r&Nr;)t[e++]=r&255|pe,r>>>=7;return t[e]=r|0,xe.bytes=e-n+1,t}var Dr=Mt,kr=128,me=127;function Mt(r,n){var e=0,n=n||0,i=0,o=n,s,c=r.length;do{if(o>=c)throw Mt.bytes=0,new RangeError("Could not decode varint");s=r[o++],e+=i<28?(s&me)<<i:(s&me)*Math.pow(2,i),i+=7}while(s>=kr);return Mt.bytes=o-n,e}var Tr=Math.pow(2,7),Br=Math.pow(2,14),Mr=Math.pow(2,21),zr=Math.pow(2,28),Cr=Math.pow(2,35),Ur=Math.pow(2,42),Rr=Math.pow(2,49),Lr=Math.pow(2,56),vr=Math.pow(2,63),Or=function(r){return r<Tr?1:r<Br?2:r<Mr?3:r<zr?4:r<Cr?5:r<Ur?6:r<Rr?7:r<Lr?8:r<vr?9:10},Vr={encode:Ar,decode:Dr,encodingLength:Or},_r=Vr,Q=_r;function K(r,t=0){return[Q.decode(r,t),Q.decode.bytes]}function G(r,t,e=0){return Q.encode(r,t,e),t}function P(r){return Q.encodingLength(r)}function R(r,t){let e=t.byteLength,n=P(r),i=n+P(e),o=new Uint8Array(i+e);return G(r,o,0),G(e,o,n),o.set(t,i),new X(r,e,t,o)}function ge(r){let t=D(r),[e,n]=K(t),[i,o]=K(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new X(e,i,s,t)}function be(r,t){if(r===t)return!0;{let e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&ce(r.bytes,e.bytes)}}var X=class{code;size;digest;bytes;constructor(t,e,n,i){this.code=t,this.size=e,this.digest=n,this.bytes=i}};var ye=0,$r="identity",we=D;function Gr(r){return R(ye,we(r))}var Pr={code:ye,name:$r,encode:we,digest:Gr};var Rt={};p(Rt,{sha256:()=>Xr,sha512:()=>qr});function Ut({name:r,code:t,encode:e}){return new Ct(r,t,e)}var Ct=class{name;code;encode;constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?R(this.code,e):e.then(n=>R(this.code,n))}else throw Error("Unknown type, must be binary type")}};function Se(r){return async t=>new Uint8Array(await crypto.subtle.digest(r,t))}var Xr=Ut({name:"sha2-256",code:18,encode:Se("SHA-256")}),qr=Ut({name:"sha2-512",code:19,encode:Se("SHA-512")});function Ae(r,t){let{bytes:e,version:n}=r;switch(n){case 0:return Jr(e,Lt(r),t??N.encoder);default:return Wr(e,Lt(r),t??$.encoder)}}var Fe=new WeakMap;function Lt(r){let t=Fe.get(r);if(t==null){let e=new Map;return Fe.set(r,e),e}return t}var ct=class r{code;version;multihash;bytes;"/";constructor(t,e,n,i){this.code=e,this.version=t,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:t,multihash:e}=this;if(t!==j)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==Qr)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(e)}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:t,digest:e}=this.multihash,n=R(t,e);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return r.equals(this,t)}static equals(t,e){let n=e;return n!=null&&t.code===n.code&&t.version===n.version&&be(t.multihash,n.multihash)}toString(t){return Ae(this,t)}toJSON(){return{"/":Ae(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof r)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:i,multihash:o,bytes:s}=e;return new r(n,i,o,s??Ne(n,i,o.bytes))}else if(e[Kr]===!0){let{version:n,multihash:i,code:o}=e,s=ge(i);return r.create(n,o,s)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==j)throw new Error(`Version 0 CID must use dag-pb (code: ${j}) block encoding`);return new r(t,e,n,n.bytes)}case 1:{let i=Ne(t,e,n.bytes);return new r(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return r.create(0,j,t)}static createV1(t,e){return r.create(1,t,e)}static decode(t){let[e,n]=r.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=r.inspectBytes(t),n=e.size-e.multihashSize,i=D(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let o=i.subarray(e.multihashSize-e.digestSize),s=new X(e.multihashCode,e.digestSize,o,i);return[e.version===0?r.createV0(s):r.createV1(e.codec,s),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[O,nt]=K(t.subarray(e));return e+=nt,O},i=n(),o=j;if(i===18?(i=0,e=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=e,c=n(),d=n(),v=e+d,x=v-s;return{version:i,codec:o,multihashCode:c,digestSize:d,multihashSize:x,size:v}}static parse(t,e){let[n,i]=Hr(t,e),o=r.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Lt(o).set(n,t),o}};function Hr(r,t){switch(r[0]){case"Q":{let e=t??N;return[N.prefix,e.decode(`${N.prefix}${r}`)]}case N.prefix:{let e=t??N;return[N.prefix,e.decode(r)]}case $.prefix:{let e=t??$;return[$.prefix,e.decode(r)]}case W.prefix:{let e=t??W;return[W.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}}function Jr(r,t,e){let{prefix:n}=e;if(n!==N.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=t.get(n);if(i==null){let o=e.encode(r).slice(1);return t.set(n,o),o}else return i}function Wr(r,t,e){let{prefix:n}=e,i=t.get(n);if(i==null){let o=e.encode(r);return t.set(n,o),o}else return i}var j=112,Qr=18;function Ne(r,t,e){let n=P(r),i=n+P(t),o=new Uint8Array(i+e.byteLength);return G(r,o,0),G(t,o,n),o.set(e,i),o}var Kr=Symbol.for("@ipld/js-cid/CID");var vt={...Bt,...At,...Tt,...Et,...St,...Nt,...It,...Dt,...kt,...Ft},oi={...Rt,...zt};function De(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Ie=De("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Ot=De("ascii","a",r=>{let t="a";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},r=>{r=r.substring(1);let t=T(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),Zr={utf8:Ie,"utf-8":Ie,hex:vt.base16,latin1:Ot,ascii:Ot,binary:Ot,...vt},ke=Zr;function Te(r,t="utf8"){let e=ke[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return e.decoder.decode(`${e.prefix}${r}`)}function Vt(r){let t=r??8192,e=t>>>1,n,i=t;return function(s){if(s<1||s>e)return T(s);i+s>t&&(n=T(t),i=0);let c=n.subarray(i,i+=s);return i&7&&(i=(i|7)+1),c}}var L=class{fn;len;next;val;constructor(t,e,n){this.fn=t,this.len=e,this.next=void 0,this.val=n}};function _t(){}var Gt=class{head;tail;len;next;constructor(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}},jr=Vt();function Yr(r){return globalThis.Buffer!=null?T(r):jr(r)}var tt=class{len;head;tail;states;constructor(){this.len=0,this.head=new L(_t,0,0),this.tail=this.head,this.states=null}_push(t,e,n){return this.tail=this.tail.next=new L(t,e,n),this.len+=e,this}uint32(t){return this.len+=(this.tail=this.tail.next=new Pt((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this}int32(t){return t<0?this._push(at,10,m.fromNumber(t)):this.uint32(t)}sint32(t){return this.uint32((t<<1^t>>31)>>>0)}uint64(t){let e=m.fromBigInt(t);return this._push(at,e.length(),e)}uint64Number(t){return this._push(Zt,H(t),t)}uint64String(t){return this.uint64(BigInt(t))}int64(t){return this.uint64(t)}int64Number(t){return this.uint64Number(t)}int64String(t){return this.uint64String(t)}sint64(t){let e=m.fromBigInt(t).zzEncode();return this._push(at,e.length(),e)}sint64Number(t){let e=m.fromNumber(t).zzEncode();return this._push(at,e.length(),e)}sint64String(t){return this.sint64(BigInt(t))}bool(t){return this._push($t,1,t?1:0)}fixed32(t){return this._push(Y,4,t>>>0)}sfixed32(t){return this.fixed32(t)}fixed64(t){let e=m.fromBigInt(t);return this._push(Y,4,e.lo)._push(Y,4,e.hi)}fixed64Number(t){let e=m.fromNumber(t);return this._push(Y,4,e.lo)._push(Y,4,e.hi)}fixed64String(t){return this.fixed64(BigInt(t))}sfixed64(t){return this.fixed64(t)}sfixed64Number(t){return this.fixed64Number(t)}sfixed64String(t){return this.fixed64String(t)}float(t){return this._push(Yt,4,t)}double(t){return this._push(ee,8,t)}bytes(t){let e=t.length>>>0;return e===0?this._push($t,1,0):this.uint32(e)._push(en,e,t)}string(t){let e=ie(t);return e!==0?this.uint32(e)._push(pt,e,t):this._push($t,1,0)}fork(){return this.states=new Gt(this),this.head=this.tail=new L(_t,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new L(_t,0,0),this.len=0),this}ldelim(){let t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=t.next,this.tail=e,this.len+=n),this}finish(){let t=this.head.next,e=Yr(this.len),n=0;for(;t!=null;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e}};function $t(r,t,e){t[e]=r&255}function tn(r,t,e){for(;r>127;)t[e++]=r&127|128,r>>>=7;t[e]=r}var Pt=class extends L{next;constructor(t,e){super(tn,t,e),this.next=void 0}};function at(r,t,e){for(;r.hi!==0;)t[e++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)t[e++]=r.lo&127|128,r.lo=r.lo>>>7;t[e++]=r.lo}function Y(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}function en(r,t,e){t.set(r,e)}globalThis.Buffer!=null&&(tt.prototype.bytes=function(r){let t=r.length>>>0;return this.uint32(t),t>0&&this._push(rn,t,r),this},tt.prototype.string=function(r){let t=globalThis.Buffer.byteLength(r);return this.uint32(t),t>0&&this._push(nn,t,r),this});function rn(r,t,e){t.set(r,e)}function nn(r,t,e){r.length<40?pt(r,t,e):t.utf8Write!=null?t.utf8Write(r,e):t.set(Te(r),e)}function Xt(){return new tt}function et(r,t){let e=Xt();return t.encode(r,e,{lengthDelimited:!1}),e.finish()}var q;(function(r){r[r.VARINT=0]="VARINT",r[r.BIT64=1]="BIT64",r[r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",r[r.START_GROUP=3]="START_GROUP",r[r.END_GROUP=4]="END_GROUP",r[r.BIT32=5]="BIT32"})(q||(q={}));function ht(r,t,e,n){return{name:r,type:t,encode:e,decode:n}}function qt(r){function t(i){if(r[i.toString()]==null)throw new Error("Invalid enum value");return r[i]}let e=function(o,s){let c=t(o);s.int32(c)},n=function(o){let s=o.int32();return t(s)};return ht("enum",q.VARINT,e,n)}function rt(r,t){return ht("message",q.LENGTH_DELIMITED,r,t)}var E;(function(r){let t;(function(i){i.Raw="Raw",i.Directory="Directory",i.File="File",i.Metadata="Metadata",i.Symlink="Symlink",i.HAMTShard="HAMTShard"})(t=r.DataType||(r.DataType={}));let e;(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"})(e||(e={})),function(i){i.codec=()=>qt(e)}(t=r.DataType||(r.DataType={}));let n;r.codec=()=>(n==null&&(n=rt((i,o,s={})=>{if(s.lengthDelimited!==!1&&o.fork(),i.Type!=null&&(o.uint32(8),r.DataType.codec().encode(i.Type,o)),i.Data!=null&&(o.uint32(18),o.bytes(i.Data)),i.filesize!=null&&(o.uint32(24),o.uint64(i.filesize)),i.blocksizes!=null)for(let 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),dt.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 d=i.uint32();switch(d>>>3){case 1:s.Type=r.DataType.codec().decode(i);break;case 2:s.Data=i.bytes();break;case 3:s.filesize=i.uint64();break;case 4:s.blocksizes.push(i.uint64());break;case 5:s.hashType=i.uint64();break;case 6:s.fanout=i.uint64();break;case 7:s.mode=i.uint32();break;case 8:s.mtime=dt.codec().decode(i,i.uint32());break;default:i.skipType(d&7);break}}return s})),n),r.encode=i=>et(i,r.codec()),r.decode=i=>J(i,r.codec())})(E||(E={}));var dt;(function(r){let t;r.codec=()=>(t==null&&(t=rt((e,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),e.Seconds!=null&&(n.uint32(8),n.int64(e.Seconds)),e.FractionalNanoseconds!=null&&(n.uint32(21),n.fixed32(e.FractionalNanoseconds)),i.lengthDelimited!==!1&&n.ldelim()},(e,n)=>{let i={},o=n==null?e.len:e.pos+n;for(;e.pos<o;){let s=e.uint32();switch(s>>>3){case 1:i.Seconds=e.int64();break;case 2:i.FractionalNanoseconds=e.fixed32();break;default:e.skipType(s&7);break}}return i})),t),r.encode=e=>et(e,r.codec()),r.decode=e=>J(e,r.codec())})(dt||(dt={}));var Be;(function(r){let t;r.codec=()=>(t==null&&(t=rt((e,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),e.MimeType!=null&&(n.uint32(10),n.string(e.MimeType)),i.lengthDelimited!==!1&&n.ldelim()},(e,n)=>{let i={},o=n==null?e.len:e.pos+n;for(;e.pos<o;){let s=e.uint32();switch(s>>>3){case 1:i.MimeType=e.string();break;default:e.skipType(s&7);break}}return i})),t),r.encode=e=>et(e,r.codec()),r.decode=e=>J(e,r.codec())})(Be||(Be={}));var Me={Raw:"raw",Directory:"directory",File:"file",Metadata:"metadata",Symlink:"symlink",HAMTShard:"hamt-sharded-directory"},on=["directory","hamt-sharded-directory"],ze=parseInt("0644",8),Ce=parseInt("0755",8),Ht=class r{static unmarshal(t){let e=E.decode(t),n=new r({type:Me[e.Type!=null?e.Type.toString():"File"],data:e.Data,blockSizes:e.blocksizes,mode:e.mode,mtime:e.mtime!=null?{secs:e.mtime.Seconds??0n,nsecs:e.mtime.FractionalNanoseconds}:void 0,fanout:e.fanout});return n._originalMode=e.mode??0,n}type;data;blockSizes;hashType;fanout;mtime;_mode;_originalMode;constructor(t={type:"file"}){let{type:e,data:n,blockSizes:i,hashType:o,fanout:s,mtime:c,mode:d}=t;if(e!=null&&!Object.values(Me).includes(e))throw new V("Type: "+e+" is not valid");this.type=e??"file",this.data=n,this.hashType=o,this.fanout=s,this.blockSizes=i??[],this._originalMode=0,this.mode=d,this.mtime=c}set mode(t){t==null?this._mode=this.isDirectory()?Ce:ze:this._mode=t&4095}get mode(){return this._mode}isDirectory(){return on.includes(this.type)}addBlockSize(t){this.blockSizes.push(t)}removeBlockSize(t){this.blockSizes.splice(t,1)}fileSize(){if(this.isDirectory())return 0n;let t=0n;return this.blockSizes.forEach(e=>{t+=e}),this.data!=null&&(t+=BigInt(this.data.length)),t}marshal(){let t;switch(this.type){case"raw":t=E.DataType.Raw;break;case"directory":t=E.DataType.Directory;break;case"file":t=E.DataType.File;break;case"metadata":t=E.DataType.Metadata;break;case"symlink":t=E.DataType.Symlink;break;case"hamt-sharded-directory":t=E.DataType.HAMTShard;break;default:throw new V(`Type: ${t} is not valid`)}let e=this.data;(this.data==null||this.data.length===0)&&(e=void 0);let n;this.mode!=null&&(n=this._originalMode&4294963200|(this.mode??0),n===ze&&!this.isDirectory()&&(n=void 0),n===Ce&&this.isDirectory()&&(n=void 0));let i;return this.mtime!=null&&(i={Seconds:this.mtime.secs,FractionalNanoseconds:this.mtime.nsecs}),E.encode({Type:t,Data:e,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:n,mtime:i})}};return Ve(sn);})(); | ||
return IpfsUnixfs})); |
@@ -138,2 +138,3 @@ /** | ||
export { UnixFS }; | ||
export * from './errors.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -92,3 +92,3 @@ /** | ||
*/ | ||
import errcode from 'err-code'; | ||
import { InvalidTypeError } from './errors.js'; | ||
import { Data as PBData } from './unixfs.js'; | ||
@@ -145,3 +145,3 @@ const types = { | ||
if (type != null && !Object.values(types).includes(type)) { | ||
throw errcode(new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE'); | ||
throw new InvalidTypeError('Type: ' + type + ' is not valid'); | ||
} | ||
@@ -219,3 +219,3 @@ this.type = type ?? 'file'; | ||
default: | ||
throw errcode(new Error(`Type: ${type} is not valid`), 'ERR_INVALID_TYPE'); | ||
throw new InvalidTypeError(`Type: ${type} is not valid`); | ||
} | ||
@@ -256,2 +256,3 @@ let data = this.data; | ||
export { UnixFS }; | ||
export * from './errors.js'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"InvalidTypeError": "https://ipfs.github.io/js-ipfs-unixfs/classes/ipfs_unixfs.InvalidTypeError.html", | ||
"UnixFS": "https://ipfs.github.io/js-ipfs-unixfs/classes/ipfs_unixfs.UnixFS.html", | ||
@@ -3,0 +4,0 @@ ".:UnixFS": "https://ipfs.github.io/js-ipfs-unixfs/classes/ipfs_unixfs.UnixFS.html", |
{ | ||
"name": "ipfs-unixfs", | ||
"version": "11.1.5", | ||
"version": "11.2.0", | ||
"description": "JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a MerkleDAG)", | ||
@@ -143,3 +143,2 @@ "license": "Apache-2.0 OR MIT", | ||
"dependencies": { | ||
"err-code": "^3.0.1", | ||
"protons-runtime": "^5.5.0", | ||
@@ -146,0 +145,0 @@ "uint8arraylist": "^2.4.8" |
@@ -93,3 +93,3 @@ /** | ||
import errcode from 'err-code' | ||
import { InvalidTypeError } from './errors.js' | ||
import { Data as PBData } from './unixfs.js' | ||
@@ -182,3 +182,3 @@ | ||
if (type != null && !Object.values(types).includes(type)) { | ||
throw errcode(new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE') | ||
throw new InvalidTypeError('Type: ' + type + ' is not valid') | ||
} | ||
@@ -255,3 +255,3 @@ | ||
default: | ||
throw errcode(new Error(`Type: ${type} is not valid`), 'ERR_INVALID_TYPE') | ||
throw new InvalidTypeError(`Type: ${type} is not valid`) | ||
} | ||
@@ -302,1 +302,2 @@ | ||
export { UnixFS } | ||
export * from './errors.js' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95305
2
21
1309
- Removederr-code@^3.0.1
- Removederr-code@3.0.1(transitive)