UNPKG

minimal-ecash-wallet

Version:
1 lines 1.43 MB
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).XecWallet=t()}}((function(){for(var define,module,exports,createModuleFactory=function(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}},_$defaults_476=createModuleFactory((function(t,e){(function(e){(function(){"use strict";var r={"Content-Type":"application/x-www-form-urlencoded"};function i(t,e){!_$utils_489.isUndefined(t)&&_$utils_489.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var n,o={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(n=_$xhr_462({})),n),transformRequest:[function(t,e){return _$normalizeHeaderName_485(e,"Accept"),_$normalizeHeaderName_485(e,"Content-Type"),_$utils_489.isFormData(t)||_$utils_489.isArrayBuffer(t)||_$utils_489.isBuffer(t)||_$utils_489.isStream(t)||_$utils_489.isFile(t)||_$utils_489.isBlob(t)?t:_$utils_489.isArrayBufferView(t)?t.buffer:_$utils_489.isURLSearchParams(t)?(i(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):_$utils_489.isObject(t)||e&&"application/json"===e["Content-Type"]?(i(e,"application/json"),function(t,e,r){if(_$utils_489.isString(t))try{return(0,JSON.parse)(t),_$utils_489.trim(t)}catch(i){if("SyntaxError"!==i.name)throw i}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||o.transitional,r=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,n=!r&&"json"===this.responseType;if(n||i&&_$utils_489.isString(t)&&t.length)try{return JSON.parse(t)}catch(a){if(n){if("SyntaxError"===a.name)throw _$enhanceError_472(a,this,"E_JSON_PARSE");throw a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_$utils_489.forEach(["delete","get","head"],(function(t){o.headers[t]={}})),_$utils_489.forEach(["post","put","patch"],(function(t){o.headers[t]=_$utils_489.merge(r)})),t.exports=o}).call(this)}).call(this,_$browser_383)})),_$xhr_462=createModuleFactory((function(t,e){"use strict";var r=_$defaults_476({});t.exports=function(t){return new Promise((function(e,i){var n,o=t.data,a=t.headers,s=t.responseType;function u(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}_$utils_489.isFormData(o)&&delete a["Content-Type"];var h=new XMLHttpRequest;if(t.auth){var f=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.Authorization="Basic "+btoa(f+":"+c)}var l=_$buildFullPath_469(t.baseURL,t.url);function d(){if(h){var r="getAllResponseHeaders"in h?_$parseHeaders_486(h.getAllResponseHeaders()):null,n={data:s&&"text"!==s&&"json"!==s?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:t,request:h};_$settle_474((function(t){e(t),u()}),(function(t){i(t),u()}),n),h=null}}if(h.open(t.method.toUpperCase(),_$buildURL_479(l,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,"onloadend"in h?h.onloadend=d:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(d)},h.onabort=function(){h&&(i(_$createError_470("Request aborted",t,"ECONNABORTED",h)),h=null)},h.onerror=function(){i(_$createError_470("Network Error",t,null,h)),h=null},h.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||r.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),i(_$createError_470(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",h)),h=null},_$utils_489.isStandardBrowserEnv()){var _=(t.withCredentials||_$isURLSameOrigin_484(l))&&t.xsrfCookieName?_$cookies_481.read(t.xsrfCookieName):void 0;_&&(a[t.xsrfHeaderName]=_)}"setRequestHeader"in h&&_$utils_489.forEach(a,(function(t,e){void 0===o&&"content-type"===e.toLowerCase()?delete a[e]:h.setRequestHeader(e,t)})),_$utils_489.isUndefined(t.withCredentials)||(h.withCredentials=!!t.withCredentials),s&&"json"!==s&&(h.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){h&&(i(!t||t&&t.type?new _$Cancel_464("canceled"):t),h.abort(),h=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),o||(o=null),h.send(o)}))}})),_$main_449=createModuleFactory((function(t,e){(function(t,r){(function(){var i=_$browser_383.nextTick,n=(Function.prototype.apply,Array.prototype.slice),o={},a=0;function s(t,e){this._id=t,this._clearFn=e}s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},e.setImmediate="function"==typeof t?t:function(t){var r=a++,s=!(arguments.length<2)&&n.call(arguments,1);return o[r]=!0,i((function(){o[r]&&(s?t.apply(null,s):t.call(null),e.clearImmediate(r))})),r},e.clearImmediate="function"==typeof r?r:function(t){delete o[t]}}).call(this)}).call(this,_$main_449({}).setImmediate,_$main_449({}).clearImmediate)})),_$cryptoBrowserify_247=createModuleFactory((function(t,e){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=_$browser_397,e.createHash=e.Hash=_$browser_243,e.createHmac=e.Hmac=_$browser_245;var r=Object.keys(_$algos_205),i=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);e.getHashes=function(){return i},e.pbkdf2=_$browser_377.pbkdf2,e.pbkdf2Sync=_$browser_377.pbkdf2Sync,e.Cipher=_$browser_201.Cipher,e.createCipher=_$browser_201.createCipher,e.Cipheriv=_$browser_201.Cipheriv,e.createCipheriv=_$browser_201.createCipheriv,e.Decipher=_$browser_201.Decipher,e.createDecipher=_$browser_201.createDecipher,e.Decipheriv=_$browser_201.Decipheriv,e.createDecipheriv=_$browser_201.createDecipheriv,e.getCiphers=_$browser_201.getCiphers,e.listCiphers=_$browser_201.listCiphers,e.DiffieHellmanGroup=_$browser_288.DiffieHellmanGroup,e.createDiffieHellmanGroup=_$browser_288.createDiffieHellmanGroup,e.getDiffieHellman=_$browser_288.getDiffieHellman,e.createDiffieHellman=_$browser_288.createDiffieHellman,e.DiffieHellman=_$browser_288.DiffieHellman,e.createSign=_$browser_208.createSign,e.Sign=_$browser_208.Sign,e.createVerify=_$browser_208.createVerify,e.Verify=_$browser_208.Verify,e.createECDH=_$browser_241,e.publicEncrypt=_$browser_384.publicEncrypt,e.privateEncrypt=_$browser_384.privateEncrypt,e.publicDecrypt=_$browser_384.publicDecrypt,e.privateDecrypt=_$browser_384.privateDecrypt,e.randomFill=_$browser_398.randomFill,e.randomFillSync=_$browser_398.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}})),_$_stream_readable_214=createModuleFactory((function(t,e){(function(e,r){(function(){"use strict";var i;t.exports=w,w.ReadableState=v,_$events_321.EventEmitter;var n,o=function(t,e){return t.listeners(e).length},a=_$buffer_233({}).Buffer,s=r.Uint8Array||function(){},u=_$empty_183({});n=u&&u.debuglog?u.debuglog("stream"):function(){};var h,f,c,l=_$state_223.getHighWaterMark,d=_$errorsBrowser_211.codes,_=d.ERR_INVALID_ARG_TYPE,p=d.ERR_STREAM_PUSH_AFTER_EOF,m=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;_$inherits_browser_360(w,_$streamBrowser_224);var y=_$destroy_219.errorOrDestroy,b=["error","close","destroy","pause","resume"];function v(t,e,r){i=i||_$Duplex_212({}),t=t||{},"boolean"!=typeof r&&(r=e instanceof i),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=l(this,t,"readableHighWaterMark",r),this.buffer=new _$buffer_list_218,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=_$string_decoder_447({}).StringDecoder),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function w(t){if(i=i||_$Duplex_212({}),!(this instanceof w))return new w(t);var e=this instanceof i;this._readableState=new v(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),_$streamBrowser_224.call(this)}function M(t,e,r,i,o){n("readableAddChunk",e);var u,h=t._readableState;if(null===e)h.reading=!1,function(t,e){if(n("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?S(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,A(t)))}}(t,h);else if(o||(u=function(t,e){var r,i;return i=e,a.isBuffer(i)||i instanceof s||"string"==typeof e||void 0===e||t.objectMode||(r=new _("chunk",["string","Buffer","Uint8Array"],e)),r}(h,e)),u)y(t,u);else if(h.objectMode||e&&e.length>0)if("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),i)h.endEmitted?y(t,new g):$(t,h,e,!0);else if(h.ended)y(t,new p);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?$(t,h,e,!1):B(t,h)):$(t,h,e,!1)}else i||(h.reading=!1,B(t,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function $(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&S(t)),B(t,e)}Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),w.prototype.destroy=_$destroy_219.destroy,w.prototype._undestroy=_$destroy_219.undestroy,w.prototype._destroy=function(t,e){e(t)},w.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=a.from(t,e),e=""),r=!0),M(this,t,e,!1,r)},w.prototype.unshift=function(t){return M(this,t,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(t){h||(h=_$string_decoder_447({}).StringDecoder);var e=new h(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function E(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var r=t._readableState;n("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(n("emitReadable",r.flowing),r.emittedReadable=!0,e.nextTick(A,t))}function A(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,R(t)}function B(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(k,t,r))}function k(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(n("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function T(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function x(t){n("readable nexttick read 0"),t.read(0)}function I(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function P(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function O(t){var r=t._readableState;n("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,e.nextTick(C,r,t))}function C(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function N(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}w.prototype.read=function(t){n("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?O(this):S(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&O(this),null;var i,o=e.needReadable;return n("need readable",o),(0===e.length||e.length-t<e.highWaterMark)&&n("length less than watermark",o=!0),e.ended||e.reading?n("reading or ended",o=!1):o&&(n("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=E(r,e))),null===(i=t>0?P(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&O(this)),null!==i&&this.emit("data",i),i},w.prototype._read=function(t){y(this,new m("_read()"))},w.prototype.pipe=function(t,r){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,r);var s=r&&!1===r.end||t===e.stdout||t===e.stderr?p:u;function u(){n("onend"),t.end()}a.endEmitted?e.nextTick(s):i.once("end",s),t.on("unpipe",(function e(r,o){n("onunpipe"),r===i&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,n("cleanup"),t.removeListener("close",d),t.removeListener("finish",_),t.removeListener("drain",h),t.removeListener("error",l),t.removeListener("unpipe",e),i.removeListener("end",u),i.removeListener("end",p),i.removeListener("data",c),f=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}));var h=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,R(t))}}(i);t.on("drain",h);var f=!1;function c(e){n("ondata");var r=t.write(e);n("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==N(a.pipes,t))&&!f&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),i.pause())}function l(e){n("onerror",e),p(),t.removeListener("error",l),0===o(t,"error")&&y(t,e)}function d(){t.removeListener("finish",_),p()}function _(){n("onfinish"),t.removeListener("close",d),p()}function p(){n("unpipe"),i.unpipe(t)}return i.on("data",c),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener("error",r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on("error",r)}(t,0,l),t.once("close",d),t.once("finish",_),t.emit("pipe",i),a.flowing||(n("pipe resume"),i.resume()),t},w.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=N(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},w.prototype.on=function(t,r){var i=_$streamBrowser_224.prototype.on.call(this,t,r),o=this._readableState;return"data"===t?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===t&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,n("on readable",o.length,o.reading),o.length?S(this):o.reading||e.nextTick(x,this))),i},w.prototype.addListener=w.prototype.on,w.prototype.removeListener=function(t,r){var i=_$streamBrowser_224.prototype.removeListener.call(this,t,r);return"readable"===t&&e.nextTick(T,this),i},w.prototype.removeAllListeners=function(t){var r=_$streamBrowser_224.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick(T,this),r},w.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick(I,t,r))}(this,t)),t.paused=!1,this},w.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},w.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var o in t.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){n("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(e.push(o)||(i=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var a=0;a<b.length;a++)t.on(b[a],this.emit.bind(this,b[a]));return this._read=function(e){n("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(w.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=_$async_iterator_217({})),f(this)}),Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(w.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(w.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),w._fromList=P,Object.defineProperty(w.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(w.from=function(t,e){return void 0===c&&(c=_$fromBrowser_221({})),c(w,t,e)})}).call(this)}).call(this,_$browser_383,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),_$fromBrowser_221=createModuleFactory((function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}})),_$async_iterator_217=createModuleFactory((function(t,e){(function(e){(function(){"use strict";var r;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var n=_$eos_220({}),o=Symbol("lastResolve"),a=Symbol("lastReject"),s=Symbol("error"),u=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),c=Symbol("stream");function l(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var r=t[c].read();null!==r&&(t[h]=null,t[o]=null,t[a]=null,e(l(r,!1)))}}var _=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((i(r={get stream(){return this[c]},next:function(){var t=this,r=this[s];if(null!==r)return Promise.reject(r);if(this[u])return Promise.resolve(l(void 0,!0));if(this[c].destroyed)return new Promise((function(r,i){e.nextTick((function(){t[s]?i(t[s]):r(l(void 0,!0))}))}));var i,n=this[h];if(n)i=new Promise(function(t,e){return function(r,i){t.then((function(){e[u]?r(l(void 0,!0)):e[f](r,i)}),i)}}(n,this));else{var o=this[c].read();if(null!==o)return Promise.resolve(l(o,!1));i=new Promise(this[f])}return this[h]=i,i}},Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var t=this;return new Promise((function(e,r){t[c].destroy(null,(function(t){t?r(t):e(l(void 0,!0))}))}))})),r),_);t.exports=function(t){var r,_=Object.create(p,(i(r={},c,{value:t,writable:!0}),i(r,o,{value:null,writable:!0}),i(r,a,{value:null,writable:!0}),i(r,s,{value:null,writable:!0}),i(r,u,{value:t._readableState.endEmitted,writable:!0}),i(r,f,{value:function(t,e){var r=_[c].read();r?(_[h]=null,_[o]=null,_[a]=null,t(l(r,!1))):(_[o]=t,_[a]=e)},writable:!0}),r));return _[h]=null,n(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=_[a];return null!==e&&(_[h]=null,_[o]=null,_[a]=null,e(t)),void(_[s]=t)}var r=_[o];null!==r&&(_[h]=null,_[o]=null,_[a]=null,r(l(void 0,!0))),_[u]=!0})),t.on("readable",function(t){e.nextTick(d,t)}.bind(null,_)),_}}).call(this)}).call(this,_$browser_383)})),_$eos_220=createModuleFactory((function(t,e){"use strict";var r=_$errorsBrowser_211.codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,o){if("function"==typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}(o||i);var a=n.readable||!1!==n.readable&&e.readable,s=n.writable||!1!==n.writable&&e.writable,u=function(){e.writable||f()},h=e._writableState&&e._writableState.finished,f=function(){s=!1,h=!0,a||o.call(e)},c=e._readableState&&e._readableState.endEmitted,l=function(){a=!1,c=!0,s||o.call(e)},d=function(t){o.call(e,t)},_=function(){var t;return a&&!c?(e._readableState&&e._readableState.ended||(t=new r),o.call(e,t)):s&&!h?(e._writableState&&e._writableState.ended||(t=new r),o.call(e,t)):void 0},p=function(){e.req.on("finish",f)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",f),e.on("abort",_),e.req?p():e.on("request",p)):s&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",l),e.on("finish",f),!1!==n.error&&e.on("error",d),e.on("close",_),function(){e.removeListener("complete",f),e.removeListener("abort",_),e.removeListener("request",p),e.req&&e.req.removeListener("finish",f),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",f),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",_)}}})),_$Duplex_212=createModuleFactory((function(t,e){(function(e){(function(){"use strict";var r=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var i=_$_stream_readable_214({}),n=_$_stream_writable_216({});_$inherits_browser_360(u,i);for(var o=r(n.prototype),a=0;a<o.length;a++){var s=o[a];u.prototype[s]||(u.prototype[s]=n.prototype[s])}function u(t){if(!(this instanceof u))return new u(t);i.call(this,t),n.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||e.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,_$browser_383)})),_$_stream_writable_216=createModuleFactory((function(t,e){(function(e,r){(function(){"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(void 0),i=i.next}e.corkedRequestsFree.next=t}(e,t)}}var n;t.exports=M,M.WritableState=w;var o,a={deprecate:_$browser_454},s=_$buffer_233({}).Buffer,u=r.Uint8Array||function(){},h=_$state_223.getHighWaterMark,f=_$errorsBrowser_211.codes,c=f.ERR_INVALID_ARG_TYPE,l=f.ERR_METHOD_NOT_IMPLEMENTED,d=f.ERR_MULTIPLE_CALLBACK,_=f.ERR_STREAM_CANNOT_PIPE,p=f.ERR_STREAM_DESTROYED,m=f.ERR_STREAM_NULL_VALUES,g=f.ERR_STREAM_WRITE_AFTER_END,y=f.ERR_UNKNOWN_ENCODING,b=_$destroy_219.errorOrDestroy;function v(){}function w(t,r,o){n=n||_$Duplex_212({}),t=t||{},"boolean"!=typeof o&&(o=r instanceof n),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,r){var i=t._writableState,n=i.sync,o=i.writecb;if("function"!=typeof o)throw new d;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(i),r)!function(t,r,i,n,o){--r.pendingcb,i?(e.nextTick(o,n),e.nextTick(k,t,r),t._writableState.errorEmitted=!0,b(t,n)):(o(n),t._writableState.errorEmitted=!0,b(t,n),k(t,r))}(t,i,n,r,o);else{var a=A(i)||t.destroyed;a||i.corked||i.bufferProcessing||!i.bufferedRequest||S(t,i),n?e.nextTick(E,t,i,a,o):E(t,i,a,o)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function M(t){var e=this instanceof(n=n||_$Duplex_212({}));if(!e&&!o.call(M,this))return new M(t);this._writableState=new w(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),_$streamBrowser_224.call(this)}function $(t,e,r,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new p("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function E(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),k(t,e)}function S(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),a=e.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,$(t,e,!0,e.length,o,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,f=r.encoding,c=r.callback;if($(t,e,!1,e.objectMode?1:h.length,h,f,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function A(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function B(t,e){t._final((function(r){e.pendingcb--,r&&b(t,r),e.prefinished=!0,t.emit("prefinish"),k(t,e)}))}function k(t,r){var i=A(r);if(i&&(function(t,r){r.prefinished||r.finalCalled||("function"!=typeof t._final||r.destroyed?(r.prefinished=!0,t.emit("prefinish")):(r.pendingcb++,r.finalCalled=!0,e.nextTick(B,t,r)))}(t,r),0===r.pendingcb&&(r.finished=!0,t.emit("finish"),r.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return i}_$inherits_browser_360(M,_$streamBrowser_224),w.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(w.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===M&&t&&t._writableState instanceof w}})):o=function(t){return t instanceof this},M.prototype.pipe=function(){b(this,new _)},M.prototype.write=function(t,r,i){var n,o=this._writableState,a=!1,h=!o.objectMode&&(n=t,s.isBuffer(n)||n instanceof u);return h&&!s.isBuffer(t)&&(t=function(t){return s.from(t)}(t)),"function"==typeof r&&(i=r,r=null),h?r="buffer":r||(r=o.defaultEncoding),"function"!=typeof i&&(i=v),o.ending?function(t,r){var i=new g;b(t,i),e.nextTick(r,i)}(this,i):(h||function(t,r,i,n){var o;return null===i?o=new m:"string"==typeof i||r.objectMode||(o=new c("chunk",["string","Buffer"],i)),!o||(b(t,o),e.nextTick(n,o),!1)}(this,o,t,i))&&(o.pendingcb++,a=function(t,e,r,i,n,o){if(!r){var a=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=s.from(e,r)),e}(e,i,n);i!==a&&(r=!0,n="buffer",i=a)}var u=e.objectMode?1:i.length;e.length+=u;var h=e.length<e.highWaterMark;if(h||(e.needDrain=!0),e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else $(t,e,!1,u,i,n,o);return h}(this,o,h,t,r,i)),a},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||S(this,t))},M.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new y(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(t,e,r){r(new l("_write()"))},M.prototype._writev=null,M.prototype.end=function(t,r,i){var n=this._writableState;return"function"==typeof t?(i=t,t=null,r=null):"function"==typeof r&&(i=r,r=null),null!=t&&this.write(t,r),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,r,i){r.ending=!0,k(t,r),i&&(r.finished?e.nextTick(i):t.once("finish",i)),r.ended=!0,t.writable=!1}(this,n,i),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),M.prototype.destroy=_$destroy_219.destroy,M.prototype._undestroy=_$destroy_219.undestroy,M.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,_$browser_383,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),_$_stream_readable_436=createModuleFactory((function(t,e){(function(e,r){(function(){"use strict";var i;t.exports=w,w.ReadableState=v,_$events_321.EventEmitter;var n,o=function(t,e){return t.listeners(e).length},a=_$buffer_233({}).Buffer,s=r.Uint8Array||function(){},u=_$empty_183({});n=u&&u.debuglog?u.debuglog("stream"):function(){};var h,f,c,l=_$state_445.getHighWaterMark,d=_$errorsBrowser_433.codes,_=d.ERR_INVALID_ARG_TYPE,p=d.ERR_STREAM_PUSH_AFTER_EOF,m=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;_$inherits_browser_360(w,_$streamBrowser_446);var y=_$destroy_441.errorOrDestroy,b=["error","close","destroy","pause","resume"];function v(t,e,r){i=i||_$Duplex_434({}),t=t||{},"boolean"!=typeof r&&(r=e instanceof i),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=l(this,t,"readableHighWaterMark",r),this.buffer=new _$buffer_list_440,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=_$string_decoder_447({}).StringDecoder),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function w(t){if(i=i||_$Duplex_434({}),!(this instanceof w))return new w(t);var e=this instanceof i;this._readableState=new v(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),_$streamBrowser_446.call(this)}function M(t,e,r,i,o){n("readableAddChunk",e);var u,h=t._readableState;if(null===e)h.reading=!1,function(t,e){if(n("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?S(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,A(t)))}}(t,h);else if(o||(u=function(t,e){var r,i;return i=e,a.isBuffer(i)||i instanceof s||"string"==typeof e||void 0===e||t.objectMode||(r=new _("chunk",["string","Buffer","Uint8Array"],e)),r}(h,e)),u)y(t,u);else if(h.objectMode||e&&e.length>0)if("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),i)h.endEmitted?y(t,new g):$(t,h,e,!0);else if(h.ended)y(t,new p);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?$(t,h,e,!1):B(t,h)):$(t,h,e,!1)}else i||(h.reading=!1,B(t,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function $(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&S(t)),B(t,e)}Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),w.prototype.destroy=_$destroy_441.destroy,w.prototype._undestroy=_$destroy_441.undestroy,w.prototype._destroy=function(t,e){e(t)},w.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=a.from(t,e),e=""),r=!0),M(this,t,e,!1,r)},w.prototype.unshift=function(t){return M(this,t,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(t){h||(h=_$string_decoder_447({}).StringDecoder);var e=new h(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function E(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var r=t._readableState;n("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(n("emitReadable",r.flowing),r.emittedReadable=!0,e.nextTick(A,t))}function A(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,R(t)}function B(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(k,t,r))}function k(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(n("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function T(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function x(t){n("readable nexttick read 0"),t.read(0)}function I(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function P(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function O(t){var r=t._readableState;n("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,e.nextTick(C,r,t))}function C(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function N(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}w.prototype.read=function(t){n("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?O(this):S(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&O(this),null;var i,o=e.needReadable;return n("need readable",o),(0===e.length||e.length-t<e.highWaterMark)&&n("length less than watermark",o=!0),e.ended||e.reading?n("reading or ended",o=!1):o&&(n("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=E(r,e))),null===(i=t>0?P(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&O(this)),null!==i&&this.emit("data",i),i},w.prototype._read=function(t){y(this,new m("_read()"))},w.prototype.pipe=function(t,r){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,r);var s=r&&!1===r.end||t===e.stdout||t===e.stderr?p:u;function u(){n("onend"),t.end()}a.endEmitted?e.nextTick(s):i.once("end",s),t.on("unpipe",(function e(r,o){n("onunpipe"),r===i&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,n("cleanup"),t.removeListener("close",d),t.removeListener("finish",_),t.removeListener("drain",h),t.removeListener("error",l),t.removeListener("unpipe",e),i.removeListener("end",u),i.removeListener("end",p),i.removeListener("data",c),f=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}));var h=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,R(t))}}(i);t.on("drain",h);var f=!1;function c(e){n("ondata");var r=t.write(e);n("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==N(a.pipes,t))&&!f&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),i.pause())}function l(e){n("onerror",e),p(),t.removeListener("error",l),0===o(t,"error")&&y(t,e)}function d(){t.removeListener("finish",_),p()}function _(){n("onfinish"),t.removeListener("close",d),p()}function p(){n("unpipe"),i.unpipe(t)}return i.on("data",c),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener("error",r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on("error",r)}(t,0,l),t.once("close",d),t.once("finish",_),t.emit("pipe",i),a.flowing||(n("pipe resume"),i.resume()),t},w.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=N(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},w.prototype.on=function(t,r){var i=_$streamBrowser_446.prototype.on.call(this,t,r),o=this._readableState;return"data"===t?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===t&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,n("on readable",o.length,o.reading),o.length?S(this):o.reading||e.nextTick(x,this))),i},w.prototype.addListener=w.prototype.on,w.prototype.removeListener=function(t,r){var i=_$streamBrowser_446.prototype.removeListener.call(this,t,r);return"readable"===t&&e.nextTick(T,this),i},w.prototype.removeAllListeners=function(t){var r=_$streamBrowser_446.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick(T,this),r},w.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick(I,t,r))}(this,t)),t.paused=!1,this},w.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},w.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var o in t.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){n("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(e.push(o)||(i=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var a=0;a<b.length;a++)t.on(b[a],this.emit.bind(this,b[a]));return this._read=function(e){n("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(w.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=_$async_iterator_439({})),f(this)}),Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(w.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(w.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),w._fromList=P,Object.defineProperty(w.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(w.from=function(t,e){return void 0===c&&(c=_$fromBrowser_443({})),c(w,t,e)})}).call(this)}).call(this,_$browser_383,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),_$fromBrowser_443=createModuleFactory((function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}})),_$async_iterator_439=createModuleFactory((function(t,e){(function(e){(function(){"use strict";var r;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var n=_$eos_442({}),o=Symbol("lastResolve"),a=Symbol("lastReject"),s=Symbol("error"),u=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),c=Symbol("stream");function l(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var r=t[c].read();null!==r&&(t[h]=null,t[o]=null,t[a]=null,e(l(r,!1)))}}var _=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((i(r={get stream(){return this[c]},next:function(){var t=this,r=this[s];if(null!==r)return Promise.reject(r);if(this[u])return Promise.resolve(l(void 0,!0));if(this[c].destroyed)return new Promise((function(r,i){e.nextTick((function(){t[s]?i(t[s]):r(l(void 0,!0))}))}));var i,n=this[h];if(n)i=new Promise(function(t,e){return function(r,i){t.then((function(){e[u]?r(l(void 0,!0)):e[f](r,i)}),i)}}(n,this));else{var o=this[c].read();if(null!==o)return Promise.resolve(l(o,!1));i=new Promise(this[f])}return this[h]=i,i}},Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var t=this;return new Promise((function(e,r){t[c].destroy(null,(function(t){t?r(t):e(l(void 0,!0))}))}))})),r),_);t.exports=function(t){var r,_=Object.create(p,(i(r={},c,{value:t,writable:!0}),i(r,o,{value:null,writable:!0}),i(r,a,{value:null,writable:!0}),i(r,s,{value:null,writable:!0}),i(r,u,{value:t._readableState.endEmitted,writable:!0}),i(r,f,{value:function(t,e){var r=_[c].read();r?(_[h]=null,_[o]=null,_[a]=null,t(l(r,!1))):(_[o]=t,_[a]=e)},writable:!0}),r));return _[h]=null,n(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=_[a];return null!==e&&(_[h]=null,_[o]=null,_[a]=null,e(t)),void(_[s]=t)}var r=_[o];null!==r&&(_[h]=null,_[o]=null,_[a]=null,r(l(void 0,!0))),_[u]=!0})),t.on("readable",function(t){e.nextTick(d,t)}.bind(null,_)),_}}).call(this)}).call(this,_$browser_383)})),_$eos_442=createModuleFactory((function(t,e){"use strict";var r=_$errorsBrowser_433.codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,o){if("function"==typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}(o||i);var a=n.readable||!1!==n.readable&&e.readable,s=n.writable||!1!==n.writable&&e.writable,u=function(){e.writable||f()},h=e._writableState&&e._writableState.finished,f=function(){s=!1,h=!0,a||o.call(e)},c=e._readableState&&e._readableState.endEmitted,l=function(){a=!1,c=!0,s||o.call(e)},d=function(t){o.call(e,t)},_=function(){var t;return a&&!c?(e._readableState&&e._readableState.ended||(t=new r),o.call(e,t)):s&&!h?(e._writableState&&e._writableState.ended||(t=new r),o.call(e,t)):void 0},p=function(){e.req.on("finish",f)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",f),e.on("abort",_),e.req?p():e.on("request",p)):s&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",l),e.on("finish",f),!1!==n.error&&e.on("error",d),e.on("close",_),function(){e.removeListener("complete",f),e.removeListener("abort",_),e.removeListener("request",p),e.req&&e.req.removeListener("finish",f),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",f),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",_)}}})),_$Duplex_434=createModuleFactory((function(t,e){(function(e){(function(){"use strict";var r=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var i=_$_stream_readable_436({}),n=_$_stream_writable_438({});_$inherits_browser_360(u,i);for(var o=r(n.prototype),a=0;a<o.length;a++){var s=o[a];u.prototype[s]||(u.prototype[s]=n.prototype[s])}function u(t){if(!(this instanceof u))return new u(t);i.call(this,t),n.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||e.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,_$browser_383)})),_$_stream_writable_438=createModuleFactory((function(t,e){(function(e,r){(function(){"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(void 0),i=i.next}e.corkedRequestsFree.next=t}(e,t)}}va