!function(a){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=a();elseif("function"==typeofdefine&&define.amd)define([],a);else{varb;b="undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:this,b.Wallet=a()}}(function(){vara;returnfunctionb(a,c,d){functione(g,h){if(!c[g]){if(!a[g]){vari="function"==typeofrequire&&require;if(!h&&i)returni(g,!0);if(f)returnf(g,!0);varj=newError("Cannot find module '"+g+"'");throwj.code="MODULE_NOT_FOUND",j}vark=c[g]={exports:{}};a[g][0].call(k.exports,function(b){varc=a[g][1][b];returne(c?c:b)},k,k.exports,b,a,c,d)}returnc[g].exports}for(varf="function"==typeofrequire&&require,g=0;g<d.length;g++)e(d[g]);returne}({1:[function(a,b,c){(function(c){"use strict";vard=a("scrypt-js"),e=a("./lib/contract.js"),f=a("./lib/providers.js"),g=a("./lib/secret-storage.js"),h=a("./lib/randomish.js"),i=(a("./lib/signing-key.js"),a("./lib/wallet.js")),j=a("./lib/units.js"),k=a("./lib/utils.js"),l=k.BN,m={};k.defineProperty(i,"utils",m),k.defineProperty(m,"BN",l),k.defineProperty(m,"Buffer",c),k.defineProperty(m,"sha3",k.sha3),k.defineProperty(m,"sha256",k.sha256),k.defineProperty(m,"getContractAddress",k.getContractAddress),b.exports=i,k.defineProperty(i,"etherSymbol","𝝣"),k.defineProperty(i,"formatEther",j.formatEther),k.defineProperty(i,"parseEther",j.parseEther),k.defineProperty(i,"getAddress",k.getAddress),k.defineProperty(i,"getIcapAddress",k.getIcapAddress),k.defineProperty(i,"isCrowdsaleWallet",g.isCrowdsaleWallet),k.defineProperty(i,"isValidWallet",g.isValidWallet),k.defineProperty(i,"decryptCrowdsale",function(a,b){returnnewi(g.decryptCrowdsale(a,b))}),k.defineProperty(i,"decrypt",function(a,b,c){if(c&&"function"!=typeofc)thrownewError("invalid callback");returnnewPromise(function(d,e){g.decrypt(a,b,c).then(function(a){d(newi(a))},function(a){e(a)})})}),k.defineProperty(i.prototype,"encrypt",function(a,b,c){if("function"!=typeofb||c||(c=b,b={}),c&&"function"!=typeofc)thrownewError("invalid callback");returng.encrypt(this.privateKey,a,b,c)}),k.defineProperty(i,"summonBrainWallet",function(a,b,e){if(e&&"function"!=typeofe)thrownewError("invalid callback");returnnewPromise(function(f,g){d(b,a,1<<18,8,1,32,function(a,b,d){a?g(a):d?f(newi(newc(d))):e&&e(b)})})}),k.defineProperty(i,"providers",f),k.defineProperty(i,"Contract",e),k.defineProperty(i,"Interface",e.Interface),k.defineProperty(i,"randomish",newh),b.exports=i}).call(this,a("buffer").Buffer)},{"./lib/contract.js":4,"./lib/providers.js":5,"./lib/randomish.js":6,"./lib/secret-storage.js":7,"./lib/signing-key.js":8,"./lib/units.js":9,"./lib/utils.js":10,"./lib/wallet.js":11,buffer:34,"scrypt-js":85}],2:[function(a,b,c){(function(c,d){"use strict";functione(a){if(a<=0||a>1024||parseInt(a)!=a)thrownewError("invalid length");varb=newd(a);returng.getRandomValues(b),b}varf=a("./utils.js"),g=c.crypto||c.msCrypto;g&&g.getRandomValues?console.log("Found strong random number source"):(console.log("WARNING: Missing strong random number source; using weak randomBytes"),g={getRandomValues:function(a){for(varb=0;b<buffer.length;b++)buffer[b]=parseInt(256*Math.random());returnbuffer},_weakCrypto:!0}),g._weakCrypto===!0&&f.defineProperty(e,"_weakCrypto",!0),b.exports=e}).call(this,"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},a("buffer").Buffer)},{"./utils.js":10,buffer:34}],3:[function(a,b,c){"use strict";try{b.exports.XMLHttpRequest=XMLHttpRequest}catch(d){console.log("Warning: XMLHttpRequest is not defined"),b.exports.XMLHttpRequest=null}},{}],4:[function(a,b,c){(function(c){"use strict";functiond(a,b,c){vard=JSON.stringify(c);Object.defineProperty(a,b,{enumerable:!0,get:function(){returnJSON.parse(d)}})}functione(a,b,c){if(!Array.isArray(a))thrownewError("invalid params");for(vard=[],e=0;e<a.length;e++){varf=a[e][b];if(c&&!f)f="";elseif("string"!=typeoff)thrownewError("invalid abi");d.push(f)}returnd}functionf(a){if(!a.eq){if("number"!=typeofa)thrownewError("invalidnu
if(!(thisinstanceofC))throwError("AES must be instanitated with `new`");this.key=h(a),this._prepare()};C.prototype._prepare=function(){vara=m[this.key.length];if(null==a)thrownewError("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(varb=0;b<=a;b++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(varc,d=4*(a+1),e=this.key.length/4,g=f(this.key),b=0;b<e;b++)c=b>>2,this._Ke[c][b%4]=g[b],this._Kd[a-c][b%4]=g[b];for(varh,i=0,j=e;j<d;){if(h=g[e-1],g[0]^=o[h>>16&255]<<24^o[h>>8&255]<<16^o[255&h]<<8^o[h>>24&255]^n[i]<<24,i+=1,8!=e)for(varb=1;b<e;b++)g[b]^=g[b-1];else{for(varb=1;b<e/2;b++)g[b]^=g[b-1];h=g[e/2-1],g[e/2]^=o[255&h]^o[h>>8&255]<<8^o[h>>16&255]<<16^o[h>>24&255]<<24;for(varb=e/2+1;b<e;b++)g[b]^=g[b-1]}for(vark,l,b=0;b<e&&j<d;)k=j>>2,l=j%4,this._Ke[k][l]=g[b],this._Kd[a-k][l]=g[b++],j++}for(vark=1;k<a;k++)for(varl=0;l<4;l++)h=this._Kd[k][l],this._Kd[k][l]=y[h>>24&255]^z[h>>16&255]^A[h>>8&255]^B[255&h]},C.prototype.encrypt=function(a){if(16!=a.length)thrownewError("invalid plaintext size (must be 16 bytes)");for(varb=this._Ke.length-1,c=[0,0,0,0],d=f(a),e=0;e<4;e++)d[e]^=this._Ke[0][e];for(varg=1;g<b;g++){for(vare=0;e<4;e++)c[e]=q[d[e]>>24&255]^r[d[(e+1)%4]>>16&255]^s[d[(e+2)%4]>>8&255]^t[255&d[(e+3)%4]]^this._Ke[g][e];d=c.slice(0)}for(vari,j=h(16),e=0;e<4;e++)i=this._Ke[b][e],j[4*e]=255&(o[d[e]>>24&255]^i>>24),j[4*e+1]=255&(o[d[(e+1)%4]>>16&255]^i>>16),j[4*e+2]=255&(o[d[(e+2)%4]>>8&255]^i>>8),j[4*e+3]=255&(o[255&d[(e+3)%4]]^i);returnj},C.prototype.decrypt=function(a){if(16!=a.length)thrownewError("invalid ciphertext size (must be 16 bytes)");for(varb=this._Kd.length-1,c=[0,0,0,0],d=f(a),e=0;e<4;e++)d[e]^=this._Kd[0][e];for(varg=1;g<b;g++){for(vare=0;e<4;e++)c[e]=u[d[e]>>24&255]^v[d[(e+3)%4]>>16&255]^w[d[(e+2)%4]>>8&255]^x[255&d[(e+1)%4]]^this._Kd[g][e];d=c.slice(0)}for(vari,j=h(16),e=0;e<4;e++)i=this._Kd[b][e],j[4*e]=255&(p[d[e]>>24&255]^i>>24),j[4*e+1]=255&(p[d[(e+3)%4]>>16&255]^i>>16),j[4*e+2]=255&(p[d[(e+2)%4]>>8&255]^i>>8),j[4*e+3]=255&(p[255&d[(e+1)%4]]^i);returnj};varD=function(a){if(!(thisinstanceofD))throwError("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=newC(a)};D.prototype.encrypt=function(a){returnthis._aes.encrypt(a)},D.prototype.decrypt=function(a,b){returnthis._aes.decrypt(a)};varE=function(a,b){if(!(thisinstanceofE))throwError("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",b){if(16!=b.length)thrownewError("invalid initialation vector size (must be 16 bytes)")}elseb=h([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);this._lastCipherblock=h(b),this._aes=newC(a)};E.prototype.encrypt=function(a){if(16!=a.length)thrownewError("invalid plaintext size (must be 16 bytes)");for(varb=h(a),c=0;c<16;c++)b[c]^=this._lastCipherblock[c];returnthis._lastCipherblock=this._aes.encrypt(b),this._lastCipherblock},E.prototype.decrypt=function(a){if(16!=a.length)thrownewError("invalid ciphertext size (must be 16 bytes)");for(varb=this._aes.decrypt(a),c=0;c<16;c++)b[c]^=this._lastCipherblock[c];returni(a,this._lastCipherblock),b};varF=function(a,b,c){if(!(thisinstanceofF))throwError("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",b){if(16!=b.length)thrownewError("invalid initialation vector size (must be 16 size)")}elseb=h([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);c||(c=1),this.segmentSize=c,this._shiftRegister=h(b),this._aes=newC(a)};F.prototype.encrypt=function(a){if(a.length%this.segmentSize!=0)thrownewError("invalid plaintext size (must be segmentSize bytes)");for(varb,c=h(a),d=0;d<c.length;d+=this.segmentSize){b=this._aes.encrypt(this._shiftRegister);for(vare=0;e<this.segmentSize;e++)c[d+e]^=b[e];i(this._shiftRegister,this._shiftRegister,0,this.segmentSize),i(c,this._shiftRegister,16-this.segmentSize,d,d+this.segmentSize)}returnc},F.prototype.decrypt=function(a){if(a.length%this.segmentSize!=0)thrownewError("invalid ciphertext size (must be segmentSize bytes)");for(varb,c=h(a),d=0;d<c.le
this.transform(j,f,k,l,d,e);for(varn=0;n<d;n++){varo=h[n]*k[n]-i[n]*l[n];i[n]=h[n]*l[n]+i[n]*k[n],h[n]=o}returnthis.conjugate(h,i,d),this.transform(h,i,m,f,d,e),this.conjugate(m,f,d),this.normalize13b(m,d),c.negative=a.negative^b.negative,c.length=a.length+b.length,c.strip()},f.prototype.mul=function(a){varb=newf(null);returnb.words=newArray(this.length+a.length),this.mulTo(a,b)},f.prototype.mulf=function(a){varb=newf(null);returnb.words=newArray(this.length+a.length),l(this,a,b)},f.prototype.imul=function(a){returnthis.clone().mulTo(a,this)},f.prototype.imuln=function(a){d("number"==typeofa),d(a<67108864);for(varb=0,c=0;c<this.length;c++){vare=(0|this.words[c])*a,f=(67108863&e)+(67108863&b);b>>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){returnthis.clone().imuln(a)},f.prototype.sqr=function(){returnthis.mul(this)},f.prototype.isqr=function(){returnthis.imul(this.clone())},f.prototype.pow=function(a){varb=i(a);if(0===b.length)returnnewf(1);for(varc=this,d=0;d<b.length&&0===b[d];d++,c=c.sqr());if(++d<b.length)for(vare=c.sqr();d<b.length;d++,e=e.sqr())0!==b[d]&&(c=c.mul(e));returnc},f.prototype.iushln=function(a){d("number"==typeofa&&a>=0);varb,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){varg=0;for(b=0;b<this.length;b++){varh=this.words[b]&f,i=(0|this.words[b])-h<<c;this.words[b]=i|g,g=h>>>26-c}g&&(this.words[b]=g,this.length++)}if(0!==e){for(b=this.length-1;b>=0;b--)this.words[b+e]=this.words[b];for(b=0;b<e;b++)this.words[b]=0;this.length+=e}returnthis.strip()},f.prototype.ishln=function(a){returnd(0===this.negative),this.iushln(a)},f.prototype.iushrn=function(a,b,c){d("number"==typeofa&&a>=0);vare;e=b?(b-b%26)/26:0;varf=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<<f,i=c;if(e-=g,e=Math.max(0,e),i){for(varj=0;j<g;j++)i.words[j]=this.words[j];i.length=g}if(0===g);elseif(this.length>g)for(this.length-=g,j=0;j<this.length;j++)this.words[j]=this.words[j+g];elsethis.words[0]=0,this.length=1;vark=0;for(j=this.length-1;j>=0&&(0!==k||j>=e);j--){varl=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}returni&&0!==k&&(i.words[i.length++]=k),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(a,b,c){returnd(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){returnthis.clone().ishln(a)},f.prototype.ushln=function(a){returnthis.clone().iushln(a)},f.prototype.shrn=function(a){returnthis.clone().ishrn(a)},f.prototype.ushrn=function(a){returnthis.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeofa&&a>=0);varb=a%26,c=(a-b)/26,e=1<<b;if(this.length<=c)return!1;varf=this.words[c];return!!(f&e)},f.prototype.imaskn=function(a){d("number"==typeofa&&a>=0);varb=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)returnthis;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){vare=67108863^67108863>>>b<<b;this.words[this.length-1]&=e}returnthis.strip()},f.prototype.maskn=function(a){returnthis.clone().imaskn(a)},f.prototype.iaddn=function(a){returnd("number"==typeofa),d(a<67108864),a<0?this.isubn(-a):0!==this.negative?1===this.length&&(0|this.words[0])<a?(this.words[0]=a-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},f.prototype._iaddn=function(a){this.words[0]+=a;for(varb=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;returnthis.length=Math.max(this.length,b+1),this},f.prototype.isubn=function(a){if(d("number"==typeofa),d(a<67108864),a<0)returnthis.iaddn(-a);if(0!==this.negative)returnthis.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;elsefor(varb=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;returnthis.strip()},f.prototype.addn=function(a){returnthis.clone().iaddn(a)},f.prototype.subn
e=c;continue}c=(e-55296<<10|c-56320)+65536}elsee&&(b-=3)>-1&&f.push(239,191,189);if(e=null,c<128){if((b-=1)<0)break;f.push(c)}elseif(c<2048){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}elseif(c<65536){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))thrownewError("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}returnf}functionT(a){for(varb=[],c=0;c<a.length;++c)b.push(255&a.charCodeAt(c));returnb}functionU(a,b){for(varc,d,e,f=[],g=0;g<a.length&&!((b-=2)<0);++g)c=a.charCodeAt(g),d=c>>8,e=c%256,f.push(e),f.push(d);returnf}functionV(a){returnY.toByteArray(P(a))}functionW(a,b,c,d){for(vare=0;e<d&&!(e+c>=b.length||e>=a.length);++e)b[e+c]=a[e];returne}functionX(a){returna!==a}varY=a("base64-js"),Z=a("ieee754"),$=a("isarray");c.Buffer=g,c.SlowBuffer=q,c.INSPECT_MAX_BYTES=50,g.TYPED_ARRAY_SUPPORT=void0!==b.TYPED_ARRAY_SUPPORT?b.TYPED_ARRAY_SUPPORT:d(),c.kMaxLength=e(),g.poolSize=8192,g._augment=function(a){returna.__proto__=g.prototype,a},g.from=function(a,b,c){returnh(null,a,b,c)},g.TYPED_ARRAY_SUPPORT&&(g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array,"undefined"!=typeofSymbol&&Symbol.species&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0})),g.alloc=function(a,b,c){returnj(null,a,b,c)},g.allocUnsafe=function(a){returnk(null,a)},g.allocUnsafeSlow=function(a){returnk(null,a)},g.isBuffer=function(a){return!(null==a||!a._isBuffer)},g.compare=function(a,b){if(!g.isBuffer(a)||!g.isBuffer(b))thrownewTypeError("Arguments must be Buffers");if(a===b)return0;for(varc=a.length,d=b.length,e=0,f=Math.min(c,d);e<f;++e)if(a[e]!==b[e]){c=a[e],d=b[e];break}returnc<d?-1:d<c?1:0},g.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},g.concat=function(a,b){if(!$(a))thrownewTypeError('"list" argument must be an Array of Buffers');if(0===a.length)returng.alloc(0);varc;if(void0===b)for(b=0,c=0;c<a.length;++c)b+=a[c].length;vard=g.allocUnsafe(b),e=0;for(c=0;c<a.length;++c){varf=a[c];if(!g.isBuffer(f))thrownewTypeError('"list" argument must be an Array of Buffers');f.copy(d,e),e+=f.length}returnd},g.byteLength=r,g.prototype._isBuffer=!0,g.prototype.swap16=function(){vara=this.length;if(a%2!==0)thrownewRangeError("Buffer size must be a multiple of 16-bits");for(varb=0;b<a;b+=2)t(this,b,b+1);returnthis},g.prototype.swap32=function(){vara=this.length;if(a%4!==0)thrownewRangeError("Buffer size must be a multiple of 32-bits");for(varb=0;b<a;b+=4)t(this,b,b+3),t(this,b+1,b+2);returnthis},g.prototype.toString=function(){vara=0|this.length;return0===a?"":0===arguments.length?C(this,0,a):s.apply(this,arguments)},g.prototype.equals=function(a){if(!g.isBuffer(a))thrownewTypeError("Argument must be a Buffer");returnthis===a||0===g.compare(this,a)},g.prototype.inspect=function(){vara="",b=c.INSPECT_MAX_BYTES;returnthis.length>0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),"<Buffer "+a+">"},g.prototype.compare=function(a,b,c,d,e){if(!g.isBuffer(a))thrownewTypeError("Argument must be a Buffer");if(void0===b&&(b=0),void0===c&&(c=a?a.length:0),void0===d&&(d=0),void0===e&&(e=this.length),b<0||c>a.length||d<0||e>this.length)thrownewRangeError("out of range index");if(d>=e&&b>=c)return0;if(d>=e)return-1;if(b>=c)return1;if(b>>>=0,c>>>=0,d>>>=0,e>>>=0,this===a)return0;for(varf=e-d,h=c-b,i=Math.min(f,h),j=this.slice(d,e),k=a.slice(b,c),l=0;l<i;++l)if(j[l]!==k[l]){f=j[l],h=k[l];break}returnf<h?-1:h<f?1:0},g.prototype.indexOf=function(a,b,c){if("string"==typeofb?(c=b,b=0):b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b>>=0,0===this.length)return-1;if(b>=this.length)return-1;if(b<0&&(b=Math.max(this.length+b,0)),"string"==typeofa&&(a=g.from(a,c)),g.isBuffer(a))return0===a.length?-1:u(this,a,b,c);if("number"==typeofa)returng.TYPED_ARRAY_SUPPORT&&"function"===Ui
vard=this._transformState;if(d.writecb=c,d.writechunk=a,d.writeencoding=b,!d.transforming){vare=this._readableState;(d.needTransform||e.needReadable||e.length<e.highWaterMark)&&this._read(e.highWaterMark)}},f.prototype._read=function(a){varb=this._transformState;null!==b.writechunk&&b.writecb&&!b.transforming?(b.transforming=!0,this._transform(b.writechunk,b.writeencoding,b.afterTransform)):b.needTransform=!0}},{"./_stream_duplex":43,"core-util-is":49,inherits:39}],47:[function(a,b,c){(function(c){"use strict";functiond(){}functione(a,b,c){this.chunk=a,this.encoding=b,this.callback=c,this.next=null}functionf(b,c){E=E||a("./_stream_duplex"),b=b||{},this.objectMode=!!b.objectMode,cinstanceofE&&(this.objectMode=this.objectMode||!!b.writableObjectMode);vard=b.highWaterMark,e=this.objectMode?16:16384;this.highWaterMark=d||0===d?d:e,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;varf=b.decodeStrings===!1;this.decodeStrings=!f,this.defaultEncoding=b.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(a){o(c,a)},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=neww(this)}functiong(b){returnE=E||a("./_stream_duplex"),thisinstanceofg||thisinstanceofE?(this._writableState=newf(b,this),this.writable=!0,b&&("function"==typeofb.write&&(this._write=b.write),"function"==typeofb.writev&&(this._writev=b.writev)),voidA.call(this)):newg(b)}functionh(a,b){varc=newError("write after end");a.emit("error",c),x(b,c)}functioni(a,b,c,d){vare=!0,f=!1;returnnull===c?f=newTypeError("May not write null values to stream"):C.isBuffer(c)||"string"==typeofc||void0===c||b.objectMode||(f=newTypeError("Invalid non-string/buffer chunk")),f&&(a.emit("error",f),x(d,f),e=!1),e}functionj(a,b,c){returna.objectMode||a.decodeStrings===!1||"string"!=typeofb||(b=D.from(b,c)),b}functionk(a,b,c,d,f){c=j(b,c,d),C.isBuffer(c)&&(d="buffer");varg=b.objectMode?1:c.length;b.length+=g;varh=b.length<b.highWaterMark;if(h||(b.needDrain=!0),b.writing||b.corked){vari=b.lastBufferedRequest;b.lastBufferedRequest=newe(c,d,f),i?i.next=b.lastBufferedRequest:b.bufferedRequest=b.lastBufferedRequest,b.bufferedRequestCount+=1}elsel(a,b,!1,g,c,d,f);returnh}functionl(a,b,c,d,e,f,g){b.writelen=d,b.writecb=g,b.writing=!0,b.sync=!0,c?a._writev(e,b.onwrite):a._write(e,f,b.onwrite),b.sync=!1}functionm(a,b,c,d,e){--b.pendingcb,c?x(e,d):e(d),a._writableState.errorEmitted=!0,a.emit("error",d)}functionn(a){a.writing=!1,a.writecb=null,a.length-=a.writelen,a.writelen=0}functiono(a,b){varc=a._writableState,d=c.sync,e=c.writecb;if(n(c),b)m(a,c,d,b,e);else{varf=s(c);f||c.corked||c.bufferProcessing||!c.bufferedRequest||r(a,c),d?y(p,a,c,f,e):p(a,c,f,e)}}functionp(a,b,c,d){c||q(a,b),b.pendingcb--,d(),u(a,b)}functionq(a,b){0===b.length&&b.needDrain&&(b.needDrain=!1,a.emit("drain"))}functionr(a,b){b.bufferProcessing=!0;varc=b.bufferedRequest;if(a._writev&&c&&c.next){vard=b.bufferedRequestCount,e=newArray(d),f=b.corkedRequestsFree;f.entry=c;for(varg=0;c;)e[g]=c,c=c.next,g+=1;l(a,b,!0,b.length,e,"",f.finish),b.pendingcb++,b.lastBufferedRequest=null,f.next?(b.corkedRequestsFree=f.next,f.next=null):b.corkedRequestsFree=neww(b)}else{for(;c;){varh=c.chunk,i=c.encoding,j=c.callback,k=b.objectMode?1:h.length;if(l(a,b,!1,k,h,i,j),c=c.next,b.writing)break}null===c&&(b.lastBufferedRequest=null)}b.bufferedRequestCount=0,b.bufferedRequest=c,b.bufferProcessing=!1}functions(a){returna.ending&&0===a.length&&null===a.bufferedRequest&&!a.finished&&!a.writing}functiont(a,b){b.prefinished||(b.prefinished=!0,a.emit("prefinish"))}functionu(a,b){varc=s(b);returnc&&(0===b.pendingcb?(t(a,b),b.finished=!0,a.emit("finish")):t(a,b)),c}functionv(a,b,c){b.ending=!0,u(a,b),c&&(b.finished?x(c):a.once("finish",c)),b.ended=!0,a.writable=!1}functionw(a){varb=this;this.next=null,this.entry=null,this.fi
for(f=0;f<a.length;f++)h[f]^=a[f];for(f=0;f<b.length;f++)h[64+f]=b[f];for(f=g-4;f<g;f++)h[f]=0;for(f=0;f<64;f++)i[f]=92;for(f=0;f<a.length;f++)i[f]^=a[f];for(;c>=32;)d(),j=j.concat(e(i.concat(e(h)))),c-=32;returnc>0&&(d(),j=j.concat(e(i.concat(e(h))).slice(0,c))),j}functiong(a,b,c,d,e){varf;for(k(a,16*(2*c-1),e,0,16),f=0;f<2*c;f++)j(a,16*f,e,16),i(e,d),k(e,0,a,b+16*f,16);for(f=0;f<c;f++)k(a,b+2*f*16,a,16*f,16);for(f=0;f<c;f++)k(a,b+16*(2*f+1),a,16*(f+c),16)}functionh(a,b){returna<<b|a>>>32-b}functioni(a,b){k(a,0,b,0,16);for(varc=8;c>0;c-=2)b[4]^=h(b[0]+b[12],7),b[8]^=h(b[4]+b[0],9),b[12]^=h(b[8]+b[4],13),b[0]^=h(b[12]+b[8],18),b[9]^=h(b[5]+b[1],7),b[13]^=h(b[9]+b[5],9),b[1]^=h(b[13]+b[9],13),b[5]^=h(b[1]+b[13],18),b[14]^=h(b[10]+b[6],7),b[2]^=h(b[14]+b[10],9),b[6]^=h(b[2]+b[14],13),b[10]^=h(b[6]+b[2],18),b[3]^=h(b[15]+b[11],7),b[7]^=h(b[3]+b[15],9),b[11]^=h(b[7]+b[3],13),b[15]^=h(b[11]+b[7],18),b[1]^=h(b[0]+b[3],7),b[2]^=h(b[1]+b[0],9),b[3]^=h(b[2]+b[1],13),b[0]^=h(b[3]+b[2],18),b[6]^=h(b[5]+b[4],7),b[7]^=h(b[6]+b[5],9),b[4]^=h(b[7]+b[6],13),b[5]^=h(b[4]+b[7],18),b[11]^=h(b[10]+b[9],7),b[8]^=h(b[11]+b[10],9),b[9]^=h(b[8]+b[11],13),b[10]^=h(b[9]+b[8],18),b[12]^=h(b[15]+b[14],7),b[13]^=h(b[12]+b[15],9),b[14]^=h(b[13]+b[12],13),b[15]^=h(b[14]+b[13],18);for(c=0;c<16;++c)a[c]+=b[c]}functionj(a,b,c,d){for(vare=0;e<d;e++)c[e]^=a[b+e]}functionk(a,b,c,d,e){for(;e--;)c[d++]=a[b++]}functionl(a){if(!a||"number"!=typeofa.length)return!1;for(varb=0;b<a.length;b++){if("number"!=typeofa[b])return!1;varc=parseInt(a[b]);if(c!=a[b]||c<0||c>=256)return!1}return!0}functionm(a,b){varc=parseInt(a);if(a!=c)thrownewError("invalid "+b);returnc}functionn(a,b,c,d,e,h,i){if(!i)thrownewError("missing callback");if(c=m(c,"N"),d=m(d,"r"),e=m(e,"p"),h=m(h,"dkLen"),0===c||0!==(c&c-1))thrownewError("N must be power of 2");if(c>o/128/d)thrownewError("N too large");if(d>o/128/e)thrownewError("r too large");if(!l(a))thrownewError("password must be an array or buffer");if(!l(b))thrownewError("salt must be an array or buffer");for(varn=f(a,b,128*e*d),p=newUint32Array(32*e*d),q=0;q<p.length;q++){varr=4*q;p[q]=(255&n[r+3])<<24|(255&n[r+2])<<16|(255&n[r+1])<<8|(255&n[r+0])<<0}vars,t,u=newUint32Array(64*d),v=newUint32Array(32*d*c),w=32*d,x=newUint32Array(16),y=newUint32Array(16),z=e*c*2,A=0,B=null,C=!1,D=0,E=0,F=parseInt(1e3/d),G="undefined"!=typeofsetImmediate?setImmediate:setTimeout,H=function(){if(C)returni(newError("cancelled"),A/z);switch(D){case0:t=32*E*d,k(p,t,u,0,w),D=1,s=0;case1:varb=c-s;b>F&&(b=F);for(varl=0;l<b;l++)k(u,0,v,(s+l)*w,w),g(u,w,d,x,y);s+=b,A+=b;varm=parseInt(1e3*A/z);if(m!==B){if(C=i(null,A/z))break;B=m}if(s<c)break;s=0,D=2;case2:varb=c-s;b>F&&(b=F);for(varl=0;l<b;l++){varo=16*(2*d-1),q=u[o]&c-1;j(v,q*w,u,w),g(u,w,d,x,y)}s+=b,A+=b;varm=parseInt(1e3*A/z);if(m!==B){if(C=i(null,A/z))break;B=m}if(s<c)break;if(k(u,0,p,t,w),E++,E<e){D=0;break}n=[];for(varl=0;l<p.length;l++)n.push(p[l]>>0&255),n.push(p[l]>>8&255),n.push(p[l]>>16&255),n.push(p[l]>>24&255);varr=f(a,n,h);returni(null,1,r)}G(H)};H()}varo=2147483647;"undefined"!=typeofd?c.exports=n:"function"==typeofa&&a.amd?a(n):b&&(b.scrypt&&(b._scrypt=b.scrypt),b.scrypt=n)}(this)},{}],86:[function(a,b,c){(function(a,b){!function(b,c){"use strict";functiond(a){returnp[o]=e.apply(c,a),o++}functione(a){varb=[].slice.call(arguments,1);returnfunction(){"function"==typeofa?a.apply(c,b):newFunction(""+a)()}}functionf(a){if(q)setTimeout(e(f,a),0);else{varb=p[a];if(b){q=!0;try{b()}finally{g(a),q=!1}}}}functiong(a){deletep[a]}functionh(){n=function(){varb=d(arguments);returna.nextTick(e(f,b)),b}}functioni(){if(b.postMessage&&!b.importScripts){vara=!0,c=b.onmessage;returnb.onmessage=function(){a=!1},b.postMessage("","*"),b.onmessage=c,a}}functionj(){vara="setImmediate$"+Math.random()+"$",c=function(c){c.source===b&&"string"==typeofc.data&&0===c.data.indexOf(a)&&f(+c.data.slice(a.length))};b.addEventListener?b.addEventListener("message",c,!1):b.attachEvent("onmessage",c),n=function(){varc=d(arguments);returnb.postMessage(a+c,"*"),