UNPKG

s-pipe

Version:

Functional streams, with a lisp-inspired chaining syntax

2 lines 55.4 kB
!function(e){"object"==typeof exports?module.exports=e:"function"==typeof define&&define.amd&&define(function(){return e})}(function(e){var t=this;e.define("7",function(t){function n(e){this.source=e,this.started=!1,this.ended=!1,this.endEmitted=!1}var r=e("8",t).PassThrough,i=(e("6",t),e("9",t)),o=i.extend({constructor:function(e){i.call(this),this._pullState=new n(e||new r)},_write:function(e,t,n){this._pullState.source._write(e,t,n)},_read:function(){var e=this,t=this._pullState;t.started||(t.started=!0,t.ended=!1,this.on("pause",function(){t.source.pause()}),this.on("resume",function(){t.source.resume()}),t.source.on("close",function(){e.emit("close")}),t.source.on("error",function(t){e.emit("error",t)}),t.source.on("end",function(){e._end()}),t.source.on("data",function(t){e._process(t)}))},_done:function(){var e=this._pullState;return e.ended||(e.ended=e.source._done?e.source._done():!1)},setEncoding:function(e){return this._pullState.source.setEncoding(e)},close:function(){var e=this._pullState;this.pause(),"function"==typeof e.source.close&&e.source.close(),e.ended=!0},destroy:function(){var e=this._pullState;this.pause(),"function"==typeof e.source.destroy&&e.source.destroy(),e.ended=!0}});t.exports=o}),e.define("9",function(t){var n=e("8",t).Duplex,r=e("6",t),i=e("5",t),o=r({constructor:function(){n.call(this,{objectMode:!0})},push:function(e){var t=this._readableState;t.length+=1,t.buffer.push(e),t.reading=!1,this._done()&&this._end()},_forward:function(e){this.emit("data",e),this._done()&&this._end()},_end:function(){i.func(this._ended)&&this._ended(),n.prototype.push.call(this,null)},_done:function(){throw new Error("not implemented")}},n);t.exports=o}),e.define("6",function(t){var n=e("10",t),r=e("4",t);t.exports=function i(e,t){var o,s;"function"==typeof e?(s={},e.call(s)):s=e,o=s.constructor,r(s,"constructor")||(o=t?function(){t.apply(this,arguments)}:function(){}),delete s.constructor,t&&n(o,t);for(var a in s)r(s,a)&&(o.prototype[a]=s[a]);return o.extend=function(e){return i(e,o)},o}}),e.define("4",function(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}}),e.define("10",function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),e.define("8",function(t){function n(){r.call(this)}t.exports=n;var r=e("11",t).EventEmitter,i=e("12",t);i.inherits(n,r),n.Readable=e("13",t),n.Writable=e("14",t),n.Duplex=e("15",t),n.Transform=e("16",t),n.PassThrough=e("17",t),n.Stream=n,n.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&c.pause&&c.pause()}function i(){c.readable&&c.resume&&c.resume()}function o(){f||(f=!0,e.end())}function s(){f||(f=!0,"function"==typeof e.destroy&&e.destroy())}function a(e){if(u(),0===r.listenerCount(this,"error"))throw e}function u(){c.removeListener("data",n),e.removeListener("drain",i),c.removeListener("end",o),c.removeListener("close",s),c.removeListener("error",a),e.removeListener("error",a),c.removeListener("end",u),c.removeListener("close",u),e.removeListener("close",u)}var c=this;c.on("data",n),e.on("drain",i),e._isStdio||t&&t.end===!1||(c.on("end",o),c.on("close",s));var f=!1;return c.on("error",a),e.on("error",a),c.on("end",u),c.on("close",u),e.on("close",u),e.emit("pipe",c),e}}),e.define("17",function(t){function n(e){return this instanceof n?(r.call(this,e),void 0):new n(e)}t.exports=n;var r=e("16",t),i=e("12",t);i.inherits(n,r),n.prototype._transform=function(e,t,n){n(null,e)}}),e.define("12",function(t,n){function i(e,t){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(t)?r.showHidden=t:t&&n._extend(r,t),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function s(e){return e}function a(e){var t={};return R.forEach(e,function(e){t[e]=!0}),t}function u(e,t,r){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r);return b(i)||(i=u(e,i,r)),i}var o=c(e,t);if(o)return o;var s=R.keys(t),g=a(s);if(e.showHidden&&(s=R.getOwnPropertyNames(t)),0===s.length){if(O(t)){var m=t.name?": "+t.name:"";return e.stylize("[Function"+m+"]","special")}if(E(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(S(t))return e.stylize(Date.prototype.toString.call(t),"date");if(x(t))return f(t)}var y="",v=!1,w=["{","}"];if(p(t)&&(v=!0,w=["[","]"]),O(t)){var _=t.name?": "+t.name:"";y=" [Function"+_+"]"}if(E(t)&&(y=" "+RegExp.prototype.toString.call(t)),S(t)&&(y=" "+Date.prototype.toUTCString.call(t)),x(t)&&(y=" "+f(t)),0===s.length&&(!v||0==t.length))return w[0]+y+w[1];if(0>r)return E(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var k;return k=v?l(e,t,r,g,s):s.map(function(n){return h(e,t,r,g,n,v)}),e.seen.pop(),d(k,y,w)}function c(e,t){if(_(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return v(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,n,r,i){for(var o=[],s=0,a=t.length;a>s;++s)A(t,String(s))?o.push(h(e,t,n,r,String(s),!0)):o.push("");return R.forEach(i,function(i){i.match(/^\d+$/)||o.push(h(e,t,n,r,i,!0))}),o}function h(e,t,n,r,i,o){var s,a,c;if(c=R.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),A(r,i)||(s="["+i+"]"),a||(R.indexOf(e.seen,c.value)<0?(a=m(n)?u(e,c.value,null):u(e,c.value,n-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),_(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function d(e,t,n){var r=0,i=R.reduce(e,function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function p(e){return R.isArray(e)}function g(e){return"boolean"==typeof e}function m(e){return null===e}function y(e){return null==e}function v(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function _(e){return void 0===e}function E(e){return k(e)&&"[object RegExp]"===j(e)}function k(e){return"object"==typeof e&&e}function S(e){return k(e)&&"[object Date]"===j(e)}function x(e){return k(e)&&"[object Error]"===j(e)}function O(e){return"function"==typeof e}function L(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function I(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.binarySlice}function j(e){return Object.prototype.toString.call(e)}function M(e){return 10>e?"0"+e.toString(10):e.toString(10)}function T(){var e=new Date,t=[M(e.getHours()),M(e.getMinutes()),M(e.getSeconds())].join(":");return[e.getDate(),B[e.getMonth()],t].join(" ")}function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var R=e("18",t),C=/%[sdj%]/g;n.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,s=String(e).replace(C,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),a=r[n];o>n;a=r[++n])s+=m(a)||!k(a)?" "+a:" "+i(a);return s},n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=p,n.isBoolean=g,n.isNull=m,n.isNullOrUndefined=y,n.isNumber=v,n.isString=b,n.isSymbol=w,n.isUndefined=_,n.isRegExp=E,n.isObject=k,n.isDate=S,n.isError=x,n.isFunction=O,n.isPrimitive=L,n.isBuffer=I;var B=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){r.log("%s - %s",T(),n.format.apply(n,arguments))},n.inherits=function(e,t){e.super_=t,e.prototype=R.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},n._extend=function(e,t){if(!t||!k(t))return e;for(var n=R.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}),e.define("18",function(e,t){function n(e){return"[object Array]"===u.call(e)}function r(e,t){var n;if(null===e)n={__proto__:null};else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,n=new r,n.__proto__=e}return"undefined"!=typeof t&&Object.defineProperties&&Object.defineProperties(n,t),n}function i(e){return"object"!=typeof e&&"function"!=typeof e||null===e}function o(e){if(i(e))throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)c.call(e,n)&&t.push(n);return t}function s(e){if(i(e))throw new TypeError("Object.getOwnPropertyNames called on a non-object");var n=o(e);return t.isArray(e)&&-1===t.indexOf(e,"length")&&n.push("length"),n}function a(e,t){return{value:e[t]}}var u=Object.prototype.toString,c=Object.prototype.hasOwnProperty;t.isArray="function"==typeof Array.isArray?Array.isArray:n,t.indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(t===e[n])return n;return-1},t.filter=function(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n},t.forEach=function(e,t,n){if(e.forEach)return e.forEach(t,n);for(var r=0;r<e.length;r++)t.call(n,e[r],r,e)},t.map=function(e,t){if(e.map)return e.map(t);for(var n=new Array(e.length),r=0;r<e.length;r++)n[r]=t(e[r],r,e);return n},t.reduce=function(e,t,n){if(e.reduce)return e.reduce(t,n);var r,i=!1;2<arguments.length&&(r=n,i=!0);for(var o=0,s=e.length;s>o;++o)e.hasOwnProperty(o)&&(i?r=t(r,e[o],o,e):(r=e[o],i=!0));return r},t.substr="b"!=="ab".substr(-1)?function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}:function(e,t,n){return e.substr(t,n)},t.trim=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},t.bind=function(){var e=Array.prototype.slice.call(arguments),t=e.shift();if(t.bind)return t.bind.apply(t,e);var n=e.shift();return function(){t.apply(n,e.concat([Array.prototype.slice.call(arguments)]))}},t.create="function"==typeof Object.create?Object.create:r;var f="function"==typeof Object.keys?Object.keys:o,l="function"==typeof Object.getOwnPropertyNames?Object.getOwnPropertyNames:s;if((new Error).hasOwnProperty("description")){var h=function(e,n){return"[object Error]"===u.call(e)&&(n=t.filter(n,function(e){return"description"!==e&&"number"!==e&&"message"!==e})),n};t.keys=function(e){return h(e,f(e))},t.getOwnPropertyNames=function(e){return h(e,l(e))}}else t.keys=f,t.getOwnPropertyNames=l;if("function"==typeof Object.getOwnPropertyDescriptor)try{Object.getOwnPropertyDescriptor({a:1},"a"),t.getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor}catch(d){t.getOwnPropertyDescriptor=function(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch(n){return a(e,t)}}}else t.getOwnPropertyDescriptor=a}),e.define("16",function(t,n,r,i,o){function s(e,t){this.afterTransform=function(e,n){return a(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function a(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&n!==o&&e.push(n),i&&i(t);var s=e._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&e._read(s.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);f.call(this,e);var t=(this._transformState=new s(e,this),this);this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("finish",function(){"function"==typeof this._flush?this._flush(function(e){c(t,e)}):c(t)})}function c(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=(e._readableState,e._transformState);if(n.length)throw new Error("calling transform done when ws.length != 0");if(r.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}t.exports=u;var f=e("15",t),l=e("12",t);l.inherits(u,f),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,f.prototype.push.call(this,e,t)},u.prototype._transform=function(){throw new Error("not implemented")},u.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(){var e=this._transformState;e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0}}),e.define("15",function(t){function n(e){return this instanceof n?(a.call(this,e),u.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),this.once("end",r),void 0):new n(e)}function r(){this.allowHalfOpen||this._writableState.ended||s.setImmediate(o.bind(this.end,this))}t.exports=n;var i=e("12",t),o=e("18",t),s=e("19",t),a=e("13",t),u=e("14",t);i.inherits(n,a),o.forEach(o.keys(u.prototype),function(e){n.prototype[e]||(n.prototype[e]=u.prototype[e])})}),e.define("14",function(t,n,r,i,o){function s(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function a(e,t){e=e||{};var n=e.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var r=e.decodeStrings===!1;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){m(t,e)},this.writecb=null,this.writelen=0,this.buffer=[]}function u(e){return this instanceof u||this instanceof S.Duplex?(this._writableState=new a(e,this),this.writable=!0,S.call(this),void 0):new u(e)}function c(e,t,n){var r=new Error("write after end");e.emit("error",r),x.setImmediate(function(){n(r)})}function f(e,t,n,r){var i=!0;if(!O.isBuffer(n)&&"string"!=typeof n&&null!==n&&n!==o&&!t.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s),x.setImmediate(function(){r(s)}),i=!1}return i}function l(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new O(t,n)),t}function h(e,t,n,r,i){n=l(t,n,r);var o=t.objectMode?1:n.length;t.length+=o;var a=t.length<t.highWaterMark;return t.needDrain=!a,t.writing?t.buffer.push(new s(n,r,i)):d(e,t,o,n,r,i),a}function d(e,t,n,r,i,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,e._write(r,i,t.onwrite),t.sync=!1}function p(e,t,n,r,i){n?x.setImmediate(function(){i(r)}):i(r),e.emit("error",r)}function g(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function m(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(g(n),t)p(e,n,r,t,i);else{var o=w(e,n);o||n.bufferProcessing||!n.buffer.length||b(e,n),r?x.setImmediate(function(){y(e,n,o,i)}):y(e,n,o,i)}}function y(e,t,n,r){n||v(e,t),r(),n&&_(e,t)}function v(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function b(e,t){t.bufferProcessing=!0;for(var n=0;n<t.buffer.length;n++){var r=t.buffer[n],i=r.chunk,o=r.encoding,s=r.callback,a=t.objectMode?1:i.length;if(d(e,t,a,i,o,s),t.writing){n++;break}}t.bufferProcessing=!1,n<t.buffer.length?t.buffer=t.buffer.slice(n):t.buffer.length=0}function w(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function _(e,t){var n=w(e,t);return n&&(t.finished=!0,e.emit("finish")),n}function E(e,t,n){t.ending=!0,_(e,t),n&&(t.finished?x.setImmediate(n):e.once("finish",n)),t.ended=!0}t.exports=u,u.WritableState=a;var k=e("12",t),S=e("8",t),x=e("19",t),O=e("20",t).Buffer;k.inherits(u,S),u.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},u.prototype.write=function(e,t,n){var r=this._writableState,i=!1;return"function"==typeof t&&(n=t,t=null),O.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=function(){}),r.ended?c(this,r,n):f(this,r,e,n)&&(i=h(this,r,e,t,n)),i},u.prototype._write=function(e,t,n){n(new Error("not implemented"))},u.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),"undefined"!=typeof e&&null!==e&&this.write(e,t),r.ending||r.finished||E(this,r,n)}}),e.define("20",function(t,n,r,i,o){function s(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function a(n,r,i){if(R||(R=e("21",t)),!(this instanceof a))return new a(n,r,i);if(this.parent=this,this.offset=0,"base64"==r&&"string"==typeof n)for(n=s(n);n.length%4!=0;)n+="=";var o;if("number"==typeof i){this.length=c(r);for(var u=0;u<this.length;u++)this[u]=n.get(u+i)}else{switch(o=typeof n){case"number":this.length=c(n);break;case"string":this.length=a.byteLength(n,r);break;case"object":this.length=c(n.length);break;default:throw new Error("First argument needs to be a number, array or string.")}if(l(n))for(var u=0;u<this.length;u++)this[u]=n instanceof a?n.readUInt8(u):n[u];else if("string"==o)this.length=this.write(n,0,r);else if("number"===o)for(var u=0;u<this.length;u++)this[u]=0}}function u(e,t,n){return"number"!=typeof e?n:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function c(e){return e=~~Math.ceil(+e),0>e?0:e}function f(e){return(Array.isArray||function(e){return"[object Array]"=={}.toString.apply(e)})(e)}function l(e){return f(e)||a.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function h(e){return 16>e?"0"+e.toString(16):e.toString(16)}function d(e){for(var t=[],n=0;n<e.length;n++)if(e.charCodeAt(n)<=127)t.push(e.charCodeAt(n));else for(var r=encodeURIComponent(e.charAt(n)).substr(1).split("%"),i=0;i<r.length;i++)t.push(parseInt(r[i],16));return t}function p(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function g(n){return e("22",t).toByteArray(n)}function m(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);)t[i+n]=e[i],i++;return i}function y(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function v(e,t,n,r){var i=0;return r||(R.ok("boolean"==typeof n,"missing or invalid endian"),R.ok(t!==o&&null!==t,"missing offset"),R.ok(t+1<e.length,"Trying to read beyond buffer length")),t>=e.length?0:(n?(i=e[t]<<8,t+1<e.length&&(i|=e[t+1])):(i=e[t],t+1<e.length&&(i|=e[t+1]<<8)),i)}function b(e,t,n,r){var i=0;return r||(R.ok("boolean"==typeof n,"missing or invalid endian"),R.ok(t!==o&&null!==t,"missing offset"),R.ok(t+3<e.length,"Trying to read beyond buffer length")),t>=e.length?0:(n?(t+1<e.length&&(i=e[t+1]<<16),t+2<e.length&&(i|=e[t+2]<<8),t+3<e.length&&(i|=e[t+3]),i+=e[t]<<24>>>0):(t+2<e.length&&(i=e[t+2]<<16),t+1<e.length&&(i|=e[t+1]<<8),i|=e[t],t+3<e.length&&(i+=e[t+3]<<24>>>0)),i)}function w(e,t,n,r){var i,s;return r||(R.ok("boolean"==typeof n,"missing or invalid endian"),R.ok(t!==o&&null!==t,"missing offset"),R.ok(t+1<e.length,"Trying to read beyond buffer length")),s=v(e,t,n,r),i=32768&s,i?-1*(65535-s+1):s}function _(e,t,n,r){var i,s;return r||(R.ok("boolean"==typeof n,"missing or invalid endian"),R.ok(t!==o&&null!==t,"missing offset"),R.ok(t+3<e.length,"Trying to read beyond buffer length")),s=b(e,t,n,r),i=2147483648&s,i?-1*(4294967295-s+1):s}function E(n,r,i,o){return o||(R.ok("boolean"==typeof i,"missing or invalid endian"),R.ok(r+3<n.length,"Trying to read beyond buffer length")),e("23",t).readIEEE754(n,r,i,23,4)}function k(n,r,i,o){return o||(R.ok("boolean"==typeof i,"missing or invalid endian"),R.ok(r+7<n.length,"Trying to read beyond buffer length")),e("23",t).readIEEE754(n,r,i,52,8)}function S(e,t){R.ok("number"==typeof e,"cannot write a non-number as a number"),R.ok(e>=0,"specified a negative value for writing an unsigned value"),R.ok(t>=e,"value is larger than maximum value for type"),R.ok(Math.floor(e)===e,"value has a fractional component")}function x(e,t,n,r,i){i||(R.ok(t!==o&&null!==t,"missing value"),R.ok("boolean"==typeof r,"missing or invalid endian"),R.ok(n!==o&&null!==n,"missing offset"),R.ok(n+1<e.length,"trying to write beyond buffer length"),S(t,65535));for(var s=0;s<Math.min(e.length-n,2);s++)e[n+s]=(t&255<<8*(r?1-s:s))>>>8*(r?1-s:s)}function O(e,t,n,r,i){i||(R.ok(t!==o&&null!==t,"missing value"),R.ok("boolean"==typeof r,"missing or invalid endian"),R.ok(n!==o&&null!==n,"missing offset"),R.ok(n+3<e.length,"trying to write beyond buffer length"),S(t,4294967295));for(var s=0;s<Math.min(e.length-n,4);s++)e[n+s]=t>>>8*(r?3-s:s)&255}function L(e,t,n){R.ok("number"==typeof e,"cannot write a non-number as a number"),R.ok(t>=e,"value larger than maximum allowed value"),R.ok(e>=n,"value smaller than minimum allowed value"),R.ok(Math.floor(e)===e,"value has a fractional component")}function I(e,t,n){R.ok("number"==typeof e,"cannot write a non-number as a number"),R.ok(t>=e,"value larger than maximum allowed value"),R.ok(e>=n,"value smaller than minimum allowed value")}function j(e,t,n,r,i){i||(R.ok(t!==o&&null!==t,"missing value"),R.ok("boolean"==typeof r,"missing or invalid endian"),R.ok(n!==o&&null!==n,"missing offset"),R.ok(n+1<e.length,"Trying to write beyond buffer length"),L(t,32767,-32768)),t>=0?x(e,t,n,r,i):x(e,65535+t+1,n,r,i)}function M(e,t,n,r,i){i||(R.ok(t!==o&&null!==t,"missing value"),R.ok("boolean"==typeof r,"missing or invalid endian"),R.ok(n!==o&&null!==n,"missing offset"),R.ok(n+3<e.length,"Trying to write beyond buffer length"),L(t,2147483647,-2147483648)),t>=0?O(e,t,n,r,i):O(e,4294967295+t+1,n,r,i)}function T(n,r,i,s,a){a||(R.ok(r!==o&&null!==r,"missing value"),R.ok("boolean"==typeof s,"missing or invalid endian"),R.ok(i!==o&&null!==i,"missing offset"),R.ok(i+3<n.length,"Trying to write beyond buffer length"),I(r,3.4028234663852886e38,-3.4028234663852886e38)),e("23",t).writeIEEE754(n,r,i,s,23,4)}function A(n,r,i,s,a){a||(R.ok(r!==o&&null!==r,"missing value"),R.ok("boolean"==typeof s,"missing or invalid endian"),R.ok(i!==o&&null!==i,"missing offset"),R.ok(i+7<n.length,"Trying to write beyond buffer length"),I(r,1.7976931348623157e308,-1.7976931348623157e308)),e("23",t).writeIEEE754(n,r,i,s,52,8)}var R;n.Buffer=a,n.SlowBuffer=a,a.poolSize=8192,n.INSPECT_MAX_BYTES=50,a.prototype.get=function(e){if(0>e||e>=this.length)throw new Error("oob");return this[e]},a.prototype.set=function(e,t){if(0>e||e>=this.length)throw new Error("oob");return this[e]=t},a.byteLength=function(e,t){switch(t||"utf8"){case"hex":return e.length/2;case"utf8":case"utf-8":return d(e).length;case"ascii":case"binary":return e.length;case"base64":return g(e).length;default:throw new Error("Unknown encoding")}},a.prototype.utf8Write=function(e,t,n){return a._charsWritten=m(d(e),this,t,n)},a.prototype.asciiWrite=function(e,t,n){return a._charsWritten=m(p(e),this,t,n)},a.prototype.binaryWrite=a.prototype.asciiWrite,a.prototype.base64Write=function(e,t,n){return a._charsWritten=m(g(e),this,t,n)},a.prototype.base64Slice=function(){var n=Array.prototype.slice.apply(this,arguments);return e("22",t).fromByteArray(n)},a.prototype.utf8Slice=function(){for(var e=Array.prototype.slice.apply(this,arguments),t="",n="",r=0;r<e.length;)e[r]<=127?(t+=y(n)+String.fromCharCode(e[r]),n=""):n+="%"+e[r].toString(16),r++;return t+y(n)},a.prototype.asciiSlice=function(){for(var e=Array.prototype.slice.apply(this,arguments),t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},a.prototype.binarySlice=a.prototype.asciiSlice,a.prototype.inspect=function(){for(var e=[],t=this.length,r=0;t>r;r++)if(e[r]=h(this[r]),r==n.INSPECT_MAX_BYTES){e[r+1]="...";break}return"<Buffer "+e.join(" ")+">"},a.prototype.hexSlice=function(e,t){var n=this.length;(!e||0>e)&&(e=0),(!t||0>t||t>n)&&(t=n);for(var r="",i=e;t>i;i++)r+=h(this[i]);return r},a.prototype.toString=function(e,t,n){if(e=String(e||"utf8").toLowerCase(),t=+t||0,"undefined"==typeof n&&(n=this.length),+n==t)return"";switch(e){case"hex":return this.hexSlice(t,n);case"utf8":case"utf-8":return this.utf8Slice(t,n);case"ascii":return this.asciiSlice(t,n);case"binary":return this.binarySlice(t,n);case"base64":return this.base64Slice(t,n);case"ucs2":case"ucs-2":return this.ucs2Slice(t,n);default:throw new Error("Unknown encoding")}},a.prototype.hexWrite=function(e,t,n){t=+t||0;var r=this.length-t;n?(n=+n,n>r&&(n=r)):n=r;var i=e.length;if(i%2)throw new Error("Invalid hex string");n>i/2&&(n=i/2);for(var o=0;n>o;o++){var s=parseInt(e.substr(2*o,2),16);if(isNaN(s))throw new Error("Invalid hex string");this[t+o]=s}return a._charsWritten=2*o,o},a.prototype.write=function(e,t,n,r){if(isFinite(t))isFinite(n)||(r=n,n=o);else{var i=r;r=t,t=n,n=i}t=+t||0;var s=this.length-t;switch(n?(n=+n,n>s&&(n=s)):n=s,r=String(r||"utf8").toLowerCase()){case"hex":return this.hexWrite(e,t,n);case"utf8":case"utf-8":return this.utf8Write(e,t,n);case"ascii":return this.asciiWrite(e,t,n);case"binary":return this.binaryWrite(e,t,n);case"base64":return this.base64Write(e,t,n);case"ucs2":case"ucs-2":return this.ucs2Write(e,t,n);default:throw new Error("Unknown encoding")}},a.prototype.slice=function(e,t){var n=this.length;return e=u(e,n,0),t=u(t,n,n),new a(this,t-e,+e)},a.prototype.copy=function(e,t,n,r){var i=this;if(n||(n=0),(r===o||isNaN(r))&&(r=this.length),t||(t=0),n>r)throw new Error("sourceEnd < sourceStart");if(r===n)return 0;if(0==e.length||0==i.length)return 0;if(0>t||t>=e.length)throw new Error("targetStart out of bounds");if(0>n||n>=i.length)throw new Error("sourceStart out of bounds");if(0>r||r>i.length)throw new Error("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);for(var s=[],a=n;r>a;a++)R.ok("undefined"!=typeof this[a],"copying undefined buffer bytes!"),s.push(this[a]);for(var a=t;a<t+s.length;a++)e[a]=s[a-t]},a.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),"number"!=typeof e||isNaN(e))throw new Error("value is not a number");if(t>n)throw new Error("end < start");if(n===t)return 0;if(0==this.length)return 0;if(0>t||t>=this.length)throw new Error("start out of bounds");if(0>n||n>this.length)throw new Error("end out of bounds");for(var r=t;n>r;r++)this[r]=e},a.isBuffer=function(e){return e instanceof a||e instanceof a},a.concat=function(e,t){if(!f(e))throw new Error("Usage: Buffer.concat(list, [totalLength])\n list should be an Array.");if(0===e.length)return new a(0);if(1===e.length)return e[0];if("number"!=typeof t){t=0;for(var n=0;n<e.length;n++){var r=e[n];t+=r.length}}for(var i=new a(t),o=0,n=0;n<e.length;n++){var r=e[n];r.copy(i,o),o+=r.length}return i},a.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},a.prototype.readUInt8=function(e,t){var n=this;return t||(R.ok(e!==o&&null!==e,"missing offset"),R.ok(e<n.length,"Trying to read beyond buffer length")),e>=n.length?void 0:n[e]},a.prototype.readUInt16LE=function(e,t){return v(this,e,!1,t)},a.prototype.readUInt16BE=function(e,t){return v(this,e,!0,t)},a.prototype.readUInt32LE=function(e,t){return b(this,e,!1,t)},a.prototype.readUInt32BE=function(e,t){return b(this,e,!0,t)},a.prototype.readInt8=function(e,t){var n,r=this;return t||(R.ok(e!==o&&null!==e,"missing offset"),R.ok(e<r.length,"Trying to read beyond buffer length")),e>=r.length?void 0:(n=128&r[e],n?-1*(255-r[e]+1):r[e])},a.prototype.readInt16LE=function(e,t){return w(this,e,!1,t)},a.prototype.readInt16BE=function(e,t){return w(this,e,!0,t)},a.prototype.readInt32LE=function(e,t){return _(this,e,!1,t)},a.prototype.readInt32BE=function(e,t){return _(this,e,!0,t)},a.prototype.readFloatLE=function(e,t){return E(this,e,!1,t)},a.prototype.readFloatBE=function(e,t){return E(this,e,!0,t)},a.prototype.readDoubleLE=function(e,t){return k(this,e,!1,t)},a.prototype.readDoubleBE=function(e,t){return k(this,e,!0,t)},a.prototype.writeUInt8=function(e,t,n){var r=this;n||(R.ok(e!==o&&null!==e,"missing value"),R.ok(t!==o&&null!==t,"missing offset"),R.ok(t<r.length,"trying to write beyond buffer length"),S(e,255)),t<r.length&&(r[t]=e)},a.prototype.writeUInt16LE=function(e,t,n){x(this,e,t,!1,n)},a.prototype.writeUInt16BE=function(e,t,n){x(this,e,t,!0,n)},a.prototype.writeUInt32LE=function(e,t,n){O(this,e,t,!1,n)},a.prototype.writeUInt32BE=function(e,t,n){O(this,e,t,!0,n)},a.prototype.writeInt8=function(e,t,n){var r=this;n||(R.ok(e!==o&&null!==e,"missing value"),R.ok(t!==o&&null!==t,"missing offset"),R.ok(t<r.length,"Trying to write beyond buffer length"),L(e,127,-128)),e>=0?r.writeUInt8(e,t,n):r.writeUInt8(255+e+1,t,n)},a.prototype.writeInt16LE=function(e,t,n){j(this,e,t,!1,n)},a.prototype.writeInt16BE=function(e,t,n){j(this,e,t,!0,n)},a.prototype.writeInt32LE=function(e,t,n){M(this,e,t,!1,n)},a.prototype.writeInt32BE=function(e,t,n){M(this,e,t,!0,n)},a.prototype.writeFloatLE=function(e,t,n){T(this,e,t,!1,n)},a.prototype.writeFloatBE=function(e,t,n){T(this,e,t,!0,n)},a.prototype.writeDoubleLE=function(e,t,n){A(this,e,t,!1,n)},a.prototype.writeDoubleBE=function(e,t,n){A(this,e,t,!0,n)}}),e.define("23",function(e,t){t.readIEEE754=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,f=-7,l=n?0:i-1,h=n?1:-1,d=e[t+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?0/0:1/0*(d?-1:1);s+=Math.pow(2,r),o-=c}return(d?-1:1)*s*Math.pow(2,o-r)},t.writeIEEE754=function(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?o-1:0,p=r?-1:1,g=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+l>=1?h/u:h*Math.pow(2,1-l),t*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+d]=255&s,d+=p,s/=256,c-=8);e[n+d-p]|=128*g}}),e.define("22",function(e){!function(){"use strict";function t(e){var t,n,i,o,s,a;if(e.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(s=e.indexOf("="),s=s>0?e.length-s:0,a=[],i=s>0?e.length-4:e.length,t=0,n=0;i>t;t+=4,n+=3)o=r.indexOf(e[t])<<18|r.indexOf(e[t+1])<<12|r.indexOf(e[t+2])<<6|r.indexOf(e[t+3]),a.push((16711680&o)>>16),a.push((65280&o)>>8),a.push(255&o);return 2===s?(o=r.indexOf(e[t])<<2|r.indexOf(e[t+1])>>4,a.push(255&o)):1===s&&(o=r.indexOf(e[t])<<10|r.indexOf(e[t+1])<<4|r.indexOf(e[t+2])>>2,a.push(o>>8&255),a.push(255&o)),a}function n(e){function t(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}var n,i,o,s=e.length%3,a="";for(n=0,o=e.length-s;o>n;n+=3)i=(e[n]<<16)+(e[n+1]<<8)+e[n+2],a+=t(i);switch(s){case 1:i=e[e.length-1],a+=r[i>>2],a+=r[i<<4&63],a+="==";break;case 2:i=(e[e.length-2]<<8)+e[e.length-1],a+=r[i>>10],a+=r[i>>4&63],a+=r[i<<2&63],a+="=" }return a}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports.toByteArray=t,e.exports.fromByteArray=n}()}),e.define("21",function(t){function n(e,t){return h.isUndefined(t)?""+t:!h.isNumber(t)||!isNaN(t)&&isFinite(t)?h.isFunction(t)||h.isRegExp(t)?t.toString():t:t.toString()}function r(e,t){return h.isString(e)?e.length<t?e:e.slice(0,t):e}function i(e){return r(JSON.stringify(e.actual,n),128)+" "+e.operator+" "+r(JSON.stringify(e.expected,n),128)}function o(e,t,n,r,i){throw new g.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function s(e,t){e||o(e,!0,t,"==",g.ok)}function a(e,t){if(e===t)return!0;if(h.isBuffer(e)&&h.isBuffer(t)){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return h.isDate(e)&&h.isDate(t)?e.getTime()===t.getTime():h.isRegExp(e)&&h.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:h.isObject(e)||h.isObject(t)?c(e,t):e==t}function u(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function c(e,t){if(h.isNullOrUndefined(e)||h.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(u(e))return u(t)?(e=p.call(e),t=p.call(t),a(e,t)):!1;try{var n,r,i=d.keys(e),o=d.keys(t)}catch(s){return!1}if(i.length!=o.length)return!1;for(i.sort(),o.sort(),r=i.length-1;r>=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(n=i[r],!a(e[n],t[n]))return!1;return!0}function f(e,t){return e&&t?"[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t?!0:t.call({},e)===!0?!0:!1:!1}function l(e,t,n,r){var i;h.isString(n)&&(r=n,n=null);try{t()}catch(s){i=s}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&o(i,n,"Missing expected exception"+r),!e&&f(i,n)&&o(i,n,"Got unwanted exception"+r),e&&i&&n&&!f(i,n)||!e&&i)throw i}var h=e("12",t),d=e("18",t),p=Array.prototype.slice,g=t.exports=s;g.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,this.message=e.message||i(this)},h.inherits(g.AssertionError,Error),g.fail=o,g.ok=s,g.equal=function(e,t,n){e!=t&&o(e,t,n,"==",g.equal)},g.notEqual=function(e,t,n){e==t&&o(e,t,n,"!=",g.notEqual)},g.deepEqual=function(e,t,n){a(e,t)||o(e,t,n,"deepEqual",g.deepEqual)},g.notDeepEqual=function(e,t,n){a(e,t)&&o(e,t,n,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(e,t,n){e!==t&&o(e,t,n,"===",g.strictEqual)},g.notStrictEqual=function(e,t,n){e===t&&o(e,t,n,"!==",g.notStrictEqual)},g.throws=function(){l.apply(this,[!0].concat(p.call(arguments)))},g.doesNotThrow=function(){l.apply(this,[!1].concat(p.call(arguments)))},g.ifError=function(e){if(e)throw e}}),e.define("19",function(e,t){function n(e,t){return function(){return e.apply(t,arguments)}}try{if(setTimeout.call)t.setTimeout=setTimeout,t.setInterval=setInterval;else{var r=Array.prototype.slice;t.setTimeout=function(e){var t=r.call(arguments,1);return setTimeout(function(){return e.apply(this,t)})},t.setInterval=function(e){var t=r.call(arguments,1);return setInterval(function(){return e.apply(this,t)})}}t.clearTimeout=clearTimeout,t.clearInterval=clearInterval,window.setImmediate&&(t.setImmediate=window.setImmediate,t.clearImmediate=window.clearImmediate),t.setTimeout(function(){})}catch(i){"undefined"!=typeof window?(t.setTimeout=n(setTimeout,window),t.setInterval=n(setInterval,window),t.clearTimeout=n(clearTimeout,window),t.clearInterval=n(clearInterval,window),window.setImmediate&&(t.setImmediate=n(window.setImmediate,window),t.clearImmediate=n(window.clearImmediate,window))):("undefined"!=typeof setTimeout&&(t.setTimeout=setTimeout),"undefined"!=typeof setInterval&&(t.setInterval=setInterval),"undefined"!=typeof clearTimeout&&(t.clearTimeout=clearTimeout),"function"==typeof clearInterval&&(t.clearInterval=clearInterval))}if(t.unref=function(){},t.ref=function(){},!t.setImmediate){var o=0,s={},a=!1;t.setImmediate=function(){function e(){a=!1;for(var e in s)if(s.hasOwnProperty(o,e)){var t=s[e];delete s[e],t()}}return"undefined"!=typeof window&&window.postMessage&&window.addEventListener?(window.addEventListener("message",function(t){t.source===window&&"browserify-tick"===t.data&&(t.stopPropagation(),e())},!0),function(e){var t=++o;return s[t]=e,a||(a=!0,window.postMessage("browserify-tick","*")),t}):function(t){var n=++o;return s[n]=t,a||(a=!0,setTimeout(e,0)),n}}(),t.clearImmediate=function(e){delete s[e]}}}),e.define("13",function(t,n,r,i,s){function a(n){n=n||{};var r=n.highWaterMark;this.highWaterMark=r||0===r?r:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!n.objectMode,this.defaultEncoding=n.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,n.encoding&&(x||(x=e("24",t).StringDecoder),this.decoder=new x(n.encoding),this.encoding=n.encoding)}function u(e){return this instanceof u?(this._readableState=new a(e,this),this.readable=!0,L.call(this),void 0):new u(e)}function c(e,t,n,r,i){var o=d(t,n);if(o)e.emit("error",o);else if(null===n||n===s)t.reading=!1,t.ended||p(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else!t.decoder||i||r||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&g(e),y(e,t);else i||(t.reading=!1);return f(t)}function f(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function l(e){if(e>=A)e=A;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function h(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||null===e?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=l(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function d(e,t){var n=null;return j.isBuffer(t)||"string"==typeof t||null===t||t===s||e.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function p(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?g(e):S(e)}function g(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?M.setImmediate(function(){m(e)}):m(e))}function m(e){e.emit("readable")}function y(e,t){t.readingMore||(t.readingMore=!0,M.setImmediate(function(){v(e,t)}))}function v(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function b(e){return function(){var t=e._readableState;t.awaitDrain--,0===t.awaitDrain&&w(e)}}function w(e){function t(e){var t=e.write(n);!1===t&&r.awaitDrain++}var n,r=e._readableState;for(r.awaitDrain=0;r.pipesCount&&null!==(n=e.read());)if(1===r.pipesCount?t(r.pipes,0,null):I.forEach(r.pipes,t),e.emit("data",n),r.awaitDrain>0)return;return 0===r.pipesCount?(r.flowing=!1,O.listenerCount(e,"data")>0&&E(e),void 0):(r.ranOut=!0,void 0)}function _(){this._readableState.ranOut&&(this._readableState.ranOut=!1,w(this))}function E(e,t){var n=e._readableState;if(n.flowing)throw new Error("Cannot switch to old mode now.");var r=t||!1,i=!1;e.readable=!0,e.pipe=L.prototype.pipe,e.on=e.addListener=L.prototype.on,e.on("readable",function(){i=!0;for(var t;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(i=!1,e._readableState.needReadable=!0)}),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,i?M.setImmediate(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function k(e,t){var n,r=t.buffer,i=t.length,o=!!t.decoder,s=!!t.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(s)n=r.shift();else if(!e||e>=i)n=o?r.join(""):j.concat(r,i),r.length=0;else if(e<r[0].length){var a=r[0];n=a.slice(0,e),r[0]=a.slice(e)}else if(e===r[0].length)n=r.shift();else{n=o?"":new j(e);for(var u=0,c=0,f=r.length;f>c&&e>u;c++){var a=r[0],l=Math.min(e-u,a.length);o?n+=a.slice(0,l):a.copy(n,u,0,l),l<a.length?r[0]=a.slice(l):r.shift(),u+=l}}return n}function S(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,M.setImmediate(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}t.exports=u,u.ReadableState=a;var x,O=e("11",t).EventEmitter,L=e("8",t),I=e("18",t),j=e("20",t).Buffer,M=e("19",t),T=e("12",t);T.inherits(u,L),u.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new j(e,t),t="")),c(this,n,e,t,!1)},u.prototype.unshift=function(e){var t=this._readableState;return c(this,t,e,"",!0)},u.prototype.setEncoding=function(n){x||(x=e("24",t).StringDecoder),this._readableState.decoder=new x(n),this._readableState.encoding=n};var A=8388608;u.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return g(this),null;if(e=h(e,t),0===e&&t.ended)return 0===t.length&&S(this),null;var r=t.needReadable;t.length-e<=t.highWaterMark&&(r=!0),(t.ended||t.reading)&&(r=!1),r&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=h(n,t));var i;return i=e>0?k(e,t):null,null===i&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&S(this),i},u.prototype._read=function(){this.emit("error",new Error("not implemented"))},u.prototype.pipe=function(e,t){function n(e){e===f&&i()}function r(){e.end()}function i(){e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("drain",p),e.removeListener("error",s),e.removeListener("unpipe",n),f.removeListener("end",r),f.removeListener("end",i),(!e._writableState||e._writableState.needDrain)&&p()}function s(t){c(),0===g&&0===O.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",u),c()}function u(){e.removeListener("close",a),c()}function c(){f.unpipe(e)}var f=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=e;break;case 1:l.pipes=[l.pipes,e];break;default:l.pipes.push(e)}l.pipesCount+=1;var h=(!t||t.end!==!1)&&e!==o.stdout&&e!==o.stderr,d=h?r:i;l.endEmitted?M.setImmediate(d):f.once("end",d),e.on("unpipe",n);var p=b(f);e.on("drain",p);var g=O.listenerCount(e,"error");return e.once("error",s),e.once("close",a),e.once("finish",u),e.emit("pipe",f),l.flowing||(this.on("readable",_),l.flowing=!0,M.setImmediate(function(){w(f)})),e},u.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,this.removeListener("readable",_),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",_),t.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var i=I.indexOf(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)},u.prototype.on=function(e,t){var n=L.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||E(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&g(this,r):this.read(0))}return n},u.prototype.addListener=u.prototype.on,u.prototype.resume=function(){E(this),this.read(0),this.emit("resume")},u.prototype.pause=function(){E(this,!0),this.emit("pause")},u.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(t.decoder&&(i=t.decoder.write(i)),i&&(t.objectMode||i.length)){var o=r.push(i);o||(n=!0,e.pause())}});for(var i in e)"function"==typeof e[i]&&"undefined"==typeof this[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return I.forEach(o,function(t){e.on(t,I.bind(r.emit,r,t))}),r._read=function(){n&&(n=!1,e.resume())},r},u._fromList=k}),e.define("24",function(t,n){function r(e){if(e&&!a.isEncoding(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function o(e){var t=this.charReceived=e.length%2;return this.charLength=t?2:0,t}function s(e){var t=this.charReceived=e.length%3;return this.charLength=t?3:0,t}var a=e("20",t).Buffer,u=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),r(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return this.write=i,void 0}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="",n=0;this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,n,r),this.charReceived+=r-n,n=r,this.charReceived<this.charLength)return"";t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=t.charCodeAt(t.length-1);if(!(i>=55296&&56319>=i)){if(this.charReceived=this.charLength=0,r==e.length)return t;e=e.slice(r,e.length);break}this.charLength+=this.surrogateSize,t=""}var o=this.detectIncompleteChar(e),s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-o,s),this.charReceived=o,s-=o),t+=e.toString(this.encoding,0,s);var s=t.length-1,i=t.charCodeAt(s);if(i>=55296&&56319>=i){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),this.charBuffer.write(t.charAt(t.length-1),this.encoding),t.substring(0,s)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(2>=t&&n>>4==14){this.charLength=3;break}if(3>=t&&n>>3==30){this.charLength=4;break}}return t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}}),e.define("11",function(t,n,i,o,s){function a(){this._events=this._events||{},this._maxListeners=this._maxListeners||s}var u=e("12",t);t.exports=a,a.EventEmitter=a,a.prototype._events=s,a.prototype._maxListeners=s,a.defaultMaxListeners=10,a.prototype.setMaxListeners=function(e){if(!u.isNumber(e)||0>e)throw TypeError("n must be a positive number");return this._maxListeners=e,this},a.prototype.emit=function(e){var t,n,r,i,o,s;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u.isObject(this._events.error)&&!this._events.error.length))throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');if(n=this._events[e],u.isUndefined(n))return!1;if(u.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;r>o;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(u.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;r>o;o++)i[o-1]=arguments[o];for(s=n.slice(),r=s.length,o=0;r>o;o++)s[o].apply(this,i)}return!0},a.prototype.addListener=function(e,t){var n;if(!u.isFunction(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,u.isFunction(t.listener)?t.listener:t),this._events[e]?u.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,u.isObject(this._events[e])&&!this._events[e].warned){var n;n=u.isUndefined(this._maxListeners)?a.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,r.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),r.trace())}return this},a.prototype.on=a.prototype.addListener,a.prototype.once=function(e,t){function n(){this.removeListener(e,n),t.apply(this,arguments)}if(!u.isFunction(t))throw TypeError("listener must be a function");return n.listener=t,this.on(e,n),this},a.prototype.removeListener=function(e,t){var n,r,i,o;if(!u.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],i=n.length,r=-1,n===t||u.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u.isObject(n)){for(o=i;o-->0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(0>r)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},a.prototype.removeAllListeners=function(e){var t,n;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(n=this._events[e],u.isFunction(n))this.removeListener(e,n);else for(;n.length;)this.removeLis