imsc
Version:
Renders IMSC 1.1 documents to HTML5 fragments
109 lines (107 loc) • 130 kB
JavaScript
/*
The buffer module from node.js, for the browser.
@author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
@license MIT
Determine if an object is a Buffer
@author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
@license MIT
http://mths.be/fromcodepoint v0.1.0 by @mathias */
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,q,p){d!=Array.prototype&&d!=Object.prototype&&(d[q]=p.value)};$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(d,q,p,n){if(q){p=$jscomp.global;d=d.split(".");for(n=0;n<d.length-1;n++){var h=d[n];h in p||(p[h]={});p=p[h]}d=d[d.length-1];n=p[d];q=q(n);q!=n&&null!=q&&$jscomp.defineProperty(p,d,{configurable:!0,writable:!0,value:q})}};$jscomp.polyfill("Array.prototype.fill",function(d){return d?d:function(d,p,n){var h=this.length||0;0>p&&(p=Math.max(0,h+p));if(null==n||n>h)n=h;n=Number(n);0>n&&(n=Math.max(0,h+n));for(p=Number(p||0);p<n;p++)this[p]=d;return this}},"es6","es3");
$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var d=0;return function(q){return $jscomp.SYMBOL_PREFIX+(q||"")+d++}}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.iterator;d||(d=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[d]&&$jscomp.defineProperty(Array.prototype,d,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.asyncIterator;d||(d=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.arrayIterator=function(d){var q=0;return $jscomp.iteratorPrototype(function(){return q<d.length?{done:!1,value:d[q++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(d){$jscomp.initSymbolIterator();d={next:d};d[$jscomp.global.Symbol.iterator]=function(){return this};return d};$jscomp.iteratorFromArray=function(d,q){$jscomp.initSymbolIterator();d instanceof String&&(d+="");var p=0,n={next:function(){if(p<d.length){var h=p++;return{value:q(h,d[h]),done:!1}}n.next=function(){return{done:!0,value:void 0}};return n.next()}};n[Symbol.iterator]=function(){return n};return n};
$jscomp.polyfill("Array.prototype.keys",function(d){return d?d:function(){return $jscomp.iteratorFromArray(this,function(d){return d})}},"es6","es3");
$jscomp.polyfill("String.fromCodePoint",function(d){return d?d:function(d){for(var p="",n=0;n<arguments.length;n++){var h=Number(arguments[n]);if(0>h||1114111<h||h!==Math.floor(h))throw new RangeError("invalid_code_point "+h);65535>=h?p+=String.fromCharCode(h):(h-=65536,p+=String.fromCharCode(h>>>10&1023|55296),p+=String.fromCharCode(h&1023|56320))}return p}},"es6","es3");$jscomp.polyfill("Math.sign",function(d){return d?d:function(d){d=Number(d);return 0===d||isNaN(d)?d:0<d?1:-1}},"es6","es3");
(function(d){"object"===typeof exports&&"undefined"!==typeof module?module.exports=d():"function"===typeof define&&define.amd?define([],d):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).imsc=d()})(function(){return function(){function d(q,p,n){function h(b,t){if(!p[b]){if(!q[b]){var a="function"==typeof require&&require;if(!t&&a)return a(b,!0);if(g)return g(b,!0);t=Error("Cannot find module '"+b+"'");throw t.code="MODULE_NOT_FOUND",t;}t=
p[b]={exports:{}};q[b][0].call(t.exports,function(a){return h(q[b][1][a]||a)},t,t.exports,d,q,p,n)}return p[b].exports}for(var g="function"==typeof require&&require,b=0;b<n.length;b++)h(n[b]);return h}return d}()({1:[function(d,q,p){function n(b){var a=b.length;if(0<a%4)throw Error("Invalid string. Length must be a multiple of 4");b=b.indexOf("=");-1===b&&(b=a);return[b,b===a?0:4-b%4]}function h(b,a,e){for(var t=[],k=a;k<e;k+=3)a=(b[k]<<16&16711680)+(b[k+1]<<8&65280)+(b[k+2]&255),t.push(g[a>>18&63]+
g[a>>12&63]+g[a>>6&63]+g[a&63]);return t.join("")}p.byteLength=function(b){b=n(b);var a=b[1];return 3*(b[0]+a)/4-a};p.toByteArray=function(g){var a=n(g);var e=a[0];a=a[1];for(var t=new B(3*(e+a)/4-a),k=0,c=0<a?e-4:e,f=0;f<c;f+=4)e=b[g.charCodeAt(f)]<<18|b[g.charCodeAt(f+1)]<<12|b[g.charCodeAt(f+2)]<<6|b[g.charCodeAt(f+3)],t[k++]=e>>16&255,t[k++]=e>>8&255,t[k++]=e&255;2===a&&(e=b[g.charCodeAt(f)]<<2|b[g.charCodeAt(f+1)]>>4,t[k++]=e&255);1===a&&(e=b[g.charCodeAt(f)]<<10|b[g.charCodeAt(f+1)]<<4|b[g.charCodeAt(f+
2)]>>2,t[k++]=e>>8&255,t[k++]=e&255);return t};p.fromByteArray=function(b){for(var a=b.length,e=a%3,t=[],k=0,c=a-e;k<c;k+=16383)t.push(h(b,k,k+16383>c?c:k+16383));1===e?(b=b[a-1],t.push(g[b>>2]+g[b<<4&63]+"==")):2===e&&(b=(b[a-2]<<8)+b[a-1],t.push(g[b>>10]+g[b>>4&63]+g[b<<2&63]+"="));return t.join("")};var g=[],b=[],B="undefined"!==typeof Uint8Array?Uint8Array:Array;for(d=0;64>d;++d)g[d]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[d],b["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(d)]=
d;b[45]=62;b[95]=63},{}],2:[function(d,q,p){},{}],3:[function(d,q,p){(function(n){var h=d("buffer"),g=h.Buffer,b=h.SlowBuffer,B=h.kMaxLength||2147483647;p.alloc=function(b,a,e){if("function"===typeof g.alloc)return g.alloc(b,a,e);if("number"===typeof e)throw new TypeError("encoding must not be number");if("number"!==typeof b)throw new TypeError("size must be a number");if(b>B)throw new RangeError("size is too large");var t=a;void 0===t&&(e=void 0,t=0);a=new g(b);if("string"===typeof t){e=new g(t,
e);t=e.length;for(var k=-1;++k<b;)a[k]=e[k%t]}else a.fill(t);return a};p.allocUnsafe=function(b){if("function"===typeof g.allocUnsafe)return g.allocUnsafe(b);if("number"!==typeof b)throw new TypeError("size must be a number");if(b>B)throw new RangeError("size is too large");return new g(b)};p.from=function(b,a,e){if("function"===typeof g.from&&(!n.Uint8Array||Uint8Array.from!==g.from))return g.from(b,a,e);if("number"===typeof b)throw new TypeError('"value" argument must not be a number');if("string"===
typeof b)return new g(b,a);if("undefined"!==typeof ArrayBuffer&&b instanceof ArrayBuffer){var h=a;if(1===arguments.length)return new g(b);"undefined"===typeof h&&(h=0);var k=e;"undefined"===typeof k&&(k=b.byteLength-h);if(h>=b.byteLength)throw new RangeError("'offset' is out of bounds");if(k>b.byteLength-h)throw new RangeError("'length' is out of bounds");return new g(b.slice(h,h+k))}if(g.isBuffer(b))return h=new g(b.length),b.copy(h,0,0,b.length),h;if(b){if(Array.isArray(b)||"undefined"!==typeof ArrayBuffer&&
b.buffer instanceof ArrayBuffer||"length"in b)return new g(b);if("Buffer"===b.type&&Array.isArray(b.data))return new g(b.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");};p.allocUnsafeSlow=function(h){if("function"===typeof g.allocUnsafeSlow)return g.allocUnsafeSlow(h);if("number"!==typeof h)throw new TypeError("size must be a number");if(h>=B)throw new RangeError("size is too large");return new b(h)}}).call(this,"undefined"!==typeof global?
global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{buffer:5}],4:[function(d,q,p){(function(d){p.isArray=function(h){return Array.isArray?Array.isArray(h):"[object Array]"===Object.prototype.toString.call(h)};p.isBoolean=function(h){return"boolean"===typeof h};p.isNull=function(h){return null===h};p.isNullOrUndefined=function(h){return null==h};p.isNumber=function(h){return"number"===typeof h};p.isString=function(h){return"string"===typeof h};p.isSymbol=function(h){return"symbol"===
typeof h};p.isUndefined=function(h){return void 0===h};p.isRegExp=function(h){return"[object RegExp]"===Object.prototype.toString.call(h)};p.isObject=function(h){return"object"===typeof h&&null!==h};p.isDate=function(h){return"[object Date]"===Object.prototype.toString.call(h)};p.isError=function(h){return"[object Error]"===Object.prototype.toString.call(h)||h instanceof Error};p.isFunction=function(h){return"function"===typeof h};p.isPrimitive=function(h){return null===h||"boolean"===typeof h||"number"===
typeof h||"string"===typeof h||"symbol"===typeof h||"undefined"===typeof h};p.isBuffer=d.isBuffer}).call(this,{isBuffer:d("../../is-buffer/index.js")})},{"../../is-buffer/index.js":9}],5:[function(d,q,p){(function(n){function h(){try{var l=new Uint8Array(1);l.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return 42===l.foo()&&"function"===typeof l.subarray&&0===l.subarray(1,1).byteLength}catch(r){return!1}}function g(l,r){if((b.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<r)throw new RangeError("Invalid typed array length");
b.TYPED_ARRAY_SUPPORT?(l=new Uint8Array(r),l.__proto__=b.prototype):(null===l&&(l=new b(r)),l.length=r);return l}function b(l,r,c){if(!(b.TYPED_ARRAY_SUPPORT||this instanceof b))return new b(l,r,c);if("number"===typeof l){if("string"===typeof r)throw Error("If encoding is specified then the first argument must be a string");return a(this,l)}return B(this,l,r,c)}function B(l,r,a,f){if("number"===typeof r)throw new TypeError('"value" argument must not be a number');if("undefined"!==typeof ArrayBuffer&&
r instanceof ArrayBuffer){r.byteLength;if(0>a||r.byteLength<a)throw new RangeError("'offset' is out of bounds");if(r.byteLength<a+(f||0))throw new RangeError("'length' is out of bounds");r=void 0===a&&void 0===f?new Uint8Array(r):void 0===f?new Uint8Array(r,a):new Uint8Array(r,a,f);b.TYPED_ARRAY_SUPPORT?(l=r,l.__proto__=b.prototype):l=e(l,r);return l}if("string"===typeof r){f=l;l=a;if("string"!==typeof l||""===l)l="utf8";if(!b.isEncoding(l))throw new TypeError('"encoding" must be a valid string encoding');
a=c(r,l)|0;f=g(f,a);r=f.write(r,l);r!==a&&(f=f.slice(0,r));return f}return v(l,r)}function t(l){if("number"!==typeof l)throw new TypeError('"size" argument must be a number');if(0>l)throw new RangeError('"size" argument must not be negative');}function a(l,r){t(r);l=g(l,0>r?0:k(r)|0);if(!b.TYPED_ARRAY_SUPPORT)for(var a=0;a<r;++a)l[a]=0;return l}function e(l,r){var a=0>r.length?0:k(r.length)|0;l=g(l,a);for(var b=0;b<a;b+=1)l[b]=r[b]&255;return l}function v(l,r){if(b.isBuffer(r)){var a=k(r.length)|
0;l=g(l,a);if(0===l.length)return l;r.copy(l,0,0,a);return l}if(r){if("undefined"!==typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return(a="number"!==typeof r.length)||(a=r.length,a=a!==a),a?g(l,0):e(l,r);if("Buffer"===r.type&&O(r.data))return e(l,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");}function k(l){if(l>=(b.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+
(b.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return l|0}function c(l,r){if(b.isBuffer(l))return l.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(l)||l instanceof ArrayBuffer))return l.byteLength;"string"!==typeof l&&(l=""+l);var a=l.length;if(0===a)return 0;for(var c=!1;;)switch(r){case "ascii":case "latin1":case "binary":return a;case "utf8":case "utf-8":case void 0:return L(l).length;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*
a;case "hex":return a>>>1;case "base64":return J.toByteArray(T(l)).length;default:if(c)return L(l).length;r=(""+r).toLowerCase();c=!0}}function f(l,r,a){var b=!1;if(void 0===r||0>r)r=0;if(r>this.length)return"";if(void 0===a||a>this.length)a=this.length;if(0>=a)return"";a>>>=0;r>>>=0;if(a<=r)return"";for(l||(l="utf8");;)switch(l){case "hex":l=r;r=a;a=this.length;if(!l||0>l)l=0;if(!r||0>r||r>a)r=a;b="";for(a=l;a<r;++a)l=b,b=this[a],b=16>b?"0"+b.toString(16):b.toString(16),b=l+b;return b;case "utf8":case "utf-8":return q(this,
r,a);case "ascii":l="";for(a=Math.min(this.length,a);r<a;++r)l+=String.fromCharCode(this[r]&127);return l;case "latin1":case "binary":l="";for(a=Math.min(this.length,a);r<a;++r)l+=String.fromCharCode(this[r]);return l;case "base64":return r=0===r&&a===this.length?J.fromByteArray(this):J.fromByteArray(this.slice(r,a)),r;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":r=this.slice(r,a);a="";for(l=0;l<r.length;l+=2)a+=String.fromCharCode(r[l]+256*r[l+1]);return a;default:if(b)throw new TypeError("Unknown encoding: "+
l);l=(l+"").toLowerCase();b=!0}}function u(l,a,b){var r=l[a];l[a]=l[b];l[b]=r}function A(l,a,c,f,e){if(0===l.length)return-1;"string"===typeof c?(f=c,c=0):2147483647<c?c=2147483647:-2147483648>c&&(c=-2147483648);c=+c;isNaN(c)&&(c=e?0:l.length-1);0>c&&(c=l.length+c);if(c>=l.length){if(e)return-1;c=l.length-1}else if(0>c)if(e)c=0;else return-1;"string"===typeof a&&(a=b.from(a,f));if(b.isBuffer(a))return 0===a.length?-1:E(l,a,c,f,e);if("number"===typeof a)return a&=255,b.TYPED_ARRAY_SUPPORT&&"function"===
typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(l,a,c):Uint8Array.prototype.lastIndexOf.call(l,a,c):E(l,[a],c,f,e);throw new TypeError("val must be string, number or Buffer");}function E(l,a,b,c,f){function r(l,a){return 1===e?l[a]:l.readUInt16BE(a*e)}var e=1,k=l.length,N=a.length;if(void 0!==c&&(c=String(c).toLowerCase(),"ucs2"===c||"ucs-2"===c||"utf16le"===c||"utf-16le"===c)){if(2>l.length||2>a.length)return-1;e=2;k/=2;N/=2;b/=2}if(f)for(c=-1;b<k;b++)if(r(l,b)===r(a,-1===
c?0:b-c)){if(-1===c&&(c=b),b-c+1===N)return c*e}else-1!==c&&(b-=b-c),c=-1;else for(b+N>k&&(b=k-N);0<=b;b--){k=!0;for(c=0;c<N;c++)if(r(l,b+c)!==r(a,c)){k=!1;break}if(k)return b}return-1}function q(l,a,b){b=Math.min(l.length,b);for(var c=[];a<b;){var r=l[a],f=null,e=239<r?4:223<r?3:191<r?2:1;if(a+e<=b)switch(e){case 1:128>r&&(f=r);break;case 2:var k=l[a+1];128===(k&192)&&(r=(r&31)<<6|k&63,127<r&&(f=r));break;case 3:k=l[a+1];var N=l[a+2];128===(k&192)&&128===(N&192)&&(r=(r&15)<<12|(k&63)<<6|N&63,2047<
r&&(55296>r||57343<r)&&(f=r));break;case 4:k=l[a+1];N=l[a+2];var g=l[a+3];128===(k&192)&&128===(N&192)&&128===(g&192)&&(r=(r&15)<<18|(k&63)<<12|(N&63)<<6|g&63,65535<r&&1114112>r&&(f=r))}null===f?(f=65533,e=1):65535<f&&(f-=65536,c.push(f>>>10&1023|55296),f=56320|f&1023);c.push(f);a+=e}l=c.length;if(l<=R)c=String.fromCharCode.apply(String,c);else{b="";for(a=0;a<l;)b+=String.fromCharCode.apply(String,c.slice(a,a+=R));c=b}return c}function y(l,a,c){if(0!==l%1||0>l)throw new RangeError("offset is not uint");
if(l+a>c)throw new RangeError("Trying to access beyond buffer length");}function D(l,a,c,f,e,k){if(!b.isBuffer(l))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>e||a<k)throw new RangeError('"value" argument is out of bounds');if(c+f>l.length)throw new RangeError("Index out of range");}function I(l,a,c,b){0>a&&(a=65535+a+1);for(var r=0,f=Math.min(l.length-c,2);r<f;++r)l[c+r]=(a&255<<8*(b?r:1-r))>>>8*(b?r:1-r)}function G(l,a,c,b){0>a&&(a=4294967295+a+1);for(var r=0,f=Math.min(l.length-
c,4);r<f;++r)l[c+r]=a>>>8*(b?r:3-r)&255}function C(l,a,c,b,f,e){if(c+b>l.length)throw new RangeError("Index out of range");if(0>c)throw new RangeError("Index out of range");}function z(l,a,c,b,f){f||C(l,a,c,4,3.4028234663852886E38,-3.4028234663852886E38);K.write(l,a,c,b,23,4);return c+4}function w(l,a,c,b,f){f||C(l,a,c,8,1.7976931348623157E308,-1.7976931348623157E308);K.write(l,a,c,b,52,8);return c+8}function T(l){l=l.trim?l.trim():l.replace(/^\s+|\s+$/g,"");l=l.replace(V,"");if(2>l.length)return"";
for(;0!==l.length%4;)l+="=";return l}function L(l,a){a=a||Infinity;for(var c,b=l.length,r=null,f=[],e=0;e<b;++e){c=l.charCodeAt(e);if(55295<c&&57344>c){if(!r){if(56319<c){-1<(a-=3)&&f.push(239,191,189);continue}else if(e+1===b){-1<(a-=3)&&f.push(239,191,189);continue}r=c;continue}if(56320>c){-1<(a-=3)&&f.push(239,191,189);r=c;continue}c=(r-55296<<10|c-56320)+65536}else r&&-1<(a-=3)&&f.push(239,191,189);r=null;if(128>c){if(0>--a)break;f.push(c)}else if(2048>c){if(0>(a-=2))break;f.push(c>>6|192,c&63|
128)}else if(65536>c){if(0>(a-=3))break;f.push(c>>12|224,c>>6&63|128,c&63|128)}else if(1114112>c){if(0>(a-=4))break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw Error("Invalid code point");}return f}function H(a){for(var l=[],c=0;c<a.length;++c)l.push(a.charCodeAt(c)&255);return l}function x(a,c,b,f){for(var l=0;l<f&&!(l+b>=c.length||l>=a.length);++l)c[l+b]=a[l];return l}var J=d("base64-js"),K=d("ieee754"),O=d("isarray");p.Buffer=b;p.SlowBuffer=function(a){+a!=a&&(a=0);return b.alloc(+a)};
p.INSPECT_MAX_BYTES=50;b.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:h();p.kMaxLength=b.TYPED_ARRAY_SUPPORT?2147483647:1073741823;b.poolSize=8192;b._augment=function(a){a.__proto__=b.prototype;return a};b.from=function(a,c,b){return B(null,a,c,b)};b.TYPED_ARRAY_SUPPORT&&(b.prototype.__proto__=Uint8Array.prototype,b.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&b[Symbol.species]===b&&Object.defineProperty(b,Symbol.species,{value:null,configurable:!0}));
b.alloc=function(a,c,b){t(a);a=0>=a?g(null,a):void 0!==c?"string"===typeof b?g(null,a).fill(c,b):g(null,a).fill(c):g(null,a);return a};b.allocUnsafe=function(l){return a(null,l)};b.allocUnsafeSlow=function(l){return a(null,l)};b.isBuffer=function(a){return!(null==a||!a._isBuffer)};b.compare=function(a,c){if(!b.isBuffer(a)||!b.isBuffer(c))throw new TypeError("Arguments must be Buffers");if(a===c)return 0;for(var l=a.length,r=c.length,f=0,e=Math.min(l,r);f<e;++f)if(a[f]!==c[f]){l=a[f];r=c[f];break}return l<
r?-1:r<l?1:0};b.isEncoding=function(a){switch(String(a).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}};b.concat=function(a,c){if(!O(a))throw new TypeError('"list" argument must be an Array of Buffers');if(0===a.length)return b.alloc(0);var l;if(void 0===c)for(l=c=0;l<a.length;++l)c+=a[l].length;c=b.allocUnsafe(c);var r=0;for(l=0;l<a.length;++l){var f=a[l];
if(!b.isBuffer(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(c,r);r+=f.length}return c};b.byteLength=c;b.prototype._isBuffer=!0;b.prototype.swap16=function(){var a=this.length;if(0!==a%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var c=0;c<a;c+=2)u(this,c,c+1);return this};b.prototype.swap32=function(){var a=this.length;if(0!==a%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var c=0;c<a;c+=4)u(this,c,c+3),u(this,c+
1,c+2);return this};b.prototype.swap64=function(){var a=this.length;if(0!==a%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var c=0;c<a;c+=8)u(this,c,c+7),u(this,c+1,c+6),u(this,c+2,c+5),u(this,c+3,c+4);return this};b.prototype.toString=function(){var a=this.length|0;return 0===a?"":0===arguments.length?q(this,0,a):f.apply(this,arguments)};b.prototype.equals=function(a){if(!b.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:0===b.compare(this,
a)};b.prototype.inspect=function(){var a="",c=p.INSPECT_MAX_BYTES;0<this.length&&(a=this.toString("hex",0,c).match(/.{2}/g).join(" "),this.length>c&&(a+=" ... "));return"<Buffer "+a+">"};b.prototype.compare=function(a,c,f,e,k){if(!b.isBuffer(a))throw new TypeError("Argument must be a Buffer");void 0===c&&(c=0);void 0===f&&(f=a?a.length:0);void 0===e&&(e=0);void 0===k&&(k=this.length);if(0>c||f>a.length||0>e||k>this.length)throw new RangeError("out of range index");if(e>=k&&c>=f)return 0;if(e>=k)return-1;
if(c>=f)return 1;c>>>=0;f>>>=0;e>>>=0;k>>>=0;if(this===a)return 0;var l=k-e,r=f-c,g=Math.min(l,r);e=this.slice(e,k);a=a.slice(c,f);for(c=0;c<g;++c)if(e[c]!==a[c]){l=e[c];r=a[c];break}return l<r?-1:r<l?1:0};b.prototype.includes=function(a,c,b){return-1!==this.indexOf(a,c,b)};b.prototype.indexOf=function(a,c,b){return A(this,a,c,b,!0)};b.prototype.lastIndexOf=function(a,c,b){return A(this,a,c,b,!1)};b.prototype.write=function(a,c,b,f){if(void 0===c)f="utf8",b=this.length,c=0;else if(void 0===b&&"string"===
typeof c)f=c,b=this.length,c=0;else if(isFinite(c))c|=0,isFinite(b)?(b|=0,void 0===f&&(f="utf8")):(f=b,b=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var l=this.length-c;if(void 0===b||b>l)b=l;if(0<a.length&&(0>b||0>c)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");f||(f="utf8");for(l=!1;;)switch(f){case "hex":a:{c=Number(c)||0;f=this.length-c;b?(b=Number(b),b>f&&(b=f)):b=f;f=a.length;if(0!==f%2)throw new TypeError("Invalid hex string");
b>f/2&&(b=f/2);for(f=0;f<b;++f){l=parseInt(a.substr(2*f,2),16);if(isNaN(l)){a=f;break a}this[c+f]=l}a=f}return a;case "utf8":case "utf-8":return x(L(a,this.length-c),this,c,b);case "ascii":return x(H(a),this,c,b);case "latin1":case "binary":return x(H(a),this,c,b);case "base64":return x(J.toByteArray(T(a)),this,c,b);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":f=a;l=this.length-c;for(var r=[],e=0;e<f.length&&!(0>(l-=2));++e){var k=f.charCodeAt(e);a=k>>8;k%=256;r.push(k);r.push(a)}return x(r,
this,c,b);default:if(l)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase();l=!0}};b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;b.prototype.slice=function(a,c){var l=this.length;a=~~a;c=void 0===c?l:~~c;0>a?(a+=l,0>a&&(a=0)):a>l&&(a=l);0>c?(c+=l,0>c&&(c=0)):c>l&&(c=l);c<a&&(c=a);if(b.TYPED_ARRAY_SUPPORT)c=this.subarray(a,c),c.__proto__=b.prototype;else{l=c-a;c=new b(l,void 0);for(var f=0;f<l;++f)c[f]=this[f+a]}return c};
b.prototype.readUIntLE=function(a,c,b){a|=0;c|=0;b||y(a,c,this.length);b=this[a];for(var l=1,f=0;++f<c&&(l*=256);)b+=this[a+f]*l;return b};b.prototype.readUIntBE=function(a,c,b){a|=0;c|=0;b||y(a,c,this.length);b=this[a+--c];for(var l=1;0<c&&(l*=256);)b+=this[a+--c]*l;return b};b.prototype.readUInt8=function(a,c){c||y(a,1,this.length);return this[a]};b.prototype.readUInt16LE=function(a,c){c||y(a,2,this.length);return this[a]|this[a+1]<<8};b.prototype.readUInt16BE=function(a,c){c||y(a,2,this.length);
return this[a]<<8|this[a+1]};b.prototype.readUInt32LE=function(a,c){c||y(a,4,this.length);return(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]};b.prototype.readUInt32BE=function(a,c){c||y(a,4,this.length);return 16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])};b.prototype.readIntLE=function(a,c,b){a|=0;c|=0;b||y(a,c,this.length);b=this[a];for(var l=1,f=0;++f<c&&(l*=256);)b+=this[a+f]*l;b>=128*l&&(b-=Math.pow(2,8*c));return b};b.prototype.readIntBE=function(a,c,b){a|=0;c|=0;b||y(a,
c,this.length);b=c;for(var l=1,f=this[a+--b];0<b&&(l*=256);)f+=this[a+--b]*l;f>=128*l&&(f-=Math.pow(2,8*c));return f};b.prototype.readInt8=function(a,c){c||y(a,1,this.length);return this[a]&128?-1*(255-this[a]+1):this[a]};b.prototype.readInt16LE=function(a,c){c||y(a,2,this.length);a=this[a]|this[a+1]<<8;return a&32768?a|4294901760:a};b.prototype.readInt16BE=function(a,c){c||y(a,2,this.length);a=this[a+1]|this[a]<<8;return a&32768?a|4294901760:a};b.prototype.readInt32LE=function(a,c){c||y(a,4,this.length);
return this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24};b.prototype.readInt32BE=function(a,c){c||y(a,4,this.length);return this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]};b.prototype.readFloatLE=function(a,c){c||y(a,4,this.length);return K.read(this,a,!0,23,4)};b.prototype.readFloatBE=function(a,c){c||y(a,4,this.length);return K.read(this,a,!1,23,4)};b.prototype.readDoubleLE=function(a,c){c||y(a,8,this.length);return K.read(this,a,!0,52,8)};b.prototype.readDoubleBE=function(a,c){c||y(a,8,this.length);
return K.read(this,a,!1,52,8)};b.prototype.writeUIntLE=function(a,c,b,f){a=+a;c|=0;b|=0;f||D(this,a,c,b,Math.pow(2,8*b)-1,0);f=1;var l=0;for(this[c]=a&255;++l<b&&(f*=256);)this[c+l]=a/f&255;return c+b};b.prototype.writeUIntBE=function(a,c,b,f){a=+a;c|=0;b|=0;f||D(this,a,c,b,Math.pow(2,8*b)-1,0);f=b-1;var l=1;for(this[c+f]=a&255;0<=--f&&(l*=256);)this[c+f]=a/l&255;return c+b};b.prototype.writeUInt8=function(a,c,f){a=+a;c|=0;f||D(this,a,c,1,255,0);b.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));this[c]=a&
255;return c+1};b.prototype.writeUInt16LE=function(a,c,f){a=+a;c|=0;f||D(this,a,c,2,65535,0);b.TYPED_ARRAY_SUPPORT?(this[c]=a&255,this[c+1]=a>>>8):I(this,a,c,!0);return c+2};b.prototype.writeUInt16BE=function(a,c,f){a=+a;c|=0;f||D(this,a,c,2,65535,0);b.TYPED_ARRAY_SUPPORT?(this[c]=a>>>8,this[c+1]=a&255):I(this,a,c,!1);return c+2};b.prototype.writeUInt32LE=function(a,c,f){a=+a;c|=0;f||D(this,a,c,4,4294967295,0);b.TYPED_ARRAY_SUPPORT?(this[c+3]=a>>>24,this[c+2]=a>>>16,this[c+1]=a>>>8,this[c]=a&255):
G(this,a,c,!0);return c+4};b.prototype.writeUInt32BE=function(a,c,f){a=+a;c|=0;f||D(this,a,c,4,4294967295,0);b.TYPED_ARRAY_SUPPORT?(this[c]=a>>>24,this[c+1]=a>>>16,this[c+2]=a>>>8,this[c+3]=a&255):G(this,a,c,!1);return c+4};b.prototype.writeIntLE=function(a,c,b,f){a=+a;c|=0;f||(f=Math.pow(2,8*b-1),D(this,a,c,b,f-1,-f));f=0;var l=1,e=0;for(this[c]=a&255;++f<b&&(l*=256);)0>a&&0===e&&0!==this[c+f-1]&&(e=1),this[c+f]=(a/l>>0)-e&255;return c+b};b.prototype.writeIntBE=function(a,c,b,f){a=+a;c|=0;f||(f=
Math.pow(2,8*b-1),D(this,a,c,b,f-1,-f));f=b-1;var l=1,e=0;for(this[c+f]=a&255;0<=--f&&(l*=256);)0>a&&0===e&&0!==this[c+f+1]&&(e=1),this[c+f]=(a/l>>0)-e&255;return c+b};b.prototype.writeInt8=function(a,c,f){a=+a;c|=0;f||D(this,a,c,1,127,-128);b.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));0>a&&(a=255+a+1);this[c]=a&255;return c+1};b.prototype.writeInt16LE=function(a,c,f){a=+a;c|=0;f||D(this,a,c,2,32767,-32768);b.TYPED_ARRAY_SUPPORT?(this[c]=a&255,this[c+1]=a>>>8):I(this,a,c,!0);return c+2};b.prototype.writeInt16BE=
function(a,c,f){a=+a;c|=0;f||D(this,a,c,2,32767,-32768);b.TYPED_ARRAY_SUPPORT?(this[c]=a>>>8,this[c+1]=a&255):I(this,a,c,!1);return c+2};b.prototype.writeInt32LE=function(a,c,f){a=+a;c|=0;f||D(this,a,c,4,2147483647,-2147483648);b.TYPED_ARRAY_SUPPORT?(this[c]=a&255,this[c+1]=a>>>8,this[c+2]=a>>>16,this[c+3]=a>>>24):G(this,a,c,!0);return c+4};b.prototype.writeInt32BE=function(a,c,f){a=+a;c|=0;f||D(this,a,c,4,2147483647,-2147483648);0>a&&(a=4294967295+a+1);b.TYPED_ARRAY_SUPPORT?(this[c]=a>>>24,this[c+
1]=a>>>16,this[c+2]=a>>>8,this[c+3]=a&255):G(this,a,c,!1);return c+4};b.prototype.writeFloatLE=function(a,c,b){return z(this,a,c,!0,b)};b.prototype.writeFloatBE=function(a,c,b){return z(this,a,c,!1,b)};b.prototype.writeDoubleLE=function(a,c,b){return w(this,a,c,!0,b)};b.prototype.writeDoubleBE=function(a,c,b){return w(this,a,c,!1,b)};b.prototype.copy=function(a,c,f,e){f||(f=0);e||0===e||(e=this.length);c>=a.length&&(c=a.length);c||(c=0);0<e&&e<f&&(e=f);if(e===f||0===a.length||0===this.length)return 0;
if(0>c)throw new RangeError("targetStart out of bounds");if(0>f||f>=this.length)throw new RangeError("sourceStart out of bounds");if(0>e)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length);a.length-c<e-f&&(e=a.length-c+f);var k=e-f;if(this===a&&f<c&&c<e)for(e=k-1;0<=e;--e)a[e+c]=this[e+f];else if(1E3>k||!b.TYPED_ARRAY_SUPPORT)for(e=0;e<k;++e)a[e+c]=this[e+f];else Uint8Array.prototype.set.call(a,this.subarray(f,f+k),c);return k};b.prototype.fill=function(a,c,f,e){if("string"===
typeof a){"string"===typeof c?(e=c,c=0,f=this.length):"string"===typeof f&&(e=f,f=this.length);if(1===a.length){var k=a.charCodeAt(0);256>k&&(a=k)}if(void 0!==e&&"string"!==typeof e)throw new TypeError("encoding must be a string");if("string"===typeof e&&!b.isEncoding(e))throw new TypeError("Unknown encoding: "+e);}else"number"===typeof a&&(a&=255);if(0>c||this.length<c||this.length<f)throw new RangeError("Out of range index");if(f<=c)return this;c>>>=0;f=void 0===f?this.length:f>>>0;a||(a=0);if("number"===
typeof a)for(e=c;e<f;++e)this[e]=a;else for(a=b.isBuffer(a)?a:L((new b(a,e)).toString()),k=a.length,e=0;e<f-c;++e)this[e+c]=a[e%k];return this};var V=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"base64-js":1,ieee754:7,isarray:10}],6:[function(d,q,p){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||void 0}function h(b){return"function"===typeof b}function g(b){return"object"===
typeof b&&null!==b}q.exports=n;n.EventEmitter=n;n.prototype._events=void 0;n.prototype._maxListeners=void 0;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(b){if("number"!==typeof b||0>b||isNaN(b))throw TypeError("n must be a positive number");this._maxListeners=b;return this};n.prototype.emit=function(b){var d;this._events||(this._events={});if("error"===b&&(!this._events.error||g(this._events.error)&&!this._events.error.length)){var n=arguments[1];if(n instanceof Error)throw n;var a=
Error('Uncaught, unspecified "error" event. ('+n+")");a.context=n;throw a;}a=this._events[b];if(void 0===a)return!1;if(h(a))switch(arguments.length){case 1:a.call(this);break;case 2:a.call(this,arguments[1]);break;case 3:a.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),a.apply(this,n)}else if(g(a)){n=Array.prototype.slice.call(arguments,1);var e=a.slice();a=e.length;for(d=0;d<a;d++)e[d].apply(this,n)}return!0};n.prototype.addListener=function(b,d){if(!h(d))throw TypeError("listener must be a function");
this._events||(this._events={});this._events.newListener&&this.emit("newListener",b,h(d.listener)?d.listener:d);this._events[b]?g(this._events[b])?this._events[b].push(d):this._events[b]=[this._events[b],d]:this._events[b]=d;g(this._events[b])&&!this._events[b].warned&&(d=void 0!==this._maxListeners?this._maxListeners:n.defaultMaxListeners)&&0<d&&this._events[b].length>d&&(this._events[b].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",
this._events[b].length),"function"===typeof console.trace&&console.trace());return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(b,g){function d(){this.removeListener(b,d);a||(a=!0,g.apply(this,arguments))}if(!h(g))throw TypeError("listener must be a function");var a=!1;d.listener=g;this.on(b,d);return this};n.prototype.removeListener=function(b,d){if(!h(d))throw TypeError("listener must be a function");if(!this._events||!this._events[b])return this;var n=this._events[b];
var a=n.length;var e=-1;if(n===d||h(n.listener)&&n.listener===d)delete this._events[b],this._events.removeListener&&this.emit("removeListener",b,d);else if(g(n)){for(;0<a--;)if(n[a]===d||n[a].listener&&n[a].listener===d){e=a;break}if(0>e)return this;1===n.length?(n.length=0,delete this._events[b]):n.splice(e,1);this._events.removeListener&&this.emit("removeListener",b,d)}return this};n.prototype.removeAllListeners=function(b){if(!this._events)return this;if(!this._events.removeListener)return 0===
arguments.length?this._events={}:this._events[b]&&delete this._events[b],this;if(0===arguments.length){for(g in this._events)"removeListener"!==g&&this.removeAllListeners(g);this.removeAllListeners("removeListener");this._events={};return this}var g=this._events[b];if(h(g))this.removeListener(b,g);else if(g)for(;g.length;)this.removeListener(b,g[g.length-1]);delete this._events[b];return this};n.prototype.listeners=function(b){return this._events&&this._events[b]?h(this._events[b])?[this._events[b]]:
this._events[b].slice():[]};n.prototype.listenerCount=function(b){if(this._events){b=this._events[b];if(h(b))return 1;if(b)return b.length}return 0};n.listenerCount=function(b,g){return b.listenerCount(g)}},{}],7:[function(d,q,p){p.read=function(d,h,g,b,p){var n=8*p-b-1;var a=(1<<n)-1,e=a>>1,v=-7;p=g?p-1:0;var k=g?-1:1,c=d[h+p];p+=k;g=c&(1<<-v)-1;c>>=-v;for(v+=n;0<v;g=256*g+d[h+p],p+=k,v-=8);n=g&(1<<-v)-1;g>>=-v;for(v+=b;0<v;n=256*n+d[h+p],p+=k,v-=8);if(0===g)g=1-e;else{if(g===a)return n?NaN:Infinity*
(c?-1:1);n+=Math.pow(2,b);g-=e}return(c?-1:1)*n*Math.pow(2,g-b)};p.write=function(d,h,g,b,p,t){var a,e=8*t-p-1,n=(1<<e)-1,k=n>>1,c=23===p?Math.pow(2,-24)-Math.pow(2,-77):0;t=b?0:t-1;var f=b?1:-1,u=0>h||0===h&&0>1/h?1:0;h=Math.abs(h);isNaN(h)||Infinity===h?(h=isNaN(h)?1:0,b=n):(b=Math.floor(Math.log(h)/Math.LN2),1>h*(a=Math.pow(2,-b))&&(b--,a*=2),h=1<=b+k?h+c/a:h+c*Math.pow(2,1-k),2<=h*a&&(b++,a/=2),b+k>=n?(h=0,b=n):1<=b+k?(h=(h*a-1)*Math.pow(2,p),b+=k):(h=h*Math.pow(2,k-1)*Math.pow(2,p),b=0));for(;8<=
p;d[g+t]=h&255,t+=f,h/=256,p-=8);b=b<<p|h;for(e+=p;0<e;d[g+t]=b&255,t+=f,b/=256,e-=8);d[g+t-f]|=128*u}},{}],8:[function(d,q,p){q.exports="function"===typeof Object.create?function(d,h){d.super_=h;d.prototype=Object.create(h.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}})}:function(d,h){d.super_=h;var g=function(){};g.prototype=h.prototype;d.prototype=new g;d.prototype.constructor=d}},{}],9:[function(d,q,p){function n(d){return!!d.constructor&&"function"===typeof d.constructor.isBuffer&&
d.constructor.isBuffer(d)}q.exports=function(d){return null!=d&&(n(d)||"function"===typeof d.readFloatLE&&"function"===typeof d.slice&&n(d.slice(0,0))||!!d._isBuffer)}},{}],10:[function(d,q,p){var n={}.toString;q.exports=Array.isArray||function(d){return"[object Array]"==n.call(d)}},{}],11:[function(d,q,p){(function(d){function h(g,b,h,n){if("function"!==typeof g)throw new TypeError('"callback" argument must be a function');var a=arguments.length;switch(a){case 0:case 1:return d.nextTick(g);case 2:return d.nextTick(function(){g.call(null,
b)});case 3:return d.nextTick(function(){g.call(null,b,h)});case 4:return d.nextTick(function(){g.call(null,b,h,n)});default:var e=Array(a-1);for(a=0;a<e.length;)e[a++]=arguments[a];return d.nextTick(function(){g.apply(null,e)})}}!d.version||0===d.version.indexOf("v0.")||0===d.version.indexOf("v1.")&&0!==d.version.indexOf("v1.8.")?q.exports=h:q.exports=d.nextTick}).call(this,d("_process"))},{_process:12}],12:[function(d,q,p){function n(){throw Error("setTimeout has not been defined");}function h(){throw Error("clearTimeout has not been defined");
}function g(a){if(v===setTimeout)return setTimeout(a,0);if((v===n||!v)&&setTimeout)return v=setTimeout,setTimeout(a,0);try{return v(a,0)}catch(X){try{return v.call(null,a,0)}catch(y){return v.call(this,a,0)}}}function b(a){if(k===clearTimeout)return clearTimeout(a);if((k===h||!k)&&clearTimeout)return k=clearTimeout,clearTimeout(a);try{return k(a)}catch(X){try{return k.call(null,a)}catch(y){return k.call(this,a)}}}function B(){f&&u&&(f=!1,u.length?c=u.concat(c):A=-1,c.length&&t())}function t(){if(!f){var a=
g(B);f=!0;for(var e=c.length;e;){u=c;for(c=[];++A<e;)u&&u[A].run();A=-1;e=c.length}u=null;f=!1;b(a)}}function a(a,c){this.fun=a;this.array=c}function e(){}d=q.exports={};try{var v="function"===typeof setTimeout?setTimeout:n}catch(E){v=n}try{var k="function"===typeof clearTimeout?clearTimeout:h}catch(E){k=h}var c=[],f=!1,u,A=-1;d.nextTick=function(b){var e=Array(arguments.length-1);if(1<arguments.length)for(var k=1;k<arguments.length;k++)e[k-1]=arguments[k];c.push(new a(b,e));1!==c.length||f||g(t)};
a.prototype.run=function(){this.fun.apply(null,this.array)};d.title="browser";d.browser=!0;d.env={};d.argv=[];d.version="";d.versions={};d.on=e;d.addListener=e;d.once=e;d.off=e;d.removeListener=e;d.removeAllListeners=e;d.emit=e;d.prependListener=e;d.prependOnceListener=e;d.listeners=function(a){return[]};d.binding=function(a){throw Error("process.binding is not supported");};d.cwd=function(){return"/"};d.chdir=function(a){throw Error("process.chdir is not supported");};d.umask=function(){return 0}},
{}],13:[function(d,q,p){q.exports=d("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":14}],14:[function(d,q,p){function n(a){if(!(this instanceof n))return new n(a);B.call(this,a);t.call(this,a);a&&!1===a.readable&&(this.readable=!1);a&&!1===a.writable&&(this.writable=!1);this.allowHalfOpen=!0;a&&!1===a.allowHalfOpen&&(this.allowHalfOpen=!1);this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||b(g,this)}function g(a){a.end()}p=Object.keys||function(a){var b=[],d;for(d in a)b.push(d);
return b};q.exports=n;var b=d("process-nextick-args");q=d("core-util-is");q.inherits=d("inherits");var B=d("./_stream_readable"),t=d("./_stream_writable");q.inherits(n,B);d=p(t.prototype);for(q=0;q<d.length;q++)p=d[q],n.prototype[p]||(n.prototype[p]=t.prototype[p])},{"./_stream_readable":16,"./_stream_writable":18,"core-util-is":4,inherits:8,"process-nextick-args":11}],15:[function(d,q,p){function n(d){if(!(this instanceof n))return new n(d);h.call(this,d)}q.exports=n;var h=d("./_stream_transform");
q=d("core-util-is");q.inherits=d("inherits");q.inherits(n,h);n.prototype._transform=function(d,b,h){h(null,d)}},{"./_stream_transform":17,"core-util-is":4,inherits:8}],16:[function(d,q,p){(function(n){function h(a,c,b){if("function"===typeof a.prependListener)return a.prependListener(c,b);if(a._events&&a._events[c])G(a._events[c])?a._events[c].unshift(b):a._events[c]=[b,a._events[c]];else a.on(c,b)}function g(a,c){C=C||d("./_stream_duplex");a=a||{};this.objectMode=!!a.objectMode;c instanceof C&&(this.objectMode=
this.objectMode||!!a.readableObjectMode);c=a.highWaterMark;var b=this.objectMode?16:16384;this.highWaterMark=c||0===c?c:b;this.highWaterMark=~~this.highWaterMark;this.buffer=new J;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.reading=this.endEmitted=this.ended=!1;this.sync=!0;this.resumeScheduled=this.readableListening=this.emittedReadable=this.needReadable=!1;this.defaultEncoding=a.defaultEncoding||"utf8";this.ranOut=!1;this.awaitDrain=0;this.readingMore=!1;this.encoding=
this.decoder=null;a.encoding&&(K||(K=d("string_decoder/").StringDecoder),this.decoder=new K(a.encoding),this.encoding=a.encoding)}function b(a){C=C||d("./_stream_duplex");if(!(this instanceof b))return new b(a);this._readableState=new g(a,this);this.readable=!0;a&&"function"===typeof a.read&&(this._read=a.read);z.call(this)}function p(c,b,f,e,k){var d=f;var l=null;w.isBuffer(d)||"string"===typeof d||null===d||void 0===d||b.objectMode||(l=new TypeError("Invalid non-string/buffer chunk"));if(d=l)c.emit("error",
d);else if(null===f)b.reading=!1,b.ended||(b.decoder&&(f=b.decoder.end())&&f.length&&(b.buffer.push(f),b.length+=b.objectMode?1:f.length),b.ended=!0,a(c));else if(b.objectMode||f&&0<f.length)if(b.ended&&!k)c.emit("error",Error("stream.push() after EOF"));else if(b.endEmitted&&k)c.emit("error",Error("stream.unshift() after end event"));else{if(b.decoder&&!k&&!e){f=b.decoder.write(f);var g=!b.objectMode&&0===f.length}k||(b.reading=!1);g||(b.flowing&&0===b.length&&!b.sync?(c.emit("data",f),c.read(0)):
(b.length+=b.objectMode?1:f.length,k?b.buffer.unshift(f):b.buffer.push(f),b.needReadable&&a(c)));b.readingMore||(b.readingMore=!0,I(v,c,b))}else k||(b.reading=!1);return!b.ended&&(b.needReadable||b.length<b.highWaterMark||0===b.length)}function t(a,c){if(0>=a||0===c.length&&c.ended)return 0;if(c.objectMode)return 1;if(a!==a)return c.flowing&&c.length?c.buffer.head.data.length:c.length;if(a>c.highWaterMark){var b=a;8388608<=b?b=8388608:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++);c.highWaterMark=
b}return a<=c.length?a:c.ended?c.length:(c.needReadable=!0,0)}function a(a){var c=a._readableState;c.needReadable=!1;c.emittedReadable||(x("emitReadable",c.flowing),c.emittedReadable=!0,c.sync?I(e,a):e(a))}function e(a){x("emit readable");a.emit("readable");u(a)}function v(a,c){for(var b=c.length;!c.reading&&!c.flowing&&!c.ended&&c.length<c.highWaterMark&&(x("maybeReadMore read 0"),a.read(0),b!==c.length);)b=c.length;c.readingMore=!1}function k(a){return function(){var c=a._readableState;x("pipeOnDrain",
c.awaitDrain);c.awaitDrain&&c.awaitDrain--;0===c.awaitDrain&&a.listeners("data").length&&(c.flowing=!0,u(a))}}function c(a){x("readable nexttick read 0");a.read(0)}function f(a,c){c.reading||(x("resume read 0"),a.read(0));c.resumeScheduled=!1;c.awaitDrain=0;a.emit("resume");u(a);c.flowing&&!c.reading&&a.read(0)}function u(a){var c=a._readableState;for(x("flow",c.flowing);c.flowing&&null!==a.read(););}function A(a,c){if(0===c.length)return null;if(c.objectMode)var b=c.buffer.shift();else if(!a||a>=
c.length)b=c.decoder?c.buffer.join(""):1===c.buffer.length?c.buffer.head.data:c.buffer.concat(c.length),c.buffer.clear();else{b=c.buffer;c=c.decoder;if(a<b.head.data.length)c=b.head.data.slice(0,a),b.head.data=b.head.data.slice(a);else{if(a===b.head.data.length)b=b.shift();else if(c){c=b.head;var f=1,e=c.data;for(a-=e.length;c=c.next;){var k=c.data,d=a>k.length?k.length:a;e=d===k.length?e+k:e+k.slice(0,a);a-=d;if(0===a){d===k.length?(++f,b.head=c.next?c.next:b.tail=null):(b.head=c,c.data=k.slice(d));
break}++f}b.length-=f;b=e}else{c=T.allocUnsafe(a);f=b.head;e=1;f.data.copy(c);for(a-=f.data.length;f=f.next;){k=f.data;d=a>k.length?k.length:a;k.copy(c,c.length-a,0,d);a-=d;if(0===a){d===k.length?(++e,b.head=f.next?f.next:b.tail=null):(b.head=f,f.data=k.slice(d));break}++e}b.length-=e;b=c}c=b}b=c}return b}function E(a){var c=a._readableState;if(0<c.length)throw Error('"endReadable()" called on non-empty stream');c.endEmitted||(c.ended=!0,I(X,c,a))}function X(a,c){a.endEmitted||0!==a.length||(a.endEmitted=
!0,c.readable=!1,c.emit("end"))}function y(a,c){for(var b=0,f=a.length;b<f;b++)c(a[b],b)}function D(a,c){for(var b=0,f=a.length;b<f;b++)if(a[b]===c)return b;return-1}q.exports=b;var I=d("process-nextick-args"),G=d("isarray"),C;b.ReadableState=g;d("events");try{var z=d("stream")}catch(O){}finally{z||(z=d("events").EventEmitter)}var w=d("buffer").Buffer,T=d("buffer-shims"),L=d("core-util-is");L.inherits=d("inherits");var H=d("util"),x=void 0;x=H&&H.debuglog?H.debuglog("stream"):function(){};var J=d("./internal/streams/BufferList"),
K;L.inherits(b,z);b.prototype.push=function(a,c){var b=this._readableState;b.objectMode||"string"!==typeof a||(c=c||b.defaultEncoding,c!==b.encoding&&(a=T.from(a,c),c=""));return p(this,b,a,c,!1)};b.prototype.unshift=function(a){return p(this,this._readableState,a,"",!0)};b.prototype.isPaused=function(){return!1===this._readableState.flowing};b.prototype.setEncoding=function(a){K||(K=d("string_decoder/").StringDecoder);this._readableState.decoder=new K(a);this._readableState.encoding=a;return this};
b.prototype.read=function(c){x("read",c);c=parseInt(c,10);var b=this._readableState,f=c;0!==c&&(b.emittedReadable=!1);if(0===c&&b.needReadable&&(b.length>=b.highWaterMark||b.ended))return x("read: emitReadable",b.length,b.ended),0===b.length&&b.ended?E(this):a(this),null;c=t(c,b);if(0===c&&b.ended)return 0===b.length&&E(this),null;var e=b.needReadable;x("need readable",e);if(0===b.length||b.length-c<b.highWaterMark)e=!0,x("length less than watermark",e);b.ended||b.reading?x("reading or ended",!1):
e&&(x("do read"),b.reading=!0,b.sync=!0,0===b.length&&(b.needReadable=!0),this._read(b.highWaterMark),b.sync=!1,b.reading||(c=t(f,b)));e=0<c?A(c,b):null;null===e?(b.needReadable=!0,c=0):b.length-=c;0===b.length&&(b.ended||(b.needReadable=!0),f!==c&&b.ended&&E(this));null!==e&&this.emit("data",e);return e};b.prototype._read=function(a){this.emit("error",Error("_read() is not implemented"))};b.prototype.pipe=function(a,c){function b(a){x("onunpipe");a===t&&e()}function f(){x("onend");a.end()}function e(){x("cleanup");
a.removeListener("close",u);a.removeListener("finish",A);a.removeListener("drain",v);a.removeListener("error",g);a.removeListener("unpipe",b);t.removeListener("end",f);t.removeListener("end",e);t.removeListener("data",d);U=!0;!F.awaitDrain||a._writableState&&!a._writableState.needDrain||v()}function d(c){x("ondata");S=!1;!1!==a.write(c)||S||((1===F.pipesCount&&F.pipes===a||1<F.pipesCount&&-1!==D(F.pipes,a))&&!U&&(x("false write response, pause",t._readableState.awaitDrain),t._readableState.awaitDrain++,
S=!0),t.pause())}function g(c){x("onerror",c);P();a.removeListener("error",g);0===a.listeners("error").length&&a.emit("error",c)}function u(){a.removeListener("finish",A);P()}function A(){x("onfinish");a.removeListener("close",u);P()}function P(){x("unpipe");t.unpipe(a)}var t=this,F=this._readableState;switch(F.pipesCount){case 0:F.pipes=a;break;case 1:F.pipes=[F.pipes,a];break;default:F.pipes.push(a)}F.pipesCount+=1;x("pipe count=%d opts=%j",F.pipesCount,c);c=c&&!1===c.end||a===n.stdout||a===n.stderr?
e:f;if(F.endEmitted)I(c);else t.once("end",c);a.on("unpipe",b);var v=k(t);a.on("drain",v);var U=!1,S=!1;t.on("data",d);h(a,"error",g);a.once("close",u);a.once("finish",A);a.emit("pipe",t);F.flowing||(x("pipe resume"),t.resume());return a};b.prototype.unpipe=function(a){var c=this._readableState;if(0===c.pipesCount)return this;if(1===c.pipesCount){if(a&&a!==c.pipes)return this;a||(a=c.pipes);c.pipes=null;c.pipesCount=0;c.flowing=!1;a&&a.emit("unpipe",this);return this}if(!a){a=c.pipes;var b=c.pipesCount;
c.pipes=null;c.pipesCount=0;c.flowing=!1;for(c=0;c<b;c++)a[c].emit("unpipe",this);return this}b=D(c.pipes,a);if(-1===b)return this;c.pipes.splice(b,1);--c.pipesCount;1===c.pipesCount&&(c.pipes=c.pipes[0]);a.emit("unpipe",this);return this};b.prototype.on=function(b,f){f=z.prototype.on.call(this,b,f);"data"===b?!1!==this._readableState.flowing&&this.resume():"readable"===b&&(b=this._readableState,b.endEmitted||b.readableListening||(b.readableListening=b.needReadable=!0,b.emittedReadable=!1,b.reading?
b.length&&a(this,b):I(c,this)));return f};b.prototype.addListener=b.prototype.on;b.prototype.resume=function(){var a=this._readableState;a.flowing||(x("resume"),a.flowing=!0,a.resumeScheduled||(a.resumeScheduled=!0,I(f,this,a)));return this};b.prototype.pause=function(){x("call pause flowing=%j",this._readableState.flowing);!1!==this._readableState.flowing&&(x("pause"),this._readableState.flowing=!1,this.emit("pause"));return this};b.prototype.wrap=function(a){var c=this._readableState,b=!1,f=this;
a.on("end",function(){x("wrapped end");if(c.decoder&&!c.ended){var a=c.decoder.end();a&&a.length&&f.push(a)}f.push(null)});a.on("data",function(e){x("wrapped data");c.decoder&&(e=c.decoder.write(e));c.objectMode&&(null===e||void 0===e)||!(c.objectMode||e&&e.length)||f.push(e)||(b=!0,a.pause())});for(var e in a)void 0===this[e]&&"function"===typeof a[e]&&(this[e]=function(c){return function(){return a[c].apply(a,arguments)}}(e));y(["error","close","destroy","pause","resume"],function(c){a.on(c,f.emit.bind(f,
c))});f._read=function(c){x("wrapped _read",c);b&&(b=!1,a.resume())};return f};b._fromList=A}).call(this,d("_process"))},{"./_stream_duplex":14,"./internal/streams/BufferList":19,_process:12,buffer:5,"buffer-shims":3,"core-util-is":4,events:6,inherits:8,isarray:10,"process-nextick-args":11,"string_decoder/":26,util:2}],17:[function(d,q,p){function n(b){this.afterTransform=function(d,a){var e=b._transformState;e.transforming=!1;var g=e.writecb;g?(e.writechunk=null,e.writecb=null,null!==a&&void 0!==
a&&b.push(a),g(d),d=b._readableState,d.reading=!1,(d.needReadable||d.length<d.highWaterMark)&&b._read(d.highWaterMark),d=void 0):d=b.emit("error",Error("no writecb in Transform class"));return d};this.transforming=this.needTransform=!1;this.writeencoding=this.writechunk=this.writecb=null}function h(d){if(!(this instanceof h))return new h(d);b.call(this,d);this._transformState=new n(this);var t=this;this._readableState.needReadable=!0;this._readableState.sync=!1;d&&("function"===typeof d.transform&&
(this._transform=d.transform),"function"===typeof d.flush&&(this._flush=d.flush));this.once("prefinish",function(){"function"===typeof this._flush?this._flush(function(a,b){g(t,a,b)}):g(t)})}function g(b,d,a){if(d)return b.emit("error",d);null!==a&&void 0!==a&&b.push(a);d=b._transformState;if(b._writableState.length)throw Error("Calling transform done when ws.length != 0");if(d.transforming)throw Error("Calling transform done when still transforming");return b.push(null)}q.exports=h;var b=d("./_stream_duplex");
q=d("core-util-is");q.inherits=d("inherits");q.inherits(h,b);h.prototype.push=function(d,g){this._transformState.needTransform=!1;return b.prototype.push.call(this,d,g)};h.prototype._transform=function(b,d,a){throw Error("_transform() is not implemented");};h.prototype._write=function(b,d,a){var e=this._transformState;e.writecb=a;e.writechunk=b;e.writeencoding=d;e.transforming||(b=this._readableState,(e.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark))};h.prototype._read=
function(b){b=this._transformState;null!==b.writechunk&&b.writecb&&!b.transforming?(b.transforming=!0,this._transform(b.writechunk,b.writeencoding,b.afterTransform)):b.needTransform=!0}},{"./_stream_duplex":14,"core-util-is":4,inherits:8}],18:[function(d,q,p){(function(n,h){function g(){}function b(a,c,b){this.chunk=a;this.encoding=c;this.callback=b;this.next=null}function p(a,c){E=E||d("./_stream_duplex");a=a||{};this.objectMode=!!a.objectMode;c instanceof E&&(this.objectMode=this.objectMode||!!a.writableObjectMode);
var b=a.highWaterMark,g=this.objectMode?16:16384;this.highWaterMark=b||0===b?b:g;this.highWaterMark=~~this.highWaterMark;this.finished=this.ended=this.ending=this.needDrain=!1;this.decodeStrings=!1!==a.decodeStrings;this.defaultEncoding=a.defaultEncoding||"utf8";this.length=0;this.writing=!1;this.corked=0;this.sync=!0;this.bufferProcessing=!1;this.onwrite=function(a){var b=c._writableState,f=b.sync,d=b.writecb;b.writing=!1;b.writecb=null;b.length-=b.writelen;b.writelen=0;a?(--b.pendingcb,f?u(d,a):
d(a),c._writableState.errorEmitted=!0,c.emit("error",a)):((a=k(b))||b.corked||b.bufferProcessing||!b.bufferedRequest||v(c,b),f?A(e,c,b,a,d):e(c,b,a,d))};this.writecb=null;this.writelen=0;this.lastBufferedRequest=this.bufferedRequest=null;this.pendingcb=0;this.errorEmitted=this.prefinished=!1;this.bufferedRequestCount=0;this.corkedRequestsFree=new f(this)}function t(a){E=E||d("./_stream_duplex");if(!(G.call(t,this)||this instanceof E))return new t(a);this._writableState=new