4 lines
103 KiB
JavaScript
Raw Normal View History

(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
return IpfsUnixfsExporter}));