UNPKG

kontainer-js

Version:

A media file format generator/parser that exposes a React-like API.

2 lines 437 kB
!function e(t,r,n){function o(a,u){if(!r[a]){if(!t[a]){var l="function"==typeof require&&require;if(!u&&l)return l(a,!0);if(i)return i(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){var r=t[a][1][e];return o(r?r:e)},c,c.exports,e,t,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,t,r){"use strict";function n(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;r>t;++t)l[t]=e[t],f[e.charCodeAt(t)]=t;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63}function o(e){var t,r,n,o,i,a,u=e.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i="="===e[u-2]?2:"="===e[u-1]?1:0,a=new c(3*u/4-i),n=i>0?u-4:u;var l=0;for(t=0,r=0;n>t;t+=4,r+=3)o=f[e.charCodeAt(t)]<<18|f[e.charCodeAt(t+1)]<<12|f[e.charCodeAt(t+2)]<<6|f[e.charCodeAt(t+3)],a[l++]=o>>16&255,a[l++]=o>>8&255,a[l++]=255&o;return 2===i?(o=f[e.charCodeAt(t)]<<2|f[e.charCodeAt(t+1)]>>4,a[l++]=255&o):1===i&&(o=f[e.charCodeAt(t)]<<10|f[e.charCodeAt(t+1)]<<4|f[e.charCodeAt(t+2)]>>2,a[l++]=o>>8&255,a[l++]=255&o),a}function i(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function a(e,t,r){for(var n,o=[],a=t;r>a;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(i(n));return o.join("")}function u(e){for(var t,r=e.length,n=r%3,o="",i=[],u=16383,f=0,c=r-n;c>f;f+=u)i.push(a(e,f,f+u>c?c:f+u));return 1===n?(t=e[r-1],o+=l[t>>2],o+=l[t<<4&63],o+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],o+=l[t>>10],o+=l[t>>4&63],o+=l[t<<2&63],o+="="),i.push(o),i.join("")}r.toByteArray=o,r.fromByteArray=u;var l=[],f=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],2:[function(e,t,r){},{}],3:[function(e,t,r){(function(t){"use strict";function n(){try{var e=new Uint8Array(1);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}function o(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=a.prototype):(null===e&&(e=new a(t)),e.length=t),e}function a(e,t,r){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(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 c(this,e)}return u(this,e,t,r)}function u(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?d(e,t,r,n):"string"==typeof t?s(e,t,r):y(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number')}function f(e,t,r,n){return l(t),0>=t?i(e,t):void 0!==r?"string"==typeof n?i(e,t).fill(r,n):i(e,t).fill(r):i(e,t)}function c(e,t){if(l(t),e=i(e,0>t?0:0|h(t)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;t>r;r++)e[r]=0;return e}function s(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(t,r);return e=i(e,n),e.write(t,r),e}function p(e,t){var r=0|h(t.length);e=i(e,r);for(var n=0;r>n;n+=1)e[n]=255&t[n];return e}function d(e,t,r,n){if(t.byteLength,0>r||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===n?new Uint8Array(t,r):new Uint8Array(t,r,n),a.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=a.prototype):e=p(e,t),e}function y(e,t){if(a.isBuffer(t)){var r=0|h(t.length);return e=i(e,r),0===e.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||G(t.length)?i(e,0):p(e,t);if("Buffer"===t.type&&J(t.data))return p(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function h(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function b(e){return+e!=e&&(e=0),a.alloc(+e)}function v(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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":case void 0:return Q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return Q(e).length;t=(""+t).toLowerCase(),n=!0}}function E(e,t,r){var n=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if(r>>>=0,t>>>=0,t>=r)return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return j(this,t,r);case"ascii":return N(this,t,r);case"binary":return L(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function O(e,t,r,n){function o(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}var i=1,a=e.length,u=t.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,a/=2,u/=2,r/=2}for(var l=-1,f=0;a>r+f;f++)if(o(e,r+f)===o(t,-1===l?0:f-l)){if(-1===l&&(l=f),f-l+1===u)return(r+l)*i}else-1!==l&&(f-=f-l),l=-1;return-1}function _(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;var i=t.length;if(i%2!==0)throw new Error("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;n>a;a++){var u=parseInt(t.substr(2*a,2),16);if(isNaN(u))return a;e[r+a]=u}return a}function T(e,t,r,n){return H(Q(t,e.length-r),e,r,n)}function w(e,t,r,n){return H(W(t),e,r,n)}function g(e,t,r,n){return w(e,t,r,n)}function P(e,t,r,n){return H(V(t),e,r,n)}function M(e,t,r,n){return H(X(t,e.length-r),e,r,n)}function C(e,t,r){return 0===t&&r===e.length?Z.fromByteArray(e):Z.fromByteArray(e.slice(t,r))}function j(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;r>o;){var i=e[o],a=null,u=i>239?4:i>223?3:i>191?2:1;if(r>=o+u){var l,f,c,s;switch(u){case 1:128>i&&(a=i);break;case 2:l=e[o+1],128===(192&l)&&(s=(31&i)<<6|63&l,s>127&&(a=s));break;case 3:l=e[o+1],f=e[o+2],128===(192&l)&&128===(192&f)&&(s=(15&i)<<12|(63&l)<<6|63&f,s>2047&&(55296>s||s>57343)&&(a=s));break;case 4:l=e[o+1],f=e[o+2],c=e[o+3],128===(192&l)&&128===(192&f)&&128===(192&c)&&(s=(15&i)<<18|(63&l)<<12|(63&f)<<6|63&c,s>65535&&1114112>s&&(a=s))}}null===a?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=u}return A(n)}function A(e){var t=e.length;if($>=t)return String.fromCharCode.apply(String,e);for(var r="",n=0;t>n;)r+=String.fromCharCode.apply(String,e.slice(n,n+=$));return r}function N(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;r>o;o++)n+=String.fromCharCode(127&e[o]);return n}function L(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;r>o;o++)n+=String.fromCharCode(e[o]);return n}function S(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var o="",i=t;r>i;i++)o+=q(e[i]);return o}function B(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 x(e,t,r){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,r,n,o,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||i>t)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function k(e,t,r,n){0>t&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-r,2);i>o;o++)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function R(e,t,r,n){0>t&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-r,4);i>o;o++)e[r+o]=t>>>8*(n?o:3-o)&255}function D(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function U(e,t,r,n,o){return o||D(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),K.write(e,t,r,n,23,4),r+4}function z(e,t,r,n,o){return o||D(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),K.write(e,t,r,n,52,8),r+8}function Y(e){if(e=F(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function F(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return 16>e?"0"+e.toString(16):e.toString(16)}function Q(e,t){t=t||1/0;for(var r,n=e.length,o=null,i=[],a=0;n>a;a++){if(r=e.charCodeAt(a),r>55295&&57344>r){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(56320>r){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,128>r){if((t-=1)<0)break;i.push(r)}else if(2048>r){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(65536>r){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))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 W(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t}function X(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);a++)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function V(e){return Z.toByteArray(Y(e))}function H(e,t,r,n){for(var o=0;n>o&&!(o+r>=t.length||o>=e.length);o++)t[o+r]=e[o];return o}function G(e){return e!==e}var Z=e("base64-js"),K=e("ieee754"),J=e("isarray");r.Buffer=a,r.SlowBuffer=b,r.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=o(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,r){return u(null,e,t,r)},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,r){return f(null,e,t,r)},a.allocUnsafe=function(e){return c(null,e)},a.allocUnsafeSlow=function(e){return c(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);i>o;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return n>r?-1:r>n?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!J(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;r++)t+=e[r].length;var n=a.allocUnsafe(t),o=0;for(r=0;r<e.length;r++){var i=e[r];if(!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},a.byteLength=v,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;e>t;t+=2)m(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;e>t;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},a.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?j(this,0,e):E.apply(this,arguments)},a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},a.prototype.compare=function(e,t,r,n,o){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),0>t||r>e.length||0>n||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;for(var i=o-n,u=r-t,l=Math.min(i,u),f=this.slice(n,o),c=e.slice(t,r),s=0;l>s;++s)if(f[s]!==c[s]){i=f[s],u=c[s];break}return u>i?-1:i>u?1:0},a.prototype.indexOf=function(e,t,r){if("string"==typeof t?(r=t,t=0):t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(0>t&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:O(this,e,t,r);if("number"==typeof e)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):O(this,[e],t,r);throw new TypeError("val must be string, number or Buffer")},a.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(0>r||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return T(this,e,t,r);case"ascii":return w(this,e,t,r);case"binary":return g(this,e,t,r);case"base64":return P(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),e>t&&(t=e);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=a.prototype;else{var o=t-e;n=new a(o,void 0);for(var i=0;o>i;i++)n[i]=this[i+e]}return n},a.prototype.readUIntLE=function(e,t,r){e=0|e,t=0|t,r||x(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},a.prototype.readUIntBE=function(e,t,r){e=0|e,t=0|t,r||x(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},a.prototype.readUInt8=function(e,t){return t||x(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||x(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||x(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e=0|e,t=0|t,r||x(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e=0|e,t=0|t,r||x(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},a.prototype.readInt8=function(e,t){return t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||x(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){t||x(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||x(e,4,this.length),K.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||x(e,4,this.length),K.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||x(e,8,this.length),K.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||x(e,8,this.length),K.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=0|t,r=0|r,!n){var o=Math.pow(2,8*r)-1;I(this,e,t,r,o,0)}var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},a.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t=0|t,r=0|r,!n){var o=Math.pow(2,8*r)-1;I(this,e,t,r,o,0)}var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t=0|t,r||I(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=0|t,r||I(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=0|t,r||I(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=0|t,r||I(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=0|t,r||I(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=0|t,!n){var o=Math.pow(2,8*r-1);I(this,e,t,r,o-1,-o)}var i=0,a=1,u=0;for(this[t]=255&e;++i<r&&(a*=256);)0>e&&0===u&&0!==this[t+i-1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=0|t,!n){var o=Math.pow(2,8*r-1);I(this,e,t,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)0>e&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t=0|t,r||I(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t=0|t,r||I(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t=0|t,r||I(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t=0|t,r||I(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t=0|t,r||I(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return z(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return z(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&r>n&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o,i=n-r;if(this===e&&t>r&&n>t)for(o=i-1;o>=0;o--)e[o+t]=this[o+r];else if(1e3>i||!a.TYPED_ARRAY_SUPPORT)for(o=0;i>o;o++)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var o=e.charCodeAt(0);256>o&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e=255&e);if(0>t||this.length<t||this.length<r)throw new RangeError("Out of range index");if(t>=r)return this;t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var i;if("number"==typeof e)for(i=t;r>i;i++)this[i]=e;else{var u=a.isBuffer(e)?e:Q(new a(e,n).toString()),l=u.length;for(i=0;r-t>i;i++)this[i+t]=u[i%l]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":1,ieee754:6,isarray:9}],4:[function(e,t,r){(function(e){function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===b(e)}function n(e){return"boolean"==typeof e}function o(e){return null===e}function i(e){return null==e}function a(e){return"number"==typeof e}function u(e){return"string"==typeof e}function l(e){return"symbol"==typeof e}function f(e){return void 0===e}function c(e){return"[object RegExp]"===b(e)}function s(e){return"object"==typeof e&&null!==e}function p(e){return"[object Date]"===b(e)}function d(e){return"[object Error]"===b(e)||e instanceof Error}function y(e){return"function"==typeof e}function h(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function b(e){return Object.prototype.toString.call(e)}r.isArray=t,r.isBoolean=n,r.isNull=o,r.isNullOrUndefined=i,r.isNumber=a,r.isString=u,r.isSymbol=l,r.isUndefined=f,r.isRegExp=c,r.isObject=s,r.isDate=p,r.isError=d,r.isFunction=y,r.isPrimitive=h,r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":8}],5:[function(e,t,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function o(e){return"function"==typeof e}function i(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function u(e){return void 0===e}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,r,n,i,l,f;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[e],u(r))return!1;if(o(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(a(r))for(i=Array.prototype.slice.call(arguments,1),f=r.slice(),n=f.length,l=0;n>l;l++)f[l].apply(this,i);return!0},n.prototype.addListener=function(e,t){var r;if(!o(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,o(t.listener)?t.listener:t),this._events[e]?a(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,a(this._events[e])&&!this._events[e].warned&&(r=u(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}if(!o(t))throw TypeError("listener must be a function");var n=!1;return r.listener=t,this.on(e,r),this},n.prototype.removeListener=function(e,t){var r,n,i,u;if(!o(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],i=r.length,n=-1,r===t||o(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(u=i;u-- >0;)if(r[u]===t||r[u].listener&&r[u].listener===t){n=u;break}if(0>n)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],o(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?o(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(o(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},{}],6:[function(e,t,r){r.read=function(e,t,r,n,o){var i,a,u=8*o-n-1,l=(1<<u)-1,f=l>>1,c=-7,s=r?o-1:0,p=r?-1:1,d=e[t+s];for(s+=p,i=d&(1<<-c)-1,d>>=-c,c+=u;c>0;i=256*i+e[t+s],s+=p,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+s],s+=p,c-=8);if(0===i)i=1-f;else{if(i===l)return a?NaN:(d?-1:1)*(1/0);a+=Math.pow(2,n),i-=f}return(d?-1:1)*a*Math.pow(2,i-n)},r.write=function(e,t,r,n,o,i){var a,u,l,f=8*i-o-1,c=(1<<f)-1,s=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,y=n?1:-1,h=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),t+=a+s>=1?p/l:p*Math.pow(2,1-s),t*l>=2&&(a++,l/=2),a+s>=c?(u=0,a=c):a+s>=1?(u=(t*l-1)*Math.pow(2,o),a+=s):(u=t*Math.pow(2,s-1)*Math.pow(2,o),a=0));o>=8;e[r+d]=255&u,d+=y,u/=256,o-=8);for(a=a<<o|u,f+=o;f>0;e[r+d]=255&a,d+=y,a/=256,f-=8);e[r+d-y]|=128*h}},{}],7:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],8:[function(e,t,r){t.exports=function(e){return!(null==e||!(e._isBuffer||e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)))}},{}],9:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],10:[function(e,t,r){(function(e){"use strict";function r(t,r,n,o){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var i,a,u=arguments.length;switch(u){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,r)});case 3:return e.nextTick(function(){t.call(null,r,n)});case 4:return e.nextTick(function(){t.call(null,r,n,o)});default:for(i=new Array(u-1),a=0;a<i.length;)i[a++]=arguments[a];return e.nextTick(function(){t.apply(null,i)})}}!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports=r:t.exports=e.nextTick}).call(this,e("_process"))},{_process:11}],11:[function(e,t,r){function n(){c&&u&&(c=!1,u.length?f=u.concat(f):s=-1,f.length&&o())}function o(){if(!c){var e=setTimeout(n);c=!0;for(var t=f.length;t;){for(u=f,f=[];++s<t;)u&&u[s].run();s=-1,t=f.length}u=null,c=!1,clearTimeout(e)}}function i(e,t){this.fun=e,this.array=t}function a(){}var u,l=t.exports={},f=[],c=!1,s=-1;l.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];f.push(new i(e,t)),1!==f.length||c||setTimeout(o,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=a,l.addListener=a,l.once=a,l.off=a,l.removeListener=a,l.removeAllListeners=a,l.emit=a,l.binding=function(e){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(e){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},{}],12:[function(e,t,r){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":13}],13:[function(e,t,r){"use strict";function n(e){return this instanceof n?(f.call(this,e),c.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",o)):new n(e)}function o(){this.allowHalfOpen||this._writableState.ended||u(i,this)}function i(e){e.end()}var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=n;var u=e("process-nextick-args"),l=e("core-util-is");l.inherits=e("inherits");var f=e("./_stream_readable"),c=e("./_stream_writable");l.inherits(n,f);for(var s=a(c.prototype),p=0;p<s.length;p++){var d=s[p];n.prototype[d]||(n.prototype[d]=c.prototype[d])}},{"./_stream_readable":15,"./_stream_writable":17,"core-util-is":4,inherits:7,"process-nextick-args":10}],14:[function(e,t,r){"use strict";function n(e){return this instanceof n?void o.call(this,e):new n(e)}t.exports=n;var o=e("./_stream_transform"),i=e("core-util-is");i.inherits=e("inherits"),i.inherits(n,o),n.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":16,"core-util-is":4,inherits:7}],15:[function(e,t,r){(function(r){"use strict";function n(t,r){x=x||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,r instanceof x&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,o=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:o,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(B||(B=e("string_decoder/").StringDecoder),this.decoder=new B(t.encoding),this.encoding=t.encoding)}function o(t){return x=x||e("./_stream_duplex"),this instanceof o?(this._readableState=new n(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),void j.call(this)):new o(t)}function i(e,t,r,n,o){var i=f(t,r);if(i)e.emit("error",i);else if(null===r)t.reading=!1,c(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!o){var u=new Error("stream.push() after EOF");e.emit("error",u)}else if(t.endEmitted&&o){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else{var l;!t.decoder||o||n||(r=t.decoder.write(r),l=!t.objectMode&&0===r.length),o||(t.reading=!1),l||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,o?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&s(e))),d(e,t)}else o||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function u(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function l(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=u(e)), e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function f(e,t){var r=null;return C.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function c(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,s(e)}}function s(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(S("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?P(p,e):p(e))}function p(e){S("emit readable"),e.emit("readable"),m(e)}function d(e,t){t.readingMore||(t.readingMore=!0,P(y,e,t))}function y(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(S("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function h(e){return function(){var t=e._readableState;S("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&A(e,"data")&&(t.flowing=!0,m(e))}}function b(e){S("readable nexttick read 0"),e.read(0)}function v(e,t){t.resumeScheduled||(t.resumeScheduled=!0,P(E,e,t))}function E(e,t){t.reading||(S("resume read 0"),e.read(0)),t.resumeScheduled=!1,e.emit("resume"),m(e),t.flowing&&!t.reading&&e.read(0)}function m(e){var t=e._readableState;if(S("flow",t.flowing),t.flowing)do var r=e.read();while(null!==r&&t.flowing)}function O(e,t){var r,n=t.buffer,o=t.length,i=!!t.decoder,a=!!t.objectMode;if(0===n.length)return null;if(0===o)r=null;else if(a)r=n.shift();else if(!e||e>=o)r=i?n.join(""):1===n.length?n[0]:C.concat(n,o),n.length=0;else if(e<n[0].length){var u=n[0];r=u.slice(0,e),n[0]=u.slice(e)}else if(e===n[0].length)r=n.shift();else{r=i?"":new C(e);for(var l=0,f=0,c=n.length;c>f&&e>l;f++){var u=n[0],s=Math.min(e-l,u.length);i?r+=u.slice(0,s):u.copy(r,l,0,s),s<u.length?n[0]=u.slice(s):n.shift(),l+=s}}return r}function _(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,P(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function w(e,t){for(var r=0,n=e.length;n>r;r++)t(e[r],r)}function g(e,t){for(var r=0,n=e.length;n>r;r++)if(e[r]===t)return r;return-1}t.exports=o;var P=e("process-nextick-args"),M=e("isarray"),C=e("buffer").Buffer;o.ReadableState=n;var j,A=(e("events"),function(e,t){return e.listeners(t).length});!function(){try{j=e("stream")}catch(t){}finally{j||(j=e("events").EventEmitter)}}();var C=e("buffer").Buffer,N=e("core-util-is");N.inherits=e("inherits");var L=e("util"),S=void 0;S=L&&L.debuglog?L.debuglog("stream"):function(){};var B;N.inherits(o,j);var x,x;o.prototype.push=function(e,t){var r=this._readableState;return r.objectMode||"string"!=typeof e||(t=t||r.defaultEncoding,t!==r.encoding&&(e=new C(e,t),t="")),i(this,r,e,t,!1)},o.prototype.unshift=function(e){var t=this._readableState;return i(this,t,e,"",!0)},o.prototype.isPaused=function(){return this._readableState.flowing===!1},o.prototype.setEncoding=function(t){return B||(B=e("string_decoder/").StringDecoder),this._readableState.decoder=new B(t),this._readableState.encoding=t,this};var I=8388608;o.prototype.read=function(e){S("read",e);var t=this._readableState,r=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return S("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?_(this):s(this),null;if(e=l(e,t),0===e&&t.ended)return 0===t.length&&_(this),null;var n=t.needReadable;S("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&(n=!0,S("length less than watermark",n)),(t.ended||t.reading)&&(n=!1,S("reading or ended",n)),n&&(S("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),n&&!t.reading&&(e=l(r,t));var o;return o=e>0?O(e,t):null,null===o&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),r!==e&&t.ended&&0===t.length&&_(this),null!==o&&this.emit("data",o),o},o.prototype._read=function(e){this.emit("error",new Error("not implemented"))},o.prototype.pipe=function(e,t){function n(e){S("onunpipe"),e===s&&i()}function o(){S("onend"),e.end()}function i(){S("cleanup"),e.removeListener("close",l),e.removeListener("finish",f),e.removeListener("drain",b),e.removeListener("error",u),e.removeListener("unpipe",n),s.removeListener("end",o),s.removeListener("end",i),s.removeListener("data",a),v=!0,!p.awaitDrain||e._writableState&&!e._writableState.needDrain||b()}function a(t){S("ondata");var r=e.write(t);!1===r&&(1!==p.pipesCount||p.pipes[0]!==e||1!==s.listenerCount("data")||v||(S("false write response, pause",s._readableState.awaitDrain),s._readableState.awaitDrain++),s.pause())}function u(t){S("onerror",t),c(),e.removeListener("error",u),0===A(e,"error")&&e.emit("error",t)}function l(){e.removeListener("finish",f),c()}function f(){S("onfinish"),e.removeListener("close",l),c()}function c(){S("unpipe"),s.unpipe(e)}var s=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=e;break;case 1:p.pipes=[p.pipes,e];break;default:p.pipes.push(e)}p.pipesCount+=1,S("pipe count=%d opts=%j",p.pipesCount,t);var d=(!t||t.end!==!1)&&e!==r.stdout&&e!==r.stderr,y=d?o:i;p.endEmitted?P(y):s.once("end",y),e.on("unpipe",n);var b=h(s);e.on("drain",b);var v=!1;return s.on("data",a),e._events&&e._events.error?M(e._events.error)?e._events.error.unshift(u):e._events.error=[u,e._events.error]:e.on("error",u),e.once("close",l),e.once("finish",f),e.emit("pipe",s),p.flowing||(S("pipe resume"),s.resume()),e},o.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;n>o;o++)r[o].emit("unpipe",this);return this}var i=g(t.pipes,e);return-1===i?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},o.prototype.on=function(e,t){var r=j.prototype.on.call(this,e,t);if("data"===e&&!1!==this._readableState.flowing&&this.resume(),"readable"===e&&!this._readableState.endEmitted){var n=this._readableState;n.readableListening||(n.readableListening=!0,n.emittedReadable=!1,n.needReadable=!0,n.reading?n.length&&s(this,n):P(b,this))}return r},o.prototype.addListener=o.prototype.on,o.prototype.resume=function(){var e=this._readableState;return e.flowing||(S("resume"),e.flowing=!0,v(this,e)),this},o.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this},o.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;e.on("end",function(){if(S("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),e.on("data",function(o){if(S("wrapped data"),t.decoder&&(o=t.decoder.write(o)),(!t.objectMode||null!==o&&void 0!==o)&&(t.objectMode||o&&o.length)){var i=n.push(o);i||(r=!0,e.pause())}});for(var o in e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));var i=["error","close","destroy","pause","resume"];return w(i,function(t){e.on(t,n.emit.bind(n,t))}),n._read=function(t){S("wrapped _read",t),r&&(r=!1,e.resume())},n},o._fromList=O}).call(this,e("_process"))},{"./_stream_duplex":13,_process:11,buffer:3,"core-util-is":4,events:5,inherits:7,isarray:9,"process-nextick-args":10,"string_decoder/":23,util:2}],16:[function(e,t,r){"use strict";function n(e){this.afterTransform=function(t,r){return o(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function o(e,t,r){var n=e._transformState;n.transforming=!1;var o=n.writecb;if(!o)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&e.push(r),o(t);var i=e._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&e._read(i.highWaterMark)}function i(e){if(!(this instanceof i))return new i(e);u.call(this,e),this._transformState=new n(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e){a(t,e)}):a(t)})}function a(e,t){if(t)return e.emit("error",t);var r=e._writableState,n=e._transformState;if(r.length)throw new Error("calling transform done when ws.length != 0");if(n.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}t.exports=i;var u=e("./_stream_duplex"),l=e("core-util-is");l.inherits=e("inherits"),l.inherits(i,u),i.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},i.prototype._transform=function(e,t,r){throw new Error("not implemented")},i.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},i.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{"./_stream_duplex":13,"core-util-is":4,inherits:7}],17:[function(e,t,r){(function(r){"use strict";function n(){}function o(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function i(t,r){A=A||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,r instanceof A&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,o=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:o,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){y(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new T(this),this.corkedRequestsFree.next=new T(this)}function a(t){return A=A||e("./_stream_duplex"),this instanceof a||this instanceof A?(this._writableState=new i(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),void C.call(this)):new a(t)}function u(e,t){var r=new Error("write after end");e.emit("error",r),w(t,r)}function l(e,t,r,n){var o=!0;if(!P.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==r&&!t.objectMode){var i=new TypeError("Invalid non-string/buffer chunk");e.emit("error",i),w(n,i),o=!1}return o}function f(e,t,r){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new P(t,r)),t}function c(e,t,r,n,i){r=f(t,r,n),P.isBuffer(r)&&(n="buffer");var a=t.objectMode?1:r.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest=new o(r,n,i),l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else s(e,t,!1,a,r,n,i);return u}function s(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function p(e,t,r,n,o){--t.pendingcb,r?w(o,n):o(n),e._writableState.errorEmitted=!0,e.emit("error",n)}function d(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function y(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if(d(r),t)p(e,r,n,t,o);else{var i=E(r);i||r.corked||r.bufferProcessing||!r.bufferedRequest||v(e,r),n?g(h,e,r,i,o):h(e,r,i,o)}}function h(e,t,r,n){r||b(e,t),t.pendingcb--,n(),O(e,t)}function b(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function v(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),i=t.corkedRequestsFree;i.entry=r;for(var a=0;r;)o[a]=r,r=r.next,a+=1;s(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,t.corkedRequestsFree=i.next,i.next=null}else{for(;r;){var u=r.chunk,l=r.encoding,f=r.callback,c=t.objectMode?1:u.length;if(s(e,t,!1,c,u,l,f),r=r.next,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function m(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function O(e,t){var r=E(t);return r&&(0===t.pendingcb?(m(e,t),t.finished=!0,e.emit("finish")):m(e,t)),r}function _(e,t,r){t.ending=!0,O(e,t),r&&(t.finished?w(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function T(e){var t=this;this.next=null,this.entry=null,this.finish=function(r){var n=t.entry;for(t.entry=null;n;){var o=n.callback;e.pendingcb--,o(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}t.exports=a;var w=e("process-nextick-args"),g=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?setImmediate:w,P=e("buffer").Buffer;a.WritableState=i;var M=e("core-util-is");M.inherits=e("inherits");var C,j={deprecate:e("util-deprecate")};!function(){try{C=e("stream")}catch(t){}finally{C||(C=e("events").EventEmitter)}}();var P=e("buffer").Buffer;M.inherits(a,C);var A;i.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(i.prototype,"buffer",{get:j.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var A;a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},a.prototype.write=function(e,t,r){var o=this._writableState,i=!1;return"function"==typeof t&&(r=t,t=null),P.isBuffer(e)?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=n),o.ended?u(this,r):l(this,o,e,r)&&(o.pendingcb++,i=c(this,o,e,t,r)),i},a.prototype.cork=function(){var e=this._writableState;e.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||v(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e},a.prototype._write=function(e,t,r){r(new Error("not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||_(this,n,r)}}).call(this,e("_process"))},{"./_stream_duplex":13,_process:11,buffer:3,"core-util-is":4,events:5,inherits:7,"process-nextick-args":10,"util-deprecate":24}],18:[function(e,t,r){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":14}],19:[function(e,t,r){(function(n){var o=function(){try{return e("stream")}catch(t){}}();r=t.exports=e("./lib/_stream_readable.js"),r.Stream=o||r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),!n.browser&&"disable"===n.env.READABLE_STREAM&&o&&(t.exports=o)}).call(this,e("_process"))},{"./lib/_stream_duplex.js":13,"./lib/_stream_passthrough.js":14,"./lib/_stream_readable.js":15,"./lib/_stream_transform.js":16,"./lib/_stream_writable.js":17,_process:11}],20:[function(e,t,r){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":16}],21:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":17}],22:[function(e,t,r){function n(){o.call(this)}t.exports=n;var o=e("events").EventEmitter,i=e("inherits");i(n,o),n.Readable=e("readable-stream/readable.js"),n.Writable=e("readable-stream/writable.js"),n.Duplex=e("readable-stream/duplex.js"),n.Transform=e("readable-stream/transform.js"),n.PassThrough=e("readable-stream/passthrough.js"),n.Stream=n,n.prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&f.pause&&f.pause()}function n(){f.readable&&f.resume&&f.resume()}function i(){c||(c=!0,e.end())}function a(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===o.listenerCount(this,"error"))throw e}function l(){f.removeListener("data",r),e.removeListener("drain",n),f.removeListener("end",i),f.removeListener("close",a),f.removeListener("error",u),e.removeListener("error",u),f.removeListener("end",l),f.removeListener("close",l),e.removeListener("close",l)}var f=this;f.on("data",r),e.on("drain",n),e._isStdio||t&&t.end===!1||(f.on("end",i),f.on("close",a));var c=!1;return f.on("error",u),e.on("error",u),f.on("end",l),f.on("close",l),e.on("close",l),e.emit("pipe",f),e}},{events:5,inherits:7,"readable-stream/duplex.js":12,"readable-stream/passthrough.js":18,"readable-stream/readable.js":19,"readable-stream/transform.js":20,"readable-stream/writable.js":21}],23:[function(e,t,r){function n(e){if(e&&!l(e))throw new Error("Unknown encoding: "+e)}function o(e){return e.toString(this.encoding)}function i(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function a(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var u=e("buffer").Buffer,l=u.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"u