mnemonickeys
Version:
Mnemonic (BIP39) to trytes seed converter and generator.
8 lines • 421 kB
JavaScript
var iotaBip39=function(e){var r={};function t(o){if(r[o])return r[o].exports;var i=r[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=65)}([function(e,r){"function"==typeof Object.create?e.exports=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,r){e.super_=r;var t=function(){};t.prototype=r.prototype,e.prototype=new t,e.prototype.constructor=e}},function(e,r,t){var o=t(6),i=o.Buffer;function a(e,r){for(var t in e)r[t]=e[t]}function n(e,r,t){return i(e,r,t)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=o:(a(o,r),r.Buffer=n),a(i,n),n.from=function(e,r,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,r,t)},n.alloc=function(e,r,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var o=i(e);return void 0!==r?"string"==typeof t?o.fill(r,t):o.fill(r):o.fill(0),o},n.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},n.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o.SlowBuffer(e)}},function(e,r){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,r,t){"use strict";var o=t(8),i=Object.keys||function(e){var r=[];for(var t in e)r.push(t);return r};e.exports=f;var a=t(7);a.inherits=t(0);var n=t(23),s=t(10);a.inherits(f,n);for(var l=i(s.prototype),u=0;u<l.length;u++){var c=l[u];f.prototype[c]||(f.prototype[c]=s.prototype[c])}function f(e){if(!(this instanceof f))return new f(e);n.call(this,e),s.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",h)}function h(){this.allowHalfOpen||this._writableState.ended||o.nextTick(p,this)}function p(e){e.end()}Object.defineProperty(f.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)}}),f.prototype._destroy=function(e,r){this.push(null),this.end(),o.nextTick(r,e)}},function(e,r){var t,o,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===a||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:a}catch(e){t=a}try{o="function"==typeof clearTimeout?clearTimeout:n}catch(e){o=n}}();var l,u=[],c=!1,f=-1;function h(){c&&l&&(c=!1,l.length?u=l.concat(u):f=-1,u.length&&p())}function p(){if(!c){var e=s(h);c=!0;for(var r=u.length;r;){for(l=u,u=[];++f<r;)l&&l[f].run();f=-1,r=u.length}l=null,c=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===n||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(r){try{return o.call(null,e)}catch(r){return o.call(this,e)}}}(e)}}function d(e,r){this.fun=e,this.array=r}function m(){}i.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];u.push(new d(e,r)),1!==u.length||c||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,r,t){var o=t(1).Buffer;function i(e,r){this._block=o.alloc(e),this._finalSize=r,this._blockSize=e,this._len=0}i.prototype.update=function(e,r){"string"==typeof e&&(r=r||"utf8",e=o.from(e,r));for(var t=this._block,i=this._blockSize,a=e.length,n=this._len,s=0;s<a;){for(var l=n%i,u=Math.min(a-s,i-l),c=0;c<u;c++)t[l+c]=e[s+c];s+=u,(n+=u)%i==0&&this._update(t)}return this._len+=a,this},i.prototype.digest=function(e){var r=this._len%this._blockSize;this._block[r]=128,this._block.fill(0,r+1),r>=this._finalSize&&(this._update(this._block),this._block.fill(0));var t=8*this._len;if(t<=4294967295)this._block.writeUInt32BE(t,this._blockSize-4);else{var o=(4294967295&t)>>>0,i=(t-o)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(o,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,r,t){"use strict";(function(e){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var o=t(63),i=t(62),a=t(27);function n(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,r){if(n()<r)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r)).__proto__=l.prototype:(null===e&&(e=new l(r)),e.length=r),e}function l(e,r,t){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,r,t);if("number"==typeof e){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return u(this,e,r,t)}function u(e,r,t,o){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(e,r,t,o){if(r.byteLength,t<0||r.byteLength<t)throw new RangeError("'offset' is out of bounds");if(r.byteLength<t+(o||0))throw new RangeError("'length' is out of bounds");r=void 0===t&&void 0===o?new Uint8Array(r):void 0===o?new Uint8Array(r,t):new Uint8Array(r,t,o);l.TYPED_ARRAY_SUPPORT?(e=r).__proto__=l.prototype:e=h(e,r);return e}(e,r,t,o):"string"==typeof r?function(e,r,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var o=0|d(r,t),i=(e=s(e,o)).write(r,t);i!==o&&(e=e.slice(0,i));return e}(e,r,t):function(e,r){if(l.isBuffer(r)){var t=0|p(r.length);return 0===(e=s(e,t)).length?e:(r.copy(e,0,0,t),e)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(o=r.length)!=o?s(e,0):h(e,r);if("Buffer"===r.type&&a(r.data))return h(e,r.data)}var o;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,r)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,r){if(c(r),e=s(e,r<0?0:0|p(r)),!l.TYPED_ARRAY_SUPPORT)for(var t=0;t<r;++t)e[t]=0;return e}function h(e,r){var t=r.length<0?0:0|p(r.length);e=s(e,t);for(var o=0;o<t;o+=1)e[o]=255&r[o];return e}function p(e){if(e>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function d(e,r){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var t=e.length;if(0===t)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return D(e).length;default:if(o)return P(e).length;r=(""+r).toLowerCase(),o=!0}}function m(e,r,t){var o=e[r];e[r]=e[t],e[t]=o}function g(e,r,t,o,i){if(0===e.length)return-1;if("string"==typeof t?(o=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return-1;t=e.length-1}else if(t<0){if(!i)return-1;t=0}if("string"==typeof r&&(r=l.from(r,o)),l.isBuffer(r))return 0===r.length?-1:b(e,r,t,o,i);if("number"==typeof r)return r&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):b(e,[r],t,o,i);throw new TypeError("val must be string, number or Buffer")}function b(e,r,t,o,i){var a,n=1,s=e.length,l=r.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||r.length<2)return-1;n=2,s/=2,l/=2,t/=2}function u(e,r){return 1===n?e[r]:e.readUInt16BE(r*n)}if(i){var c=-1;for(a=t;a<s;a++)if(u(e,a)===u(r,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*n}else-1!==c&&(a-=a-c),c=-1}else for(t+l>s&&(t=s-l),a=t;a>=0;a--){for(var f=!0,h=0;h<l;h++)if(u(e,a+h)!==u(r,h)){f=!1;break}if(f)return a}return-1}function v(e,r,t,o){t=Number(t)||0;var i=e.length-t;o?(o=Number(o))>i&&(o=i):o=i;var a=r.length;if(a%2!=0)throw new TypeError("Invalid hex string");o>a/2&&(o=a/2);for(var n=0;n<o;++n){var s=parseInt(r.substr(2*n,2),16);if(isNaN(s))return n;e[t+n]=s}return n}function y(e,r,t,o){return F(P(r,e.length-t),e,t,o)}function w(e,r,t,o){return F(function(e){for(var r=[],t=0;t<e.length;++t)r.push(255&e.charCodeAt(t));return r}(r),e,t,o)}function _(e,r,t,o){return w(e,r,t,o)}function x(e,r,t,o){return F(D(r),e,t,o)}function z(e,r,t,o){return F(function(e,r){for(var t,o,i,a=[],n=0;n<e.length&&!((r-=2)<0);++n)t=e.charCodeAt(n),o=t>>8,i=t%256,a.push(i),a.push(o);return a}(r,e.length-t),e,t,o)}function k(e,r,t){return 0===r&&t===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(r,t))}function E(e,r,t){t=Math.min(e.length,t);for(var o=[],i=r;i<t;){var a,n,s,l,u=e[i],c=null,f=u>239?4:u>223?3:u>191?2:1;if(i+f<=t)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(a=e[i+1]))&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=e[i+1],n=e[i+2],128==(192&a)&&128==(192&n)&&(l=(15&u)<<12|(63&a)<<6|63&n)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[i+1],n=e[i+2],s=e[i+3],128==(192&a)&&128==(192&n)&&128==(192&s)&&(l=(15&u)<<18|(63&a)<<12|(63&n)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,o.push(c>>>10&1023|55296),c=56320|1023&c),o.push(c),i+=f}return function(e){var r=e.length;if(r<=S)return String.fromCharCode.apply(String,e);var t="",o=0;for(;o<r;)t+=String.fromCharCode.apply(String,e.slice(o,o+=S));return t}(o)}r.Buffer=l,r.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},r.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),r.kMaxLength=n(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,r,t){return u(null,e,r,t)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,r,t){return function(e,r,t,o){return c(r),r<=0?s(e,r):void 0!==t?"string"==typeof o?s(e,r).fill(t,o):s(e,r).fill(t):s(e,r)}(null,e,r,t)},l.allocUnsafe=function(e){return f(null,e)},l.allocUnsafeSlow=function(e){return f(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,r){if(!l.isBuffer(e)||!l.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var t=e.length,o=r.length,i=0,a=Math.min(t,o);i<a;++i)if(e[i]!==r[i]){t=e[i],o=r[i];break}return t<o?-1:o<t?1:0},l.isEncoding=function(e){switch(String(e).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}},l.concat=function(e,r){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var t;if(void 0===r)for(r=0,t=0;t<e.length;++t)r+=e[t].length;var o=l.allocUnsafe(r),i=0;for(t=0;t<e.length;++t){var n=e[t];if(!l.isBuffer(n))throw new TypeError('"list" argument must be an Array of Buffers');n.copy(o,i),i+=n.length}return o},l.byteLength=d,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)m(this,r,r+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)m(this,r,r+3),m(this,r+1,r+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)m(this,r,r+7),m(this,r+1,r+6),m(this,r+2,r+5),m(this,r+3,r+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?E(this,0,e):function(e,r,t){var o=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(r>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,r,t);case"utf8":case"utf-8":return E(this,r,t);case"ascii":return j(this,r,t);case"latin1":case"binary":return T(this,r,t);case"base64":return k(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,r,t);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,r,t,o,i){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===t&&(t=e?e.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),r<0||t>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=t)return 0;if(o>=i)return-1;if(r>=t)return 1;if(r>>>=0,t>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var a=i-o,n=t-r,s=Math.min(a,n),u=this.slice(o,i),c=e.slice(r,t),f=0;f<s;++f)if(u[f]!==c[f]){a=u[f],n=c[f];break}return a<n?-1:n<a?1:0},l.prototype.includes=function(e,r,t){return-1!==this.indexOf(e,r,t)},l.prototype.indexOf=function(e,r,t){return g(this,e,r,t,!0)},l.prototype.lastIndexOf=function(e,r,t){return g(this,e,r,t,!1)},l.prototype.write=function(e,r,t,o){if(void 0===r)o="utf8",t=this.length,r=0;else if(void 0===t&&"string"==typeof r)o=r,t=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(t)?(t|=0,void 0===o&&(o="utf8")):(o=t,t=void 0)}var i=this.length-r;if((void 0===t||t>i)&&(t=i),e.length>0&&(t<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return v(this,e,r,t);case"utf8":case"utf-8":return y(this,e,r,t);case"ascii":return w(this,e,r,t);case"latin1":case"binary":return _(this,e,r,t);case"base64":return x(this,e,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,e,r,t);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function j(e,r,t){var o="";t=Math.min(e.length,t);for(var i=r;i<t;++i)o+=String.fromCharCode(127&e[i]);return o}function T(e,r,t){var o="";t=Math.min(e.length,t);for(var i=r;i<t;++i)o+=String.fromCharCode(e[i]);return o}function B(e,r,t){var o=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>o)&&(t=o);for(var i="",a=r;a<t;++a)i+=U(e[a]);return i}function q(e,r,t){for(var o=e.slice(r,t),i="",a=0;a<o.length;a+=2)i+=String.fromCharCode(o[a]+256*o[a+1]);return i}function A(e,r,t){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}function R(e,r,t,o,i,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)throw new RangeError('"value" argument is out of bounds');if(t+o>e.length)throw new RangeError("Index out of range")}function C(e,r,t,o){r<0&&(r=65535+r+1);for(var i=0,a=Math.min(e.length-t,2);i<a;++i)e[t+i]=(r&255<<8*(o?i:1-i))>>>8*(o?i:1-i)}function I(e,r,t,o){r<0&&(r=4294967295+r+1);for(var i=0,a=Math.min(e.length-t,4);i<a;++i)e[t+i]=r>>>8*(o?i:3-i)&255}function M(e,r,t,o,i,a){if(t+o>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function L(e,r,t,o,a){return a||M(e,0,t,4),i.write(e,r,t,o,23,4),t+4}function N(e,r,t,o,a){return a||M(e,0,t,8),i.write(e,r,t,o,52,8),t+8}l.prototype.slice=function(e,r){var t,o=this.length;if(e=~~e,r=void 0===r?o:~~r,e<0?(e+=o)<0&&(e=0):e>o&&(e=o),r<0?(r+=o)<0&&(r=0):r>o&&(r=o),r<e&&(r=e),l.TYPED_ARRAY_SUPPORT)(t=this.subarray(e,r)).__proto__=l.prototype;else{var i=r-e;t=new l(i,void 0);for(var a=0;a<i;++a)t[a]=this[a+e]}return t},l.prototype.readUIntLE=function(e,r,t){e|=0,r|=0,t||A(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return o},l.prototype.readUIntBE=function(e,r,t){e|=0,r|=0,t||A(e,r,this.length);for(var o=this[e+--r],i=1;r>0&&(i*=256);)o+=this[e+--r]*i;return o},l.prototype.readUInt8=function(e,r){return r||A(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,r){return r||A(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,r){return r||A(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,r){return r||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,r){return r||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,r,t){e|=0,r|=0,t||A(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},l.prototype.readIntBE=function(e,r,t){e|=0,r|=0,t||A(e,r,this.length);for(var o=r,i=1,a=this[e+--o];o>0&&(i*=256);)a+=this[e+--o]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*r)),a},l.prototype.readInt8=function(e,r){return r||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,r){r||A(e,2,this.length);var t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},l.prototype.readInt16BE=function(e,r){r||A(e,2,this.length);var t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},l.prototype.readInt32LE=function(e,r){return r||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,r){return r||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,r){return r||A(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,r){return r||A(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,r){return r||A(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,r){return r||A(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,r,t,o){(e=+e,r|=0,t|=0,o)||R(this,e,r,t,Math.pow(2,8*t)-1,0);var i=1,a=0;for(this[r]=255&e;++a<t&&(i*=256);)this[r+a]=e/i&255;return r+t},l.prototype.writeUIntBE=function(e,r,t,o){(e=+e,r|=0,t|=0,o)||R(this,e,r,t,Math.pow(2,8*t)-1,0);var i=t-1,a=1;for(this[r+i]=255&e;--i>=0&&(a*=256);)this[r+i]=e/a&255;return r+t},l.prototype.writeUInt8=function(e,r,t){return e=+e,r|=0,t||R(this,e,r,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},l.prototype.writeUInt16LE=function(e,r,t){return e=+e,r|=0,t||R(this,e,r,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):C(this,e,r,!0),r+2},l.prototype.writeUInt16BE=function(e,r,t){return e=+e,r|=0,t||R(this,e,r,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):C(this,e,r,!1),r+2},l.prototype.writeUInt32LE=function(e,r,t){return e=+e,r|=0,t||R(this,e,r,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):I(this,e,r,!0),r+4},l.prototype.writeUInt32BE=function(e,r,t){return e=+e,r|=0,t||R(this,e,r,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):I(this,e,r,!1),r+4},l.prototype.writeIntLE=function(e,r,t,o){if(e=+e,r|=0,!o){var i=Math.pow(2,8*t-1);R(this,e,r,t,i-1,-i)}var a=0,n=1,s=0;for(this[r]=255&e;++a<t&&(n*=256);)e<0&&0===s&&0!==this[r+a-1]&&(s=1),this[r+a]=(e/n>>0)-s&255;return r+t},l.prototype.writeIntBE=function(e,r,t,o){if(e=+e,r|=0,!o){var i=Math.pow(2,8*t-1);R(this,e,r,t,i-1,-i)}var a=t-1,n=1,s=0;for(this[r+a]=255&e;--a>=0&&(n*=256);)e<0&&0===s&&0!==this[r+a+1]&&(s=1),this[r+a]=(e/n>>0)-s&255;return r+t},l.prototype.writeInt8=function(e,r,t){return e=+e,r|=0,t||R(this,e,r,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},l.prototype.writeInt16LE=function(e,r,t){return e=+e,r|=0,t||R(this,e,r,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):C(this,e,r,!0),r+2},l.prototype.writeInt16BE=function(e,r,t){return e=+e,r|=0,t||R(this,e,r,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):C(this,e,r,!1),r+2},l.prototype.writeInt32LE=function(e,r,t){return e=+e,r|=0,t||R(this,e,r,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):I(this,e,r,!0),r+4},l.prototype.writeInt32BE=function(e,r,t){return e=+e,r|=0,t||R(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):I(this,e,r,!1),r+4},l.prototype.writeFloatLE=function(e,r,t){return L(this,e,r,!0,t)},l.prototype.writeFloatBE=function(e,r,t){return L(this,e,r,!1,t)},l.prototype.writeDoubleLE=function(e,r,t){return N(this,e,r,!0,t)},l.prototype.writeDoubleBE=function(e,r,t){return N(this,e,r,!1,t)},l.prototype.copy=function(e,r,t,o){if(t||(t=0),o||0===o||(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o<t&&(o=t),o===t)return 0;if(0===e.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r<o-t&&(o=e.length-r+t);var i,a=o-t;if(this===e&&t<r&&r<o)for(i=a-1;i>=0;--i)e[i+r]=this[i+t];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+r]=this[i+t];else Uint8Array.prototype.set.call(e,this.subarray(t,t+a),r);return a},l.prototype.fill=function(e,r,t,o){if("string"==typeof e){if("string"==typeof r?(o=r,r=0,t=this.length):"string"==typeof t&&(o=t,t=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!l.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else"number"==typeof e&&(e&=255);if(r<0||this.length<r||this.length<t)throw new RangeError("Out of range index");if(t<=r)return this;var a;if(r>>>=0,t=void 0===t?this.length:t>>>0,e||(e=0),"number"==typeof e)for(a=r;a<t;++a)this[a]=e;else{var n=l.isBuffer(e)?e:P(new l(e,o).toString()),s=n.length;for(a=0;a<t-r;++a)this[a+r]=n[a%s]}return this};var O=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function P(e,r){var t;r=r||1/0;for(var o=e.length,i=null,a=[],n=0;n<o;++n){if((t=e.charCodeAt(n))>55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&a.push(239,191,189);continue}if(n+1===o){(r-=3)>-1&&a.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&a.push(239,191,189),i=t;continue}t=65536+(i-55296<<10|t-56320)}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;a.push(t)}else if(t<2048){if((r-=2)<0)break;a.push(t>>6|192,63&t|128)}else if(t<65536){if((r-=3)<0)break;a.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return a}function D(e){return o.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,r,t,o){for(var i=0;i<o&&!(i+t>=r.length||i>=e.length);++i)r[i+t]=e[i];return i}}).call(this,t(2))},function(e,r,t){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this,t(6).Buffer)},function(e,r,t){"use strict";(function(r){!r.version||0===r.version.indexOf("v0.")||0===r.version.indexOf("v1.")&&0!==r.version.indexOf("v1.8.")?e.exports={nextTick:function(e,t,o,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,n,s=arguments.length;switch(s){case 0:case 1:return r.nextTick(e);case 2:return r.nextTick(function(){e.call(null,t)});case 3:return r.nextTick(function(){e.call(null,t,o)});case 4:return r.nextTick(function(){e.call(null,t,o,i)});default:for(a=new Array(s-1),n=0;n<a.length;)a[n++]=arguments[n];return r.nextTick(function(){e.apply(null,a)})}}}:e.exports=r}).call(this,t(4))},function(e,r,t){"use strict";var o=t(1).Buffer,i=o.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var r;switch(this.encoding=function(e){var r=function(e){if(!e)return"utf8";for(var r;;)switch(e){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 e;default:if(r)return;e=(""+e).toLowerCase(),r=!0}}(e);if("string"!=typeof r&&(o.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return r||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,r=4;break;case"utf8":this.fillLast=s,r=4;break;case"base64":this.text=c,this.end=f,r=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=o.allocUnsafe(r)}function n(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function s(e){var r=this.lastTotal-this.lastNeed,t=function(e,r,t){if(128!=(192&r[0]))return e.lastNeed=0,"�".repeat(t);if(e.lastNeed>1&&r.length>1){if(128!=(192&r[1]))return e.lastNeed=1,"�".repeat(t+1);if(e.lastNeed>2&&r.length>2&&128!=(192&r[2]))return e.lastNeed=2,"�".repeat(t+2)}}(this,e,r);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,r,0,e.length),void(this.lastNeed-=e.length))}function l(e,r){if((e.length-r)%2==0){var t=e.toString("utf16le",r);if(t){var o=t.charCodeAt(t.length-1);if(o>=55296&&o<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",r,e.length-1)}function u(e){var r=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,t)}return r}function c(e,r){var t=(e.length-r)%3;return 0===t?e.toString("base64",r):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",r,e.length-t))}function f(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}r.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var r,t;if(this.lastNeed){if(void 0===(r=this.fillLast(e)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<e.length?r?r+this.text(e,t):this.text(e,t):r||""},a.prototype.end=function(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+"�".repeat(this.lastTotal-this.lastNeed):r},a.prototype.text=function(e,r){var t=function(e,r,t){var o=r.length-1;if(o<t)return 0;var i=n(r[o]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--o<t)return 0;if((i=n(r[o]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--o<t)return 0;if((i=n(r[o]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,r);if(!this.lastNeed)return e.toString("utf8",r);this.lastTotal=t;var o=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,o),e.toString("utf8",r,o)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,r,t){"use strict";(function(r,o,i){var a=t(8);function n(e){var r=this;this.next=null,this.entry=null,this.finish=function(){!function(e,r,t){var o=e.entry;e.entry=null;for(;o;){var i=o.callback;r.pendingcb--,i(t),o=o.next}r.corkedRequestsFree?r.corkedRequestsFree.next=e:r.corkedRequestsFree=e}(r,e)}}e.exports=v;var s,l=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?o:a.nextTick;v.WritableState=b;var u=t(7);u.inherits=t(0);var c={deprecate:t(53)},f=t(22),h=t(1).Buffer,p=i.Uint8Array||function(){};var d,m=t(21);function g(){}function b(e,r){s=s||t(3),e=e||{};var o=r instanceof s;this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:o&&(u||0===u)?u:c,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 f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,r){var t=e._writableState,o=t.sync,i=t.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(t),r)!function(e,r,t,o,i){--r.pendingcb,t?(a.nextTick(i,o),a.nextTick(k,e,r),e._writableState.errorEmitted=!0,e.emit("error",o)):(i(o),e._writableState.errorEmitted=!0,e.emit("error",o),k(e,r))}(e,t,o,r,i);else{var n=x(t);n||t.corked||t.bufferProcessing||!t.bufferedRequest||_(e,t),o?l(w,e,t,n,i):w(e,t,n,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function v(e){if(s=s||t(3),!(d.call(v,this)||this instanceof s))return new v(e);this._writableState=new b(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)),f.call(this)}function y(e,r,t,o,i,a,n){r.writelen=o,r.writecb=n,r.writing=!0,r.sync=!0,t?e._writev(i,r.onwrite):e._write(i,a,r.onwrite),r.sync=!1}function w(e,r,t,o){t||function(e,r){0===r.length&&r.needDrain&&(r.needDrain=!1,e.emit("drain"))}(e,r),r.pendingcb--,o(),k(e,r)}function _(e,r){r.bufferProcessing=!0;var t=r.bufferedRequest;if(e._writev&&t&&t.next){var o=r.bufferedRequestCount,i=new Array(o),a=r.corkedRequestsFree;a.entry=t;for(var s=0,l=!0;t;)i[s]=t,t.isBuf||(l=!1),t=t.next,s+=1;i.allBuffers=l,y(e,r,!0,r.length,i,"",a.finish),r.pendingcb++,r.lastBufferedRequest=null,a.next?(r.corkedRequestsFree=a.next,a.next=null):r.corkedRequestsFree=new n(r),r.bufferedRequestCount=0}else{for(;t;){var u=t.chunk,c=t.encoding,f=t.callback;if(y(e,r,!1,r.objectMode?1:u.length,u,c,f),t=t.next,r.bufferedRequestCount--,r.writing)break}null===t&&(r.lastBufferedRequest=null)}r.bufferedRequest=t,r.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function z(e,r){e._final(function(t){r.pendingcb--,t&&e.emit("error",t),r.prefinished=!0,e.emit("prefinish"),k(e,r)})}function k(e,r){var t=x(r);return t&&(!function(e,r){r.prefinished||r.finalCalled||("function"==typeof e._final?(r.pendingcb++,r.finalCalled=!0,a.nextTick(z,e,r)):(r.prefinished=!0,e.emit("prefinish")))}(e,r),0===r.pendingcb&&(r.finished=!0,e.emit("finish"))),t}u.inherits(v,f),b.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r},function(){try{Object.defineProperty(b.prototype,"buffer",{get:c.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]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===v&&(e&&e._writableState instanceof b)}})):d=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,r,t){var o,i=this._writableState,n=!1,s=!i.objectMode&&(o=e,h.isBuffer(o)||o instanceof p);return s&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof r&&(t=r,r=null),s?r="buffer":r||(r=i.defaultEncoding),"function"!=typeof t&&(t=g),i.ended?function(e,r){var t=new Error("write after end");e.emit("error",t),a.nextTick(r,t)}(this,t):(s||function(e,r,t,o){var i=!0,n=!1;return null===t?n=new TypeError("May not write null values to stream"):"string"==typeof t||void 0===t||r.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n&&(e.emit("error",n),a.nextTick(o,n),i=!1),i}(this,i,e,t))&&(i.pendingcb++,n=function(e,r,t,o,i,a){if(!t){var n=function(e,r,t){e.objectMode||!1===e.decodeStrings||"string"!=typeof r||(r=h.from(r,t));return r}(r,o,i);o!==n&&(t=!0,i="buffer",o=n)}var s=r.objectMode?1:o.length;r.length+=s;var l=r.length<r.highWaterMark;l||(r.needDrain=!0);if(r.writing||r.corked){var u=r.lastBufferedRequest;r.lastBufferedRequest={chunk:o,encoding:i,isBuf:t,callback:a,next:null},u?u.next=r.lastBufferedRequest:r.bufferedRequest=r.lastBufferedRequest,r.bufferedRequestCount+=1}else y(e,r,!1,s,o,i,a);return l}(this,i,s,e,r,t)),n},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},v.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},v.prototype._write=function(e,r,t){t(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,r,t){var o=this._writableState;"function"==typeof e?(t=e,e=null,r=null):"function"==typeof r&&(t=r,r=null),null!==e&&void 0!==e&&this.write(e,r),o.corked&&(o.corked=1,this.uncork()),o.ending||o.finished||function(e,r,t){r.ending=!0,k(e,r),t&&(r.finished?a.nextTick(t):e.once("finish",t));r.ended=!0,e.writable=!1}(this,o,t)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,r){this.end(),r(e)}}).call(this,t(4),t(55).setImmediate,t(2))},function(e,r,t){(r=e.exports=t(23)).Stream=r,r.Readable=r,r.Writable=t(10),r.Duplex=t(3),r.Transform=t(20),r.PassThrough=t(52)},function(e,r){function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function o(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var r,t,n,s,l,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((r=arguments[1])instanceof Error)throw r;var c=new Error('Uncaught, unspecified "error" event. ('+r+")");throw c.context=r,c}if(a(t=this._events[e]))return!1;if(o(t))switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),t.apply(this,s)}else if(i(t))for(s=Array.prototype.slice.call(arguments,1),n=(u=t.slice()).length,l=0;l<n;l++)u[l].apply(this,s);return!0},t.prototype.addListener=function(e,r){var n;if(!o(r))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,o(r.listener)?r.listener:r),this._events[e]?i(this._events[e])?this._events[e].push(r):this._events[e]=[this._events[e],r]:this._events[e]=r,i(this._events[e])&&!this._events[e].warned&&(n=a(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,r){if(!o(r))throw TypeError("listener must be a function");var t=!1;function i(){this.removeListener(e,i),t||(t=!0,r.apply(this,arguments))}return i.listener=r,this.on(e,i),this},t.prototype.removeListener=function(e,r){var t,a,n,s;if(!o(r))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(t=this._events[e]).length,a=-1,t===r||o(t.listener)&&t.listener===r)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,r);else if(i(t)){for(s=n;s-- >0;)if(t[s]===r||t[s].listener&&t[s].listener===r){a=s;break}if(a<0)return this;1===t.length?(t.length=0,delete this._events[e]):t.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,r)}return this},t.prototype.removeAllListeners=function(e){var r,t;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(r in this._events)"removeListener"!==r&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events={},this}if(o(t=this._events[e]))this.removeListener(e,t);else if(t)for(;t.length;)this.removeListener(e,t[t.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){return this._events&&this._events[e]?o(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.prototype.listenerCount=function(e){if(this._events){var r=this._events[e];if(o(r))return 1;if(r)return r.length}return 0},t.listenerCount=function(e,r){return e.listenerCount(r)}},function(e,r,t){const o=t(28),i=t(30),a=t(29),n=function(e,r){if(!o.validateMnemonic(e))throw new Error("The Mnemonic you provided is not valid!: "+e);const t=r?r.toString():void 0,n=o.mnemonicToSeedHex(e,t),s=new a(parseInt(n,16),10),l=i.fromValue(s);return i.trytes(l)};e.exports={toTrytes:n,toSeed:function(e,r){return n(e,r).slice(0,81)}}},function(e,r,t){var o=t(26),i=t(25),a=t(19),n=t(16),s=t(15),l=t(1).Buffer,u=l.alloc(128),c={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(e,r,t){var n=function(e){return"rmd160"===e||"ripemd160"===e?i:"md5"===e?o:function(r){return a(e).update(r).digest()}}(e),s="sha512"===e||"sha384"===e?128:64;r.length>s?r=n(r):r.length<s&&(r=l.concat([r,u],s));for(var f=l.allocUnsafe(s+c[e]),h=l.allocUnsafe(s+c[e]),p=0;p<s;p++)f[p]=54^r[p],h[p]=92^r[p];var d=l.allocUnsafe(s+t+4);f.copy(d,0,0,s),this.ipad1=d,this.ipad2=f,this.opad=h,this.alg=e,this.blocksize=s,this.hash=n,this.size=c[e]}f.prototype.run=function(e,r){return e.copy(r,this.blocksize),this.hash(r).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(e,r,t,o,i){l.isBuffer(e)||(e=l.from(e,s)),l.isBuffer(r)||(r=l.from(r,s)),n(t,o);var a=new f(i=i||"sha1",e,r.length),u=l.allocUnsafe(o),h=l.allocUnsafe(r.length+4);r.copy(h,0,0,r.length);for(var p=0,d=c[i],m=Math.ceil(o/d),g=1;g<=m;g++){h.writeUInt32BE(g,r.length);for(var b=a.run(h,a.ipad1),v=b,y=1;y<t;y++){v=a.run(v,a.ipad2);for(var w=0;w<d;w++)b[w]^=v[w]}b.copy(u,p),p+=d}return u}},function(e,r,t){(function(r){var t;r.browser?t="utf-8":t=parseInt(r.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=t}).call(this,t(4))},function(e,r){var t=Math.pow(2,30)-1;e.exports=function(e,r){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof r)throw new TypeError("Key length not a number");if(r<0||r>t||r!=r)throw new TypeError("Bad key length")}},function(e,r,t){var o=t(0),i=t(5),a=t(1).Buffer,n=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function l(){this.init(),this._w=s,i.call(this,128,112)}function u(e,r,t){return t^e&(r^t)}function c(e,r,t){return e&r|t&(e|r)}function f(e,r){return(e>>>28|r<<4)^(r>>>2|e<<30)^(r>>>7|e<<25)}function h(e,r){return(e>>>14|r<<18)^(e>>>18|r<<14)^(r>>>9|e<<23)}function p(e,r){return(e>>>1|r<<31)^(e>>>8|r<<24)^e>>>7}function d(e,r){return(e>>>1|r<<31)^(e>>>8|r<<24)^(e>>>7|r<<25)}function m(e,r){return(e>>>19|r<<13)^(r>>>29|e<<3)^e>>>6}function g(e,r){return(e>>>19|r<<13)^(r>>>29|e<<3)^(e>>>6|r<<26)}function b(e,r){return e>>>0<r>>>0?1:0}o(l,i),l.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},l.prototype._update=function(e){for(var r=this._w,t=0|this._ah,o=0|this._bh,i=0|this._ch,a=0|this._dh,s=0|this._eh,l=0|this._fh,v=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,x=0|this._cl,z=0|this._dl,k=0|this._el,E=0|this._fl,S=0|this._gl,j=0|this._hl,T=0;T<32;T+=2)r[T]=e.readInt32BE(4*T),r[T+1]=e.readInt32BE(4*T+4);for(;T<160;T+=2){var B=r[T-30],q=r[T-30+1],A=p(B,q),R=d(q,B),C=m(B=r[T-4],q=r[T-4+1]),I=g(q,B),M=r[T-14],L=r[T-14+1],N=r[T-32],O=r[T-32+1],U=R+L|0,P=A+M+b(U,R)|0;P=(P=P+C+b(U=U+I|0,I)|0)+N+b(U=U+O|0,O)|0,r[T]=P,r[T+1]=U}for(var D=0;D<160;D+=2){P=r[D],U=r[D+1];var F=c(t,o,i),Y=c(w,_,x),W=f(t,w),H=f(w,t),V=h(s,k),K=h(k,s),$=n[D],G=n[D+1],J=u(s,l,v),X=u(k,E,S),Z=j+K|0,Q=y+V+b(Z,j)|0;Q=(Q=(Q=Q+J+b(Z=Z+X|0,X)|0)+$+b(Z=Z+G|0,G)|0)+P+b(Z=Z+U|0,U)|0;var ee=H+Y|0,re=W+F+b(ee,H)|0;y=v,j=S,v=l,S=E,l=s,E=k,s=a+Q+b(k=z+Z|0,z)|0,a=i,z=x,i=o,x=_,o=t,_=w,t=Q+re+b(w=Z+ee|0,Z)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+x|0,this._dl=this._dl+z|0,this._el=this._el+k|0,this._fl=this._fl+E|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+t+b(this._al,w)|0,this._bh=this._bh+o+b(this._bl,_)|0,this._ch=this._ch+i+b(this._cl,x)|0,this._dh=this._dh+a+b(this._dl,z)|0,this._eh=this._eh+s+b(this._el,k)|0,this._fh=this._fh+l+b(this._fl,E)|0,this._gh=this._gh+v+b(this._gl,S)|0,this._hh=this._hh+y+b(this._hl,j)|0},l.prototype._hash=function(){var e=a.allocUnsafe(64);function r(r,t,o){e.writeInt32BE(r,o),e.writeInt32BE(t,o+4)}return r(this._ah,this._al,0),r(this._bh,this._bl,8),r(this._ch,this._cl,16),r(this._dh,this._dl,24),r(this._eh,this._el,32),r(this._fh,this._fl,40),r(this._gh,this._gl,48),r(this._hh,this._hl,56),e},e.exports=l},function(e,r,t){var o=t(0),i=t(5),a=t(1).Buffer,n=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function l(){this.init(),this._w=s,i.call(this,64,56)}function u(e,r,t){return t^e&(r^t)}function c(e,r,t){return e&r|t&(e|r)}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function h(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function p(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}o(l,i),l.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},l.prototype._update=function(e){for(var r,t=this._w,o=0|this._a,i=0|this._b,a=0|this._c,s=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,b=0;b<16;++b)t[b]=e.readInt32BE(4*b);for(;b<64;++b)t[b]=0|(((r=t[b-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+t[b-7]+p(t[b-15])+t[b-16];for(var v=0;v<64;++v){var y=g+h(l)+u(l,d,m)+n[v]+t[v]|0,w=f(o)+c(o,i,a)|0;g=m,m=d,d=l,l=s+y|0,s=a,a=i,i=o,o=y+w|0}this._a=o+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},l.prototype._hash=function(){var e=a.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=l},function(e,r,t){(r=e.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=t(47),r.sha1=t(46),r.sha224=t(45),r.sha256=t(18),r.sha384=t(44),r.sha512=t(17)},function(e,r,t){"use strict";e.exports=a;var o=t(3),i=t(7);function a(e){if(!(this instanceof a))return new a(e);o.call(this,e),this._transformState={afterTransform:function(e,r){var t=this._transformState;t.tran