Skip to content

Instantly share code, notes, and snippets.

@tomoya55
Last active March 4, 2018 10:00
Show Gist options
  • Save tomoya55/9226b9f4c024e63144d251752aaf3b13 to your computer and use it in GitHub Desktop.
Save tomoya55/9226b9f4c024e63144d251752aaf3b13 to your computer and use it in GitHub Desktop.
require=function(r,e,n){function t(n,o){function i(r){return t(i.resolve(r))}function f(e){return r[n][1][e]||e}if(!e[n]){if(!r[n]){var c="function"==typeof require&&require;if(!o&&c)return c(n,!0);if(u)return u(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}i.resolve=f;var a=e[n]=new t.Module;r[n][0].call(a.exports,i,a,a.exports)}return e[n].exports}function o(){this.bundle=t,this.exports={}}var u="function"==typeof require&&require;t.Module=o,t.modules=r,t.cache=e,t.parent=u;for(var i=0;i<n.length;i++)t(n[i]);return t}({15:[function(require,module,exports) {
exports.endianness=function(){return"LE"},exports.hostname=function(){return"undefined"!=typeof location?location.hostname:""},exports.loadavg=function(){return[]},exports.uptime=function(){return 0},exports.freemem=function(){return Number.MAX_VALUE},exports.totalmem=function(){return Number.MAX_VALUE},exports.cpus=function(){return[]},exports.type=function(){return"Browser"},exports.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},exports.networkInterfaces=exports.getNetworkInterfaces=function(){return{}},exports.arch=function(){return"javascript"},exports.platform=function(){return"browser"},exports.tmpdir=exports.tmpDir=function(){return"/tmp"},exports.EOL="\n",exports.homedir=function(){return"/"};
},{}],19:[function(require,module,exports) {
function e(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function t(e){return"function"==typeof e}function s(e){return"number"==typeof e}function n(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}module.exports=e,e.EventEmitter=e,e.prototype._events=void 0,e.prototype._maxListeners=void 0,e.defaultMaxListeners=10,e.prototype.setMaxListeners=function(e){if(!s(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},e.prototype.emit=function(e){var s,r,o,h,v,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((s=arguments[1])instanceof Error)throw s;var u=new Error('Uncaught, unspecified "error" event. ('+s+")");throw u.context=s,u}if(i(r=this._events[e]))return!1;if(t(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:h=Array.prototype.slice.call(arguments,1),r.apply(this,h)}else if(n(r))for(h=Array.prototype.slice.call(arguments,1),o=(l=r.slice()).length,v=0;v<o;v++)l[v].apply(this,h);return!0},e.prototype.addListener=function(s,r){var o;if(!t(r))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",s,t(r.listener)?r.listener:r),this._events[s]?n(this._events[s])?this._events[s].push(r):this._events[s]=[this._events[s],r]:this._events[s]=r,n(this._events[s])&&!this._events[s].warned&&(o=i(this._maxListeners)?e.defaultMaxListeners:this._maxListeners)&&o>0&&this._events[s].length>o&&(this._events[s].warned=!0,console.trace),this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(e,s){if(!t(s))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,s.apply(this,arguments))}return i.listener=s,this.on(e,i),this},e.prototype.removeListener=function(e,s){var i,r,o,h;if(!t(s))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=(i=this._events[e]).length,r=-1,i===s||t(i.listener)&&i.listener===s)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,s);else if(n(i)){for(h=o;h-- >0;)if(i[h]===s||i[h].listener&&i[h].listener===s){r=h;break}if(r<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,s)}return this},e.prototype.removeAllListeners=function(e){var s,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(s in this._events)"removeListener"!==s&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events={},this}if(t(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},e.prototype.listeners=function(e){return this._events&&this._events[e]?t(this._events[e])?[this._events[e]]:this._events[e].slice():[]},e.prototype.listenerCount=function(e){if(this._events){var s=this._events[e];if(t(s))return 1;if(s)return s.length}return 0},e.listenerCount=function(e,t){return e.listenerCount(t)};
},{}],20:[function(require,module,exports) {
"function"==typeof Object.create?module.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t};
},{}],6:[function(require,module,exports) {
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(t){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],36:[function(require,module,exports) {
var process = require("process");
var n=require("process");function e(e,r,t,c){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,l,u=arguments.length;switch(u){case 0:case 1:return n.nextTick(e);case 2:return n.nextTick(function(){e.call(null,r)});case 3:return n.nextTick(function(){e.call(null,r,t)});case 4:return n.nextTick(function(){e.call(null,r,t,c)});default:for(i=new Array(u-1),l=0;l<i.length;)i[l++]=arguments[l];return n.nextTick(function(){e.apply(null,i)})}}!n.version||0===n.version.indexOf("v0.")||0===n.version.indexOf("v1.")&&0!==n.version.indexOf("v1.8.")?module.exports=e:module.exports=n.nextTick;
},{"process":6}],39:[function(require,module,exports) {
var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
},{}],32:[function(require,module,exports) {
module.exports=require("events").EventEmitter;
},{"events":19}],42:[function(require,module,exports) {
"use strict";exports.byteLength=c,exports.toByteArray=u,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===r[t-2]?2:"="===r[t-1]?1:0}function c(r){return 3*r.length/4-h(r)}function u(r){var n,o,a,c,u,A=r.length;c=h(r),u=new e(3*A/4-c),o=c>0?A-4:A;var i=0;for(n=0;n<o;n+=4)a=t[r.charCodeAt(n)]<<18|t[r.charCodeAt(n+1)]<<12|t[r.charCodeAt(n+2)]<<6|t[r.charCodeAt(n+3)],u[i++]=a>>16&255,u[i++]=a>>8&255,u[i++]=255&a;return 2===c?(a=t[r.charCodeAt(n)]<<2|t[r.charCodeAt(n+1)]>>4,u[i++]=255&a):1===c&&(a=t[r.charCodeAt(n)]<<10|t[r.charCodeAt(n+1)]<<4|t[r.charCodeAt(n+2)]>>2,u[i++]=a>>8&255,u[i++]=255&a),u}function A(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function i(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],o.push(A(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a="",h=[],c=0,u=n-o;c<u;c+=16383)h.push(i(t,c,c+16383>u?u:c+16383));return 1===o?(e=t[n-1],a+=r[e>>2],a+=r[e<<4&63],a+="=="):2===o&&(e=(t[n-2]<<8)+t[n-1],a+=r[e>>10],a+=r[e>>4&63],a+=r[e<<2&63],a+="="),h.push(a),h.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
},{}],43:[function(require,module,exports) {
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
},{}],40:[function(require,module,exports) {
var global = (1,eval)("this");
var t=(0,eval)("this"),r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function m(t,r,e,n){return Q($(r,t.length-e),t,e,n)}function P(t,r,e,n){return Q(G(r),t,e,n)}function T(t,r,e,n){return P(t,r,e,n)}function B(t,r,e,n){return Q(K(r),t,e,n)}function U(t,r,e,n){return Q(H(r,t.length-e),t,e,n)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Y(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!f.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},f.byteLength=v,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)b(this,r,r+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Y(this,0,t):E.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(r>>>=0,e>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,u=e-r,s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;c<s;++c)if(h[c]!==a[c]){o=h[c],u=a[c];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},f.prototype.indexOf=function(t,r,e){return R(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return R(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=I));return e}function L(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Z(t[o]);return i}function C(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if(t=~~t,r=void 0===r?n:~~r,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),r<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),f.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=f.prototype;else{var i=r-t;e=new f(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=f.isBuffer(t)?t:$(new f(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function X(t){if((t=J(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t}
},{"base64-js":42,"ieee754":43,"isarray":39,"buffer":40}],38:[function(require,module,exports) {
var r=require("buffer"),e=r.Buffer;function n(r,e){for(var n in r)e[n]=r[n]}function o(r,n,o){return e(r,n,o)}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?module.exports=r:(n(r,exports),exports.Buffer=o),n(e,o),o.from=function(r,n,o){if("number"==typeof r)throw new TypeError("Argument must not be a number");return e(r,n,o)},o.alloc=function(r,n,o){if("number"!=typeof r)throw new TypeError("Argument must be a number");var f=e(r);return void 0!==n?"string"==typeof o?f.fill(n,o):f.fill(n):f.fill(0),f},o.allocUnsafe=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return e(r)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)};
},{"buffer":40}],35:[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var r=require("buffer").Buffer;function t(r){return Array.isArray?Array.isArray(r):"[object Array]"===a(r)}function e(r){return"boolean"==typeof r}function n(r){return null===r}function o(r){return null==r}function i(r){return"number"==typeof r}function u(r){return"string"==typeof r}function s(r){return"symbol"==typeof r}function f(r){return void 0===r}function p(r){return"[object RegExp]"===a(r)}function c(r){return"object"==typeof r&&null!==r}function l(r){return"[object Date]"===a(r)}function y(r){return"[object Error]"===a(r)||r instanceof Error}function x(r){return"function"==typeof r}function b(r){return null===r||"boolean"==typeof r||"number"==typeof r||"string"==typeof r||"symbol"==typeof r||void 0===r}function a(r){return Object.prototype.toString.call(r)}exports.isArray=t,exports.isBoolean=e,exports.isNull=n,exports.isNullOrUndefined=o,exports.isNumber=i,exports.isString=u,exports.isSymbol=s,exports.isUndefined=f,exports.isRegExp=p,exports.isObject=c,exports.isDate=l,exports.isError=y,exports.isFunction=x,exports.isPrimitive=b,exports.isBuffer=r.isBuffer;
},{"buffer":40}],31:[function(require,module,exports) {
},{}],34:[function(require,module,exports) {
"use strict";function t(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var n=require("safe-buffer").Buffer;function h(t,n,h){t.copy(n,h)}module.exports=function(){function i(){t(this,i),this.head=null,this.tail=null,this.length=0}return i.prototype.push=function(t){var n={data:t,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},i.prototype.unshift=function(t){var n={data:t,next:this.head};0===this.length&&(this.tail=n),this.head=n,++this.length},i.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(t){if(0===this.length)return"";for(var n=this.head,h=""+n.data;n=n.next;)h+=t+n.data;return h},i.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var i=n.allocUnsafe(t>>>0),e=this.head,a=0;e;)h(e.data,i,a),a+=e.data.length,e=e.next;return i},i}();
},{"safe-buffer":38}],33:[function(require,module,exports) {
"use strict";var t=require("process-nextick-args");function e(e,a){var r=this,s=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;s||d?a?a(e):!e||this._writableState&&this._writableState.errorEmitted||t(i,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!a&&e?(t(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):a&&a(e)}))}function a(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(t,e){t.emit("error",e)}module.exports={destroy:e,undestroy:a};
},{"process-nextick-args":36}],37:[function(require,module,exports) {
var global = (1,eval)("this");
var r=(0,eval)("this");function t(r,t){if(e("noDeprecation"))return r;var n=!1;return function(){if(!n){if(e("throwDeprecation"))throw new Error(t);e("traceDeprecation"),n=!0}return r.apply(this,arguments)}}function e(t){try{if(!r.localStorage)return!1}catch(r){return!1}var e=r.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}module.exports=t;
},{}],28:[function(require,module,exports) {
var process = require("process");
var global = (1,eval)("this");
var e=require("process"),t=(0,eval)("this"),n=require("process-nextick-args");function r(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){I(t,e)}}module.exports=g;var o,s=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?setImmediate:n;g.WritableState=y;var f=require("core-util-is");f.inherits=require("inherits");var u={deprecate:require("util-deprecate")},a=require("./internal/streams/stream"),c=require("safe-buffer").Buffer,d=t.Uint8Array||function(){};function l(e){return c.from(e)}function h(e){return c.isBuffer(e)||e instanceof d}var b,p=require("./internal/streams/destroy");function w(){}function y(e,t){o=o||require("./_stream_duplex"),e=e||{},this.objectMode=!!e.objectMode,t instanceof o&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){x(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function g(e){if(o=o||require("./_stream_duplex"),!(b.call(g,this)||this instanceof o))return new g(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function v(e,t){var r=new Error("write after end");e.emit("error",r),n(t,r)}function q(e,t,r,i){var o=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),n(i,s),o=!1),o}function k(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,n)),t}function _(e,t,n,r,i,o){if(!n){var s=k(t,r,i);r!==s&&(n=!0,i="buffer",r=s)}var f=t.objectMode?1:r.length;t.length+=f;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var a=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},a?a.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,f,r,i,o);return u}function m(e,t,n,r,i,o,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function R(e,t,r,i,o){--t.pendingcb,r?(n(o,i),n(P,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(o(i),e._writableState.errorEmitted=!0,e.emit("error",i),P(e,t))}function S(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function x(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(S(n),t)R(e,n,r,t,i);else{var o=j(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||E(e,n),r?s(M,e,n,o,i):M(e,n,o,i)}}function M(e,t,n,r){n||B(e,t),t.pendingcb--,r(),P(e,t)}function B(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function E(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),s=t.corkedRequestsFree;s.entry=n;for(var f=0,u=!0;n;)o[f]=n,n.isBuf||(u=!1),n=n.next,f+=1;o.allBuffers=u,m(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new i(t)}else{for(;n;){var a=n.chunk,c=n.encoding,d=n.callback;if(m(e,t,!1,t.objectMode?1:a.length,a,c,d),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function j(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),P(e,t)})}function F(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,n(C,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function P(e,t){var n=j(t);return n&&(F(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}function D(e,t,r){t.ending=!0,P(e,t),r&&(t.finished?n(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function I(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}f.inherits(g,a),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!b.call(this,e)||e&&e._writableState instanceof y}})):b=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,n){var r=this._writableState,i=!1,o=h(e)&&!r.objectMode;return o&&!c.isBuffer(e)&&(e=l(e)),"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=w),r.ended?v(this,n):(o||q(this,r,e,n))&&(r.pendingcb++,i=_(this,r,o,e,t,n)),i},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||E(this,e))},g.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},g.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},g.prototype._writev=null,g.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),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||D(this,r,n)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=p.destroy,g.prototype._undestroy=p.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)};
},{"process-nextick-args":36,"core-util-is":35,"inherits":20,"util-deprecate":37,"./internal/streams/stream":32,"safe-buffer":38,"./internal/streams/destroy":33,"./_stream_duplex":26,"process":6}],26:[function(require,module,exports) {
"use strict";var e=require("process-nextick-args"),t=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};module.exports=l;var r=require("core-util-is");r.inherits=require("inherits");var i=require("./_stream_readable"),a=require("./_stream_writable");r.inherits(l,i);for(var o=t(a.prototype),s=0;s<o.length;s++){var n=o[s];l.prototype[n]||(l.prototype[n]=a.prototype[n])}function l(e){if(!(this instanceof l))return new l(e);i.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||e(h,this)}function h(e){e.end()}function u(e,t){for(var r=0,i=e.length;r<i;r++)t(e[r],r)}Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),l.prototype._destroy=function(t,r){this.push(null),this.end(),e(r,t)};
},{"process-nextick-args":36,"core-util-is":35,"inherits":20,"./_stream_readable":27,"./_stream_writable":28}],41:[function(require,module,exports) {
"use strict";var t=require("safe-buffer").Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.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}};function s(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function a(a){var i=s(a);if("string"!=typeof i&&(t.isEncoding===e||!e(a)))throw new Error("Unknown encoding: "+a);return i||a}function i(e){var s;switch(this.encoding=a(e),this.encoding){case"utf16le":this.text=c,this.end=f,s=4;break;case"utf8":this.fillLast=l,s=4;break;case"base64":this.text=d,this.end=g,s=3;break;default:return this.write=N,void(this.end=v)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(s)}function r(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:-1}function n(t,e,s){var a=e.length-1;if(a<s)return 0;var i=r(e[a]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--a<s?0:(i=r(e[a]))>=0?(i>0&&(t.lastNeed=i-2),i):--a<s?0:(i=r(e[a]))>=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}function h(t,e,s){if(128!=(192&e[0]))return t.lastNeed=0,"�".repeat(s);if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�".repeat(s+1);if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�".repeat(s+2)}}function l(t){var e=this.lastTotal-this.lastNeed,s=h(this,t,e);return void 0!==s?s:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){var s=n(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=s;var a=t.length-(s-this.lastNeed);return t.copy(this.lastChar,0,a),t.toString("utf8",e,a)}function o(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�".repeat(this.lastTotal-this.lastNeed):e}function c(t,e){if((t.length-e)%2==0){var s=t.toString("utf16le",e);if(s){var a=s.charCodeAt(s.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],s.slice(0,-1)}return s}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var s=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,s)}return e}function d(t,e){var s=(t.length-e)%3;return 0===s?t.toString("base64",e):(this.lastNeed=3-s,this.lastTotal=3,1===s?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-s))}function g(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function N(t){return t.toString(this.encoding)}function v(t){return t&&t.length?this.write(t):""}exports.StringDecoder=i,i.prototype.write=function(t){if(0===t.length)return"";var e,s;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";s=this.lastNeed,this.lastNeed=0}else s=0;return s<t.length?e?e+this.text(t,s):this.text(t,s):e||""},i.prototype.end=o,i.prototype.text=u,i.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};
},{"safe-buffer":38}],27:[function(require,module,exports) {
var global = (1,eval)("this");
var process = require("process");
var e=(0,eval)("this"),t=require("process"),n=require("process-nextick-args");module.exports=_;var r,i=require("isarray");_.ReadableState=w;var a=require("events").EventEmitter,d=function(e,t){return e.listeners(t).length},o=require("./internal/streams/stream"),s=require("safe-buffer").Buffer,u=e.Uint8Array||function(){};function l(e){return s.from(e)}function h(e){return s.isBuffer(e)||e instanceof u}var p=require("core-util-is");p.inherits=require("inherits");var f=require("util"),c=void 0;c=f&&f.debuglog?f.debuglog("stream"):function(){};var g,b=require("./internal/streams/BufferList"),m=require("./internal/streams/destroy");p.inherits(_,o);var v=["error","close","destroy","pause","resume"];function y(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function w(e,t){r=r||require("./_stream_duplex"),e=e||{},this.objectMode=!!e.objectMode,t instanceof r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,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.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(g||(g=require("string_decoder/").StringDecoder),this.decoder=new g(e.encoding),this.encoding=e.encoding)}function _(e){if(r=r||require("./_stream_duplex"),!(this instanceof _))return new _(e);this._readableState=new w(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function S(e,t,n,r,i){var a,d=e._readableState;null===t?(d.reading=!1,q(e,d)):(i||(a=j(d,t)),a?e.emit("error",a):d.objectMode||t&&t.length>0?("string"==typeof t||d.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=l(t)),r?d.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):M(e,d,t,!0):d.ended?e.emit("error",new Error("stream.push() after EOF")):(d.reading=!1,d.decoder&&!n?(t=d.decoder.write(t),d.objectMode||0!==t.length?M(e,d,t,!1):x(e,d)):M(e,d,t,!1))):r||(d.reading=!1));return R(d)}function M(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&C(e)),x(e,t)}function j(e,t){var n;return h(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function R(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=m.destroy,_.prototype._undestroy=m.undestroy,_.prototype._destroy=function(e,t){this.push(null),t(e)},_.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=s.from(e,t),t=""),n=!0),S(this,e,t,!1,n)},_.prototype.unshift=function(e){return S(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){return g||(g=require("string_decoder/").StringDecoder),this._readableState.decoder=new g(e),this._readableState.encoding=e,this};var k=8388608;function E(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function L(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=E(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function q(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,C(e)}}function C(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n(D,e):D(e))}function D(e){c("emit readable"),e.emit("readable"),I(e)}function x(e,t){t.readingMore||(t.readingMore=!0,n(W,e,t))}function W(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(c("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function O(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&d(e,"data")&&(t.flowing=!0,I(e))}}function U(e){c("readable nexttick read 0"),e.read(0)}function B(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n(P,e,t))}function P(e,t){t.reading||(c("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),I(e),t.flowing&&!t.reading&&e.read(0)}function I(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function A(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=F(e,t.buffer,t.decoder),n);var n}function F(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?T(e,t):z(e,t),r}function T(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var a=n.data,d=e>a.length?a.length:e;if(d===a.length?i+=a:i+=a.slice(0,e),0===(e-=d)){d===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(d));break}++r}return t.length-=r,i}function z(e,t){var n=s.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var a=r.data,d=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,d),0===(e-=d)){d===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(d));break}++i}return t.length-=i,n}function G(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n(H,t,e))}function H(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function J(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function K(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}_.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?G(this):C(this),null;if(0===(e=L(e,t))&&t.ended)return 0===t.length&&G(this),null;var r,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=L(n,t))),null===(r=e>0?A(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&G(this)),null!==r&&this.emit("data",r),r},_.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(e,r){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,c("pipe count=%d opts=%j",a.pipesCount,r);var o=(!r||!1!==r.end)&&e!==t.stdout&&e!==t.stderr?u:v;function s(t,n){c("onunpipe"),t===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),e.removeListener("close",b),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",g),e.removeListener("unpipe",s),i.removeListener("end",u),i.removeListener("end",v),i.removeListener("data",f),h=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){c("onend"),e.end()}a.endEmitted?n(o):i.once("end",o),e.on("unpipe",s);var l=O(i);e.on("drain",l);var h=!1;var p=!1;function f(t){c("ondata"),p=!1,!1!==e.write(t)||p||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==K(a.pipes,e))&&!h&&(c("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,p=!0),i.pause())}function g(t){c("onerror",t),v(),e.removeListener("error",g),0===d(e,"error")&&e.emit("error",t)}function b(){e.removeListener("finish",m),v()}function m(){c("onfinish"),e.removeListener("close",b),v()}function v(){c("unpipe"),i.unpipe(e)}return i.on("data",f),y(e,"error",g),e.once("close",b),e.once("finish",m),e.emit("pipe",i),a.flowing||(c("pipe resume"),i.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,n);return this}var d=K(t.pipes,e);return-1===d?this:(t.pipes.splice(d,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},_.prototype.on=function(e,t){var r=o.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&C(this):n(U,this))}return r},_.prototype.addListener=_.prototype.on,_.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!0,B(this,e)),this},_.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this},_.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(c("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){(c("wrapped data"),t.decoder&&(i=t.decoder.write(i)),!t.objectMode||null!==i&&void 0!==i)&&((t.objectMode||i&&i.length)&&(r.push(i)||(n=!0,e.pause())))});for(var i in e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<v.length;a++)e.on(v[a],r.emit.bind(r,v[a]));return r._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},r},_._fromList=A;
},{"process-nextick-args":36,"isarray":39,"events":19,"./internal/streams/stream":32,"safe-buffer":38,"core-util-is":35,"inherits":20,"util":31,"./internal/streams/BufferList":34,"./internal/streams/destroy":33,"./_stream_duplex":26,"string_decoder/":41,"process":6}],29:[function(require,module,exports) {
"use strict";module.exports=i;var t=require("./_stream_duplex"),r=require("core-util-is");function e(t){this.afterTransform=function(r,e){return n(t,r,e)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function n(t,r,e){var n=t._transformState;n.transforming=!1;var i=n.writecb;if(!i)return t.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!==e&&void 0!==e&&t.push(e),i(r);var a=t._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&t._read(a.highWaterMark)}function i(r){if(!(this instanceof i))return new i(r);t.call(this,r),this._transformState=new e(this);var n=this;this._readableState.needReadable=!0,this._readableState.sync=!1,r&&("function"==typeof r.transform&&(this._transform=r.transform),"function"==typeof r.flush&&(this._flush=r.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(t,r){a(n,t,r)}):a(n)})}function a(t,r,e){if(r)return t.emit("error",r);null!==e&&void 0!==e&&t.push(e);var n=t._writableState,i=t._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}r.inherits=require("inherits"),r.inherits(i,t),i.prototype.push=function(r,e){return this._transformState.needTransform=!1,t.prototype.push.call(this,r,e)},i.prototype._transform=function(t,r,e){throw new Error("_transform() is not implemented")},i.prototype._write=function(t,r,e){var n=this._transformState;if(n.writecb=e,n.writechunk=t,n.writeencoding=r,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},i.prototype._read=function(t){var r=this._transformState;null!==r.writechunk&&r.writecb&&!r.transforming?(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform)):r.needTransform=!0},i.prototype._destroy=function(r,e){var n=this;t.prototype._destroy.call(this,r,function(t){e(t),n.emit("close")})};
},{"./_stream_duplex":26,"core-util-is":35,"inherits":20}],30:[function(require,module,exports) {
"use strict";module.exports=i;var r=require("./_stream_transform"),e=require("core-util-is");function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}e.inherits=require("inherits"),e.inherits(i,r),i.prototype._transform=function(r,e,i){i(null,r)};
},{"./_stream_transform":29,"core-util-is":35,"inherits":20}],21:[function(require,module,exports) {
exports=module.exports=require("./lib/_stream_readable.js"),exports.Stream=exports,exports.Readable=exports,exports.Writable=require("./lib/_stream_writable.js"),exports.Duplex=require("./lib/_stream_duplex.js"),exports.Transform=require("./lib/_stream_transform.js"),exports.PassThrough=require("./lib/_stream_passthrough.js");
},{"./lib/_stream_readable.js":27,"./lib/_stream_writable.js":28,"./lib/_stream_duplex.js":26,"./lib/_stream_transform.js":29,"./lib/_stream_passthrough.js":30}],25:[function(require,module,exports) {
module.exports=require("./lib/_stream_writable.js");
},{"./lib/_stream_writable.js":28}],24:[function(require,module,exports) {
module.exports=require("./lib/_stream_duplex.js");
},{"./lib/_stream_duplex.js":26}],23:[function(require,module,exports) {
module.exports=require("./readable").Transform;
},{"./readable":21}],22:[function(require,module,exports) {
module.exports=require("./readable").PassThrough;
},{"./readable":21}],14:[function(require,module,exports) {
module.exports=n;var e=require("events").EventEmitter,r=require("inherits");function n(){e.call(this)}r(n,e),n.Readable=require("readable-stream/readable.js"),n.Writable=require("readable-stream/writable.js"),n.Duplex=require("readable-stream/duplex.js"),n.Transform=require("readable-stream/transform.js"),n.PassThrough=require("readable-stream/passthrough.js"),n.Stream=n,n.prototype.pipe=function(r,n){var o=this;function t(e){r.writable&&!1===r.write(e)&&o.pause&&o.pause()}function s(){o.readable&&o.resume&&o.resume()}o.on("data",t),r.on("drain",s),r._isStdio||n&&!1===n.end||(o.on("end",a),o.on("close",u));var i=!1;function a(){i||(i=!0,r.end())}function u(){i||(i=!0,"function"==typeof r.destroy&&r.destroy())}function d(r){if(l(),0===e.listenerCount(this,"error"))throw r}function l(){o.removeListener("data",t),r.removeListener("drain",s),o.removeListener("end",a),o.removeListener("close",u),o.removeListener("error",d),r.removeListener("error",d),o.removeListener("end",l),o.removeListener("close",l),r.removeListener("close",l)}return o.on("error",d),r.on("error",d),o.on("end",l),o.on("close",l),r.on("close",l),r.emit("pipe",o),r};
},{"events":19,"inherits":20,"readable-stream/readable.js":21,"readable-stream/writable.js":25,"readable-stream/duplex.js":24,"readable-stream/transform.js":23,"readable-stream/passthrough.js":22}],13:[function(require,module,exports) {
"use strict";module.exports.isFunction=(e=>{return e&&"[object Function]"==={}.toString.call(e)}),module.exports.isArray=(e=>Array.isArray(e)),module.exports.isObject=(e=>e instanceof Object),module.exports.isString=(e=>"string"==typeof e),module.exports.isNumber=(e=>"number"==typeof e),module.exports.isBoolean=(e=>"boolean"==typeof e),module.exports.isDate=(e=>e instanceof Date);
},{}],16:[function(require,module,exports) {
var r=require("os");const o=require("./helper");module.exports=function(e,n){if(!e||!o.isArray(e))throw new TypeError('Invalid params "rows" for joinRows. Must be an array of string.');return e.join(n||r.EOL||"\n")};
},{"os":15,"./helper":13}],17:[function(require,module,exports) {
"use strict";const e=require("../core/helper");class t{constructor(e){this._options=e,this._options.handleString=this._options.handleString||this._handleString,this._options.handleNumber=this._options.handleNumber||this._handleNumber,this._options.handleBoolean=this._options.handleBoolean||this._handleBoolean,this._options.handleDate=this._options.handleDate||this._handleDate}_setHeaders(e,t){let i=this;return t?e.map(function(e){return e.item=e.item?t+i._options.headerPathString+e.item:t,e}):e}check(t,i){if(e.isString(t))return[{item:i,value:this._options.handleString(t,i)}];if(e.isNumber(t))return[{item:i,value:this._options.handleNumber(t,i)}];if(e.isBoolean(t))return[{item:i,value:this._options.handleBoolean.bind(this)(t,i)}];if(e.isDate(t))return[{item:i,value:this._options.handleDate(t,i)}];if(e.isArray(t)){var n=this._handleArray(t,i);return this._setHeaders(n,i)}if(e.isObject(t)){var r=this._handleObject(t,i);return this._setHeaders(r,i)}return[{item:i,value:""}]}_handleObject(e){var t=[];for(var i in e){var n=e[i],r=this.check(n,i);t=t.concat(r)}return t}_handleArray(e){let t=this,i=[];var n;for(let o of e){var r=t.check(o);if(0!==r.length){var a=r[0];a.item||void 0===n?(r.length>0&&!a.item&&void 0===n&&(n=a),i=i.concat(r)):n.value+=t._options.arrayPathString+a.value}}return i}_handleBoolean(e){return e?this._options.booleanTrueString||"true":this._options.booleanFalseString||"false"}_handleString(e){return e}_handleNumber(e){return e}_handleDate(e){return e.toLocaleDateString()}}module.exports=t;
},{"../core/helper":13}],18:[function(require,module,exports) {
"use strict";module.exports=function(e,r){if("string"!=typeof e)throw new TypeError('Invalid param "textDelimiter", must be a string.');if("string"!=typeof r)throw new TypeError('Invalid param "rowDelimiter", must be a string.');let n=new RegExp("\\"+e,"g"),t=e+e;const i='"'===e?e=>e.indexOf(r)>=0||e.indexOf("\n")>=0||e.indexOf('"')>=0:e=>e.indexOf(r)>=0||e.indexOf("\n")>=0;return function(r){if(!r.replace)return r;var f=r.replace(n,t);return i(r)&&(f=e+f+e),f}};
},{}],12:[function(require,module,exports) {
"use strict";const e=require("os"),t=require("stream").Transform,i=require("../core/join-rows"),r=require("./handler"),s=require("../core/helper");class n{constructor(e){this._options=this._parseOptions(e)||{},this._handler=new r(this._options),this._headers=this._options.headers||[],this._escape=require("../core/escape-delimiters")(this._options.textDelimiter,this._options.rowDelimiter)}parse(e,t,i){return s.isArray(e)?t(null,this._parseArray(e,i)):s.isObject(e)?t(null,this._parseObject(e)):t(new Error("Unable to parse the JSON object, its not an Array or Object."))}get headers(){let e=this._headers;return this._options.rename&&this._options.rename.length>0&&(e=e.map(e=>this._options.rename[this._options.headers.indexOf(e)]||e)),e.join(this._options.rowDelimiter)}_checkRows(e){let t=null,i=[],r=(e,i)=>""===e||void 0===e?t[i]:e;for(let s of e){let e=this._headers.length-s.length;e>0&&(s=s.concat(Array(e).join(".").split("."))),t&&this._options.fillGaps&&(s=s.map(r)),i.push(s.join(this._options.rowDelimiter)),t=s}return i}_parseArray(e,t){let r=this;this._headers=this._headers||[];let s,n=[],o=function(e){var t=r._headers.indexOf(e);return-1===t&&(r._headers.push(e),t=r._headers.indexOf(e)),t};s=function(e){let t=[Array(r._headers.length).join(".").split(".")];for(let i of e){let e=o(i.item),s=!1;for(let n of t)if(!s&&""===n[e]||void 0===n[e]){n[e]=r._escape(i.value),s=!0;break}if(!s){let s=Array(r._headers.length).join(".").split(".");s[e]=r._escape(i.value),t.push(s)}}n=n.concat(r._checkRows(t))};for(let t of e){s(r._handler.check(t,r._options.mainPathItem))}return!t&&r._options.includeHeaders&&n.unshift(this.headers),i(n,r._options.endOfLine)}_parseObject(e){let t,r=this,s=[],n=[],o=[[],[]];t=function(e){var t=e.value?e.value.toString():r._options.undefinedString;if(t=r._escape(t),r._options.verticalOutput){var i=[e.item,t];s.push(i.join(r._options.rowDelimiter))}else o[0].push(e.item),o[1].push(t)};for(var a in e){var h="";this._options.mainPathItem&&(h=this._options.mainPathItem+this._options.headerPathString),(n=this._handler.check(e[a],h+a)).forEach(t)}return this._options.verticalOutput||(s.push(o[0].join(this._options.rowDelimiter)),s.push(o[1].join(this._options.rowDelimiter))),i(s,this._options.endOfLine)}_parseOptions(t){let i={headers:[],rename:[],headerPathString:".",rowDelimiter:",",textDelimiter:'"',arrayPathString:";",undefinedString:"",endOfLine:e.EOL||"\n",mainPathItem:null,booleanTrueString:null,booleanFalseString:null,includeHeaders:!0,fillGaps:!1,verticalOutput:!0,handleString:void 0,handleNumber:void 0,handleBoolean:void 0,handleDate:void 0};return Object.assign({},i,t)}}module.exports=n;
},{"os":15,"stream":14,"../core/join-rows":16,"./handler":17,"../core/helper":13,"../core/escape-delimiters":18}],11:[function(require,module,exports) {
"use strict";const t=require("stream").Transform;class r extends t{constructor(t){super(),this._parser=t,this._options=t._options,this._headers=this._options.headers||[],this._hasHeaders=!1,this._lastError=null}_mergeChunk(t){return this._extra=this._extra||"",this._extra.length>3*t.toString().length?null:(","==this._extra.charAt(0)&&(this._extra=this._extra.substr(1)),t=this._extra+t.toString(),this._extra.length>0&&(this._extra=""),t)}_wrapArray(t){return"["!=t.charAt(0)&&(t="["+t),"]"!=t.charAt(t.length-1)&&(t+="]"),t}_transform(t,r,e){let s=this,h=null;if(!(t=this._mergeChunk(t)))return e(this._lastError);let a=t.split("}");for(;null===h&&a.length>0;)try{let t=s._wrapArray(a.join("}"));h=JSON.parse(t)}catch(t){this._lastError=t;let r=a.pop();s._extra=r+(s._extra||""),a.length>0&&(a[a.length-1]+="}")}if(!h)return e();this._parser.parse(h,(t,r)=>{if(t)return e(t);s.hasHeaders||(s.hasHeaders=!0,s.push(s._parser.headers)),s.push(s._options.endOfLine+r),e()},!0)}}module.exports=r;
},{"stream":14}],10:[function(require,module,exports) {
"use strict";const e=require("./parser/csv"),r=require("./core/stream"),i=require("./core/helper");module.exports=function(n,s,t){i.isFunction(s)&&(t=s,s={});let u=new e(s=t?s:n);if(!t||!i.isFunction(t))return new r(u);u.parse(n,t)};
},{"./parser/csv":12,"./core/stream":11,"./core/helper":13}],3:[function(require,module,exports) {
"use strict";function r(r){if(Array.isArray(r)){for(var e=0,t=Array(r.length);e<r.length;e++)t[e]=r[e];return t}return Array.from(r)}Object.defineProperty(exports,"__esModule",{value:!0});var e=exports.flatten=function(e){var t;return(t=[]).concat.apply(t,r(e))},t=exports.compact=function(r){return r.filter(function(r){return!!r})},n=exports.parseJapaneseDate=function(r){var e=r.match(/(\d+)年(\d+)月(\d+)日/);if(e){var t=e.slice(1,4).map(function(r){return parseInt(r)});return new Date(t[0],t[1]-1,t[2])}},a=exports.parseJapaneseYen=function(r){return r&&parseInt(r.replace("¥","").replace(",",""))};
},{}],4:[function(require,module,exports) {
var process = require("process");
var e=require("process");Object.defineProperty(exports,"__esModule",{value:!0});var r=exports.debug=function(){e&&e.env};
},{"process":6}],8:[function(require,module,exports) {
module.exports=function(o){return o&&"object"==typeof o&&"function"==typeof o.copy&&"function"==typeof o.fill&&"function"==typeof o.readUInt8};
},{}],7:[function(require,module,exports) {
var global = (1,eval)("this");
var process = require("process");
var e=(0,eval)("this"),t=require("process"),r=/%[sdj%]/g;exports.format=function(e){if(!v(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}n=1;for(var o=arguments,u=o.length,s=String(e).replace(r,function(e){if("%%"===e)return"%";if(n>=u)return e;switch(e){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch(e){return"[Circular]"}default:return e}}),c=o[n];n<u;c=o[++n])h(c)||!z(c)?s+=" "+c:s+=" "+i(c);return s},exports.deprecate=function(r,n){if(j(e.process))return function(){return exports.deprecate(r,n).apply(this,arguments)};if(!0===t.noDeprecation)return r;var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation,o=!0}return r.apply(this,arguments)}};var n,o={};function i(e,t){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),x(t)?r.showHidden=t:t&&exports._extend(r,t),j(r.showHidden)&&(r.showHidden=!1),j(r.depth)&&(r.depth=2),j(r.colors)&&(r.colors=!1),j(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),p(r,e,r.depth)}function u(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function s(e,t){return e}function c(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function p(e,t,r){if(e.customInspect&&t&&D(t.inspect)&&t.inspect!==exports.inspect&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return v(n)||(n=p(e,n,r)),n}var o=l(e,t);if(o)return o;var i=Object.keys(t),u=c(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),E(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return a(t);if(0===i.length){if(D(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(O(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(w(t))return e.stylize(Date.prototype.toString.call(t),"date");if(E(t))return a(t)}var x,h="",b=!1,m=["{","}"];(d(t)&&(b=!0,m=["[","]"]),D(t))&&(h=" [Function"+(t.name?": "+t.name:"")+"]");return O(t)&&(h=" "+RegExp.prototype.toString.call(t)),w(t)&&(h=" "+Date.prototype.toUTCString.call(t)),E(t)&&(h=" "+a(t)),0!==i.length||b&&0!=t.length?r<0?O(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),x=b?f(e,t,r,u,i):i.map(function(n){return g(e,t,r,u,n,b)}),e.seen.pop(),y(x,h,m)):m[0]+h+m[1]}function l(e,t){if(j(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):x(t)?e.stylize(""+t,"boolean"):h(t)?e.stylize("null","null"):void 0}function a(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,o){for(var i=[],u=0,s=t.length;u<s;++u)$(t,String(u))?i.push(g(e,t,r,n,String(u),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(g(e,t,r,n,o,!0))}),i}function g(e,t,r,n,o,i){var u,s,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),$(n,o)||(u="["+o+"]"),s||(e.seen.indexOf(c.value)<0?(s=h(r)?p(e,c.value,null):p(e,c.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),j(u)){if(i&&o.match(/^\d+$/))return s;(u=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+s}function y(e,t,r){return e.reduce(function(e,t){return 0,t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function d(e){return Array.isArray(e)}function x(e){return"boolean"==typeof e}function h(e){return null===e}function b(e){return null==e}function m(e){return"number"==typeof e}function v(e){return"string"==typeof e}function S(e){return"symbol"==typeof e}function j(e){return void 0===e}function O(e){return z(e)&&"[object RegExp]"===A(e)}function z(e){return"object"==typeof e&&null!==e}function w(e){return z(e)&&"[object Date]"===A(e)}function E(e){return z(e)&&("[object Error]"===A(e)||e instanceof Error)}function D(e){return"function"==typeof e}function N(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function A(e){return Object.prototype.toString.call(e)}function J(e){return e<10?"0"+e.toString(10):e.toString(10)}exports.debuglog=function(e){if(j(n)&&(n=""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(n)){t.pid;o[e]=function(){exports.format.apply(exports,arguments)}}else o[e]=function(){};return o[e]},exports.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"},exports.isArray=d,exports.isBoolean=x,exports.isNull=h,exports.isNullOrUndefined=b,exports.isNumber=m,exports.isString=v,exports.isSymbol=S,exports.isUndefined=j,exports.isRegExp=O,exports.isObject=z,exports.isDate=w,exports.isError=E,exports.isFunction=D,exports.isPrimitive=N,exports.isBuffer=require("./support/isBuffer");var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function H(){var e=new Date,t=[J(e.getHours()),J(e.getMinutes()),J(e.getSeconds())].join(":");return[e.getDate(),R[e.getMonth()],t].join(" ")}function $(e,t){return Object.prototype.hasOwnProperty.call(e,t)}exports.log=function(){},exports.inherits=require("inherits"),exports._extend=function(e,t){if(!t||!z(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};
},{"./support/isBuffer":8,"inherits":20,"process":6}],5:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("util"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}exports.default=function(e,t,r){var n=e.createElement("a");if(n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(r)),n.setAttribute("download",t),e.createEvent){var a=e.createEvent("MouseEvents");a.initEvent("click",!0,!0),n.dispatchEvent(a)}else n.click()};
},{"util":7}],2:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.downloadAsCsv=exports.isSameBookWithDifferentVolume=exports.scrapeWithFilter=exports.parseOrdersList=exports.parseOrderSummary=void 0;var e=require("jsonexport"),r=l(e),t=require("./utils"),n=require("./logging"),o=require("./download"),i=l(o);function l(e){return e&&e.__esModule?e:{default:e}}function a(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)}var u=function(e){return new Promise(function(r,t){return window.fetch(e,{credentials:"include"}).then(function(e){return e.text()}).then(r).catch(t)})},c=function(e,r){return[].concat(a(e.querySelectorAll(".shipment .a-fixed-left-grid"))).map(function(e){var n=e.querySelectorAll(".a-fixed-left-grid-col.a-col-right > .a-row"),o=n[0].querySelector("a").href,i=n[0].textContent.trim(),l=n[1].textContent.trim(),a=(0,t.parseJapaneseYen)(e.querySelector(".a-color-price").textContent.trim()),u=e.querySelector(".a-fixed-left-grid-col.a-col-left img"),c=u&&u.src;return{order:r,url:o,title:i,author:l,price:a,imageUrl:c}})},f=function(e,r){return[].concat(a(e.querySelectorAll(".sample b > a"))).map(function(e){var o={order:r,url:e.href,title:e.textContent.trim(),author:e.parentNode.parentNode.innerHTML.split("<br>")[1].trim(),imageUrl:null,price:(0,t.parseJapaneseYen)(e.parentNode.parentNode.nextSibling.nextSibling.textContent.trim())};return(0,n.debug)("==> parseOrderSummary",o),o}).sort(x)},s=exports.parseOrderSummary=function(e,r){var t=document.createElement("html");return t.innerHTML=e,t.querySelector(".shipment")?c(t,r):f(t,r)},d=function(e){var r=e.querySelector(".order-info"),n=r.querySelectorAll(".a-fixed-right-grid-col.a-col-left .a-column")[0].querySelector(".value"),o=(0,t.parseJapaneseDate)(n.textContent.trim()),i=r.querySelectorAll(".a-fixed-right-grid-col.a-col-left .a-column")[1].querySelector(".value");return{date:o,price:i&&(0,t.parseJapaneseYen)(i.textContent.trim()),orderId:r.querySelectorAll(".a-fixed-right-grid-col.a-col-right .a-row")[0].querySelector(".value").textContent.trim()}},m=function(e){var r=e.querySelectorAll(".a-box .a-fixed-right-grid .a-fixed-right-grid-col.a-col-left .a-fixed-left-grid"),o=d(e),i=Array.from(r).map(function(r){var i=r&&r.querySelectorAll(".a-fixed-left-grid-col.a-col-right > .a-row"),l=i[0].querySelector(".a-link-normal"),a=r&&r.querySelector(".a-fixed-left-grid-col.a-col-left img");if(o&&r&&l){var u=l.href,c=l.textContent.trim(),f=a&&a.src,s=i[1].textContent.trim(),d=i[4]&&(0,t.parseJapaneseYen)(i[4].textContent.trim()),m={order:o,title:c,author:s,price:d,url:u,imageUrl:f};return(0,n.debug)("==> parseOrdersList",m),m}(0,n.debug)("==> items not found from ",e.textContent.trim())});return Promise.resolve((0,t.compact)(i).sort(x))},p=exports.parseOrdersList=function(e){var r=document.createElement("html");r.innerHTML=e;var n=[].concat(a(r.querySelectorAll(".order")));if(n.length<1)return Promise.resolve([]);var o=n.map(function(e,r){var t=e.querySelector(".a-size-medium.a-link-emphasis");if(t){var n=d(e);return u(t.href).then(function(e){return s(e,n)})}return m(e)});return Promise.all(o).then(function(e){return(0,t.compact)((0,t.flatten)(e))})},h=exports.scrapeWithFilter=function(e){return new Promise(function(r,t){var n=e.filter;!function e(o,i){u("?ie=UTF8&orderFilter="+n+"&startIndex="+10*o).then(function(n){p(n).then(function(t){t.length>0?(i.push.apply(i,a(t)),window.setTimeout(function(){return e(++o,i)},100)):r(i)}).catch(function(e){t(e,i)})})}(0,[])})},x=function(e,r){return v(e.title,r.title)?y.compare(e.title,r.title):e.title>r.title?1:-1},g=/^([^0-90-9]+)(?:[\s\u3000]*)([0-90-9]+)/,y=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}),v=exports.isSameBookWithDifferentVolume=function(e,r){var t=e.match(g),n=r.match(g);return!!(t&&n&&t[1]===n[1]&&t[2]&&n[2])},S=exports.downloadAsCsv=function(e,t,n){n=n||{},(0,r.default)(t,n,function(r,t){(0,i.default)(document,e,t)})};
},{"jsonexport":10,"./utils":3,"./logging":4,"./download":5}],1:[function(require,module,exports) {
"use strict";var e=require("./amalet"),r=function(){var e="year-"+(new Date).getFullYear();return{order:"reverse",exportOptions:{headers:["order.date","author","title","order.price","order.orderId","price","url","imageUrl"],handleDate:function(e){return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()}},filter:"function"==typeof window.prompt?window.prompt("取得範囲を入力してください。year-2018, year-2017, last30, months-6",e):e}},t=function(){var t=r();(0,e.scrapeWithFilter)(t).then(function(r){r="reverse"===t.order?r.reverse():r;var o="amazonReport_"+t.filter+".csv";(0,e.downloadAsCsv)(o,r,t.exportOptions)}).catch(function(e,r){})};t();
},{"./amalet":2}]},{},[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment