ipfs-unixfs
Advanced tools
Comparing version 0.1.15 to 0.1.16
@@ -0,1 +1,6 @@ | ||
<a name="0.1.16"></a> | ||
## [0.1.16](https://github.com/ipfs/js-ipfs-unixfs/compare/v0.1.15...v0.1.16) (2018-10-26) | ||
<a name="0.1.15"></a> | ||
@@ -2,0 +7,0 @@ ## [0.1.15](https://github.com/ipfs/js-ipfs-unixfs/compare/v0.1.14...v0.1.15) (2018-06-08) |
@@ -1,1 +0,2 @@ | ||
var IpfsUnixfs=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){e.exports={encode:r(16),decode:r(17),encodingLength:r(18)}},function(e,t,r){"use strict";(function(e){var n=r(7),o=r(8),i=r(9);function s(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?y(e,t,r,n):"string"==typeof t?d(e,t,r):w(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t,r,n){return h(t),t<=0?f(e,t):void 0!==r?"string"==typeof n?f(e,t).fill(r,n):f(e,t).fill(r):f(e,t)}function l(e,t){if(h(t),e=f(e,t<0?0:0|v(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|b(t,r),o=(e=f(e,n)).write(t,r);return o!==n&&(e=e.slice(0,o)),e}function g(e,t){var r=t.length<0?0:0|v(t.length);e=f(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function y(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=g(e,t),e}function w(e,t){if(u.isBuffer(t)){var r=0|v(t.length);return 0===(e=f(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||te(t.length)?f(e,0):g(e,t);if("Buffer"===t.type&&i(t.data))return g(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function v(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),u.alloc(+e)}function b(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(n)return G(e).length;t=(""+t).toLowerCase(),n=!0}}function E(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Y(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return M(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return P(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function x(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function k(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:A(e,t,r,n,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):A(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function A(e,t,r,n,o){var i=1,s=e.length,a=t.length,f;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,s/=2,a/=2,r/=2}function u(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var c=-1;for(f=r;f<s;f++)if(u(e,f)===u(t,-1===c?0:f-c)){if(-1===c&&(c=f),f-c+1===a)return c*i}else-1!==c&&(f-=f-c),c=-1}else for(r+a>s&&(r=s-a),f=r;f>=0;f--){for(var h=!0,p=0;p<a;p++)if(u(e,f+p)!==u(t,p)){h=!1;break}if(h)return f}return-1}function _(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function R(e,t,r,n){return ee(G(t,e.length-r),e,r,n)}function T(e,t,r,n){return ee(K(t),e,r,n)}function U(e,t,r,n){return T(e,t,r,n)}function S(e,t,r,n){return ee(W(t),e,r,n)}function B(e,t,r,n){return ee(Q(t,e.length-r),e,r,n)}function P(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i=e[o],s=null,a=i>239?4:i>223?3:i>191?2:1,f,u,c,h;if(o+a<=r)switch(a){case 1:i<128&&(s=i);break;case 2:128==(192&(f=e[o+1]))&&(h=(31&i)<<6|63&f)>127&&(s=h);break;case 3:f=e[o+1],u=e[o+2],128==(192&f)&&128==(192&u)&&(h=(15&i)<<12|(63&f)<<6|63&u)>2047&&(h<55296||h>57343)&&(s=h);break;case 4:f=e[o+1],u=e[o+2],c=e[o+3],128==(192&f)&&128==(192&u)&&128==(192&c)&&(h=(15&i)<<18|(63&f)<<12|(63&u)<<6|63&c)>65535&&h<1114112&&(s=h)}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=a}return I(n)}t.Buffer=u,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return p(null,e,t,r)},u.allocUnsafe=function(e){return l(null,e)},u.allocUnsafeSlow=function(e){return l(null,e)},u.isBuffer=function e(t){return!(null==t||!t._isBuffer)},u.compare=function e(t,r){if(!u.isBuffer(t)||!u.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,o=r.length,i=0,s=Math.min(n,o);i<s;++i)if(t[i]!==r[i]){n=t[i],o=r[i];break}return n<o?-1:o<n?1:0},u.isEncoding=function e(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function e(t,r){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var o=u.allocUnsafe(r),s=0;for(n=0;n<t.length;++n){var a=t[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,s),s+=a.length}return o},u.byteLength=b,u.prototype._isBuffer=!0,u.prototype.swap16=function e(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)x(this,r,r+1);return this},u.prototype.swap32=function e(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)x(this,r,r+3),x(this,r+1,r+2);return this},u.prototype.swap64=function e(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)x(this,r,r+7),x(this,r+1,r+6),x(this,r+2,r+5),x(this,r+3,r+4);return this},u.prototype.toString=function e(){var t=0|this.length;return 0===t?"":0===arguments.length?O(this,0,t):E.apply(this,arguments)},u.prototype.equals=function e(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function e(){var r="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(r=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(r+=" ... ")),"<Buffer "+r+">"},u.prototype.compare=function e(t,r,n,o,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),r<0||n>t.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===t)return 0;for(var s=i-o,a=n-r,f=Math.min(s,a),c=this.slice(o,i),h=t.slice(r,n),p=0;p<f;++p)if(c[p]!==h[p]){s=c[p],a=h[p];break}return s<a?-1:a<s?1:0},u.prototype.includes=function e(t,r,n){return-1!==this.indexOf(t,r,n)},u.prototype.indexOf=function e(t,r,n){return k(this,t,r,n,!0)},u.prototype.lastIndexOf=function e(t,r,n){return k(this,t,r,n,!1)},u.prototype.write=function e(t,r,n,o){if(void 0===r)o="utf8",n=this.length,r=0;else if(void 0===n&&"string"==typeof r)o=r,n=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(n)?(n|=0,void 0===o&&(o="utf8")):(o=n,n=void 0)}var i=this.length-r;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var s=!1;;)switch(o){case"hex":return _(this,t,r,n);case"utf8":case"utf-8":return R(this,t,r,n);case"ascii":return T(this,t,r,n);case"latin1":case"binary":return U(this,t,r,n);case"base64":return S(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),s=!0}},u.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function I(e){var t=e.length;if(t<=L)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=L));return r}function M(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function Y(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=Z(e[i]);return o}function j(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function z(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-r,2);o<i;++o)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function q(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-r,4);o<i;++o)e[r+o]=t>>>8*(n?o:3-o)&255}function F(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function $(e,t,r,n,i){return i||F(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),o.write(e,t,r,n,23,4),r+4}function H(e,t,r,n,i){return i||F(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function e(t,r){var n=this.length,o;if(t=~~t,r=void 0===r?n:~~r,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),r<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),u.TYPED_ARRAY_SUPPORT)(o=this.subarray(t,r)).__proto__=u.prototype;else{var i=r-t;o=new u(i,void 0);for(var s=0;s<i;++s)o[s]=this[s+t]}return o},u.prototype.readUIntLE=function e(t,r,n){t|=0,r|=0,n||C(t,r,this.length);for(var o=this[t],i=1,s=0;++s<r&&(i*=256);)o+=this[t+s]*i;return o},u.prototype.readUIntBE=function e(t,r,n){t|=0,r|=0,n||C(t,r,this.length);for(var o=this[t+--r],i=1;r>0&&(i*=256);)o+=this[t+--r]*i;return o},u.prototype.readUInt8=function e(t,r){return r||C(t,1,this.length),this[t]},u.prototype.readUInt16LE=function e(t,r){return r||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function e(t,r){return r||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function e(t,r){return r||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function e(t,r){return r||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function e(t,r,n){t|=0,r|=0,n||C(t,r,this.length);for(var o=this[t],i=1,s=0;++s<r&&(i*=256);)o+=this[t+s]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},u.prototype.readIntBE=function e(t,r,n){t|=0,r|=0,n||C(t,r,this.length);for(var o=r,i=1,s=this[t+--o];o>0&&(i*=256);)s+=this[t+--o]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*r)),s},u.prototype.readInt8=function e(t,r){return r||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function e(t,r){r||C(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function e(t,r){r||C(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function e(t,r){return r||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function e(t,r){return r||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function e(t,r){return r||C(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function e(t,r){return r||C(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function e(t,r){return r||C(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function e(t,r){return r||C(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function e(t,r,n,o){var i;(t=+t,r|=0,n|=0,o)||N(this,t,r,n,Math.pow(2,8*n)-1,0);var s=1,a=0;for(this[r]=255&t;++a<n&&(s*=256);)this[r+a]=t/s&255;return r+n},u.prototype.writeUIntBE=function e(t,r,n,o){var i;(t=+t,r|=0,n|=0,o)||N(this,t,r,n,Math.pow(2,8*n)-1,0);var s=n-1,a=1;for(this[r+s]=255&t;--s>=0&&(a*=256);)this[r+s]=t/a&255;return r+n},u.prototype.writeUInt8=function e(t,r,n){return t=+t,r|=0,n||N(this,t,r,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},u.prototype.writeUInt16LE=function e(t,r,n){return t=+t,r|=0,n||N(this,t,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):z(this,t,r,!0),r+2},u.prototype.writeUInt16BE=function e(t,r,n){return t=+t,r|=0,n||N(this,t,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):z(this,t,r,!1),r+2},u.prototype.writeUInt32LE=function e(t,r,n){return t=+t,r|=0,n||N(this,t,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):q(this,t,r,!0),r+4},u.prototype.writeUInt32BE=function e(t,r,n){return t=+t,r|=0,n||N(this,t,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):q(this,t,r,!1),r+4},u.prototype.writeIntLE=function e(t,r,n,o){if(t=+t,r|=0,!o){var i=Math.pow(2,8*n-1);N(this,t,r,n,i-1,-i)}var s=0,a=1,f=0;for(this[r]=255&t;++s<n&&(a*=256);)t<0&&0===f&&0!==this[r+s-1]&&(f=1),this[r+s]=(t/a>>0)-f&255;return r+n},u.prototype.writeIntBE=function e(t,r,n,o){if(t=+t,r|=0,!o){var i=Math.pow(2,8*n-1);N(this,t,r,n,i-1,-i)}var s=n-1,a=1,f=0;for(this[r+s]=255&t;--s>=0&&(a*=256);)t<0&&0===f&&0!==this[r+s+1]&&(f=1),this[r+s]=(t/a>>0)-f&255;return r+n},u.prototype.writeInt8=function e(t,r,n){return t=+t,r|=0,n||N(this,t,r,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},u.prototype.writeInt16LE=function e(t,r,n){return t=+t,r|=0,n||N(this,t,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):z(this,t,r,!0),r+2},u.prototype.writeInt16BE=function e(t,r,n){return t=+t,r|=0,n||N(this,t,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):z(this,t,r,!1),r+2},u.prototype.writeInt32LE=function e(t,r,n){return t=+t,r|=0,n||N(this,t,r,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):q(this,t,r,!0),r+4},u.prototype.writeInt32BE=function e(t,r,n){return t=+t,r|=0,n||N(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):q(this,t,r,!1),r+4},u.prototype.writeFloatLE=function e(t,r,n){return $(this,t,r,!0,n)},u.prototype.writeFloatBE=function e(t,r,n){return $(this,t,r,!1,n)},u.prototype.writeDoubleLE=function e(t,r,n){return H(this,t,r,!0,n)},u.prototype.writeDoubleBE=function e(t,r,n){return H(this,t,r,!1,n)},u.prototype.copy=function e(t,r,n,o){if(n||(n=0),o||0===o||(o=this.length),r>=t.length&&(r=t.length),r||(r=0),o>0&&o<n&&(o=n),o===n)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-r<o-n&&(o=t.length-r+n);var i=o-n,s;if(this===t&&n<r&&r<o)for(s=i-1;s>=0;--s)t[s+r]=this[s+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(s=0;s<i;++s)t[s+r]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),r);return i},u.prototype.fill=function e(t,r,n,o){if("string"==typeof t){if("string"==typeof r?(o=r,r=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;var s;if(r>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=r;s<n;++s)this[s]=t;else{var a=u.isBuffer(t)?t:G(new u(t,o).toString()),f=a.length;for(s=0;s<n-r;++s)this[s+r]=a[s%f]}return this};var J=/[^+\/0-9A-Za-z-_]/g;function V(e){if((e=X(e).replace(J,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function X(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Z(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function K(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function Q(e,t){for(var r,n,o,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,o=r%256,i.push(o),i.push(n);return i}function W(e){return n.toByteArray(V(e))}function ee(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function te(e){return e!=e}}).call(t,r(6))},function(e,t,r){"use strict";t.defined=function(e){return null!==e&&void 0!==e&&("number"!=typeof e||!isNaN(e))}},function(e,t,r){e.exports=r(4)},function(e,t,r){"use strict";const n=r(5),o=n(r(24)),i=o.Data,s=["raw","directory","file","metadata","symlink","hamt-sharded-directory"],a=["directory","hamt-sharded-directory"];function f(e,t){if(!(this instanceof f))return new f(e,t);if(-1===s.indexOf(e))throw new Error("Type: "+e+" is not valid");this.type=e,this.data=t,this.blockSizes=[],this.addBlockSize=(e=>{this.blockSizes.push(e)}),this.removeBlockSize=(e=>{this.blockSizes.splice(e,1)}),this.fileSize=(()=>{if(a.indexOf(this.type)>=0)return;let e=0;return this.blockSizes.forEach(t=>{e+=t}),t&&(e+=t.length),e}),this.marshal=(()=>{let e;switch(this.type){case"raw":e=i.DataType.Raw;break;case"directory":e=i.DataType.Directory;break;case"file":e=i.DataType.File;break;case"metadata":e=i.DataType.Metadata;break;case"symlink":e=i.DataType.Symlink;break;case"hamt-sharded-directory":e=i.DataType.HAMTShard;break;default:throw new Error(`Unkown type: "${this.type}"`)}let t=this.fileSize(),r=this.data;this.data&&this.data.length||(r=void 0);let n=this.blockSizes;return this.blockSizes&&this.blockSizes.length||(n=void 0),i.encode({Type:e,Data:r,filesize:t,blocksizes:n,hashType:this.hashType,fanout:this.fanout})})}f.unmarshal=(e=>{const t=i.decode(e);t.Data||(t.Data=void 0);const r=new f(s[t.Type],t.Data);return r.blockSizes=t.blocksizes,r}),t=e.exports=f},function(e,t,r){"use strict";(function(t){var n=r(10),o=r(14),i=function(e){if(!e)return null;var t={};return Object.keys(e).forEach(function(r){t[r]=e[r].value}),t};e.exports=function(e,r){if(r||(r={}),!e)throw new Error("Pass in a .proto string or a protobuf-schema parsed object");var s="object"!=typeof e||t.isBuffer(e)?n.parse(e):e,a=function(){var e=this;o(s,r.encodings||{}).forEach(function(t){e[t.name]=i(t.values)||t})};return a.prototype.toString=function(){return n.stringify(s)},a.prototype.toJSON=function(){return s},new a}}).call(t,r(1).Buffer)},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";t.byteLength=c,t.toByteArray=p,t.fromByteArray=g;for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,f=s.length;a<f;++a)n[a]=s[a],o[s.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("="),n;return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n}function h(e,t,r){return 3*(t+r)/4-r}function p(e){for(var t,r=u(e),n=r[0],s=r[1],a=new i(h(e,n,s)),f=0,c=s>0?n-4:n,p=0;p<c;p+=4)t=o[e.charCodeAt(p)]<<18|o[e.charCodeAt(p+1)]<<12|o[e.charCodeAt(p+2)]<<6|o[e.charCodeAt(p+3)],a[f++]=t>>16&255,a[f++]=t>>8&255,a[f++]=255&t;return 2===s&&(t=o[e.charCodeAt(p)]<<2|o[e.charCodeAt(p+1)]>>4,a[f++]=255&t),1===s&&(t=o[e.charCodeAt(p)]<<10|o[e.charCodeAt(p+1)]<<4|o[e.charCodeAt(p+2)]>>2,a[f++]=t>>8&255,a[f++]=255&t),a}function l(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function d(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(l(n));return o.join("")}function g(e){for(var t,r=e.length,o=r%3,i=[],s=16383,a=0,f=r-o;a<f;a+=16383)i.push(d(e,a,a+16383>f?f:a+16383));return 1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,f=(1<<a)-1,u=f>>1,c=-7,h=r?o-1:0,p=r?-1:1,l=e[t+h];for(h+=p,i=l&(1<<-c)-1,l>>=-c,c+=a;c>0;i=256*i+e[t+h],h+=p,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=p,c-=8);if(0===i)i=1-u;else{if(i===f)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),i-=u}return(l?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var s,a,f,u=8*i-o-1,c=(1<<u)-1,h=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:i-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-s))<1&&(s--,f*=2),(t+=s+h>=1?p/f:p*Math.pow(2,1-h))*f>=2&&(s++,f/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*f-1)*Math.pow(2,o),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;e[r+l]=255&a,l+=d,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;e[r+l]=255&s,l+=d,s/=256,u-=8);e[r+l-d]|=128*g}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){var n=r(11),o=r(13);e.exports=n,e.exports.parse=n,e.exports.stringify=o},function(e,t,r){var n=r(12),o=536870911,i=["int32","int64","uint32","uint64","sint32","sint64","bool","fixed64","sfixed64","double","fixed32","sfixed32","float"],s=function(e){for(var t={};e.length;)switch(e[0]){case"[":case",":e.shift();var r=e.shift();if("("===r&&(r=e.shift(),e.shift()),"="!==e[0])throw new Error("Unexpected token in field options: "+e[0]);if(e.shift(),"]"===e[0])throw new Error("Unexpected ] in field option");t[r]=e.shift();break;case"]":return e.shift(),t;default:throw new Error("Unexpected token in field options: "+e[0])}throw new Error("No closing tag for field options")},a=function(e){for(var t={name:null,type:null,tag:-1,map:null,oneof:null,required:!1,repeated:!1,options:{}};e.length;)switch(e[0]){case"=":e.shift(),t.tag=Number(e.shift());break;case"map":if(t.type="map",t.map={from:null,to:null},e.shift(),"<"!==e[0])throw new Error("Unexpected token in map type: "+e[0]);if(e.shift(),t.map.from=e.shift(),","!==e[0])throw new Error("Unexpected token in map type: "+e[0]);if(e.shift(),t.map.to=e.shift(),">"!==e[0])throw new Error("Unexpected token in map type: "+e[0]);e.shift(),t.name=e.shift();break;case"repeated":case"required":case"optional":var r=e.shift();t.required="required"===r,t.repeated="repeated"===r,t.type=e.shift(),t.name=e.shift();break;case"[":t.options=s(e);break;case";":if(null===t.name)throw new Error("Missing field name");if(null===t.type)throw new Error("Missing type in message field: "+t.name);if(-1===t.tag)throw new Error("Missing tag number in message field: "+t.name);return e.shift(),t;default:throw new Error("Unexpected token in message field: "+e[0])}throw new Error("No ; found for message field")},f=function(e){for(var t={enums:[],messages:[],fields:[],extends:[],extensions:null};e.length;)switch(e[0]){case"map":case"repeated":case"optional":case"required":t.fields.push(a(e));break;case"enum":t.enums.push(g(e));break;case"message":t.messages.push(h(e));break;case"extensions":t.extensions=c(e);break;case"oneof":e.shift();var r=e.shift();if("{"!==e[0])throw new Error("Unexpected token in oneof: "+e[0]);for(e.shift();"}"!==e[0];){e.unshift("optional");var n=a(e);n.oneof=r,t.fields.push(n)}e.shift();break;case"extend":t.extends.push(u(e));break;case";":e.shift();break;case"reserved":case"option":for(e.shift();";"!==e[0];)e.shift();break;default:e.unshift("optional"),t.fields.push(a(e))}return t},u=function(e){var t;return{name:e[1],message:h(e)}},c=function(e){e.shift();var t=Number(e.shift());if(isNaN(t))throw new Error("Invalid from in extensions definition");if("to"!==e.shift())throw new Error("Expected keyword 'to' in extensions definition");var r=e.shift();if("max"===r&&(r=536870911),r=Number(r),isNaN(r))throw new Error("Invalid to in extensions definition");if(";"!==e.shift())throw new Error("Missing ; in extensions definition");return{from:t,to:r}},h=function(e){e.shift();var t=1,r=[],n={name:e.shift(),enums:[],extends:[],messages:[],fields:[]};if("{"!==e[0])throw new Error("Expected { but found "+e[0]);for(e.shift();e.length;){if("{"===e[0]?t++:"}"===e[0]&&t--,!t)return e.shift(),r=f(r),n.enums=r.enums,n.messages=r.messages,n.fields=r.fields,n.extends=r.extends,n.extensions=r.extensions,n;r.push(e.shift())}if(t)throw new Error("No closing tag for message")},p=function(e){e.shift();var t=e.shift();if(";"!==e[0])throw new Error("Expected ; but found "+e[0]);return e.shift(),t},l=function(e){if(e.shift(),"="!==e[0])throw new Error("Expected = but found "+e[0]);e.shift();var t=e.shift();switch(t){case'"proto2"':t=2;break;case'"proto3"':t=3;break;default:throw new Error("Expected protobuf syntax version but found "+t)}if(";"!==e[0])throw new Error("Expected ; but found "+e[0]);return e.shift(),t},d=function(e){if(e.length<4)throw new Error("Invalid enum value: "+e.slice(0,3).join(" "));if("="!==e[1])throw new Error("Expected = but found "+e[1]);if(";"!==e[3]&&"["!==e[3])throw new Error("Expected ; or [ but found "+e[1]);var t=e.shift();e.shift();var r={value:null,options:{}};return r.value=Number(e.shift()),"["===e[0]&&(r.options=s(e)),e.shift(),{name:t,val:r}},g=function(e){e.shift();var t={},r={name:e.shift(),values:{},options:{}};if("{"!==e[0])throw new Error("Expected { but found "+e[0]);for(e.shift();e.length;){if("}"===e[0])return e.shift(),";"===e[0]&&e.shift(),r;if("option"!==e[0]){var n=d(e);r.values[n.name]=n.val}else t=y(e),r.options[t.name]=t.value}throw new Error("No closing tag for enum")},y=function(e){for(var t=null,r=null,n=function(e){return"true"===e||"false"!==e&&e.replace(/^"+|"+$/gm,"")};e.length;){if(";"===e[0])return e.shift(),{name:t,value:r};switch(e[0]){case"option":e.shift();var o="("===e[0];if(o&&e.shift(),t=e.shift(),o){if(")"!==e[0])throw new Error("Expected ) but found "+e[0]);e.shift()}"."===e[0][0]&&(t+=e.shift());break;case"=":if(e.shift(),null===t)throw new Error("Expected key for option with value: "+e[0]);if(r=n(e.shift()),"optimize_for"===t&&!/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(r))throw new Error("Unexpected value for option optimize_for: "+r);"{"===r&&(r=w(e));break;default:throw new Error("Unexpected token in option: "+e[0])}}},w=function(e){for(var t=function(e){return"true"===e||"false"!==e&&e.replace(/^"+|"+$/gm,"")},r={};e.length;){if("}"===e[0])return e.shift(),r;var n="("===e[0];n&&e.shift();var o=e.shift();if(n){if(")"!==e[0])throw new Error("Expected ) but found "+e[0]);e.shift()}var i=null;switch(e[0]){case":":if(void 0!==r[o])throw new Error("Duplicate option map key "+o);e.shift(),"{"===(i=t(e.shift()))&&(i=w(e)),r[o]=i,";"===e[0]&&e.shift();break;case"{":if(e.shift(),i=w(e),void 0===r[o]&&(r[o]=[]),!Array.isArray(r[o]))throw new Error("Duplicate option map key "+o);r[o].push(i);break;default:throw new Error("Unexpected token in option map: "+e[0])}}throw new Error("No closing tag for option map")},v=function(e){e.shift();var t=e.shift().replace(/^"+|"+$/gm,"");if(";"!==e[0])throw new Error("Unexpected token: "+e[0]+'. Expected ";"');return e.shift(),t},m=function(e){e.shift();var t={name:e.shift(),methods:[],options:{}};if("{"!==e[0])throw new Error("Expected { but found "+e[0]);for(e.shift();e.length;){if("}"===e[0])return e.shift(),";"===e[0]&&e.shift(),t;switch(e[0]){case"option":var r=y(e);if(void 0!==t.options[r.name])throw new Error("Duplicate option "+r.name);t.options[r.name]=r.value;break;case"rpc":t.methods.push(b(e));break;default:throw new Error("Unexpected token in service: "+e[0])}}throw new Error("No closing tag for service")},b=function(e){e.shift();var t={name:e.shift(),input_type:null,output_type:null,client_streaming:!1,server_streaming:!1,options:{}};if("("!==e[0])throw new Error("Expected ( but found "+e[0]);if(e.shift(),"stream"===e[0]&&(e.shift(),t.client_streaming=!0),t.input_type=e.shift(),")"!==e[0])throw new Error("Expected ) but found "+e[0]);if(e.shift(),"returns"!==e[0])throw new Error("Expected returns but found "+e[0]);if(e.shift(),"("!==e[0])throw new Error("Expected ( but found "+e[0]);if(e.shift(),"stream"===e[0]&&(e.shift(),t.server_streaming=!0),t.output_type=e.shift(),")"!==e[0])throw new Error("Expected ) but found "+e[0]);if(e.shift(),";"===e[0])return e.shift(),t;if("{"!==e[0])throw new Error("Expected { but found "+e[0]);for(e.shift();e.length;){if("}"===e[0])return e.shift(),";"===e[0]&&e.shift(),t;if("option"!==e[0])throw new Error("Unexpected token in rpc options: "+e[0]);var r=y(e);if(void 0!==t.options[r.name])throw new Error("Duplicate option "+r.name);t.options[r.name]=r.value}throw new Error("No closing tag for rpc")},E=function(e){for(var t=n(e.toString()),r=0;r<t.length;r++){var o;if(/^("|')([^'"]*)$/.test(t[r]))for(o=1===t[r].length?r+1:r;o<t.length;o++)if(/^([^'"]*)("|')$/.test(t[o])){t=t.slice(0,r).concat(t.slice(r,o+1).join("")).concat(t.slice(o+1));break}}for(var s={syntax:3,package:null,imports:[],enums:[],messages:[],options:{},extends:[]},a=!0;t.length;){switch(t[0]){case"package":s.package=p(t);break;case"syntax":if(!a)throw new Error("Protobuf syntax version should be first thing in file");s.syntax=l(t);break;case"message":s.messages.push(h(t));break;case"enum":s.enums.push(g(t));break;case"option":var f=y(t);if(s.options[f.name])throw new Error("Duplicate option "+f.name);s.options[f.name]=f.value;break;case"import":s.imports.push(v(t));break;case"extend":s.extends.push(u(t));break;case"service":s.services||(s.services=[]),s.services.push(m(t));break;default:throw new Error("Unexpected token: "+t[0])}a=!1}return s.extends.forEach(function(e){s.messages.forEach(function(t){t.name===e.name&&e.message.fields.forEach(function(e){if(!t.extensions||e.tag<t.extensions.from||e.tag>t.extensions.to)throw new Error(t.name+" does not declare "+e.tag+" as an extension number");t.fields.push(e)})})}),s.messages.forEach(function(e){e.fields.forEach(function(t){var r,n,o,a;function f(e){return e.name===t.type}function u(e){return e.name===o}if(t.options&&"true"===t.options.packed&&-1===i.indexOf(t.type)){if(-1===t.type.indexOf(".")){if(e.enums&&e.enums.some(f))return}else{if((r=t.type.split(".")).length>2)throw new Error("what is this?");if(n=r[0],o=r[1],s.messages.some(function(e){if(e.name===n)return a=e,e}),a&&a.enums&&a.enums.some(u))return}throw new Error("Fields of type "+t.type+' cannot be declared [packed=true]. Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared "packed". See https://developers.google.com/protocol-buffers/docs/encoding#optional')}})}),s};e.exports=E},function(e,t){e.exports=function(e){var t=function(e){var t=e.indexOf("//");return t>-1?e.slice(0,t):e},r=function(){var e=!1;return function(t){return"/*"===t?(e=!0,!1):"*/"===t?(e=!1,!1):!e}},n=function(e){return e.trim()};return e.replace(/([;,{}()=:[\]<>]|\/\*|\*\/)/g," $1 ").split(/\n/).map(n).filter(Boolean).map(t).map(n).filter(Boolean).join("\n").split(/\s+|\n+/gm).filter(r())}},function(e,t){var r=function(e,t){var r=e.repeated?"repeated":e.required?"required":"optional";"map"===e.type&&(r="map<"+e.map.from+","+e.map.to+">"),e.oneof&&(r="");var n=Object.keys(e.options||{}).map(function(t){return t+" = "+e.options[t]}).join(",");return n&&(n=" ["+n+"]"),t.push((r?r+" ":"")+("map"===e.map?"":e.type+" ")+e.name+" = "+e.tag+n+";"),t},n=function(e,t){t.push("message "+e.name+" {"),e.enums||(e.enums=[]),e.enums.forEach(function(e){t.push(o(e,[]))}),e.messages||(e.messages=[]),e.messages.forEach(function(e){t.push(n(e,[]))});var i={};return e.fields||(e.fields=[]),e.fields.forEach(function(e){e.oneof?(i[e.oneof]||(i[e.oneof]=[]),i[e.oneof].push(r(e,[]))):t.push(r(e,[]))}),Object.keys(i).forEach(function(e){i[e].unshift("oneof "+e+" {"),i[e].push("}"),t.push(i[e])}),t.push("}",""),t},o=function(e,t){t.push("enum "+e.name+" {"),e.options||(e.options={});var r=s(e.options,[]);return r.length>1&&t.push(r.slice(0,-1)),Object.keys(e.values).map(function(r){var n=i(e.values[r]);t.push([r+" = "+n+";"])}),t.push("}",""),t},i=function(e,t){var r=Object.keys(e.options||{}).map(function(t){return t+" = "+e.options[t]}).join(","),n;return r&&(r=" ["+r+"]"),e.value+r},s=function(e,t){var r=Object.keys(e);return r.forEach(function(r){var n=e[r];~r.indexOf(".")&&(r="("+r+")");var o=typeof n;"object"===o?(n=a(n,[])).length&&t.push("option "+r+" = {",n,"};"):("string"===o&&"optimize_for"!==r&&(n='"'+n+'"'),t.push("option "+r+" = "+n+";"))}),r.length>0&&t.push(""),t},a=function(e,t){var r;return Object.keys(e).forEach(function(r){var n=e[r],o=typeof n;"object"===o?Array.isArray(n)?n.forEach(function(e){(e=a(e,[])).length&&t.push(r+" {",e,"}")}):(n=a(n,[])).length&&t.push(r+" {",n,"}"):("string"===o&&(n='"'+n+'"'),t.push(r+": "+n))}),t},f=function(e,t){return t.push("service "+e.name+" {"),e.options||(e.options={}),s(e.options,t),e.methods||(e.methods=[]),e.methods.forEach(function(e){t.push(u(e,[]))}),t.push("}",""),t},u=function(e,t){var r="rpc "+e.name+"(";e.client_streaming&&(r+="stream "),r+=e.input_type+") returns (",e.server_streaming&&(r+="stream "),r+=e.output_type+")",e.options||(e.options={});var n=s(e.options,[]);return n.length>1?t.push(r+" {",n.slice(0,-1),"}"):t.push(r+";"),t},c=function(e){return function(t){return Array.isArray(t)?t.map(c(e+" ")).join("\n"):e+t}};e.exports=function(e){var t=[];return t.push('syntax = "proto'+e.syntax+'";',""),e.package&&t.push("package "+e.package+";",""),e.options||(e.options={}),s(e.options,t),e.enums||(e.enums=[]),e.enums.forEach(function(e){o(e,t)}),e.messages||(e.messages=[]),e.messages.forEach(function(e){n(e,t)}),e.services&&e.services.forEach(function(e){f(e,t)}),t.map(c("")).join("\n")}},function(e,t,r){"use strict";var n=r(15),o=r(21),i=r(22),s=r(23),a=r(0),f=function(e){if(!e)return null;var t={};return Object.keys(e).forEach(function(r){t[r]=e[r].value}),t};e.exports=function(e,t){var r={},u={},c={},h=function(e,t){e.enums&&e.enums.forEach(function(e){e.id=t+(t?".":"")+e.name,u[e.id]=e,h(e,e.id)}),e.messages&&e.messages.forEach(function(n){n.id=t+(t?".":"")+n.name,r[n.id]=n,n.fields.forEach(function(n){if(n.map){var o="Map_"+n.map.from+"_"+n.map.to,i={name:o,enums:[],messages:[],fields:[{name:"key",type:n.map.from,tag:1,repeated:!1,required:!0},{name:"value",type:n.map.to,tag:2,repeated:!1,required:!1}],extensions:null,id:t+(t?".":"")+o};r[i.id]||(r[i.id]=i,e.messages.push(i)),n.type=o,n.repeated=!0}}),h(n,n.id)})};h(e,"");var p=function(e){var t=Object.keys(e.values||[]).map(function(t){return parseInt(e.values[t].value,10)}),r=function e(r,n,o){if(!t.length||-1===t.indexOf(r))throw new Error("Invalid enum value: "+r);return a.encode(r,n,o),e.bytes=a.encode.bytes,n},o=function e(r,n){var o=a.decode(r,n);if(!t.length||-1===t.indexOf(o))throw new Error("Invalid enum value: "+o);return e.bytes=a.decode.bytes,o};return n.make(0,r,o,a.encodingLength)},l=function(e,t){e.messages.forEach(function(r){t[r.name]=d(r.name,e.id)}),e.enums.forEach(function(e){t[e.name]=f(e.values)}),t.type=2,t.message=!0,t.name=e.name;var r={};e.fields.forEach(function(e){e.oneof&&(r[e.oneof]||(r[e.oneof]=[]),r[e.oneof].push(e.name))});var n=e.fields.map(function(t){return d(t.type,e.id)}),a=s(e,n,r),u=i(e,d,n,r,a),c=o(e,d,n);return u.bytes=c.bytes=0,t.buffer=!0,t.encode=u,t.decode=c,t.encodingLength=a,t},d=function(e,o,i){if(t&&t[e])return t[e];if(n[e])return n[e];var s=(o?o+"."+e:e).split(".").map(function(t,r,n){return n.slice(0,r).concat(e).join(".")}).reverse().reduce(function(e,t){return e||r[t]||u[t]},null),a;if(!1===i)return s;if(!s)throw new Error("Could not resolve "+e);return s.values?p(s):c[s.id]||l(s,c[s.id]={})};return(e.enums||[]).concat((e.messages||[]).map(function(e){return d(e.id)}))}},function(e,t,r){"use strict";var n=r(0),o=r(19),i=r(20).Buffer,s=function(e,t,r,n){return t.bytes=r.bytes=0,{type:e,encode:t,decode:r,encodingLength:n}},a,f,u,c,h;t.make=s,t.bytes=(f=function(e){return i.isBuffer(e)?e.length:i.byteLength(e)},s(2,c=function(e,t,r){var o=r,s=f(e);return n.encode(s,t,r),r+=n.encode.bytes,i.isBuffer(e)?e.copy(t,r):t.write(e,r,s),r+=s,c.bytes=r-o,t},h=function(e,t){var r=t,o=n.decode(e,t);t+=n.decode.bytes;var i=e.slice(t,t+o);return t+=i.length,h.bytes=t-r,i},function(e){var t=f(e);return n.encodingLength(t)+t})),t.string=function(){var e,t=function(e,r,o){var s=o,a=i.byteLength(e);return n.encode(a,r,o,"utf-8"),o+=n.encode.bytes,r.write(e,o,a),o+=a,t.bytes=o-s,r},r=function(e,t){var o=t,i=n.decode(e,t);t+=n.decode.bytes;var s=e.toString("utf-8",t,t+i);return t+=i,r.bytes=t-o,s};return s(2,t,r,function(e){var t=i.byteLength(e);return n.encodingLength(t)+t})}(),t.bool=function(){var e,t=function(e,r,n){return r[n]=e?1:0,t.bytes=1,r},r=function(e,t){var n=e[t]>0;return r.bytes=1,n};return s(0,t,r,function(e){return 1})}(),t.int32=function(){var e=function(t,r){var o=n.decode(t,r);return e.bytes=n.decode.bytes,o>2147483647?o-4294967296:o},t=function(e,r,o){return n.encode(e<0?e+4294967296:e,r,o),t.bytes=n.encode.bytes,r},r=function(e){return n.encodingLength(e<0?e+4294967296:e)};return s(0,n.encode,e,r)}(),t.int64=function(){var e=function(t,r){var o=n.decode(t,r);if(o>=Math.pow(2,63)){for(var s=9;255===t[r+s-1];)s--;s=s||9;var a=i.allocUnsafe(s);t.copy(a,0,r,r+s),a[s-1]=127&a[s-1],o=-1*n.decode(a,0),e.bytes=10}else e.bytes=n.decode.bytes;return o},t=function(e,r,o){if(e<0){var i=o+9;for(n.encode(-1*e,r,o),r[o+=n.encode.bytes-1]=128|r[o];o<i-1;)r[++o]=255;r[i]=1,t.bytes=10}else n.encode(e,r,o),t.bytes=n.encode.bytes;return r},r;return s(0,t,e,function(e){return e<0?10:n.encodingLength(e)})}(),t.sint32=t.sint64=s(0,o.encode,o.decode,o.encodingLength),t.uint32=t.uint64=t.enum=t.varint=s(0,n.encode,n.decode,n.encodingLength),t.fixed64=t.sfixed64=function(){var e,t=function(e,r,n){return e.copy(r,n),t.bytes=8,r},r=function(e,t){var n=e.slice(t,t+8);return r.bytes=8,n};return s(1,t,r,function(e){return 8})}(),t.double=function(){var e,t=function(e,r,n){return r.writeDoubleLE(e,n),t.bytes=8,r},r=function(e,t){var n=e.readDoubleLE(t);return r.bytes=8,n};return s(1,t,r,function(e){return 8})}(),t.fixed32=function(){var e,t=function(e,r,n){return r.writeUInt32LE(e,n),t.bytes=4,r},r=function(e,t){var n=e.readUInt32LE(t);return r.bytes=4,n};return s(5,t,r,function(e){return 4})}(),t.sfixed32=function(){var e,t=function(e,r,n){return r.writeInt32LE(e,n),t.bytes=4,r},r=function(e,t){var n=e.readInt32LE(t);return r.bytes=4,n};return s(5,t,r,function(e){return 4})}(),t.float=function(){var e,t=function(e,r,n){return r.writeFloatLE(e,n),t.bytes=4,r},r=function(e,t){var n=e.readFloatLE(t);return r.bytes=4,n};return s(5,t,r,function(e){return 4})}()},function(e,t){e.exports=s;var r=128,n=127,o=-128,i=Math.pow(2,31);function s(e,t,n){t=t||[];for(var a=n=n||0;e>=i;)t[n++]=255&e|r,e/=128;for(;e&o;)t[n++]=255&e|r,e>>>=7;return t[n]=0|e,s.bytes=n-a+1,t}},function(e,t){e.exports=o;var r=128,n=127;function o(e,t){var i=0,t,s=0,a=t=t||0,f,u=e.length;do{if(a>=u)throw o.bytes=0,new RangeError("Could not decode varint");f=e[a++],i+=s<28?(f&n)<<s:(f&n)*Math.pow(2,s),s+=7}while(f>=r);return o.bytes=a-t,i}},function(e,t){var r=Math.pow(2,7),n=Math.pow(2,14),o=Math.pow(2,21),i=Math.pow(2,28),s=Math.pow(2,35),a=Math.pow(2,42),f=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);e.exports=function(e){return e<r?1:e<n?2:e<o?3:e<i?4:e<s?5:e<a?6:e<f?7:e<u?8:e<c?9:10}},function(e,t,r){var n=r(0);t.encode=function e(t,r,o){t=t>=0?2*t:-2*t-1;var i=n.encode(t,r,o);return e.bytes=n.encode.bytes,i},t.decode=function e(t,r){var o=n.decode(t,r);return e.bytes=n.decode.bytes,1&o?(o+1)/-2:o/2},t.encodingLength=function(e){return n.encodingLength(e>=0?2*e:-2*e-1)}},function(e,t,r){var n=r(1),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=s),i(o,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";var n=r(0),o=r(2).defined;function i(e,t,r){for(var i=[],f={},u=[],c=[],h=0;h<r.length;h++){var p=e.fields[h];f[p.tag]=h;var l=p.options&&p.options.default,d=t(p.type,e.id,!1);c[h]=[l,d&&d.values],e.fields[h].packed=p.repeated&&p.options&&p.options.packed&&"false"!==p.options.packed,p.required&&i.push(p.name),p.oneof&&u.push(p.name)}function g(e,t,r,o,i,s){var a=t.name;if(t.oneof)for(var f=Object.keys(r),c=0;c<f.length;c++)u.indexOf(f[c])>-1&&delete r[f[c]];if(e.message){var h=n.decode(o,i);i+=n.decode.bytes;var p=e.decode(o,i,i+h);t.map?(r[a]=r[a]||{},r[a][p.key]=p.value):t.repeated?(r[a]=r[a]||[],r[a].push(p)):r[a]=p}else t.repeated?(r[a]=r[a]||[],r[a].push(e.decode(o,i))):r[a]=e.decode(o,i);return i+=e.decode.bytes}return function t(h,p,l){if(null==p&&(p=0),null==l&&(l=h.length),!(l<=h.length&&p<=h.length))throw new Error("Decoded message is not valid");for(var d=p,y={},w;;){if(l<=p){var v="",m=0,b,E;for(m=0;m<i.length;m++)if(v=i[m],!o(y[v]))throw new Error("Decoded message is not valid, missing required field: "+v);for(m=0;m<r.length;m++)if(w=e.fields[m],E=c[m][0],b=c[m][1],v=w.name,!o(y[v])){var x=!1;if(w.oneof)for(var k=Object.keys(y),A=0;A<k.length;A++)if(u.indexOf(k[A])>-1){x=!0;break}x||(b?w.repeated?y[v]=[]:(E=E&&b[E]?b[E].value:b[Object.keys(b)[0]].value,y[v]=parseInt(E||0,10)):y[v]=a(w,E))}return t.bytes=p-d,y}var _=n.decode(h,p);p+=n.decode.bytes;var R,T=f[_>>3];if(null!=T){var U=r[T];if((w=e.fields[T]).packed){var S=n.decode(h,p);for(S+=p+=n.decode.bytes;p<S;)p=g(U,w,y,h,p,T)}else p=g(U,w,y,h,p,T)}else p=s(7&_,h,p)}}}var s=function(e,t,r){switch(e){case 0:return n.decode(t,r),r+n.decode.bytes;case 1:return r+8;case 2:var o=n.decode(t,r);return r+n.decode.bytes+o;case 3:case 4:throw new Error("Groups are not supported");case 5:return r+4;default:throw new Error("Unknown wire type: "+e)}},a=function(e,t){if(e.map)return{};if(e.repeated)return[];switch(e.type){case"string":return null!=t?t:"";case"bool":return"true"===t;case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return parseInt(t||0,10);default:return null}};e.exports=i},function(e,t,r){"use strict";(function(t){var n=r(2).defined,o=r(0);function i(e,r,i,s,a){for(var f=Object.keys(s),u=i.length,c={},h=0;h<u;h++){c[h]={p:o.encode(e.fields[h].tag<<3|2),h:o.encode(e.fields[h].tag<<3|i[h].type)};var p=e.fields[h];e.fields[h].packed=p.repeated&&p.options&&p.options.packed&&"false"!==p.options.packed}function l(e,t,r,n,i,s){var a=0;if(!i)for(a=0;a<r.length;a++)e[t++]=r[a];return n.message&&(o.encode(n.encodingLength(s),e,t),t+=o.encode.bytes),n.encode(s,e,t),t+n.encode.bytes}return function r(h,p,d){null==d&&(d=0),null==p&&(p=t.allocUnsafe(a(h)));var g=d,y=Object.keys(h),w=0,v=!1;for(w=0;w<f.length;w++){var m=f[w],b=s[w];if(y.indexOf(b)>-1){if(v)throw new Error("only one of the properties defined in oneof "+m+" can be set");v=!0}}for(w=0;w<u;w++){var E=i[w],x=e.fields[w],k=h[x.name],A=0;if(n(k)){var _=c[w].p,R=c[w].h,T=x.packed,U;if(x.map){var S=Object.keys(k);for(A=0;A<S.length;A++)S[A]={key:S[A],value:k[S[A]]};k=S}if(T){var B=0;for(A=0;A<k.length;A++)n(k[A])&&(B+=E.encodingLength(k[A]));if(B){for(A=0;A<R.length;A++)p[d++]=_[A];o.encode(B,p,d),d+=o.encode.bytes}}if(x.repeated)for(A=0;A<k.length;A++)U=k[A],n(U)&&(d=l(p,d,R,E,T,U));else d=l(p,d,R,E,T,k)}else if(x.required)throw new Error(x.name+" is required")}return r.bytes=d-g,p}}e.exports=i}).call(t,r(1).Buffer)},function(e,t,r){"use strict";var n=r(2).defined,o=r(0);function i(e,t,r){for(var i=Object.keys(r),s=t.length,a=new Array(s),f=0;f<e.fields.length;f++){a[f]=o.encodingLength(e.fields[f].tag<<3|t[f].type);var u=e.fields[f];e.fields[f].packed=u.repeated&&u.options&&u.options.packed&&"false"!==u.options.packed}return function f(u){var c=0,h=0,p=0;for(h=0;h<i.length;h++){var l=i[h],d=r[l],g=!1;for(p=0;p<d.length;p++)if(n(u[d[p]])){if(g)throw new Error("only one of the properties defined in oneof "+l+" can be set");g=!0}}for(h=0;h<s;h++){var y=t[h],w=e.fields[h],v=u[w.name],m=a[h],b;if(n(v)){if(w.map){var E=Object.keys(v);for(p=0;p<E.length;p++)E[p]={key:E[p],value:v[E[p]]};v=E}if(w.packed){var x=0;for(p=0;p<v.length;p++)n(v[p])&&(x+=b=y.encodingLength(v[p]),y.message&&(x+=o.encodingLength(b)));x&&(c+=m+x+o.encodingLength(x))}else if(w.repeated)for(p=0;p<v.length;p++)n(v[p])&&(c+=m+(b=y.encodingLength(v[p]))+(y.message?o.encodingLength(b):0));else c+=m+(b=y.encodingLength(v))+(y.message?o.encodingLength(b):0)}else if(w.required)throw new Error(w.name+" is required")}return c}}e.exports=i},function(e,t,r){"use strict";e.exports="message Data {\n enum DataType {\n Raw = 0;\n Directory = 1;\n File = 2;\n Metadata = 3;\n Symlink = 4;\n HAMTShard = 5;\n }\n\n required DataType Type = 1;\n optional bytes Data = 2;\n optional uint64 filesize = 3;\n repeated uint64 blocksizes = 4;\n\n optional uint64 hashType = 5;\n optional uint64 fanout = 6;\n}\n\nmessage Metadata {\n optional string MimeType = 1;\n}"}]); | ||
var IpfsUnixfs=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}({"./node_modules/base64-js/index.js":function(e,t,n){"use strict";t.byteLength=c,t.toByteArray=l,t.fromByteArray=g;for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,f=s.length;u<f;++u)r[u]=s[u],o[s.charCodeAt(u)]=u;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("="),r;return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){var t=a(e),n=t[0],r=t[1];return 3*(n+r)/4-r}function h(e,t,n){return 3*(t+n)/4-n}function l(e){for(var t,n=a(e),r=n[0],s=n[1],u=new i(h(e,r,s)),f=0,c=s>0?r-4:r,l=0;l<c;l+=4)t=o[e.charCodeAt(l)]<<18|o[e.charCodeAt(l+1)]<<12|o[e.charCodeAt(l+2)]<<6|o[e.charCodeAt(l+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===s&&(t=o[e.charCodeAt(l)]<<2|o[e.charCodeAt(l+1)]>>4,u[f++]=255&t),1===s&&(t=o[e.charCodeAt(l)]<<10|o[e.charCodeAt(l+1)]<<4|o[e.charCodeAt(l+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u}function d(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function p(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(d(r));return o.join("")}function g(e){for(var t,n=e.length,o=n%3,i=[],s=16383,u=0,f=n-o;u<f;u+=16383)i.push(p(e,u,u+16383>f?f:u+16383));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},"./node_modules/buffer/index.js":function(e,t,n){"use strict";(function(e){var r=n("./node_modules/base64-js/index.js"),o=n("./node_modules/ieee754/index.js"),i=n("./node_modules/isarray/index.js");function s(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function u(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e,t){if(u()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=a.prototype:(null===e&&(e=new a(t)),e.length=t),e}function a(e,t,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?m(e,t,n,r):"string"==typeof t?p(e,t,n):y(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t,n,r){return h(t),t<=0?f(e,t):void 0!==n?"string"==typeof r?f(e,t).fill(n,r):f(e,t).fill(n):f(e,t)}function d(e,t){if(h(t),e=f(e,t<0?0:0|v(t)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|b(t,n),o=(e=f(e,r)).write(t,n);return o!==r&&(e=e.slice(0,o)),e}function g(e,t){var n=t.length<0?0:0|v(t.length);e=f(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function m(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),a.TYPED_ARRAY_SUPPORT?(e=t).__proto__=a.prototype:e=g(e,t),e}function y(e,t){if(a.isBuffer(t)){var n=0|v(t.length);return 0===(e=f(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||te(t.length)?f(e,0):g(e,t);if("Buffer"===t.type&&i(t.data))return g(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function v(e){if(e>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|e}function w(e){return+e!=e&&(e=0),a.alloc(+e)}function b(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function E(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,n);case"utf8":case"utf-8":return P(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return B(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function x(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:k(e,t,n,r,o);if("number"==typeof t)return t&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):k(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function k(e,t,n,r,o){var i=1,s=e.length,u=t.length,f;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;i=2,s/=2,u/=2,n/=2}function a(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var c=-1;for(f=n;f<s;f++)if(a(e,f)===a(t,-1===c?0:f-c)){if(-1===c&&(c=f),f-c+1===u)return c*i}else-1!==c&&(f-=f-c),c=-1}else for(n+u>s&&(n=s-u),f=n;f>=0;f--){for(var h=!0,l=0;l<u;l++)if(a(e,f+l)!==a(t,l)){h=!1;break}if(h)return f}return-1}function A(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s<r;++s){var u=parseInt(t.substr(2*s,2),16);if(isNaN(u))return s;e[n+s]=u}return s}function j(e,t,n,r){return ee(G(t,e.length-n),e,n,r)}function T(e,t,n,r){return ee(K(t),e,n,r)}function R(e,t,n,r){return T(e,t,n,r)}function U(e,t,n,r){return ee(W(t),e,n,r)}function S(e,t,n,r){return ee(Q(t,e.length-n),e,n,r)}function B(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function P(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i=e[o],s=null,u=i>239?4:i>223?3:i>191?2:1,f,a,c,h;if(o+u<=n)switch(u){case 1:i<128&&(s=i);break;case 2:128==(192&(f=e[o+1]))&&(h=(31&i)<<6|63&f)>127&&(s=h);break;case 3:f=e[o+1],a=e[o+2],128==(192&f)&&128==(192&a)&&(h=(15&i)<<12|(63&f)<<6|63&a)>2047&&(h<55296||h>57343)&&(s=h);break;case 4:f=e[o+1],a=e[o+2],c=e[o+3],128==(192&f)&&128==(192&a)&&128==(192&c)&&(h=(15&i)<<18|(63&f)<<12|(63&a)<<6|63&c)>65535&&h<1114112&&(s=h)}null===s?(s=65533,u=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),o+=u}return L(r)}t.Buffer=a,t.SlowBuffer=w,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=u(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,n){return c(null,e,t,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,n){return l(null,e,t,n)},a.allocUnsafe=function(e){return d(null,e)},a.allocUnsafeSlow=function(e){return d(null,e)},a.isBuffer=function e(t){return!(null==t||!t._isBuffer)},a.compare=function e(t,n){if(!a.isBuffer(t)||!a.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(t===n)return 0;for(var r=t.length,o=n.length,i=0,s=Math.min(r,o);i<s;++i)if(t[i]!==n[i]){r=t[i],o=n[i];break}return r<o?-1:o<r?1:0},a.isEncoding=function e(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function e(t,n){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===n)for(n=0,r=0;r<t.length;++r)n+=t[r].length;var o=a.allocUnsafe(n),s=0;for(r=0;r<t.length;++r){var u=t[r];if(!a.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(o,s),s+=u.length}return o},a.byteLength=b,a.prototype._isBuffer=!0,a.prototype.swap16=function e(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<t;n+=2)x(this,n,n+1);return this},a.prototype.swap32=function e(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<t;n+=4)x(this,n,n+3),x(this,n+1,n+2);return this},a.prototype.swap64=function e(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<t;n+=8)x(this,n,n+7),x(this,n+1,n+6),x(this,n+2,n+5),x(this,n+3,n+4);return this},a.prototype.toString=function e(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):E.apply(this,arguments)},a.prototype.equals=function e(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function e(){var n="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(n+=" ... ")),"<Buffer "+n+">"},a.prototype.compare=function e(t,n,r,o,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===r&&(r=t?t.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),n<0||r>t.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&n>=r)return 0;if(o>=i)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,o>>>=0,i>>>=0,this===t)return 0;for(var s=i-o,u=r-n,f=Math.min(s,u),c=this.slice(o,i),h=t.slice(n,r),l=0;l<f;++l)if(c[l]!==h[l]){s=c[l],u=h[l];break}return s<u?-1:u<s?1:0},a.prototype.includes=function e(t,n,r){return-1!==this.indexOf(t,n,r)},a.prototype.indexOf=function e(t,n,r){return _(this,t,n,r,!0)},a.prototype.lastIndexOf=function e(t,n,r){return _(this,t,n,r,!1)},a.prototype.write=function e(t,n,r,o){if(void 0===n)o="utf8",r=this.length,n=0;else if(void 0===r&&"string"==typeof n)o=n,r=this.length,n=0;else{if(!isFinite(n))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");n|=0,isFinite(r)?(r|=0,void 0===o&&(o="utf8")):(o=r,r=void 0)}var i=this.length-n;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var s=!1;;)switch(o){case"hex":return A(this,t,n,r);case"utf8":case"utf-8":return j(this,t,n,r);case"ascii":return T(this,t,n,r);case"latin1":case"binary":return R(this,t,n,r);case"base64":return U(this,t,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,n,r);default:if(s)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),s=!0}},a.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function L(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=O));return n}function M(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function I(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function D(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=Z(e[i]);return o}function Y(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function C(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,o,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function z(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function q(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function F(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function $(e,t,n,r,i){return i||F(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),o.write(e,t,n,r,23,4),n+4}function H(e,t,n,r,i){return i||F(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),o.write(e,t,n,r,52,8),n+8}a.prototype.slice=function e(t,n){var r=this.length,o;if(t=~~t,n=void 0===n?r:~~n,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),n<0?(n+=r)<0&&(n=0):n>r&&(n=r),n<t&&(n=t),a.TYPED_ARRAY_SUPPORT)(o=this.subarray(t,n)).__proto__=a.prototype;else{var i=n-t;o=new a(i,void 0);for(var s=0;s<i;++s)o[s]=this[s+t]}return o},a.prototype.readUIntLE=function e(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var o=this[t],i=1,s=0;++s<n&&(i*=256);)o+=this[t+s]*i;return o},a.prototype.readUIntBE=function e(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var o=this[t+--n],i=1;n>0&&(i*=256);)o+=this[t+--n]*i;return o},a.prototype.readUInt8=function e(t,n){return n||C(t,1,this.length),this[t]},a.prototype.readUInt16LE=function e(t,n){return n||C(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function e(t,n){return n||C(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function e(t,n){return n||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function e(t,n){return n||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function e(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var o=this[t],i=1,s=0;++s<n&&(i*=256);)o+=this[t+s]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*n)),o},a.prototype.readIntBE=function e(t,n,r){t|=0,n|=0,r||C(t,n,this.length);for(var o=n,i=1,s=this[t+--o];o>0&&(i*=256);)s+=this[t+--o]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*n)),s},a.prototype.readInt8=function e(t,n){return n||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function e(t,n){n||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function e(t,n){n||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function e(t,n){return n||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function e(t,n){return n||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function e(t,n){return n||C(t,4,this.length),o.read(this,t,!0,23,4)},a.prototype.readFloatBE=function e(t,n){return n||C(t,4,this.length),o.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function e(t,n){return n||C(t,8,this.length),o.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function e(t,n){return n||C(t,8,this.length),o.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function e(t,n,r,o){var i;(t=+t,n|=0,r|=0,o)||N(this,t,n,r,Math.pow(2,8*r)-1,0);var s=1,u=0;for(this[n]=255&t;++u<r&&(s*=256);)this[n+u]=t/s&255;return n+r},a.prototype.writeUIntBE=function e(t,n,r,o){var i;(t=+t,n|=0,r|=0,o)||N(this,t,n,r,Math.pow(2,8*r)-1,0);var s=r-1,u=1;for(this[n+s]=255&t;--s>=0&&(u*=256);)this[n+s]=t/u&255;return n+r},a.prototype.writeUInt8=function e(t,n,r){return t=+t,n|=0,r||N(this,t,n,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=255&t,n+1},a.prototype.writeUInt16LE=function e(t,n,r){return t=+t,n|=0,r||N(this,t,n,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):z(this,t,n,!0),n+2},a.prototype.writeUInt16BE=function e(t,n,r){return t=+t,n|=0,r||N(this,t,n,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):z(this,t,n,!1),n+2},a.prototype.writeUInt32LE=function e(t,n,r){return t=+t,n|=0,r||N(this,t,n,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=255&t):q(this,t,n,!0),n+4},a.prototype.writeUInt32BE=function e(t,n,r){return t=+t,n|=0,r||N(this,t,n,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):q(this,t,n,!1),n+4},a.prototype.writeIntLE=function e(t,n,r,o){if(t=+t,n|=0,!o){var i=Math.pow(2,8*r-1);N(this,t,n,r,i-1,-i)}var s=0,u=1,f=0;for(this[n]=255&t;++s<r&&(u*=256);)t<0&&0===f&&0!==this[n+s-1]&&(f=1),this[n+s]=(t/u>>0)-f&255;return n+r},a.prototype.writeIntBE=function e(t,n,r,o){if(t=+t,n|=0,!o){var i=Math.pow(2,8*r-1);N(this,t,n,r,i-1,-i)}var s=r-1,u=1,f=0;for(this[n+s]=255&t;--s>=0&&(u*=256);)t<0&&0===f&&0!==this[n+s+1]&&(f=1),this[n+s]=(t/u>>0)-f&255;return n+r},a.prototype.writeInt8=function e(t,n,r){return t=+t,n|=0,r||N(this,t,n,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=255&t,n+1},a.prototype.writeInt16LE=function e(t,n,r){return t=+t,n|=0,r||N(this,t,n,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):z(this,t,n,!0),n+2},a.prototype.writeInt16BE=function e(t,n,r){return t=+t,n|=0,r||N(this,t,n,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):z(this,t,n,!1),n+2},a.prototype.writeInt32LE=function e(t,n,r){return t=+t,n|=0,r||N(this,t,n,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):q(this,t,n,!0),n+4},a.prototype.writeInt32BE=function e(t,n,r){return t=+t,n|=0,r||N(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):q(this,t,n,!1),n+4},a.prototype.writeFloatLE=function e(t,n,r){return $(this,t,n,!0,r)},a.prototype.writeFloatBE=function e(t,n,r){return $(this,t,n,!1,r)},a.prototype.writeDoubleLE=function e(t,n,r){return H(this,t,n,!0,r)},a.prototype.writeDoubleBE=function e(t,n,r){return H(this,t,n,!1,r)},a.prototype.copy=function e(t,n,r,o){if(r||(r=0),o||0===o||(o=this.length),n>=t.length&&(n=t.length),n||(n=0),o>0&&o<r&&(o=r),o===r)return 0;if(0===t.length||0===this.length)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-n<o-r&&(o=t.length-n+r);var i=o-r,s;if(this===t&&r<n&&n<o)for(s=i-1;s>=0;--s)t[s+n]=this[s+r];else if(i<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<i;++s)t[s+n]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),n);return i},a.prototype.fill=function e(t,n,r,o){if("string"==typeof t){if("string"==typeof n?(o=n,n=0,r=this.length):"string"==typeof r&&(o=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!a.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else"number"==typeof t&&(t&=255);if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;var s;if(n>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=n;s<r;++s)this[s]=t;else{var u=a.isBuffer(t)?t:G(new a(t,o).toString()),f=u.length;for(s=0;s<r-n;++s)this[s+n]=u[s%f]}return this};var J=/[^+\/0-9A-Za-z-_]/g;function V(e){if((e=X(e).replace(J,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function X(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Z(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function K(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function Q(e,t){for(var n,r,o,i=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,o=n%256,i.push(o),i.push(r);return i}function W(e){return r.toByteArray(V(e))}function ee(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function te(e){return e!=e}}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/ieee754/index.js":function(e,t){t.read=function(e,t,n,r,o){var i,s,u=8*o-r-1,f=(1<<u)-1,a=f>>1,c=-7,h=n?o-1:0,l=n?-1:1,d=e[t+h];for(h+=l,i=d&(1<<-c)-1,d>>=-c,c+=u;c>0;i=256*i+e[t+h],h+=l,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=r;c>0;s=256*s+e[t+h],h+=l,c-=8);if(0===i)i=1-a;else{if(i===f)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),i-=a}return(d?-1:1)*s*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var s,u,f,a=8*i-o-1,c=(1<<a)-1,h=c>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-s))<1&&(s--,f*=2),(t+=s+h>=1?l/f:l*Math.pow(2,1-h))*f>=2&&(s++,f/=2),s+h>=c?(u=0,s=c):s+h>=1?(u=(t*f-1)*Math.pow(2,o),s+=h):(u=t*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;e[n+d]=255&u,d+=p,u/=256,o-=8);for(s=s<<o|u,a+=o;a>0;e[n+d]=255&s,d+=p,s/=256,a-=8);e[n+d-p]|=128*g}},"./node_modules/isarray/index.js":function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},"./node_modules/protocol-buffers-schema/index.js":function(e,t,n){var r=n("./node_modules/protocol-buffers-schema/parse.js"),o=n("./node_modules/protocol-buffers-schema/stringify.js");e.exports=r,e.exports.parse=r,e.exports.stringify=o},"./node_modules/protocol-buffers-schema/parse.js":function(e,t,n){var r=n("./node_modules/protocol-buffers-schema/tokenize.js"),o=536870911,i=["int32","int64","uint32","uint64","sint32","sint64","bool","fixed64","sfixed64","double","fixed32","sfixed32","float"],s=function(e){for(var t={};e.length;)switch(e[0]){case"[":case",":e.shift();var n=e.shift();if("("===n&&(n=e.shift(),e.shift()),"="!==e[0])throw new Error("Unexpected token in field options: "+e[0]);if(e.shift(),"]"===e[0])throw new Error("Unexpected ] in field option");t[n]=e.shift();break;case"]":return e.shift(),t;default:throw new Error("Unexpected token in field options: "+e[0])}throw new Error("No closing tag for field options")},u=function(e){for(var t={name:null,type:null,tag:-1,map:null,oneof:null,required:!1,repeated:!1,options:{}};e.length;)switch(e[0]){case"=":e.shift(),t.tag=Number(e.shift());break;case"map":if(t.type="map",t.map={from:null,to:null},e.shift(),"<"!==e[0])throw new Error("Unexpected token in map type: "+e[0]);if(e.shift(),t.map.from=e.shift(),","!==e[0])throw new Error("Unexpected token in map type: "+e[0]);if(e.shift(),t.map.to=e.shift(),">"!==e[0])throw new Error("Unexpected token in map type: "+e[0]);e.shift(),t.name=e.shift();break;case"repeated":case"required":case"optional":var n=e.shift();t.required="required"===n,t.repeated="repeated"===n,t.type=e.shift(),t.name=e.shift();break;case"[":t.options=s(e);break;case";":if(null===t.name)throw new Error("Missing field name");if(null===t.type)throw new Error("Missing type in message field: "+t.name);if(-1===t.tag)throw new Error("Missing tag number in message field: "+t.name);return e.shift(),t;default:throw new Error("Unexpected token in message field: "+e[0])}throw new Error("No ; found for message field")},f=function(e){for(var t={enums:[],messages:[],fields:[],extends:[],extensions:null};e.length;)switch(e[0]){case"map":case"repeated":case"optional":case"required":t.fields.push(u(e));break;case"enum":t.enums.push(g(e));break;case"message":t.messages.push(h(e));break;case"extensions":t.extensions=c(e);break;case"oneof":e.shift();var n=e.shift();if("{"!==e[0])throw new Error("Unexpected token in oneof: "+e[0]);for(e.shift();"}"!==e[0];){e.unshift("optional");var r=u(e);r.oneof=n,t.fields.push(r)}e.shift();break;case"extend":t.extends.push(a(e));break;case";":e.shift();break;case"reserved":case"option":for(e.shift();";"!==e[0];)e.shift();break;default:e.unshift("optional"),t.fields.push(u(e))}return t},a=function(e){var t;return{name:e[1],message:h(e)}},c=function(e){e.shift();var t=Number(e.shift());if(isNaN(t))throw new Error("Invalid from in extensions definition");if("to"!==e.shift())throw new Error("Expected keyword 'to' in extensions definition");var n=e.shift();if("max"===n&&(n=536870911),n=Number(n),isNaN(n))throw new Error("Invalid to in extensions definition");if(";"!==e.shift())throw new Error("Missing ; in extensions definition");return{from:t,to:n}},h=function(e){e.shift();var t=1,n=[],r={name:e.shift(),enums:[],extends:[],messages:[],fields:[]};if("{"!==e[0])throw new Error("Expected { but found "+e[0]);for(e.shift();e.length;){if("{"===e[0]?t++:"}"===e[0]&&t--,!t)return e.shift(),n=f(n),r.enums=n.enums,r.messages=n.messages,r.fields=n.fields,r.extends=n.extends,r.extensions=n.extensions,r;n.push(e.shift())}if(t)throw new Error("No closing tag for message")},l=function(e){e.shift();var t=e.shift();if(";"!==e[0])throw new Error("Expected ; but found "+e[0]);return e.shift(),t},d=function(e){if(e.shift(),"="!==e[0])throw new Error("Expected = but found "+e[0]);e.shift();var t=e.shift();switch(t){case'"proto2"':t=2;break;case'"proto3"':t=3;break;default:throw new Error("Expected protobuf syntax version but found "+t)}if(";"!==e[0])throw new Error("Expected ; but found "+e[0]);return e.shift(),t},p=function(e){if(e.length<4)throw new Error("Invalid enum value: "+e.slice(0,3).join(" "));if("="!==e[1])throw new Error("Expected = but found "+e[1]);if(";"!==e[3]&&"["!==e[3])throw new Error("Expected ; or [ but found "+e[1]);var t=e.shift();e.shift();var n={value:null,options:{}};return n.value=Number(e.shift()),"["===e[0]&&(n.options=s(e)),e.shift(),{name:t,val:n}},g=function(e){e.shift();var t={},n={name:e.shift(),values:{},options:{}};if("{"!==e[0])throw new Error("Expected { but found "+e[0]);for(e.shift();e.length;){if("}"===e[0])return e.shift(),";"===e[0]&&e.shift(),n;if("option"!==e[0]){var r=p(e);n.values[r.name]=r.val}else t=m(e),n.options[t.name]=t.value}throw new Error("No closing tag for enum")},m=function(e){for(var t=null,n=null,r=function(e){return"true"===e||"false"!==e&&e.replace(/^"+|"+$/gm,"")};e.length;){if(";"===e[0])return e.shift(),{name:t,value:n};switch(e[0]){case"option":e.shift();var o="("===e[0];if(o&&e.shift(),t=e.shift(),o){if(")"!==e[0])throw new Error("Expected ) but found "+e[0]);e.shift()}"."===e[0][0]&&(t+=e.shift());break;case"=":if(e.shift(),null===t)throw new Error("Expected key for option with value: "+e[0]);if(n=r(e.shift()),"optimize_for"===t&&!/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(n))throw new Error("Unexpected value for option optimize_for: "+n);"{"===n&&(n=y(e));break;default:throw new Error("Unexpected token in option: "+e[0])}}},y=function(e){for(var t=function(e){return"true"===e||"false"!==e&&e.replace(/^"+|"+$/gm,"")},n={};e.length;){if("}"===e[0])return e.shift(),n;var r="("===e[0];r&&e.shift();var o=e.shift();if(r){if(")"!==e[0])throw new Error("Expected ) but found "+e[0]);e.shift()}var i=null;switch(e[0]){case":":if(void 0!==n[o])throw new Error("Duplicate option map key "+o);e.shift(),"{"===(i=t(e.shift()))&&(i=y(e)),n[o]=i,";"===e[0]&&e.shift();break;case"{":if(e.shift(),i=y(e),void 0===n[o]&&(n[o]=[]),!Array.isArray(n[o]))throw new Error("Duplicate option map key "+o);n[o].push(i);break;default:throw new Error("Unexpected token in option map: "+e[0])}}throw new Error("No closing tag for option map")},v=function(e){e.shift();var t=e.shift().replace(/^"+|"+$/gm,"");if(";"!==e[0])throw new Error("Unexpected token: "+e[0]+'. Expected ";"');return e.shift(),t},w=function(e){e.shift();var t={name:e.shift(),methods:[],options:{}};if("{"!==e[0])throw new Error("Expected { but found "+e[0]);for(e.shift();e.length;){if("}"===e[0])return e.shift(),";"===e[0]&&e.shift(),t;switch(e[0]){case"option":var n=m(e);if(void 0!==t.options[n.name])throw new Error("Duplicate option "+n.name);t.options[n.name]=n.value;break;case"rpc":t.methods.push(b(e));break;default:throw new Error("Unexpected token in service: "+e[0])}}throw new Error("No closing tag for service")},b=function(e){e.shift();var t={name:e.shift(),input_type:null,output_type:null,client_streaming:!1,server_streaming:!1,options:{}};if("("!==e[0])throw new Error("Expected ( but found "+e[0]);if(e.shift(),"stream"===e[0]&&(e.shift(),t.client_streaming=!0),t.input_type=e.shift(),")"!==e[0])throw new Error("Expected ) but found "+e[0]);if(e.shift(),"returns"!==e[0])throw new Error("Expected returns but found "+e[0]);if(e.shift(),"("!==e[0])throw new Error("Expected ( but found "+e[0]);if(e.shift(),"stream"===e[0]&&(e.shift(),t.server_streaming=!0),t.output_type=e.shift(),")"!==e[0])throw new Error("Expected ) but found "+e[0]);if(e.shift(),";"===e[0])return e.shift(),t;if("{"!==e[0])throw new Error("Expected { but found "+e[0]);for(e.shift();e.length;){if("}"===e[0])return e.shift(),";"===e[0]&&e.shift(),t;if("option"!==e[0])throw new Error("Unexpected token in rpc options: "+e[0]);var n=m(e);if(void 0!==t.options[n.name])throw new Error("Duplicate option "+n.name);t.options[n.name]=n.value}throw new Error("No closing tag for rpc")},E=function(e){for(var t=r(e.toString()),n=0;n<t.length;n++){var o;if(/^("|')([^'"]*)$/.test(t[n]))for(o=1===t[n].length?n+1:n;o<t.length;o++)if(/^([^'"]*)("|')$/.test(t[o])){t=t.slice(0,n).concat(t.slice(n,o+1).join("")).concat(t.slice(o+1));break}}for(var s={syntax:3,package:null,imports:[],enums:[],messages:[],options:{},extends:[]},u=!0;t.length;){switch(t[0]){case"package":s.package=l(t);break;case"syntax":if(!u)throw new Error("Protobuf syntax version should be first thing in file");s.syntax=d(t);break;case"message":s.messages.push(h(t));break;case"enum":s.enums.push(g(t));break;case"option":var f=m(t);if(s.options[f.name])throw new Error("Duplicate option "+f.name);s.options[f.name]=f.value;break;case"import":s.imports.push(v(t));break;case"extend":s.extends.push(a(t));break;case"service":s.services||(s.services=[]),s.services.push(w(t));break;default:throw new Error("Unexpected token: "+t[0])}u=!1}return s.extends.forEach(function(e){s.messages.forEach(function(t){t.name===e.name&&e.message.fields.forEach(function(e){if(!t.extensions||e.tag<t.extensions.from||e.tag>t.extensions.to)throw new Error(t.name+" does not declare "+e.tag+" as an extension number");t.fields.push(e)})})}),s.messages.forEach(function(e){e.fields.forEach(function(t){var n,r,o,u;function f(e){return e.name===t.type}function a(e){return e.name===o}if(t.options&&"true"===t.options.packed&&-1===i.indexOf(t.type)){if(-1===t.type.indexOf(".")){if(e.enums&&e.enums.some(f))return}else{if((n=t.type.split(".")).length>2)throw new Error("what is this?");if(r=n[0],o=n[1],s.messages.some(function(e){if(e.name===r)return u=e,e}),u&&u.enums&&u.enums.some(a))return}throw new Error("Fields of type "+t.type+' cannot be declared [packed=true]. Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared "packed". See https://developers.google.com/protocol-buffers/docs/encoding#optional')}})}),s};e.exports=E},"./node_modules/protocol-buffers-schema/stringify.js":function(e,t){var n=function(e,t){var n=e.repeated?"repeated":e.required?"required":"optional";"map"===e.type&&(n="map<"+e.map.from+","+e.map.to+">"),e.oneof&&(n="");var r=Object.keys(e.options||{}).map(function(t){return t+" = "+e.options[t]}).join(",");return r&&(r=" ["+r+"]"),t.push((n?n+" ":"")+("map"===e.map?"":e.type+" ")+e.name+" = "+e.tag+r+";"),t},r=function(e,t){t.push("message "+e.name+" {"),e.enums||(e.enums=[]),e.enums.forEach(function(e){t.push(o(e,[]))}),e.messages||(e.messages=[]),e.messages.forEach(function(e){t.push(r(e,[]))});var i={};return e.fields||(e.fields=[]),e.fields.forEach(function(e){e.oneof?(i[e.oneof]||(i[e.oneof]=[]),i[e.oneof].push(n(e,[]))):t.push(n(e,[]))}),Object.keys(i).forEach(function(e){i[e].unshift("oneof "+e+" {"),i[e].push("}"),t.push(i[e])}),t.push("}",""),t},o=function(e,t){t.push("enum "+e.name+" {"),e.options||(e.options={});var n=s(e.options,[]);return n.length>1&&t.push(n.slice(0,-1)),Object.keys(e.values).map(function(n){var r=i(e.values[n]);t.push([n+" = "+r+";"])}),t.push("}",""),t},i=function(e,t){var n=Object.keys(e.options||{}).map(function(t){return t+" = "+e.options[t]}).join(","),r;return n&&(n=" ["+n+"]"),e.value+n},s=function(e,t){var n=Object.keys(e);return n.forEach(function(n){var r=e[n];~n.indexOf(".")&&(n="("+n+")");var o=typeof r;"object"===o?(r=u(r,[])).length&&t.push("option "+n+" = {",r,"};"):("string"===o&&"optimize_for"!==n&&(r='"'+r+'"'),t.push("option "+n+" = "+r+";"))}),n.length>0&&t.push(""),t},u=function(e,t){var n;return Object.keys(e).forEach(function(n){var r=e[n],o=typeof r;"object"===o?Array.isArray(r)?r.forEach(function(e){(e=u(e,[])).length&&t.push(n+" {",e,"}")}):(r=u(r,[])).length&&t.push(n+" {",r,"}"):("string"===o&&(r='"'+r+'"'),t.push(n+": "+r))}),t},f=function(e,t){return t.push("service "+e.name+" {"),e.options||(e.options={}),s(e.options,t),e.methods||(e.methods=[]),e.methods.forEach(function(e){t.push(a(e,[]))}),t.push("}",""),t},a=function(e,t){var n="rpc "+e.name+"(";e.client_streaming&&(n+="stream "),n+=e.input_type+") returns (",e.server_streaming&&(n+="stream "),n+=e.output_type+")",e.options||(e.options={});var r=s(e.options,[]);return r.length>1?t.push(n+" {",r.slice(0,-1),"}"):t.push(n+";"),t},c=function(e){return function(t){return Array.isArray(t)?t.map(c(e+" ")).join("\n"):e+t}};e.exports=function(e){var t=[];return t.push('syntax = "proto'+e.syntax+'";',""),e.package&&t.push("package "+e.package+";",""),e.options||(e.options={}),s(e.options,t),e.enums||(e.enums=[]),e.enums.forEach(function(e){o(e,t)}),e.messages||(e.messages=[]),e.messages.forEach(function(e){r(e,t)}),e.services&&e.services.forEach(function(e){f(e,t)}),t.map(c("")).join("\n")}},"./node_modules/protocol-buffers-schema/tokenize.js":function(e,t){e.exports=function(e){var t=function(e){var t=e.indexOf("//");return t>-1?e.slice(0,t):e},n=function(){var e=!1;return function(t){return"/*"===t?(e=!0,!1):"*/"===t?(e=!1,!1):!e}},r=function(e){return e.trim()};return e.replace(/([;,{}()=:[\]<>]|\/\*|\*\/)/g," $1 ").split(/\n/).map(r).filter(Boolean).map(t).map(r).filter(Boolean).join("\n").split(/\s+|\n+/gm).filter(n())}},"./node_modules/protons/src/compile/decode.js":function(e,t,n){"use strict";var r=n("./node_modules/varint/index.js"),o=n("./node_modules/protons/src/compile/utils.js").defined;function i(e,t,n){for(var i=[],f={},a=[],c=[],h=0;h<n.length;h++){var l=e.fields[h];f[l.tag]=h;var d=l.options&&l.options.default,p=t(l.type,e.id,!1);c[h]=[d,p&&p.values],e.fields[h].packed=l.repeated&&l.options&&l.options.packed&&"false"!==l.options.packed,l.required&&i.push(l.name),l.oneof&&a.push(l.name)}function g(e,t,n,o,i,s){var u=t.name;if(t.oneof)for(var f=Object.keys(n),c=0;c<f.length;c++)a.indexOf(f[c])>-1&&delete n[f[c]];if(e.message){var h=r.decode(o,i);i+=r.decode.bytes;var l=e.decode(o,i,i+h);t.map?(n[u]=n[u]||{},n[u][l.key]=l.value):t.repeated?(n[u]=n[u]||[],n[u].push(l)):n[u]=l}else t.repeated?(n[u]=n[u]||[],n[u].push(e.decode(o,i))):n[u]=e.decode(o,i);return i+=e.decode.bytes}return function t(h,l,d){if(null==l&&(l=0),null==d&&(d=h.length),!(d<=h.length&&l<=h.length))throw new Error("Decoded message is not valid");for(var p=l,m={},y;;){if(d<=l){var v="",w=0,b,E;for(w=0;w<i.length;w++)if(v=i[w],!o(m[v]))throw new Error("Decoded message is not valid, missing required field: "+v);for(w=0;w<n.length;w++)if(y=e.fields[w],E=c[w][0],b=c[w][1],v=y.name,!o(m[v])){var x=!1;if(y.oneof)for(var _=Object.keys(m),k=0;k<_.length;k++)if(a.indexOf(_[k])>-1){x=!0;break}x||(b?y.repeated?m[v]=[]:(E=E&&b[E]?b[E].value:b[Object.keys(b)[0]].value,m[v]=parseInt(E||0,10)):m[v]=u(y,E))}return t.bytes=l-p,m}var A=r.decode(h,l);l+=r.decode.bytes;var j,T=f[A>>3];if(null!=T){var R=n[T];if((y=e.fields[T]).packed){var U=r.decode(h,l);for(U+=l+=r.decode.bytes;l<U;)l=g(R,y,m,h,l,T)}else l=g(R,y,m,h,l,T)}else l=s(7&A,h,l)}}}var s=function(e,t,n){switch(e){case 0:return r.decode(t,n),n+r.decode.bytes;case 1:return n+8;case 2:var o=r.decode(t,n);return n+r.decode.bytes+o;case 3:case 4:throw new Error("Groups are not supported");case 5:return n+4;default:throw new Error("Unknown wire type: "+e)}},u=function(e,t){if(e.map)return{};if(e.repeated)return[];switch(e.type){case"string":return null!=t?t:"";case"bool":return"true"===t;case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return parseInt(t||0,10);default:return null}};e.exports=i},"./node_modules/protons/src/compile/encode.js":function(e,t,n){"use strict";(function(t){var r=n("./node_modules/protons/src/compile/utils.js").defined,o=n("./node_modules/varint/index.js");function i(e,n,i,s,u){for(var f=Object.keys(s),a=i.length,c={},h=0;h<a;h++){c[h]={p:o.encode(e.fields[h].tag<<3|2),h:o.encode(e.fields[h].tag<<3|i[h].type)};var l=e.fields[h];e.fields[h].packed=l.repeated&&l.options&&l.options.packed&&"false"!==l.options.packed}function d(e,t,n,r,i,s){var u=0;if(!i)for(u=0;u<n.length;u++)e[t++]=n[u];return r.message&&(o.encode(r.encodingLength(s),e,t),t+=o.encode.bytes),r.encode(s,e,t),t+r.encode.bytes}return function n(h,l,p){null==p&&(p=0),null==l&&(l=t.allocUnsafe(u(h)));var g=p,m=Object.keys(h),y=0,v=!1;for(y=0;y<f.length;y++){var w=f[y],b=s[y];if(m.indexOf(b)>-1){if(v)throw new Error("only one of the properties defined in oneof "+w+" can be set");v=!0}}for(y=0;y<a;y++){var E=i[y],x=e.fields[y],_=h[x.name],k=0;if(r(_)){var A=c[y].p,j=c[y].h,T=x.packed,R;if(x.map){var U=Object.keys(_);for(k=0;k<U.length;k++)U[k]={key:U[k],value:_[U[k]]};_=U}if(T){var S=0;for(k=0;k<_.length;k++)r(_[k])&&(S+=E.encodingLength(_[k]));if(S){for(k=0;k<j.length;k++)l[p++]=A[k];o.encode(S,l,p),p+=o.encode.bytes}}if(x.repeated)for(k=0;k<_.length;k++)R=_[k],r(R)&&(p=d(l,p,j,E,T,R));else p=d(l,p,j,E,T,_)}else if(x.required)throw new Error(x.name+" is required")}return n.bytes=p-g,l}}e.exports=i}).call(this,n("./node_modules/buffer/index.js").Buffer)},"./node_modules/protons/src/compile/encoding-length.js":function(e,t,n){"use strict";var r=n("./node_modules/protons/src/compile/utils.js").defined,o=n("./node_modules/varint/index.js");function i(e,t,n){for(var i=Object.keys(n),s=t.length,u=new Array(s),f=0;f<e.fields.length;f++){u[f]=o.encodingLength(e.fields[f].tag<<3|t[f].type);var a=e.fields[f];e.fields[f].packed=a.repeated&&a.options&&a.options.packed&&"false"!==a.options.packed}return function f(a){var c=0,h=0,l=0;for(h=0;h<i.length;h++){var d=i[h],p=n[d],g=!1;for(l=0;l<p.length;l++)if(r(a[p[l]])){if(g)throw new Error("only one of the properties defined in oneof "+d+" can be set");g=!0}}for(h=0;h<s;h++){var m=t[h],y=e.fields[h],v=a[y.name],w=u[h],b;if(r(v)){if(y.map){var E=Object.keys(v);for(l=0;l<E.length;l++)E[l]={key:E[l],value:v[E[l]]};v=E}if(y.packed){var x=0;for(l=0;l<v.length;l++)r(v[l])&&(x+=b=m.encodingLength(v[l]),m.message&&(x+=o.encodingLength(b)));x&&(c+=w+x+o.encodingLength(x))}else if(y.repeated)for(l=0;l<v.length;l++)r(v[l])&&(c+=w+(b=m.encodingLength(v[l]))+(m.message?o.encodingLength(b):0));else c+=w+(b=m.encodingLength(v))+(m.message?o.encodingLength(b):0)}else if(y.required)throw new Error(y.name+" is required")}return c}}e.exports=i},"./node_modules/protons/src/compile/encodings.js":function(e,t,n){"use strict";var r=n("./node_modules/varint/index.js"),o=n("./node_modules/signed-varint/index.js"),i=n("./node_modules/safe-buffer/index.js").Buffer,s=function(e,t,n,r){return t.bytes=n.bytes=0,{type:e,encode:t,decode:n,encodingLength:r}},u,f,a,c,h;t.make=s,t.bytes=(f=function(e){return i.isBuffer(e)?e.length:i.byteLength(e)},s(2,c=function(e,t,n){var o=n,s=f(e);return r.encode(s,t,n),n+=r.encode.bytes,i.isBuffer(e)?e.copy(t,n):t.write(e,n,s),n+=s,c.bytes=n-o,t},h=function(e,t){var n=t,o=r.decode(e,t);t+=r.decode.bytes;var i=e.slice(t,t+o);return t+=i.length,h.bytes=t-n,i},function(e){var t=f(e);return r.encodingLength(t)+t})),t.string=function(){var e,t=function(e,n,o){var s=o,u=i.byteLength(e);return r.encode(u,n,o,"utf-8"),o+=r.encode.bytes,n.write(e,o,u),o+=u,t.bytes=o-s,n},n=function(e,t){var o=t,i=r.decode(e,t);t+=r.decode.bytes;var s=e.toString("utf-8",t,t+i);return t+=i,n.bytes=t-o,s};return s(2,t,n,function(e){var t=i.byteLength(e);return r.encodingLength(t)+t})}(),t.bool=function(){var e,t=function(e,n,r){return n[r]=e?1:0,t.bytes=1,n},n=function(e,t){var r=e[t]>0;return n.bytes=1,r};return s(0,t,n,function(e){return 1})}(),t.int32=function(){var e=function(t,n){var o=r.decode(t,n);return e.bytes=r.decode.bytes,o>2147483647?o-4294967296:o},t=function(e,n,o){return r.encode(e<0?e+4294967296:e,n,o),t.bytes=r.encode.bytes,n},n=function(e){return r.encodingLength(e<0?e+4294967296:e)};return s(0,r.encode,e,n)}(),t.int64=function(){var e=function(t,n){var o=r.decode(t,n);if(o>=Math.pow(2,63)){for(var s=9;255===t[n+s-1];)s--;s=s||9;var u=i.allocUnsafe(s);t.copy(u,0,n,n+s),u[s-1]=127&u[s-1],o=-1*r.decode(u,0),e.bytes=10}else e.bytes=r.decode.bytes;return o},t=function(e,n,o){if(e<0){var i=o+9;for(r.encode(-1*e,n,o),n[o+=r.encode.bytes-1]=128|n[o];o<i-1;)n[++o]=255;n[i]=1,t.bytes=10}else r.encode(e,n,o),t.bytes=r.encode.bytes;return n},n;return s(0,t,e,function(e){return e<0?10:r.encodingLength(e)})}(),t.sint32=t.sint64=s(0,o.encode,o.decode,o.encodingLength),t.uint32=t.uint64=t.enum=t.varint=s(0,r.encode,r.decode,r.encodingLength),t.fixed64=t.sfixed64=function(){var e,t=function(e,n,r){return e.copy(n,r),t.bytes=8,n},n=function(e,t){var r=e.slice(t,t+8);return n.bytes=8,r};return s(1,t,n,function(e){return 8})}(),t.double=function(){var e,t=function(e,n,r){return n.writeDoubleLE(e,r),t.bytes=8,n},n=function(e,t){var r=e.readDoubleLE(t);return n.bytes=8,r};return s(1,t,n,function(e){return 8})}(),t.fixed32=function(){var e,t=function(e,n,r){return n.writeUInt32LE(e,r),t.bytes=4,n},n=function(e,t){var r=e.readUInt32LE(t);return n.bytes=4,r};return s(5,t,n,function(e){return 4})}(),t.sfixed32=function(){var e,t=function(e,n,r){return n.writeInt32LE(e,r),t.bytes=4,n},n=function(e,t){var r=e.readInt32LE(t);return n.bytes=4,r};return s(5,t,n,function(e){return 4})}(),t.float=function(){var e,t=function(e,n,r){return n.writeFloatLE(e,r),t.bytes=4,n},n=function(e,t){var r=e.readFloatLE(t);return n.bytes=4,r};return s(5,t,n,function(e){return 4})}()},"./node_modules/protons/src/compile/index.js":function(e,t,n){"use strict";var r=n("./node_modules/protons/src/compile/encodings.js"),o=n("./node_modules/protons/src/compile/decode.js"),i=n("./node_modules/protons/src/compile/encode.js"),s=n("./node_modules/protons/src/compile/encoding-length.js"),u=n("./node_modules/varint/index.js"),f=function(e){if(!e)return null;var t={};return Object.keys(e).forEach(function(n){t[n]=e[n].value}),t};e.exports=function(e,t){var n={},a={},c={},h=function(e,t){e.enums&&e.enums.forEach(function(e){e.id=t+(t?".":"")+e.name,a[e.id]=e,h(e,e.id)}),e.messages&&e.messages.forEach(function(r){r.id=t+(t?".":"")+r.name,n[r.id]=r,r.fields.forEach(function(r){if(r.map){var o="Map_"+r.map.from+"_"+r.map.to,i={name:o,enums:[],messages:[],fields:[{name:"key",type:r.map.from,tag:1,repeated:!1,required:!0},{name:"value",type:r.map.to,tag:2,repeated:!1,required:!1}],extensions:null,id:t+(t?".":"")+o};n[i.id]||(n[i.id]=i,e.messages.push(i)),r.type=o,r.repeated=!0}}),h(r,r.id)})};h(e,"");var l=function(e){var t=Object.keys(e.values||[]).map(function(t){return parseInt(e.values[t].value,10)}),n=function e(n,r,o){if(!t.length||-1===t.indexOf(n))throw new Error("Invalid enum value: "+n);return u.encode(n,r,o),e.bytes=u.encode.bytes,r},o=function e(n,r){var o=u.decode(n,r);if(!t.length||-1===t.indexOf(o))throw new Error("Invalid enum value: "+o);return e.bytes=u.decode.bytes,o};return r.make(0,n,o,u.encodingLength)},d=function(e,t){e.messages.forEach(function(n){t[n.name]=p(n.name,e.id)}),e.enums.forEach(function(e){t[e.name]=f(e.values)}),t.type=2,t.message=!0,t.name=e.name;var n={};e.fields.forEach(function(e){e.oneof&&(n[e.oneof]||(n[e.oneof]=[]),n[e.oneof].push(e.name))});var r=e.fields.map(function(t){return p(t.type,e.id)}),u=s(e,r,n),a=i(e,p,r,n,u),c=o(e,p,r);return a.bytes=c.bytes=0,t.buffer=!0,t.encode=a,t.decode=c,t.encodingLength=u,t},p=function(e,o,i){if(t&&t[e])return t[e];if(r[e])return r[e];var s=(o?o+"."+e:e).split(".").map(function(t,n,r){return r.slice(0,n).concat(e).join(".")}).reverse().reduce(function(e,t){return e||n[t]||a[t]},null),u;if(!1===i)return s;if(!s)throw new Error("Could not resolve "+e);return s.values?l(s):c[s.id]||d(s,c[s.id]={})};return(e.enums||[]).concat((e.messages||[]).map(function(e){return p(e.id)}))}},"./node_modules/protons/src/compile/utils.js":function(e,t,n){"use strict";t.defined=function(e){return null!==e&&void 0!==e&&("number"!=typeof e||!isNaN(e))}},"./node_modules/protons/src/index.js":function(e,t,n){"use strict";(function(t){var r=n("./node_modules/protocol-buffers-schema/index.js"),o=n("./node_modules/protons/src/compile/index.js"),i=function(e){if(!e)return null;var t={};return Object.keys(e).forEach(function(n){t[n]=e[n].value}),t};e.exports=function(e,n){if(n||(n={}),!e)throw new Error("Pass in a .proto string or a protobuf-schema parsed object");var s="object"!=typeof e||t.isBuffer(e)?r.parse(e):e,u=function(){var e=this;o(s,n.encodings||{}).forEach(function(t){e[t.name]=i(t.values)||t})};return u.prototype.toString=function(){return r.stringify(s)},u.prototype.toJSON=function(){return s},new u}}).call(this,n("./node_modules/buffer/index.js").Buffer)},"./node_modules/safe-buffer/index.js":function(e,t,n){var r=n("./node_modules/buffer/index.js"),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s),i(o,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},"./node_modules/signed-varint/index.js":function(e,t,n){var r=n("./node_modules/varint/index.js");t.encode=function e(t,n,o){t=t>=0?2*t:-2*t-1;var i=r.encode(t,n,o);return e.bytes=r.encode.bytes,i},t.decode=function e(t,n){var o=r.decode(t,n);return e.bytes=r.decode.bytes,1&o?(o+1)/-2:o/2},t.encodingLength=function(e){return r.encodingLength(e>=0?2*e:-2*e-1)}},"./node_modules/varint/decode.js":function(e,t){e.exports=o;var n=128,r=127;function o(e,t){var i=0,t,s=0,u=t=t||0,f,a=e.length;do{if(u>=a)throw o.bytes=0,new RangeError("Could not decode varint");f=e[u++],i+=s<28?(f&r)<<s:(f&r)*Math.pow(2,s),s+=7}while(f>=n);return o.bytes=u-t,i}},"./node_modules/varint/encode.js":function(e,t){e.exports=s;var n=128,r=127,o=-128,i=Math.pow(2,31);function s(e,t,r){t=t||[];for(var u=r=r||0;e>=i;)t[r++]=255&e|n,e/=128;for(;e&o;)t[r++]=255&e|n,e>>>=7;return t[r]=0|e,s.bytes=r-u+1,t}},"./node_modules/varint/index.js":function(e,t,n){e.exports={encode:n("./node_modules/varint/encode.js"),decode:n("./node_modules/varint/decode.js"),encodingLength:n("./node_modules/varint/length.js")}},"./node_modules/varint/length.js":function(e,t){var n=Math.pow(2,7),r=Math.pow(2,14),o=Math.pow(2,21),i=Math.pow(2,28),s=Math.pow(2,35),u=Math.pow(2,42),f=Math.pow(2,49),a=Math.pow(2,56),c=Math.pow(2,63);e.exports=function(e){return e<n?1:e<r?2:e<o?3:e<i?4:e<s?5:e<u?6:e<f?7:e<a?8:e<c?9:10}},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},"./src/index.js":function(e,t,n){"use strict";const r=n("./node_modules/protons/src/index.js"),o=r(n("./src/unixfs.proto.js")),i=o.Data,s=["raw","directory","file","metadata","symlink","hamt-sharded-directory"],u=["directory","hamt-sharded-directory"];function f(e,t){if(!(this instanceof f))return new f(e,t);if(-1===s.indexOf(e))throw new Error("Type: "+e+" is not valid");this.type=e,this.data=t,this.blockSizes=[],this.addBlockSize=(e=>{this.blockSizes.push(e)}),this.removeBlockSize=(e=>{this.blockSizes.splice(e,1)}),this.fileSize=(()=>{if(u.indexOf(this.type)>=0)return;let e=0;return this.blockSizes.forEach(t=>{e+=t}),t&&(e+=t.length),e}),this.marshal=(()=>{let e;switch(this.type){case"raw":e=i.DataType.Raw;break;case"directory":e=i.DataType.Directory;break;case"file":e=i.DataType.File;break;case"metadata":e=i.DataType.Metadata;break;case"symlink":e=i.DataType.Symlink;break;case"hamt-sharded-directory":e=i.DataType.HAMTShard;break;default:throw new Error(`Unkown type: "${this.type}"`)}let t=this.fileSize(),n=this.data;this.data&&this.data.length||(n=void 0);let r=this.blockSizes;return this.blockSizes&&this.blockSizes.length||(r=void 0),i.encode({Type:e,Data:n,filesize:t,blocksizes:r,hashType:this.hashType,fanout:this.fanout})})}f.unmarshal=(e=>{const t=i.decode(e);t.Data||(t.Data=void 0);const n=new f(s[t.Type],t.Data);return n.blockSizes=t.blocksizes,n}),t=e.exports=f},"./src/unixfs.proto.js":function(e,t,n){"use strict";e.exports="message Data {\n enum DataType {\n Raw = 0;\n Directory = 1;\n File = 2;\n Metadata = 3;\n Symlink = 4;\n HAMTShard = 5;\n }\n\n required DataType Type = 1;\n optional bytes Data = 2;\n optional uint64 filesize = 3;\n repeated uint64 blocksizes = 4;\n\n optional uint64 hashType = 5;\n optional uint64 fanout = 6;\n}\n\nmessage Metadata {\n optional string MimeType = 1;\n}"},0:function(e,t,n){e.exports=n("./src/index.js")}}); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "ipfs-unixfs", | ||
"version": "0.1.15", | ||
"version": "0.1.16", | ||
"description": "JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a MerkleDAG)", | ||
@@ -39,15 +39,9 @@ "leadMaintainer": "Alex Potsides <alex.potsides@protocol.ai>", | ||
"devDependencies": { | ||
"aegir": "^14.0.0", | ||
"chai": "^4.1.2", | ||
"dirty-chai": "^2.0.1", | ||
"pre-commit": "^1.2.2", | ||
"safe-buffer": "^5.1.1" | ||
"aegir": "^17.0.0", | ||
"chai": "^4.2.0", | ||
"dirty-chai": "^2.0.1" | ||
}, | ||
"dependencies": { | ||
"protons": "^1.0.0" | ||
"protons": "^1.0.1" | ||
}, | ||
"pre-commit": [ | ||
"lint", | ||
"test" | ||
], | ||
"contributors": [ | ||
@@ -54,0 +48,0 @@ "David Dias <daviddias.p@gmail.com>", |
@@ -6,11 +6,10 @@ # ipfs-unixfs JavaScript Implementation | ||
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) | ||
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) | ||
[![Build Status](https://travis-ci.org/ipfs/js-ipfs-unixfs.svg?style=flat-square&branch=master)](https://travis-ci.org/ipfs/js-ipfs-unixfs) | ||
[![Coverage Status](https://coveralls.io/repos/github/ipfs/js-ipfs-unixfs/badge.svg?branch=master)](https://coveralls.io/github/ipfs/js-ipfs-unixfs?branch=master) | ||
[![Dependency Status](https://david-dm.org/ipfs/js-ipfs-unixfs.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs-unixfs) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) | ||
[![Jenkins](https://ci.ipfs.team/buildStatus/icon?job=ipfs/js-ipfs-unixfs/master)](https://ci.ipfs.team/job/ipfs/job/js-ipfs-unixfs/job/master/) | ||
[![Codecov](https://codecov.io/gh/ipfs/js-ipfs-unixfs/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/js-ipfs-unixfs) | ||
[![Deps](https://david-dm.org/ipfs/js-ipfs-unixfs.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs-unixfs) | ||
[![Style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) | ||
![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square) | ||
![](https://img.shields.io/badge/Node.js-%3E%3D4.0.0-orange.svg?style=flat-square) | ||
![](https://img.shields.io/badge/Node.js-%3E%3D8.0.0-orange.svg?style=flat-square) | ||
> JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a MerkleDAG) | ||
> JavaScript implementation of IPFS' unixfs (a Unix FileSystem files representation on top of a MerkleDAG) | ||
@@ -17,0 +16,0 @@ [The unixfs spec can be found inside the ipfs/specs repository](http://github.com/ipfs/specs) |
Sorry, the diff of this file is too big to display
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
417708
3
4284
0
20
165
Updatedprotons@^1.0.1