diff --git a/dist/ethers-providers.js b/dist/ethers-providers.js index 2ad4a9a33..c80450b4e 100644 --- a/dist/ethers-providers.js +++ b/dist/ethers-providers.js @@ -4231,7 +4231,7 @@ utils.defineProperty(EtherscanProvider.prototype, 'getHistory', function(address module.exports = EtherscanProvider;; -},{"../utils/convert.js":18,"../utils/properties.js":23,"./provider.js":13}],8:[function(require,module,exports){ +},{"../utils/convert.js":19,"../utils/properties.js":24,"./provider.js":13}],8:[function(require,module,exports){ 'use strict'; var inherits = require('inherits'); @@ -4295,7 +4295,7 @@ utils.defineProperty(FallbackProvider.prototype, 'perform', function(method, par module.exports = FallbackProvider; -},{"../utils/properties.js":23,"./provider.js":13,"inherits":3}],9:[function(require,module,exports){ +},{"../utils/properties.js":24,"./provider.js":13,"inherits":3}],9:[function(require,module,exports){ 'use strict'; var Provider = require('./provider'); @@ -4337,7 +4337,7 @@ if (IpcProvider) { module.exports = exports; -},{"./etherscan-provider":7,"./fallback-provider":8,"./infura-provider":10,"./ipc-provider":19,"./json-rpc-provider":11,"./provider":13,"./web3-provider":14}],10:[function(require,module,exports){ +},{"./etherscan-provider":7,"./fallback-provider":8,"./infura-provider":10,"./ipc-provider":20,"./json-rpc-provider":11,"./provider":13,"./web3-provider":14}],10:[function(require,module,exports){ 'use strict'; var Provider = require('./provider'); @@ -4399,7 +4399,7 @@ utils.defineProperty(InfuraProvider.prototype, 'listAccounts', function() { module.exports = InfuraProvider; -},{"../utils/errors":20,"../utils/properties":23,"./json-rpc-provider":11,"./provider":13}],11:[function(require,module,exports){ +},{"../utils/errors":21,"../utils/properties":24,"./json-rpc-provider":11,"./provider":13}],11:[function(require,module,exports){ 'use strict'; // See: https://github.com/ethereum/wiki/wiki/JSON-RPC @@ -4561,7 +4561,7 @@ function JsonRpcProvider(url, network) { network = Provider.getNetwork(url); url = null; } catch (error) { } - } else { + } else if (url && url.url == null) { network = url; url = null; } @@ -4699,7 +4699,7 @@ utils.defineProperty(JsonRpcProvider, '_hexlifyTransaction', function(transactio module.exports = JsonRpcProvider; -},{"../utils/address":15,"../utils/convert":18,"../utils/errors":20,"../utils/properties":23,"../utils/utf8":26,"./provider.js":13}],12:[function(require,module,exports){ +},{"../utils/address":15,"../utils/convert":19,"../utils/errors":21,"../utils/properties":24,"../utils/utf8":27,"./provider.js":13}],12:[function(require,module,exports){ module.exports={ "unspecified": { "chainId": 0, @@ -4760,6 +4760,7 @@ var networks = require('./networks.json'); var utils = (function() { var convert = require('../utils/convert'); + var utf8 = require('../utils/utf8'); return { defineProperty: require('../utils/properties').defineProperty, @@ -4776,14 +4777,19 @@ var utils = (function() { hexStripZeros: convert.hexStripZeros, stripZeros: convert.stripZeros, + base64: require('../utils/base64'), + namehash: require('../utils/namehash'), - toUtf8String: require('../utils/utf8').toUtf8String, + toUtf8String: utf8.toUtf8String, + toUtf8Bytes: utf8.toUtf8Bytes, RLP: require('../utils/rlp'), } })(); +var errors = require('../utils/errors'); + function copyObject(obj) { var result = {}; for (var key in obj) { result[key] = obj[key]; } @@ -5313,17 +5319,36 @@ utils.defineProperty(Provider, 'getNetwork', function(network) { utils.defineProperty(Provider, 'networks', networks); utils.defineProperty(Provider, 'fetchJSON', function(url, json, processFunc) { + var headers = [ ]; + + if (typeof(url) === 'object' && url.url != null && url.user != null && url.password != null) { + if (url.url.substring(0, 6) !== 'https:' && url.forceInsecure !== true) { + errors.throwError('basic authentication requires a secure https url', errors.INVALID_ARGUMENT, { arg: 'url', url: url.url, user: url.user, password: '[REDACTED]' }); + } + + var authorization = url.user + ':' + url.password; + headers.push({ + key: 'Authorization', + value: 'Basic ' + utils.base64.encode(utils.toUtf8Bytes(authorization)) + }); + + url = url.url; + } return new Promise(function(resolve, reject) { var request = new XMLHttpRequest(); if (json) { request.open('POST', url, true); - request.setRequestHeader('Content-Type','application/json'); + headers.push({ key: 'Content-Type', value: 'application/json' }); } else { request.open('GET', url, true); } + headers.forEach(function(header) { + request.setRequestHeader(header.key, header.value); + }); + request.onreadystatechange = function() { if (request.readyState !== 4) { return; } @@ -5906,7 +5931,7 @@ utils.defineProperty(Provider, '_formatters', { module.exports = Provider; -},{"../utils/address":15,"../utils/bignumber":16,"../utils/contract-address":17,"../utils/convert":18,"../utils/namehash":22,"../utils/properties":23,"../utils/rlp":24,"../utils/utf8":26,"./networks.json":12,"inherits":3,"xmlhttprequest":6}],14:[function(require,module,exports){ +},{"../utils/address":15,"../utils/base64":17,"../utils/bignumber":16,"../utils/contract-address":18,"../utils/convert":19,"../utils/errors":21,"../utils/namehash":23,"../utils/properties":24,"../utils/rlp":25,"../utils/utf8":27,"./networks.json":12,"inherits":3,"xmlhttprequest":6}],14:[function(require,module,exports){ 'use strict'; var Provider = require('./provider'); @@ -5976,7 +6001,7 @@ utils.defineProperty(Web3Provider.prototype, 'send', function(method, params) { module.exports = Web3Provider; -},{"../utils/errors":20,"../utils/properties":23,"./json-rpc-provider":11,"./provider":13}],15:[function(require,module,exports){ +},{"../utils/errors":21,"../utils/properties":24,"./json-rpc-provider":11,"./provider":13}],15:[function(require,module,exports){ var BN = require('bn.js'); @@ -6102,7 +6127,7 @@ module.exports = { getAddress: getAddress, } -},{"./convert":18,"./keccak256":21,"./throw-error":25,"bn.js":1}],16:[function(require,module,exports){ +},{"./convert":19,"./keccak256":22,"./throw-error":26,"bn.js":1}],16:[function(require,module,exports){ /** * BigNumber * @@ -6253,7 +6278,33 @@ module.exports = { BigNumber: BigNumber }; -},{"./convert":18,"./properties":23,"./throw-error":25,"bn.js":1}],17:[function(require,module,exports){ +},{"./convert":19,"./properties":24,"./throw-error":26,"bn.js":1}],17:[function(require,module,exports){ +'use strict'; + +var convert = require('./convert'); + +module.exports = { + decode: function(textData) { + textData = atob(textData); + var data = []; + for (var i = 0; i < textData.length; i++) { + data.push(textData.charCodeAt(i)); + } + return convert.arrayify(data); + }, + encode: function(data) { + data = convert.arrayify(data); + var textData = ''; + for (var i = 0; i < data.length; i++) { + textData += String.fromCharCode(data[i]); + } + return btoa(textData); + } +}; + + + +},{"./convert":19}],18:[function(require,module,exports){ var getAddress = require('./address').getAddress; var convert = require('./convert'); @@ -6275,7 +6326,7 @@ module.exports = { getContractAddress: getContractAddress, } -},{"./address":15,"./convert":18,"./keccak256":21,"./rlp":24}],18:[function(require,module,exports){ +},{"./address":15,"./convert":19,"./keccak256":22,"./rlp":25}],19:[function(require,module,exports){ /** * Conversion Utilities * @@ -6501,10 +6552,10 @@ module.exports = { hexZeroPad: hexZeroPad, }; -},{"./errors":20,"./properties.js":23}],19:[function(require,module,exports){ +},{"./errors":21,"./properties.js":24}],20:[function(require,module,exports){ module.exports = undefined; -},{}],20:[function(require,module,exports){ +},{}],21:[function(require,module,exports){ 'use strict'; var defineProperty = require('./properties').defineProperty; @@ -6577,7 +6628,7 @@ defineProperty(codes, 'checkNew', function(self, kind) { module.exports = codes; -},{"./properties":23}],21:[function(require,module,exports){ +},{"./properties":24}],22:[function(require,module,exports){ 'use strict'; var sha3 = require('js-sha3'); @@ -6591,7 +6642,7 @@ function keccak256(data) { module.exports = keccak256; -},{"./convert.js":18,"js-sha3":4}],22:[function(require,module,exports){ +},{"./convert.js":19,"js-sha3":4}],23:[function(require,module,exports){ 'use strict'; var convert = require('./convert'); @@ -6631,7 +6682,7 @@ function namehash(name, depth) { module.exports = namehash; -},{"./convert":18,"./keccak256":21,"./utf8":26}],23:[function(require,module,exports){ +},{"./convert":19,"./keccak256":22,"./utf8":27}],24:[function(require,module,exports){ 'use strict'; function defineProperty(object, name, value) { @@ -6655,7 +6706,7 @@ module.exports = { defineProperty: defineProperty, }; -},{}],24:[function(require,module,exports){ +},{}],25:[function(require,module,exports){ //See: https://github.com/ethereum/wiki/wiki/RLP var convert = require('./convert.js'); @@ -6799,7 +6850,7 @@ module.exports = { decode: decode, } -},{"./convert.js":18}],25:[function(require,module,exports){ +},{"./convert.js":19}],26:[function(require,module,exports){ 'use strict'; function throwError(message, params) { @@ -6812,7 +6863,7 @@ function throwError(message, params) { module.exports = throwError; -},{}],26:[function(require,module,exports){ +},{}],27:[function(require,module,exports){ var convert = require('./convert.js'); @@ -6927,5 +6978,5 @@ module.exports = { toUtf8String: bytesToUtf8, }; -},{"./convert.js":18}]},{},[9])(9) +},{"./convert.js":19}]},{},[9])(9) }); \ No newline at end of file diff --git a/dist/ethers-providers.min.js b/dist/ethers-providers.min.js index 9456ac8c1..3158b592c 100644 --- a/dist/ethers-providers.min.js +++ b/dist/ethers-providers.min.js @@ -1,3 +1,3 @@ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.ethers=a()}}(function(){return function(){function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=49&&g<=54?g-49+10:g>=17&&g<=22?g-17+10:15&g}return d}function h(a,b,c,d){for(var e=0,f=Math.min(a.length,c),g=b;g=49?h-49+10:h>=17?h-17+10:h}return e}function i(a){for(var b=new Array(a.bitLength()),c=0;c>>e}return b}function j(a,b,c){c.negative=b.negative^a.negative;var d=a.length+b.length|0;c.length=d,d=d-1|0;var e=0|a.words[0],f=0|b.words[0],g=e*f,h=67108863&g,i=g/67108864|0;c.words[0]=h;for(var j=1;j>>26,l=67108863&i,m=Math.min(j,b.length-1),n=Math.max(0,j-a.length+1);n<=m;n++){var o=j-n|0;e=0|a.words[o],f=0|b.words[n],g=e*f+l,k+=g/67108864|0,l=67108863&g}c.words[j]=0|l,i=0|k}return 0!==i?c.words[j]=0|i:c.length--,c.strip()}function k(a,b,c){c.negative=b.negative^a.negative,c.length=a.length+b.length;for(var d=0,e=0,f=0;f>>26)|0,e+=g>>>26,g&=67108863}c.words[f]=h,d=g,g=e}return 0!==d?c.words[f]=d:c.length--,c.strip()}function l(a,b,c){var d=new m;return d.mulp(a,b,c)}function m(a,b){this.x=a,this.y=b}function n(a,b){this.name=a,this.p=new f(b,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function o(){n.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){n.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function q(){n.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function r(){n.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function s(a){if("string"==typeof a){var b=f._prime(a);this.m=b.p,this.prime=b}else d(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}function t(a){s.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof b?b.exports=f:c.BN=f,f.BN=f,f.wordSize=26;var u;try{u=a("buffer").Buffer}catch(v){}f.isBN=function(a){return a instanceof f||null!==a&&"object"==typeof a&&a.constructor.wordSize===f.wordSize&&Array.isArray(a.words)},f.max=function(a,b){return a.cmp(b)>0?a:b},f.min=function(a,b){return a.cmp(b)<0?a:b},f.prototype._init=function(a,b,c){if("number"==typeof a)return this._initNumber(a,b,c);if("object"==typeof a)return this._initArray(a,b,c);"hex"===b&&(b=16),d(b===(0|b)&&b>=2&&b<=36),a=a.toString().replace(/\s+/g,"");var e=0;"-"===a[0]&&e++,16===b?this._parseHex(a,e):this._parseBase(a,b,e),"-"===a[0]&&(this.negative=1),this.strip(),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initNumber=function(a,b,c){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[67108863&a],this.length=1):a<4503599627370496?(this.words=[67108863&a,a/67108864&67108863],this.length=2):(d(a<9007199254740992),this.words=[67108863&a,a/67108864&67108863,1],this.length=3),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initArray=function(a,b,c){if(d("number"==typeof a.length),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var e=0;e=0;e-=3)g=a[e]|a[e-1]<<8|a[e-2]<<16,this.words[f]|=g<>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);else if("le"===c)for(e=0,f=0;e>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);return this.strip()},f.prototype._parseHex=function(a,b){this.length=Math.ceil((a.length-b)/6),this.words=new Array(this.length);for(var c=0;c=b;c-=6)e=g(a,c,c+6),this.words[d]|=e<>>26-f&4194303,f+=24,f>=26&&(f-=26,d++);c+6!==b&&(e=g(a,b,c+6),this.words[d]|=e<>>26-f&4194303),this.strip()},f.prototype._parseBase=function(a,b,c){this.words=[0],this.length=1;for(var d=0,e=1;e<=67108863;e*=b)d++;d--,e=e/b|0;for(var f=a.length-c,g=f%d,i=Math.min(f,f-g)+c,j=0,k=c;k1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(a,b){a=a||10,b=0|b||1;var c;if(16===a||"hex"===a){c="";for(var e=0,f=0,g=0;g>>24-e&16777215,c=0!==f||g!==this.length-1?w[6-i.length]+i+c:i+c,e+=2,e>=26&&(e-=26,g--)}for(0!==f&&(c=f.toString(16)+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(a===(0|a)&&a>=2&&a<=36){var j=x[a],k=y[a];c="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modn(k).toString(a);l=l.idivn(k),c=l.isZero()?m+c:w[j-m.length]+m+c}for(this.isZero()&&(c="0"+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}d(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var a=this.words[0];return 2===this.length?a+=67108864*this.words[1]:3===this.length&&1===this.words[2]?a+=4503599627370496+67108864*this.words[1]:this.length>2&&d(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-a:a},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(a,b){return d("undefined"!=typeof u),this.toArrayLike(u,a,b)},f.prototype.toArray=function(a,b){return this.toArrayLike(Array,a,b)},f.prototype.toArrayLike=function(a,b,c){var e=this.byteLength(),f=c||Math.max(1,e);d(e<=f,"byte array longer than desired length"),d(f>0,"Requested array length <= 0"),this.strip();var g,h,i="le"===b,j=new a(f),k=this.clone();if(i){for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[h]=g;for(;h=4096&&(c+=13,b>>>=13),b>=64&&(c+=7,b>>>=7),b>=8&&(c+=4,b>>>=4),b>=2&&(c+=2,b>>>=2),c+b},f.prototype._zeroBits=function(a){if(0===a)return 26;var b=a,c=0;return 0===(8191&b)&&(c+=13,b>>>=13),0===(127&b)&&(c+=7,b>>>=7),0===(15&b)&&(c+=4,b>>>=4),0===(3&b)&&(c+=2,b>>>=2),0===(1&b)&&c++,c},f.prototype.bitLength=function(){var a=this.words[this.length-1],b=this._countBits(a);return 26*(this.length-1)+b},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,b=0;ba.length?this.clone().ior(a):a.clone().ior(this)},f.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},f.prototype.iuand=function(a){var b;b=this.length>a.length?a:this;for(var c=0;ca.length?this.clone().iand(a):a.clone().iand(this)},f.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},f.prototype.iuxor=function(a){var b,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(var d=0;da.length?this.clone().ixor(a):a.clone().ixor(this)},f.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},f.prototype.inotn=function(a){d("number"==typeof a&&a>=0);var b=0|Math.ceil(a/26),c=a%26;this._expand(b),c>0&&b--;for(var e=0;e0&&(this.words[e]=~this.words[e]&67108863>>26-c),this.strip()},f.prototype.notn=function(a){return this.clone().inotn(a)},f.prototype.setn=function(a,b){d("number"==typeof a&&a>=0);var c=a/26|0,e=a%26;return this._expand(c+1),b?this.words[c]=this.words[c]|1<a.length?(c=this,d=a):(c=a,d=this);for(var e=0,f=0;f>>26;for(;0!==e&&f>>26;if(this.length=c.length,0!==e)this.words[this.length]=e,this.length++;else if(c!==this)for(;fa.length?this.clone().iadd(a):a.clone().iadd(this)},f.prototype.isub=function(a){if(0!==a.negative){a.negative=0;var b=this.iadd(a);return a.negative=1,b._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var c=this.cmp(a);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;var d,e;c>0?(d=this,e=a):(d=a,e=this);for(var f=0,g=0;g>26,this.words[g]=67108863&b;for(;0!==f&&g>26,this.words[g]=67108863&b;if(0===f&&g>>13,n=0|g[1],o=8191&n,p=n>>>13,q=0|g[2],r=8191&q,s=q>>>13,t=0|g[3],u=8191&t,v=t>>>13,w=0|g[4],x=8191&w,y=w>>>13,z=0|g[5],A=8191&z,B=z>>>13,C=0|g[6],D=8191&C,E=C>>>13,F=0|g[7],G=8191&F,H=F>>>13,I=0|g[8],J=8191&I,K=I>>>13,L=0|g[9],M=8191&L,N=L>>>13,O=0|h[0],P=8191&O,Q=O>>>13,R=0|h[1],S=8191&R,T=R>>>13,U=0|h[2],V=8191&U,W=U>>>13,X=0|h[3],Y=8191&X,Z=X>>>13,$=0|h[4],_=8191&$,aa=$>>>13,ba=0|h[5],ca=8191&ba,da=ba>>>13,ea=0|h[6],fa=8191&ea,ga=ea>>>13,ha=0|h[7],ia=8191&ha,ja=ha>>>13,ka=0|h[8],la=8191&ka,ma=ka>>>13,na=0|h[9],oa=8191&na,pa=na>>>13;c.negative=a.negative^b.negative,c.length=19,d=Math.imul(l,P),e=Math.imul(l,Q),e=e+Math.imul(m,P)|0,f=Math.imul(m,Q);var qa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(qa>>>26)|0,qa&=67108863,d=Math.imul(o,P),e=Math.imul(o,Q),e=e+Math.imul(p,P)|0,f=Math.imul(p,Q),d=d+Math.imul(l,S)|0,e=e+Math.imul(l,T)|0,e=e+Math.imul(m,S)|0,f=f+Math.imul(m,T)|0;var ra=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ra>>>26)|0,ra&=67108863,d=Math.imul(r,P),e=Math.imul(r,Q),e=e+Math.imul(s,P)|0,f=Math.imul(s,Q),d=d+Math.imul(o,S)|0,e=e+Math.imul(o,T)|0,e=e+Math.imul(p,S)|0,f=f+Math.imul(p,T)|0,d=d+Math.imul(l,V)|0,e=e+Math.imul(l,W)|0,e=e+Math.imul(m,V)|0,f=f+Math.imul(m,W)|0;var sa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(sa>>>26)|0,sa&=67108863,d=Math.imul(u,P),e=Math.imul(u,Q),e=e+Math.imul(v,P)|0,f=Math.imul(v,Q),d=d+Math.imul(r,S)|0,e=e+Math.imul(r,T)|0,e=e+Math.imul(s,S)|0,f=f+Math.imul(s,T)|0,d=d+Math.imul(o,V)|0,e=e+Math.imul(o,W)|0,e=e+Math.imul(p,V)|0,f=f+Math.imul(p,W)|0,d=d+Math.imul(l,Y)|0,e=e+Math.imul(l,Z)|0,e=e+Math.imul(m,Y)|0,f=f+Math.imul(m,Z)|0;var ta=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ta>>>26)|0,ta&=67108863,d=Math.imul(x,P),e=Math.imul(x,Q),e=e+Math.imul(y,P)|0,f=Math.imul(y,Q),d=d+Math.imul(u,S)|0,e=e+Math.imul(u,T)|0,e=e+Math.imul(v,S)|0,f=f+Math.imul(v,T)|0,d=d+Math.imul(r,V)|0,e=e+Math.imul(r,W)|0,e=e+Math.imul(s,V)|0,f=f+Math.imul(s,W)|0,d=d+Math.imul(o,Y)|0,e=e+Math.imul(o,Z)|0,e=e+Math.imul(p,Y)|0,f=f+Math.imul(p,Z)|0,d=d+Math.imul(l,_)|0,e=e+Math.imul(l,aa)|0,e=e+Math.imul(m,_)|0,f=f+Math.imul(m,aa)|0;var ua=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ua>>>26)|0,ua&=67108863,d=Math.imul(A,P),e=Math.imul(A,Q),e=e+Math.imul(B,P)|0,f=Math.imul(B,Q),d=d+Math.imul(x,S)|0,e=e+Math.imul(x,T)|0,e=e+Math.imul(y,S)|0,f=f+Math.imul(y,T)|0,d=d+Math.imul(u,V)|0,e=e+Math.imul(u,W)|0,e=e+Math.imul(v,V)|0,f=f+Math.imul(v,W)|0,d=d+Math.imul(r,Y)|0,e=e+Math.imul(r,Z)|0,e=e+Math.imul(s,Y)|0,f=f+Math.imul(s,Z)|0,d=d+Math.imul(o,_)|0,e=e+Math.imul(o,aa)|0,e=e+Math.imul(p,_)|0,f=f+Math.imul(p,aa)|0,d=d+Math.imul(l,ca)|0,e=e+Math.imul(l,da)|0,e=e+Math.imul(m,ca)|0,f=f+Math.imul(m,da)|0;var va=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(va>>>26)|0,va&=67108863,d=Math.imul(D,P),e=Math.imul(D,Q),e=e+Math.imul(E,P)|0,f=Math.imul(E,Q),d=d+Math.imul(A,S)|0,e=e+Math.imul(A,T)|0,e=e+Math.imul(B,S)|0,f=f+Math.imul(B,T)|0,d=d+Math.imul(x,V)|0,e=e+Math.imul(x,W)|0,e=e+Math.imul(y,V)|0,f=f+Math.imul(y,W)|0,d=d+Math.imul(u,Y)|0,e=e+Math.imul(u,Z)|0,e=e+Math.imul(v,Y)|0,f=f+Math.imul(v,Z)|0,d=d+Math.imul(r,_)|0,e=e+Math.imul(r,aa)|0,e=e+Math.imul(s,_)|0,f=f+Math.imul(s,aa)|0,d=d+Math.imul(o,ca)|0,e=e+Math.imul(o,da)|0,e=e+Math.imul(p,ca)|0,f=f+Math.imul(p,da)|0,d=d+Math.imul(l,fa)|0,e=e+Math.imul(l,ga)|0,e=e+Math.imul(m,fa)|0,f=f+Math.imul(m,ga)|0;var wa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(wa>>>26)|0,wa&=67108863,d=Math.imul(G,P),e=Math.imul(G,Q),e=e+Math.imul(H,P)|0,f=Math.imul(H,Q),d=d+Math.imul(D,S)|0,e=e+Math.imul(D,T)|0,e=e+Math.imul(E,S)|0,f=f+Math.imul(E,T)|0,d=d+Math.imul(A,V)|0,e=e+Math.imul(A,W)|0,e=e+Math.imul(B,V)|0,f=f+Math.imul(B,W)|0,d=d+Math.imul(x,Y)|0,e=e+Math.imul(x,Z)|0,e=e+Math.imul(y,Y)|0,f=f+Math.imul(y,Z)|0,d=d+Math.imul(u,_)|0,e=e+Math.imul(u,aa)|0,e=e+Math.imul(v,_)|0,f=f+Math.imul(v,aa)|0,d=d+Math.imul(r,ca)|0,e=e+Math.imul(r,da)|0,e=e+Math.imul(s,ca)|0,f=f+Math.imul(s,da)|0,d=d+Math.imul(o,fa)|0,e=e+Math.imul(o,ga)|0,e=e+Math.imul(p,fa)|0,f=f+Math.imul(p,ga)|0,d=d+Math.imul(l,ia)|0,e=e+Math.imul(l,ja)|0,e=e+Math.imul(m,ia)|0,f=f+Math.imul(m,ja)|0;var xa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(xa>>>26)|0,xa&=67108863,d=Math.imul(J,P),e=Math.imul(J,Q),e=e+Math.imul(K,P)|0,f=Math.imul(K,Q),d=d+Math.imul(G,S)|0,e=e+Math.imul(G,T)|0,e=e+Math.imul(H,S)|0,f=f+Math.imul(H,T)|0,d=d+Math.imul(D,V)|0,e=e+Math.imul(D,W)|0,e=e+Math.imul(E,V)|0,f=f+Math.imul(E,W)|0,d=d+Math.imul(A,Y)|0,e=e+Math.imul(A,Z)|0,e=e+Math.imul(B,Y)|0,f=f+Math.imul(B,Z)|0,d=d+Math.imul(x,_)|0,e=e+Math.imul(x,aa)|0,e=e+Math.imul(y,_)|0,f=f+Math.imul(y,aa)|0,d=d+Math.imul(u,ca)|0,e=e+Math.imul(u,da)|0,e=e+Math.imul(v,ca)|0,f=f+Math.imul(v,da)|0,d=d+Math.imul(r,fa)|0,e=e+Math.imul(r,ga)|0,e=e+Math.imul(s,fa)|0,f=f+Math.imul(s,ga)|0,d=d+Math.imul(o,ia)|0,e=e+Math.imul(o,ja)|0,e=e+Math.imul(p,ia)|0,f=f+Math.imul(p,ja)|0,d=d+Math.imul(l,la)|0,e=e+Math.imul(l,ma)|0,e=e+Math.imul(m,la)|0,f=f+Math.imul(m,ma)|0;var ya=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ya>>>26)|0,ya&=67108863,d=Math.imul(M,P),e=Math.imul(M,Q),e=e+Math.imul(N,P)|0,f=Math.imul(N,Q),d=d+Math.imul(J,S)|0,e=e+Math.imul(J,T)|0,e=e+Math.imul(K,S)|0,f=f+Math.imul(K,T)|0,d=d+Math.imul(G,V)|0,e=e+Math.imul(G,W)|0,e=e+Math.imul(H,V)|0,f=f+Math.imul(H,W)|0,d=d+Math.imul(D,Y)|0,e=e+Math.imul(D,Z)|0,e=e+Math.imul(E,Y)|0,f=f+Math.imul(E,Z)|0,d=d+Math.imul(A,_)|0,e=e+Math.imul(A,aa)|0,e=e+Math.imul(B,_)|0,f=f+Math.imul(B,aa)|0,d=d+Math.imul(x,ca)|0,e=e+Math.imul(x,da)|0,e=e+Math.imul(y,ca)|0,f=f+Math.imul(y,da)|0,d=d+Math.imul(u,fa)|0,e=e+Math.imul(u,ga)|0,e=e+Math.imul(v,fa)|0,f=f+Math.imul(v,ga)|0,d=d+Math.imul(r,ia)|0,e=e+Math.imul(r,ja)|0,e=e+Math.imul(s,ia)|0,f=f+Math.imul(s,ja)|0,d=d+Math.imul(o,la)|0,e=e+Math.imul(o,ma)|0,e=e+Math.imul(p,la)|0,f=f+Math.imul(p,ma)|0,d=d+Math.imul(l,oa)|0,e=e+Math.imul(l,pa)|0,e=e+Math.imul(m,oa)|0,f=f+Math.imul(m,pa)|0;var za=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(za>>>26)|0,za&=67108863,d=Math.imul(M,S),e=Math.imul(M,T),e=e+Math.imul(N,S)|0,f=Math.imul(N,T),d=d+Math.imul(J,V)|0,e=e+Math.imul(J,W)|0,e=e+Math.imul(K,V)|0,f=f+Math.imul(K,W)|0,d=d+Math.imul(G,Y)|0,e=e+Math.imul(G,Z)|0,e=e+Math.imul(H,Y)|0,f=f+Math.imul(H,Z)|0,d=d+Math.imul(D,_)|0,e=e+Math.imul(D,aa)|0,e=e+Math.imul(E,_)|0,f=f+Math.imul(E,aa)|0,d=d+Math.imul(A,ca)|0,e=e+Math.imul(A,da)|0,e=e+Math.imul(B,ca)|0,f=f+Math.imul(B,da)|0,d=d+Math.imul(x,fa)|0,e=e+Math.imul(x,ga)|0,e=e+Math.imul(y,fa)|0,f=f+Math.imul(y,ga)|0,d=d+Math.imul(u,ia)|0,e=e+Math.imul(u,ja)|0,e=e+Math.imul(v,ia)|0,f=f+Math.imul(v,ja)|0,d=d+Math.imul(r,la)|0,e=e+Math.imul(r,ma)|0,e=e+Math.imul(s,la)|0,f=f+Math.imul(s,ma)|0,d=d+Math.imul(o,oa)|0,e=e+Math.imul(o,pa)|0,e=e+Math.imul(p,oa)|0,f=f+Math.imul(p,pa)|0;var Aa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,d=Math.imul(M,V),e=Math.imul(M,W),e=e+Math.imul(N,V)|0,f=Math.imul(N,W),d=d+Math.imul(J,Y)|0,e=e+Math.imul(J,Z)|0,e=e+Math.imul(K,Y)|0,f=f+Math.imul(K,Z)|0,d=d+Math.imul(G,_)|0,e=e+Math.imul(G,aa)|0,e=e+Math.imul(H,_)|0,f=f+Math.imul(H,aa)|0,d=d+Math.imul(D,ca)|0,e=e+Math.imul(D,da)|0,e=e+Math.imul(E,ca)|0,f=f+Math.imul(E,da)|0,d=d+Math.imul(A,fa)|0,e=e+Math.imul(A,ga)|0,e=e+Math.imul(B,fa)|0,f=f+Math.imul(B,ga)|0,d=d+Math.imul(x,ia)|0,e=e+Math.imul(x,ja)|0,e=e+Math.imul(y,ia)|0,f=f+Math.imul(y,ja)|0,d=d+Math.imul(u,la)|0,e=e+Math.imul(u,ma)|0,e=e+Math.imul(v,la)|0,f=f+Math.imul(v,ma)|0,d=d+Math.imul(r,oa)|0,e=e+Math.imul(r,pa)|0,e=e+Math.imul(s,oa)|0,f=f+Math.imul(s,pa)|0;var Ba=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,d=Math.imul(M,Y),e=Math.imul(M,Z),e=e+Math.imul(N,Y)|0,f=Math.imul(N,Z),d=d+Math.imul(J,_)|0,e=e+Math.imul(J,aa)|0,e=e+Math.imul(K,_)|0,f=f+Math.imul(K,aa)|0,d=d+Math.imul(G,ca)|0,e=e+Math.imul(G,da)|0,e=e+Math.imul(H,ca)|0,f=f+Math.imul(H,da)|0,d=d+Math.imul(D,fa)|0,e=e+Math.imul(D,ga)|0,e=e+Math.imul(E,fa)|0,f=f+Math.imul(E,ga)|0,d=d+Math.imul(A,ia)|0,e=e+Math.imul(A,ja)|0,e=e+Math.imul(B,ia)|0,f=f+Math.imul(B,ja)|0,d=d+Math.imul(x,la)|0,e=e+Math.imul(x,ma)|0,e=e+Math.imul(y,la)|0,f=f+Math.imul(y,ma)|0,d=d+Math.imul(u,oa)|0,e=e+Math.imul(u,pa)|0,e=e+Math.imul(v,oa)|0,f=f+Math.imul(v,pa)|0;var Ca=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,d=Math.imul(M,_),e=Math.imul(M,aa),e=e+Math.imul(N,_)|0,f=Math.imul(N,aa),d=d+Math.imul(J,ca)|0,e=e+Math.imul(J,da)|0,e=e+Math.imul(K,ca)|0,f=f+Math.imul(K,da)|0,d=d+Math.imul(G,fa)|0,e=e+Math.imul(G,ga)|0,e=e+Math.imul(H,fa)|0,f=f+Math.imul(H,ga)|0,d=d+Math.imul(D,ia)|0,e=e+Math.imul(D,ja)|0,e=e+Math.imul(E,ia)|0,f=f+Math.imul(E,ja)|0,d=d+Math.imul(A,la)|0,e=e+Math.imul(A,ma)|0,e=e+Math.imul(B,la)|0,f=f+Math.imul(B,ma)|0,d=d+Math.imul(x,oa)|0,e=e+Math.imul(x,pa)|0,e=e+Math.imul(y,oa)|0,f=f+Math.imul(y,pa)|0;var Da=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Da>>>26)|0,Da&=67108863,d=Math.imul(M,ca),e=Math.imul(M,da),e=e+Math.imul(N,ca)|0,f=Math.imul(N,da),d=d+Math.imul(J,fa)|0,e=e+Math.imul(J,ga)|0,e=e+Math.imul(K,fa)|0,f=f+Math.imul(K,ga)|0,d=d+Math.imul(G,ia)|0,e=e+Math.imul(G,ja)|0,e=e+Math.imul(H,ia)|0,f=f+Math.imul(H,ja)|0,d=d+Math.imul(D,la)|0,e=e+Math.imul(D,ma)|0,e=e+Math.imul(E,la)|0,f=f+Math.imul(E,ma)|0,d=d+Math.imul(A,oa)|0,e=e+Math.imul(A,pa)|0,e=e+Math.imul(B,oa)|0,f=f+Math.imul(B,pa)|0;var Ea=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,d=Math.imul(M,fa),e=Math.imul(M,ga),e=e+Math.imul(N,fa)|0,f=Math.imul(N,ga),d=d+Math.imul(J,ia)|0,e=e+Math.imul(J,ja)|0,e=e+Math.imul(K,ia)|0,f=f+Math.imul(K,ja)|0,d=d+Math.imul(G,la)|0,e=e+Math.imul(G,ma)|0,e=e+Math.imul(H,la)|0,f=f+Math.imul(H,ma)|0,d=d+Math.imul(D,oa)|0,e=e+Math.imul(D,pa)|0,e=e+Math.imul(E,oa)|0,f=f+Math.imul(E,pa)|0;var Fa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,d=Math.imul(M,ia),e=Math.imul(M,ja),e=e+Math.imul(N,ia)|0,f=Math.imul(N,ja),d=d+Math.imul(J,la)|0,e=e+Math.imul(J,ma)|0,e=e+Math.imul(K,la)|0,f=f+Math.imul(K,ma)|0,d=d+Math.imul(G,oa)|0,e=e+Math.imul(G,pa)|0,e=e+Math.imul(H,oa)|0,f=f+Math.imul(H,pa)|0;var Ga=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,d=Math.imul(M,la),e=Math.imul(M,ma),e=e+Math.imul(N,la)|0,f=Math.imul(N,ma),d=d+Math.imul(J,oa)|0,e=e+Math.imul(J,pa)|0,e=e+Math.imul(K,oa)|0,f=f+Math.imul(K,pa)|0;var Ha=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,d=Math.imul(M,oa),e=Math.imul(M,pa),e=e+Math.imul(N,oa)|0,f=Math.imul(N,pa);var Ia=(j+d|0)+((8191&e)<<13)|0;return j=(f+(e>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,i[0]=qa,i[1]=ra,i[2]=sa,i[3]=ta,i[4]=ua,i[5]=va,i[6]=wa,i[7]=xa,i[8]=ya,i[9]=za,i[10]=Aa,i[11]=Ba,i[12]=Ca,i[13]=Da,i[14]=Ea,i[15]=Fa,i[16]=Ga,i[17]=Ha,i[18]=Ia,0!==j&&(i[19]=j,c.length++),c};Math.imul||(z=j),f.prototype.mulTo=function(a,b){var c,d=this.length+a.length;return c=10===this.length&&10===a.length?z(this,a,b):d<63?j(this,a,b):d<1024?k(this,a,b):l(this,a,b)},m.prototype.makeRBT=function(a){for(var b=new Array(a),c=f.prototype._countBits(a)-1,d=0;d>=1;return d},m.prototype.permute=function(a,b,c,d,e,f){for(var g=0;g>>=1)e++;return 1<>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return 0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){return this.clone().imuln(a)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(a){var b=i(a);if(0===b.length)return new f(1);for(var c=this,d=0;d=0);var b,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){var g=0;for(b=0;b>>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=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<g)for(this.length-=g,j=0;j=0&&(0!==k||j>=e);j--){var l=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&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){return d(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){return this.clone().ishln(a)},f.prototype.ushln=function(a){return this.clone().iushln(a)},f.prototype.shrn=function(a){return this.clone().ishrn(a)},f.prototype.ushrn=function(a){return this.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26,e=1<=0);var b=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){var e=67108863^67108863>>>b<=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},f.prototype.isubn=function(a){if(d("number"==typeof a),d(a<67108864),a<0)return this.iaddn(-a);if(0!==this.negative)return this.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;else for(var b=0;b>26)-(i/67108864|0),this.words[e+c]=67108863&g}for(;e>26,this.words[e+c]=67108863&g;if(0===h)return this.strip();for(d(h===-1),h=0,e=0;e>26,this.words[e]=67108863&g;return this.negative=1,this.strip()},f.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),e=a,g=0|e.words[e.length-1],h=this._countBits(g);c=26-h,0!==c&&(e=e.ushln(c),d.iushln(c),g=0|e.words[e.length-1]);var i,j=d.length-e.length;if("mod"!==b){i=new f(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k=0;m--){var n=67108864*(0|d.words[e.length+m])+(0|d.words[e.length+m-1]);for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(e,n,m);0!==d.negative;)n--,d.negative=0,d._ishlnsubmul(e,1,m),d.isZero()||(d.negative^=1);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.iushrn(c),{div:i||null,mod:d}},f.prototype.divmod=function(a,b,c){if(d(!a.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var e,g,h;return 0!==this.negative&&0===a.negative?(h=this.neg().divmod(a,b),"mod"!==b&&(e=h.div.neg()),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.iadd(a)),{div:e,mod:g}):0===this.negative&&0!==a.negative?(h=this.divmod(a.neg(),b),"mod"!==b&&(e=h.div.neg()), -{div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new f(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new f(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new f(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){return this.divmod(a,"div",!1).div},f.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){var b=this.divmod(a);if(b.mod.isZero())return b.div;var c=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);return f<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(var b=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;return c},f.prototype.idivn=function(a){d(a<=67108863);for(var b=0,c=this.length-1;c>=0;c--){var e=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}return this.strip()},f.prototype.divn=function(a){return this.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=new f(0),i=new f(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(var k=c.clone(),l=b.clone();!b.isZero();){for(var m=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-- >0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(var o=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-- >0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(var i=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-- >0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(var k=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}var m;return m=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var b=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(var d=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);var e=b.cmp(c);if(e<0){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.iushln(d)},f.prototype.invm=function(a){return this.egcd(a).a.umod(a)},f.prototype.isEven=function(){return 0===(1&this.words[0])},f.prototype.isOdd=function(){return 1===(1&this.words[0])},f.prototype.andln=function(a){return this.words[0]&a},f.prototype.bincn=function(a){d("number"==typeof a);var b=a%26,c=(a-b)/26,e=1<>>26,h&=67108863,this.words[g]=h}return 0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){var b=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return 1;this.strip();var c;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");var e=0|this.words[0];c=e===a?0:ea.length)return 1;if(this.length=0;c--){var d=0|this.words[c],e=0|a.words[c];if(d!==e){de&&(b=1);break}}return b},f.prototype.gtn=function(a){return 1===this.cmpn(a)},f.prototype.gt=function(a){return 1===this.cmp(a)},f.prototype.gten=function(a){return this.cmpn(a)>=0},f.prototype.gte=function(a){return this.cmp(a)>=0},f.prototype.ltn=function(a){return this.cmpn(a)===-1},f.prototype.lt=function(a){return this.cmp(a)===-1},f.prototype.lten=function(a){return this.cmpn(a)<=0},f.prototype.lte=function(a){return this.cmp(a)<=0},f.prototype.eqn=function(a){return 0===this.cmpn(a)},f.prototype.eq=function(a){return 0===this.cmp(a)},f.red=function(a){return new s(a)},f.prototype.toRed=function(a){return d(!this.red,"Already a number in reduction context"),d(0===this.negative,"red works only with positives"),a.convertTo(this)._forceRed(a)},f.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(a){return this.red=a,this},f.prototype.forceRed=function(a){return d(!this.red,"Already a number in reduction context"),this._forceRed(a)},f.prototype.redAdd=function(a){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},f.prototype.redIAdd=function(a){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},f.prototype.redSub=function(a){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},f.prototype.redISub=function(a){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},f.prototype.redShl=function(a){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},f.prototype.redMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},f.prototype.redIMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},f.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(a){return d(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var a=new f(null);return a.words=new Array(Math.ceil(this.n/13)),a},n.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b0?c.isub(this.p):c.strip(),c},n.prototype.split=function(a,b){a.iushrn(this.n,0,b)},n.prototype.imulK=function(a){return a.imul(this.k)},e(o,n),o.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;e>>22,f=g}f>>>=22,a.words[e-10]=f,0===f&&a.length>10?a.length-=10:a.length-=9},o.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b=0,c=0;c>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},f._prime=function B(a){if(A[a])return A[a];var B;if("k256"===a)B=new o;else if("p224"===a)B=new p;else if("p192"===a)B=new q;else{if("p25519"!==a)throw new Error("Unknown prime "+a);B=new r}return A[a]=B,B},s.prototype._verify1=function(a){d(0===a.negative,"red works only with positives"),d(a.red,"red works only with red numbers")},s.prototype._verify2=function(a,b){d(0===(a.negative|b.negative),"red works only with positives"),d(a.red&&a.red===b.red,"red works only with red numbers")},s.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:2}],2:[function(a,b,c){},{}],3:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],4:[function(a,b,c){(function(a,c){!function(){"use strict";function d(a,b,c){this.blocks=[],this.s=[],this.padding=b,this.outputBits=c,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(a<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=c>>5,this.extraBytes=(31&c)>>3;for(var d=0;d<50;++d)this.s[d]=0}var e="object"==typeof window?window:{},f=!e.JS_SHA3_NO_NODE_JS&&"object"==typeof a&&a.versions&&a.versions.node;f&&(e=c);for(var g=!e.JS_SHA3_NO_COMMON_JS&&"object"==typeof b&&b.exports,h="0123456789abcdef".split(""),i=[31,7936,2031616,520093696],j=[1,256,65536,16777216],k=[6,1536,393216,100663296],l=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],n=[224,256,384,512],o=[128,256],p=["hex","buffer","arrayBuffer","array"],q=function(a,b,c){return function(e){return new d(a,b,a).update(e)[c]()}},r=function(a,b,c){return function(e,f){return new d(a,b,f).update(e)[c]()}},s=function(a,b){var c=q(a,b,"hex");c.create=function(){return new d(a,b,a)},c.update=function(a){return c.create().update(a)};for(var e=0;e>2]|=a[i]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(f[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=g){for(this.start=c-g,this.block=f[h],c=0;c>2]|=this.padding[3&b],this.lastByteIndex===this.byteCount)for(a[0]=a[c],b=1;b>4&15]+h[15&a]+h[a>>12&15]+h[a>>8&15]+h[a>>20&15]+h[a>>16&15]+h[a>>28&15]+h[a>>24&15];g%b===0&&(C(c),f=0)}return e&&(a=c[f],e>0&&(i+=h[a>>4&15]+h[15&a]),e>1&&(i+=h[a>>12&15]+h[a>>8&15]),e>2&&(i+=h[a>>20&15]+h[a>>16&15])),i},d.prototype.arrayBuffer=function(){this.finalize();var a,b=this.blockCount,c=this.s,d=this.outputBlocks,e=this.extraBytes,f=0,g=0,h=this.outputBits>>3;a=e?new ArrayBuffer(d+1<<2):new ArrayBuffer(h);for(var i=new Uint32Array(a);g>8&255,i[a+2]=b>>16&255,i[a+3]=b>>24&255;h%c===0&&C(d)}return f&&(a=h<<2,b=d[g],f>0&&(i[a]=255&b),f>1&&(i[a+1]=b>>8&255),f>2&&(i[a+2]=b>>16&255)),i};var C=function(a){var b,c,d,e,f,g,h,i,j,k,l,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka;for(d=0;d<48;d+=2)e=a[0]^a[10]^a[20]^a[30]^a[40],f=a[1]^a[11]^a[21]^a[31]^a[41],g=a[2]^a[12]^a[22]^a[32]^a[42],h=a[3]^a[13]^a[23]^a[33]^a[43],i=a[4]^a[14]^a[24]^a[34]^a[44],j=a[5]^a[15]^a[25]^a[35]^a[45],k=a[6]^a[16]^a[26]^a[36]^a[46],l=a[7]^a[17]^a[27]^a[37]^a[47],n=a[8]^a[18]^a[28]^a[38]^a[48],o=a[9]^a[19]^a[29]^a[39]^a[49],b=n^(g<<1|h>>>31),c=o^(h<<1|g>>>31),a[0]^=b,a[1]^=c,a[10]^=b,a[11]^=c,a[20]^=b,a[21]^=c,a[30]^=b,a[31]^=c,a[40]^=b,a[41]^=c,b=e^(i<<1|j>>>31),c=f^(j<<1|i>>>31),a[2]^=b,a[3]^=c,a[12]^=b,a[13]^=c,a[22]^=b,a[23]^=c,a[32]^=b,a[33]^=c,a[42]^=b,a[43]^=c,b=g^(k<<1|l>>>31),c=h^(l<<1|k>>>31),a[4]^=b,a[5]^=c,a[14]^=b,a[15]^=c,a[24]^=b,a[25]^=c,a[34]^=b,a[35]^=c,a[44]^=b,a[45]^=c,b=i^(n<<1|o>>>31),c=j^(o<<1|n>>>31),a[6]^=b,a[7]^=c,a[16]^=b,a[17]^=c,a[26]^=b,a[27]^=c,a[36]^=b,a[37]^=c,a[46]^=b,a[47]^=c,b=k^(e<<1|f>>>31),c=l^(f<<1|e>>>31),a[8]^=b,a[9]^=c,a[18]^=b,a[19]^=c,a[28]^=b,a[29]^=c,a[38]^=b,a[39]^=c,a[48]^=b,a[49]^=c,p=a[0],q=a[1],V=a[11]<<4|a[10]>>>28,W=a[10]<<4|a[11]>>>28,D=a[20]<<3|a[21]>>>29,E=a[21]<<3|a[20]>>>29,ha=a[31]<<9|a[30]>>>23,ia=a[30]<<9|a[31]>>>23,R=a[40]<<18|a[41]>>>14,S=a[41]<<18|a[40]>>>14,J=a[2]<<1|a[3]>>>31,K=a[3]<<1|a[2]>>>31,r=a[13]<<12|a[12]>>>20,s=a[12]<<12|a[13]>>>20,X=a[22]<<10|a[23]>>>22,Y=a[23]<<10|a[22]>>>22,F=a[33]<<13|a[32]>>>19,G=a[32]<<13|a[33]>>>19,ja=a[42]<<2|a[43]>>>30,ka=a[43]<<2|a[42]>>>30,ba=a[5]<<30|a[4]>>>2,ca=a[4]<<30|a[5]>>>2,L=a[14]<<6|a[15]>>>26,M=a[15]<<6|a[14]>>>26,t=a[25]<<11|a[24]>>>21,u=a[24]<<11|a[25]>>>21,Z=a[34]<<15|a[35]>>>17,$=a[35]<<15|a[34]>>>17,H=a[45]<<29|a[44]>>>3,I=a[44]<<29|a[45]>>>3,z=a[6]<<28|a[7]>>>4,A=a[7]<<28|a[6]>>>4,da=a[17]<<23|a[16]>>>9,ea=a[16]<<23|a[17]>>>9,N=a[26]<<25|a[27]>>>7,O=a[27]<<25|a[26]>>>7,v=a[36]<<21|a[37]>>>11,w=a[37]<<21|a[36]>>>11,_=a[47]<<24|a[46]>>>8,aa=a[46]<<24|a[47]>>>8,T=a[8]<<27|a[9]>>>5,U=a[9]<<27|a[8]>>>5,B=a[18]<<20|a[19]>>>12,C=a[19]<<20|a[18]>>>12,fa=a[29]<<7|a[28]>>>25,ga=a[28]<<7|a[29]>>>25,P=a[38]<<8|a[39]>>>24,Q=a[39]<<8|a[38]>>>24,x=a[48]<<14|a[49]>>>18,y=a[49]<<14|a[48]>>>18,a[0]=p^~r&t,a[1]=q^~s&u,a[10]=z^~B&D,a[11]=A^~C&E,a[20]=J^~L&N,a[21]=K^~M&O,a[30]=T^~V&X,a[31]=U^~W&Y,a[40]=ba^~da&fa,a[41]=ca^~ea&ga,a[2]=r^~t&v,a[3]=s^~u&w,a[12]=B^~D&F,a[13]=C^~E&G,a[22]=L^~N&P,a[23]=M^~O&Q,a[32]=V^~X&Z,a[33]=W^~Y&$,a[42]=da^~fa&ha,a[43]=ea^~ga&ia,a[4]=t^~v&x,a[5]=u^~w&y,a[14]=D^~F&H,a[15]=E^~G&I,a[24]=N^~P&R,a[25]=O^~Q&S,a[34]=X^~Z&_,a[35]=Y^~$&aa,a[44]=fa^~ha&ja,a[45]=ga^~ia&ka,a[6]=v^~x&p,a[7]=w^~y&q,a[16]=F^~H&z,a[17]=G^~I&A,a[26]=P^~R&J,a[27]=Q^~S&K,a[36]=Z^~_&T,a[37]=$^~aa&U,a[46]=ha^~ja&ba,a[47]=ia^~ka&ca,a[8]=x^~p&r,a[9]=y^~q&s,a[18]=H^~z&B,a[19]=I^~A&C,a[28]=R^~J&L,a[29]=S^~K&M,a[38]=_^~T&V,a[39]=aa^~U&W,a[48]=ja^~ba&da,a[49]=ka^~ca&ea,a[0]^=m[d],a[1]^=m[d+1]};if(g)b.exports=v;else for(var x=0;x0){if(b.filter.topics.length>1)throw new Error("unsupported topic format");var k=b.filter.topics[0];if("string"!=typeof k||66!==k.length)throw new Error("unsupported topic0 format");c+="&topic0="+k}}catch(l){return Promise.reject(l)}c+=e;var m=this;return i.fetchJSON(c,null,f).then(function(a){var b={},c=Promise.resolve();return a.forEach(function(a){c=c.then(function(){if(null==a.blockHash)return a.blockHash=b[a.transactionHash],null==a.blockHash?m.getTransaction(a.transactionHash).then(function(c){b[a.transactionHash]=c.blockHash,a.blockHash=c.blockHash}):void 0})}),c.then(function(){return a})});case"getEtherPrice":return"homestead"!==this.name?Promise.resolve(0):(c+="/api?module=stats&action=ethprice",c+=e,i.fetchJSON(c,null,f).then(function(a){return parseFloat(a.ethusd)}))}return Promise.reject(new Error("not implemented - "+a))}),j.defineProperty(e.prototype,"getHistory",function(a,b,c){var d=this.baseUrl,e="";return this.apiKey&&(e+="&apikey="+this.apiKey),null==b&&(b=0),null==c&&(c=99999999),this.resolveName(a).then(function(a){return d+="/api?module=account&action=txlist&address="+a,d+="&startblock="+b,d+="&endblock="+c,d+="&sort=asc",i.fetchJSON(d,null,f).then(function(a){var b=[];return a.forEach(function(a){["contractAddress","to"].forEach(function(b){""==a[b]&&delete a[b]}),null==a.creates&&null!=a.contractAddress&&(a.creates=a.contractAddress),b.push(i._formatters.checkTransactionResponse(a))}),b})})}),b.exports=e},{"../utils/convert.js":18,"../utils/properties.js":23,"./provider.js":13}],8:[function(a,b,c){"use strict";function d(a){if(0===a.length)throw new Error("no providers");var b={};if(["chainId","ensAddress","name","testnet"].forEach(function(c){for(var d=1;db+12&&delete e._emitted[a]})),e.emit("block",b);var c={};Object.keys(d).forEach(function(b){var d=B(b);"transaction"===d.type?e.getTransaction(d.hash).then(function(a){a&&null!=a.blockNumber&&(e._emitted["t:"+a.hash.toLowerCase()]=a.blockNumber,e.emit(d.hash,a))}):"address"===d.type?(g[d.address]&&(c[d.address]=g[d.address]),e.getBalance(d.address,"latest").then(function(a){var b=g[d.address];b&&a.eq(b)||(g[d.address]=a,e.emit(d.address,a))})):"topic"===d.type&&e.getLogs({fromBlock:f+1,toBlock:a,topics:d.topic}).then(function(a){0!==a.length&&a.forEach(function(a){e._emitted["b:"+a.blockHash.toLowerCase()]=a.blockNumber,e._emitted["t:"+a.transactionHash.toLowerCase()]=a.blockNumber,e.emit(d.topic,a)})})}),f=a,g=c}}),e.doPoll()}if(!(this instanceof w))throw new Error("missing new");a=w.getNetwork(a);var c=null;a.ensAddress&&(c=F.getAddress(a.ensAddress)),F.defineProperty(this,"chainId",a.chainId),F.defineProperty(this,"ensAddress",c),F.defineProperty(this,"name",a.name);var d={};F.defineProperty(this,"_events",d),F.defineProperty(this,"_emitted",{block:-1});var e=this,f=null,g={};F.defineProperty(this,"resetEventsBlock",function(a){f=a,e.doPoll()});var h=4e3,i=null;Object.defineProperty(this,"polling",{get:function(){return null!=i},set:function(a){setTimeout(function(){a&&!i?i=setInterval(b,h):!a&&i&&(clearInterval(i),i=null)},0)}}),Object.defineProperty(this,"pollingInterval",{get:function(){return h},set:function(a){if("number"!=typeof a||a<=0||parseInt(a)!=a)throw new Error("invalid polling interval");h=a,i&&(clearInterval(i),i=setInterval(b,h))}})}function x(a){return function(b){C(b,a),F.defineProperty(b,"inherits",x(b))}}function y(a,b){return new Promise(function(c,d){function e(){b().then(function(b){if(b||a())c(b);else{f++;var d=500+250*parseInt(Math.random()*(1<1e4&&(d=1e4),setTimeout(e,d)}},function(a){d(a)})}var f=0;e()})}function z(a,b){if(Array.isArray(a)){var c=[];return a.forEach(function(a){c.push(z(a,b))}),c}return b(a)}function A(a){try{return"address:"+F.getAddress(a)}catch(b){}if("block"===a)return"block";if("pending"===a)return"pending";if(F.isHexString(a)){if(66===a.length)return"tx:"+a}else if(Array.isArray(a)){a=z(a,function(a){return null==a&&(a="0x"),a});try{return"topic:"+F.RLP.encode(a)}catch(b){console.log(b)}}throw new Error("invalid event - "+a)}function B(a){if("tx:"===a.substring(0,3))return{type:"transaction",hash:a.substring(3)};if("block"===a)return{type:"block"};if("pending"===a)return{type:"pending"};if("address:"===a.substring(0,8))return{type:"address",address:a.substring(8)};if("topic:"===a.substring(0,6))try{var b=F.RLP.decode(a.substring(6));return b=z(b,function(a){return"0x"===a&&(a=null),a}),{type:"topic",topic:b}}catch(c){console.log(c)}throw new Error("invalid event string")}var C=a("inherits"),D=a("xmlhttprequest").XMLHttpRequest,E=a("./networks.json"),F=function(){var b=a("../utils/convert");return{defineProperty:a("../utils/properties").defineProperty,getAddress:a("../utils/address").getAddress,getContractAddress:a("../utils/contract-address").getContractAddress,bigNumberify:a("../utils/bignumber").bigNumberify,arrayify:b.arrayify,hexlify:b.hexlify,isHexString:b.isHexString,concat:b.concat,hexStripZeros:b.hexStripZeros,stripZeros:b.stripZeros,namehash:a("../utils/namehash"),toUtf8String:a("../utils/utf8").toUtf8String,RLP:a("../utils/rlp")}}(),G={hash:i,parentHash:i,number:j,timestamp:j,nonce:f(F.hexlify),difficulty:k,gasLimit:F.bigNumberify,gasUsed:F.bigNumberify,miner:F.getAddress,extraData:F.hexlify,transactions:f(h(i))},H={hash:i,blockHash:f(i,null),blockNumber:f(j,null),transactionIndex:f(j,null),from:F.getAddress,gasPrice:F.bigNumberify,gasLimit:F.bigNumberify,to:f(F.getAddress,null),value:F.bigNumberify,nonce:j,data:F.hexlify,r:f(m),s:f(m),v:f(j),creates:f(F.getAddress,null),raw:f(F.hexlify)},I={from:f(F.getAddress),nonce:f(j),gasLimit:f(F.bigNumberify),gasPrice:f(F.bigNumberify),to:f(F.getAddress),value:f(F.bigNumberify),data:f(F.hexlify)},J={transactionLogIndex:f(j),transactionIndex:j,blockNumber:j,transactionHash:i,address:F.getAddress,topics:h(i),data:F.hexlify,logIndex:j,blockHash:i},K={contractAddress:f(F.getAddress,null),transactionIndex:j,root:f(i),gasUsed:F.bigNumberify,logsBloom:f(F.hexlify),blockHash:i,transactionHash:i,logs:h(r),blockNumber:j,cumulativeGasUsed:F.bigNumberify,status:f(j)},L={fromBlock:f(n,void 0),toBlock:f(n,void 0),address:f(F.getAddress,void 0),topics:f(t,void 0)},M={blockNumber:f(j),blockHash:f(i),transactionIndex:j,removed:f(l),address:F.getAddress,data:g(F.hexlify,"0x"),topics:h(i),transactionHash:i,logIndex:j};F.defineProperty(w,"inherits",x(w)),F.defineProperty(w,"getNetwork",function(a){if("string"==typeof a){if(a=E[a],!a)throw new Error("unknown network")}else null==a&&(a=E.homestead);if("number"!=typeof a.chainId)throw new Error("invalid chainId");return a}),F.defineProperty(w,"networks",E),F.defineProperty(w,"fetchJSON",function(a,b,c){return new Promise(function(d,e){var f=new D;b?(f.open("POST",a,!0),f.setRequestHeader("Content-Type","application/json")):f.open("GET",a,!0),f.onreadystatechange=function(){if(4===f.readyState){try{var g=JSON.parse(f.responseText)}catch(h){var i=new Error("invalid json response");return i.orginialError=h,i.responseText=f.responseText,i.url=a,void e(i)}if(c)try{g=c(g)}catch(h){return h.url=a,h.body=b,h.responseText=f.responseText,void e(h)}if(200!=f.status){var h=new Error("invalid response - "+f.status);return h.statusCode=f.statusCode,void e(h)}d(g)}},f.onerror=function(a){e(a)};try{b?f.send(b):f.send()}catch(g){var h=new Error("connection error");h.error=g,e(h)}})}),F.defineProperty(w.prototype,"waitForTransaction",function(a,b){var c=this;return new Promise(function(d,e){function f(a){g&&clearTimeout(g),d(a)}var g=null;c.once(a,f),"number"==typeof b&&b>0&&(g=setTimeout(function(){c.removeListener(a,f),e(new Error("timeout"))},b))})}),F.defineProperty(w.prototype,"getBlockNumber",function(){try{return this.perform("getBlockNumber").then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getBlockNumber");return b})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"getGasPrice",function(){try{return this.perform("getGasPrice").then(function(a){return F.bigNumberify(a)})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"getBalance",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getBalance",d).then(function(a){return F.bigNumberify(a)})})}),F.defineProperty(w.prototype,"getTransactionCount",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getTransactionCount",d).then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getTransactionCount");return b})})}),F.defineProperty(w.prototype,"getCode",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getCode",d).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"getStorageAt",function(a,b,c){var d=this;return this.resolveName(a).then(function(a){var e={address:a,blockTag:n(c),position:F.hexStripZeros(F.hexlify(b))};return d.perform("getStorageAt",e).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"sendTransaction",function(a){try{var b={signedTransaction:F.hexlify(a)};return this.perform("sendTransaction",b).then(function(a){if(a=F.hexlify(a),66!==a.length)throw new Error("invalid response - sendTransaction");return a})}catch(c){return Promise.reject(c)}}),F.defineProperty(w.prototype,"call",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:q(a)};return b.perform("call",c).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"estimateGas",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:q(a)};return b.perform("estimateGas",c).then(function(a){return F.bigNumberify(a)})})}),F.defineProperty(w.prototype,"getBlock",function(a){var b=this;try{var c=F.hexlify(a);if(66===c.length)return y(function(){return null==b._emitted["b:"+c.toLowerCase()]},function(){return b.perform("getBlock",{blockHash:c}).then(function(a){return null==a?null:o(a)})})}catch(d){}try{var e=n(a);return y(function(){if(F.isHexString(e)){var a=parseInt(e.substring(2),16);return a>b._emitted.block}return!0},function(){return b.perform("getBlock",{blockTag:e}).then(function(a){return null==a?null:o(a)})})}catch(d){}return Promise.reject(new Error("invalid block hash or block tag"))}),F.defineProperty(w.prototype,"getTransaction",function(a){var b=this;try{var c={transactionHash:i(a)};return y(function(){return null==b._emitted["t:"+a.toLowerCase()]},function(){return b.perform("getTransaction",c).then(function(a){return null!=a&&(a=p(a)),a})})}catch(d){return Promise.reject(d)}}),F.defineProperty(w.prototype,"getTransactionReceipt",function(a){var b=this;try{var c={transactionHash:i(a)};return y(function(){return null==b._emitted["t:"+a.toLowerCase()]},function(){return b.perform("getTransactionReceipt",c).then(function(a){return null!=a&&(a=s(a)),a})})}catch(d){return Promise.reject(d)}}),F.defineProperty(w.prototype,"getLogs",function(a){var b=this;return this._resolveNames(a,["address"]).then(function(a){var c={filter:u(a)};return b.perform("getLogs",c).then(function(a){return h(v)(a)})})}),F.defineProperty(w.prototype,"getEtherPrice",function(){try{return this.perform("getEtherPrice",{}).then(function(a){return a})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"_resolveNames",function(a,b){var c=[],e=d(a);return b.forEach(function(a){void 0!==e[a]&&c.push(this.resolveName(e[a]).then(function(b){e[a]=b}))},this),Promise.all(c).then(function(){return e})}),F.defineProperty(w.prototype,"_getResolver",function(a){var b=F.namehash(a),c="0x0178b8bf"+b.substring(2),d={to:this.ensAddress,data:c};return this.call(d).then(function(a){return 66!=a.length?null:F.getAddress("0x"+a.substring(26))})}),F.defineProperty(w.prototype,"resolveName",function(a){try{return Promise.resolve(F.getAddress(a))}catch(b){}if(!this.ensAddress)throw new Error("network does not have ENS deployed");var c=this,d=F.namehash(a);return this._getResolver(a).then(function(a){var b="0x3b3b57de"+d.substring(2),e={to:a,data:b};return c.call(e)}).then(function(a){if(66!=a.length)return null;var b=F.getAddress("0x"+a.substring(26));return"0x0000000000000000000000000000000000000000"===b?null:b})}),F.defineProperty(w.prototype,"lookupAddress",function(a){if(!this.ensAddress)throw new Error("network does not have ENS deployed");a=F.getAddress(a);var b=a.substring(2)+".addr.reverse",c=F.namehash(b),d=this;return this._getResolver(b).then(function(a){if(!a)return null;var b="0x691f3431"+c.substring(2),e={to:a,data:b};return d.call(e)}).then(function(b){if(b=b.substring(2),b.length<64)return null;if(b=b.substring(64),b.length<64)return null;var c=F.bigNumberify("0x"+b.substring(0,64)).toNumber();if(b=b.substring(64),2*c>b.length)return null;var e=F.toUtf8String("0x"+b.substring(0,2*c));return d.resolveName(e).then(function(b){return b!=a?null:e})})}),F.defineProperty(w.prototype,"doPoll",function(){}),F.defineProperty(w.prototype,"perform",function(a,b){return Promise.reject(new Error("not implemented - "+a))}),F.defineProperty(w.prototype,"_startPending",function(){console.log("WARNING: this provider does not support pending events")}),F.defineProperty(w.prototype,"_stopPending",function(){}),F.defineProperty(w.prototype,"on",function(a,b){var c=A(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"on"}),"pending"===c&&this._startPending(),this.polling=!0}),F.defineProperty(w.prototype,"once",function(a,b){var c=A(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"once"}),"pending"===c&&this._startPending(),this.polling=!0}),F.defineProperty(w.prototype,"emit",function(a){var b=A(a),c=Array.prototype.slice.call(arguments,1),d=this._events[b];if(d){for(var e=0;e>1]>>4>=8&&(a[c]=a[c].toUpperCase()),(15&b[c>>1])>=8&&(a[c+1]=a[c+1].toUpperCase());return"0x"+a.join("")}function e(a){return Math.log10?Math.log10(a):Math.log(a)/Math.LN10}function f(a,b){var c=null;if("string"!=typeof a&&i("invalid address",{input:a}),a.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==a.substring(0,2)&&(a="0x"+a),c=d(a),a.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&c!==a&&i("invalid address checksum",{input:a,expected:c});else if(a.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(a.substring(2,4)!==l(a)&&i("invalid address icap checksum",{input:a}),c=new g(a.substring(4),36).toString(16);c.length<40;)c="0"+c;c=d("0x"+c)}else i("invalid address",{input:a});if(b){for(var e=new g(c.substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e}return c}var g=a("bn.js"),h=a("./convert"),i=a("./throw-error"),j=a("./keccak256"),k=9007199254740991,l=function(){for(var a={},b=0;b<10;b++)a[String(b)]=String(b);for(var b=0;b<26;b++)a[String.fromCharCode(65+b)]=String(10+b);var c=Math.floor(e(k));return function(b){b=b.toUpperCase(),b=b.substring(4)+b.substring(0,2)+"00";for(var d=b.split(""),e=0;e=c;){var f=d.substring(0,c);d=parseInt(f,10)%97+d.substring(f.length)}for(var g=String(98-parseInt(d,10)%97);g.length<2;)g="0"+g;return g}}();b.exports={getAddress:f}},{"./convert":18,"./keccak256":21,"./throw-error":25,"bn.js":1}],16:[function(a,b,c){function d(a){if(!(this instanceof d))throw new Error("missing new");i.isHexString(a)?("0x"==a&&(a="0x0"),a=new g(a.substring(2),16)):"string"==typeof a&&"-"===a[0]&&i.isHexString(a.substring(1))?a=new g(a.substring(3),16).mul(d.constantNegativeOne._bn):"string"==typeof a&&a.match(/^-?[0-9]*$/)?(""==a&&(a="0"),a=new g(a)):"number"==typeof a&&parseInt(a)==a?a=new g(a):g.isBN(a)||(e(a)?a=a._bn:i.isArrayish(a)?a=new g(i.hexlify(a).substring(2),16):j("invalid BigNumber value",{input:a})),h(this,"_bn",a)}function e(a){return a._bn&&a._bn.mod}function f(a){return e(a)?a:new d(a)}var g=a("bn.js"),h=a("./properties").defineProperty,i=a("./convert"),j=a("./throw-error");h(d,"constantNegativeOne",f(-1)),h(d,"constantZero",f(0)),h(d,"constantOne",f(1)),h(d,"constantTwo",f(2)),h(d,"constantWeiPerEther",f(new g("1000000000000000000"))),h(d.prototype,"fromTwos",function(a){return new d(this._bn.fromTwos(a))}),h(d.prototype,"toTwos",function(a){return new d(this._bn.toTwos(a))}),h(d.prototype,"add",function(a){return new d(this._bn.add(f(a)._bn))}),h(d.prototype,"sub",function(a){return new d(this._bn.sub(f(a)._bn))}),h(d.prototype,"div",function(a){return new d(this._bn.div(f(a)._bn))}),h(d.prototype,"mul",function(a){return new d(this._bn.mul(f(a)._bn))}),h(d.prototype,"mod",function(a){return new d(this._bn.mod(f(a)._bn))}),h(d.prototype,"pow",function(a){return new d(this._bn.pow(f(a)._bn))}),h(d.prototype,"maskn",function(a){return new d(this._bn.maskn(a))}),h(d.prototype,"eq",function(a){return this._bn.eq(f(a)._bn)}),h(d.prototype,"lt",function(a){return this._bn.lt(f(a)._bn)}),h(d.prototype,"lte",function(a){return this._bn.lte(f(a)._bn)}),h(d.prototype,"gt",function(a){return this._bn.gt(f(a)._bn)}),h(d.prototype,"gte",function(a){return this._bn.gte(f(a)._bn)}),h(d.prototype,"isZero",function(){return this._bn.isZero()}),h(d.prototype,"toNumber",function(a){return this._bn.toNumber()}),h(d.prototype,"toString",function(){return this._bn.toString(10)}),h(d.prototype,"toHexString",function(){var a=this._bn.toString(16);return a.length%2&&(a="0"+a),"0x"+a}),b.exports={isBigNumber:e,bigNumberify:f,BigNumber:d}},{"./convert":18,"./properties":23,"./throw-error":25,"bn.js":1}],17:[function(a,b,c){function d(a){if(!a.from)throw new Error("missing from address");var b=a.nonce;return e("0x"+g(h.encode([e(a.from),f.stripZeros(f.hexlify(b,"nonce"))])).substring(26))}var e=a("./address").getAddress,f=a("./convert"),g=a("./keccak256"),h=a("./rlp");b.exports={getContractAddress:d}},{"./address":15,"./convert":18,"./keccak256":21,"./rlp":24}],18:[function(a,b,c){function d(a){return a.slice?a:(a.slice=function(){var b=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(a,b))},a)}function e(a){if(!a||parseInt(a.length)!=a.length||"string"==typeof a)return!1;for(var b=0;b=256||parseInt(c)!=c)return!1}return!0}function f(a){if(null==a&&o.throwError("cannot convert null value to array",o.INVALID_ARGUMENT,{arg:"value",value:a}),a&&a.toHexString&&(a=a.toHexString()),j(a)){a=a.substring(2),a.length%2&&(a="0"+a);for(var b=[],c=0;c>4]+p[15&f])}return"0x"+c.join("")}o.throwError("invalid hexlify value",{arg:"value",value:a})}function l(a){for(;a.length>3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function m(a,b){for(;a.length<2*b+2;)a="0x0"+a.substring(2);return a}function n(a){if(a=f(a),65!==a.length)throw new Error("invalid signature");var b=a[64];return 27!==b&&28!==b&&(b=27+b%2),{r:k(a.slice(0,32)),s:k(a.slice(32,64)),v:b}}var o=(a("./properties.js").defineProperty,a("./errors")),p="0123456789abcdef";b.exports={arrayify:f,isArrayish:e,concat:g,padZeros:i,stripZeros:h,splitSignature:n,hexlify:k,isHexString:j,hexStripZeros:l,hexZeroPad:m}},{"./errors":20,"./properties.js":23}],19:[function(a,b,c){b.exports=void 0},{}],20:[function(a,b,c){"use strict";var d=a("./properties").defineProperty,e={};["UNKNOWN_ERROR","NOT_IMPLEMENTED","MISSING_NEW","INVALID_ARGUMENT","MISSING_ARGUMENT","UNEXPECTED_ARGUMENT","UNSUPPORTED_OPERATION"].forEach(function(a){d(e,a,a)}),d(e,"throwError",function(a,b,c){b||(b=e.UNKNOWN_ERROR),c||(c={});var d=[];Object.keys(c).forEach(function(a){d.push(a+"="+JSON.stringify(c[a]))});var f=a;d.length&&(a+=" ("+d.join(", ")+")");var g=new Error(a);throw g.reason=f,g.code=b,Object.keys(c).forEach(function(a){g[a]=c[a]}),g}),d(e,"checkNew",function(a,b){a instanceof b||e.throwError("missing new",e.MISSING_NEW,{name:b.name})}),b.exports=e},{"./properties":23}],21:[function(a,b,c){"use strict";function d(a){return a=f.arrayify(a),"0x"+e.keccak_256(a)}var e=a("js-sha3"),f=a("./convert.js");b.exports=d},{"./convert.js":18,"js-sha3":4}],22:[function(a,b,c){"use strict";function d(a,b){if(a=a.toLowerCase(),!a.match(j))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var c=h,d=0;a.length&&(!b||d>=8;return b}function e(a,b,c){for(var d=0,e=0;eb+1+d)throw new Error("invalid rlp")}return{consumed:1+d,result:e}}function i(a,b){if(0===a.length)throw new Error("invalid rlp data");if(a[b]>=248){var c=a[b]-247;if(b+1+c>a.length)throw new Error("too short");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("to short");return h(a,b,b+1+c,c+d)}if(a[b]>=192){var d=a[b]-192;if(b+1+d>a.length)throw new Error("invalid rlp data");return h(a,b,b+1,d)}if(a[b]>=184){var c=a[b]-183;if(b+1+c>a.length)throw new Error("invalid rlp data");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("invalid rlp data");var f=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){var d=a[b]-128;if(b+1+d>a.offset)throw new Error("invlaid rlp data");var f=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}function j(a){a=k.arrayify(a);var b=i(a,0);if(b.consumed!==a.length)throw new Error("invalid rlp data");return b.result}var k=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":18}],25:[function(a,b,c){"use strict";function d(a,b){var c=new Error(a);for(var d in b)c[d]=b[d];throw c}b.exports=d},{}],26:[function(a,b,c){function d(a){for(var b=[],c=0,d=0;d>6|192,b[c++]=63&e|128):55296==(64512&e)&&d+1>18|240,b[c++]=e>>12&63|128,b[c++]=e>>6&63|128,b[c++]=63&e|128):(b[c++]=e>>12|224,b[c++]=e>>6&63|128,b[c++]=63&e|128)}return f.arrayify(b)}function e(a){a=f.arrayify(a);for(var b="",c=0;c>7!=0){if(d>>6!=2){var e=null;if(d>>5==6)e=1;else if(d>>4==14)e=2;else if(d>>3==30)e=3;else if(d>>2==62)e=4;else{if(d>>1!=126)continue;e=5}if(c+e>a.length){for(;c>6==2;c++);if(c!=a.length)continue;return b}var g,h=d&(1<<8-e-1)-1;for(g=0;g>6!=2)break;h=h<<6|63&i}g==e?h<=65535?b+=String.fromCharCode(h):(h-=65536,b+=String.fromCharCode((h>>10&1023)+55296,(1023&h)+56320)):c--}}else b+=String.fromCharCode(d)}return b}var f=a("./convert.js");b.exports={toUtf8Bytes:d,toUtf8String:e}},{"./convert.js":18}]},{},[9])(9)}); \ No newline at end of file +{div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new f(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new f(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new f(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){return this.divmod(a,"div",!1).div},f.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){var b=this.divmod(a);if(b.mod.isZero())return b.div;var c=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);return f<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(var b=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;return c},f.prototype.idivn=function(a){d(a<=67108863);for(var b=0,c=this.length-1;c>=0;c--){var e=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}return this.strip()},f.prototype.divn=function(a){return this.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=new f(0),i=new f(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(var k=c.clone(),l=b.clone();!b.isZero();){for(var m=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-- >0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(var o=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-- >0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(var i=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-- >0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(var k=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}var m;return m=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var b=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(var d=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);var e=b.cmp(c);if(e<0){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.iushln(d)},f.prototype.invm=function(a){return this.egcd(a).a.umod(a)},f.prototype.isEven=function(){return 0===(1&this.words[0])},f.prototype.isOdd=function(){return 1===(1&this.words[0])},f.prototype.andln=function(a){return this.words[0]&a},f.prototype.bincn=function(a){d("number"==typeof a);var b=a%26,c=(a-b)/26,e=1<>>26,h&=67108863,this.words[g]=h}return 0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){var b=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return 1;this.strip();var c;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");var e=0|this.words[0];c=e===a?0:ea.length)return 1;if(this.length=0;c--){var d=0|this.words[c],e=0|a.words[c];if(d!==e){de&&(b=1);break}}return b},f.prototype.gtn=function(a){return 1===this.cmpn(a)},f.prototype.gt=function(a){return 1===this.cmp(a)},f.prototype.gten=function(a){return this.cmpn(a)>=0},f.prototype.gte=function(a){return this.cmp(a)>=0},f.prototype.ltn=function(a){return this.cmpn(a)===-1},f.prototype.lt=function(a){return this.cmp(a)===-1},f.prototype.lten=function(a){return this.cmpn(a)<=0},f.prototype.lte=function(a){return this.cmp(a)<=0},f.prototype.eqn=function(a){return 0===this.cmpn(a)},f.prototype.eq=function(a){return 0===this.cmp(a)},f.red=function(a){return new s(a)},f.prototype.toRed=function(a){return d(!this.red,"Already a number in reduction context"),d(0===this.negative,"red works only with positives"),a.convertTo(this)._forceRed(a)},f.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(a){return this.red=a,this},f.prototype.forceRed=function(a){return d(!this.red,"Already a number in reduction context"),this._forceRed(a)},f.prototype.redAdd=function(a){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},f.prototype.redIAdd=function(a){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},f.prototype.redSub=function(a){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},f.prototype.redISub=function(a){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},f.prototype.redShl=function(a){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},f.prototype.redMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},f.prototype.redIMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},f.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(a){return d(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var a=new f(null);return a.words=new Array(Math.ceil(this.n/13)),a},n.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b0?c.isub(this.p):c.strip(),c},n.prototype.split=function(a,b){a.iushrn(this.n,0,b)},n.prototype.imulK=function(a){return a.imul(this.k)},e(o,n),o.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;e>>22,f=g}f>>>=22,a.words[e-10]=f,0===f&&a.length>10?a.length-=10:a.length-=9},o.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b=0,c=0;c>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},f._prime=function B(a){if(A[a])return A[a];var B;if("k256"===a)B=new o;else if("p224"===a)B=new p;else if("p192"===a)B=new q;else{if("p25519"!==a)throw new Error("Unknown prime "+a);B=new r}return A[a]=B,B},s.prototype._verify1=function(a){d(0===a.negative,"red works only with positives"),d(a.red,"red works only with red numbers")},s.prototype._verify2=function(a,b){d(0===(a.negative|b.negative),"red works only with positives"),d(a.red&&a.red===b.red,"red works only with red numbers")},s.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:2}],2:[function(a,b,c){},{}],3:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],4:[function(a,b,c){(function(a,c){!function(){"use strict";function d(a,b,c){this.blocks=[],this.s=[],this.padding=b,this.outputBits=c,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(a<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=c>>5,this.extraBytes=(31&c)>>3;for(var d=0;d<50;++d)this.s[d]=0}var e="object"==typeof window?window:{},f=!e.JS_SHA3_NO_NODE_JS&&"object"==typeof a&&a.versions&&a.versions.node;f&&(e=c);for(var g=!e.JS_SHA3_NO_COMMON_JS&&"object"==typeof b&&b.exports,h="0123456789abcdef".split(""),i=[31,7936,2031616,520093696],j=[1,256,65536,16777216],k=[6,1536,393216,100663296],l=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],n=[224,256,384,512],o=[128,256],p=["hex","buffer","arrayBuffer","array"],q=function(a,b,c){return function(e){return new d(a,b,a).update(e)[c]()}},r=function(a,b,c){return function(e,f){return new d(a,b,f).update(e)[c]()}},s=function(a,b){var c=q(a,b,"hex");c.create=function(){return new d(a,b,a)},c.update=function(a){return c.create().update(a)};for(var e=0;e>2]|=a[i]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(f[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=g){for(this.start=c-g,this.block=f[h],c=0;c>2]|=this.padding[3&b],this.lastByteIndex===this.byteCount)for(a[0]=a[c],b=1;b>4&15]+h[15&a]+h[a>>12&15]+h[a>>8&15]+h[a>>20&15]+h[a>>16&15]+h[a>>28&15]+h[a>>24&15];g%b===0&&(C(c),f=0)}return e&&(a=c[f],e>0&&(i+=h[a>>4&15]+h[15&a]),e>1&&(i+=h[a>>12&15]+h[a>>8&15]),e>2&&(i+=h[a>>20&15]+h[a>>16&15])),i},d.prototype.arrayBuffer=function(){this.finalize();var a,b=this.blockCount,c=this.s,d=this.outputBlocks,e=this.extraBytes,f=0,g=0,h=this.outputBits>>3;a=e?new ArrayBuffer(d+1<<2):new ArrayBuffer(h);for(var i=new Uint32Array(a);g>8&255,i[a+2]=b>>16&255,i[a+3]=b>>24&255;h%c===0&&C(d)}return f&&(a=h<<2,b=d[g],f>0&&(i[a]=255&b),f>1&&(i[a+1]=b>>8&255),f>2&&(i[a+2]=b>>16&255)),i};var C=function(a){var b,c,d,e,f,g,h,i,j,k,l,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka;for(d=0;d<48;d+=2)e=a[0]^a[10]^a[20]^a[30]^a[40],f=a[1]^a[11]^a[21]^a[31]^a[41],g=a[2]^a[12]^a[22]^a[32]^a[42],h=a[3]^a[13]^a[23]^a[33]^a[43],i=a[4]^a[14]^a[24]^a[34]^a[44],j=a[5]^a[15]^a[25]^a[35]^a[45],k=a[6]^a[16]^a[26]^a[36]^a[46],l=a[7]^a[17]^a[27]^a[37]^a[47],n=a[8]^a[18]^a[28]^a[38]^a[48],o=a[9]^a[19]^a[29]^a[39]^a[49],b=n^(g<<1|h>>>31),c=o^(h<<1|g>>>31),a[0]^=b,a[1]^=c,a[10]^=b,a[11]^=c,a[20]^=b,a[21]^=c,a[30]^=b,a[31]^=c,a[40]^=b,a[41]^=c,b=e^(i<<1|j>>>31),c=f^(j<<1|i>>>31),a[2]^=b,a[3]^=c,a[12]^=b,a[13]^=c,a[22]^=b,a[23]^=c,a[32]^=b,a[33]^=c,a[42]^=b,a[43]^=c,b=g^(k<<1|l>>>31),c=h^(l<<1|k>>>31),a[4]^=b,a[5]^=c,a[14]^=b,a[15]^=c,a[24]^=b,a[25]^=c,a[34]^=b,a[35]^=c,a[44]^=b,a[45]^=c,b=i^(n<<1|o>>>31),c=j^(o<<1|n>>>31),a[6]^=b,a[7]^=c,a[16]^=b,a[17]^=c,a[26]^=b,a[27]^=c,a[36]^=b,a[37]^=c,a[46]^=b,a[47]^=c,b=k^(e<<1|f>>>31),c=l^(f<<1|e>>>31),a[8]^=b,a[9]^=c,a[18]^=b,a[19]^=c,a[28]^=b,a[29]^=c,a[38]^=b,a[39]^=c,a[48]^=b,a[49]^=c,p=a[0],q=a[1],V=a[11]<<4|a[10]>>>28,W=a[10]<<4|a[11]>>>28,D=a[20]<<3|a[21]>>>29,E=a[21]<<3|a[20]>>>29,ha=a[31]<<9|a[30]>>>23,ia=a[30]<<9|a[31]>>>23,R=a[40]<<18|a[41]>>>14,S=a[41]<<18|a[40]>>>14,J=a[2]<<1|a[3]>>>31,K=a[3]<<1|a[2]>>>31,r=a[13]<<12|a[12]>>>20,s=a[12]<<12|a[13]>>>20,X=a[22]<<10|a[23]>>>22,Y=a[23]<<10|a[22]>>>22,F=a[33]<<13|a[32]>>>19,G=a[32]<<13|a[33]>>>19,ja=a[42]<<2|a[43]>>>30,ka=a[43]<<2|a[42]>>>30,ba=a[5]<<30|a[4]>>>2,ca=a[4]<<30|a[5]>>>2,L=a[14]<<6|a[15]>>>26,M=a[15]<<6|a[14]>>>26,t=a[25]<<11|a[24]>>>21,u=a[24]<<11|a[25]>>>21,Z=a[34]<<15|a[35]>>>17,$=a[35]<<15|a[34]>>>17,H=a[45]<<29|a[44]>>>3,I=a[44]<<29|a[45]>>>3,z=a[6]<<28|a[7]>>>4,A=a[7]<<28|a[6]>>>4,da=a[17]<<23|a[16]>>>9,ea=a[16]<<23|a[17]>>>9,N=a[26]<<25|a[27]>>>7,O=a[27]<<25|a[26]>>>7,v=a[36]<<21|a[37]>>>11,w=a[37]<<21|a[36]>>>11,_=a[47]<<24|a[46]>>>8,aa=a[46]<<24|a[47]>>>8,T=a[8]<<27|a[9]>>>5,U=a[9]<<27|a[8]>>>5,B=a[18]<<20|a[19]>>>12,C=a[19]<<20|a[18]>>>12,fa=a[29]<<7|a[28]>>>25,ga=a[28]<<7|a[29]>>>25,P=a[38]<<8|a[39]>>>24,Q=a[39]<<8|a[38]>>>24,x=a[48]<<14|a[49]>>>18,y=a[49]<<14|a[48]>>>18,a[0]=p^~r&t,a[1]=q^~s&u,a[10]=z^~B&D,a[11]=A^~C&E,a[20]=J^~L&N,a[21]=K^~M&O,a[30]=T^~V&X,a[31]=U^~W&Y,a[40]=ba^~da&fa,a[41]=ca^~ea&ga,a[2]=r^~t&v,a[3]=s^~u&w,a[12]=B^~D&F,a[13]=C^~E&G,a[22]=L^~N&P,a[23]=M^~O&Q,a[32]=V^~X&Z,a[33]=W^~Y&$,a[42]=da^~fa&ha,a[43]=ea^~ga&ia,a[4]=t^~v&x,a[5]=u^~w&y,a[14]=D^~F&H,a[15]=E^~G&I,a[24]=N^~P&R,a[25]=O^~Q&S,a[34]=X^~Z&_,a[35]=Y^~$&aa,a[44]=fa^~ha&ja,a[45]=ga^~ia&ka,a[6]=v^~x&p,a[7]=w^~y&q,a[16]=F^~H&z,a[17]=G^~I&A,a[26]=P^~R&J,a[27]=Q^~S&K,a[36]=Z^~_&T,a[37]=$^~aa&U,a[46]=ha^~ja&ba,a[47]=ia^~ka&ca,a[8]=x^~p&r,a[9]=y^~q&s,a[18]=H^~z&B,a[19]=I^~A&C,a[28]=R^~J&L,a[29]=S^~K&M,a[38]=_^~T&V,a[39]=aa^~U&W,a[48]=ja^~ba&da,a[49]=ka^~ca&ea,a[0]^=m[d],a[1]^=m[d+1]};if(g)b.exports=v;else for(var x=0;x0){if(b.filter.topics.length>1)throw new Error("unsupported topic format");var k=b.filter.topics[0];if("string"!=typeof k||66!==k.length)throw new Error("unsupported topic0 format");c+="&topic0="+k}}catch(l){return Promise.reject(l)}c+=e;var m=this;return i.fetchJSON(c,null,f).then(function(a){var b={},c=Promise.resolve();return a.forEach(function(a){c=c.then(function(){if(null==a.blockHash)return a.blockHash=b[a.transactionHash],null==a.blockHash?m.getTransaction(a.transactionHash).then(function(c){b[a.transactionHash]=c.blockHash,a.blockHash=c.blockHash}):void 0})}),c.then(function(){return a})});case"getEtherPrice":return"homestead"!==this.name?Promise.resolve(0):(c+="/api?module=stats&action=ethprice",c+=e,i.fetchJSON(c,null,f).then(function(a){return parseFloat(a.ethusd)}))}return Promise.reject(new Error("not implemented - "+a))}),j.defineProperty(e.prototype,"getHistory",function(a,b,c){var d=this.baseUrl,e="";return this.apiKey&&(e+="&apikey="+this.apiKey),null==b&&(b=0),null==c&&(c=99999999),this.resolveName(a).then(function(a){return d+="/api?module=account&action=txlist&address="+a,d+="&startblock="+b,d+="&endblock="+c,d+="&sort=asc",i.fetchJSON(d,null,f).then(function(a){var b=[];return a.forEach(function(a){["contractAddress","to"].forEach(function(b){""==a[b]&&delete a[b]}),null==a.creates&&null!=a.contractAddress&&(a.creates=a.contractAddress),b.push(i._formatters.checkTransactionResponse(a))}),b})})}),b.exports=e},{"../utils/convert.js":19,"../utils/properties.js":24,"./provider.js":13}],8:[function(a,b,c){"use strict";function d(a){if(0===a.length)throw new Error("no providers");var b={};if(["chainId","ensAddress","name","testnet"].forEach(function(c){for(var d=1;db+12&&delete e._emitted[a]})),e.emit("block",b);var c={};Object.keys(d).forEach(function(b){var d=B(b);"transaction"===d.type?e.getTransaction(d.hash).then(function(a){a&&null!=a.blockNumber&&(e._emitted["t:"+a.hash.toLowerCase()]=a.blockNumber,e.emit(d.hash,a))}):"address"===d.type?(g[d.address]&&(c[d.address]=g[d.address]),e.getBalance(d.address,"latest").then(function(a){var b=g[d.address];b&&a.eq(b)||(g[d.address]=a,e.emit(d.address,a))})):"topic"===d.type&&e.getLogs({fromBlock:f+1,toBlock:a,topics:d.topic}).then(function(a){0!==a.length&&a.forEach(function(a){e._emitted["b:"+a.blockHash.toLowerCase()]=a.blockNumber,e._emitted["t:"+a.transactionHash.toLowerCase()]=a.blockNumber,e.emit(d.topic,a)})})}),f=a,g=c}}),e.doPoll()}if(!(this instanceof w))throw new Error("missing new");a=w.getNetwork(a);var c=null;a.ensAddress&&(c=F.getAddress(a.ensAddress)),F.defineProperty(this,"chainId",a.chainId),F.defineProperty(this,"ensAddress",c),F.defineProperty(this,"name",a.name);var d={};F.defineProperty(this,"_events",d),F.defineProperty(this,"_emitted",{block:-1});var e=this,f=null,g={};F.defineProperty(this,"resetEventsBlock",function(a){f=a,e.doPoll()});var h=4e3,i=null;Object.defineProperty(this,"polling",{get:function(){return null!=i},set:function(a){setTimeout(function(){a&&!i?i=setInterval(b,h):!a&&i&&(clearInterval(i),i=null)},0)}}),Object.defineProperty(this,"pollingInterval",{get:function(){return h},set:function(a){if("number"!=typeof a||a<=0||parseInt(a)!=a)throw new Error("invalid polling interval");h=a,i&&(clearInterval(i),i=setInterval(b,h))}})}function x(a){return function(b){C(b,a),F.defineProperty(b,"inherits",x(b))}}function y(a,b){return new Promise(function(c,d){function e(){b().then(function(b){if(b||a())c(b);else{f++;var d=500+250*parseInt(Math.random()*(1<1e4&&(d=1e4),setTimeout(e,d)}},function(a){d(a)})}var f=0;e()})}function z(a,b){if(Array.isArray(a)){var c=[];return a.forEach(function(a){c.push(z(a,b))}),c}return b(a)}function A(a){try{return"address:"+F.getAddress(a)}catch(b){}if("block"===a)return"block";if("pending"===a)return"pending";if(F.isHexString(a)){if(66===a.length)return"tx:"+a}else if(Array.isArray(a)){a=z(a,function(a){return null==a&&(a="0x"),a});try{return"topic:"+F.RLP.encode(a)}catch(b){console.log(b)}}throw new Error("invalid event - "+a)}function B(a){if("tx:"===a.substring(0,3))return{type:"transaction",hash:a.substring(3)};if("block"===a)return{type:"block"};if("pending"===a)return{type:"pending"};if("address:"===a.substring(0,8))return{type:"address",address:a.substring(8)};if("topic:"===a.substring(0,6))try{var b=F.RLP.decode(a.substring(6));return b=z(b,function(a){return"0x"===a&&(a=null),a}),{type:"topic",topic:b}}catch(c){console.log(c)}throw new Error("invalid event string")}var C=a("inherits"),D=a("xmlhttprequest").XMLHttpRequest,E=a("./networks.json"),F=function(){var b=a("../utils/convert"),c=a("../utils/utf8");return{defineProperty:a("../utils/properties").defineProperty,getAddress:a("../utils/address").getAddress,getContractAddress:a("../utils/contract-address").getContractAddress,bigNumberify:a("../utils/bignumber").bigNumberify,arrayify:b.arrayify,hexlify:b.hexlify,isHexString:b.isHexString,concat:b.concat,hexStripZeros:b.hexStripZeros,stripZeros:b.stripZeros,base64:a("../utils/base64"),namehash:a("../utils/namehash"),toUtf8String:c.toUtf8String,toUtf8Bytes:c.toUtf8Bytes,RLP:a("../utils/rlp")}}(),G=a("../utils/errors"),H={hash:i,parentHash:i,number:j,timestamp:j,nonce:f(F.hexlify),difficulty:k,gasLimit:F.bigNumberify,gasUsed:F.bigNumberify,miner:F.getAddress,extraData:F.hexlify,transactions:f(h(i))},I={hash:i,blockHash:f(i,null),blockNumber:f(j,null),transactionIndex:f(j,null),from:F.getAddress,gasPrice:F.bigNumberify,gasLimit:F.bigNumberify,to:f(F.getAddress,null),value:F.bigNumberify,nonce:j,data:F.hexlify,r:f(m),s:f(m),v:f(j),creates:f(F.getAddress,null),raw:f(F.hexlify)},J={from:f(F.getAddress),nonce:f(j),gasLimit:f(F.bigNumberify),gasPrice:f(F.bigNumberify),to:f(F.getAddress),value:f(F.bigNumberify),data:f(F.hexlify)},K={transactionLogIndex:f(j),transactionIndex:j,blockNumber:j,transactionHash:i,address:F.getAddress,topics:h(i),data:F.hexlify,logIndex:j,blockHash:i},L={contractAddress:f(F.getAddress,null),transactionIndex:j,root:f(i),gasUsed:F.bigNumberify,logsBloom:f(F.hexlify),blockHash:i,transactionHash:i,logs:h(r),blockNumber:j,cumulativeGasUsed:F.bigNumberify,status:f(j)},M={fromBlock:f(n,void 0),toBlock:f(n,void 0),address:f(F.getAddress,void 0),topics:f(t,void 0)},N={blockNumber:f(j),blockHash:f(i),transactionIndex:j,removed:f(l),address:F.getAddress,data:g(F.hexlify,"0x"),topics:h(i),transactionHash:i,logIndex:j};F.defineProperty(w,"inherits",x(w)),F.defineProperty(w,"getNetwork",function(a){if("string"==typeof a){if(a=E[a],!a)throw new Error("unknown network")}else null==a&&(a=E.homestead);if("number"!=typeof a.chainId)throw new Error("invalid chainId");return a}),F.defineProperty(w,"networks",E),F.defineProperty(w,"fetchJSON",function(a,b,c){var d=[];if("object"==typeof a&&null!=a.url&&null!=a.user&&null!=a.password){"https:"!==a.url.substring(0,6)&&a.forceInsecure!==!0&&G.throwError("basic authentication requires a secure https url",G.INVALID_ARGUMENT,{arg:"url",url:a.url,user:a.user,password:"[REDACTED]"});var e=a.user+":"+a.password;d.push({key:"Authorization",value:"Basic "+F.base64.encode(F.toUtf8Bytes(e))}),a=a.url}return new Promise(function(e,f){var g=new D;b?(g.open("POST",a,!0),d.push({key:"Content-Type",value:"application/json"})):g.open("GET",a,!0),d.forEach(function(a){g.setRequestHeader(a.key,a.value)}),g.onreadystatechange=function(){if(4===g.readyState){try{var d=JSON.parse(g.responseText)}catch(h){var i=new Error("invalid json response");return i.orginialError=h,i.responseText=g.responseText,i.url=a,void f(i)}if(c)try{d=c(d)}catch(h){return h.url=a,h.body=b,h.responseText=g.responseText,void f(h)}if(200!=g.status){var h=new Error("invalid response - "+g.status);return h.statusCode=g.statusCode,void f(h)}e(d)}},g.onerror=function(a){f(a)};try{b?g.send(b):g.send()}catch(h){var i=new Error("connection error");i.error=h,f(i)}})}),F.defineProperty(w.prototype,"waitForTransaction",function(a,b){var c=this;return new Promise(function(d,e){function f(a){g&&clearTimeout(g),d(a)}var g=null;c.once(a,f),"number"==typeof b&&b>0&&(g=setTimeout(function(){c.removeListener(a,f),e(new Error("timeout"))},b))})}),F.defineProperty(w.prototype,"getBlockNumber",function(){try{return this.perform("getBlockNumber").then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getBlockNumber");return b})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"getGasPrice",function(){try{return this.perform("getGasPrice").then(function(a){return F.bigNumberify(a)})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"getBalance",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getBalance",d).then(function(a){return F.bigNumberify(a)})})}),F.defineProperty(w.prototype,"getTransactionCount",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getTransactionCount",d).then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getTransactionCount");return b})})}),F.defineProperty(w.prototype,"getCode",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getCode",d).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"getStorageAt",function(a,b,c){var d=this;return this.resolveName(a).then(function(a){var e={address:a,blockTag:n(c),position:F.hexStripZeros(F.hexlify(b))};return d.perform("getStorageAt",e).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"sendTransaction",function(a){try{var b={signedTransaction:F.hexlify(a)};return this.perform("sendTransaction",b).then(function(a){if(a=F.hexlify(a),66!==a.length)throw new Error("invalid response - sendTransaction");return a})}catch(c){return Promise.reject(c)}}),F.defineProperty(w.prototype,"call",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:q(a)};return b.perform("call",c).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"estimateGas",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:q(a)};return b.perform("estimateGas",c).then(function(a){return F.bigNumberify(a)})})}),F.defineProperty(w.prototype,"getBlock",function(a){var b=this;try{var c=F.hexlify(a);if(66===c.length)return y(function(){return null==b._emitted["b:"+c.toLowerCase()]},function(){return b.perform("getBlock",{blockHash:c}).then(function(a){return null==a?null:o(a)})})}catch(d){}try{var e=n(a);return y(function(){if(F.isHexString(e)){var a=parseInt(e.substring(2),16);return a>b._emitted.block}return!0},function(){return b.perform("getBlock",{blockTag:e}).then(function(a){return null==a?null:o(a)})})}catch(d){}return Promise.reject(new Error("invalid block hash or block tag"))}),F.defineProperty(w.prototype,"getTransaction",function(a){var b=this;try{var c={transactionHash:i(a)};return y(function(){return null==b._emitted["t:"+a.toLowerCase()]},function(){return b.perform("getTransaction",c).then(function(a){return null!=a&&(a=p(a)),a})})}catch(d){return Promise.reject(d)}}),F.defineProperty(w.prototype,"getTransactionReceipt",function(a){var b=this;try{var c={transactionHash:i(a)};return y(function(){return null==b._emitted["t:"+a.toLowerCase()]},function(){return b.perform("getTransactionReceipt",c).then(function(a){return null!=a&&(a=s(a)),a})})}catch(d){return Promise.reject(d)}}),F.defineProperty(w.prototype,"getLogs",function(a){var b=this;return this._resolveNames(a,["address"]).then(function(a){var c={filter:u(a)};return b.perform("getLogs",c).then(function(a){return h(v)(a)})})}),F.defineProperty(w.prototype,"getEtherPrice",function(){try{return this.perform("getEtherPrice",{}).then(function(a){return a})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"_resolveNames",function(a,b){var c=[],e=d(a);return b.forEach(function(a){void 0!==e[a]&&c.push(this.resolveName(e[a]).then(function(b){e[a]=b}))},this),Promise.all(c).then(function(){return e})}),F.defineProperty(w.prototype,"_getResolver",function(a){var b=F.namehash(a),c="0x0178b8bf"+b.substring(2),d={to:this.ensAddress,data:c};return this.call(d).then(function(a){return 66!=a.length?null:F.getAddress("0x"+a.substring(26))})}),F.defineProperty(w.prototype,"resolveName",function(a){try{return Promise.resolve(F.getAddress(a))}catch(b){}if(!this.ensAddress)throw new Error("network does not have ENS deployed");var c=this,d=F.namehash(a);return this._getResolver(a).then(function(a){var b="0x3b3b57de"+d.substring(2),e={to:a,data:b};return c.call(e)}).then(function(a){if(66!=a.length)return null;var b=F.getAddress("0x"+a.substring(26));return"0x0000000000000000000000000000000000000000"===b?null:b})}),F.defineProperty(w.prototype,"lookupAddress",function(a){if(!this.ensAddress)throw new Error("network does not have ENS deployed");a=F.getAddress(a);var b=a.substring(2)+".addr.reverse",c=F.namehash(b),d=this;return this._getResolver(b).then(function(a){if(!a)return null;var b="0x691f3431"+c.substring(2),e={to:a,data:b};return d.call(e)}).then(function(b){if(b=b.substring(2),b.length<64)return null;if(b=b.substring(64),b.length<64)return null;var c=F.bigNumberify("0x"+b.substring(0,64)).toNumber();if(b=b.substring(64),2*c>b.length)return null;var e=F.toUtf8String("0x"+b.substring(0,2*c));return d.resolveName(e).then(function(b){return b!=a?null:e})})}),F.defineProperty(w.prototype,"doPoll",function(){}),F.defineProperty(w.prototype,"perform",function(a,b){return Promise.reject(new Error("not implemented - "+a))}),F.defineProperty(w.prototype,"_startPending",function(){console.log("WARNING: this provider does not support pending events")}),F.defineProperty(w.prototype,"_stopPending",function(){}),F.defineProperty(w.prototype,"on",function(a,b){var c=A(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"on"}),"pending"===c&&this._startPending(),this.polling=!0}),F.defineProperty(w.prototype,"once",function(a,b){var c=A(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"once"}),"pending"===c&&this._startPending(),this.polling=!0}),F.defineProperty(w.prototype,"emit",function(a){var b=A(a),c=Array.prototype.slice.call(arguments,1),d=this._events[b];if(d){for(var e=0;e>1]>>4>=8&&(a[c]=a[c].toUpperCase()),(15&b[c>>1])>=8&&(a[c+1]=a[c+1].toUpperCase());return"0x"+a.join("")}function e(a){return Math.log10?Math.log10(a):Math.log(a)/Math.LN10}function f(a,b){var c=null;if("string"!=typeof a&&i("invalid address",{input:a}),a.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==a.substring(0,2)&&(a="0x"+a),c=d(a),a.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&c!==a&&i("invalid address checksum",{input:a,expected:c});else if(a.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(a.substring(2,4)!==l(a)&&i("invalid address icap checksum",{input:a}),c=new g(a.substring(4),36).toString(16);c.length<40;)c="0"+c;c=d("0x"+c)}else i("invalid address",{input:a});if(b){for(var e=new g(c.substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e}return c}var g=a("bn.js"),h=a("./convert"),i=a("./throw-error"),j=a("./keccak256"),k=9007199254740991,l=function(){for(var a={},b=0;b<10;b++)a[String(b)]=String(b);for(var b=0;b<26;b++)a[String.fromCharCode(65+b)]=String(10+b);var c=Math.floor(e(k));return function(b){b=b.toUpperCase(),b=b.substring(4)+b.substring(0,2)+"00";for(var d=b.split(""),e=0;e=c;){var f=d.substring(0,c);d=parseInt(f,10)%97+d.substring(f.length)}for(var g=String(98-parseInt(d,10)%97);g.length<2;)g="0"+g;return g}}();b.exports={getAddress:f}},{"./convert":19,"./keccak256":22,"./throw-error":26,"bn.js":1}],16:[function(a,b,c){function d(a){if(!(this instanceof d))throw new Error("missing new");i.isHexString(a)?("0x"==a&&(a="0x0"),a=new g(a.substring(2),16)):"string"==typeof a&&"-"===a[0]&&i.isHexString(a.substring(1))?a=new g(a.substring(3),16).mul(d.constantNegativeOne._bn):"string"==typeof a&&a.match(/^-?[0-9]*$/)?(""==a&&(a="0"),a=new g(a)):"number"==typeof a&&parseInt(a)==a?a=new g(a):g.isBN(a)||(e(a)?a=a._bn:i.isArrayish(a)?a=new g(i.hexlify(a).substring(2),16):j("invalid BigNumber value",{input:a})),h(this,"_bn",a)}function e(a){return a._bn&&a._bn.mod}function f(a){return e(a)?a:new d(a)}var g=a("bn.js"),h=a("./properties").defineProperty,i=a("./convert"),j=a("./throw-error");h(d,"constantNegativeOne",f(-1)),h(d,"constantZero",f(0)),h(d,"constantOne",f(1)),h(d,"constantTwo",f(2)),h(d,"constantWeiPerEther",f(new g("1000000000000000000"))),h(d.prototype,"fromTwos",function(a){return new d(this._bn.fromTwos(a))}),h(d.prototype,"toTwos",function(a){return new d(this._bn.toTwos(a))}),h(d.prototype,"add",function(a){return new d(this._bn.add(f(a)._bn))}),h(d.prototype,"sub",function(a){return new d(this._bn.sub(f(a)._bn))}),h(d.prototype,"div",function(a){return new d(this._bn.div(f(a)._bn))}),h(d.prototype,"mul",function(a){return new d(this._bn.mul(f(a)._bn))}),h(d.prototype,"mod",function(a){return new d(this._bn.mod(f(a)._bn))}),h(d.prototype,"pow",function(a){return new d(this._bn.pow(f(a)._bn))}),h(d.prototype,"maskn",function(a){return new d(this._bn.maskn(a))}),h(d.prototype,"eq",function(a){return this._bn.eq(f(a)._bn)}),h(d.prototype,"lt",function(a){return this._bn.lt(f(a)._bn)}),h(d.prototype,"lte",function(a){return this._bn.lte(f(a)._bn)}),h(d.prototype,"gt",function(a){return this._bn.gt(f(a)._bn)}),h(d.prototype,"gte",function(a){return this._bn.gte(f(a)._bn)}),h(d.prototype,"isZero",function(){return this._bn.isZero()}),h(d.prototype,"toNumber",function(a){return this._bn.toNumber()}),h(d.prototype,"toString",function(){return this._bn.toString(10)}),h(d.prototype,"toHexString",function(){var a=this._bn.toString(16);return a.length%2&&(a="0"+a),"0x"+a}),b.exports={isBigNumber:e,bigNumberify:f,BigNumber:d}},{"./convert":19,"./properties":24,"./throw-error":26,"bn.js":1}],17:[function(a,b,c){"use strict";var d=a("./convert");b.exports={decode:function(a){a=atob(a);for(var b=[],c=0;c=256||parseInt(c)!=c)return!1}return!0}function f(a){if(null==a&&o.throwError("cannot convert null value to array",o.INVALID_ARGUMENT,{arg:"value",value:a}),a&&a.toHexString&&(a=a.toHexString()),j(a)){a=a.substring(2),a.length%2&&(a="0"+a);for(var b=[],c=0;c>4]+p[15&f])}return"0x"+c.join("")}o.throwError("invalid hexlify value",{arg:"value",value:a})}function l(a){for(;a.length>3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function m(a,b){for(;a.length<2*b+2;)a="0x0"+a.substring(2);return a}function n(a){if(a=f(a),65!==a.length)throw new Error("invalid signature");var b=a[64];return 27!==b&&28!==b&&(b=27+b%2),{r:k(a.slice(0,32)),s:k(a.slice(32,64)),v:b}}var o=(a("./properties.js").defineProperty,a("./errors")),p="0123456789abcdef";b.exports={arrayify:f,isArrayish:e,concat:g,padZeros:i,stripZeros:h,splitSignature:n,hexlify:k,isHexString:j,hexStripZeros:l,hexZeroPad:m}},{"./errors":21,"./properties.js":24}],20:[function(a,b,c){b.exports=void 0},{}],21:[function(a,b,c){"use strict";var d=a("./properties").defineProperty,e={};["UNKNOWN_ERROR","NOT_IMPLEMENTED","MISSING_NEW","INVALID_ARGUMENT","MISSING_ARGUMENT","UNEXPECTED_ARGUMENT","UNSUPPORTED_OPERATION"].forEach(function(a){d(e,a,a)}),d(e,"throwError",function(a,b,c){b||(b=e.UNKNOWN_ERROR),c||(c={});var d=[];Object.keys(c).forEach(function(a){d.push(a+"="+JSON.stringify(c[a]))});var f=a;d.length&&(a+=" ("+d.join(", ")+")");var g=new Error(a);throw g.reason=f,g.code=b,Object.keys(c).forEach(function(a){g[a]=c[a]}),g}),d(e,"checkNew",function(a,b){a instanceof b||e.throwError("missing new",e.MISSING_NEW,{name:b.name})}),b.exports=e},{"./properties":24}],22:[function(a,b,c){"use strict";function d(a){return a=f.arrayify(a),"0x"+e.keccak_256(a)}var e=a("js-sha3"),f=a("./convert.js");b.exports=d},{"./convert.js":19,"js-sha3":4}],23:[function(a,b,c){"use strict";function d(a,b){if(a=a.toLowerCase(),!a.match(j))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var c=h,d=0;a.length&&(!b||d>=8;return b}function e(a,b,c){for(var d=0,e=0;eb+1+d)throw new Error("invalid rlp")}return{consumed:1+d,result:e}}function i(a,b){if(0===a.length)throw new Error("invalid rlp data");if(a[b]>=248){var c=a[b]-247;if(b+1+c>a.length)throw new Error("too short");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("to short");return h(a,b,b+1+c,c+d)}if(a[b]>=192){var d=a[b]-192;if(b+1+d>a.length)throw new Error("invalid rlp data");return h(a,b,b+1,d)}if(a[b]>=184){var c=a[b]-183;if(b+1+c>a.length)throw new Error("invalid rlp data");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("invalid rlp data");var f=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){var d=a[b]-128;if(b+1+d>a.offset)throw new Error("invlaid rlp data");var f=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}function j(a){a=k.arrayify(a);var b=i(a,0);if(b.consumed!==a.length)throw new Error("invalid rlp data");return b.result}var k=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":19}],26:[function(a,b,c){"use strict";function d(a,b){var c=new Error(a);for(var d in b)c[d]=b[d];throw c}b.exports=d},{}],27:[function(a,b,c){function d(a){for(var b=[],c=0,d=0;d>6|192,b[c++]=63&e|128):55296==(64512&e)&&d+1>18|240,b[c++]=e>>12&63|128,b[c++]=e>>6&63|128,b[c++]=63&e|128):(b[c++]=e>>12|224,b[c++]=e>>6&63|128,b[c++]=63&e|128)}return f.arrayify(b)}function e(a){a=f.arrayify(a);for(var b="",c=0;c>7!=0){if(d>>6!=2){var e=null;if(d>>5==6)e=1;else if(d>>4==14)e=2;else if(d>>3==30)e=3;else if(d>>2==62)e=4;else{if(d>>1!=126)continue;e=5}if(c+e>a.length){for(;c>6==2;c++);if(c!=a.length)continue;return b}var g,h=d&(1<<8-e-1)-1;for(g=0;g>6!=2)break;h=h<<6|63&i}g==e?h<=65535?b+=String.fromCharCode(h):(h-=65536,b+=String.fromCharCode((h>>10&1023)+55296,(1023&h)+56320)):c--}}else b+=String.fromCharCode(d)}return b}var f=a("./convert.js");b.exports={toUtf8Bytes:d,toUtf8String:e}},{"./convert.js":19}]},{},[9])(9)}); \ No newline at end of file diff --git a/dist/ethers-utils.js b/dist/ethers-utils.js index 287470a7e..0dfa44a2b 100644 --- a/dist/ethers-utils.js +++ b/dist/ethers-utils.js @@ -5412,7 +5412,7 @@ utils.defineProperty(Coder, 'defaultCoder', new Coder()); module.exports = Coder -},{"../utils/address":20,"../utils/bignumber.js":21,"../utils/convert.js":24,"../utils/properties.js":30,"../utils/throw-error":34,"../utils/utf8.js":36}],20:[function(require,module,exports){ +},{"../utils/address":20,"../utils/bignumber.js":21,"../utils/convert.js":25,"../utils/properties.js":31,"../utils/throw-error":35,"../utils/utf8.js":37}],20:[function(require,module,exports){ var BN = require('bn.js'); @@ -5538,7 +5538,7 @@ module.exports = { getAddress: getAddress, } -},{"./convert":24,"./keccak256":28,"./throw-error":34,"bn.js":1}],21:[function(require,module,exports){ +},{"./convert":25,"./keccak256":29,"./throw-error":35,"bn.js":1}],21:[function(require,module,exports){ /** * BigNumber * @@ -5689,7 +5689,33 @@ module.exports = { BigNumber: BigNumber }; -},{"./convert":24,"./properties":30,"./throw-error":34,"bn.js":1}],22:[function(require,module,exports){ +},{"./convert":25,"./properties":31,"./throw-error":35,"bn.js":1}],22:[function(require,module,exports){ +'use strict'; + +var convert = require('./convert'); + +module.exports = { + decode: function(textData) { + textData = atob(textData); + var data = []; + for (var i = 0; i < textData.length; i++) { + data.push(textData.charCodeAt(i)); + } + return convert.arrayify(data); + }, + encode: function(data) { + data = convert.arrayify(data); + var textData = ''; + for (var i = 0; i < data.length; i++) { + textData += String.fromCharCode(data[i]); + } + return btoa(textData); + } +}; + + + +},{"./convert":25}],23:[function(require,module,exports){ (function (global){ 'use strict'; @@ -5736,7 +5762,7 @@ if (crypto._weakCrypto === true) { module.exports = randomBytes; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./convert":24,"./properties":30}],23:[function(require,module,exports){ +},{"./convert":25,"./properties":31}],24:[function(require,module,exports){ var getAddress = require('./address').getAddress; var convert = require('./convert'); @@ -5758,7 +5784,7 @@ module.exports = { getContractAddress: getContractAddress, } -},{"./address":20,"./convert":24,"./keccak256":28,"./rlp":31}],24:[function(require,module,exports){ +},{"./address":20,"./convert":25,"./keccak256":29,"./rlp":32}],25:[function(require,module,exports){ /** * Conversion Utilities * @@ -5984,7 +6010,7 @@ module.exports = { hexZeroPad: hexZeroPad, }; -},{"./errors":25,"./properties.js":30}],25:[function(require,module,exports){ +},{"./errors":26,"./properties.js":31}],26:[function(require,module,exports){ 'use strict'; var defineProperty = require('./properties').defineProperty; @@ -6057,7 +6083,7 @@ defineProperty(codes, 'checkNew', function(self, kind) { module.exports = codes; -},{"./properties":30}],26:[function(require,module,exports){ +},{"./properties":31}],27:[function(require,module,exports){ 'use strict'; var keccak256 = require('./keccak256'); @@ -6069,7 +6095,7 @@ function id(text) { module.exports = id; -},{"./keccak256":28,"./utf8":36}],27:[function(require,module,exports){ +},{"./keccak256":29,"./utf8":37}],28:[function(require,module,exports){ 'use strict'; // This is SUPER useful, but adds 140kb (even zipped, adds 40kb) @@ -6077,6 +6103,7 @@ module.exports = id; var address = require('./address'); var AbiCoder = require('./abi-coder'); +var base64 = require('./base64'); var bigNumber = require('./bignumber'); var contractAddress = require('./contract-address'); var convert = require('./convert'); @@ -6111,6 +6138,8 @@ module.exports = { padZeros: convert.padZeros, stripZeros: convert.stripZeros, + base64: base64, + bigNumberify: bigNumber.bigNumberify, BigNumber: bigNumber.BigNumber, @@ -6143,7 +6172,7 @@ module.exports = { splitSignature: convert.splitSignature, } -},{"./abi-coder":19,"./address":20,"./bignumber":21,"./contract-address":23,"./convert":24,"./id":26,"./keccak256":28,"./namehash":29,"./properties":30,"./random-bytes":22,"./rlp":31,"./sha2":32,"./solidity":33,"./units":35,"./utf8":36}],28:[function(require,module,exports){ +},{"./abi-coder":19,"./address":20,"./base64":22,"./bignumber":21,"./contract-address":24,"./convert":25,"./id":27,"./keccak256":29,"./namehash":30,"./properties":31,"./random-bytes":23,"./rlp":32,"./sha2":33,"./solidity":34,"./units":36,"./utf8":37}],29:[function(require,module,exports){ 'use strict'; var sha3 = require('js-sha3'); @@ -6157,7 +6186,7 @@ function keccak256(data) { module.exports = keccak256; -},{"./convert.js":24,"js-sha3":16}],29:[function(require,module,exports){ +},{"./convert.js":25,"js-sha3":16}],30:[function(require,module,exports){ 'use strict'; var convert = require('./convert'); @@ -6197,7 +6226,7 @@ function namehash(name, depth) { module.exports = namehash; -},{"./convert":24,"./keccak256":28,"./utf8":36}],30:[function(require,module,exports){ +},{"./convert":25,"./keccak256":29,"./utf8":37}],31:[function(require,module,exports){ 'use strict'; function defineProperty(object, name, value) { @@ -6221,7 +6250,7 @@ module.exports = { defineProperty: defineProperty, }; -},{}],31:[function(require,module,exports){ +},{}],32:[function(require,module,exports){ //See: https://github.com/ethereum/wiki/wiki/RLP var convert = require('./convert.js'); @@ -6365,7 +6394,7 @@ module.exports = { decode: decode, } -},{"./convert.js":24}],32:[function(require,module,exports){ +},{"./convert.js":25}],33:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -6390,7 +6419,7 @@ module.exports = { createSha512: hash.sha512, } -},{"./convert.js":24,"hash.js":3}],33:[function(require,module,exports){ +},{"./convert.js":25,"hash.js":3}],34:[function(require,module,exports){ 'use strict'; var bigNumberify = require('./bignumber').bigNumberify; @@ -6489,7 +6518,7 @@ module.exports = { sha256: sha256, } -},{"./address":20,"./bignumber":21,"./convert":24,"./keccak256":28,"./sha2":32,"./utf8":36}],34:[function(require,module,exports){ +},{"./address":20,"./bignumber":21,"./convert":25,"./keccak256":29,"./sha2":33,"./utf8":37}],35:[function(require,module,exports){ 'use strict'; function throwError(message, params) { @@ -6502,7 +6531,7 @@ function throwError(message, params) { module.exports = throwError; -},{}],35:[function(require,module,exports){ +},{}],36:[function(require,module,exports){ var bigNumberify = require('./bignumber.js').bigNumberify; var throwError = require('./throw-error'); @@ -6652,7 +6681,7 @@ module.exports = { parseUnits: parseUnits, } -},{"./bignumber.js":21,"./throw-error":34}],36:[function(require,module,exports){ +},{"./bignumber.js":21,"./throw-error":35}],37:[function(require,module,exports){ var convert = require('./convert.js'); @@ -6767,5 +6796,5 @@ module.exports = { toUtf8String: bytesToUtf8, }; -},{"./convert.js":24}]},{},[27])(27) +},{"./convert.js":25}]},{},[28])(28) }); \ No newline at end of file diff --git a/dist/ethers-utils.min.js b/dist/ethers-utils.min.js index 1627079cc..77f5e0dad 100644 --- a/dist/ethers-utils.min.js +++ b/dist/ethers-utils.min.js @@ -1,3 +1,3 @@ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.ethers=a()}}(function(){return function(){function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=49&&g<=54?g-49+10:g>=17&&g<=22?g-17+10:15&g}return d}function h(a,b,c,d){for(var e=0,f=Math.min(a.length,c),g=b;g=49?h-49+10:h>=17?h-17+10:h}return e}function i(a){for(var b=new Array(a.bitLength()),c=0;c>>e}return b}function j(a,b,c){c.negative=b.negative^a.negative;var d=a.length+b.length|0;c.length=d,d=d-1|0;var e=0|a.words[0],f=0|b.words[0],g=e*f,h=67108863&g,i=g/67108864|0;c.words[0]=h;for(var j=1;j>>26,l=67108863&i,m=Math.min(j,b.length-1),n=Math.max(0,j-a.length+1);n<=m;n++){var o=j-n|0;e=0|a.words[o],f=0|b.words[n],g=e*f+l,k+=g/67108864|0,l=67108863&g}c.words[j]=0|l,i=0|k}return 0!==i?c.words[j]=0|i:c.length--,c.strip()}function k(a,b,c){c.negative=b.negative^a.negative,c.length=a.length+b.length;for(var d=0,e=0,f=0;f>>26)|0,e+=g>>>26,g&=67108863}c.words[f]=h,d=g,g=e}return 0!==d?c.words[f]=d:c.length--,c.strip()}function l(a,b,c){var d=new m;return d.mulp(a,b,c)}function m(a,b){this.x=a,this.y=b}function n(a,b){this.name=a,this.p=new f(b,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function o(){n.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){n.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function q(){n.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function r(){n.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function s(a){if("string"==typeof a){var b=f._prime(a);this.m=b.p,this.prime=b}else d(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}function t(a){s.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof b?b.exports=f:c.BN=f,f.BN=f,f.wordSize=26;var u;try{u=a("buffer").Buffer}catch(v){}f.isBN=function(a){return a instanceof f||null!==a&&"object"==typeof a&&a.constructor.wordSize===f.wordSize&&Array.isArray(a.words)},f.max=function(a,b){return a.cmp(b)>0?a:b},f.min=function(a,b){return a.cmp(b)<0?a:b},f.prototype._init=function(a,b,c){if("number"==typeof a)return this._initNumber(a,b,c);if("object"==typeof a)return this._initArray(a,b,c);"hex"===b&&(b=16),d(b===(0|b)&&b>=2&&b<=36),a=a.toString().replace(/\s+/g,"");var e=0;"-"===a[0]&&e++,16===b?this._parseHex(a,e):this._parseBase(a,b,e),"-"===a[0]&&(this.negative=1),this.strip(),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initNumber=function(a,b,c){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[67108863&a],this.length=1):a<4503599627370496?(this.words=[67108863&a,a/67108864&67108863],this.length=2):(d(a<9007199254740992),this.words=[67108863&a,a/67108864&67108863,1],this.length=3),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initArray=function(a,b,c){if(d("number"==typeof a.length),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var e=0;e=0;e-=3)g=a[e]|a[e-1]<<8|a[e-2]<<16,this.words[f]|=g<>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);else if("le"===c)for(e=0,f=0;e>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);return this.strip()},f.prototype._parseHex=function(a,b){this.length=Math.ceil((a.length-b)/6),this.words=new Array(this.length);for(var c=0;c=b;c-=6)e=g(a,c,c+6),this.words[d]|=e<>>26-f&4194303,f+=24,f>=26&&(f-=26,d++);c+6!==b&&(e=g(a,b,c+6),this.words[d]|=e<>>26-f&4194303),this.strip()},f.prototype._parseBase=function(a,b,c){this.words=[0],this.length=1;for(var d=0,e=1;e<=67108863;e*=b)d++;d--,e=e/b|0;for(var f=a.length-c,g=f%d,i=Math.min(f,f-g)+c,j=0,k=c;k1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(a,b){a=a||10,b=0|b||1;var c;if(16===a||"hex"===a){c="";for(var e=0,f=0,g=0;g>>24-e&16777215,c=0!==f||g!==this.length-1?w[6-i.length]+i+c:i+c,e+=2,e>=26&&(e-=26,g--)}for(0!==f&&(c=f.toString(16)+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(a===(0|a)&&a>=2&&a<=36){var j=x[a],k=y[a];c="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modn(k).toString(a);l=l.idivn(k),c=l.isZero()?m+c:w[j-m.length]+m+c}for(this.isZero()&&(c="0"+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}d(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var a=this.words[0];return 2===this.length?a+=67108864*this.words[1]:3===this.length&&1===this.words[2]?a+=4503599627370496+67108864*this.words[1]:this.length>2&&d(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-a:a},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(a,b){return d("undefined"!=typeof u),this.toArrayLike(u,a,b)},f.prototype.toArray=function(a,b){return this.toArrayLike(Array,a,b)},f.prototype.toArrayLike=function(a,b,c){var e=this.byteLength(),f=c||Math.max(1,e);d(e<=f,"byte array longer than desired length"),d(f>0,"Requested array length <= 0"),this.strip();var g,h,i="le"===b,j=new a(f),k=this.clone();if(i){for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[h]=g;for(;h=4096&&(c+=13,b>>>=13),b>=64&&(c+=7,b>>>=7),b>=8&&(c+=4,b>>>=4),b>=2&&(c+=2,b>>>=2),c+b},f.prototype._zeroBits=function(a){if(0===a)return 26;var b=a,c=0;return 0===(8191&b)&&(c+=13,b>>>=13),0===(127&b)&&(c+=7,b>>>=7),0===(15&b)&&(c+=4,b>>>=4),0===(3&b)&&(c+=2,b>>>=2),0===(1&b)&&c++,c},f.prototype.bitLength=function(){var a=this.words[this.length-1],b=this._countBits(a);return 26*(this.length-1)+b},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,b=0;ba.length?this.clone().ior(a):a.clone().ior(this)},f.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},f.prototype.iuand=function(a){var b;b=this.length>a.length?a:this;for(var c=0;ca.length?this.clone().iand(a):a.clone().iand(this)},f.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},f.prototype.iuxor=function(a){var b,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(var d=0;da.length?this.clone().ixor(a):a.clone().ixor(this)},f.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},f.prototype.inotn=function(a){d("number"==typeof a&&a>=0);var b=0|Math.ceil(a/26),c=a%26;this._expand(b),c>0&&b--;for(var e=0;e0&&(this.words[e]=~this.words[e]&67108863>>26-c),this.strip()},f.prototype.notn=function(a){return this.clone().inotn(a)},f.prototype.setn=function(a,b){d("number"==typeof a&&a>=0);var c=a/26|0,e=a%26;return this._expand(c+1),b?this.words[c]=this.words[c]|1<a.length?(c=this,d=a):(c=a,d=this);for(var e=0,f=0;f>>26;for(;0!==e&&f>>26;if(this.length=c.length,0!==e)this.words[this.length]=e,this.length++;else if(c!==this)for(;fa.length?this.clone().iadd(a):a.clone().iadd(this)},f.prototype.isub=function(a){if(0!==a.negative){a.negative=0;var b=this.iadd(a);return a.negative=1,b._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var c=this.cmp(a);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;var d,e;c>0?(d=this,e=a):(d=a,e=this);for(var f=0,g=0;g>26,this.words[g]=67108863&b;for(;0!==f&&g>26,this.words[g]=67108863&b;if(0===f&&g>>13,n=0|g[1],o=8191&n,p=n>>>13,q=0|g[2],r=8191&q,s=q>>>13,t=0|g[3],u=8191&t,v=t>>>13,w=0|g[4],x=8191&w,y=w>>>13,z=0|g[5],A=8191&z,B=z>>>13,C=0|g[6],D=8191&C,E=C>>>13,F=0|g[7],G=8191&F,H=F>>>13,I=0|g[8],J=8191&I,K=I>>>13,L=0|g[9],M=8191&L,N=L>>>13,O=0|h[0],P=8191&O,Q=O>>>13,R=0|h[1],S=8191&R,T=R>>>13,U=0|h[2],V=8191&U,W=U>>>13,X=0|h[3],Y=8191&X,Z=X>>>13,$=0|h[4],_=8191&$,aa=$>>>13,ba=0|h[5],ca=8191&ba,da=ba>>>13,ea=0|h[6],fa=8191&ea,ga=ea>>>13,ha=0|h[7],ia=8191&ha,ja=ha>>>13,ka=0|h[8],la=8191&ka,ma=ka>>>13,na=0|h[9],oa=8191&na,pa=na>>>13;c.negative=a.negative^b.negative,c.length=19,d=Math.imul(l,P),e=Math.imul(l,Q),e=e+Math.imul(m,P)|0,f=Math.imul(m,Q);var qa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(qa>>>26)|0,qa&=67108863,d=Math.imul(o,P),e=Math.imul(o,Q),e=e+Math.imul(p,P)|0,f=Math.imul(p,Q),d=d+Math.imul(l,S)|0,e=e+Math.imul(l,T)|0,e=e+Math.imul(m,S)|0,f=f+Math.imul(m,T)|0;var ra=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ra>>>26)|0,ra&=67108863,d=Math.imul(r,P),e=Math.imul(r,Q),e=e+Math.imul(s,P)|0,f=Math.imul(s,Q),d=d+Math.imul(o,S)|0,e=e+Math.imul(o,T)|0,e=e+Math.imul(p,S)|0,f=f+Math.imul(p,T)|0,d=d+Math.imul(l,V)|0,e=e+Math.imul(l,W)|0,e=e+Math.imul(m,V)|0,f=f+Math.imul(m,W)|0;var sa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(sa>>>26)|0,sa&=67108863,d=Math.imul(u,P),e=Math.imul(u,Q),e=e+Math.imul(v,P)|0,f=Math.imul(v,Q),d=d+Math.imul(r,S)|0,e=e+Math.imul(r,T)|0,e=e+Math.imul(s,S)|0,f=f+Math.imul(s,T)|0,d=d+Math.imul(o,V)|0,e=e+Math.imul(o,W)|0,e=e+Math.imul(p,V)|0,f=f+Math.imul(p,W)|0,d=d+Math.imul(l,Y)|0,e=e+Math.imul(l,Z)|0,e=e+Math.imul(m,Y)|0,f=f+Math.imul(m,Z)|0;var ta=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ta>>>26)|0,ta&=67108863,d=Math.imul(x,P),e=Math.imul(x,Q),e=e+Math.imul(y,P)|0,f=Math.imul(y,Q),d=d+Math.imul(u,S)|0,e=e+Math.imul(u,T)|0,e=e+Math.imul(v,S)|0,f=f+Math.imul(v,T)|0,d=d+Math.imul(r,V)|0,e=e+Math.imul(r,W)|0,e=e+Math.imul(s,V)|0,f=f+Math.imul(s,W)|0,d=d+Math.imul(o,Y)|0,e=e+Math.imul(o,Z)|0,e=e+Math.imul(p,Y)|0,f=f+Math.imul(p,Z)|0,d=d+Math.imul(l,_)|0,e=e+Math.imul(l,aa)|0,e=e+Math.imul(m,_)|0,f=f+Math.imul(m,aa)|0;var ua=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ua>>>26)|0,ua&=67108863,d=Math.imul(A,P),e=Math.imul(A,Q),e=e+Math.imul(B,P)|0,f=Math.imul(B,Q),d=d+Math.imul(x,S)|0,e=e+Math.imul(x,T)|0,e=e+Math.imul(y,S)|0,f=f+Math.imul(y,T)|0,d=d+Math.imul(u,V)|0,e=e+Math.imul(u,W)|0,e=e+Math.imul(v,V)|0,f=f+Math.imul(v,W)|0,d=d+Math.imul(r,Y)|0,e=e+Math.imul(r,Z)|0,e=e+Math.imul(s,Y)|0,f=f+Math.imul(s,Z)|0,d=d+Math.imul(o,_)|0,e=e+Math.imul(o,aa)|0,e=e+Math.imul(p,_)|0,f=f+Math.imul(p,aa)|0,d=d+Math.imul(l,ca)|0,e=e+Math.imul(l,da)|0,e=e+Math.imul(m,ca)|0,f=f+Math.imul(m,da)|0;var va=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(va>>>26)|0,va&=67108863,d=Math.imul(D,P),e=Math.imul(D,Q),e=e+Math.imul(E,P)|0,f=Math.imul(E,Q),d=d+Math.imul(A,S)|0,e=e+Math.imul(A,T)|0,e=e+Math.imul(B,S)|0,f=f+Math.imul(B,T)|0,d=d+Math.imul(x,V)|0,e=e+Math.imul(x,W)|0,e=e+Math.imul(y,V)|0,f=f+Math.imul(y,W)|0,d=d+Math.imul(u,Y)|0,e=e+Math.imul(u,Z)|0,e=e+Math.imul(v,Y)|0,f=f+Math.imul(v,Z)|0,d=d+Math.imul(r,_)|0,e=e+Math.imul(r,aa)|0,e=e+Math.imul(s,_)|0,f=f+Math.imul(s,aa)|0,d=d+Math.imul(o,ca)|0,e=e+Math.imul(o,da)|0,e=e+Math.imul(p,ca)|0,f=f+Math.imul(p,da)|0,d=d+Math.imul(l,fa)|0,e=e+Math.imul(l,ga)|0,e=e+Math.imul(m,fa)|0,f=f+Math.imul(m,ga)|0;var wa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(wa>>>26)|0,wa&=67108863,d=Math.imul(G,P),e=Math.imul(G,Q),e=e+Math.imul(H,P)|0,f=Math.imul(H,Q),d=d+Math.imul(D,S)|0,e=e+Math.imul(D,T)|0,e=e+Math.imul(E,S)|0,f=f+Math.imul(E,T)|0,d=d+Math.imul(A,V)|0,e=e+Math.imul(A,W)|0,e=e+Math.imul(B,V)|0,f=f+Math.imul(B,W)|0,d=d+Math.imul(x,Y)|0,e=e+Math.imul(x,Z)|0,e=e+Math.imul(y,Y)|0,f=f+Math.imul(y,Z)|0,d=d+Math.imul(u,_)|0,e=e+Math.imul(u,aa)|0,e=e+Math.imul(v,_)|0,f=f+Math.imul(v,aa)|0,d=d+Math.imul(r,ca)|0,e=e+Math.imul(r,da)|0,e=e+Math.imul(s,ca)|0,f=f+Math.imul(s,da)|0,d=d+Math.imul(o,fa)|0,e=e+Math.imul(o,ga)|0,e=e+Math.imul(p,fa)|0,f=f+Math.imul(p,ga)|0,d=d+Math.imul(l,ia)|0,e=e+Math.imul(l,ja)|0,e=e+Math.imul(m,ia)|0,f=f+Math.imul(m,ja)|0;var xa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(xa>>>26)|0,xa&=67108863,d=Math.imul(J,P),e=Math.imul(J,Q),e=e+Math.imul(K,P)|0,f=Math.imul(K,Q),d=d+Math.imul(G,S)|0,e=e+Math.imul(G,T)|0,e=e+Math.imul(H,S)|0,f=f+Math.imul(H,T)|0,d=d+Math.imul(D,V)|0,e=e+Math.imul(D,W)|0,e=e+Math.imul(E,V)|0,f=f+Math.imul(E,W)|0,d=d+Math.imul(A,Y)|0,e=e+Math.imul(A,Z)|0,e=e+Math.imul(B,Y)|0,f=f+Math.imul(B,Z)|0,d=d+Math.imul(x,_)|0,e=e+Math.imul(x,aa)|0,e=e+Math.imul(y,_)|0,f=f+Math.imul(y,aa)|0,d=d+Math.imul(u,ca)|0,e=e+Math.imul(u,da)|0,e=e+Math.imul(v,ca)|0,f=f+Math.imul(v,da)|0,d=d+Math.imul(r,fa)|0,e=e+Math.imul(r,ga)|0,e=e+Math.imul(s,fa)|0,f=f+Math.imul(s,ga)|0,d=d+Math.imul(o,ia)|0,e=e+Math.imul(o,ja)|0,e=e+Math.imul(p,ia)|0,f=f+Math.imul(p,ja)|0,d=d+Math.imul(l,la)|0,e=e+Math.imul(l,ma)|0,e=e+Math.imul(m,la)|0,f=f+Math.imul(m,ma)|0;var ya=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ya>>>26)|0,ya&=67108863,d=Math.imul(M,P),e=Math.imul(M,Q),e=e+Math.imul(N,P)|0,f=Math.imul(N,Q),d=d+Math.imul(J,S)|0,e=e+Math.imul(J,T)|0,e=e+Math.imul(K,S)|0,f=f+Math.imul(K,T)|0,d=d+Math.imul(G,V)|0,e=e+Math.imul(G,W)|0,e=e+Math.imul(H,V)|0,f=f+Math.imul(H,W)|0,d=d+Math.imul(D,Y)|0,e=e+Math.imul(D,Z)|0,e=e+Math.imul(E,Y)|0,f=f+Math.imul(E,Z)|0,d=d+Math.imul(A,_)|0,e=e+Math.imul(A,aa)|0,e=e+Math.imul(B,_)|0,f=f+Math.imul(B,aa)|0,d=d+Math.imul(x,ca)|0,e=e+Math.imul(x,da)|0,e=e+Math.imul(y,ca)|0,f=f+Math.imul(y,da)|0,d=d+Math.imul(u,fa)|0,e=e+Math.imul(u,ga)|0,e=e+Math.imul(v,fa)|0,f=f+Math.imul(v,ga)|0,d=d+Math.imul(r,ia)|0,e=e+Math.imul(r,ja)|0,e=e+Math.imul(s,ia)|0,f=f+Math.imul(s,ja)|0,d=d+Math.imul(o,la)|0,e=e+Math.imul(o,ma)|0,e=e+Math.imul(p,la)|0,f=f+Math.imul(p,ma)|0,d=d+Math.imul(l,oa)|0,e=e+Math.imul(l,pa)|0,e=e+Math.imul(m,oa)|0,f=f+Math.imul(m,pa)|0;var za=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(za>>>26)|0,za&=67108863,d=Math.imul(M,S),e=Math.imul(M,T),e=e+Math.imul(N,S)|0,f=Math.imul(N,T),d=d+Math.imul(J,V)|0,e=e+Math.imul(J,W)|0,e=e+Math.imul(K,V)|0,f=f+Math.imul(K,W)|0,d=d+Math.imul(G,Y)|0,e=e+Math.imul(G,Z)|0,e=e+Math.imul(H,Y)|0,f=f+Math.imul(H,Z)|0,d=d+Math.imul(D,_)|0,e=e+Math.imul(D,aa)|0,e=e+Math.imul(E,_)|0,f=f+Math.imul(E,aa)|0,d=d+Math.imul(A,ca)|0,e=e+Math.imul(A,da)|0,e=e+Math.imul(B,ca)|0,f=f+Math.imul(B,da)|0,d=d+Math.imul(x,fa)|0,e=e+Math.imul(x,ga)|0,e=e+Math.imul(y,fa)|0,f=f+Math.imul(y,ga)|0,d=d+Math.imul(u,ia)|0,e=e+Math.imul(u,ja)|0,e=e+Math.imul(v,ia)|0,f=f+Math.imul(v,ja)|0,d=d+Math.imul(r,la)|0,e=e+Math.imul(r,ma)|0,e=e+Math.imul(s,la)|0,f=f+Math.imul(s,ma)|0,d=d+Math.imul(o,oa)|0,e=e+Math.imul(o,pa)|0,e=e+Math.imul(p,oa)|0,f=f+Math.imul(p,pa)|0;var Aa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,d=Math.imul(M,V),e=Math.imul(M,W),e=e+Math.imul(N,V)|0,f=Math.imul(N,W),d=d+Math.imul(J,Y)|0,e=e+Math.imul(J,Z)|0,e=e+Math.imul(K,Y)|0,f=f+Math.imul(K,Z)|0,d=d+Math.imul(G,_)|0,e=e+Math.imul(G,aa)|0,e=e+Math.imul(H,_)|0,f=f+Math.imul(H,aa)|0,d=d+Math.imul(D,ca)|0,e=e+Math.imul(D,da)|0,e=e+Math.imul(E,ca)|0,f=f+Math.imul(E,da)|0,d=d+Math.imul(A,fa)|0,e=e+Math.imul(A,ga)|0,e=e+Math.imul(B,fa)|0,f=f+Math.imul(B,ga)|0,d=d+Math.imul(x,ia)|0,e=e+Math.imul(x,ja)|0,e=e+Math.imul(y,ia)|0,f=f+Math.imul(y,ja)|0,d=d+Math.imul(u,la)|0,e=e+Math.imul(u,ma)|0,e=e+Math.imul(v,la)|0,f=f+Math.imul(v,ma)|0,d=d+Math.imul(r,oa)|0,e=e+Math.imul(r,pa)|0,e=e+Math.imul(s,oa)|0,f=f+Math.imul(s,pa)|0;var Ba=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,d=Math.imul(M,Y),e=Math.imul(M,Z),e=e+Math.imul(N,Y)|0,f=Math.imul(N,Z),d=d+Math.imul(J,_)|0,e=e+Math.imul(J,aa)|0,e=e+Math.imul(K,_)|0,f=f+Math.imul(K,aa)|0,d=d+Math.imul(G,ca)|0,e=e+Math.imul(G,da)|0,e=e+Math.imul(H,ca)|0,f=f+Math.imul(H,da)|0,d=d+Math.imul(D,fa)|0,e=e+Math.imul(D,ga)|0,e=e+Math.imul(E,fa)|0,f=f+Math.imul(E,ga)|0,d=d+Math.imul(A,ia)|0,e=e+Math.imul(A,ja)|0,e=e+Math.imul(B,ia)|0,f=f+Math.imul(B,ja)|0,d=d+Math.imul(x,la)|0,e=e+Math.imul(x,ma)|0,e=e+Math.imul(y,la)|0,f=f+Math.imul(y,ma)|0,d=d+Math.imul(u,oa)|0,e=e+Math.imul(u,pa)|0,e=e+Math.imul(v,oa)|0,f=f+Math.imul(v,pa)|0;var Ca=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,d=Math.imul(M,_),e=Math.imul(M,aa),e=e+Math.imul(N,_)|0,f=Math.imul(N,aa),d=d+Math.imul(J,ca)|0,e=e+Math.imul(J,da)|0,e=e+Math.imul(K,ca)|0,f=f+Math.imul(K,da)|0,d=d+Math.imul(G,fa)|0,e=e+Math.imul(G,ga)|0,e=e+Math.imul(H,fa)|0,f=f+Math.imul(H,ga)|0,d=d+Math.imul(D,ia)|0,e=e+Math.imul(D,ja)|0,e=e+Math.imul(E,ia)|0,f=f+Math.imul(E,ja)|0,d=d+Math.imul(A,la)|0,e=e+Math.imul(A,ma)|0,e=e+Math.imul(B,la)|0,f=f+Math.imul(B,ma)|0,d=d+Math.imul(x,oa)|0,e=e+Math.imul(x,pa)|0,e=e+Math.imul(y,oa)|0,f=f+Math.imul(y,pa)|0;var Da=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Da>>>26)|0,Da&=67108863,d=Math.imul(M,ca),e=Math.imul(M,da),e=e+Math.imul(N,ca)|0,f=Math.imul(N,da),d=d+Math.imul(J,fa)|0,e=e+Math.imul(J,ga)|0,e=e+Math.imul(K,fa)|0,f=f+Math.imul(K,ga)|0,d=d+Math.imul(G,ia)|0,e=e+Math.imul(G,ja)|0,e=e+Math.imul(H,ia)|0,f=f+Math.imul(H,ja)|0,d=d+Math.imul(D,la)|0,e=e+Math.imul(D,ma)|0,e=e+Math.imul(E,la)|0,f=f+Math.imul(E,ma)|0,d=d+Math.imul(A,oa)|0,e=e+Math.imul(A,pa)|0,e=e+Math.imul(B,oa)|0,f=f+Math.imul(B,pa)|0;var Ea=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,d=Math.imul(M,fa),e=Math.imul(M,ga),e=e+Math.imul(N,fa)|0,f=Math.imul(N,ga),d=d+Math.imul(J,ia)|0,e=e+Math.imul(J,ja)|0,e=e+Math.imul(K,ia)|0,f=f+Math.imul(K,ja)|0,d=d+Math.imul(G,la)|0,e=e+Math.imul(G,ma)|0,e=e+Math.imul(H,la)|0,f=f+Math.imul(H,ma)|0,d=d+Math.imul(D,oa)|0,e=e+Math.imul(D,pa)|0,e=e+Math.imul(E,oa)|0,f=f+Math.imul(E,pa)|0;var Fa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,d=Math.imul(M,ia),e=Math.imul(M,ja),e=e+Math.imul(N,ia)|0,f=Math.imul(N,ja),d=d+Math.imul(J,la)|0,e=e+Math.imul(J,ma)|0,e=e+Math.imul(K,la)|0,f=f+Math.imul(K,ma)|0,d=d+Math.imul(G,oa)|0,e=e+Math.imul(G,pa)|0,e=e+Math.imul(H,oa)|0,f=f+Math.imul(H,pa)|0;var Ga=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,d=Math.imul(M,la),e=Math.imul(M,ma),e=e+Math.imul(N,la)|0,f=Math.imul(N,ma),d=d+Math.imul(J,oa)|0,e=e+Math.imul(J,pa)|0,e=e+Math.imul(K,oa)|0,f=f+Math.imul(K,pa)|0;var Ha=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,d=Math.imul(M,oa),e=Math.imul(M,pa),e=e+Math.imul(N,oa)|0,f=Math.imul(N,pa);var Ia=(j+d|0)+((8191&e)<<13)|0;return j=(f+(e>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,i[0]=qa,i[1]=ra,i[2]=sa,i[3]=ta,i[4]=ua,i[5]=va,i[6]=wa,i[7]=xa,i[8]=ya,i[9]=za,i[10]=Aa,i[11]=Ba,i[12]=Ca,i[13]=Da,i[14]=Ea,i[15]=Fa,i[16]=Ga,i[17]=Ha,i[18]=Ia,0!==j&&(i[19]=j,c.length++),c};Math.imul||(z=j),f.prototype.mulTo=function(a,b){var c,d=this.length+a.length;return c=10===this.length&&10===a.length?z(this,a,b):d<63?j(this,a,b):d<1024?k(this,a,b):l(this,a,b)},m.prototype.makeRBT=function(a){for(var b=new Array(a),c=f.prototype._countBits(a)-1,d=0;d>=1;return d},m.prototype.permute=function(a,b,c,d,e,f){for(var g=0;g>>=1)e++;return 1<>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return 0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){return this.clone().imuln(a)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(a){var b=i(a);if(0===b.length)return new f(1);for(var c=this,d=0;d=0);var b,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){var g=0;for(b=0;b>>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=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<g)for(this.length-=g,j=0;j=0&&(0!==k||j>=e);j--){var l=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&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){return d(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){return this.clone().ishln(a)},f.prototype.ushln=function(a){return this.clone().iushln(a)},f.prototype.shrn=function(a){return this.clone().ishrn(a)},f.prototype.ushrn=function(a){return this.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26,e=1<=0);var b=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){var e=67108863^67108863>>>b<=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},f.prototype.isubn=function(a){if(d("number"==typeof a),d(a<67108864),a<0)return this.iaddn(-a);if(0!==this.negative)return this.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;else for(var b=0;b>26)-(i/67108864|0),this.words[e+c]=67108863&g}for(;e>26,this.words[e+c]=67108863&g;if(0===h)return this.strip();for(d(h===-1),h=0,e=0;e>26,this.words[e]=67108863&g;return this.negative=1,this.strip()},f.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),e=a,g=0|e.words[e.length-1],h=this._countBits(g);c=26-h,0!==c&&(e=e.ushln(c),d.iushln(c),g=0|e.words[e.length-1]);var i,j=d.length-e.length;if("mod"!==b){i=new f(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k=0;m--){var n=67108864*(0|d.words[e.length+m])+(0|d.words[e.length+m-1]);for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(e,n,m);0!==d.negative;)n--,d.negative=0,d._ishlnsubmul(e,1,m),d.isZero()||(d.negative^=1);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.iushrn(c),{div:i||null,mod:d}},f.prototype.divmod=function(a,b,c){if(d(!a.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var e,g,h;return 0!==this.negative&&0===a.negative?(h=this.neg().divmod(a,b),"mod"!==b&&(e=h.div.neg()),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.iadd(a)),{div:e,mod:g}):0===this.negative&&0!==a.negative?(h=this.divmod(a.neg(),b),"mod"!==b&&(e=h.div.neg()), {div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new f(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new f(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new f(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){return this.divmod(a,"div",!1).div},f.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){var b=this.divmod(a);if(b.mod.isZero())return b.div;var c=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);return f<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(var b=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;return c},f.prototype.idivn=function(a){d(a<=67108863);for(var b=0,c=this.length-1;c>=0;c--){var e=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}return this.strip()},f.prototype.divn=function(a){return this.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=new f(0),i=new f(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(var k=c.clone(),l=b.clone();!b.isZero();){for(var m=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-- >0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(var o=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-- >0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(var i=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-- >0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(var k=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}var m;return m=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var b=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(var d=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);var e=b.cmp(c);if(e<0){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.iushln(d)},f.prototype.invm=function(a){return this.egcd(a).a.umod(a)},f.prototype.isEven=function(){return 0===(1&this.words[0])},f.prototype.isOdd=function(){return 1===(1&this.words[0])},f.prototype.andln=function(a){return this.words[0]&a},f.prototype.bincn=function(a){d("number"==typeof a);var b=a%26,c=(a-b)/26,e=1<>>26,h&=67108863,this.words[g]=h}return 0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){var b=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return 1;this.strip();var c;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");var e=0|this.words[0];c=e===a?0:ea.length)return 1;if(this.length=0;c--){var d=0|this.words[c],e=0|a.words[c];if(d!==e){de&&(b=1);break}}return b},f.prototype.gtn=function(a){return 1===this.cmpn(a)},f.prototype.gt=function(a){return 1===this.cmp(a)},f.prototype.gten=function(a){return this.cmpn(a)>=0},f.prototype.gte=function(a){return this.cmp(a)>=0},f.prototype.ltn=function(a){return this.cmpn(a)===-1},f.prototype.lt=function(a){return this.cmp(a)===-1},f.prototype.lten=function(a){return this.cmpn(a)<=0},f.prototype.lte=function(a){return this.cmp(a)<=0},f.prototype.eqn=function(a){return 0===this.cmpn(a)},f.prototype.eq=function(a){return 0===this.cmp(a)},f.red=function(a){return new s(a)},f.prototype.toRed=function(a){return d(!this.red,"Already a number in reduction context"),d(0===this.negative,"red works only with positives"),a.convertTo(this)._forceRed(a)},f.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(a){return this.red=a,this},f.prototype.forceRed=function(a){return d(!this.red,"Already a number in reduction context"),this._forceRed(a)},f.prototype.redAdd=function(a){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},f.prototype.redIAdd=function(a){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},f.prototype.redSub=function(a){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},f.prototype.redISub=function(a){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},f.prototype.redShl=function(a){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},f.prototype.redMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},f.prototype.redIMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},f.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(a){return d(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var a=new f(null);return a.words=new Array(Math.ceil(this.n/13)),a},n.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b0?c.isub(this.p):c.strip(),c},n.prototype.split=function(a,b){a.iushrn(this.n,0,b)},n.prototype.imulK=function(a){return a.imul(this.k)},e(o,n),o.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;e>>22,f=g}f>>>=22,a.words[e-10]=f,0===f&&a.length>10?a.length-=10:a.length-=9},o.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b=0,c=0;c>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},f._prime=function B(a){if(A[a])return A[a];var B;if("k256"===a)B=new o;else if("p224"===a)B=new p;else if("p192"===a)B=new q;else{if("p25519"!==a)throw new Error("Unknown prime "+a);B=new r}return A[a]=B,B},s.prototype._verify1=function(a){d(0===a.negative,"red works only with positives"),d(a.red,"red works only with red numbers")},s.prototype._verify2=function(a,b){d(0===(a.negative|b.negative),"red works only with positives"),d(a.red&&a.red===b.red,"red works only with red numbers")},s.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:2}],2:[function(a,b,c){},{}],3:[function(a,b,c){var d=c;d.utils=a("./hash/utils"),d.common=a("./hash/common"),d.sha=a("./hash/sha"),d.ripemd=a("./hash/ripemd"),d.hmac=a("./hash/hmac"),d.sha1=d.sha.sha1,d.sha256=d.sha.sha256,d.sha224=d.sha.sha224,d.sha384=d.sha.sha384,d.sha512=d.sha.sha512,d.ripemd160=d.ripemd.ripemd160},{"./hash/common":4,"./hash/hmac":5,"./hash/ripemd":6,"./hash/sha":7,"./hash/utils":14}],4:[function(a,b,c){"use strict";function d(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var e=a("./utils"),f=a("minimalistic-assert");c.BlockHash=d,d.prototype.update=function(a,b){if(a=e.toArray(a,b),this.pending?this.pending=this.pending.concat(a):this.pending=a,this.pendingTotal+=a.length,this.pending.length>=this._delta8){a=this.pending;var c=a.length%this._delta8;this.pending=a.slice(a.length-c,a.length),0===this.pending.length&&(this.pending=null),a=e.join32(a,0,a.length-c,this.endian);for(var d=0;d>>24&255,d[e++]=a>>>16&255,d[e++]=a>>>8&255,d[e++]=255&a}else for(d[e++]=255&a,d[e++]=a>>>8&255,d[e++]=a>>>16&255,d[e++]=a>>>24&255,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=0,f=8;fthis.blockSize&&(a=(new this.Hash).update(a).digest()),f(a.length<=this.blockSize);for(var b=a.length;b>>3}function k(a){return m(a,17)^m(a,19)^a>>>10}var l=a("../utils"),m=l.rotr32;c.ft_1=d,c.ch32=e,c.maj32=f,c.p32=g,c.s0_256=h,c.s1_256=i,c.g0_256=j,c.g1_256=k},{"../utils":14}],14:[function(a,b,c){"use strict";function d(a,b){if(Array.isArray(a))return a.slice();if(!a)return[];var c=[];if("string"==typeof a)if(b){if("hex"===b)for(a=a.replace(/[^a-z0-9]+/gi,""),a.length%2!==0&&(a="0"+a),d=0;d>8,g=255&e;f?c.push(f,g):c.push(g)}else for(d=0;d>>24|a>>>8&65280|a<<8&16711680|(255&a)<<24;return b>>>0}function g(a,b){for(var c="",d=0;d>>0}return f}function k(a,b){for(var c=new Array(4*a.length),d=0,e=0;d>>24,c[e+1]=f>>>16&255,c[e+2]=f>>>8&255,c[e+3]=255&f):(c[e+3]=f>>>24,c[e+2]=f>>>16&255,c[e+1]=f>>>8&255,c[e]=255&f)}return c}function l(a,b){return a>>>b|a<<32-b}function m(a,b){return a<>>32-b}function n(a,b){return a+b>>>0}function o(a,b,c){return a+b+c>>>0}function p(a,b,c,d){return a+b+c+d>>>0}function q(a,b,c,d,e){return a+b+c+d+e>>>0}function r(a,b,c,d){var e=a[b],f=a[b+1],g=d+f>>>0,h=(g>>0,a[b+1]=g}function s(a,b,c,d){var e=b+d>>>0,f=(e>>0}function t(a,b,c,d){var e=b+d;return e>>>0}function u(a,b,c,d,e,f,g,h){var i=0,j=b;j=j+d>>>0,i+=j>>0,i+=j>>0,i+=j>>0}function v(a,b,c,d,e,f,g,h){var i=b+d+f+h;return i>>>0}function w(a,b,c,d,e,f,g,h,i,j){var k=0,l=b;l=l+d>>>0,k+=l>>0,k+=l>>0,k+=l>>0,k+=l>>0}function x(a,b,c,d,e,f,g,h,i,j){var k=b+d+f+h+j;return k>>>0}function y(a,b,c){var d=b<<32-c|a>>>c;return d>>>0}function z(a,b,c){var d=a<<32-c|b>>>c;return d>>>0}function A(a,b,c){return a>>>c}function B(a,b,c){var d=a<<32-c|b>>>c;return d>>>0}var C=a("minimalistic-assert"),D=a("inherits");c.inherits=D,c.toArray=d,c.toHex=e,c.htonl=f,c.toHex32=g,c.zero2=h,c.zero8=i,c.join32=j,c.split32=k,c.rotr32=l,c.rotl32=m,c.sum32=n,c.sum32_3=o,c.sum32_4=p,c.sum32_5=q,c.sum64=r,c.sum64_hi=s,c.sum64_lo=t,c.sum64_4_hi=u,c.sum64_4_lo=v,c.sum64_5_hi=w,c.sum64_5_lo=x,c.rotr64_hi=y,c.rotr64_lo=z,c.shr64_hi=A,c.shr64_lo=B},{inherits:15,"minimalistic-assert":17}],15:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],16:[function(a,b,c){(function(a,c){!function(){"use strict";function d(a,b,c){this.blocks=[],this.s=[],this.padding=b,this.outputBits=c,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(a<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=c>>5,this.extraBytes=(31&c)>>3;for(var d=0;d<50;++d)this.s[d]=0}var e="object"==typeof window?window:{},f=!e.JS_SHA3_NO_NODE_JS&&"object"==typeof a&&a.versions&&a.versions.node;f&&(e=c);for(var g=!e.JS_SHA3_NO_COMMON_JS&&"object"==typeof b&&b.exports,h="0123456789abcdef".split(""),i=[31,7936,2031616,520093696],j=[1,256,65536,16777216],k=[6,1536,393216,100663296],l=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],n=[224,256,384,512],o=[128,256],p=["hex","buffer","arrayBuffer","array"],q=function(a,b,c){return function(e){return new d(a,b,a).update(e)[c]()}},r=function(a,b,c){return function(e,f){return new d(a,b,f).update(e)[c]()}},s=function(a,b){var c=q(a,b,"hex");c.create=function(){return new d(a,b,a)},c.update=function(a){return c.create().update(a)};for(var e=0;e>2]|=a[i]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(f[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=g){for(this.start=c-g,this.block=f[h],c=0;c>2]|=this.padding[3&b],this.lastByteIndex===this.byteCount)for(a[0]=a[c],b=1;b>4&15]+h[15&a]+h[a>>12&15]+h[a>>8&15]+h[a>>20&15]+h[a>>16&15]+h[a>>28&15]+h[a>>24&15];g%b===0&&(C(c),f=0)}return e&&(a=c[f],e>0&&(i+=h[a>>4&15]+h[15&a]),e>1&&(i+=h[a>>12&15]+h[a>>8&15]),e>2&&(i+=h[a>>20&15]+h[a>>16&15])),i},d.prototype.arrayBuffer=function(){this.finalize();var a,b=this.blockCount,c=this.s,d=this.outputBlocks,e=this.extraBytes,f=0,g=0,h=this.outputBits>>3;a=e?new ArrayBuffer(d+1<<2):new ArrayBuffer(h);for(var i=new Uint32Array(a);g>8&255,i[a+2]=b>>16&255,i[a+3]=b>>24&255;h%c===0&&C(d)}return f&&(a=h<<2,b=d[g],f>0&&(i[a]=255&b),f>1&&(i[a+1]=b>>8&255),f>2&&(i[a+2]=b>>16&255)),i};var C=function(a){var b,c,d,e,f,g,h,i,j,k,l,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka;for(d=0;d<48;d+=2)e=a[0]^a[10]^a[20]^a[30]^a[40],f=a[1]^a[11]^a[21]^a[31]^a[41],g=a[2]^a[12]^a[22]^a[32]^a[42],h=a[3]^a[13]^a[23]^a[33]^a[43],i=a[4]^a[14]^a[24]^a[34]^a[44],j=a[5]^a[15]^a[25]^a[35]^a[45],k=a[6]^a[16]^a[26]^a[36]^a[46],l=a[7]^a[17]^a[27]^a[37]^a[47],n=a[8]^a[18]^a[28]^a[38]^a[48],o=a[9]^a[19]^a[29]^a[39]^a[49],b=n^(g<<1|h>>>31),c=o^(h<<1|g>>>31),a[0]^=b,a[1]^=c,a[10]^=b,a[11]^=c,a[20]^=b,a[21]^=c,a[30]^=b,a[31]^=c,a[40]^=b,a[41]^=c,b=e^(i<<1|j>>>31),c=f^(j<<1|i>>>31),a[2]^=b,a[3]^=c,a[12]^=b,a[13]^=c,a[22]^=b,a[23]^=c,a[32]^=b,a[33]^=c,a[42]^=b,a[43]^=c,b=g^(k<<1|l>>>31),c=h^(l<<1|k>>>31),a[4]^=b,a[5]^=c,a[14]^=b,a[15]^=c,a[24]^=b,a[25]^=c,a[34]^=b,a[35]^=c,a[44]^=b,a[45]^=c,b=i^(n<<1|o>>>31),c=j^(o<<1|n>>>31),a[6]^=b,a[7]^=c,a[16]^=b,a[17]^=c,a[26]^=b,a[27]^=c,a[36]^=b,a[37]^=c,a[46]^=b,a[47]^=c,b=k^(e<<1|f>>>31),c=l^(f<<1|e>>>31),a[8]^=b,a[9]^=c,a[18]^=b,a[19]^=c,a[28]^=b,a[29]^=c,a[38]^=b,a[39]^=c,a[48]^=b,a[49]^=c,p=a[0],q=a[1],V=a[11]<<4|a[10]>>>28,W=a[10]<<4|a[11]>>>28,D=a[20]<<3|a[21]>>>29,E=a[21]<<3|a[20]>>>29,ha=a[31]<<9|a[30]>>>23,ia=a[30]<<9|a[31]>>>23,R=a[40]<<18|a[41]>>>14,S=a[41]<<18|a[40]>>>14,J=a[2]<<1|a[3]>>>31,K=a[3]<<1|a[2]>>>31,r=a[13]<<12|a[12]>>>20,s=a[12]<<12|a[13]>>>20,X=a[22]<<10|a[23]>>>22,Y=a[23]<<10|a[22]>>>22,F=a[33]<<13|a[32]>>>19,G=a[32]<<13|a[33]>>>19,ja=a[42]<<2|a[43]>>>30,ka=a[43]<<2|a[42]>>>30,ba=a[5]<<30|a[4]>>>2,ca=a[4]<<30|a[5]>>>2,L=a[14]<<6|a[15]>>>26,M=a[15]<<6|a[14]>>>26,t=a[25]<<11|a[24]>>>21,u=a[24]<<11|a[25]>>>21,Z=a[34]<<15|a[35]>>>17,$=a[35]<<15|a[34]>>>17,H=a[45]<<29|a[44]>>>3,I=a[44]<<29|a[45]>>>3,z=a[6]<<28|a[7]>>>4,A=a[7]<<28|a[6]>>>4,da=a[17]<<23|a[16]>>>9,ea=a[16]<<23|a[17]>>>9,N=a[26]<<25|a[27]>>>7,O=a[27]<<25|a[26]>>>7,v=a[36]<<21|a[37]>>>11,w=a[37]<<21|a[36]>>>11,_=a[47]<<24|a[46]>>>8,aa=a[46]<<24|a[47]>>>8,T=a[8]<<27|a[9]>>>5,U=a[9]<<27|a[8]>>>5,B=a[18]<<20|a[19]>>>12,C=a[19]<<20|a[18]>>>12,fa=a[29]<<7|a[28]>>>25,ga=a[28]<<7|a[29]>>>25,P=a[38]<<8|a[39]>>>24,Q=a[39]<<8|a[38]>>>24,x=a[48]<<14|a[49]>>>18,y=a[49]<<14|a[48]>>>18,a[0]=p^~r&t,a[1]=q^~s&u,a[10]=z^~B&D,a[11]=A^~C&E,a[20]=J^~L&N,a[21]=K^~M&O,a[30]=T^~V&X,a[31]=U^~W&Y,a[40]=ba^~da&fa,a[41]=ca^~ea&ga,a[2]=r^~t&v,a[3]=s^~u&w,a[12]=B^~D&F,a[13]=C^~E&G,a[22]=L^~N&P,a[23]=M^~O&Q,a[32]=V^~X&Z,a[33]=W^~Y&$,a[42]=da^~fa&ha,a[43]=ea^~ga&ia,a[4]=t^~v&x,a[5]=u^~w&y,a[14]=D^~F&H,a[15]=E^~G&I,a[24]=N^~P&R,a[25]=O^~Q&S,a[34]=X^~Z&_,a[35]=Y^~$&aa,a[44]=fa^~ha&ja,a[45]=ga^~ia&ka,a[6]=v^~x&p,a[7]=w^~y&q,a[16]=F^~H&z,a[17]=G^~I&A, -a[26]=P^~R&J,a[27]=Q^~S&K,a[36]=Z^~_&T,a[37]=$^~aa&U,a[46]=ha^~ja&ba,a[47]=ia^~ka&ca,a[8]=x^~p&r,a[9]=y^~q&s,a[18]=H^~z&B,a[19]=I^~A&C,a[28]=R^~J&L,a[29]=S^~K&M,a[38]=_^~T&V,a[39]=aa^~U&W,a[48]=ja^~ba&da,a[49]=ka^~ca&ea,a[0]^=m[d],a[1]^=m[d+1]};if(g)b.exports=v;else for(var x=0;x=0?c:"")+"]";return{coder:b,localName:d,length:c,name:"array",type:e,encode:function(a){Array.isArray(a)||n("invalid array");var d=c,e=new Uint8Array(0);d===-1&&(d=a.length,e=v.encode(d)),d!==a.length&&n("size mismatch");var f=[];return a.forEach(function(a){f.push(b)}),o.concat([e,g(f,a)])},decode:function(d,f){var g=0,i=c;if(i===-1){var j=v.decode(d,f);i=j.value.toNumber(),g+=j.consumed,f+=j.consumed}for(var k=[],l=0;l256||f%8!==0)&&n("invalid type",{type:b}),u(a,f/8,"int"===e[1],c)}var e=b.match(p);if(e){var f=parseInt(e[1]);return(0===f||f>32)&&n("invalid type "+b),x(a,f,c)}var e=b.match(r);if(e){var f=parseInt(e[2]||-1);return i(a,l(a,e[1],c),f,c)}if("tuple("===b.substring(0,6)&&")"===b.substring(b.length-1)){var g=[],h=[];return c&&"object"==typeof c&&(Array.isArray(c.names)&&(h=c.names),"string"==typeof c.name&&(c=c.name)),k(b.substring(6,b.length-1)).forEach(function(b,c){g.push(l(a,b,h[c]))}),j(a,g,c)}return""===b?t(a):void n("invalid type",{type:b})}function m(a){if(!(this instanceof m))throw new Error("missing new");a||(a=s),o.defineProperty(this,"coerceFunc",a)}var n=a("../utils/throw-error"),o=function(){var b=a("../utils/convert.js"),c=a("../utils/utf8.js");return{defineProperty:a("../utils/properties.js").defineProperty,arrayify:b.arrayify,padZeros:b.padZeros,bigNumberify:a("../utils/bignumber.js").bigNumberify,getAddress:a("../utils/address").getAddress,concat:b.concat,toUtf8Bytes:c.toUtf8Bytes,toUtf8String:c.toUtf8String,hexlify:b.hexlify}}(),p=new RegExp(/^bytes([0-9]*)$/),q=new RegExp(/^(u?int)([0-9]*)$/),r=new RegExp(/^(.*)\[([0-9]*)\]$/),s=function(a,b){var c=a.match(q);return c&&parseInt(c[2])<=48?b.toNumber():b},t=function(a){return{name:"null",type:"",encode:function(a){return o.arrayify([])},decode:function(b,c){if(c>b.length)throw new Error("invalid null");return{consumed:0,value:a("null",void 0)}},dynamic:!1}},u=function(a,b,c,d){var e=(c?"int":"uint")+8*b;return{localName:d,name:e,type:e,encode:function(a){return a=o.bigNumberify(a).toTwos(8*b).maskn(8*b),c&&(a=a.fromTwos(8*b).toTwos(256)),o.padZeros(o.arrayify(a),32)},decode:function(d,f){d.length>1]>>4>=8&&(a[c]=a[c].toUpperCase()),(15&b[c>>1])>=8&&(a[c+1]=a[c+1].toUpperCase());return"0x"+a.join("")}function e(a){return Math.log10?Math.log10(a):Math.log(a)/Math.LN10}function f(a,b){var c=null;if("string"!=typeof a&&i("invalid address",{input:a}),a.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==a.substring(0,2)&&(a="0x"+a),c=d(a),a.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&c!==a&&i("invalid address checksum",{input:a,expected:c});else if(a.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(a.substring(2,4)!==l(a)&&i("invalid address icap checksum",{input:a}),c=new g(a.substring(4),36).toString(16);c.length<40;)c="0"+c;c=d("0x"+c)}else i("invalid address",{input:a});if(b){for(var e=new g(c.substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e}return c}var g=a("bn.js"),h=a("./convert"),i=a("./throw-error"),j=a("./keccak256"),k=9007199254740991,l=function(){for(var a={},b=0;b<10;b++)a[String(b)]=String(b);for(var b=0;b<26;b++)a[String.fromCharCode(65+b)]=String(10+b);var c=Math.floor(e(k));return function(b){b=b.toUpperCase(),b=b.substring(4)+b.substring(0,2)+"00";for(var d=b.split(""),e=0;e=c;){var f=d.substring(0,c);d=parseInt(f,10)%97+d.substring(f.length)}for(var g=String(98-parseInt(d,10)%97);g.length<2;)g="0"+g;return g}}();b.exports={getAddress:f}},{"./convert":24,"./keccak256":28,"./throw-error":34,"bn.js":1}],21:[function(a,b,c){function d(a){if(!(this instanceof d))throw new Error("missing new");i.isHexString(a)?("0x"==a&&(a="0x0"),a=new g(a.substring(2),16)):"string"==typeof a&&"-"===a[0]&&i.isHexString(a.substring(1))?a=new g(a.substring(3),16).mul(d.constantNegativeOne._bn):"string"==typeof a&&a.match(/^-?[0-9]*$/)?(""==a&&(a="0"),a=new g(a)):"number"==typeof a&&parseInt(a)==a?a=new g(a):g.isBN(a)||(e(a)?a=a._bn:i.isArrayish(a)?a=new g(i.hexlify(a).substring(2),16):j("invalid BigNumber value",{input:a})),h(this,"_bn",a)}function e(a){return a._bn&&a._bn.mod}function f(a){return e(a)?a:new d(a)}var g=a("bn.js"),h=a("./properties").defineProperty,i=a("./convert"),j=a("./throw-error");h(d,"constantNegativeOne",f(-1)),h(d,"constantZero",f(0)),h(d,"constantOne",f(1)),h(d,"constantTwo",f(2)),h(d,"constantWeiPerEther",f(new g("1000000000000000000"))),h(d.prototype,"fromTwos",function(a){return new d(this._bn.fromTwos(a))}),h(d.prototype,"toTwos",function(a){return new d(this._bn.toTwos(a))}),h(d.prototype,"add",function(a){return new d(this._bn.add(f(a)._bn))}),h(d.prototype,"sub",function(a){return new d(this._bn.sub(f(a)._bn))}),h(d.prototype,"div",function(a){return new d(this._bn.div(f(a)._bn))}),h(d.prototype,"mul",function(a){return new d(this._bn.mul(f(a)._bn))}),h(d.prototype,"mod",function(a){return new d(this._bn.mod(f(a)._bn))}),h(d.prototype,"pow",function(a){return new d(this._bn.pow(f(a)._bn))}),h(d.prototype,"maskn",function(a){return new d(this._bn.maskn(a))}),h(d.prototype,"eq",function(a){return this._bn.eq(f(a)._bn)}),h(d.prototype,"lt",function(a){return this._bn.lt(f(a)._bn)}),h(d.prototype,"lte",function(a){return this._bn.lte(f(a)._bn)}),h(d.prototype,"gt",function(a){return this._bn.gt(f(a)._bn)}),h(d.prototype,"gte",function(a){return this._bn.gte(f(a)._bn)}),h(d.prototype,"isZero",function(){return this._bn.isZero()}),h(d.prototype,"toNumber",function(a){return this._bn.toNumber()}),h(d.prototype,"toString",function(){return this._bn.toString(10)}),h(d.prototype,"toHexString",function(){var a=this._bn.toString(16);return a.length%2&&(a="0"+a),"0x"+a}),b.exports={isBigNumber:e,bigNumberify:f,BigNumber:d}},{"./convert":24,"./properties":30,"./throw-error":34,"bn.js":1}],22:[function(a,b,c){(function(c){"use strict";function d(a){if(a<=0||a>1024||parseInt(a)!=a)throw new Error("invalid length");var b=new Uint8Array(a);return g.getRandomValues(b),e.arrayify(b)}var e=a("./convert"),f=a("./properties").defineProperty,g=c.crypto||c.msCrypto;g&&g.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),g={getRandomValues:function(a){for(var b=0;b<20;b++)for(var c=0;c=256||parseInt(c)!=c)return!1}return!0}function f(a){if(null==a&&o.throwError("cannot convert null value to array",o.INVALID_ARGUMENT,{arg:"value",value:a}),a&&a.toHexString&&(a=a.toHexString()),j(a)){a=a.substring(2),a.length%2&&(a="0"+a);for(var b=[],c=0;c>4]+p[15&f])}return"0x"+c.join("")}o.throwError("invalid hexlify value",{arg:"value",value:a})}function l(a){for(;a.length>3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function m(a,b){for(;a.length<2*b+2;)a="0x0"+a.substring(2);return a}function n(a){if(a=f(a),65!==a.length)throw new Error("invalid signature");var b=a[64];return 27!==b&&28!==b&&(b=27+b%2),{r:k(a.slice(0,32)),s:k(a.slice(32,64)),v:b}}var o=(a("./properties.js").defineProperty,a("./errors")),p="0123456789abcdef";b.exports={arrayify:f,isArrayish:e,concat:g,padZeros:i,stripZeros:h,splitSignature:n,hexlify:k,isHexString:j,hexStripZeros:l,hexZeroPad:m}},{"./errors":25,"./properties.js":30}],25:[function(a,b,c){"use strict";var d=a("./properties").defineProperty,e={};["UNKNOWN_ERROR","NOT_IMPLEMENTED","MISSING_NEW","INVALID_ARGUMENT","MISSING_ARGUMENT","UNEXPECTED_ARGUMENT","UNSUPPORTED_OPERATION"].forEach(function(a){d(e,a,a)}),d(e,"throwError",function(a,b,c){b||(b=e.UNKNOWN_ERROR),c||(c={});var d=[];Object.keys(c).forEach(function(a){d.push(a+"="+JSON.stringify(c[a]))});var f=a;d.length&&(a+=" ("+d.join(", ")+")");var g=new Error(a);throw g.reason=f,g.code=b,Object.keys(c).forEach(function(a){g[a]=c[a]}),g}),d(e,"checkNew",function(a,b){a instanceof b||e.throwError("missing new",e.MISSING_NEW,{name:b.name})}),b.exports=e},{"./properties":30}],26:[function(a,b,c){"use strict";function d(a){return e(f.toUtf8Bytes(a))}var e=a("./keccak256"),f=a("./utf8");b.exports=d},{"./keccak256":28,"./utf8":36}],27:[function(a,b,c){"use strict";var d=a("./address"),e=a("./abi-coder"),f=a("./bignumber"),g=a("./contract-address"),h=a("./convert"),i=a("./id"),j=a("./keccak256"),k=a("./namehash"),l=a("./sha2").sha256,m=a("./solidity"),n=a("./random-bytes"),o=a("./properties"),p=a("./rlp"),q=a("./utf8"),r=a("./units");b.exports={AbiCoder:e,RLP:p,defineProperty:o.defineProperty,etherSymbol:"Ξ",arrayify:h.arrayify,concat:h.concat,padZeros:h.padZeros,stripZeros:h.stripZeros,bigNumberify:f.bigNumberify,BigNumber:f.BigNumber,hexlify:h.hexlify,toUtf8Bytes:q.toUtf8Bytes,toUtf8String:q.toUtf8String,namehash:k,id:i,getAddress:d.getAddress,getContractAddress:g.getContractAddress,formatEther:r.formatEther,parseEther:r.parseEther,formatUnits:r.formatUnits,parseUnits:r.parseUnits,keccak256:j,sha256:l,randomBytes:n,solidityPack:m.pack,solidityKeccak256:m.keccak256,soliditySha256:m.sha256,splitSignature:h.splitSignature}},{"./abi-coder":19,"./address":20,"./bignumber":21,"./contract-address":23,"./convert":24,"./id":26,"./keccak256":28,"./namehash":29,"./properties":30,"./random-bytes":22,"./rlp":31,"./sha2":32,"./solidity":33,"./units":35,"./utf8":36}],28:[function(a,b,c){"use strict";function d(a){return a=f.arrayify(a),"0x"+e.keccak_256(a)}var e=a("js-sha3"),f=a("./convert.js");b.exports=d},{"./convert.js":24,"js-sha3":16}],29:[function(a,b,c){"use strict";function d(a,b){if(a=a.toLowerCase(),!a.match(j))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var c=h,d=0;a.length&&(!b||d>=8;return b}function e(a,b,c){for(var d=0,e=0;eb+1+d)throw new Error("invalid rlp")}return{consumed:1+d,result:e}}function i(a,b){if(0===a.length)throw new Error("invalid rlp data");if(a[b]>=248){var c=a[b]-247;if(b+1+c>a.length)throw new Error("too short");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("to short");return h(a,b,b+1+c,c+d)}if(a[b]>=192){var d=a[b]-192;if(b+1+d>a.length)throw new Error("invalid rlp data");return h(a,b,b+1,d)}if(a[b]>=184){var c=a[b]-183;if(b+1+c>a.length)throw new Error("invalid rlp data");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("invalid rlp data");var f=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){var d=a[b]-128;if(b+1+d>a.offset)throw new Error("invlaid rlp data");var f=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}function j(a){a=k.arrayify(a);var b=i(a,0);if(b.consumed!==a.length)throw new Error("invalid rlp data");return b.result}var k=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":24}],32:[function(a,b,c){"use strict";function d(a){return a=g.arrayify(a),"0x"+f.sha256().update(a).digest("hex")}function e(a){return a=g.arrayify(a),"0x"+f.sha512().update(a).digest("hex")}var f=a("hash.js"),g=a("./convert.js");b.exports={sha256:d,sha512:e,createSha256:f.sha256,createSha512:f.sha512}},{"./convert.js":24,"hash.js":3}],33:[function(a,b,c){"use strict";function d(a,b,c){switch(a){case"address":return c?i.padZeros(b,32):i.arrayify(b);case"string":return j.toUtf8Bytes(b);case"bytes":return i.arrayify(b);case"bool":return b=b?"0x01":"0x00",c?i.padZeros(b,32):i.arrayify(b)}var e=a.match(n);if(e){var f=("int"===e[1],parseInt(e[2]||"256"));if(f%8!=0||0===f||f>256)throw new Error("invalid number type - "+a);return c&&(f=256),b=h(b).toTwos(f),i.padZeros(b,f/8)}if(e=a.match(m)){var f=e[1];if(f!=parseInt(f)||0===f||f>32)throw new Error("invalid number type - "+a);if(f=parseInt(f),i.arrayify(b).byteLength!==f)throw new Error("invalid value for "+a);return c?(b+p).substring(0,66):b}if(e=a.match(o)){var g=e[1],k=parseInt(e[2]||b.length);if(k!=b.length)throw new Error("invalid value for "+a);var l=[];return b.forEach(function(a){a=d(g,a,!0),l.push(a)}),i.concat(l)}throw new Error("unknown type - "+a)}function e(a,b){if(a.length!=b.length)throw new Error("type/value count mismatch");var c=[];return a.forEach(function(a,e){c.push(d(a,b[e]))}),i.hexlify(i.concat(c))}function f(a,b){return k(e(a,b))}function g(a,b){return l(e(a,b))}var h=a("./bignumber").bigNumberify,i=a("./convert"),j=(a("./address").getAddress,a("./utf8")),k=a("./keccak256"),l=a("./sha2").sha256,m=new RegExp("^bytes([0-9]+)$"),n=new RegExp("^(u?int)([0-9]*)$"),o=new RegExp("^(.*)\\[([0-9]*)\\]$"),p="0000000000000000000000000000000000000000000000000000000000000000";b.exports={pack:e,keccak256:f,sha256:g}},{"./address":20,"./bignumber":21,"./convert":24,"./keccak256":28,"./sha2":32,"./utf8":36}],34:[function(a,b,c){"use strict";function d(a,b){var c=new Error(a);for(var d in b)c[d]=b[d];throw c}b.exports=d},{}],35:[function(a,b,c){function d(a,b,c){"object"!=typeof b||c||(c=b,b=void 0),null==b&&(b=18);var d=m(b);a=h(a),c||(c={});var e=a.lt(j);e&&(a=a.mul(k));for(var f=a.mod(d.tenPower).toString(10);f.length2&&i("too many decimal points",{input:a});var f=e[0],g=e[1];for(f||(f="0"),g||(g="0"),g.length>c.decimals&&i("too many decimal places",{input:a,decimals:g.length});g.length=0&&c<=256){for(var e="1",f=0;f>6|192,b[c++]=63&e|128):55296==(64512&e)&&d+1>18|240,b[c++]=e>>12&63|128,b[c++]=e>>6&63|128,b[c++]=63&e|128):(b[c++]=e>>12|224,b[c++]=e>>6&63|128,b[c++]=63&e|128)}return f.arrayify(b)}function e(a){a=f.arrayify(a);for(var b="",c=0;c>7!=0){if(d>>6!=2){var e=null;if(d>>5==6)e=1;else if(d>>4==14)e=2;else if(d>>3==30)e=3;else if(d>>2==62)e=4;else{if(d>>1!=126)continue;e=5}if(c+e>a.length){for(;c>6==2;c++);if(c!=a.length)continue;return b}var g,h=d&(1<<8-e-1)-1;for(g=0;g>6!=2)break;h=h<<6|63&i}g==e?h<=65535?b+=String.fromCharCode(h):(h-=65536,b+=String.fromCharCode((h>>10&1023)+55296,(1023&h)+56320)):c--}}else b+=String.fromCharCode(d)}return b}var f=a("./convert.js");b.exports={toUtf8Bytes:d,toUtf8String:e}},{"./convert.js":24}]},{},[27])(27)}); \ No newline at end of file +a[26]=P^~R&J,a[27]=Q^~S&K,a[36]=Z^~_&T,a[37]=$^~aa&U,a[46]=ha^~ja&ba,a[47]=ia^~ka&ca,a[8]=x^~p&r,a[9]=y^~q&s,a[18]=H^~z&B,a[19]=I^~A&C,a[28]=R^~J&L,a[29]=S^~K&M,a[38]=_^~T&V,a[39]=aa^~U&W,a[48]=ja^~ba&da,a[49]=ka^~ca&ea,a[0]^=m[d],a[1]^=m[d+1]};if(g)b.exports=v;else for(var x=0;x=0?c:"")+"]";return{coder:b,localName:d,length:c,name:"array",type:e,encode:function(a){Array.isArray(a)||n("invalid array");var d=c,e=new Uint8Array(0);d===-1&&(d=a.length,e=v.encode(d)),d!==a.length&&n("size mismatch");var f=[];return a.forEach(function(a){f.push(b)}),o.concat([e,g(f,a)])},decode:function(d,f){var g=0,i=c;if(i===-1){var j=v.decode(d,f);i=j.value.toNumber(),g+=j.consumed,f+=j.consumed}for(var k=[],l=0;l256||f%8!==0)&&n("invalid type",{type:b}),u(a,f/8,"int"===e[1],c)}var e=b.match(p);if(e){var f=parseInt(e[1]);return(0===f||f>32)&&n("invalid type "+b),x(a,f,c)}var e=b.match(r);if(e){var f=parseInt(e[2]||-1);return i(a,l(a,e[1],c),f,c)}if("tuple("===b.substring(0,6)&&")"===b.substring(b.length-1)){var g=[],h=[];return c&&"object"==typeof c&&(Array.isArray(c.names)&&(h=c.names),"string"==typeof c.name&&(c=c.name)),k(b.substring(6,b.length-1)).forEach(function(b,c){g.push(l(a,b,h[c]))}),j(a,g,c)}return""===b?t(a):void n("invalid type",{type:b})}function m(a){if(!(this instanceof m))throw new Error("missing new");a||(a=s),o.defineProperty(this,"coerceFunc",a)}var n=a("../utils/throw-error"),o=function(){var b=a("../utils/convert.js"),c=a("../utils/utf8.js");return{defineProperty:a("../utils/properties.js").defineProperty,arrayify:b.arrayify,padZeros:b.padZeros,bigNumberify:a("../utils/bignumber.js").bigNumberify,getAddress:a("../utils/address").getAddress,concat:b.concat,toUtf8Bytes:c.toUtf8Bytes,toUtf8String:c.toUtf8String,hexlify:b.hexlify}}(),p=new RegExp(/^bytes([0-9]*)$/),q=new RegExp(/^(u?int)([0-9]*)$/),r=new RegExp(/^(.*)\[([0-9]*)\]$/),s=function(a,b){var c=a.match(q);return c&&parseInt(c[2])<=48?b.toNumber():b},t=function(a){return{name:"null",type:"",encode:function(a){return o.arrayify([])},decode:function(b,c){if(c>b.length)throw new Error("invalid null");return{consumed:0,value:a("null",void 0)}},dynamic:!1}},u=function(a,b,c,d){var e=(c?"int":"uint")+8*b;return{localName:d,name:e,type:e,encode:function(a){return a=o.bigNumberify(a).toTwos(8*b).maskn(8*b),c&&(a=a.fromTwos(8*b).toTwos(256)),o.padZeros(o.arrayify(a),32)},decode:function(d,f){d.length>1]>>4>=8&&(a[c]=a[c].toUpperCase()),(15&b[c>>1])>=8&&(a[c+1]=a[c+1].toUpperCase());return"0x"+a.join("")}function e(a){return Math.log10?Math.log10(a):Math.log(a)/Math.LN10}function f(a,b){var c=null;if("string"!=typeof a&&i("invalid address",{input:a}),a.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==a.substring(0,2)&&(a="0x"+a),c=d(a),a.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&c!==a&&i("invalid address checksum",{input:a,expected:c});else if(a.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(a.substring(2,4)!==l(a)&&i("invalid address icap checksum",{input:a}),c=new g(a.substring(4),36).toString(16);c.length<40;)c="0"+c;c=d("0x"+c)}else i("invalid address",{input:a});if(b){for(var e=new g(c.substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e}return c}var g=a("bn.js"),h=a("./convert"),i=a("./throw-error"),j=a("./keccak256"),k=9007199254740991,l=function(){for(var a={},b=0;b<10;b++)a[String(b)]=String(b);for(var b=0;b<26;b++)a[String.fromCharCode(65+b)]=String(10+b);var c=Math.floor(e(k));return function(b){b=b.toUpperCase(),b=b.substring(4)+b.substring(0,2)+"00";for(var d=b.split(""),e=0;e=c;){var f=d.substring(0,c);d=parseInt(f,10)%97+d.substring(f.length)}for(var g=String(98-parseInt(d,10)%97);g.length<2;)g="0"+g;return g}}();b.exports={getAddress:f}},{"./convert":25,"./keccak256":29,"./throw-error":35,"bn.js":1}],21:[function(a,b,c){function d(a){if(!(this instanceof d))throw new Error("missing new");i.isHexString(a)?("0x"==a&&(a="0x0"),a=new g(a.substring(2),16)):"string"==typeof a&&"-"===a[0]&&i.isHexString(a.substring(1))?a=new g(a.substring(3),16).mul(d.constantNegativeOne._bn):"string"==typeof a&&a.match(/^-?[0-9]*$/)?(""==a&&(a="0"),a=new g(a)):"number"==typeof a&&parseInt(a)==a?a=new g(a):g.isBN(a)||(e(a)?a=a._bn:i.isArrayish(a)?a=new g(i.hexlify(a).substring(2),16):j("invalid BigNumber value",{input:a})),h(this,"_bn",a)}function e(a){return a._bn&&a._bn.mod}function f(a){return e(a)?a:new d(a)}var g=a("bn.js"),h=a("./properties").defineProperty,i=a("./convert"),j=a("./throw-error");h(d,"constantNegativeOne",f(-1)),h(d,"constantZero",f(0)),h(d,"constantOne",f(1)),h(d,"constantTwo",f(2)),h(d,"constantWeiPerEther",f(new g("1000000000000000000"))),h(d.prototype,"fromTwos",function(a){return new d(this._bn.fromTwos(a))}),h(d.prototype,"toTwos",function(a){return new d(this._bn.toTwos(a))}),h(d.prototype,"add",function(a){return new d(this._bn.add(f(a)._bn))}),h(d.prototype,"sub",function(a){return new d(this._bn.sub(f(a)._bn))}),h(d.prototype,"div",function(a){return new d(this._bn.div(f(a)._bn))}),h(d.prototype,"mul",function(a){return new d(this._bn.mul(f(a)._bn))}),h(d.prototype,"mod",function(a){return new d(this._bn.mod(f(a)._bn))}),h(d.prototype,"pow",function(a){return new d(this._bn.pow(f(a)._bn))}),h(d.prototype,"maskn",function(a){return new d(this._bn.maskn(a))}),h(d.prototype,"eq",function(a){return this._bn.eq(f(a)._bn)}),h(d.prototype,"lt",function(a){return this._bn.lt(f(a)._bn)}),h(d.prototype,"lte",function(a){return this._bn.lte(f(a)._bn)}),h(d.prototype,"gt",function(a){return this._bn.gt(f(a)._bn)}),h(d.prototype,"gte",function(a){return this._bn.gte(f(a)._bn)}),h(d.prototype,"isZero",function(){return this._bn.isZero()}),h(d.prototype,"toNumber",function(a){return this._bn.toNumber()}),h(d.prototype,"toString",function(){return this._bn.toString(10)}),h(d.prototype,"toHexString",function(){var a=this._bn.toString(16);return a.length%2&&(a="0"+a),"0x"+a}),b.exports={isBigNumber:e,bigNumberify:f,BigNumber:d}},{"./convert":25,"./properties":31,"./throw-error":35,"bn.js":1}],22:[function(a,b,c){"use strict";var d=a("./convert");b.exports={decode:function(a){a=atob(a);for(var b=[],c=0;c1024||parseInt(a)!=a)throw new Error("invalid length");var b=new Uint8Array(a);return g.getRandomValues(b),e.arrayify(b)}var e=a("./convert"),f=a("./properties").defineProperty,g=c.crypto||c.msCrypto;g&&g.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),g={getRandomValues:function(a){for(var b=0;b<20;b++)for(var c=0;c=256||parseInt(c)!=c)return!1}return!0}function f(a){if(null==a&&o.throwError("cannot convert null value to array",o.INVALID_ARGUMENT,{arg:"value",value:a}),a&&a.toHexString&&(a=a.toHexString()),j(a)){a=a.substring(2),a.length%2&&(a="0"+a);for(var b=[],c=0;c>4]+p[15&f])}return"0x"+c.join("")}o.throwError("invalid hexlify value",{arg:"value",value:a})}function l(a){for(;a.length>3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function m(a,b){for(;a.length<2*b+2;)a="0x0"+a.substring(2);return a}function n(a){if(a=f(a),65!==a.length)throw new Error("invalid signature");var b=a[64];return 27!==b&&28!==b&&(b=27+b%2),{r:k(a.slice(0,32)),s:k(a.slice(32,64)),v:b}}var o=(a("./properties.js").defineProperty,a("./errors")),p="0123456789abcdef";b.exports={arrayify:f,isArrayish:e,concat:g,padZeros:i,stripZeros:h,splitSignature:n,hexlify:k,isHexString:j,hexStripZeros:l,hexZeroPad:m}},{"./errors":26,"./properties.js":31}],26:[function(a,b,c){"use strict";var d=a("./properties").defineProperty,e={};["UNKNOWN_ERROR","NOT_IMPLEMENTED","MISSING_NEW","INVALID_ARGUMENT","MISSING_ARGUMENT","UNEXPECTED_ARGUMENT","UNSUPPORTED_OPERATION"].forEach(function(a){d(e,a,a)}),d(e,"throwError",function(a,b,c){b||(b=e.UNKNOWN_ERROR),c||(c={});var d=[];Object.keys(c).forEach(function(a){d.push(a+"="+JSON.stringify(c[a]))});var f=a;d.length&&(a+=" ("+d.join(", ")+")");var g=new Error(a);throw g.reason=f,g.code=b,Object.keys(c).forEach(function(a){g[a]=c[a]}),g}),d(e,"checkNew",function(a,b){a instanceof b||e.throwError("missing new",e.MISSING_NEW,{name:b.name})}),b.exports=e},{"./properties":31}],27:[function(a,b,c){"use strict";function d(a){return e(f.toUtf8Bytes(a))}var e=a("./keccak256"),f=a("./utf8");b.exports=d},{"./keccak256":29,"./utf8":37}],28:[function(a,b,c){"use strict";var d=a("./address"),e=a("./abi-coder"),f=a("./base64"),g=a("./bignumber"),h=a("./contract-address"),i=a("./convert"),j=a("./id"),k=a("./keccak256"),l=a("./namehash"),m=a("./sha2").sha256,n=a("./solidity"),o=a("./random-bytes"),p=a("./properties"),q=a("./rlp"),r=a("./utf8"),s=a("./units");b.exports={AbiCoder:e,RLP:q,defineProperty:p.defineProperty,etherSymbol:"Ξ",arrayify:i.arrayify,concat:i.concat,padZeros:i.padZeros,stripZeros:i.stripZeros,base64:f,bigNumberify:g.bigNumberify,BigNumber:g.BigNumber,hexlify:i.hexlify,toUtf8Bytes:r.toUtf8Bytes,toUtf8String:r.toUtf8String,namehash:l,id:j,getAddress:d.getAddress,getContractAddress:h.getContractAddress,formatEther:s.formatEther,parseEther:s.parseEther,formatUnits:s.formatUnits,parseUnits:s.parseUnits,keccak256:k,sha256:m,randomBytes:o,solidityPack:n.pack,solidityKeccak256:n.keccak256,soliditySha256:n.sha256,splitSignature:i.splitSignature}},{"./abi-coder":19,"./address":20,"./base64":22,"./bignumber":21,"./contract-address":24,"./convert":25,"./id":27,"./keccak256":29,"./namehash":30,"./properties":31,"./random-bytes":23,"./rlp":32,"./sha2":33,"./solidity":34,"./units":36,"./utf8":37}],29:[function(a,b,c){"use strict";function d(a){return a=f.arrayify(a),"0x"+e.keccak_256(a)}var e=a("js-sha3"),f=a("./convert.js");b.exports=d},{"./convert.js":25,"js-sha3":16}],30:[function(a,b,c){"use strict";function d(a,b){if(a=a.toLowerCase(),!a.match(j))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var c=h,d=0;a.length&&(!b||d>=8;return b}function e(a,b,c){for(var d=0,e=0;eb+1+d)throw new Error("invalid rlp")}return{consumed:1+d,result:e}}function i(a,b){if(0===a.length)throw new Error("invalid rlp data");if(a[b]>=248){var c=a[b]-247;if(b+1+c>a.length)throw new Error("too short");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("to short");return h(a,b,b+1+c,c+d)}if(a[b]>=192){var d=a[b]-192;if(b+1+d>a.length)throw new Error("invalid rlp data");return h(a,b,b+1,d)}if(a[b]>=184){var c=a[b]-183;if(b+1+c>a.length)throw new Error("invalid rlp data");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("invalid rlp data");var f=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){var d=a[b]-128;if(b+1+d>a.offset)throw new Error("invlaid rlp data");var f=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}function j(a){a=k.arrayify(a);var b=i(a,0);if(b.consumed!==a.length)throw new Error("invalid rlp data");return b.result}var k=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":25}],33:[function(a,b,c){"use strict";function d(a){return a=g.arrayify(a),"0x"+f.sha256().update(a).digest("hex")}function e(a){return a=g.arrayify(a),"0x"+f.sha512().update(a).digest("hex")}var f=a("hash.js"),g=a("./convert.js");b.exports={sha256:d,sha512:e,createSha256:f.sha256,createSha512:f.sha512}},{"./convert.js":25,"hash.js":3}],34:[function(a,b,c){"use strict";function d(a,b,c){switch(a){case"address":return c?i.padZeros(b,32):i.arrayify(b);case"string":return j.toUtf8Bytes(b);case"bytes":return i.arrayify(b);case"bool":return b=b?"0x01":"0x00",c?i.padZeros(b,32):i.arrayify(b)}var e=a.match(n);if(e){var f=("int"===e[1],parseInt(e[2]||"256"));if(f%8!=0||0===f||f>256)throw new Error("invalid number type - "+a);return c&&(f=256),b=h(b).toTwos(f),i.padZeros(b,f/8)}if(e=a.match(m)){var f=e[1];if(f!=parseInt(f)||0===f||f>32)throw new Error("invalid number type - "+a);if(f=parseInt(f),i.arrayify(b).byteLength!==f)throw new Error("invalid value for "+a);return c?(b+p).substring(0,66):b}if(e=a.match(o)){var g=e[1],k=parseInt(e[2]||b.length);if(k!=b.length)throw new Error("invalid value for "+a);var l=[];return b.forEach(function(a){a=d(g,a,!0),l.push(a)}),i.concat(l)}throw new Error("unknown type - "+a)}function e(a,b){if(a.length!=b.length)throw new Error("type/value count mismatch");var c=[];return a.forEach(function(a,e){c.push(d(a,b[e]))}),i.hexlify(i.concat(c))}function f(a,b){return k(e(a,b))}function g(a,b){return l(e(a,b))}var h=a("./bignumber").bigNumberify,i=a("./convert"),j=(a("./address").getAddress,a("./utf8")),k=a("./keccak256"),l=a("./sha2").sha256,m=new RegExp("^bytes([0-9]+)$"),n=new RegExp("^(u?int)([0-9]*)$"),o=new RegExp("^(.*)\\[([0-9]*)\\]$"),p="0000000000000000000000000000000000000000000000000000000000000000";b.exports={pack:e,keccak256:f,sha256:g}},{"./address":20,"./bignumber":21,"./convert":25,"./keccak256":29,"./sha2":33,"./utf8":37}],35:[function(a,b,c){"use strict";function d(a,b){var c=new Error(a);for(var d in b)c[d]=b[d];throw c}b.exports=d},{}],36:[function(a,b,c){function d(a,b,c){"object"!=typeof b||c||(c=b,b=void 0),null==b&&(b=18);var d=m(b);a=h(a),c||(c={});var e=a.lt(j);e&&(a=a.mul(k));for(var f=a.mod(d.tenPower).toString(10);f.length2&&i("too many decimal points",{input:a});var f=e[0],g=e[1];for(f||(f="0"),g||(g="0"),g.length>c.decimals&&i("too many decimal places",{input:a,decimals:g.length});g.length=0&&c<=256){for(var e="1",f=0;f>6|192,b[c++]=63&e|128):55296==(64512&e)&&d+1>18|240,b[c++]=e>>12&63|128,b[c++]=e>>6&63|128,b[c++]=63&e|128):(b[c++]=e>>12|224,b[c++]=e>>6&63|128,b[c++]=63&e|128)}return f.arrayify(b)}function e(a){a=f.arrayify(a);for(var b="",c=0;c>7!=0){if(d>>6!=2){var e=null;if(d>>5==6)e=1;else if(d>>4==14)e=2;else if(d>>3==30)e=3;else if(d>>2==62)e=4;else{if(d>>1!=126)continue;e=5}if(c+e>a.length){for(;c>6==2;c++);if(c!=a.length)continue;return b}var g,h=d&(1<<8-e-1)-1;for(g=0;g>6!=2)break;h=h<<6|63&i}g==e?h<=65535?b+=String.fromCharCode(h):(h-=65536,b+=String.fromCharCode((h>>10&1023)+55296,(1023&h)+56320)):c--}}else b+=String.fromCharCode(d)}return b}var f=a("./convert.js");b.exports={toUtf8Bytes:d,toUtf8String:e}},{"./convert.js":25}]},{},[28])(28)}); \ No newline at end of file diff --git a/dist/ethers-wallet.js b/dist/ethers-wallet.js index 60df43991..49fe8836c 100644 --- a/dist/ethers-wallet.js +++ b/dist/ethers-wallet.js @@ -4229,7 +4229,7 @@ },{"buffer":4}],3:[function(require,module,exports){ var randomBytes = require('../../utils').randomBytes; module.exports = function(length) { return randomBytes(length); }; -},{"../../utils":50}],4:[function(require,module,exports){ +},{"../../utils":51}],4:[function(require,module,exports){ },{}],5:[function(require,module,exports){ 'use strict'; @@ -9416,7 +9416,7 @@ utils.defineProperty(Coder, 'defaultCoder', new Coder()); module.exports = Coder -},{"../utils/address":42,"../utils/bignumber.js":43,"../utils/convert.js":46,"../utils/properties.js":54,"../utils/throw-error":58,"../utils/utf8.js":60}],42:[function(require,module,exports){ +},{"../utils/address":42,"../utils/bignumber.js":43,"../utils/convert.js":47,"../utils/properties.js":55,"../utils/throw-error":59,"../utils/utf8.js":61}],42:[function(require,module,exports){ var BN = require('bn.js'); @@ -9542,7 +9542,7 @@ module.exports = { getAddress: getAddress, } -},{"./convert":46,"./keccak256":51,"./throw-error":58,"bn.js":2}],43:[function(require,module,exports){ +},{"./convert":47,"./keccak256":52,"./throw-error":59,"bn.js":2}],43:[function(require,module,exports){ /** * BigNumber * @@ -9693,7 +9693,33 @@ module.exports = { BigNumber: BigNumber }; -},{"./convert":46,"./properties":54,"./throw-error":58,"bn.js":2}],44:[function(require,module,exports){ +},{"./convert":47,"./properties":55,"./throw-error":59,"bn.js":2}],44:[function(require,module,exports){ +'use strict'; + +var convert = require('./convert'); + +module.exports = { + decode: function(textData) { + textData = atob(textData); + var data = []; + for (var i = 0; i < textData.length; i++) { + data.push(textData.charCodeAt(i)); + } + return convert.arrayify(data); + }, + encode: function(data) { + data = convert.arrayify(data); + var textData = ''; + for (var i = 0; i < data.length; i++) { + textData += String.fromCharCode(data[i]); + } + return btoa(textData); + } +}; + + + +},{"./convert":47}],45:[function(require,module,exports){ (function (global){ 'use strict'; @@ -9740,7 +9766,7 @@ if (crypto._weakCrypto === true) { module.exports = randomBytes; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./convert":46,"./properties":54}],45:[function(require,module,exports){ +},{"./convert":47,"./properties":55}],46:[function(require,module,exports){ var getAddress = require('./address').getAddress; var convert = require('./convert'); @@ -9762,7 +9788,7 @@ module.exports = { getContractAddress: getContractAddress, } -},{"./address":42,"./convert":46,"./keccak256":51,"./rlp":55}],46:[function(require,module,exports){ +},{"./address":42,"./convert":47,"./keccak256":52,"./rlp":56}],47:[function(require,module,exports){ /** * Conversion Utilities * @@ -9988,7 +10014,7 @@ module.exports = { hexZeroPad: hexZeroPad, }; -},{"./errors":47,"./properties.js":54}],47:[function(require,module,exports){ +},{"./errors":48,"./properties.js":55}],48:[function(require,module,exports){ 'use strict'; var defineProperty = require('./properties').defineProperty; @@ -10061,7 +10087,7 @@ defineProperty(codes, 'checkNew', function(self, kind) { module.exports = codes; -},{"./properties":54}],48:[function(require,module,exports){ +},{"./properties":55}],49:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -10087,7 +10113,7 @@ module.exports = { createSha512Hmac: createSha512Hmac, }; -},{"./convert.js":46,"./sha2.js":56,"hash.js":20}],49:[function(require,module,exports){ +},{"./convert.js":47,"./sha2.js":57,"hash.js":20}],50:[function(require,module,exports){ 'use strict'; var keccak256 = require('./keccak256'); @@ -10099,7 +10125,7 @@ function id(text) { module.exports = id; -},{"./keccak256":51,"./utf8":60}],50:[function(require,module,exports){ +},{"./keccak256":52,"./utf8":61}],51:[function(require,module,exports){ 'use strict'; // This is SUPER useful, but adds 140kb (even zipped, adds 40kb) @@ -10107,6 +10133,7 @@ module.exports = id; var address = require('./address'); var AbiCoder = require('./abi-coder'); +var base64 = require('./base64'); var bigNumber = require('./bignumber'); var contractAddress = require('./contract-address'); var convert = require('./convert'); @@ -10141,6 +10168,8 @@ module.exports = { padZeros: convert.padZeros, stripZeros: convert.stripZeros, + base64: base64, + bigNumberify: bigNumber.bigNumberify, BigNumber: bigNumber.BigNumber, @@ -10173,7 +10202,7 @@ module.exports = { splitSignature: convert.splitSignature, } -},{"./abi-coder":41,"./address":42,"./bignumber":43,"./contract-address":45,"./convert":46,"./id":49,"./keccak256":51,"./namehash":52,"./properties":54,"./random-bytes":44,"./rlp":55,"./sha2":56,"./solidity":57,"./units":59,"./utf8":60}],51:[function(require,module,exports){ +},{"./abi-coder":41,"./address":42,"./base64":44,"./bignumber":43,"./contract-address":46,"./convert":47,"./id":50,"./keccak256":52,"./namehash":53,"./properties":55,"./random-bytes":45,"./rlp":56,"./sha2":57,"./solidity":58,"./units":60,"./utf8":61}],52:[function(require,module,exports){ 'use strict'; var sha3 = require('js-sha3'); @@ -10187,7 +10216,7 @@ function keccak256(data) { module.exports = keccak256; -},{"./convert.js":46,"js-sha3":34}],52:[function(require,module,exports){ +},{"./convert.js":47,"js-sha3":34}],53:[function(require,module,exports){ 'use strict'; var convert = require('./convert'); @@ -10227,7 +10256,7 @@ function namehash(name, depth) { module.exports = namehash; -},{"./convert":46,"./keccak256":51,"./utf8":60}],53:[function(require,module,exports){ +},{"./convert":47,"./keccak256":52,"./utf8":61}],54:[function(require,module,exports){ 'use strict'; var convert = require('./convert'); @@ -10280,7 +10309,7 @@ function pbkdf2(password, salt, iterations, keylen, createHmac) { module.exports = pbkdf2; -},{"./convert":46}],54:[function(require,module,exports){ +},{"./convert":47}],55:[function(require,module,exports){ 'use strict'; function defineProperty(object, name, value) { @@ -10304,7 +10333,7 @@ module.exports = { defineProperty: defineProperty, }; -},{}],55:[function(require,module,exports){ +},{}],56:[function(require,module,exports){ //See: https://github.com/ethereum/wiki/wiki/RLP var convert = require('./convert.js'); @@ -10448,7 +10477,7 @@ module.exports = { decode: decode, } -},{"./convert.js":46}],56:[function(require,module,exports){ +},{"./convert.js":47}],57:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -10473,7 +10502,7 @@ module.exports = { createSha512: hash.sha512, } -},{"./convert.js":46,"hash.js":20}],57:[function(require,module,exports){ +},{"./convert.js":47,"hash.js":20}],58:[function(require,module,exports){ 'use strict'; var bigNumberify = require('./bignumber').bigNumberify; @@ -10572,7 +10601,7 @@ module.exports = { sha256: sha256, } -},{"./address":42,"./bignumber":43,"./convert":46,"./keccak256":51,"./sha2":56,"./utf8":60}],58:[function(require,module,exports){ +},{"./address":42,"./bignumber":43,"./convert":47,"./keccak256":52,"./sha2":57,"./utf8":61}],59:[function(require,module,exports){ 'use strict'; function throwError(message, params) { @@ -10585,7 +10614,7 @@ function throwError(message, params) { module.exports = throwError; -},{}],59:[function(require,module,exports){ +},{}],60:[function(require,module,exports){ var bigNumberify = require('./bignumber.js').bigNumberify; var throwError = require('./throw-error'); @@ -10735,7 +10764,7 @@ module.exports = { parseUnits: parseUnits, } -},{"./bignumber.js":43,"./throw-error":58}],60:[function(require,module,exports){ +},{"./bignumber.js":43,"./throw-error":59}],61:[function(require,module,exports){ var convert = require('./convert.js'); @@ -10850,7 +10879,7 @@ module.exports = { toUtf8String: bytesToUtf8, }; -},{"./convert.js":46}],61:[function(require,module,exports){ +},{"./convert.js":47}],62:[function(require,module,exports){ // See: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki // See: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki @@ -11111,7 +11140,7 @@ module.exports = { isValidMnemonic: isValidMnemonic, }; -},{"../utils/bignumber.js":43,"../utils/convert.js":46,"../utils/hmac":48,"../utils/pbkdf2.js":53,"../utils/properties.js":54,"../utils/sha2":56,"../utils/utf8.js":60,"./words.json":66,"elliptic":5}],62:[function(require,module,exports){ +},{"../utils/bignumber.js":43,"../utils/convert.js":47,"../utils/hmac":49,"../utils/pbkdf2.js":54,"../utils/properties.js":55,"../utils/sha2":57,"../utils/utf8.js":61,"./words.json":67,"elliptic":5}],63:[function(require,module,exports){ 'use strict'; var Wallet = require('./wallet'); @@ -11125,7 +11154,7 @@ module.exports = { SigningKey: SigningKey, } -},{"./hdnode":61,"./signing-key":64,"./wallet":65}],63:[function(require,module,exports){ +},{"./hdnode":62,"./signing-key":65,"./wallet":66}],64:[function(require,module,exports){ 'use strict'; var aes = require('aes-js'); @@ -11576,7 +11605,7 @@ utils.defineProperty(secretStorage, 'encrypt', function(privateKey, password, op module.exports = secretStorage; -},{"../utils":50,"../utils/hmac":48,"../utils/pbkdf2":53,"./hdnode":61,"./signing-key":64,"aes-js":1,"scrypt-js":37,"uuid":40}],64:[function(require,module,exports){ +},{"../utils":51,"../utils/hmac":49,"../utils/pbkdf2":54,"./hdnode":62,"./signing-key":65,"aes-js":1,"scrypt-js":37,"uuid":40}],65:[function(require,module,exports){ 'use strict'; /** @@ -11678,7 +11707,7 @@ utils.defineProperty(SigningKey, 'publicKeyToAddress', function(publicKey) { module.exports = SigningKey; -},{"../utils/address":42,"../utils/convert":46,"../utils/errors":47,"../utils/keccak256":51,"../utils/properties":54,"elliptic":5}],65:[function(require,module,exports){ +},{"../utils/address":42,"../utils/convert":47,"../utils/errors":48,"../utils/keccak256":52,"../utils/properties":55,"elliptic":5}],66:[function(require,module,exports){ 'use strict'; var scrypt = require('scrypt-js'); @@ -12160,8 +12189,8 @@ utils.defineProperty(Wallet, 'fromBrainWallet', function(username, password, pro module.exports = Wallet; -},{"../utils":50,"../utils/address":42,"../utils/bignumber":43,"../utils/convert":46,"../utils/errors":47,"../utils/keccak256":51,"../utils/properties":54,"../utils/rlp":55,"../utils/utf8":60,"./hdnode":61,"./secret-storage":63,"./signing-key":64,"scrypt-js":37,"setimmediate":38}],66:[function(require,module,exports){ +},{"../utils":51,"../utils/address":42,"../utils/bignumber":43,"../utils/convert":47,"../utils/errors":48,"../utils/keccak256":52,"../utils/properties":55,"../utils/rlp":56,"../utils/utf8":61,"./hdnode":62,"./secret-storage":64,"./signing-key":65,"scrypt-js":37,"setimmediate":38}],67:[function(require,module,exports){ module.exports="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo" -},{}]},{},[62])(62) +},{}]},{},[63])(63) }); \ No newline at end of file diff --git a/dist/ethers-wallet.min.js b/dist/ethers-wallet.min.js index 305de9b34..b8e9b5cac 100644 --- a/dist/ethers-wallet.min.js +++ b/dist/ethers-wallet.min.js @@ -1,7 +1,7 @@ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.ethers=a()}}(function(){var a;return function(){function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g255)return!1;return!0}function g(a,b){if(a.buffer&&ArrayBuffer.isView(a)&&"Uint8Array"===a.name)return b&&(a=a.slice?a.slice():Array.prototype.slice.call(a)),a;if(Array.isArray(a)){if(!f(a))throw new Error("Array contains invalid value: "+a);return new Uint8Array(a)}if(e(a.length)&&f(a))return new Uint8Array(a);throw new Error("unsupported array-like object")}function h(a){return new Uint8Array(a)}function i(a,b,c,d,e){null==d&&null==e||(a=a.slice?a.slice(d,e):Array.prototype.slice.call(a,d,e)),b.set(a,c)}function j(a){for(var b=[],c=0;c16)throw new Error("PKCS#7 padding byte out of range");for(var c=a.length-b,d=0;d191&&d<224?(b.push(String.fromCharCode((31&d)<<6|63&a[c+1])),c+=2):(b.push(String.fromCharCode((15&d)<<12|(63&a[c+1])<<6|63&a[c+2])),c+=3)}return b.join("")}return{toBytes:a,fromBytes:b}}(),n=function(){function a(a){for(var b=[],c=0;c>4]+c[15&e])}return b.join("")}var c="0123456789abcdef";return{toBytes:a,fromBytes:b}}(),o={16:10,24:12,32:14},p=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],q=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],r=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],s=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],t=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],u=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],v=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],w=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],x=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],y=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],z=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],B=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],C=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],D=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925],E=function(a){ if(!(this instanceof E))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:g(a,!0)}),this._prepare()};E.prototype._prepare=function(){var a=o[this.key.length];if(null==a)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var b=0;b<=a;b++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var c,d=4*(a+1),e=this.key.length/4,f=j(this.key),b=0;b>2,this._Ke[c][b%4]=f[b],this._Kd[a-c][b%4]=f[b];for(var g,h=0,i=e;i>16&255]<<24^q[g>>8&255]<<16^q[255&g]<<8^q[g>>24&255]^p[h]<<24,h+=1,8!=e)for(var b=1;b>8&255]<<8^q[g>>16&255]<<16^q[g>>24&255]<<24;for(var b=e/2+1;b>2,l=i%4,this._Ke[k][l]=f[b],this._Kd[a-k][l]=f[b++],i++}for(var k=1;k>24&255]^B[g>>16&255]^C[g>>8&255]^D[255&g]},E.prototype.encrypt=function(a){if(16!=a.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var b=this._Ke.length-1,c=[0,0,0,0],d=j(a),e=0;e<4;e++)d[e]^=this._Ke[0][e];for(var f=1;f>24&255]^t[d[(e+1)%4]>>16&255]^u[d[(e+2)%4]>>8&255]^v[255&d[(e+3)%4]]^this._Ke[f][e];d=c.slice()}for(var g,i=h(16),e=0;e<4;e++)g=this._Ke[b][e],i[4*e]=255&(q[d[e]>>24&255]^g>>24),i[4*e+1]=255&(q[d[(e+1)%4]>>16&255]^g>>16),i[4*e+2]=255&(q[d[(e+2)%4]>>8&255]^g>>8),i[4*e+3]=255&(q[255&d[(e+3)%4]]^g);return i},E.prototype.decrypt=function(a){if(16!=a.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var b=this._Kd.length-1,c=[0,0,0,0],d=j(a),e=0;e<4;e++)d[e]^=this._Kd[0][e];for(var f=1;f>24&255]^x[d[(e+3)%4]>>16&255]^y[d[(e+2)%4]>>8&255]^z[255&d[(e+1)%4]]^this._Kd[f][e];d=c.slice()}for(var g,i=h(16),e=0;e<4;e++)g=this._Kd[b][e],i[4*e]=255&(r[d[e]>>24&255]^g>>24),i[4*e+1]=255&(r[d[(e+3)%4]>>16&255]^g>>16),i[4*e+2]=255&(r[d[(e+2)%4]>>8&255]^g>>8),i[4*e+3]=255&(r[255&d[(e+1)%4]]^g);return i};var F=function(a){if(!(this instanceof F))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new E(a)};F.prototype.encrypt=function(a){if(a=g(a),a.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var b=h(a.length),c=h(16),d=0;d=0;--b)this._counter[b]=a%256,a>>=8},J.prototype.setBytes=function(a){if(a=g(a,!0),16!=a.length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=a},J.prototype.increment=function(){for(var a=15;a>=0;a--){if(255!==this._counter[a]){this._counter[a]++;break}this._counter[a]=0}};var K=function(a,b){if(!(this instanceof K))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",b instanceof J||(b=new J(b)),this._counter=b,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new E(a)};K.prototype.encrypt=function(a){for(var b=g(a,!0),c=0;c=49&&g<=54?g-49+10:g>=17&&g<=22?g-17+10:15&g}return d}function h(a,b,c,d){for(var e=0,f=Math.min(a.length,c),g=b;g=49?h-49+10:h>=17?h-17+10:h}return e}function i(a){for(var b=new Array(a.bitLength()),c=0;c>>e}return b}function j(a,b,c){c.negative=b.negative^a.negative;var d=a.length+b.length|0;c.length=d,d=d-1|0;var e=0|a.words[0],f=0|b.words[0],g=e*f,h=67108863&g,i=g/67108864|0;c.words[0]=h;for(var j=1;j>>26,l=67108863&i,m=Math.min(j,b.length-1),n=Math.max(0,j-a.length+1);n<=m;n++){var o=j-n|0;e=0|a.words[o],f=0|b.words[n],g=e*f+l,k+=g/67108864|0,l=67108863&g}c.words[j]=0|l,i=0|k}return 0!==i?c.words[j]=0|i:c.length--,c.strip()}function k(a,b,c){c.negative=b.negative^a.negative,c.length=a.length+b.length;for(var d=0,e=0,f=0;f>>26)|0,e+=g>>>26,g&=67108863}c.words[f]=h,d=g,g=e}return 0!==d?c.words[f]=d:c.length--,c.strip()}function l(a,b,c){var d=new m;return d.mulp(a,b,c)}function m(a,b){this.x=a,this.y=b}function n(a,b){this.name=a,this.p=new f(b,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function o(){n.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){n.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function q(){n.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function r(){n.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function s(a){if("string"==typeof a){var b=f._prime(a);this.m=b.p,this.prime=b}else d(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}function t(a){s.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof b?b.exports=f:c.BN=f,f.BN=f,f.wordSize=26;var u;try{u=a("buffer").Buffer}catch(v){}f.isBN=function(a){return a instanceof f||null!==a&&"object"==typeof a&&a.constructor.wordSize===f.wordSize&&Array.isArray(a.words)},f.max=function(a,b){return a.cmp(b)>0?a:b},f.min=function(a,b){return a.cmp(b)<0?a:b},f.prototype._init=function(a,b,c){if("number"==typeof a)return this._initNumber(a,b,c);if("object"==typeof a)return this._initArray(a,b,c);"hex"===b&&(b=16),d(b===(0|b)&&b>=2&&b<=36),a=a.toString().replace(/\s+/g,"");var e=0;"-"===a[0]&&e++,16===b?this._parseHex(a,e):this._parseBase(a,b,e),"-"===a[0]&&(this.negative=1),this.strip(),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initNumber=function(a,b,c){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[67108863&a],this.length=1):a<4503599627370496?(this.words=[67108863&a,a/67108864&67108863],this.length=2):(d(a<9007199254740992),this.words=[67108863&a,a/67108864&67108863,1],this.length=3),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initArray=function(a,b,c){if(d("number"==typeof a.length),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var e=0;e=0;e-=3)g=a[e]|a[e-1]<<8|a[e-2]<<16,this.words[f]|=g<>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);else if("le"===c)for(e=0,f=0;e>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);return this.strip()},f.prototype._parseHex=function(a,b){this.length=Math.ceil((a.length-b)/6),this.words=new Array(this.length);for(var c=0;c=b;c-=6)e=g(a,c,c+6),this.words[d]|=e<>>26-f&4194303,f+=24,f>=26&&(f-=26,d++);c+6!==b&&(e=g(a,b,c+6),this.words[d]|=e<>>26-f&4194303),this.strip()},f.prototype._parseBase=function(a,b,c){this.words=[0],this.length=1;for(var d=0,e=1;e<=67108863;e*=b)d++;d--,e=e/b|0;for(var f=a.length-c,g=f%d,i=Math.min(f,f-g)+c,j=0,k=c;k1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(a,b){a=a||10,b=0|b||1;var c;if(16===a||"hex"===a){c="";for(var e=0,f=0,g=0;g>>24-e&16777215,c=0!==f||g!==this.length-1?w[6-i.length]+i+c:i+c,e+=2,e>=26&&(e-=26,g--)}for(0!==f&&(c=f.toString(16)+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(a===(0|a)&&a>=2&&a<=36){var j=x[a],k=y[a];c="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modn(k).toString(a);l=l.idivn(k),c=l.isZero()?m+c:w[j-m.length]+m+c}for(this.isZero()&&(c="0"+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}d(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var a=this.words[0];return 2===this.length?a+=67108864*this.words[1]:3===this.length&&1===this.words[2]?a+=4503599627370496+67108864*this.words[1]:this.length>2&&d(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-a:a},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(a,b){return d("undefined"!=typeof u),this.toArrayLike(u,a,b)},f.prototype.toArray=function(a,b){return this.toArrayLike(Array,a,b)},f.prototype.toArrayLike=function(a,b,c){var e=this.byteLength(),f=c||Math.max(1,e);d(e<=f,"byte array longer than desired length"),d(f>0,"Requested array length <= 0"),this.strip();var g,h,i="le"===b,j=new a(f),k=this.clone();if(i){for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[h]=g;for(;h=4096&&(c+=13,b>>>=13),b>=64&&(c+=7,b>>>=7),b>=8&&(c+=4,b>>>=4),b>=2&&(c+=2,b>>>=2),c+b},f.prototype._zeroBits=function(a){if(0===a)return 26;var b=a,c=0;return 0===(8191&b)&&(c+=13,b>>>=13),0===(127&b)&&(c+=7,b>>>=7),0===(15&b)&&(c+=4,b>>>=4),0===(3&b)&&(c+=2,b>>>=2),0===(1&b)&&c++,c},f.prototype.bitLength=function(){var a=this.words[this.length-1],b=this._countBits(a);return 26*(this.length-1)+b},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,b=0;ba.length?this.clone().ior(a):a.clone().ior(this)},f.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},f.prototype.iuand=function(a){var b;b=this.length>a.length?a:this;for(var c=0;ca.length?this.clone().iand(a):a.clone().iand(this)},f.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},f.prototype.iuxor=function(a){var b,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(var d=0;da.length?this.clone().ixor(a):a.clone().ixor(this)},f.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},f.prototype.inotn=function(a){d("number"==typeof a&&a>=0);var b=0|Math.ceil(a/26),c=a%26;this._expand(b),c>0&&b--;for(var e=0;e0&&(this.words[e]=~this.words[e]&67108863>>26-c),this.strip()},f.prototype.notn=function(a){return this.clone().inotn(a)},f.prototype.setn=function(a,b){d("number"==typeof a&&a>=0);var c=a/26|0,e=a%26;return this._expand(c+1),b?this.words[c]=this.words[c]|1<a.length?(c=this,d=a):(c=a,d=this);for(var e=0,f=0;f>>26;for(;0!==e&&f>>26;if(this.length=c.length,0!==e)this.words[this.length]=e,this.length++;else if(c!==this)for(;fa.length?this.clone().iadd(a):a.clone().iadd(this)},f.prototype.isub=function(a){if(0!==a.negative){a.negative=0;var b=this.iadd(a);return a.negative=1,b._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var c=this.cmp(a);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;var d,e;c>0?(d=this,e=a):(d=a,e=this);for(var f=0,g=0;g>26,this.words[g]=67108863&b;for(;0!==f&&g>26,this.words[g]=67108863&b;if(0===f&&g>>13,n=0|g[1],o=8191&n,p=n>>>13,q=0|g[2],r=8191&q,s=q>>>13,t=0|g[3],u=8191&t,v=t>>>13,w=0|g[4],x=8191&w,y=w>>>13,z=0|g[5],A=8191&z,B=z>>>13,C=0|g[6],D=8191&C,E=C>>>13,F=0|g[7],G=8191&F,H=F>>>13,I=0|g[8],J=8191&I,K=I>>>13,L=0|g[9],M=8191&L,N=L>>>13,O=0|h[0],P=8191&O,Q=O>>>13,R=0|h[1],S=8191&R,T=R>>>13,U=0|h[2],V=8191&U,W=U>>>13,X=0|h[3],Y=8191&X,Z=X>>>13,$=0|h[4],_=8191&$,aa=$>>>13,ba=0|h[5],ca=8191&ba,da=ba>>>13,ea=0|h[6],fa=8191&ea,ga=ea>>>13,ha=0|h[7],ia=8191&ha,ja=ha>>>13,ka=0|h[8],la=8191&ka,ma=ka>>>13,na=0|h[9],oa=8191&na,pa=na>>>13;c.negative=a.negative^b.negative,c.length=19,d=Math.imul(l,P),e=Math.imul(l,Q),e=e+Math.imul(m,P)|0,f=Math.imul(m,Q);var qa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(qa>>>26)|0,qa&=67108863,d=Math.imul(o,P),e=Math.imul(o,Q),e=e+Math.imul(p,P)|0,f=Math.imul(p,Q),d=d+Math.imul(l,S)|0,e=e+Math.imul(l,T)|0,e=e+Math.imul(m,S)|0,f=f+Math.imul(m,T)|0;var ra=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ra>>>26)|0,ra&=67108863,d=Math.imul(r,P),e=Math.imul(r,Q),e=e+Math.imul(s,P)|0,f=Math.imul(s,Q),d=d+Math.imul(o,S)|0,e=e+Math.imul(o,T)|0,e=e+Math.imul(p,S)|0,f=f+Math.imul(p,T)|0,d=d+Math.imul(l,V)|0,e=e+Math.imul(l,W)|0,e=e+Math.imul(m,V)|0,f=f+Math.imul(m,W)|0;var sa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(sa>>>26)|0,sa&=67108863,d=Math.imul(u,P),e=Math.imul(u,Q),e=e+Math.imul(v,P)|0,f=Math.imul(v,Q),d=d+Math.imul(r,S)|0,e=e+Math.imul(r,T)|0,e=e+Math.imul(s,S)|0,f=f+Math.imul(s,T)|0,d=d+Math.imul(o,V)|0,e=e+Math.imul(o,W)|0,e=e+Math.imul(p,V)|0,f=f+Math.imul(p,W)|0,d=d+Math.imul(l,Y)|0,e=e+Math.imul(l,Z)|0,e=e+Math.imul(m,Y)|0,f=f+Math.imul(m,Z)|0;var ta=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ta>>>26)|0,ta&=67108863,d=Math.imul(x,P),e=Math.imul(x,Q),e=e+Math.imul(y,P)|0,f=Math.imul(y,Q),d=d+Math.imul(u,S)|0,e=e+Math.imul(u,T)|0,e=e+Math.imul(v,S)|0,f=f+Math.imul(v,T)|0,d=d+Math.imul(r,V)|0,e=e+Math.imul(r,W)|0,e=e+Math.imul(s,V)|0,f=f+Math.imul(s,W)|0,d=d+Math.imul(o,Y)|0,e=e+Math.imul(o,Z)|0,e=e+Math.imul(p,Y)|0,f=f+Math.imul(p,Z)|0,d=d+Math.imul(l,_)|0,e=e+Math.imul(l,aa)|0,e=e+Math.imul(m,_)|0,f=f+Math.imul(m,aa)|0;var ua=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ua>>>26)|0,ua&=67108863,d=Math.imul(A,P),e=Math.imul(A,Q),e=e+Math.imul(B,P)|0,f=Math.imul(B,Q),d=d+Math.imul(x,S)|0,e=e+Math.imul(x,T)|0,e=e+Math.imul(y,S)|0,f=f+Math.imul(y,T)|0,d=d+Math.imul(u,V)|0,e=e+Math.imul(u,W)|0,e=e+Math.imul(v,V)|0,f=f+Math.imul(v,W)|0,d=d+Math.imul(r,Y)|0,e=e+Math.imul(r,Z)|0,e=e+Math.imul(s,Y)|0,f=f+Math.imul(s,Z)|0,d=d+Math.imul(o,_)|0,e=e+Math.imul(o,aa)|0,e=e+Math.imul(p,_)|0,f=f+Math.imul(p,aa)|0,d=d+Math.imul(l,ca)|0,e=e+Math.imul(l,da)|0,e=e+Math.imul(m,ca)|0,f=f+Math.imul(m,da)|0;var va=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(va>>>26)|0,va&=67108863,d=Math.imul(D,P),e=Math.imul(D,Q),e=e+Math.imul(E,P)|0,f=Math.imul(E,Q),d=d+Math.imul(A,S)|0,e=e+Math.imul(A,T)|0,e=e+Math.imul(B,S)|0,f=f+Math.imul(B,T)|0,d=d+Math.imul(x,V)|0,e=e+Math.imul(x,W)|0,e=e+Math.imul(y,V)|0,f=f+Math.imul(y,W)|0,d=d+Math.imul(u,Y)|0,e=e+Math.imul(u,Z)|0,e=e+Math.imul(v,Y)|0,f=f+Math.imul(v,Z)|0,d=d+Math.imul(r,_)|0,e=e+Math.imul(r,aa)|0,e=e+Math.imul(s,_)|0,f=f+Math.imul(s,aa)|0,d=d+Math.imul(o,ca)|0,e=e+Math.imul(o,da)|0,e=e+Math.imul(p,ca)|0,f=f+Math.imul(p,da)|0,d=d+Math.imul(l,fa)|0,e=e+Math.imul(l,ga)|0,e=e+Math.imul(m,fa)|0,f=f+Math.imul(m,ga)|0;var wa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(wa>>>26)|0,wa&=67108863,d=Math.imul(G,P),e=Math.imul(G,Q),e=e+Math.imul(H,P)|0,f=Math.imul(H,Q),d=d+Math.imul(D,S)|0,e=e+Math.imul(D,T)|0,e=e+Math.imul(E,S)|0,f=f+Math.imul(E,T)|0,d=d+Math.imul(A,V)|0,e=e+Math.imul(A,W)|0,e=e+Math.imul(B,V)|0,f=f+Math.imul(B,W)|0,d=d+Math.imul(x,Y)|0,e=e+Math.imul(x,Z)|0,e=e+Math.imul(y,Y)|0,f=f+Math.imul(y,Z)|0,d=d+Math.imul(u,_)|0,e=e+Math.imul(u,aa)|0,e=e+Math.imul(v,_)|0,f=f+Math.imul(v,aa)|0,d=d+Math.imul(r,ca)|0,e=e+Math.imul(r,da)|0,e=e+Math.imul(s,ca)|0,f=f+Math.imul(s,da)|0,d=d+Math.imul(o,fa)|0,e=e+Math.imul(o,ga)|0,e=e+Math.imul(p,fa)|0,f=f+Math.imul(p,ga)|0,d=d+Math.imul(l,ia)|0,e=e+Math.imul(l,ja)|0,e=e+Math.imul(m,ia)|0,f=f+Math.imul(m,ja)|0;var xa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(xa>>>26)|0,xa&=67108863,d=Math.imul(J,P),e=Math.imul(J,Q),e=e+Math.imul(K,P)|0,f=Math.imul(K,Q),d=d+Math.imul(G,S)|0,e=e+Math.imul(G,T)|0,e=e+Math.imul(H,S)|0,f=f+Math.imul(H,T)|0,d=d+Math.imul(D,V)|0,e=e+Math.imul(D,W)|0,e=e+Math.imul(E,V)|0,f=f+Math.imul(E,W)|0,d=d+Math.imul(A,Y)|0,e=e+Math.imul(A,Z)|0,e=e+Math.imul(B,Y)|0,f=f+Math.imul(B,Z)|0,d=d+Math.imul(x,_)|0,e=e+Math.imul(x,aa)|0,e=e+Math.imul(y,_)|0,f=f+Math.imul(y,aa)|0,d=d+Math.imul(u,ca)|0,e=e+Math.imul(u,da)|0,e=e+Math.imul(v,ca)|0,f=f+Math.imul(v,da)|0,d=d+Math.imul(r,fa)|0,e=e+Math.imul(r,ga)|0,e=e+Math.imul(s,fa)|0,f=f+Math.imul(s,ga)|0,d=d+Math.imul(o,ia)|0,e=e+Math.imul(o,ja)|0,e=e+Math.imul(p,ia)|0,f=f+Math.imul(p,ja)|0,d=d+Math.imul(l,la)|0,e=e+Math.imul(l,ma)|0,e=e+Math.imul(m,la)|0,f=f+Math.imul(m,ma)|0;var ya=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ya>>>26)|0,ya&=67108863,d=Math.imul(M,P),e=Math.imul(M,Q),e=e+Math.imul(N,P)|0,f=Math.imul(N,Q),d=d+Math.imul(J,S)|0,e=e+Math.imul(J,T)|0,e=e+Math.imul(K,S)|0,f=f+Math.imul(K,T)|0,d=d+Math.imul(G,V)|0,e=e+Math.imul(G,W)|0,e=e+Math.imul(H,V)|0,f=f+Math.imul(H,W)|0,d=d+Math.imul(D,Y)|0,e=e+Math.imul(D,Z)|0,e=e+Math.imul(E,Y)|0,f=f+Math.imul(E,Z)|0,d=d+Math.imul(A,_)|0,e=e+Math.imul(A,aa)|0,e=e+Math.imul(B,_)|0,f=f+Math.imul(B,aa)|0,d=d+Math.imul(x,ca)|0,e=e+Math.imul(x,da)|0,e=e+Math.imul(y,ca)|0,f=f+Math.imul(y,da)|0,d=d+Math.imul(u,fa)|0,e=e+Math.imul(u,ga)|0,e=e+Math.imul(v,fa)|0,f=f+Math.imul(v,ga)|0,d=d+Math.imul(r,ia)|0,e=e+Math.imul(r,ja)|0,e=e+Math.imul(s,ia)|0,f=f+Math.imul(s,ja)|0,d=d+Math.imul(o,la)|0,e=e+Math.imul(o,ma)|0,e=e+Math.imul(p,la)|0,f=f+Math.imul(p,ma)|0,d=d+Math.imul(l,oa)|0,e=e+Math.imul(l,pa)|0,e=e+Math.imul(m,oa)|0,f=f+Math.imul(m,pa)|0;var za=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(za>>>26)|0,za&=67108863,d=Math.imul(M,S),e=Math.imul(M,T),e=e+Math.imul(N,S)|0,f=Math.imul(N,T),d=d+Math.imul(J,V)|0,e=e+Math.imul(J,W)|0,e=e+Math.imul(K,V)|0,f=f+Math.imul(K,W)|0,d=d+Math.imul(G,Y)|0,e=e+Math.imul(G,Z)|0,e=e+Math.imul(H,Y)|0,f=f+Math.imul(H,Z)|0,d=d+Math.imul(D,_)|0,e=e+Math.imul(D,aa)|0,e=e+Math.imul(E,_)|0,f=f+Math.imul(E,aa)|0,d=d+Math.imul(A,ca)|0,e=e+Math.imul(A,da)|0,e=e+Math.imul(B,ca)|0,f=f+Math.imul(B,da)|0,d=d+Math.imul(x,fa)|0,e=e+Math.imul(x,ga)|0,e=e+Math.imul(y,fa)|0,f=f+Math.imul(y,ga)|0,d=d+Math.imul(u,ia)|0,e=e+Math.imul(u,ja)|0,e=e+Math.imul(v,ia)|0,f=f+Math.imul(v,ja)|0,d=d+Math.imul(r,la)|0,e=e+Math.imul(r,ma)|0,e=e+Math.imul(s,la)|0,f=f+Math.imul(s,ma)|0,d=d+Math.imul(o,oa)|0,e=e+Math.imul(o,pa)|0,e=e+Math.imul(p,oa)|0,f=f+Math.imul(p,pa)|0;var Aa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,d=Math.imul(M,V),e=Math.imul(M,W),e=e+Math.imul(N,V)|0,f=Math.imul(N,W),d=d+Math.imul(J,Y)|0,e=e+Math.imul(J,Z)|0,e=e+Math.imul(K,Y)|0,f=f+Math.imul(K,Z)|0,d=d+Math.imul(G,_)|0,e=e+Math.imul(G,aa)|0,e=e+Math.imul(H,_)|0,f=f+Math.imul(H,aa)|0,d=d+Math.imul(D,ca)|0,e=e+Math.imul(D,da)|0,e=e+Math.imul(E,ca)|0,f=f+Math.imul(E,da)|0,d=d+Math.imul(A,fa)|0,e=e+Math.imul(A,ga)|0,e=e+Math.imul(B,fa)|0,f=f+Math.imul(B,ga)|0,d=d+Math.imul(x,ia)|0,e=e+Math.imul(x,ja)|0,e=e+Math.imul(y,ia)|0,f=f+Math.imul(y,ja)|0,d=d+Math.imul(u,la)|0,e=e+Math.imul(u,ma)|0,e=e+Math.imul(v,la)|0,f=f+Math.imul(v,ma)|0,d=d+Math.imul(r,oa)|0,e=e+Math.imul(r,pa)|0,e=e+Math.imul(s,oa)|0,f=f+Math.imul(s,pa)|0;var Ba=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,d=Math.imul(M,Y),e=Math.imul(M,Z),e=e+Math.imul(N,Y)|0,f=Math.imul(N,Z),d=d+Math.imul(J,_)|0,e=e+Math.imul(J,aa)|0,e=e+Math.imul(K,_)|0,f=f+Math.imul(K,aa)|0,d=d+Math.imul(G,ca)|0,e=e+Math.imul(G,da)|0,e=e+Math.imul(H,ca)|0,f=f+Math.imul(H,da)|0,d=d+Math.imul(D,fa)|0,e=e+Math.imul(D,ga)|0,e=e+Math.imul(E,fa)|0,f=f+Math.imul(E,ga)|0,d=d+Math.imul(A,ia)|0,e=e+Math.imul(A,ja)|0,e=e+Math.imul(B,ia)|0,f=f+Math.imul(B,ja)|0,d=d+Math.imul(x,la)|0,e=e+Math.imul(x,ma)|0,e=e+Math.imul(y,la)|0,f=f+Math.imul(y,ma)|0,d=d+Math.imul(u,oa)|0,e=e+Math.imul(u,pa)|0,e=e+Math.imul(v,oa)|0,f=f+Math.imul(v,pa)|0;var Ca=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,d=Math.imul(M,_),e=Math.imul(M,aa),e=e+Math.imul(N,_)|0,f=Math.imul(N,aa),d=d+Math.imul(J,ca)|0,e=e+Math.imul(J,da)|0,e=e+Math.imul(K,ca)|0,f=f+Math.imul(K,da)|0,d=d+Math.imul(G,fa)|0,e=e+Math.imul(G,ga)|0,e=e+Math.imul(H,fa)|0,f=f+Math.imul(H,ga)|0,d=d+Math.imul(D,ia)|0,e=e+Math.imul(D,ja)|0,e=e+Math.imul(E,ia)|0,f=f+Math.imul(E,ja)|0,d=d+Math.imul(A,la)|0,e=e+Math.imul(A,ma)|0,e=e+Math.imul(B,la)|0,f=f+Math.imul(B,ma)|0,d=d+Math.imul(x,oa)|0,e=e+Math.imul(x,pa)|0,e=e+Math.imul(y,oa)|0,f=f+Math.imul(y,pa)|0;var Da=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Da>>>26)|0,Da&=67108863,d=Math.imul(M,ca),e=Math.imul(M,da),e=e+Math.imul(N,ca)|0,f=Math.imul(N,da),d=d+Math.imul(J,fa)|0,e=e+Math.imul(J,ga)|0,e=e+Math.imul(K,fa)|0,f=f+Math.imul(K,ga)|0,d=d+Math.imul(G,ia)|0,e=e+Math.imul(G,ja)|0,e=e+Math.imul(H,ia)|0,f=f+Math.imul(H,ja)|0,d=d+Math.imul(D,la)|0,e=e+Math.imul(D,ma)|0,e=e+Math.imul(E,la)|0,f=f+Math.imul(E,ma)|0,d=d+Math.imul(A,oa)|0,e=e+Math.imul(A,pa)|0,e=e+Math.imul(B,oa)|0,f=f+Math.imul(B,pa)|0;var Ea=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,d=Math.imul(M,fa),e=Math.imul(M,ga),e=e+Math.imul(N,fa)|0,f=Math.imul(N,ga),d=d+Math.imul(J,ia)|0,e=e+Math.imul(J,ja)|0,e=e+Math.imul(K,ia)|0,f=f+Math.imul(K,ja)|0,d=d+Math.imul(G,la)|0,e=e+Math.imul(G,ma)|0,e=e+Math.imul(H,la)|0,f=f+Math.imul(H,ma)|0,d=d+Math.imul(D,oa)|0,e=e+Math.imul(D,pa)|0,e=e+Math.imul(E,oa)|0,f=f+Math.imul(E,pa)|0;var Fa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,d=Math.imul(M,ia),e=Math.imul(M,ja),e=e+Math.imul(N,ia)|0,f=Math.imul(N,ja),d=d+Math.imul(J,la)|0,e=e+Math.imul(J,ma)|0,e=e+Math.imul(K,la)|0,f=f+Math.imul(K,ma)|0,d=d+Math.imul(G,oa)|0,e=e+Math.imul(G,pa)|0,e=e+Math.imul(H,oa)|0,f=f+Math.imul(H,pa)|0;var Ga=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,d=Math.imul(M,la),e=Math.imul(M,ma),e=e+Math.imul(N,la)|0,f=Math.imul(N,ma),d=d+Math.imul(J,oa)|0,e=e+Math.imul(J,pa)|0,e=e+Math.imul(K,oa)|0,f=f+Math.imul(K,pa)|0;var Ha=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,d=Math.imul(M,oa),e=Math.imul(M,pa),e=e+Math.imul(N,oa)|0,f=Math.imul(N,pa);var Ia=(j+d|0)+((8191&e)<<13)|0;return j=(f+(e>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,i[0]=qa,i[1]=ra,i[2]=sa,i[3]=ta,i[4]=ua,i[5]=va,i[6]=wa,i[7]=xa,i[8]=ya,i[9]=za,i[10]=Aa,i[11]=Ba,i[12]=Ca,i[13]=Da,i[14]=Ea,i[15]=Fa,i[16]=Ga,i[17]=Ha,i[18]=Ia,0!==j&&(i[19]=j,c.length++),c};Math.imul||(z=j),f.prototype.mulTo=function(a,b){var c,d=this.length+a.length;return c=10===this.length&&10===a.length?z(this,a,b):d<63?j(this,a,b):d<1024?k(this,a,b):l(this,a,b)},m.prototype.makeRBT=function(a){for(var b=new Array(a),c=f.prototype._countBits(a)-1,d=0;d>=1;return d},m.prototype.permute=function(a,b,c,d,e,f){for(var g=0;g>>=1)e++;return 1<>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return 0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){return this.clone().imuln(a)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(a){var b=i(a);if(0===b.length)return new f(1);for(var c=this,d=0;d=0);var b,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){var g=0;for(b=0;b>>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=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<g)for(this.length-=g,j=0;j=0&&(0!==k||j>=e);j--){var l=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&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){return d(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){return this.clone().ishln(a)},f.prototype.ushln=function(a){return this.clone().iushln(a)},f.prototype.shrn=function(a){return this.clone().ishrn(a)},f.prototype.ushrn=function(a){return this.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26,e=1<=0);var b=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){var e=67108863^67108863>>>b<=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},f.prototype.isubn=function(a){if(d("number"==typeof a),d(a<67108864),a<0)return this.iaddn(-a);if(0!==this.negative)return this.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;else for(var b=0;b>26)-(i/67108864|0),this.words[e+c]=67108863&g}for(;e>26,this.words[e+c]=67108863&g;if(0===h)return this.strip();for(d(h===-1),h=0,e=0;e>26,this.words[e]=67108863&g;return this.negative=1,this.strip()},f.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),e=a,g=0|e.words[e.length-1],h=this._countBits(g);c=26-h,0!==c&&(e=e.ushln(c),d.iushln(c),g=0|e.words[e.length-1]);var i,j=d.length-e.length;if("mod"!==b){i=new f(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k=0;m--){var n=67108864*(0|d.words[e.length+m])+(0|d.words[e.length+m-1]);for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(e,n,m);0!==d.negative;)n--,d.negative=0,d._ishlnsubmul(e,1,m),d.isZero()||(d.negative^=1);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.iushrn(c),{div:i||null,mod:d}},f.prototype.divmod=function(a,b,c){if(d(!a.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var e,g,h;return 0!==this.negative&&0===a.negative?(h=this.neg().divmod(a,b),"mod"!==b&&(e=h.div.neg()),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.iadd(a)),{div:e,mod:g}):0===this.negative&&0!==a.negative?(h=this.divmod(a.neg(),b),"mod"!==b&&(e=h.div.neg()),{div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new f(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new f(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new f(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){return this.divmod(a,"div",!1).div},f.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){var b=this.divmod(a);if(b.mod.isZero())return b.div;var c=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);return f<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(var b=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;return c},f.prototype.idivn=function(a){d(a<=67108863);for(var b=0,c=this.length-1;c>=0;c--){var e=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}return this.strip()},f.prototype.divn=function(a){return this.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=new f(0),i=new f(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(var k=c.clone(),l=b.clone();!b.isZero();){for(var m=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-- >0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(var o=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-- >0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(var i=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-- >0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(var k=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}var m;return m=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var b=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(var d=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);var e=b.cmp(c);if(e<0){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.iushln(d)},f.prototype.invm=function(a){return this.egcd(a).a.umod(a)},f.prototype.isEven=function(){return 0===(1&this.words[0])},f.prototype.isOdd=function(){return 1===(1&this.words[0])},f.prototype.andln=function(a){return this.words[0]&a},f.prototype.bincn=function(a){d("number"==typeof a);var b=a%26,c=(a-b)/26,e=1<>>26,h&=67108863,this.words[g]=h}return 0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){var b=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return 1;this.strip();var c;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");var e=0|this.words[0];c=e===a?0:ea.length)return 1;if(this.length=0;c--){var d=0|this.words[c],e=0|a.words[c];if(d!==e){de&&(b=1);break}}return b},f.prototype.gtn=function(a){return 1===this.cmpn(a)},f.prototype.gt=function(a){return 1===this.cmp(a)},f.prototype.gten=function(a){return this.cmpn(a)>=0},f.prototype.gte=function(a){return this.cmp(a)>=0},f.prototype.ltn=function(a){return this.cmpn(a)===-1},f.prototype.lt=function(a){return this.cmp(a)===-1},f.prototype.lten=function(a){return this.cmpn(a)<=0},f.prototype.lte=function(a){return this.cmp(a)<=0},f.prototype.eqn=function(a){return 0===this.cmpn(a)},f.prototype.eq=function(a){return 0===this.cmp(a)},f.red=function(a){return new s(a)},f.prototype.toRed=function(a){return d(!this.red,"Already a number in reduction context"),d(0===this.negative,"red works only with positives"),a.convertTo(this)._forceRed(a)},f.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(a){return this.red=a,this},f.prototype.forceRed=function(a){return d(!this.red,"Already a number in reduction context"),this._forceRed(a)},f.prototype.redAdd=function(a){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},f.prototype.redIAdd=function(a){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},f.prototype.redSub=function(a){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},f.prototype.redISub=function(a){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},f.prototype.redShl=function(a){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},f.prototype.redMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},f.prototype.redIMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},f.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(a){return d(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var a=new f(null);return a.words=new Array(Math.ceil(this.n/13)),a},n.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b0?c.isub(this.p):c.strip(),c},n.prototype.split=function(a,b){a.iushrn(this.n,0,b)},n.prototype.imulK=function(a){return a.imul(this.k)},e(o,n),o.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;e>>22,f=g}f>>>=22,a.words[e-10]=f,0===f&&a.length>10?a.length-=10:a.length-=9},o.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b=0,c=0;c>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},f._prime=function B(a){if(A[a])return A[a];var B;if("k256"===a)B=new o;else if("p224"===a)B=new p;else if("p192"===a)B=new q;else{if("p25519"!==a)throw new Error("Unknown prime "+a);B=new r}return A[a]=B,B},s.prototype._verify1=function(a){d(0===a.negative,"red works only with positives"),d(a.red,"red works only with red numbers")},s.prototype._verify2=function(a,b){d(0===(a.negative|b.negative),"red works only with positives"),d(a.red&&a.red===b.red,"red works only with red numbers")},s.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:4}],3:[function(a,b,c){var d=a("../../utils").randomBytes;b.exports=function(a){return d(a)}},{"../../utils":50}],4:[function(a,b,c){},{}],5:[function(a,b,c){"use strict";var d=c;d.version=a("../package.json").version,d.utils=a("./elliptic/utils"),d.rand=a("brorand"),d.hmacDRBG=a("./elliptic/hmac-drbg"),d.curve=a("./elliptic/curve"),d.curves=a("./elliptic/curves"),d.ec=a("./elliptic/ec"),d.eddsa=a("./elliptic/eddsa")},{"../package.json":19,"./elliptic/curve":8,"./elliptic/curves":11,"./elliptic/ec":12,"./elliptic/eddsa":15,"./elliptic/hmac-drbg":16,"./elliptic/utils":18,brorand:3}],6:[function(a,b,c){"use strict";function d(a,b){this.type=a,this.p=new f(b.p,16),this.red=b.prime?f.red(b.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=b.n&&new f(b.n,16),this.g=b.g&&this.pointFromJSON(b.g,b.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function e(a,b){this.curve=a,this.type=b,this.precomputed=null}var f=a("bn.js"),g=a("../../elliptic"),h=g.utils,i=h.getNAF,j=h.getJSF,k=h.assert;b.exports=d,d.prototype.point=function(){throw new Error("Not implemented")},d.prototype.validate=function(){throw new Error("Not implemented")},d.prototype._fixedNafMul=function(a,b){k(a.precomputed);var c=a._getDoubles(),d=i(b,1),e=(1<=g;b--)h=(h<<1)+d[b];f.push(h)}for(var j=this.jpoint(null,null,null),l=this.jpoint(null,null,null),m=e;m>0;m--){for(var g=0;g=0;h--){for(var b=0;h>=0&&0===f[h];h--)b++;if(h>=0&&b++,g=g.dblp(b),h<0)break;var j=f[h];k(0!==j),g="affine"===a.type?j>0?g.mixedAdd(e[j-1>>1]):g.mixedAdd(e[-j-1>>1].neg()):j>0?g.add(e[j-1>>1]):g.add(e[-j-1>>1].neg())}return"affine"===a.type?g.toP():g},d.prototype._wnafMulAdd=function(a,b,c,d,e){for(var f=this._wnafT1,g=this._wnafT2,h=this._wnafT3,k=0,l=0;l=1;l-=2){var o=l-1,p=l;if(1===f[o]&&1===f[p]){var q=[b[o],null,null,b[p]];0===b[o].y.cmp(b[p].y)?(q[1]=b[o].add(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg())):0===b[o].y.cmp(b[p].y.redNeg())?(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].add(b[p].neg())):(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg()));var r=[-3,-1,-5,-7,0,7,5,1,3],s=j(c[o],c[p]);k=Math.max(s[0].length,k),h[o]=new Array(k),h[p]=new Array(k);for(var t=0;t=0;l--){for(var y=0;l>=0;){for(var z=!0,t=0;t=0&&y++,w=w.dblp(y),l<0)break;for(var t=0;t0?m=g[t][A-1>>1]:A<0&&(m=g[t][-A-1>>1].neg()),w="affine"===m.type?w.mixedAdd(m):w.add(m))}}for(var l=0;l=Math.ceil((a.bitLength()+1)/b.step)},e.prototype._getDoubles=function(a,b){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],d=this,e=0;e=0&&(f=b,g=c),d.negative&&(d=d.neg(),e=e.neg()),f.negative&&(f=f.neg(),g=g.neg()),[{a:d,b:e},{a:f,b:g}]},d.prototype._endoSplit=function(a){var b=this.endo.basis,c=b[0],d=b[1],e=d.b.mul(a).divRound(this.n),f=c.b.neg().mul(a).divRound(this.n),g=e.mul(c.a),h=f.mul(d.a),i=e.mul(c.b),j=f.mul(d.b),k=a.sub(g).sub(h),l=i.add(j).neg();return{k1:k,k2:l}},d.prototype.pointFromX=function(a,b){a=new i(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr().redMul(a).redIAdd(a.redMul(this.a)).redIAdd(this.b),d=c.redSqrt();if(0!==d.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var e=d.fromRed().isOdd();return(b&&!e||!b&&e)&&(d=d.redNeg()),this.point(a,d)},d.prototype.validate=function(a){if(a.inf)return!0;var b=a.x,c=a.y,d=this.a.redMul(b),e=b.redSqr().redMul(b).redIAdd(d).redIAdd(this.b);return 0===c.redSqr().redISub(e).cmpn(0)},d.prototype._endoWnafMulAdd=function(a,b,c){for(var d=this._endoWnafT1,e=this._endoWnafT2,f=0;f":""},e.prototype.isInfinity=function(){return this.inf},e.prototype.add=function(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(0===this.x.cmp(a.x))return this.curve.point(null,null);var b=this.y.redSub(a.y);0!==b.cmpn(0)&&(b=b.redMul(this.x.redSub(a.x).redInvm()));var c=b.redSqr().redISub(this.x).redISub(a.x),d=b.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,d)},e.prototype.dbl=function(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(0===a.cmpn(0))return this.curve.point(null,null);var b=this.curve.a,c=this.x.redSqr(),d=a.redInvm(),e=c.redAdd(c).redIAdd(c).redIAdd(b).redMul(d),f=e.redSqr().redISub(this.x.redAdd(this.x)),g=e.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,g)},e.prototype.getX=function(){return this.x.fromRed()},e.prototype.getY=function(){return this.y.fromRed()},e.prototype.mul=function(a){return a=new i(a,16),this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)},e.prototype.mulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e):this.curve._wnafMulAdd(1,d,e,2)},e.prototype.jmulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e,!0):this.curve._wnafMulAdd(1,d,e,2,!0)},e.prototype.eq=function(a){return this===a||this.inf===a.inf&&(this.inf||0===this.x.cmp(a.x)&&0===this.y.cmp(a.y))},e.prototype.neg=function(a){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(a&&this.precomputed){var c=this.precomputed,d=function(a){return a.neg()};b.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(d)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(d)}}}return b},e.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a},j(f,k.BasePoint),d.prototype.jpoint=function(a,b,c){return new f(this,a,b,c)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),b=a.redSqr(),c=this.x.redMul(b),d=this.y.redMul(b).redMul(a);return this.curve.point(c,d)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.z.redSqr(),c=this.z.redSqr(),d=this.x.redMul(b),e=a.x.redMul(c),f=this.y.redMul(b.redMul(a.z)),g=a.y.redMul(c.redMul(this.z)),h=d.redSub(e),i=f.redSub(g);if(0===h.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var j=h.redSqr(),k=j.redMul(h),l=d.redMul(j),m=i.redSqr().redIAdd(k).redISub(l).redISub(l),n=i.redMul(l.redISub(m)).redISub(f.redMul(k)),o=this.z.redMul(a.z).redMul(h);return this.curve.jpoint(m,n,o)},f.prototype.mixedAdd=function(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var b=this.z.redSqr(),c=this.x,d=a.x.redMul(b),e=this.y,f=a.y.redMul(b).redMul(this.z),g=c.redSub(d),h=e.redSub(f);if(0===g.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=g.redSqr(),j=i.redMul(g),k=c.redMul(i),l=h.redSqr().redIAdd(j).redISub(k).redISub(k),m=h.redMul(k.redISub(l)).redISub(e.redMul(j)),n=this.z.redMul(g); +f>>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return 0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){return this.clone().imuln(a)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(a){var b=i(a);if(0===b.length)return new f(1);for(var c=this,d=0;d=0);var b,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){var g=0;for(b=0;b>>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=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<g)for(this.length-=g,j=0;j=0&&(0!==k||j>=e);j--){var l=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&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){return d(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){return this.clone().ishln(a)},f.prototype.ushln=function(a){return this.clone().iushln(a)},f.prototype.shrn=function(a){return this.clone().ishrn(a)},f.prototype.ushrn=function(a){return this.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26,e=1<=0);var b=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){var e=67108863^67108863>>>b<=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},f.prototype.isubn=function(a){if(d("number"==typeof a),d(a<67108864),a<0)return this.iaddn(-a);if(0!==this.negative)return this.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;else for(var b=0;b>26)-(i/67108864|0),this.words[e+c]=67108863&g}for(;e>26,this.words[e+c]=67108863&g;if(0===h)return this.strip();for(d(h===-1),h=0,e=0;e>26,this.words[e]=67108863&g;return this.negative=1,this.strip()},f.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),e=a,g=0|e.words[e.length-1],h=this._countBits(g);c=26-h,0!==c&&(e=e.ushln(c),d.iushln(c),g=0|e.words[e.length-1]);var i,j=d.length-e.length;if("mod"!==b){i=new f(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k=0;m--){var n=67108864*(0|d.words[e.length+m])+(0|d.words[e.length+m-1]);for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(e,n,m);0!==d.negative;)n--,d.negative=0,d._ishlnsubmul(e,1,m),d.isZero()||(d.negative^=1);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.iushrn(c),{div:i||null,mod:d}},f.prototype.divmod=function(a,b,c){if(d(!a.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var e,g,h;return 0!==this.negative&&0===a.negative?(h=this.neg().divmod(a,b),"mod"!==b&&(e=h.div.neg()),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.iadd(a)),{div:e,mod:g}):0===this.negative&&0!==a.negative?(h=this.divmod(a.neg(),b),"mod"!==b&&(e=h.div.neg()),{div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new f(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new f(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new f(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){return this.divmod(a,"div",!1).div},f.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){var b=this.divmod(a);if(b.mod.isZero())return b.div;var c=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);return f<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(var b=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;return c},f.prototype.idivn=function(a){d(a<=67108863);for(var b=0,c=this.length-1;c>=0;c--){var e=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}return this.strip()},f.prototype.divn=function(a){return this.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=new f(0),i=new f(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(var k=c.clone(),l=b.clone();!b.isZero();){for(var m=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-- >0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(var o=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-- >0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(var i=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-- >0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(var k=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}var m;return m=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var b=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(var d=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);var e=b.cmp(c);if(e<0){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.iushln(d)},f.prototype.invm=function(a){return this.egcd(a).a.umod(a)},f.prototype.isEven=function(){return 0===(1&this.words[0])},f.prototype.isOdd=function(){return 1===(1&this.words[0])},f.prototype.andln=function(a){return this.words[0]&a},f.prototype.bincn=function(a){d("number"==typeof a);var b=a%26,c=(a-b)/26,e=1<>>26,h&=67108863,this.words[g]=h}return 0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){var b=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return 1;this.strip();var c;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");var e=0|this.words[0];c=e===a?0:ea.length)return 1;if(this.length=0;c--){var d=0|this.words[c],e=0|a.words[c];if(d!==e){de&&(b=1);break}}return b},f.prototype.gtn=function(a){return 1===this.cmpn(a)},f.prototype.gt=function(a){return 1===this.cmp(a)},f.prototype.gten=function(a){return this.cmpn(a)>=0},f.prototype.gte=function(a){return this.cmp(a)>=0},f.prototype.ltn=function(a){return this.cmpn(a)===-1},f.prototype.lt=function(a){return this.cmp(a)===-1},f.prototype.lten=function(a){return this.cmpn(a)<=0},f.prototype.lte=function(a){return this.cmp(a)<=0},f.prototype.eqn=function(a){return 0===this.cmpn(a)},f.prototype.eq=function(a){return 0===this.cmp(a)},f.red=function(a){return new s(a)},f.prototype.toRed=function(a){return d(!this.red,"Already a number in reduction context"),d(0===this.negative,"red works only with positives"),a.convertTo(this)._forceRed(a)},f.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(a){return this.red=a,this},f.prototype.forceRed=function(a){return d(!this.red,"Already a number in reduction context"),this._forceRed(a)},f.prototype.redAdd=function(a){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},f.prototype.redIAdd=function(a){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},f.prototype.redSub=function(a){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},f.prototype.redISub=function(a){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},f.prototype.redShl=function(a){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},f.prototype.redMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},f.prototype.redIMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},f.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(a){return d(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var a=new f(null);return a.words=new Array(Math.ceil(this.n/13)),a},n.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b0?c.isub(this.p):c.strip(),c},n.prototype.split=function(a,b){a.iushrn(this.n,0,b)},n.prototype.imulK=function(a){return a.imul(this.k)},e(o,n),o.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;e>>22,f=g}f>>>=22,a.words[e-10]=f,0===f&&a.length>10?a.length-=10:a.length-=9},o.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b=0,c=0;c>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},f._prime=function B(a){if(A[a])return A[a];var B;if("k256"===a)B=new o;else if("p224"===a)B=new p;else if("p192"===a)B=new q;else{if("p25519"!==a)throw new Error("Unknown prime "+a);B=new r}return A[a]=B,B},s.prototype._verify1=function(a){d(0===a.negative,"red works only with positives"),d(a.red,"red works only with red numbers")},s.prototype._verify2=function(a,b){d(0===(a.negative|b.negative),"red works only with positives"),d(a.red&&a.red===b.red,"red works only with red numbers")},s.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:4}],3:[function(a,b,c){var d=a("../../utils").randomBytes;b.exports=function(a){return d(a)}},{"../../utils":51}],4:[function(a,b,c){},{}],5:[function(a,b,c){"use strict";var d=c;d.version=a("../package.json").version,d.utils=a("./elliptic/utils"),d.rand=a("brorand"),d.hmacDRBG=a("./elliptic/hmac-drbg"),d.curve=a("./elliptic/curve"),d.curves=a("./elliptic/curves"),d.ec=a("./elliptic/ec"),d.eddsa=a("./elliptic/eddsa")},{"../package.json":19,"./elliptic/curve":8,"./elliptic/curves":11,"./elliptic/ec":12,"./elliptic/eddsa":15,"./elliptic/hmac-drbg":16,"./elliptic/utils":18,brorand:3}],6:[function(a,b,c){"use strict";function d(a,b){this.type=a,this.p=new f(b.p,16),this.red=b.prime?f.red(b.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=b.n&&new f(b.n,16),this.g=b.g&&this.pointFromJSON(b.g,b.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function e(a,b){this.curve=a,this.type=b,this.precomputed=null}var f=a("bn.js"),g=a("../../elliptic"),h=g.utils,i=h.getNAF,j=h.getJSF,k=h.assert;b.exports=d,d.prototype.point=function(){throw new Error("Not implemented")},d.prototype.validate=function(){throw new Error("Not implemented")},d.prototype._fixedNafMul=function(a,b){k(a.precomputed);var c=a._getDoubles(),d=i(b,1),e=(1<=g;b--)h=(h<<1)+d[b];f.push(h)}for(var j=this.jpoint(null,null,null),l=this.jpoint(null,null,null),m=e;m>0;m--){for(var g=0;g=0;h--){for(var b=0;h>=0&&0===f[h];h--)b++;if(h>=0&&b++,g=g.dblp(b),h<0)break;var j=f[h];k(0!==j),g="affine"===a.type?j>0?g.mixedAdd(e[j-1>>1]):g.mixedAdd(e[-j-1>>1].neg()):j>0?g.add(e[j-1>>1]):g.add(e[-j-1>>1].neg())}return"affine"===a.type?g.toP():g},d.prototype._wnafMulAdd=function(a,b,c,d,e){for(var f=this._wnafT1,g=this._wnafT2,h=this._wnafT3,k=0,l=0;l=1;l-=2){var o=l-1,p=l;if(1===f[o]&&1===f[p]){var q=[b[o],null,null,b[p]];0===b[o].y.cmp(b[p].y)?(q[1]=b[o].add(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg())):0===b[o].y.cmp(b[p].y.redNeg())?(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].add(b[p].neg())):(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg()));var r=[-3,-1,-5,-7,0,7,5,1,3],s=j(c[o],c[p]);k=Math.max(s[0].length,k),h[o]=new Array(k),h[p]=new Array(k);for(var t=0;t=0;l--){for(var y=0;l>=0;){for(var z=!0,t=0;t=0&&y++,w=w.dblp(y),l<0)break;for(var t=0;t0?m=g[t][A-1>>1]:A<0&&(m=g[t][-A-1>>1].neg()),w="affine"===m.type?w.mixedAdd(m):w.add(m))}}for(var l=0;l=Math.ceil((a.bitLength()+1)/b.step)},e.prototype._getDoubles=function(a,b){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],d=this,e=0;e=0&&(f=b,g=c),d.negative&&(d=d.neg(),e=e.neg()),f.negative&&(f=f.neg(),g=g.neg()),[{a:d,b:e},{a:f,b:g}]},d.prototype._endoSplit=function(a){var b=this.endo.basis,c=b[0],d=b[1],e=d.b.mul(a).divRound(this.n),f=c.b.neg().mul(a).divRound(this.n),g=e.mul(c.a),h=f.mul(d.a),i=e.mul(c.b),j=f.mul(d.b),k=a.sub(g).sub(h),l=i.add(j).neg();return{k1:k,k2:l}},d.prototype.pointFromX=function(a,b){a=new i(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr().redMul(a).redIAdd(a.redMul(this.a)).redIAdd(this.b),d=c.redSqrt();if(0!==d.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var e=d.fromRed().isOdd();return(b&&!e||!b&&e)&&(d=d.redNeg()),this.point(a,d)},d.prototype.validate=function(a){if(a.inf)return!0;var b=a.x,c=a.y,d=this.a.redMul(b),e=b.redSqr().redMul(b).redIAdd(d).redIAdd(this.b);return 0===c.redSqr().redISub(e).cmpn(0)},d.prototype._endoWnafMulAdd=function(a,b,c){for(var d=this._endoWnafT1,e=this._endoWnafT2,f=0;f":""},e.prototype.isInfinity=function(){return this.inf},e.prototype.add=function(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(0===this.x.cmp(a.x))return this.curve.point(null,null);var b=this.y.redSub(a.y);0!==b.cmpn(0)&&(b=b.redMul(this.x.redSub(a.x).redInvm()));var c=b.redSqr().redISub(this.x).redISub(a.x),d=b.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,d)},e.prototype.dbl=function(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(0===a.cmpn(0))return this.curve.point(null,null);var b=this.curve.a,c=this.x.redSqr(),d=a.redInvm(),e=c.redAdd(c).redIAdd(c).redIAdd(b).redMul(d),f=e.redSqr().redISub(this.x.redAdd(this.x)),g=e.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,g)},e.prototype.getX=function(){return this.x.fromRed()},e.prototype.getY=function(){return this.y.fromRed()},e.prototype.mul=function(a){return a=new i(a,16),this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)},e.prototype.mulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e):this.curve._wnafMulAdd(1,d,e,2)},e.prototype.jmulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e,!0):this.curve._wnafMulAdd(1,d,e,2,!0)},e.prototype.eq=function(a){return this===a||this.inf===a.inf&&(this.inf||0===this.x.cmp(a.x)&&0===this.y.cmp(a.y))},e.prototype.neg=function(a){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(a&&this.precomputed){var c=this.precomputed,d=function(a){return a.neg()};b.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(d)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(d)}}}return b},e.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a},j(f,k.BasePoint),d.prototype.jpoint=function(a,b,c){return new f(this,a,b,c)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),b=a.redSqr(),c=this.x.redMul(b),d=this.y.redMul(b).redMul(a);return this.curve.point(c,d)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.z.redSqr(),c=this.z.redSqr(),d=this.x.redMul(b),e=a.x.redMul(c),f=this.y.redMul(b.redMul(a.z)),g=a.y.redMul(c.redMul(this.z)),h=d.redSub(e),i=f.redSub(g);if(0===h.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var j=h.redSqr(),k=j.redMul(h),l=d.redMul(j),m=i.redSqr().redIAdd(k).redISub(l).redISub(l),n=i.redMul(l.redISub(m)).redISub(f.redMul(k)),o=this.z.redMul(a.z).redMul(h);return this.curve.jpoint(m,n,o)},f.prototype.mixedAdd=function(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var b=this.z.redSqr(),c=this.x,d=a.x.redMul(b),e=this.y,f=a.y.redMul(b).redMul(this.z),g=c.redSub(d),h=e.redSub(f);if(0===g.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=g.redSqr(),j=i.redMul(g),k=c.redMul(i),l=h.redSqr().redIAdd(j).redISub(k).redISub(k),m=h.redMul(k.redISub(l)).redISub(e.redMul(j)),n=this.z.redMul(g); return this.curve.jpoint(l,m,n)},f.prototype.dblp=function(a){if(0===a)return this;if(this.isInfinity())return this;if(!a)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var b=this,c=0;c=0)return!1;if(c.redIAdd(e),0===this.x.cmp(c))return!0}return!1},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":5,"../curve":8,"bn.js":2,inherits:33}],11:[function(a,b,c){"use strict";function d(a){"short"===a.type?this.curve=new h.curve["short"](a):"edwards"===a.type?this.curve=new h.curve.edwards(a):this.curve=new h.curve.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function e(a,b){Object.defineProperty(f,a,{configurable:!0,enumerable:!0,get:function(){var c=new d(b);return Object.defineProperty(f,a,{configurable:!0,enumerable:!0,value:c}),c}})}var f=c,g=a("hash.js"),h=a("../elliptic"),i=h.utils.assert;f.PresetCurve=d,e("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:g.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),e("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:g.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),e("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:g.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),e("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:g.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),e("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:g.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),e("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["9"]}),e("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var j;try{j=a("./precomputed/secp256k1")}catch(k){j=void 0}e("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:g.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",j]})},{"../elliptic":5,"./precomputed/secp256k1":17,"hash.js":20}],12:[function(a,b,c){"use strict";function d(a){return this instanceof d?("string"==typeof a&&(h(f.curves.hasOwnProperty(a),"Unknown curve "+a),a=f.curves[a]),a instanceof f.curves.PresetCurve&&(a={curve:a}),this.curve=a.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=a.curve.g,this.g.precompute(a.curve.n.bitLength()+1),void(this.hash=a.hash||a.curve.hash)):new d(a)}var e=a("bn.js"),f=a("../../elliptic"),g=f.utils,h=g.assert,i=a("./key"),j=a("./signature");b.exports=d,d.prototype.keyPair=function(a){return new i(this,a)},d.prototype.keyFromPrivate=function(a,b){return i.fromPrivate(this,a,b)},d.prototype.keyFromPublic=function(a,b){return i.fromPublic(this,a,b)},d.prototype.genKeyPair=function(a){a||(a={});for(var b=new f.hmacDRBG({hash:this.hash,pers:a.pers,entropy:a.entropy||f.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),c=this.n.byteLength(),d=this.n.sub(new e(2));;){var g=new e(b.generate(c));if(!(g.cmp(d)>0))return g.iaddn(1),this.keyFromPrivate(g)}},d.prototype._truncateToN=function(a,b){var c=8*a.byteLength()-this.n.bitLength();return c>0&&(a=a.ushrn(c)),!b&&a.cmp(this.n)>=0?a.sub(this.n):a},d.prototype.sign=function(a,b,c,d){"object"==typeof c&&(d=c,c=null),d||(d={}),b=this.keyFromPrivate(b,c),a=this._truncateToN(new e(a,16));for(var g=this.n.byteLength(),h=b.getPrivate().toArray("be",g),i=a.toArray("be",g),k=new f.hmacDRBG({hash:this.hash,entropy:h,nonce:i,pers:d.pers,persEnc:d.persEnc}),l=this.n.sub(new e(1)),m=0;!0;m++){var n=d.k?d.k(m):new e(k.generate(this.n.byteLength()));if(n=this._truncateToN(n,!0),!(n.cmpn(1)<=0||n.cmp(l)>=0)){var o=this.g.mul(n);if(!o.isInfinity()){var p=o.getX(),q=p.umod(this.n);if(0!==q.cmpn(0)){var r=n.invm(this.n).mul(q.mul(b.getPrivate()).iadd(a));if(r=r.umod(this.n),0!==r.cmpn(0)){var s=(o.getY().isOdd()?1:0)|(0!==p.cmp(q)?2:0);return d.canonical&&r.cmp(this.nh)>0&&(r=this.n.sub(r),s^=1),new j({r:q,s:r,recoveryParam:s})}}}}}},d.prototype.verify=function(a,b,c,d){a=this._truncateToN(new e(a,16)),c=this.keyFromPublic(c,d),b=new j(b,"hex");var f=b.r,g=b.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;if(g.cmpn(1)<0||g.cmp(this.n)>=0)return!1;var h=g.invm(this.n),i=h.mul(a).umod(this.n),k=h.mul(f).umod(this.n);if(!this.curve._maxwellTrick){var l=this.g.mulAdd(i,c.getPublic(),k);return!l.isInfinity()&&0===l.getX().umod(this.n).cmp(f)}var l=this.g.jmulAdd(i,c.getPublic(),k);return!l.isInfinity()&&l.eqXToP(f)},d.prototype.recoverPubKey=function(a,b,c,d){h((3&c)===c,"The recovery param is more than two bits"),b=new j(b,d);var f=this.n,g=new e(a),i=b.r,k=b.s,l=1&c,m=c>>1;if(i.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");i=m?this.curve.pointFromX(i.add(this.curve.n),l):this.curve.pointFromX(i,l);var n=b.r.invm(f),o=f.sub(g).mul(n).umod(f),p=k.mul(n).umod(f);return this.g.mulAdd(o,i,p)},d.prototype.getKeyRecoveryParam=function(a,b,c,d){if(b=new j(b,d),null!==b.recoveryParam)return b.recoveryParam;for(var e=0;e<4;e++){var f;try{f=this.recoverPubKey(a,b,e)}catch(a){continue}if(f.eq(c))return e}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":5,"./key":13,"./signature":14,"bn.js":2}],13:[function(a,b,c){"use strict";function d(a,b){this.ec=a,this.priv=null,this.pub=null,b.priv&&this._importPrivate(b.priv,b.privEnc),b.pub&&this._importPublic(b.pub,b.pubEnc)}var e=a("bn.js"),f=a("../../elliptic"),g=f.utils,h=g.assert;b.exports=d,d.fromPublic=function(a,b,c){return b instanceof d?b:new d(a,{pub:b,pubEnc:c})},d.fromPrivate=function(a,b,c){return b instanceof d?b:new d(a,{priv:b,privEnc:c})},d.prototype.validate=function(){var a=this.getPublic();return a.isInfinity()?{result:!1,reason:"Invalid public key"}:a.validate()?a.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(a,b){return"string"==typeof a&&(b=a,a=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),b?this.pub.encode(b,a):this.pub},d.prototype.getPrivate=function(a){return"hex"===a?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(a,b){this.priv=new e(a,b||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(a,b){return a.x||a.y?("mont"===this.ec.curve.type?h(a.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||h(a.x&&a.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(a.x,a.y))):void(this.pub=this.ec.curve.decodePoint(a,b))},d.prototype.derive=function(a){return a.mul(this.priv).getX()},d.prototype.sign=function(a,b,c){return this.ec.sign(a,this,b,c)},d.prototype.verify=function(a,b){return this.ec.verify(a,b,this)},d.prototype.inspect=function(){return""}},{"../../elliptic":5,"bn.js":2}],14:[function(a,b,c){"use strict";function d(a,b){return a instanceof d?a:void(this._importDER(a,b)||(l(a.r&&a.s,"Signature without r or s"),this.r=new i(a.r,16),this.s=new i(a.s,16),void 0===a.recoveryParam?this.recoveryParam=null:this.recoveryParam=a.recoveryParam))}function e(){this.place=0}function f(a,b){var c=a[b.place++];if(!(128&c))return c;for(var d=15&c,e=0,f=0,g=b.place;f>>3);for(a.push(128|c);--c;)a.push(b>>>(c<<3)&255);a.push(b)}var i=a("bn.js"),j=a("../../elliptic"),k=j.utils,l=k.assert;b.exports=d,d.prototype._importDER=function(a,b){a=k.toArray(a,b);var c=new e;if(48!==a[c.place++])return!1;var d=f(a,c);if(d+c.place!==a.length)return!1;if(2!==a[c.place++])return!1;var g=f(a,c),h=a.slice(c.place,g+c.place);if(c.place+=g,2!==a[c.place++])return!1;var j=f(a,c);if(a.length!==j+c.place)return!1;var l=a.slice(c.place,j+c.place);return 0===h[0]&&128&h[1]&&(h=h.slice(1)),0===l[0]&&128&l[1]&&(l=l.slice(1)),this.r=new i(h),this.s=new i(l),this.recoveryParam=null,!0},d.prototype.toDER=function(a){var b=this.r.toArray(),c=this.s.toArray();for(128&b[0]&&(b=[0].concat(b)),128&c[0]&&(c=[0].concat(c)),b=g(b),c=g(c);!(c[0]||128&c[1]);)c=c.slice(1);var d=[2];h(d,b.length),d=d.concat(b),d.push(2),h(d,c.length);var e=d.concat(c),f=[48];return h(f,e.length),f=f.concat(e),k.encode(f,a)}},{"../../elliptic":5,"bn.js":2}],15:[function(a,b,c){arguments[4][7][0].apply(c,arguments)},{dup:7}],16:[function(a,b,c){"use strict";function d(a){if(!(this instanceof d))return new d(a);this.hash=a.hash,this.predResist=!!a.predResist,this.outLen=this.hash.outSize,this.minEntropy=a.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var b=g.toArray(a.entropy,a.entropyEnc),c=g.toArray(a.nonce,a.nonceEnc),e=g.toArray(a.pers,a.persEnc);h(b.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(b,c,e)}var e=a("hash.js"),f=a("../elliptic"),g=f.utils,h=g.assert;b.exports=d,d.prototype._init=function(a,b,c){var d=a.concat(b).concat(c);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var e=0;e=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(a.concat(c||[])),this.reseed=1},d.prototype.generate=function(a,b,c,d){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof b&&(d=c,c=b,b=null),c&&(c=g.toArray(c,d),this._update(c));for(var e=[];e.length>8,g=255&e;f?c.push(f,g):c.push(g)}return c}function e(a){return 1===a.length?"0"+a:a}function f(a){for(var b="",c=0;c=0;){var f;if(e.isOdd()){var g=e.andln(d-1);f=g>(d>>1)-1?(d>>1)-g:g,e.isubn(f)}else f=0;c.push(f);for(var h=0!==e.cmpn(0)&&0===e.andln(d-1)?b+1:1,i=1;i0||b.cmpn(-e)>0;){var f=a.andln(3)+d&3,g=b.andln(3)+e&3;3===f&&(f=-1),3===g&&(g=-1);var h;if(0===(1&f))h=0;else{var i=a.andln(7)+d&7;h=3!==i&&5!==i||2!==g?f:-f}c[0].push(h);var j;if(0===(1&g))j=0;else{var i=b.andln(7)+e&7;j=3!==i&&5!==i||2!==f?g:-g}c[1].push(j),2*d===h+1&&(d=1-d),2*e===j+1&&(e=1-e),a.iushrn(1),b.iushrn(1)}return c}function i(a,b,c){var d="_"+b;a.prototype[b]=function(){return void 0!==this[d]?this[d]:this[d]=c.call(this)}}function j(a){return"string"==typeof a?l.toArray(a,"hex"):a}function k(a){return new m(a,"hex","le")}var l=c,m=a("bn.js");l.assert=function(a,b){if(!a)throw new Error(b||"Assertion failed")},l.toArray=d,l.zero2=e,l.toHex=f,l.encode=function(a,b){return"hex"===b?f(a):a},l.getNAF=g,l.getJSF=h,l.cachedProperty=i,l.parseBytes=j,l.intFromLE=k},{"bn.js":2}],19:[function(a,b,c){b.exports={version:"6.3.3"}},{}],20:[function(a,b,c){var d=c;d.utils=a("./hash/utils"),d.common=a("./hash/common"),d.sha=a("./hash/sha"),d.ripemd=a("./hash/ripemd"),d.hmac=a("./hash/hmac"),d.sha1=d.sha.sha1,d.sha256=d.sha.sha256,d.sha224=d.sha.sha224,d.sha384=d.sha.sha384,d.sha512=d.sha.sha512,d.ripemd160=d.ripemd.ripemd160},{"./hash/common":21,"./hash/hmac":22,"./hash/ripemd":23,"./hash/sha":24,"./hash/utils":31}],21:[function(a,b,c){"use strict";function d(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var e=a("./utils"),f=a("minimalistic-assert");c.BlockHash=d,d.prototype.update=function(a,b){if(a=e.toArray(a,b),this.pending?this.pending=this.pending.concat(a):this.pending=a,this.pendingTotal+=a.length,this.pending.length>=this._delta8){a=this.pending;var c=a.length%this._delta8;this.pending=a.slice(a.length-c,a.length),0===this.pending.length&&(this.pending=null),a=e.join32(a,0,a.length-c,this.endian);for(var d=0;d>>24&255,d[e++]=a>>>16&255,d[e++]=a>>>8&255,d[e++]=255&a}else for(d[e++]=255&a,d[e++]=a>>>8&255,d[e++]=a>>>16&255,d[e++]=a>>>24&255,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=0,f=8;fthis.blockSize&&(a=(new this.Hash).update(a).digest()),f(a.length<=this.blockSize);for(var b=a.length;b>>3}function k(a){return m(a,17)^m(a,19)^a>>>10}var l=a("../utils"),m=l.rotr32;c.ft_1=d,c.ch32=e,c.maj32=f,c.p32=g,c.s0_256=h,c.s1_256=i,c.g0_256=j,c.g1_256=k},{"../utils":31}],31:[function(a,b,c){"use strict";function d(a,b){if(Array.isArray(a))return a.slice();if(!a)return[];var c=[];if("string"==typeof a)if(b){if("hex"===b)for(a=a.replace(/[^a-z0-9]+/gi,""),a.length%2!==0&&(a="0"+a),d=0;d>8,g=255&e;f?c.push(f,g):c.push(g)}else for(d=0;d>>24|a>>>8&65280|a<<8&16711680|(255&a)<<24;return b>>>0}function g(a,b){for(var c="",d=0;d>>0}return f}function k(a,b){for(var c=new Array(4*a.length),d=0,e=0;d>>24,c[e+1]=f>>>16&255,c[e+2]=f>>>8&255,c[e+3]=255&f):(c[e+3]=f>>>24,c[e+2]=f>>>16&255,c[e+1]=f>>>8&255,c[e]=255&f)}return c}function l(a,b){return a>>>b|a<<32-b}function m(a,b){return a<>>32-b}function n(a,b){return a+b>>>0}function o(a,b,c){return a+b+c>>>0}function p(a,b,c,d){return a+b+c+d>>>0}function q(a,b,c,d,e){return a+b+c+d+e>>>0}function r(a,b,c,d){var e=a[b],f=a[b+1],g=d+f>>>0,h=(g>>0,a[b+1]=g}function s(a,b,c,d){var e=b+d>>>0,f=(e>>0}function t(a,b,c,d){var e=b+d;return e>>>0}function u(a,b,c,d,e,f,g,h){var i=0,j=b;j=j+d>>>0,i+=j>>0,i+=j>>0,i+=j>>0}function v(a,b,c,d,e,f,g,h){var i=b+d+f+h;return i>>>0}function w(a,b,c,d,e,f,g,h,i,j){var k=0,l=b;l=l+d>>>0,k+=l>>0,k+=l>>0,k+=l>>0,k+=l>>0}function x(a,b,c,d,e,f,g,h,i,j){var k=b+d+f+h+j;return k>>>0}function y(a,b,c){var d=b<<32-c|a>>>c;return d>>>0}function z(a,b,c){ -var d=a<<32-c|b>>>c;return d>>>0}function A(a,b,c){return a>>>c}function B(a,b,c){var d=a<<32-c|b>>>c;return d>>>0}var C=a("minimalistic-assert"),D=a("inherits");c.inherits=D,c.toArray=d,c.toHex=e,c.htonl=f,c.toHex32=g,c.zero2=h,c.zero8=i,c.join32=j,c.split32=k,c.rotr32=l,c.rotl32=m,c.sum32=n,c.sum32_3=o,c.sum32_4=p,c.sum32_5=q,c.sum64=r,c.sum64_hi=s,c.sum64_lo=t,c.sum64_4_hi=u,c.sum64_4_lo=v,c.sum64_5_hi=w,c.sum64_5_lo=x,c.rotr64_hi=y,c.rotr64_lo=z,c.shr64_hi=A,c.shr64_lo=B},{inherits:32,"minimalistic-assert":35}],32:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],33:[function(a,b,c){arguments[4][32][0].apply(c,arguments)},{dup:32}],34:[function(a,b,c){(function(a,c){!function(){"use strict";function d(a,b,c){this.blocks=[],this.s=[],this.padding=b,this.outputBits=c,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(a<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=c>>5,this.extraBytes=(31&c)>>3;for(var d=0;d<50;++d)this.s[d]=0}var e="object"==typeof window?window:{},f=!e.JS_SHA3_NO_NODE_JS&&"object"==typeof a&&a.versions&&a.versions.node;f&&(e=c);for(var g=!e.JS_SHA3_NO_COMMON_JS&&"object"==typeof b&&b.exports,h="0123456789abcdef".split(""),i=[31,7936,2031616,520093696],j=[1,256,65536,16777216],k=[6,1536,393216,100663296],l=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],n=[224,256,384,512],o=[128,256],p=["hex","buffer","arrayBuffer","array"],q=function(a,b,c){return function(e){return new d(a,b,a).update(e)[c]()}},r=function(a,b,c){return function(e,f){return new d(a,b,f).update(e)[c]()}},s=function(a,b){var c=q(a,b,"hex");c.create=function(){return new d(a,b,a)},c.update=function(a){return c.create().update(a)};for(var e=0;e>2]|=a[i]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(f[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=g){for(this.start=c-g,this.block=f[h],c=0;c>2]|=this.padding[3&b],this.lastByteIndex===this.byteCount)for(a[0]=a[c],b=1;b>4&15]+h[15&a]+h[a>>12&15]+h[a>>8&15]+h[a>>20&15]+h[a>>16&15]+h[a>>28&15]+h[a>>24&15];g%b===0&&(C(c),f=0)}return e&&(a=c[f],e>0&&(i+=h[a>>4&15]+h[15&a]),e>1&&(i+=h[a>>12&15]+h[a>>8&15]),e>2&&(i+=h[a>>20&15]+h[a>>16&15])),i},d.prototype.arrayBuffer=function(){this.finalize();var a,b=this.blockCount,c=this.s,d=this.outputBlocks,e=this.extraBytes,f=0,g=0,h=this.outputBits>>3;a=e?new ArrayBuffer(d+1<<2):new ArrayBuffer(h);for(var i=new Uint32Array(a);g>8&255,i[a+2]=b>>16&255,i[a+3]=b>>24&255;h%c===0&&C(d)}return f&&(a=h<<2,b=d[g],f>0&&(i[a]=255&b),f>1&&(i[a+1]=b>>8&255),f>2&&(i[a+2]=b>>16&255)),i};var C=function(a){var b,c,d,e,f,g,h,i,j,k,l,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka;for(d=0;d<48;d+=2)e=a[0]^a[10]^a[20]^a[30]^a[40],f=a[1]^a[11]^a[21]^a[31]^a[41],g=a[2]^a[12]^a[22]^a[32]^a[42],h=a[3]^a[13]^a[23]^a[33]^a[43],i=a[4]^a[14]^a[24]^a[34]^a[44],j=a[5]^a[15]^a[25]^a[35]^a[45],k=a[6]^a[16]^a[26]^a[36]^a[46],l=a[7]^a[17]^a[27]^a[37]^a[47],n=a[8]^a[18]^a[28]^a[38]^a[48],o=a[9]^a[19]^a[29]^a[39]^a[49],b=n^(g<<1|h>>>31),c=o^(h<<1|g>>>31),a[0]^=b,a[1]^=c,a[10]^=b,a[11]^=c,a[20]^=b,a[21]^=c,a[30]^=b,a[31]^=c,a[40]^=b,a[41]^=c,b=e^(i<<1|j>>>31),c=f^(j<<1|i>>>31),a[2]^=b,a[3]^=c,a[12]^=b,a[13]^=c,a[22]^=b,a[23]^=c,a[32]^=b,a[33]^=c,a[42]^=b,a[43]^=c,b=g^(k<<1|l>>>31),c=h^(l<<1|k>>>31),a[4]^=b,a[5]^=c,a[14]^=b,a[15]^=c,a[24]^=b,a[25]^=c,a[34]^=b,a[35]^=c,a[44]^=b,a[45]^=c,b=i^(n<<1|o>>>31),c=j^(o<<1|n>>>31),a[6]^=b,a[7]^=c,a[16]^=b,a[17]^=c,a[26]^=b,a[27]^=c,a[36]^=b,a[37]^=c,a[46]^=b,a[47]^=c,b=k^(e<<1|f>>>31),c=l^(f<<1|e>>>31),a[8]^=b,a[9]^=c,a[18]^=b,a[19]^=c,a[28]^=b,a[29]^=c,a[38]^=b,a[39]^=c,a[48]^=b,a[49]^=c,p=a[0],q=a[1],V=a[11]<<4|a[10]>>>28,W=a[10]<<4|a[11]>>>28,D=a[20]<<3|a[21]>>>29,E=a[21]<<3|a[20]>>>29,ha=a[31]<<9|a[30]>>>23,ia=a[30]<<9|a[31]>>>23,R=a[40]<<18|a[41]>>>14,S=a[41]<<18|a[40]>>>14,J=a[2]<<1|a[3]>>>31,K=a[3]<<1|a[2]>>>31,r=a[13]<<12|a[12]>>>20,s=a[12]<<12|a[13]>>>20,X=a[22]<<10|a[23]>>>22,Y=a[23]<<10|a[22]>>>22,F=a[33]<<13|a[32]>>>19,G=a[32]<<13|a[33]>>>19,ja=a[42]<<2|a[43]>>>30,ka=a[43]<<2|a[42]>>>30,ba=a[5]<<30|a[4]>>>2,ca=a[4]<<30|a[5]>>>2,L=a[14]<<6|a[15]>>>26,M=a[15]<<6|a[14]>>>26,t=a[25]<<11|a[24]>>>21,u=a[24]<<11|a[25]>>>21,Z=a[34]<<15|a[35]>>>17,$=a[35]<<15|a[34]>>>17,H=a[45]<<29|a[44]>>>3,I=a[44]<<29|a[45]>>>3,z=a[6]<<28|a[7]>>>4,A=a[7]<<28|a[6]>>>4,da=a[17]<<23|a[16]>>>9,ea=a[16]<<23|a[17]>>>9,N=a[26]<<25|a[27]>>>7,O=a[27]<<25|a[26]>>>7,v=a[36]<<21|a[37]>>>11,w=a[37]<<21|a[36]>>>11,_=a[47]<<24|a[46]>>>8,aa=a[46]<<24|a[47]>>>8,T=a[8]<<27|a[9]>>>5,U=a[9]<<27|a[8]>>>5,B=a[18]<<20|a[19]>>>12,C=a[19]<<20|a[18]>>>12,fa=a[29]<<7|a[28]>>>25,ga=a[28]<<7|a[29]>>>25,P=a[38]<<8|a[39]>>>24,Q=a[39]<<8|a[38]>>>24,x=a[48]<<14|a[49]>>>18,y=a[49]<<14|a[48]>>>18,a[0]=p^~r&t,a[1]=q^~s&u,a[10]=z^~B&D,a[11]=A^~C&E,a[20]=J^~L&N,a[21]=K^~M&O,a[30]=T^~V&X,a[31]=U^~W&Y,a[40]=ba^~da&fa,a[41]=ca^~ea&ga,a[2]=r^~t&v,a[3]=s^~u&w,a[12]=B^~D&F,a[13]=C^~E&G,a[22]=L^~N&P,a[23]=M^~O&Q,a[32]=V^~X&Z,a[33]=W^~Y&$,a[42]=da^~fa&ha,a[43]=ea^~ga&ia,a[4]=t^~v&x,a[5]=u^~w&y,a[14]=D^~F&H,a[15]=E^~G&I,a[24]=N^~P&R,a[25]=O^~Q&S,a[34]=X^~Z&_,a[35]=Y^~$&aa,a[44]=fa^~ha&ja,a[45]=ga^~ia&ka,a[6]=v^~x&p,a[7]=w^~y&q,a[16]=F^~H&z,a[17]=G^~I&A,a[26]=P^~R&J,a[27]=Q^~S&K,a[36]=Z^~_&T,a[37]=$^~aa&U,a[46]=ha^~ja&ba,a[47]=ia^~ka&ca,a[8]=x^~p&r,a[9]=y^~q&s,a[18]=H^~z&B,a[19]=I^~A&C,a[28]=R^~J&L,a[29]=S^~K&M,a[38]=_^~T&V,a[39]=aa^~U&W,a[48]=ja^~ba&da,a[49]=ka^~ca&ea,a[0]^=m[d],a[1]^=m[d+1]};if(g)b.exports=v;else for(var x=0;x=64;){var n,o,p,q,r,s=d,t=e,u=f,v=g,w=h,x=i,y=j,z=k;for(o=0;o<16;o++)p=b+4*o,l[o]=(255&a[p])<<24|(255&a[p+1])<<16|(255&a[p+2])<<8|255&a[p+3];for(o=16;o<64;o++)n=l[o-2],q=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,n=l[o-15],r=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,l[o]=(q+l[o-7]|0)+(r+l[o-16]|0)|0;for(o=0;o<64;o++)q=(((w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7))+(w&x^~w&y)|0)+(z+(c[o]+l[o]|0)|0)|0,r=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&t^s&u^t&u)|0,z=y,y=x,x=w,w=v+q|0,v=u,u=t,t=s,s=q+r|0;d=d+s|0,e=e+t|0,f=f+u|0,g=g+v|0,h=h+w|0,i=i+x|0,j=j+y|0,k=k+z|0,b+=64,m-=64}}var c=[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],d=1779033703,e=3144134277,f=1013904242,g=2773480762,h=1359893119,i=2600822924,j=528734635,k=1541459225,l=new Array(64);b(a);var m,n=a.length%64,o=a.length/536870912|0,p=a.length<<3,q=n<56?56:120,r=a.slice(a.length-n,a.length);for(r.push(128),m=n+1;m>>24&255),r.push(o>>>16&255),r.push(o>>>8&255),r.push(o>>>0&255),r.push(p>>>24&255),r.push(p>>>16&255),r.push(p>>>8&255),r.push(p>>>0&255),b(r),[d>>>24&255,d>>>16&255,d>>>8&255,d>>>0&255,e>>>24&255,e>>>16&255,e>>>8&255,e>>>0&255,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255,g>>>24&255,g>>>16&255,g>>>8&255,g>>>0&255,h>>>24&255,h>>>16&255,h>>>8&255,h>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,j>>>24&255,j>>>16&255,j>>>8&255,j>>>0&255,k>>>24&255,k>>>16&255,k>>>8&255,k>>>0&255]}function f(a,b,c){function d(){for(var a=g-1;a>=g-4;a--){if(h[a]++,h[a]<=255)return;h[a]=0}}a=a.length<=64?a:e(a);var f,g=64+b.length+4,h=new Array(g),i=new Array(64),j=[];for(f=0;f<64;f++)h[f]=54;for(f=0;f=32;)d(),j=j.concat(e(i.concat(e(h)))),c-=32;return c>0&&(d(),j=j.concat(e(i.concat(e(h))).slice(0,c))),j}function g(a,b,c,d,e){var f;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>>32-b}function i(a,b){k(a,0,b,0,16);for(var c=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]}function j(a,b,c,d){for(var e=0;e=256)return!1}return!0}function m(a,b){var c=parseInt(a);if(a!=c)throw new Error("invalid "+b);return c}function n(a,b,c,d,e,h,i){if(!i)throw new Error("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))throw new Error("N must be power of 2");if(c>o/128/d)throw new Error("N too large");if(d>o/128/e)throw new Error("r too large");if(!l(a))throw new Error("password must be an array or buffer");if(!l(b))throw new Error("salt must be an array or buffer");for(var n=f(a,b,128*e*d),p=new Uint32Array(32*e*d),q=0;qF&&(b=F);for(var l=0;lF&&(b=F);for(var l=0;l>0&255),n.push(p[l]>>8&255),n.push(p[l]>>16&255),n.push(p[l]>>24&255);var r=f(a,n,h);return i(null,1,r)}G(H)};H()}var o=2147483647;"undefined"!=typeof d?c.exports=n:"function"==typeof a&&a.amd?a(n):b&&(b.scrypt&&(b._scrypt=b.scrypt),b.scrypt=n)}(this)},{}],38:[function(a,b,c){(function(a,b){!function(b,c){"use strict";function d(a){return p[o]=e.apply(c,a),o++}function e(a){var b=[].slice.call(arguments,1);return function(){"function"==typeof a?a.apply(c,b):new Function(""+a)()}}function f(a){if(q)setTimeout(e(f,a),0);else{var b=p[a];if(b){q=!0;try{b()}finally{g(a),q=!1}}}}function g(a){delete p[a]}function h(){n=function(){var b=d(arguments);return a.nextTick(e(f,b)),b}}function i(){if(b.postMessage&&!b.importScripts){var a=!0,c=b.onmessage;return b.onmessage=function(){a=!1},b.postMessage("","*"),b.onmessage=c,a}}function j(){var a="setImmediate$"+Math.random()+"$",c=function(c){c.source===b&&"string"==typeof c.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(){var c=d(arguments);return b.postMessage(a+c,"*"),c}}function k(){var a=new MessageChannel;a.port1.onmessage=function(a){var b=a.data;f(b)},n=function(){var b=d(arguments);return a.port2.postMessage(b),b}}function l(){var a=r.documentElement;n=function(){var b=d(arguments),c=r.createElement("script");return c.onreadystatechange=function(){f(b),c.onreadystatechange=null,a.removeChild(c),c=null},a.appendChild(c),b}}function m(){n=function(){var a=d(arguments);return setTimeout(e(f,a),0),a}}if(!b.setImmediate){var n,o=1,p={},q=!1,r=b.document,s=Object.getPrototypeOf&&Object.getPrototypeOf(b);s=s&&s.setTimeout?s:b,"[object process]"==={}.toString.call(b.process)?h():i()?j():b.MessageChannel?k():r&&"onreadystatechange"in r.createElement("script")?l():m(),s.setImmediate=n,s.clearImmediate=g}}("undefined"==typeof self?"undefined"==typeof b?this:b:self)}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:36}],39:[function(a,b,c){(function(a){var c;if(a.crypto&&crypto.getRandomValues){var d=new Uint8Array(16);c=function(){return crypto.getRandomValues(d),d}}if(!c){var e=new Array(16);c=function(){for(var a,b=0;b<16;b++)0===(3&b)&&(a=4294967296*Math.random()),e[b]=a>>>((3&b)<<3)&255;return e}}b.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],40:[function(a,b,c){function d(a,b,c){var d=b&&c||0,e=0;for(b=b||[],a.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){e<16&&(b[d+e++]=j[a])});e<16;)b[d+e++]=0;return b}function e(a,b){var c=b||0,d=i;return d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]}function f(a,b,c){var d=b&&c||0,f=b||[];a=a||{};var g=void 0!==a.clockseq?a.clockseq:n,h=void 0!==a.msecs?a.msecs:(new Date).getTime(),i=void 0!==a.nsecs?a.nsecs:p+1,j=h-o+(i-p)/1e4;if(j<0&&void 0===a.clockseq&&(g=g+1&16383),(j<0||h>o)&&void 0===a.nsecs&&(i=0),i>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");o=h,p=i,n=g,h+=122192928e5;var k=(1e4*(268435455&h)+i)%4294967296;f[d++]=k>>>24&255,f[d++]=k>>>16&255,f[d++]=k>>>8&255,f[d++]=255&k;var l=h/4294967296*1e4&268435455;f[d++]=l>>>8&255,f[d++]=255&l,f[d++]=l>>>24&15|16,f[d++]=l>>>16&255,f[d++]=g>>>8|128,f[d++]=255&g;for(var q=a.node||m,r=0;r<6;r++)f[d+r]=q[r];return b?b:e(f)}function g(a,b,c){var d=b&&c||0;"string"==typeof a&&(b="binary"==a?new Array(16):null,a=null),a=a||{};var f=a.random||(a.rng||h)();if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b)for(var g=0;g<16;g++)b[d+g]=f[g];return b||e(f)}for(var h=a("./rng"),i=[],j={},k=0;k<256;k++)i[k]=(k+256).toString(16).substr(1),j[i[k]]=k;var l=h(),m=[1|l[0],l[1],l[2],l[3],l[4],l[5]],n=16383&(l[6]<<8|l[7]),o=0,p=0,q=g;q.v1=f,q.v4=g,q.parse=d,q.unparse=e,b.exports=q},{"./rng":39}],41:[function(a,b,c){"use strict";function d(a){var b=parseInt(32*Math.ceil(a.length/32)),c=new Uint8Array(b-a.length);return o.concat([v.encode(a.length),a,c])}function e(a,b){a.length=0?c:"")+"]";return{coder:b,localName:d,length:c,name:"array",type:e,encode:function(a){Array.isArray(a)||n("invalid array");var d=c,e=new Uint8Array(0);d===-1&&(d=a.length,e=v.encode(d)),d!==a.length&&n("size mismatch");var f=[];return a.forEach(function(a){f.push(b)}),o.concat([e,g(f,a)])},decode:function(d,f){var g=0,i=c;if(i===-1){var j=v.decode(d,f);i=j.value.toNumber(),g+=j.consumed,f+=j.consumed}for(var k=[],l=0;l256||f%8!==0)&&n("invalid type",{type:b}),u(a,f/8,"int"===e[1],c)}var e=b.match(p);if(e){var f=parseInt(e[1]);return(0===f||f>32)&&n("invalid type "+b),x(a,f,c)}var e=b.match(r);if(e){var f=parseInt(e[2]||-1);return i(a,l(a,e[1],c),f,c)}if("tuple("===b.substring(0,6)&&")"===b.substring(b.length-1)){var g=[],h=[];return c&&"object"==typeof c&&(Array.isArray(c.names)&&(h=c.names),"string"==typeof c.name&&(c=c.name)),k(b.substring(6,b.length-1)).forEach(function(b,c){g.push(l(a,b,h[c]))}),j(a,g,c)}return""===b?t(a):void n("invalid type",{type:b})}function m(a){if(!(this instanceof m))throw new Error("missing new");a||(a=s),o.defineProperty(this,"coerceFunc",a)}var n=a("../utils/throw-error"),o=function(){var b=a("../utils/convert.js"),c=a("../utils/utf8.js");return{defineProperty:a("../utils/properties.js").defineProperty,arrayify:b.arrayify,padZeros:b.padZeros,bigNumberify:a("../utils/bignumber.js").bigNumberify,getAddress:a("../utils/address").getAddress,concat:b.concat,toUtf8Bytes:c.toUtf8Bytes,toUtf8String:c.toUtf8String,hexlify:b.hexlify}}(),p=new RegExp(/^bytes([0-9]*)$/),q=new RegExp(/^(u?int)([0-9]*)$/),r=new RegExp(/^(.*)\[([0-9]*)\]$/),s=function(a,b){var c=a.match(q);return c&&parseInt(c[2])<=48?b.toNumber():b},t=function(a){return{name:"null",type:"",encode:function(a){return o.arrayify([])},decode:function(b,c){if(c>b.length)throw new Error("invalid null");return{consumed:0,value:a("null",void 0)}},dynamic:!1}},u=function(a,b,c,d){var e=(c?"int":"uint")+8*b;return{localName:d,name:e,type:e,encode:function(a){return a=o.bigNumberify(a).toTwos(8*b).maskn(8*b),c&&(a=a.fromTwos(8*b).toTwos(256)),o.padZeros(o.arrayify(a),32)},decode:function(d,f){d.length>1]>>4>=8&&(a[c]=a[c].toUpperCase()),(15&b[c>>1])>=8&&(a[c+1]=a[c+1].toUpperCase());return"0x"+a.join("")}function e(a){return Math.log10?Math.log10(a):Math.log(a)/Math.LN10}function f(a,b){var c=null;if("string"!=typeof a&&i("invalid address",{input:a}),a.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==a.substring(0,2)&&(a="0x"+a),c=d(a),a.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&c!==a&&i("invalid address checksum",{input:a,expected:c});else if(a.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(a.substring(2,4)!==l(a)&&i("invalid address icap checksum",{input:a}),c=new g(a.substring(4),36).toString(16);c.length<40;)c="0"+c;c=d("0x"+c)}else i("invalid address",{input:a});if(b){for(var e=new g(c.substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e}return c}var g=a("bn.js"),h=a("./convert"),i=a("./throw-error"),j=a("./keccak256"),k=9007199254740991,l=function(){for(var a={},b=0;b<10;b++)a[String(b)]=String(b);for(var b=0;b<26;b++)a[String.fromCharCode(65+b)]=String(10+b);var c=Math.floor(e(k));return function(b){b=b.toUpperCase(),b=b.substring(4)+b.substring(0,2)+"00";for(var d=b.split(""),e=0;e=c;){var f=d.substring(0,c);d=parseInt(f,10)%97+d.substring(f.length)}for(var g=String(98-parseInt(d,10)%97);g.length<2;)g="0"+g;return g}}();b.exports={getAddress:f}},{"./convert":46,"./keccak256":51,"./throw-error":58,"bn.js":2}],43:[function(a,b,c){function d(a){if(!(this instanceof d))throw new Error("missing new");i.isHexString(a)?("0x"==a&&(a="0x0"),a=new g(a.substring(2),16)):"string"==typeof a&&"-"===a[0]&&i.isHexString(a.substring(1))?a=new g(a.substring(3),16).mul(d.constantNegativeOne._bn):"string"==typeof a&&a.match(/^-?[0-9]*$/)?(""==a&&(a="0"),a=new g(a)):"number"==typeof a&&parseInt(a)==a?a=new g(a):g.isBN(a)||(e(a)?a=a._bn:i.isArrayish(a)?a=new g(i.hexlify(a).substring(2),16):j("invalid BigNumber value",{input:a})),h(this,"_bn",a)}function e(a){return a._bn&&a._bn.mod}function f(a){return e(a)?a:new d(a)}var g=a("bn.js"),h=a("./properties").defineProperty,i=a("./convert"),j=a("./throw-error");h(d,"constantNegativeOne",f(-1)),h(d,"constantZero",f(0)),h(d,"constantOne",f(1)),h(d,"constantTwo",f(2)),h(d,"constantWeiPerEther",f(new g("1000000000000000000"))),h(d.prototype,"fromTwos",function(a){return new d(this._bn.fromTwos(a))}),h(d.prototype,"toTwos",function(a){return new d(this._bn.toTwos(a))}),h(d.prototype,"add",function(a){return new d(this._bn.add(f(a)._bn))}),h(d.prototype,"sub",function(a){return new d(this._bn.sub(f(a)._bn))}),h(d.prototype,"div",function(a){return new d(this._bn.div(f(a)._bn))}),h(d.prototype,"mul",function(a){return new d(this._bn.mul(f(a)._bn))}),h(d.prototype,"mod",function(a){return new d(this._bn.mod(f(a)._bn))}),h(d.prototype,"pow",function(a){return new d(this._bn.pow(f(a)._bn))}),h(d.prototype,"maskn",function(a){return new d(this._bn.maskn(a))}),h(d.prototype,"eq",function(a){return this._bn.eq(f(a)._bn)}),h(d.prototype,"lt",function(a){return this._bn.lt(f(a)._bn)}),h(d.prototype,"lte",function(a){return this._bn.lte(f(a)._bn)}),h(d.prototype,"gt",function(a){return this._bn.gt(f(a)._bn)}),h(d.prototype,"gte",function(a){return this._bn.gte(f(a)._bn)}),h(d.prototype,"isZero",function(){return this._bn.isZero()}),h(d.prototype,"toNumber",function(a){return this._bn.toNumber()}),h(d.prototype,"toString",function(){return this._bn.toString(10)}),h(d.prototype,"toHexString",function(){var a=this._bn.toString(16);return a.length%2&&(a="0"+a),"0x"+a}),b.exports={isBigNumber:e,bigNumberify:f,BigNumber:d}},{"./convert":46,"./properties":54,"./throw-error":58,"bn.js":2}],44:[function(a,b,c){(function(c){"use strict";function d(a){if(a<=0||a>1024||parseInt(a)!=a)throw new Error("invalid length");var b=new Uint8Array(a);return g.getRandomValues(b),e.arrayify(b)}var e=a("./convert"),f=a("./properties").defineProperty,g=c.crypto||c.msCrypto;g&&g.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),g={getRandomValues:function(a){for(var b=0;b<20;b++)for(var c=0;c=256||parseInt(c)!=c)return!1}return!0}function f(a){if(null==a&&o.throwError("cannot convert null value to array",o.INVALID_ARGUMENT,{arg:"value",value:a}),a&&a.toHexString&&(a=a.toHexString()),j(a)){a=a.substring(2),a.length%2&&(a="0"+a);for(var b=[],c=0;c>4]+p[15&f])}return"0x"+c.join("")}o.throwError("invalid hexlify value",{arg:"value",value:a})}function l(a){for(;a.length>3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function m(a,b){for(;a.length<2*b+2;)a="0x0"+a.substring(2);return a}function n(a){if(a=f(a),65!==a.length)throw new Error("invalid signature");var b=a[64];return 27!==b&&28!==b&&(b=27+b%2),{r:k(a.slice(0,32)),s:k(a.slice(32,64)),v:b}}var o=(a("./properties.js").defineProperty,a("./errors")),p="0123456789abcdef";b.exports={arrayify:f,isArrayish:e,concat:g,padZeros:i,stripZeros:h,splitSignature:n,hexlify:k,isHexString:j,hexStripZeros:l,hexZeroPad:m}},{"./errors":47,"./properties.js":54}],47:[function(a,b,c){"use strict";var d=a("./properties").defineProperty,e={};["UNKNOWN_ERROR","NOT_IMPLEMENTED","MISSING_NEW","INVALID_ARGUMENT","MISSING_ARGUMENT","UNEXPECTED_ARGUMENT","UNSUPPORTED_OPERATION"].forEach(function(a){ -d(e,a,a)}),d(e,"throwError",function(a,b,c){b||(b=e.UNKNOWN_ERROR),c||(c={});var d=[];Object.keys(c).forEach(function(a){d.push(a+"="+JSON.stringify(c[a]))});var f=a;d.length&&(a+=" ("+d.join(", ")+")");var g=new Error(a);throw g.reason=f,g.code=b,Object.keys(c).forEach(function(a){g[a]=c[a]}),g}),d(e,"checkNew",function(a,b){a instanceof b||e.throwError("missing new",e.MISSING_NEW,{name:b.name})}),b.exports=e},{"./properties":54}],48:[function(a,b,c){"use strict";function d(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha256,a)}function e(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha512,a)}var f=a("hash.js"),g=a("./sha2.js"),h=a("./convert.js");b.exports={createSha256Hmac:d,createSha512Hmac:e}},{"./convert.js":46,"./sha2.js":56,"hash.js":20}],49:[function(a,b,c){"use strict";function d(a){return e(f.toUtf8Bytes(a))}var e=a("./keccak256"),f=a("./utf8");b.exports=d},{"./keccak256":51,"./utf8":60}],50:[function(a,b,c){"use strict";var d=a("./address"),e=a("./abi-coder"),f=a("./bignumber"),g=a("./contract-address"),h=a("./convert"),i=a("./id"),j=a("./keccak256"),k=a("./namehash"),l=a("./sha2").sha256,m=a("./solidity"),n=a("./random-bytes"),o=a("./properties"),p=a("./rlp"),q=a("./utf8"),r=a("./units");b.exports={AbiCoder:e,RLP:p,defineProperty:o.defineProperty,etherSymbol:"Ξ",arrayify:h.arrayify,concat:h.concat,padZeros:h.padZeros,stripZeros:h.stripZeros,bigNumberify:f.bigNumberify,BigNumber:f.BigNumber,hexlify:h.hexlify,toUtf8Bytes:q.toUtf8Bytes,toUtf8String:q.toUtf8String,namehash:k,id:i,getAddress:d.getAddress,getContractAddress:g.getContractAddress,formatEther:r.formatEther,parseEther:r.parseEther,formatUnits:r.formatUnits,parseUnits:r.parseUnits,keccak256:j,sha256:l,randomBytes:n,solidityPack:m.pack,solidityKeccak256:m.keccak256,soliditySha256:m.sha256,splitSignature:h.splitSignature}},{"./abi-coder":41,"./address":42,"./bignumber":43,"./contract-address":45,"./convert":46,"./id":49,"./keccak256":51,"./namehash":52,"./properties":54,"./random-bytes":44,"./rlp":55,"./sha2":56,"./solidity":57,"./units":59,"./utf8":60}],51:[function(a,b,c){"use strict";function d(a){return a=f.arrayify(a),"0x"+e.keccak_256(a)}var e=a("js-sha3"),f=a("./convert.js");b.exports=d},{"./convert.js":46,"js-sha3":34}],52:[function(a,b,c){"use strict";function d(a,b){if(a=a.toLowerCase(),!a.match(j))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var c=h,d=0;a.length&&(!b||d>24&255,j[b.length+1]=m>>16&255,j[b.length+2]=m>>8&255,j[b.length+3]=255&m;var n=f(a).update(j).digest();g||(g=n.length,l=new Uint8Array(g),h=Math.ceil(d/g),k=d-(h-1)*g),l.set(n);for(var o=1;o>=8;return b}function e(a,b,c){for(var d=0,e=0;eb+1+d)throw new Error("invalid rlp")}return{consumed:1+d,result:e}}function i(a,b){if(0===a.length)throw new Error("invalid rlp data");if(a[b]>=248){var c=a[b]-247;if(b+1+c>a.length)throw new Error("too short");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("to short");return h(a,b,b+1+c,c+d)}if(a[b]>=192){var d=a[b]-192;if(b+1+d>a.length)throw new Error("invalid rlp data");return h(a,b,b+1,d)}if(a[b]>=184){var c=a[b]-183;if(b+1+c>a.length)throw new Error("invalid rlp data");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("invalid rlp data");var f=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){var d=a[b]-128;if(b+1+d>a.offset)throw new Error("invlaid rlp data");var f=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}function j(a){a=k.arrayify(a);var b=i(a,0);if(b.consumed!==a.length)throw new Error("invalid rlp data");return b.result}var k=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":46}],56:[function(a,b,c){"use strict";function d(a){return a=g.arrayify(a),"0x"+f.sha256().update(a).digest("hex")}function e(a){return a=g.arrayify(a),"0x"+f.sha512().update(a).digest("hex")}var f=a("hash.js"),g=a("./convert.js");b.exports={sha256:d,sha512:e,createSha256:f.sha256,createSha512:f.sha512}},{"./convert.js":46,"hash.js":20}],57:[function(a,b,c){"use strict";function d(a,b,c){switch(a){case"address":return c?i.padZeros(b,32):i.arrayify(b);case"string":return j.toUtf8Bytes(b);case"bytes":return i.arrayify(b);case"bool":return b=b?"0x01":"0x00",c?i.padZeros(b,32):i.arrayify(b)}var e=a.match(n);if(e){var f=("int"===e[1],parseInt(e[2]||"256"));if(f%8!=0||0===f||f>256)throw new Error("invalid number type - "+a);return c&&(f=256),b=h(b).toTwos(f),i.padZeros(b,f/8)}if(e=a.match(m)){var f=e[1];if(f!=parseInt(f)||0===f||f>32)throw new Error("invalid number type - "+a);if(f=parseInt(f),i.arrayify(b).byteLength!==f)throw new Error("invalid value for "+a);return c?(b+p).substring(0,66):b}if(e=a.match(o)){var g=e[1],k=parseInt(e[2]||b.length);if(k!=b.length)throw new Error("invalid value for "+a);var l=[];return b.forEach(function(a){a=d(g,a,!0),l.push(a)}),i.concat(l)}throw new Error("unknown type - "+a)}function e(a,b){if(a.length!=b.length)throw new Error("type/value count mismatch");var c=[];return a.forEach(function(a,e){c.push(d(a,b[e]))}),i.hexlify(i.concat(c))}function f(a,b){return k(e(a,b))}function g(a,b){return l(e(a,b))}var h=a("./bignumber").bigNumberify,i=a("./convert"),j=(a("./address").getAddress,a("./utf8")),k=a("./keccak256"),l=a("./sha2").sha256,m=new RegExp("^bytes([0-9]+)$"),n=new RegExp("^(u?int)([0-9]*)$"),o=new RegExp("^(.*)\\[([0-9]*)\\]$"),p="0000000000000000000000000000000000000000000000000000000000000000";b.exports={pack:e,keccak256:f,sha256:g}},{"./address":42,"./bignumber":43,"./convert":46,"./keccak256":51,"./sha2":56,"./utf8":60}],58:[function(a,b,c){"use strict";function d(a,b){var c=new Error(a);for(var d in b)c[d]=b[d];throw c}b.exports=d},{}],59:[function(a,b,c){function d(a,b,c){"object"!=typeof b||c||(c=b,b=void 0),null==b&&(b=18);var d=m(b);a=h(a),c||(c={});var e=a.lt(j);e&&(a=a.mul(k));for(var f=a.mod(d.tenPower).toString(10);f.length2&&i("too many decimal points",{input:a});var f=e[0],g=e[1];for(f||(f="0"),g||(g="0"),g.length>c.decimals&&i("too many decimal places",{input:a,decimals:g.length});g.length=0&&c<=256){for(var e="1",f=0;f>6|192,b[c++]=63&e|128):55296==(64512&e)&&d+1>18|240,b[c++]=e>>12&63|128,b[c++]=e>>6&63|128,b[c++]=63&e|128):(b[c++]=e>>12|224,b[c++]=e>>6&63|128,b[c++]=63&e|128)}return f.arrayify(b)}function e(a){a=f.arrayify(a);for(var b="",c=0;c>7!=0){if(d>>6!=2){var e=null;if(d>>5==6)e=1;else if(d>>4==14)e=2;else if(d>>3==30)e=3;else if(d>>2==62)e=4;else{if(d>>1!=126)continue;e=5}if(c+e>a.length){for(;c>6==2;c++);if(c!=a.length)continue;return b}var g,h=d&(1<<8-e-1)-1;for(g=0;g>6!=2)break;h=h<<6|63&i}g==e?h<=65535?b+=String.fromCharCode(h):(h-=65536,b+=String.fromCharCode((h>>10&1023)+55296,(1023&h)+56320)):c--}}else b+=String.fromCharCode(d)}return b}var f=a("./convert.js");b.exports={toUtf8Bytes:d,toUtf8String:e}},{"./convert.js":46}],61:[function(a,b,c){function d(a){return(1<127)throw new Error("passwords with non-ASCII characters not supported in this environment")}else b="";a=m.toUtf8Bytes(a,"NFKD");var e=m.toUtf8Bytes("mnemonic"+b,"NFKD");return m.hexlify(m.pbkdf2(a,e,2048,64,m.createSha512Hmac))}function h(a){var b=a.toLowerCase().split(" ");if(b.length%3!==0)throw new Error("invalid mnemonic");for(var c=m.arrayify(new Uint8Array(Math.ceil(11*b.length/8))),e=0,f=0;f>3]|=1<<7-e%8),e++}var i=32*b.length/3,j=b.length/3,k=d(j),n=m.arrayify(m.sha256(c.slice(0,i/8)))[0];if(n&=k,n!==(c[c.length-1]&k))throw new Error("invalid checksum");return m.hexlify(c.slice(0,i/8))}function i(a){if(a=m.arrayify(a),a.length%4!==0||a.length<16||a.length>32)throw new Error("invalid entropy");for(var b=[0],c=11,f=0;f8?(b[b.length-1]<<=8,b[b.length-1]|=a[f],c-=8):(b[b.length-1]<<=c,b[b.length-1]|=a[f]>>8-c,b.push(a[f]&e(8-c)),c+=3);var g=m.arrayify(m.sha256(a))[0],h=a.length/4;g&=d(h),b[b.length-1]<<=h,b[b.length-1]|=g>>8-h;for(var f=0;f=o)throw new Error("cannot derive child of neutered node");throw new Error("not implemented")}var b=new Uint8Array(37);a&o?b.set(m.arrayify(this.privateKey),1):b.set(this._keyPair.getPublic().encode(null,!0));for(var c=24;c>=0;c-=8)b[33+(c>>3)]=a>>24-c&255;var d=m.arrayify(m.createSha512Hmac(this.chainCode).update(b).digest()),e=m.bigNumberify(d.slice(0,32)),g=(d.slice(32),e.add("0x"+this._keyPair.getPrivate("hex")).mod("0x"+k.curve.n.toString(16)));return new f(k.keyFromPrivate(m.arrayify(g)),d.slice(32),a,this.depth+1)}),m.defineProperty(f.prototype,"derivePath",function(a){var b=a.split("/");if(0===b.length||"m"===b[0]&&0!==this.depth)throw new Error("invalid path");"m"===b[0]&&b.shift();for(var c=this,d=0;d=o)throw new Error("invalid path index - "+e);c=c._derive(o+f)}else{if(!e.match(/^[0-9]+$/))throw new Error("invlaid path component - "+e);var f=parseInt(e);if(f>=o)throw new Error("invalid path index - "+e);c=c._derive(f)}}return c}),m.defineProperty(f,"fromMnemonic",function(a){return h(a),f.fromSeed(g(a))}),m.defineProperty(f,"fromSeed",function(a){if(a=m.arrayify(a),a.length<16||a.length>64)throw new Error("invalid seed");var b=m.arrayify(m.createSha512Hmac(n).update(a).digest());return new f(k.keyFromPrivate(b.slice(0,32)),b.slice(32),0,0,0)}),b.exports={fromMnemonic:f.fromMnemonic,fromSeed:f.fromSeed,mnemonicToEntropy:h,entropyToMnemonic:i,mnemonicToSeed:g,isValidMnemonic:j}},{"../utils/bignumber.js":43,"../utils/convert.js":46,"../utils/hmac":48,"../utils/pbkdf2.js":53,"../utils/properties.js":54,"../utils/sha2":56,"../utils/utf8.js":60,"./words.json":66,elliptic:5}],62:[function(a,b,c){"use strict";var d=a("./wallet"),e=a("./hdnode"),f=a("./signing-key");b.exports={HDNode:e,Wallet:d,SigningKey:f}},{"./hdnode":61,"./signing-key":64,"./wallet":65}],63:[function(a,b,c){"use strict";function d(a){return"string"==typeof a&&"0x"!==a.substring(0,2)&&(a="0x"+a),m.arrayify(a)}function e(a,b){for(a=String(a);a.length0){var e=new Error("invalid "+b.name);throw e.reason="wrong length",e.value=c,e}if(b.maxLength&&(c=g.stripZeros(c),c.length>b.maxLength)){var e=new Error("invalid "+b.name);throw e.reason="too long",e.value=c,e}d.push(g.hexlify(c))}),b&&(d.push(g.hexlify(b)),d.push("0x"),d.push("0x"));var e=g.keccak256(g.RLP.encode(d)),f=c.signDigest(e),h=27+f.recoveryParam;return b&&(d.pop(),d.pop(),d.pop(),h+=2*b+8),d.push(g.hexlify(h)),d.push(f.r),d.push(f.s),g.RLP.encode(d)})}function e(a){var b=g.concat([g.toUtf8Bytes("Ethereum Signed Message:\n"),g.toUtf8Bytes(String(a.length)),"string"==typeof a?g.toUtf8Bytes(a):a]);return g.keccak256(b)}var f=a("scrypt-js"),g=function(){var b=a("../utils/convert");return{defineProperty:a("../utils/properties").defineProperty,arrayify:b.arrayify,concat:b.concat,hexlify:b.hexlify,stripZeros:b.stripZeros,hexZeroPad:b.hexZeroPad,bigNumberify:a("../utils/bignumber").bigNumberify,toUtf8Bytes:a("../utils/utf8").toUtf8Bytes,getAddress:a("../utils/address").getAddress,keccak256:a("../utils/keccak256"),randomBytes:a("../utils").randomBytes,RLP:a("../utils/rlp")}}(),h=a("../utils/errors"),i=a("./hdnode"),j=a("./secret-storage"),k=a("./signing-key");a("setimmediate");var l="m/44'/60'/0'/0/0",m=[{name:"nonce",maxLength:32},{name:"gasPrice",maxLength:32},{name:"gasLimit",maxLength:32},{name:"to",length:20},{name:"value",maxLength:32},{name:"data"}];g.defineProperty(d,"parseTransaction",function(a){a=g.hexlify(a,"rawTransaction");var b=g.RLP.decode(a);if(9!==b.length)throw new Error("invalid transaction");var c=[],d={};m.forEach(function(a,e){d[a.name]=b[e],c.push(b[e])}),d.to&&("0x"==d.to?delete d.to:d.to=g.getAddress(d.to)),["gasPrice","gasLimit","nonce","value"].forEach(function(a){d[a]&&(0===d[a].length?d[a]=g.bigNumberify(0):d[a]=g.bigNumberify(d[a]))}),d.nonce?d.nonce=d.nonce.toNumber():d.nonce=0;var e=g.arrayify(b[6]),f=g.arrayify(b[7]),h=g.arrayify(b[8]);if(e.length>=1&&f.length>=1&&f.length<=32&&h.length>=1&&h.length<=32){d.v=g.bigNumberify(e).toNumber(),d.r=b[7],d.s=b[8];var i=(d.v-35)/2;i<0&&(i=0),i=parseInt(i),d.chainId=i;var j=d.v-27;i&&(c.push(g.hexlify(i)),c.push("0x"),c.push("0x"),j-=2*i+8);var l=g.keccak256(g.RLP.encode(c));try{d.from=k.recover(l,f,h,j)}catch(n){console.log(n)}}return d}),g.defineProperty(d.prototype,"getAddress",function(){return this.address}),g.defineProperty(d.prototype,"getBalance",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,a)}),g.defineProperty(d.prototype,"getTransactionCount",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,a)}),g.defineProperty(d.prototype,"estimateGas",function(a){if(!this.provider)throw new Error("missing provider");var b={};return["from","to","data","value"].forEach(function(c){null!=a[c]&&(b[c]=a[c])}),null==a.from&&(b.from=this.address),this.provider.estimateGas(b)}),g.defineProperty(d.prototype,"sendTransaction",function(a){if(!this.provider)throw new Error("missing provider");if(!a||"object"!=typeof a)throw new Error("invalid transaction object");var b=a.gasLimit;null==b&&(b=this.defaultGasLimit);var c=this,e=null;e=a.gasPrice?Promise.resolve(a.gasPrice):this.provider.getGasPrice();var f=null;f=a.nonce?Promise.resolve(a.nonce):this.provider.getTransactionCount(c.address,"pending");var h=this.provider.chainId,i=null;i=a.to?this.provider.resolveName(a.to):Promise.resolve(void 0);var j=g.hexlify(a.data||"0x"),k=g.hexlify(a.value||0);return Promise.all([e,f,i]).then(function(a){var e=c.sign({to:a[2],data:j,gasLimit:b,gasPrice:a[0],nonce:a[1],value:k,chainId:h});return c.provider.sendTransaction(e).then(function(a){var b=d.parseTransaction(e);return b.hash=a,b.wait=function(){return c.provider.waitForTransaction(a)},b})})}),g.defineProperty(d.prototype,"send",function(a,b,c){return c||(c={}),this.sendTransaction({to:a,gasLimit:c.gasLimit,gasPrice:c.gasPrice,nonce:c.nonce,value:b})}),g.defineProperty(d.prototype,"signMessage",function(a){var b=new k(this.privateKey),c=b.signDigest(e(a));return g.hexZeroPad(c.r,32)+g.hexZeroPad(c.s,32).substring(2)+(c.recoveryParam?"1c":"1b")}),g.defineProperty(d,"verifyMessage",function(a,b){if(b=g.hexlify(b),132!=b.length)throw new Error("invalid signature");var c=e(a),d=parseInt(b.substring(130),16);if(d>=27&&(d-=27),d<0)throw new Error("invalid signature");return k.recover(c,b.substring(0,66),"0x"+b.substring(66,130),d)}),g.defineProperty(d.prototype,"encrypt",function(a,b,c){if("function"!=typeof b||c||(c=b,b={}),c&&"function"!=typeof c)throw new Error("invalid callback");if(b||(b={}),this.mnemonic){var d={};for(var e in b)d[e]=b[e];b=d,b.mnemonic=this.mnemonic,b.path=this.path}return j.encrypt(this.privateKey,a,b,c)}),g.defineProperty(d,"isEncryptedWallet",function(a){return j.isValidWallet(a)||j.isCrowdsaleWallet(a)}),g.defineProperty(d,"createRandom",function(a){var b=g.randomBytes(16);a||(a={}),a.extraEntropy&&(b=g.keccak256(g.concat([b,a.extraEntropy])).substring(0,34));var c=i.entropyToMnemonic(b);return d.fromMnemonic(c,a.path)}),g.defineProperty(d,"fromEncryptedWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return new Promise(function(e,f){if(j.isCrowdsaleWallet(a))try{var h=j.decryptCrowdsale(a,b);e(new d(h))}catch(i){f(i)}else j.isValidWallet(a)?j.decrypt(a,b,c).then(function(a){var b=new d(a);a.mnemonic&&a.path&&(g.defineProperty(b,"mnemonic",a.mnemonic),g.defineProperty(b,"path",a.path)),e(b)},function(a){f(a)}):f("invalid wallet JSON")})}),g.defineProperty(d,"fromMnemonic",function(a,b){b||(b=l);var c=i.fromMnemonic(a).derivePath(b),e=new d(c.privateKey);return g.defineProperty(e,"mnemonic",a),g.defineProperty(e,"path",b),e}),g.defineProperty(d,"fromBrainWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return a="string"==typeof a?g.toUtf8Bytes(a,"NFKC"):g.arrayify(a,"password"),b="string"==typeof b?g.toUtf8Bytes(b,"NFKC"):g.arrayify(b,"password"),new Promise(function(e,h){f(b,a,1<<18,8,1,32,function(a,b,f){if(a)h(a);else if(f)e(new d(g.hexlify(f)));else if(c)return c(b)})})}),b.exports=d},{"../utils":50,"../utils/address":42,"../utils/bignumber":43,"../utils/convert":46,"../utils/errors":47,"../utils/keccak256":51,"../utils/properties":54,"../utils/rlp":55,"../utils/utf8":60,"./hdnode":61,"./secret-storage":63,"./signing-key":64,"scrypt-js":37,setimmediate:38}],66:[function(a,b,c){b.exports="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; -},{}]},{},[62])(62)}); \ No newline at end of file +var d=a<<32-c|b>>>c;return d>>>0}function A(a,b,c){return a>>>c}function B(a,b,c){var d=a<<32-c|b>>>c;return d>>>0}var C=a("minimalistic-assert"),D=a("inherits");c.inherits=D,c.toArray=d,c.toHex=e,c.htonl=f,c.toHex32=g,c.zero2=h,c.zero8=i,c.join32=j,c.split32=k,c.rotr32=l,c.rotl32=m,c.sum32=n,c.sum32_3=o,c.sum32_4=p,c.sum32_5=q,c.sum64=r,c.sum64_hi=s,c.sum64_lo=t,c.sum64_4_hi=u,c.sum64_4_lo=v,c.sum64_5_hi=w,c.sum64_5_lo=x,c.rotr64_hi=y,c.rotr64_lo=z,c.shr64_hi=A,c.shr64_lo=B},{inherits:32,"minimalistic-assert":35}],32:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],33:[function(a,b,c){arguments[4][32][0].apply(c,arguments)},{dup:32}],34:[function(a,b,c){(function(a,c){!function(){"use strict";function d(a,b,c){this.blocks=[],this.s=[],this.padding=b,this.outputBits=c,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(a<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=c>>5,this.extraBytes=(31&c)>>3;for(var d=0;d<50;++d)this.s[d]=0}var e="object"==typeof window?window:{},f=!e.JS_SHA3_NO_NODE_JS&&"object"==typeof a&&a.versions&&a.versions.node;f&&(e=c);for(var g=!e.JS_SHA3_NO_COMMON_JS&&"object"==typeof b&&b.exports,h="0123456789abcdef".split(""),i=[31,7936,2031616,520093696],j=[1,256,65536,16777216],k=[6,1536,393216,100663296],l=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],n=[224,256,384,512],o=[128,256],p=["hex","buffer","arrayBuffer","array"],q=function(a,b,c){return function(e){return new d(a,b,a).update(e)[c]()}},r=function(a,b,c){return function(e,f){return new d(a,b,f).update(e)[c]()}},s=function(a,b){var c=q(a,b,"hex");c.create=function(){return new d(a,b,a)},c.update=function(a){return c.create().update(a)};for(var e=0;e>2]|=a[i]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(f[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=g){for(this.start=c-g,this.block=f[h],c=0;c>2]|=this.padding[3&b],this.lastByteIndex===this.byteCount)for(a[0]=a[c],b=1;b>4&15]+h[15&a]+h[a>>12&15]+h[a>>8&15]+h[a>>20&15]+h[a>>16&15]+h[a>>28&15]+h[a>>24&15];g%b===0&&(C(c),f=0)}return e&&(a=c[f],e>0&&(i+=h[a>>4&15]+h[15&a]),e>1&&(i+=h[a>>12&15]+h[a>>8&15]),e>2&&(i+=h[a>>20&15]+h[a>>16&15])),i},d.prototype.arrayBuffer=function(){this.finalize();var a,b=this.blockCount,c=this.s,d=this.outputBlocks,e=this.extraBytes,f=0,g=0,h=this.outputBits>>3;a=e?new ArrayBuffer(d+1<<2):new ArrayBuffer(h);for(var i=new Uint32Array(a);g>8&255,i[a+2]=b>>16&255,i[a+3]=b>>24&255;h%c===0&&C(d)}return f&&(a=h<<2,b=d[g],f>0&&(i[a]=255&b),f>1&&(i[a+1]=b>>8&255),f>2&&(i[a+2]=b>>16&255)),i};var C=function(a){var b,c,d,e,f,g,h,i,j,k,l,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka;for(d=0;d<48;d+=2)e=a[0]^a[10]^a[20]^a[30]^a[40],f=a[1]^a[11]^a[21]^a[31]^a[41],g=a[2]^a[12]^a[22]^a[32]^a[42],h=a[3]^a[13]^a[23]^a[33]^a[43],i=a[4]^a[14]^a[24]^a[34]^a[44],j=a[5]^a[15]^a[25]^a[35]^a[45],k=a[6]^a[16]^a[26]^a[36]^a[46],l=a[7]^a[17]^a[27]^a[37]^a[47],n=a[8]^a[18]^a[28]^a[38]^a[48],o=a[9]^a[19]^a[29]^a[39]^a[49],b=n^(g<<1|h>>>31),c=o^(h<<1|g>>>31),a[0]^=b,a[1]^=c,a[10]^=b,a[11]^=c,a[20]^=b,a[21]^=c,a[30]^=b,a[31]^=c,a[40]^=b,a[41]^=c,b=e^(i<<1|j>>>31),c=f^(j<<1|i>>>31),a[2]^=b,a[3]^=c,a[12]^=b,a[13]^=c,a[22]^=b,a[23]^=c,a[32]^=b,a[33]^=c,a[42]^=b,a[43]^=c,b=g^(k<<1|l>>>31),c=h^(l<<1|k>>>31),a[4]^=b,a[5]^=c,a[14]^=b,a[15]^=c,a[24]^=b,a[25]^=c,a[34]^=b,a[35]^=c,a[44]^=b,a[45]^=c,b=i^(n<<1|o>>>31),c=j^(o<<1|n>>>31),a[6]^=b,a[7]^=c,a[16]^=b,a[17]^=c,a[26]^=b,a[27]^=c,a[36]^=b,a[37]^=c,a[46]^=b,a[47]^=c,b=k^(e<<1|f>>>31),c=l^(f<<1|e>>>31),a[8]^=b,a[9]^=c,a[18]^=b,a[19]^=c,a[28]^=b,a[29]^=c,a[38]^=b,a[39]^=c,a[48]^=b,a[49]^=c,p=a[0],q=a[1],V=a[11]<<4|a[10]>>>28,W=a[10]<<4|a[11]>>>28,D=a[20]<<3|a[21]>>>29,E=a[21]<<3|a[20]>>>29,ha=a[31]<<9|a[30]>>>23,ia=a[30]<<9|a[31]>>>23,R=a[40]<<18|a[41]>>>14,S=a[41]<<18|a[40]>>>14,J=a[2]<<1|a[3]>>>31,K=a[3]<<1|a[2]>>>31,r=a[13]<<12|a[12]>>>20,s=a[12]<<12|a[13]>>>20,X=a[22]<<10|a[23]>>>22,Y=a[23]<<10|a[22]>>>22,F=a[33]<<13|a[32]>>>19,G=a[32]<<13|a[33]>>>19,ja=a[42]<<2|a[43]>>>30,ka=a[43]<<2|a[42]>>>30,ba=a[5]<<30|a[4]>>>2,ca=a[4]<<30|a[5]>>>2,L=a[14]<<6|a[15]>>>26,M=a[15]<<6|a[14]>>>26,t=a[25]<<11|a[24]>>>21,u=a[24]<<11|a[25]>>>21,Z=a[34]<<15|a[35]>>>17,$=a[35]<<15|a[34]>>>17,H=a[45]<<29|a[44]>>>3,I=a[44]<<29|a[45]>>>3,z=a[6]<<28|a[7]>>>4,A=a[7]<<28|a[6]>>>4,da=a[17]<<23|a[16]>>>9,ea=a[16]<<23|a[17]>>>9,N=a[26]<<25|a[27]>>>7,O=a[27]<<25|a[26]>>>7,v=a[36]<<21|a[37]>>>11,w=a[37]<<21|a[36]>>>11,_=a[47]<<24|a[46]>>>8,aa=a[46]<<24|a[47]>>>8,T=a[8]<<27|a[9]>>>5,U=a[9]<<27|a[8]>>>5,B=a[18]<<20|a[19]>>>12,C=a[19]<<20|a[18]>>>12,fa=a[29]<<7|a[28]>>>25,ga=a[28]<<7|a[29]>>>25,P=a[38]<<8|a[39]>>>24,Q=a[39]<<8|a[38]>>>24,x=a[48]<<14|a[49]>>>18,y=a[49]<<14|a[48]>>>18,a[0]=p^~r&t,a[1]=q^~s&u,a[10]=z^~B&D,a[11]=A^~C&E,a[20]=J^~L&N,a[21]=K^~M&O,a[30]=T^~V&X,a[31]=U^~W&Y,a[40]=ba^~da&fa,a[41]=ca^~ea&ga,a[2]=r^~t&v,a[3]=s^~u&w,a[12]=B^~D&F,a[13]=C^~E&G,a[22]=L^~N&P,a[23]=M^~O&Q,a[32]=V^~X&Z,a[33]=W^~Y&$,a[42]=da^~fa&ha,a[43]=ea^~ga&ia,a[4]=t^~v&x,a[5]=u^~w&y,a[14]=D^~F&H,a[15]=E^~G&I,a[24]=N^~P&R,a[25]=O^~Q&S,a[34]=X^~Z&_,a[35]=Y^~$&aa,a[44]=fa^~ha&ja,a[45]=ga^~ia&ka,a[6]=v^~x&p,a[7]=w^~y&q,a[16]=F^~H&z,a[17]=G^~I&A,a[26]=P^~R&J,a[27]=Q^~S&K,a[36]=Z^~_&T,a[37]=$^~aa&U,a[46]=ha^~ja&ba,a[47]=ia^~ka&ca,a[8]=x^~p&r,a[9]=y^~q&s,a[18]=H^~z&B,a[19]=I^~A&C,a[28]=R^~J&L,a[29]=S^~K&M,a[38]=_^~T&V,a[39]=aa^~U&W,a[48]=ja^~ba&da,a[49]=ka^~ca&ea,a[0]^=m[d],a[1]^=m[d+1]};if(g)b.exports=v;else for(var x=0;x=64;){var n,o,p,q,r,s=d,t=e,u=f,v=g,w=h,x=i,y=j,z=k;for(o=0;o<16;o++)p=b+4*o,l[o]=(255&a[p])<<24|(255&a[p+1])<<16|(255&a[p+2])<<8|255&a[p+3];for(o=16;o<64;o++)n=l[o-2],q=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,n=l[o-15],r=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,l[o]=(q+l[o-7]|0)+(r+l[o-16]|0)|0;for(o=0;o<64;o++)q=(((w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7))+(w&x^~w&y)|0)+(z+(c[o]+l[o]|0)|0)|0,r=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&t^s&u^t&u)|0,z=y,y=x,x=w,w=v+q|0,v=u,u=t,t=s,s=q+r|0;d=d+s|0,e=e+t|0,f=f+u|0,g=g+v|0,h=h+w|0,i=i+x|0,j=j+y|0,k=k+z|0,b+=64,m-=64}}var c=[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],d=1779033703,e=3144134277,f=1013904242,g=2773480762,h=1359893119,i=2600822924,j=528734635,k=1541459225,l=new Array(64);b(a);var m,n=a.length%64,o=a.length/536870912|0,p=a.length<<3,q=n<56?56:120,r=a.slice(a.length-n,a.length);for(r.push(128),m=n+1;m>>24&255),r.push(o>>>16&255),r.push(o>>>8&255),r.push(o>>>0&255),r.push(p>>>24&255),r.push(p>>>16&255),r.push(p>>>8&255),r.push(p>>>0&255),b(r),[d>>>24&255,d>>>16&255,d>>>8&255,d>>>0&255,e>>>24&255,e>>>16&255,e>>>8&255,e>>>0&255,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255,g>>>24&255,g>>>16&255,g>>>8&255,g>>>0&255,h>>>24&255,h>>>16&255,h>>>8&255,h>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,j>>>24&255,j>>>16&255,j>>>8&255,j>>>0&255,k>>>24&255,k>>>16&255,k>>>8&255,k>>>0&255]}function f(a,b,c){function d(){for(var a=g-1;a>=g-4;a--){if(h[a]++,h[a]<=255)return;h[a]=0}}a=a.length<=64?a:e(a);var f,g=64+b.length+4,h=new Array(g),i=new Array(64),j=[];for(f=0;f<64;f++)h[f]=54;for(f=0;f=32;)d(),j=j.concat(e(i.concat(e(h)))),c-=32;return c>0&&(d(),j=j.concat(e(i.concat(e(h))).slice(0,c))),j}function g(a,b,c,d,e){var f;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>>32-b}function i(a,b){k(a,0,b,0,16);for(var c=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]}function j(a,b,c,d){for(var e=0;e=256)return!1}return!0}function m(a,b){var c=parseInt(a);if(a!=c)throw new Error("invalid "+b);return c}function n(a,b,c,d,e,h,i){if(!i)throw new Error("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))throw new Error("N must be power of 2");if(c>o/128/d)throw new Error("N too large");if(d>o/128/e)throw new Error("r too large");if(!l(a))throw new Error("password must be an array or buffer");if(!l(b))throw new Error("salt must be an array or buffer");for(var n=f(a,b,128*e*d),p=new Uint32Array(32*e*d),q=0;qF&&(b=F);for(var l=0;lF&&(b=F);for(var l=0;l>0&255),n.push(p[l]>>8&255),n.push(p[l]>>16&255),n.push(p[l]>>24&255);var r=f(a,n,h);return i(null,1,r)}G(H)};H()}var o=2147483647;"undefined"!=typeof d?c.exports=n:"function"==typeof a&&a.amd?a(n):b&&(b.scrypt&&(b._scrypt=b.scrypt),b.scrypt=n)}(this)},{}],38:[function(a,b,c){(function(a,b){!function(b,c){"use strict";function d(a){return p[o]=e.apply(c,a),o++}function e(a){var b=[].slice.call(arguments,1);return function(){"function"==typeof a?a.apply(c,b):new Function(""+a)()}}function f(a){if(q)setTimeout(e(f,a),0);else{var b=p[a];if(b){q=!0;try{b()}finally{g(a),q=!1}}}}function g(a){delete p[a]}function h(){n=function(){var b=d(arguments);return a.nextTick(e(f,b)),b}}function i(){if(b.postMessage&&!b.importScripts){var a=!0,c=b.onmessage;return b.onmessage=function(){a=!1},b.postMessage("","*"),b.onmessage=c,a}}function j(){var a="setImmediate$"+Math.random()+"$",c=function(c){c.source===b&&"string"==typeof c.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(){var c=d(arguments);return b.postMessage(a+c,"*"),c}}function k(){var a=new MessageChannel;a.port1.onmessage=function(a){var b=a.data;f(b)},n=function(){var b=d(arguments);return a.port2.postMessage(b),b}}function l(){var a=r.documentElement;n=function(){var b=d(arguments),c=r.createElement("script");return c.onreadystatechange=function(){f(b),c.onreadystatechange=null,a.removeChild(c),c=null},a.appendChild(c),b}}function m(){n=function(){var a=d(arguments);return setTimeout(e(f,a),0),a}}if(!b.setImmediate){var n,o=1,p={},q=!1,r=b.document,s=Object.getPrototypeOf&&Object.getPrototypeOf(b);s=s&&s.setTimeout?s:b,"[object process]"==={}.toString.call(b.process)?h():i()?j():b.MessageChannel?k():r&&"onreadystatechange"in r.createElement("script")?l():m(),s.setImmediate=n,s.clearImmediate=g}}("undefined"==typeof self?"undefined"==typeof b?this:b:self)}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:36}],39:[function(a,b,c){(function(a){var c;if(a.crypto&&crypto.getRandomValues){var d=new Uint8Array(16);c=function(){return crypto.getRandomValues(d),d}}if(!c){var e=new Array(16);c=function(){for(var a,b=0;b<16;b++)0===(3&b)&&(a=4294967296*Math.random()),e[b]=a>>>((3&b)<<3)&255;return e}}b.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],40:[function(a,b,c){function d(a,b,c){var d=b&&c||0,e=0;for(b=b||[],a.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){e<16&&(b[d+e++]=j[a])});e<16;)b[d+e++]=0;return b}function e(a,b){var c=b||0,d=i;return d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]}function f(a,b,c){var d=b&&c||0,f=b||[];a=a||{};var g=void 0!==a.clockseq?a.clockseq:n,h=void 0!==a.msecs?a.msecs:(new Date).getTime(),i=void 0!==a.nsecs?a.nsecs:p+1,j=h-o+(i-p)/1e4;if(j<0&&void 0===a.clockseq&&(g=g+1&16383),(j<0||h>o)&&void 0===a.nsecs&&(i=0),i>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");o=h,p=i,n=g,h+=122192928e5;var k=(1e4*(268435455&h)+i)%4294967296;f[d++]=k>>>24&255,f[d++]=k>>>16&255,f[d++]=k>>>8&255,f[d++]=255&k;var l=h/4294967296*1e4&268435455;f[d++]=l>>>8&255,f[d++]=255&l,f[d++]=l>>>24&15|16,f[d++]=l>>>16&255,f[d++]=g>>>8|128,f[d++]=255&g;for(var q=a.node||m,r=0;r<6;r++)f[d+r]=q[r];return b?b:e(f)}function g(a,b,c){var d=b&&c||0;"string"==typeof a&&(b="binary"==a?new Array(16):null,a=null),a=a||{};var f=a.random||(a.rng||h)();if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b)for(var g=0;g<16;g++)b[d+g]=f[g];return b||e(f)}for(var h=a("./rng"),i=[],j={},k=0;k<256;k++)i[k]=(k+256).toString(16).substr(1),j[i[k]]=k;var l=h(),m=[1|l[0],l[1],l[2],l[3],l[4],l[5]],n=16383&(l[6]<<8|l[7]),o=0,p=0,q=g;q.v1=f,q.v4=g,q.parse=d,q.unparse=e,b.exports=q},{"./rng":39}],41:[function(a,b,c){"use strict";function d(a){var b=parseInt(32*Math.ceil(a.length/32)),c=new Uint8Array(b-a.length);return o.concat([v.encode(a.length),a,c])}function e(a,b){a.length=0?c:"")+"]";return{coder:b,localName:d,length:c,name:"array",type:e,encode:function(a){Array.isArray(a)||n("invalid array");var d=c,e=new Uint8Array(0);d===-1&&(d=a.length,e=v.encode(d)),d!==a.length&&n("size mismatch");var f=[];return a.forEach(function(a){f.push(b)}),o.concat([e,g(f,a)])},decode:function(d,f){var g=0,i=c;if(i===-1){var j=v.decode(d,f);i=j.value.toNumber(),g+=j.consumed,f+=j.consumed}for(var k=[],l=0;l256||f%8!==0)&&n("invalid type",{type:b}),u(a,f/8,"int"===e[1],c)}var e=b.match(p);if(e){var f=parseInt(e[1]);return(0===f||f>32)&&n("invalid type "+b),x(a,f,c)}var e=b.match(r);if(e){var f=parseInt(e[2]||-1);return i(a,l(a,e[1],c),f,c)}if("tuple("===b.substring(0,6)&&")"===b.substring(b.length-1)){var g=[],h=[];return c&&"object"==typeof c&&(Array.isArray(c.names)&&(h=c.names),"string"==typeof c.name&&(c=c.name)),k(b.substring(6,b.length-1)).forEach(function(b,c){g.push(l(a,b,h[c]))}),j(a,g,c)}return""===b?t(a):void n("invalid type",{type:b})}function m(a){if(!(this instanceof m))throw new Error("missing new");a||(a=s),o.defineProperty(this,"coerceFunc",a)}var n=a("../utils/throw-error"),o=function(){var b=a("../utils/convert.js"),c=a("../utils/utf8.js");return{defineProperty:a("../utils/properties.js").defineProperty,arrayify:b.arrayify,padZeros:b.padZeros,bigNumberify:a("../utils/bignumber.js").bigNumberify,getAddress:a("../utils/address").getAddress,concat:b.concat,toUtf8Bytes:c.toUtf8Bytes,toUtf8String:c.toUtf8String,hexlify:b.hexlify}}(),p=new RegExp(/^bytes([0-9]*)$/),q=new RegExp(/^(u?int)([0-9]*)$/),r=new RegExp(/^(.*)\[([0-9]*)\]$/),s=function(a,b){var c=a.match(q);return c&&parseInt(c[2])<=48?b.toNumber():b},t=function(a){return{name:"null",type:"",encode:function(a){return o.arrayify([])},decode:function(b,c){if(c>b.length)throw new Error("invalid null");return{consumed:0,value:a("null",void 0)}},dynamic:!1}},u=function(a,b,c,d){var e=(c?"int":"uint")+8*b;return{localName:d,name:e,type:e,encode:function(a){return a=o.bigNumberify(a).toTwos(8*b).maskn(8*b),c&&(a=a.fromTwos(8*b).toTwos(256)),o.padZeros(o.arrayify(a),32)},decode:function(d,f){d.length>1]>>4>=8&&(a[c]=a[c].toUpperCase()),(15&b[c>>1])>=8&&(a[c+1]=a[c+1].toUpperCase());return"0x"+a.join("")}function e(a){return Math.log10?Math.log10(a):Math.log(a)/Math.LN10}function f(a,b){var c=null;if("string"!=typeof a&&i("invalid address",{input:a}),a.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==a.substring(0,2)&&(a="0x"+a),c=d(a),a.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&c!==a&&i("invalid address checksum",{input:a,expected:c});else if(a.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(a.substring(2,4)!==l(a)&&i("invalid address icap checksum",{input:a}),c=new g(a.substring(4),36).toString(16);c.length<40;)c="0"+c;c=d("0x"+c)}else i("invalid address",{input:a});if(b){for(var e=new g(c.substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e}return c}var g=a("bn.js"),h=a("./convert"),i=a("./throw-error"),j=a("./keccak256"),k=9007199254740991,l=function(){for(var a={},b=0;b<10;b++)a[String(b)]=String(b);for(var b=0;b<26;b++)a[String.fromCharCode(65+b)]=String(10+b);var c=Math.floor(e(k));return function(b){b=b.toUpperCase(),b=b.substring(4)+b.substring(0,2)+"00";for(var d=b.split(""),e=0;e=c;){var f=d.substring(0,c);d=parseInt(f,10)%97+d.substring(f.length)}for(var g=String(98-parseInt(d,10)%97);g.length<2;)g="0"+g;return g}}();b.exports={getAddress:f}},{"./convert":47,"./keccak256":52,"./throw-error":59,"bn.js":2}],43:[function(a,b,c){function d(a){if(!(this instanceof d))throw new Error("missing new");i.isHexString(a)?("0x"==a&&(a="0x0"),a=new g(a.substring(2),16)):"string"==typeof a&&"-"===a[0]&&i.isHexString(a.substring(1))?a=new g(a.substring(3),16).mul(d.constantNegativeOne._bn):"string"==typeof a&&a.match(/^-?[0-9]*$/)?(""==a&&(a="0"),a=new g(a)):"number"==typeof a&&parseInt(a)==a?a=new g(a):g.isBN(a)||(e(a)?a=a._bn:i.isArrayish(a)?a=new g(i.hexlify(a).substring(2),16):j("invalid BigNumber value",{input:a})),h(this,"_bn",a)}function e(a){return a._bn&&a._bn.mod}function f(a){return e(a)?a:new d(a)}var g=a("bn.js"),h=a("./properties").defineProperty,i=a("./convert"),j=a("./throw-error");h(d,"constantNegativeOne",f(-1)),h(d,"constantZero",f(0)),h(d,"constantOne",f(1)),h(d,"constantTwo",f(2)),h(d,"constantWeiPerEther",f(new g("1000000000000000000"))),h(d.prototype,"fromTwos",function(a){return new d(this._bn.fromTwos(a))}),h(d.prototype,"toTwos",function(a){return new d(this._bn.toTwos(a))}),h(d.prototype,"add",function(a){return new d(this._bn.add(f(a)._bn))}),h(d.prototype,"sub",function(a){return new d(this._bn.sub(f(a)._bn))}),h(d.prototype,"div",function(a){return new d(this._bn.div(f(a)._bn))}),h(d.prototype,"mul",function(a){return new d(this._bn.mul(f(a)._bn))}),h(d.prototype,"mod",function(a){return new d(this._bn.mod(f(a)._bn))}),h(d.prototype,"pow",function(a){return new d(this._bn.pow(f(a)._bn))}),h(d.prototype,"maskn",function(a){return new d(this._bn.maskn(a))}),h(d.prototype,"eq",function(a){return this._bn.eq(f(a)._bn)}),h(d.prototype,"lt",function(a){return this._bn.lt(f(a)._bn)}),h(d.prototype,"lte",function(a){return this._bn.lte(f(a)._bn)}),h(d.prototype,"gt",function(a){return this._bn.gt(f(a)._bn)}),h(d.prototype,"gte",function(a){return this._bn.gte(f(a)._bn)}),h(d.prototype,"isZero",function(){return this._bn.isZero()}),h(d.prototype,"toNumber",function(a){return this._bn.toNumber()}),h(d.prototype,"toString",function(){return this._bn.toString(10)}),h(d.prototype,"toHexString",function(){var a=this._bn.toString(16);return a.length%2&&(a="0"+a),"0x"+a}),b.exports={isBigNumber:e,bigNumberify:f,BigNumber:d}},{"./convert":47,"./properties":55,"./throw-error":59,"bn.js":2}],44:[function(a,b,c){"use strict";var d=a("./convert");b.exports={decode:function(a){a=atob(a);for(var b=[],c=0;c1024||parseInt(a)!=a)throw new Error("invalid length");var b=new Uint8Array(a);return g.getRandomValues(b),e.arrayify(b)}var e=a("./convert"),f=a("./properties").defineProperty,g=c.crypto||c.msCrypto;g&&g.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),g={getRandomValues:function(a){for(var b=0;b<20;b++)for(var c=0;c=256||parseInt(c)!=c)return!1}return!0}function f(a){if(null==a&&o.throwError("cannot convert null value to array",o.INVALID_ARGUMENT,{arg:"value",value:a}),a&&a.toHexString&&(a=a.toHexString()),j(a)){a=a.substring(2),a.length%2&&(a="0"+a);for(var b=[],c=0;c>4]+p[15&f])}return"0x"+c.join("")}o.throwError("invalid hexlify value",{arg:"value",value:a})}function l(a){for(;a.length>3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function m(a,b){for(;a.length<2*b+2;)a="0x0"+a.substring(2);return a}function n(a){if(a=f(a),65!==a.length)throw new Error("invalid signature");var b=a[64];return 27!==b&&28!==b&&(b=27+b%2),{r:k(a.slice(0,32)),s:k(a.slice(32,64)),v:b}}var o=(a("./properties.js").defineProperty,a("./errors")),p="0123456789abcdef";b.exports={arrayify:f, +isArrayish:e,concat:g,padZeros:i,stripZeros:h,splitSignature:n,hexlify:k,isHexString:j,hexStripZeros:l,hexZeroPad:m}},{"./errors":48,"./properties.js":55}],48:[function(a,b,c){"use strict";var d=a("./properties").defineProperty,e={};["UNKNOWN_ERROR","NOT_IMPLEMENTED","MISSING_NEW","INVALID_ARGUMENT","MISSING_ARGUMENT","UNEXPECTED_ARGUMENT","UNSUPPORTED_OPERATION"].forEach(function(a){d(e,a,a)}),d(e,"throwError",function(a,b,c){b||(b=e.UNKNOWN_ERROR),c||(c={});var d=[];Object.keys(c).forEach(function(a){d.push(a+"="+JSON.stringify(c[a]))});var f=a;d.length&&(a+=" ("+d.join(", ")+")");var g=new Error(a);throw g.reason=f,g.code=b,Object.keys(c).forEach(function(a){g[a]=c[a]}),g}),d(e,"checkNew",function(a,b){a instanceof b||e.throwError("missing new",e.MISSING_NEW,{name:b.name})}),b.exports=e},{"./properties":55}],49:[function(a,b,c){"use strict";function d(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha256,a)}function e(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha512,a)}var f=a("hash.js"),g=a("./sha2.js"),h=a("./convert.js");b.exports={createSha256Hmac:d,createSha512Hmac:e}},{"./convert.js":47,"./sha2.js":57,"hash.js":20}],50:[function(a,b,c){"use strict";function d(a){return e(f.toUtf8Bytes(a))}var e=a("./keccak256"),f=a("./utf8");b.exports=d},{"./keccak256":52,"./utf8":61}],51:[function(a,b,c){"use strict";var d=a("./address"),e=a("./abi-coder"),f=a("./base64"),g=a("./bignumber"),h=a("./contract-address"),i=a("./convert"),j=a("./id"),k=a("./keccak256"),l=a("./namehash"),m=a("./sha2").sha256,n=a("./solidity"),o=a("./random-bytes"),p=a("./properties"),q=a("./rlp"),r=a("./utf8"),s=a("./units");b.exports={AbiCoder:e,RLP:q,defineProperty:p.defineProperty,etherSymbol:"Ξ",arrayify:i.arrayify,concat:i.concat,padZeros:i.padZeros,stripZeros:i.stripZeros,base64:f,bigNumberify:g.bigNumberify,BigNumber:g.BigNumber,hexlify:i.hexlify,toUtf8Bytes:r.toUtf8Bytes,toUtf8String:r.toUtf8String,namehash:l,id:j,getAddress:d.getAddress,getContractAddress:h.getContractAddress,formatEther:s.formatEther,parseEther:s.parseEther,formatUnits:s.formatUnits,parseUnits:s.parseUnits,keccak256:k,sha256:m,randomBytes:o,solidityPack:n.pack,solidityKeccak256:n.keccak256,soliditySha256:n.sha256,splitSignature:i.splitSignature}},{"./abi-coder":41,"./address":42,"./base64":44,"./bignumber":43,"./contract-address":46,"./convert":47,"./id":50,"./keccak256":52,"./namehash":53,"./properties":55,"./random-bytes":45,"./rlp":56,"./sha2":57,"./solidity":58,"./units":60,"./utf8":61}],52:[function(a,b,c){"use strict";function d(a){return a=f.arrayify(a),"0x"+e.keccak_256(a)}var e=a("js-sha3"),f=a("./convert.js");b.exports=d},{"./convert.js":47,"js-sha3":34}],53:[function(a,b,c){"use strict";function d(a,b){if(a=a.toLowerCase(),!a.match(j))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var c=h,d=0;a.length&&(!b||d>24&255,j[b.length+1]=m>>16&255,j[b.length+2]=m>>8&255,j[b.length+3]=255&m;var n=f(a).update(j).digest();g||(g=n.length,l=new Uint8Array(g),h=Math.ceil(d/g),k=d-(h-1)*g),l.set(n);for(var o=1;o>=8;return b}function e(a,b,c){for(var d=0,e=0;eb+1+d)throw new Error("invalid rlp")}return{consumed:1+d,result:e}}function i(a,b){if(0===a.length)throw new Error("invalid rlp data");if(a[b]>=248){var c=a[b]-247;if(b+1+c>a.length)throw new Error("too short");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("to short");return h(a,b,b+1+c,c+d)}if(a[b]>=192){var d=a[b]-192;if(b+1+d>a.length)throw new Error("invalid rlp data");return h(a,b,b+1,d)}if(a[b]>=184){var c=a[b]-183;if(b+1+c>a.length)throw new Error("invalid rlp data");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("invalid rlp data");var f=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){var d=a[b]-128;if(b+1+d>a.offset)throw new Error("invlaid rlp data");var f=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}function j(a){a=k.arrayify(a);var b=i(a,0);if(b.consumed!==a.length)throw new Error("invalid rlp data");return b.result}var k=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":47}],57:[function(a,b,c){"use strict";function d(a){return a=g.arrayify(a),"0x"+f.sha256().update(a).digest("hex")}function e(a){return a=g.arrayify(a),"0x"+f.sha512().update(a).digest("hex")}var f=a("hash.js"),g=a("./convert.js");b.exports={sha256:d,sha512:e,createSha256:f.sha256,createSha512:f.sha512}},{"./convert.js":47,"hash.js":20}],58:[function(a,b,c){"use strict";function d(a,b,c){switch(a){case"address":return c?i.padZeros(b,32):i.arrayify(b);case"string":return j.toUtf8Bytes(b);case"bytes":return i.arrayify(b);case"bool":return b=b?"0x01":"0x00",c?i.padZeros(b,32):i.arrayify(b)}var e=a.match(n);if(e){var f=("int"===e[1],parseInt(e[2]||"256"));if(f%8!=0||0===f||f>256)throw new Error("invalid number type - "+a);return c&&(f=256),b=h(b).toTwos(f),i.padZeros(b,f/8)}if(e=a.match(m)){var f=e[1];if(f!=parseInt(f)||0===f||f>32)throw new Error("invalid number type - "+a);if(f=parseInt(f),i.arrayify(b).byteLength!==f)throw new Error("invalid value for "+a);return c?(b+p).substring(0,66):b}if(e=a.match(o)){var g=e[1],k=parseInt(e[2]||b.length);if(k!=b.length)throw new Error("invalid value for "+a);var l=[];return b.forEach(function(a){a=d(g,a,!0),l.push(a)}),i.concat(l)}throw new Error("unknown type - "+a)}function e(a,b){if(a.length!=b.length)throw new Error("type/value count mismatch");var c=[];return a.forEach(function(a,e){c.push(d(a,b[e]))}),i.hexlify(i.concat(c))}function f(a,b){return k(e(a,b))}function g(a,b){return l(e(a,b))}var h=a("./bignumber").bigNumberify,i=a("./convert"),j=(a("./address").getAddress,a("./utf8")),k=a("./keccak256"),l=a("./sha2").sha256,m=new RegExp("^bytes([0-9]+)$"),n=new RegExp("^(u?int)([0-9]*)$"),o=new RegExp("^(.*)\\[([0-9]*)\\]$"),p="0000000000000000000000000000000000000000000000000000000000000000";b.exports={pack:e,keccak256:f,sha256:g}},{"./address":42,"./bignumber":43,"./convert":47,"./keccak256":52,"./sha2":57,"./utf8":61}],59:[function(a,b,c){"use strict";function d(a,b){var c=new Error(a);for(var d in b)c[d]=b[d];throw c}b.exports=d},{}],60:[function(a,b,c){function d(a,b,c){"object"!=typeof b||c||(c=b,b=void 0),null==b&&(b=18);var d=m(b);a=h(a),c||(c={});var e=a.lt(j);e&&(a=a.mul(k));for(var f=a.mod(d.tenPower).toString(10);f.length2&&i("too many decimal points",{input:a});var f=e[0],g=e[1];for(f||(f="0"),g||(g="0"),g.length>c.decimals&&i("too many decimal places",{input:a,decimals:g.length});g.length=0&&c<=256){for(var e="1",f=0;f>6|192,b[c++]=63&e|128):55296==(64512&e)&&d+1>18|240,b[c++]=e>>12&63|128,b[c++]=e>>6&63|128,b[c++]=63&e|128):(b[c++]=e>>12|224,b[c++]=e>>6&63|128,b[c++]=63&e|128)}return f.arrayify(b)}function e(a){a=f.arrayify(a);for(var b="",c=0;c>7!=0){if(d>>6!=2){var e=null;if(d>>5==6)e=1;else if(d>>4==14)e=2;else if(d>>3==30)e=3;else if(d>>2==62)e=4;else{if(d>>1!=126)continue;e=5}if(c+e>a.length){for(;c>6==2;c++);if(c!=a.length)continue;return b}var g,h=d&(1<<8-e-1)-1;for(g=0;g>6!=2)break;h=h<<6|63&i}g==e?h<=65535?b+=String.fromCharCode(h):(h-=65536,b+=String.fromCharCode((h>>10&1023)+55296,(1023&h)+56320)):c--}}else b+=String.fromCharCode(d)}return b}var f=a("./convert.js");b.exports={toUtf8Bytes:d,toUtf8String:e}},{"./convert.js":47}],62:[function(a,b,c){function d(a){return(1<127)throw new Error("passwords with non-ASCII characters not supported in this environment")}else b="";a=m.toUtf8Bytes(a,"NFKD");var e=m.toUtf8Bytes("mnemonic"+b,"NFKD");return m.hexlify(m.pbkdf2(a,e,2048,64,m.createSha512Hmac))}function h(a){var b=a.toLowerCase().split(" ");if(b.length%3!==0)throw new Error("invalid mnemonic");for(var c=m.arrayify(new Uint8Array(Math.ceil(11*b.length/8))),e=0,f=0;f>3]|=1<<7-e%8),e++}var i=32*b.length/3,j=b.length/3,k=d(j),n=m.arrayify(m.sha256(c.slice(0,i/8)))[0];if(n&=k,n!==(c[c.length-1]&k))throw new Error("invalid checksum");return m.hexlify(c.slice(0,i/8))}function i(a){if(a=m.arrayify(a),a.length%4!==0||a.length<16||a.length>32)throw new Error("invalid entropy");for(var b=[0],c=11,f=0;f8?(b[b.length-1]<<=8,b[b.length-1]|=a[f],c-=8):(b[b.length-1]<<=c,b[b.length-1]|=a[f]>>8-c,b.push(a[f]&e(8-c)),c+=3);var g=m.arrayify(m.sha256(a))[0],h=a.length/4;g&=d(h),b[b.length-1]<<=h,b[b.length-1]|=g>>8-h;for(var f=0;f=o)throw new Error("cannot derive child of neutered node");throw new Error("not implemented")}var b=new Uint8Array(37);a&o?b.set(m.arrayify(this.privateKey),1):b.set(this._keyPair.getPublic().encode(null,!0));for(var c=24;c>=0;c-=8)b[33+(c>>3)]=a>>24-c&255;var d=m.arrayify(m.createSha512Hmac(this.chainCode).update(b).digest()),e=m.bigNumberify(d.slice(0,32)),g=(d.slice(32),e.add("0x"+this._keyPair.getPrivate("hex")).mod("0x"+k.curve.n.toString(16)));return new f(k.keyFromPrivate(m.arrayify(g)),d.slice(32),a,this.depth+1)}),m.defineProperty(f.prototype,"derivePath",function(a){var b=a.split("/");if(0===b.length||"m"===b[0]&&0!==this.depth)throw new Error("invalid path");"m"===b[0]&&b.shift();for(var c=this,d=0;d=o)throw new Error("invalid path index - "+e);c=c._derive(o+f)}else{if(!e.match(/^[0-9]+$/))throw new Error("invlaid path component - "+e);var f=parseInt(e);if(f>=o)throw new Error("invalid path index - "+e);c=c._derive(f)}}return c}),m.defineProperty(f,"fromMnemonic",function(a){return h(a),f.fromSeed(g(a))}),m.defineProperty(f,"fromSeed",function(a){if(a=m.arrayify(a),a.length<16||a.length>64)throw new Error("invalid seed");var b=m.arrayify(m.createSha512Hmac(n).update(a).digest());return new f(k.keyFromPrivate(b.slice(0,32)),b.slice(32),0,0,0)}),b.exports={fromMnemonic:f.fromMnemonic,fromSeed:f.fromSeed,mnemonicToEntropy:h,entropyToMnemonic:i,mnemonicToSeed:g,isValidMnemonic:j}},{"../utils/bignumber.js":43,"../utils/convert.js":47,"../utils/hmac":49,"../utils/pbkdf2.js":54,"../utils/properties.js":55,"../utils/sha2":57,"../utils/utf8.js":61,"./words.json":67,elliptic:5}],63:[function(a,b,c){"use strict";var d=a("./wallet"),e=a("./hdnode"),f=a("./signing-key");b.exports={HDNode:e,Wallet:d,SigningKey:f}},{"./hdnode":62,"./signing-key":65,"./wallet":66}],64:[function(a,b,c){"use strict";function d(a){return"string"==typeof a&&"0x"!==a.substring(0,2)&&(a="0x"+a),m.arrayify(a)}function e(a,b){for(a=String(a);a.length0){var e=new Error("invalid "+b.name);throw e.reason="wrong length",e.value=c,e}if(b.maxLength&&(c=g.stripZeros(c),c.length>b.maxLength)){var e=new Error("invalid "+b.name);throw e.reason="too long",e.value=c,e}d.push(g.hexlify(c))}),b&&(d.push(g.hexlify(b)),d.push("0x"),d.push("0x"));var e=g.keccak256(g.RLP.encode(d)),f=c.signDigest(e),h=27+f.recoveryParam;return b&&(d.pop(),d.pop(),d.pop(),h+=2*b+8),d.push(g.hexlify(h)),d.push(f.r),d.push(f.s),g.RLP.encode(d)})}function e(a){var b=g.concat([g.toUtf8Bytes("Ethereum Signed Message:\n"),g.toUtf8Bytes(String(a.length)),"string"==typeof a?g.toUtf8Bytes(a):a]);return g.keccak256(b)}var f=a("scrypt-js"),g=function(){var b=a("../utils/convert");return{defineProperty:a("../utils/properties").defineProperty,arrayify:b.arrayify,concat:b.concat,hexlify:b.hexlify,stripZeros:b.stripZeros,hexZeroPad:b.hexZeroPad,bigNumberify:a("../utils/bignumber").bigNumberify,toUtf8Bytes:a("../utils/utf8").toUtf8Bytes,getAddress:a("../utils/address").getAddress,keccak256:a("../utils/keccak256"),randomBytes:a("../utils").randomBytes,RLP:a("../utils/rlp")}}(),h=a("../utils/errors"),i=a("./hdnode"),j=a("./secret-storage"),k=a("./signing-key");a("setimmediate");var l="m/44'/60'/0'/0/0",m=[{name:"nonce",maxLength:32},{name:"gasPrice",maxLength:32},{name:"gasLimit",maxLength:32},{name:"to",length:20},{name:"value",maxLength:32},{name:"data"}];g.defineProperty(d,"parseTransaction",function(a){a=g.hexlify(a,"rawTransaction");var b=g.RLP.decode(a);if(9!==b.length)throw new Error("invalid transaction");var c=[],d={};m.forEach(function(a,e){d[a.name]=b[e],c.push(b[e])}),d.to&&("0x"==d.to?delete d.to:d.to=g.getAddress(d.to)),["gasPrice","gasLimit","nonce","value"].forEach(function(a){d[a]&&(0===d[a].length?d[a]=g.bigNumberify(0):d[a]=g.bigNumberify(d[a]))}),d.nonce?d.nonce=d.nonce.toNumber():d.nonce=0;var e=g.arrayify(b[6]),f=g.arrayify(b[7]),h=g.arrayify(b[8]);if(e.length>=1&&f.length>=1&&f.length<=32&&h.length>=1&&h.length<=32){d.v=g.bigNumberify(e).toNumber(),d.r=b[7],d.s=b[8];var i=(d.v-35)/2;i<0&&(i=0),i=parseInt(i),d.chainId=i;var j=d.v-27;i&&(c.push(g.hexlify(i)),c.push("0x"),c.push("0x"),j-=2*i+8);var l=g.keccak256(g.RLP.encode(c));try{d.from=k.recover(l,f,h,j)}catch(n){console.log(n)}}return d}),g.defineProperty(d.prototype,"getAddress",function(){return this.address}),g.defineProperty(d.prototype,"getBalance",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,a)}),g.defineProperty(d.prototype,"getTransactionCount",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,a)}),g.defineProperty(d.prototype,"estimateGas",function(a){if(!this.provider)throw new Error("missing provider");var b={};return["from","to","data","value"].forEach(function(c){null!=a[c]&&(b[c]=a[c])}),null==a.from&&(b.from=this.address),this.provider.estimateGas(b)}),g.defineProperty(d.prototype,"sendTransaction",function(a){if(!this.provider)throw new Error("missing provider");if(!a||"object"!=typeof a)throw new Error("invalid transaction object");var b=a.gasLimit;null==b&&(b=this.defaultGasLimit);var c=this,e=null;e=a.gasPrice?Promise.resolve(a.gasPrice):this.provider.getGasPrice();var f=null;f=a.nonce?Promise.resolve(a.nonce):this.provider.getTransactionCount(c.address,"pending");var h=this.provider.chainId,i=null;i=a.to?this.provider.resolveName(a.to):Promise.resolve(void 0);var j=g.hexlify(a.data||"0x"),k=g.hexlify(a.value||0);return Promise.all([e,f,i]).then(function(a){var e=c.sign({to:a[2],data:j,gasLimit:b,gasPrice:a[0],nonce:a[1],value:k,chainId:h});return c.provider.sendTransaction(e).then(function(a){var b=d.parseTransaction(e);return b.hash=a,b.wait=function(){return c.provider.waitForTransaction(a)},b})})}),g.defineProperty(d.prototype,"send",function(a,b,c){return c||(c={}),this.sendTransaction({to:a,gasLimit:c.gasLimit,gasPrice:c.gasPrice,nonce:c.nonce,value:b})}),g.defineProperty(d.prototype,"signMessage",function(a){var b=new k(this.privateKey),c=b.signDigest(e(a));return g.hexZeroPad(c.r,32)+g.hexZeroPad(c.s,32).substring(2)+(c.recoveryParam?"1c":"1b")}),g.defineProperty(d,"verifyMessage",function(a,b){if(b=g.hexlify(b),132!=b.length)throw new Error("invalid signature");var c=e(a),d=parseInt(b.substring(130),16);if(d>=27&&(d-=27),d<0)throw new Error("invalid signature");return k.recover(c,b.substring(0,66),"0x"+b.substring(66,130),d)}),g.defineProperty(d.prototype,"encrypt",function(a,b,c){if("function"!=typeof b||c||(c=b,b={}),c&&"function"!=typeof c)throw new Error("invalid callback");if(b||(b={}),this.mnemonic){var d={};for(var e in b)d[e]=b[e];b=d,b.mnemonic=this.mnemonic,b.path=this.path}return j.encrypt(this.privateKey,a,b,c)}),g.defineProperty(d,"isEncryptedWallet",function(a){return j.isValidWallet(a)||j.isCrowdsaleWallet(a)}),g.defineProperty(d,"createRandom",function(a){var b=g.randomBytes(16);a||(a={}),a.extraEntropy&&(b=g.keccak256(g.concat([b,a.extraEntropy])).substring(0,34));var c=i.entropyToMnemonic(b);return d.fromMnemonic(c,a.path)}),g.defineProperty(d,"fromEncryptedWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return new Promise(function(e,f){if(j.isCrowdsaleWallet(a))try{var h=j.decryptCrowdsale(a,b);e(new d(h))}catch(i){f(i)}else j.isValidWallet(a)?j.decrypt(a,b,c).then(function(a){var b=new d(a);a.mnemonic&&a.path&&(g.defineProperty(b,"mnemonic",a.mnemonic),g.defineProperty(b,"path",a.path)),e(b)},function(a){f(a)}):f("invalid wallet JSON")})}),g.defineProperty(d,"fromMnemonic",function(a,b){b||(b=l);var c=i.fromMnemonic(a).derivePath(b),e=new d(c.privateKey);return g.defineProperty(e,"mnemonic",a),g.defineProperty(e,"path",b),e}),g.defineProperty(d,"fromBrainWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return a="string"==typeof a?g.toUtf8Bytes(a,"NFKC"):g.arrayify(a,"password"),b="string"==typeof b?g.toUtf8Bytes(b,"NFKC"):g.arrayify(b,"password"),new Promise(function(e,h){f(b,a,1<<18,8,1,32,function(a,b,f){if(a)h(a);else if(f)e(new d(g.hexlify(f)));else if(c)return c(b)})})}),b.exports=d},{"../utils":51,"../utils/address":42,"../utils/bignumber":43,"../utils/convert":47,"../utils/errors":48,"../utils/keccak256":52,"../utils/properties":55,"../utils/rlp":56,"../utils/utf8":61,"./hdnode":62,"./secret-storage":64,"./signing-key":65,"scrypt-js":37,setimmediate:38}],67:[function(a,b,c){b.exports="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; +},{}]},{},[63])(63)}); \ No newline at end of file diff --git a/dist/ethers.js b/dist/ethers.js index 95366a761..fbfc8cebf 100644 --- a/dist/ethers.js +++ b/dist/ethers.js @@ -317,7 +317,7 @@ utils.defineProperty(Contract, 'getDeployTransaction', function(bytecode, contra module.exports = Contract; -},{"../utils/address.js":56,"../utils/bignumber.js":57,"../utils/convert.js":60,"../utils/properties.js":69,"./interface.js":3}],2:[function(require,module,exports){ +},{"../utils/address.js":56,"../utils/bignumber.js":57,"../utils/convert.js":61,"../utils/properties.js":70,"./interface.js":3}],2:[function(require,module,exports){ 'use strict'; var Contract = require('./contract.js'); @@ -672,7 +672,7 @@ function Interface(abi) { module.exports = Interface; -},{"../utils/abi-coder":55,"../utils/convert":60,"../utils/keccak256":66,"../utils/properties":69,"../utils/throw-error":73,"../utils/utf8":75}],4:[function(require,module,exports){ +},{"../utils/abi-coder":55,"../utils/convert":61,"../utils/keccak256":67,"../utils/properties":70,"../utils/throw-error":74,"../utils/utf8":76}],4:[function(require,module,exports){ 'use strict'; var version = require('./package.json').version; @@ -701,7 +701,7 @@ module.exports = { version: version, }; -},{"./contracts":2,"./package.json":45,"./providers":49,"./utils":65,"./utils/errors":62,"./wallet":77}],5:[function(require,module,exports){ +},{"./contracts":2,"./package.json":45,"./providers":49,"./utils":66,"./utils/errors":63,"./wallet":78}],5:[function(require,module,exports){ "use strict"; (function(root) { @@ -4932,7 +4932,7 @@ module.exports = { },{"buffer":8}],7:[function(require,module,exports){ var randomBytes = require('../../utils').randomBytes; module.exports = function(length) { return randomBytes(length); }; -},{"../../utils":65}],8:[function(require,module,exports){ +},{"../../utils":66}],8:[function(require,module,exports){ },{}],9:[function(require,module,exports){ 'use strict'; @@ -9578,7 +9578,7 @@ uuid.unparse = unparse; module.exports = uuid; },{"./rng":43}],45:[function(require,module,exports){ -module.exports={"version":"3.0.11"} +module.exports={"version":"3.0.12"} },{}],46:[function(require,module,exports){ 'use strict'; @@ -9875,7 +9875,7 @@ utils.defineProperty(EtherscanProvider.prototype, 'getHistory', function(address module.exports = EtherscanProvider;; -},{"../utils/convert.js":60,"../utils/properties.js":69,"./provider.js":53}],48:[function(require,module,exports){ +},{"../utils/convert.js":61,"../utils/properties.js":70,"./provider.js":53}],48:[function(require,module,exports){ 'use strict'; var inherits = require('inherits'); @@ -9939,7 +9939,7 @@ utils.defineProperty(FallbackProvider.prototype, 'perform', function(method, par module.exports = FallbackProvider; -},{"../utils/properties.js":69,"./provider.js":53,"inherits":37}],49:[function(require,module,exports){ +},{"../utils/properties.js":70,"./provider.js":53,"inherits":37}],49:[function(require,module,exports){ 'use strict'; var Provider = require('./provider'); @@ -9981,7 +9981,7 @@ if (IpcProvider) { module.exports = exports; -},{"./etherscan-provider":47,"./fallback-provider":48,"./infura-provider":50,"./ipc-provider":61,"./json-rpc-provider":51,"./provider":53,"./web3-provider":54}],50:[function(require,module,exports){ +},{"./etherscan-provider":47,"./fallback-provider":48,"./infura-provider":50,"./ipc-provider":62,"./json-rpc-provider":51,"./provider":53,"./web3-provider":54}],50:[function(require,module,exports){ 'use strict'; var Provider = require('./provider'); @@ -10043,7 +10043,7 @@ utils.defineProperty(InfuraProvider.prototype, 'listAccounts', function() { module.exports = InfuraProvider; -},{"../utils/errors":62,"../utils/properties":69,"./json-rpc-provider":51,"./provider":53}],51:[function(require,module,exports){ +},{"../utils/errors":63,"../utils/properties":70,"./json-rpc-provider":51,"./provider":53}],51:[function(require,module,exports){ 'use strict'; // See: https://github.com/ethereum/wiki/wiki/JSON-RPC @@ -10205,7 +10205,7 @@ function JsonRpcProvider(url, network) { network = Provider.getNetwork(url); url = null; } catch (error) { } - } else { + } else if (url && url.url == null) { network = url; url = null; } @@ -10343,7 +10343,7 @@ utils.defineProperty(JsonRpcProvider, '_hexlifyTransaction', function(transactio module.exports = JsonRpcProvider; -},{"../utils/address":56,"../utils/convert":60,"../utils/errors":62,"../utils/properties":69,"../utils/utf8":75,"./provider.js":53}],52:[function(require,module,exports){ +},{"../utils/address":56,"../utils/convert":61,"../utils/errors":63,"../utils/properties":70,"../utils/utf8":76,"./provider.js":53}],52:[function(require,module,exports){ module.exports={ "unspecified": { "chainId": 0, @@ -10404,6 +10404,7 @@ var networks = require('./networks.json'); var utils = (function() { var convert = require('../utils/convert'); + var utf8 = require('../utils/utf8'); return { defineProperty: require('../utils/properties').defineProperty, @@ -10420,14 +10421,19 @@ var utils = (function() { hexStripZeros: convert.hexStripZeros, stripZeros: convert.stripZeros, + base64: require('../utils/base64'), + namehash: require('../utils/namehash'), - toUtf8String: require('../utils/utf8').toUtf8String, + toUtf8String: utf8.toUtf8String, + toUtf8Bytes: utf8.toUtf8Bytes, RLP: require('../utils/rlp'), } })(); +var errors = require('../utils/errors'); + function copyObject(obj) { var result = {}; for (var key in obj) { result[key] = obj[key]; } @@ -10957,17 +10963,36 @@ utils.defineProperty(Provider, 'getNetwork', function(network) { utils.defineProperty(Provider, 'networks', networks); utils.defineProperty(Provider, 'fetchJSON', function(url, json, processFunc) { + var headers = [ ]; + + if (typeof(url) === 'object' && url.url != null && url.user != null && url.password != null) { + if (url.url.substring(0, 6) !== 'https:' && url.forceInsecure !== true) { + errors.throwError('basic authentication requires a secure https url', errors.INVALID_ARGUMENT, { arg: 'url', url: url.url, user: url.user, password: '[REDACTED]' }); + } + + var authorization = url.user + ':' + url.password; + headers.push({ + key: 'Authorization', + value: 'Basic ' + utils.base64.encode(utils.toUtf8Bytes(authorization)) + }); + + url = url.url; + } return new Promise(function(resolve, reject) { var request = new XMLHttpRequest(); if (json) { request.open('POST', url, true); - request.setRequestHeader('Content-Type','application/json'); + headers.push({ key: 'Content-Type', value: 'application/json' }); } else { request.open('GET', url, true); } + headers.forEach(function(header) { + request.setRequestHeader(header.key, header.value); + }); + request.onreadystatechange = function() { if (request.readyState !== 4) { return; } @@ -11550,7 +11575,7 @@ utils.defineProperty(Provider, '_formatters', { module.exports = Provider; -},{"../utils/address":56,"../utils/bignumber":57,"../utils/contract-address":59,"../utils/convert":60,"../utils/namehash":67,"../utils/properties":69,"../utils/rlp":70,"../utils/utf8":75,"./networks.json":52,"inherits":37,"xmlhttprequest":46}],54:[function(require,module,exports){ +},{"../utils/address":56,"../utils/base64":58,"../utils/bignumber":57,"../utils/contract-address":60,"../utils/convert":61,"../utils/errors":63,"../utils/namehash":68,"../utils/properties":70,"../utils/rlp":71,"../utils/utf8":76,"./networks.json":52,"inherits":37,"xmlhttprequest":46}],54:[function(require,module,exports){ 'use strict'; var Provider = require('./provider'); @@ -11620,7 +11645,7 @@ utils.defineProperty(Web3Provider.prototype, 'send', function(method, params) { module.exports = Web3Provider; -},{"../utils/errors":62,"../utils/properties":69,"./json-rpc-provider":51,"./provider":53}],55:[function(require,module,exports){ +},{"../utils/errors":63,"../utils/properties":70,"./json-rpc-provider":51,"./provider":53}],55:[function(require,module,exports){ 'use strict'; // See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI @@ -12162,7 +12187,7 @@ utils.defineProperty(Coder, 'defaultCoder', new Coder()); module.exports = Coder -},{"../utils/address":56,"../utils/bignumber.js":57,"../utils/convert.js":60,"../utils/properties.js":69,"../utils/throw-error":73,"../utils/utf8.js":75}],56:[function(require,module,exports){ +},{"../utils/address":56,"../utils/bignumber.js":57,"../utils/convert.js":61,"../utils/properties.js":70,"../utils/throw-error":74,"../utils/utf8.js":76}],56:[function(require,module,exports){ var BN = require('bn.js'); @@ -12288,7 +12313,7 @@ module.exports = { getAddress: getAddress, } -},{"./convert":60,"./keccak256":66,"./throw-error":73,"bn.js":6}],57:[function(require,module,exports){ +},{"./convert":61,"./keccak256":67,"./throw-error":74,"bn.js":6}],57:[function(require,module,exports){ /** * BigNumber * @@ -12439,7 +12464,33 @@ module.exports = { BigNumber: BigNumber }; -},{"./convert":60,"./properties":69,"./throw-error":73,"bn.js":6}],58:[function(require,module,exports){ +},{"./convert":61,"./properties":70,"./throw-error":74,"bn.js":6}],58:[function(require,module,exports){ +'use strict'; + +var convert = require('./convert'); + +module.exports = { + decode: function(textData) { + textData = atob(textData); + var data = []; + for (var i = 0; i < textData.length; i++) { + data.push(textData.charCodeAt(i)); + } + return convert.arrayify(data); + }, + encode: function(data) { + data = convert.arrayify(data); + var textData = ''; + for (var i = 0; i < data.length; i++) { + textData += String.fromCharCode(data[i]); + } + return btoa(textData); + } +}; + + + +},{"./convert":61}],59:[function(require,module,exports){ (function (global){ 'use strict'; @@ -12486,7 +12537,7 @@ if (crypto._weakCrypto === true) { module.exports = randomBytes; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./convert":60,"./properties":69}],59:[function(require,module,exports){ +},{"./convert":61,"./properties":70}],60:[function(require,module,exports){ var getAddress = require('./address').getAddress; var convert = require('./convert'); @@ -12508,7 +12559,7 @@ module.exports = { getContractAddress: getContractAddress, } -},{"./address":56,"./convert":60,"./keccak256":66,"./rlp":70}],60:[function(require,module,exports){ +},{"./address":56,"./convert":61,"./keccak256":67,"./rlp":71}],61:[function(require,module,exports){ /** * Conversion Utilities * @@ -12734,10 +12785,10 @@ module.exports = { hexZeroPad: hexZeroPad, }; -},{"./errors":62,"./properties.js":69}],61:[function(require,module,exports){ +},{"./errors":63,"./properties.js":70}],62:[function(require,module,exports){ module.exports = undefined; -},{}],62:[function(require,module,exports){ +},{}],63:[function(require,module,exports){ 'use strict'; var defineProperty = require('./properties').defineProperty; @@ -12810,7 +12861,7 @@ defineProperty(codes, 'checkNew', function(self, kind) { module.exports = codes; -},{"./properties":69}],63:[function(require,module,exports){ +},{"./properties":70}],64:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -12836,7 +12887,7 @@ module.exports = { createSha512Hmac: createSha512Hmac, }; -},{"./convert.js":60,"./sha2.js":71,"hash.js":24}],64:[function(require,module,exports){ +},{"./convert.js":61,"./sha2.js":72,"hash.js":24}],65:[function(require,module,exports){ 'use strict'; var keccak256 = require('./keccak256'); @@ -12848,7 +12899,7 @@ function id(text) { module.exports = id; -},{"./keccak256":66,"./utf8":75}],65:[function(require,module,exports){ +},{"./keccak256":67,"./utf8":76}],66:[function(require,module,exports){ 'use strict'; // This is SUPER useful, but adds 140kb (even zipped, adds 40kb) @@ -12856,6 +12907,7 @@ module.exports = id; var address = require('./address'); var AbiCoder = require('./abi-coder'); +var base64 = require('./base64'); var bigNumber = require('./bignumber'); var contractAddress = require('./contract-address'); var convert = require('./convert'); @@ -12890,6 +12942,8 @@ module.exports = { padZeros: convert.padZeros, stripZeros: convert.stripZeros, + base64: base64, + bigNumberify: bigNumber.bigNumberify, BigNumber: bigNumber.BigNumber, @@ -12922,7 +12976,7 @@ module.exports = { splitSignature: convert.splitSignature, } -},{"./abi-coder":55,"./address":56,"./bignumber":57,"./contract-address":59,"./convert":60,"./id":64,"./keccak256":66,"./namehash":67,"./properties":69,"./random-bytes":58,"./rlp":70,"./sha2":71,"./solidity":72,"./units":74,"./utf8":75}],66:[function(require,module,exports){ +},{"./abi-coder":55,"./address":56,"./base64":58,"./bignumber":57,"./contract-address":60,"./convert":61,"./id":65,"./keccak256":67,"./namehash":68,"./properties":70,"./random-bytes":59,"./rlp":71,"./sha2":72,"./solidity":73,"./units":75,"./utf8":76}],67:[function(require,module,exports){ 'use strict'; var sha3 = require('js-sha3'); @@ -12936,7 +12990,7 @@ function keccak256(data) { module.exports = keccak256; -},{"./convert.js":60,"js-sha3":38}],67:[function(require,module,exports){ +},{"./convert.js":61,"js-sha3":38}],68:[function(require,module,exports){ 'use strict'; var convert = require('./convert'); @@ -12976,7 +13030,7 @@ function namehash(name, depth) { module.exports = namehash; -},{"./convert":60,"./keccak256":66,"./utf8":75}],68:[function(require,module,exports){ +},{"./convert":61,"./keccak256":67,"./utf8":76}],69:[function(require,module,exports){ 'use strict'; var convert = require('./convert'); @@ -13029,7 +13083,7 @@ function pbkdf2(password, salt, iterations, keylen, createHmac) { module.exports = pbkdf2; -},{"./convert":60}],69:[function(require,module,exports){ +},{"./convert":61}],70:[function(require,module,exports){ 'use strict'; function defineProperty(object, name, value) { @@ -13053,7 +13107,7 @@ module.exports = { defineProperty: defineProperty, }; -},{}],70:[function(require,module,exports){ +},{}],71:[function(require,module,exports){ //See: https://github.com/ethereum/wiki/wiki/RLP var convert = require('./convert.js'); @@ -13197,7 +13251,7 @@ module.exports = { decode: decode, } -},{"./convert.js":60}],71:[function(require,module,exports){ +},{"./convert.js":61}],72:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -13222,7 +13276,7 @@ module.exports = { createSha512: hash.sha512, } -},{"./convert.js":60,"hash.js":24}],72:[function(require,module,exports){ +},{"./convert.js":61,"hash.js":24}],73:[function(require,module,exports){ 'use strict'; var bigNumberify = require('./bignumber').bigNumberify; @@ -13321,7 +13375,7 @@ module.exports = { sha256: sha256, } -},{"./address":56,"./bignumber":57,"./convert":60,"./keccak256":66,"./sha2":71,"./utf8":75}],73:[function(require,module,exports){ +},{"./address":56,"./bignumber":57,"./convert":61,"./keccak256":67,"./sha2":72,"./utf8":76}],74:[function(require,module,exports){ 'use strict'; function throwError(message, params) { @@ -13334,7 +13388,7 @@ function throwError(message, params) { module.exports = throwError; -},{}],74:[function(require,module,exports){ +},{}],75:[function(require,module,exports){ var bigNumberify = require('./bignumber.js').bigNumberify; var throwError = require('./throw-error'); @@ -13484,7 +13538,7 @@ module.exports = { parseUnits: parseUnits, } -},{"./bignumber.js":57,"./throw-error":73}],75:[function(require,module,exports){ +},{"./bignumber.js":57,"./throw-error":74}],76:[function(require,module,exports){ var convert = require('./convert.js'); @@ -13599,7 +13653,7 @@ module.exports = { toUtf8String: bytesToUtf8, }; -},{"./convert.js":60}],76:[function(require,module,exports){ +},{"./convert.js":61}],77:[function(require,module,exports){ // See: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki // See: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki @@ -13860,7 +13914,7 @@ module.exports = { isValidMnemonic: isValidMnemonic, }; -},{"../utils/bignumber.js":57,"../utils/convert.js":60,"../utils/hmac":63,"../utils/pbkdf2.js":68,"../utils/properties.js":69,"../utils/sha2":71,"../utils/utf8.js":75,"./words.json":81,"elliptic":9}],77:[function(require,module,exports){ +},{"../utils/bignumber.js":57,"../utils/convert.js":61,"../utils/hmac":64,"../utils/pbkdf2.js":69,"../utils/properties.js":70,"../utils/sha2":72,"../utils/utf8.js":76,"./words.json":82,"elliptic":9}],78:[function(require,module,exports){ 'use strict'; var Wallet = require('./wallet'); @@ -13874,7 +13928,7 @@ module.exports = { SigningKey: SigningKey, } -},{"./hdnode":76,"./signing-key":79,"./wallet":80}],78:[function(require,module,exports){ +},{"./hdnode":77,"./signing-key":80,"./wallet":81}],79:[function(require,module,exports){ 'use strict'; var aes = require('aes-js'); @@ -14325,7 +14379,7 @@ utils.defineProperty(secretStorage, 'encrypt', function(privateKey, password, op module.exports = secretStorage; -},{"../utils":65,"../utils/hmac":63,"../utils/pbkdf2":68,"./hdnode":76,"./signing-key":79,"aes-js":5,"scrypt-js":41,"uuid":44}],79:[function(require,module,exports){ +},{"../utils":66,"../utils/hmac":64,"../utils/pbkdf2":69,"./hdnode":77,"./signing-key":80,"aes-js":5,"scrypt-js":41,"uuid":44}],80:[function(require,module,exports){ 'use strict'; /** @@ -14427,7 +14481,7 @@ utils.defineProperty(SigningKey, 'publicKeyToAddress', function(publicKey) { module.exports = SigningKey; -},{"../utils/address":56,"../utils/convert":60,"../utils/errors":62,"../utils/keccak256":66,"../utils/properties":69,"elliptic":9}],80:[function(require,module,exports){ +},{"../utils/address":56,"../utils/convert":61,"../utils/errors":63,"../utils/keccak256":67,"../utils/properties":70,"elliptic":9}],81:[function(require,module,exports){ 'use strict'; var scrypt = require('scrypt-js'); @@ -14909,7 +14963,7 @@ utils.defineProperty(Wallet, 'fromBrainWallet', function(username, password, pro module.exports = Wallet; -},{"../utils":65,"../utils/address":56,"../utils/bignumber":57,"../utils/convert":60,"../utils/errors":62,"../utils/keccak256":66,"../utils/properties":69,"../utils/rlp":70,"../utils/utf8":75,"./hdnode":76,"./secret-storage":78,"./signing-key":79,"scrypt-js":41,"setimmediate":42}],81:[function(require,module,exports){ +},{"../utils":66,"../utils/address":56,"../utils/bignumber":57,"../utils/convert":61,"../utils/errors":63,"../utils/keccak256":67,"../utils/properties":70,"../utils/rlp":71,"../utils/utf8":76,"./hdnode":77,"./secret-storage":79,"./signing-key":80,"scrypt-js":41,"setimmediate":42}],82:[function(require,module,exports){ module.exports="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo" },{}]},{},[4])(4) diff --git a/dist/ethers.min.js b/dist/ethers.min.js index e92f7085c..5889f4f99 100644 --- a/dist/ethers.min.js +++ b/dist/ethers.min.js @@ -1,8 +1,8 @@ -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.ethers=a()}}(function(){var a;return function(){function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gc.inputs.types.length)throw new Error("too many parameters");if(i.length=0&&(e=a.type.substring(f));var g=d(a.components);b.push({name:a.name||null,names:g.names}),c.push("tuple("+g.types.join(",")+")"+e)}else b.push(a.name||null),c.push(a.type)}),{names:b,types:c}}function e(a,b){for(var c in b)m.defineProperty(a,c,b[c]);return a}function f(){}function g(){}function h(){}function i(a){m.defineProperty(this,"indexed",!0),m.defineProperty(this,"hash",a)}function j(){}function k(a){function b(a){switch(a.type){case"constructor":var b=function(){var b=d(a.inputs),c=function(a){m.isHexString(a)||l("invalid bytecode",{input:a});var c=Array.prototype.slice.call(arguments,1);c.lengthb.types.length&&l("too many parameters");var d={bytecode:a+m.coder.encode(b.names,b.types,c).substring(2),type:"deploy"};return e(new f,d)};return m.defineFrozen(c,"inputs",b),m.defineProperty(c,"payable",null==a.payable||!!a.payable),c}();p||(p=b);break;case"function":var b=function(){var b=d(a.inputs),c=d(a.outputs),f="("+b.types.join(",")+")";f=f.replace(/tuple/g,""),f=a.name+f;var h=function(a){return m.coder.decode(c.names,c.types,m.arrayify(a))},i=m.keccak256(m.toUtf8Bytes(f)).substring(0,10),j=function(){var c={name:a.name,signature:f,sighash:i,type:a.constant?"call":"transaction"},d=Array.prototype.slice.call(arguments,0);return d.lengthb.types.length&&l("too many parameters"),c.data=i+m.coder.encode(b.names,b.types,d).substring(2),c.parse=h,e(new g,c)};return m.defineFrozen(j,"inputs",b),m.defineFrozen(j,"outputs",c),m.defineProperty(j,"payable",null==a.payable||!!a.payable),m.defineProperty(j,"parseResult",h),m.defineProperty(j,"signature",f),m.defineProperty(j,"sighash",i),j}();a.name&&null==n[a.name]&&m.defineProperty(n,a.name,b),null==n[b.signature]&&m.defineProperty(n,b.signature,b);break;case"event":var b=function(){var b=d(a.inputs),c="("+b.types.join(",")+")";c=c.replace(/tuple/g,""),c=a.name+c;var f={anonymous:!!a.anonymous,name:a.name,signature:c,type:"event"};f.parse=function(c,d){null==d&&(d=c,c=null),null==c||a.anonymous||(c=c.slice(1));var e=[],f=[],g=[],h=[],k=[];if(a.inputs.forEach(function(a,c){var d=b.types[c],i=b.names[c];a.indexed?("string"===d||"bytes"===d||d.indexOf("[")>=0||"tuple"===d.substring(0,5)?(g.push("bytes32"),k.push(!0)):(g.push(d),k.push(!1)),e.push(i)):(f.push(i),h.push(d),k.push(!1))}),null!=c)var l=m.coder.decode(e,g,m.concat(c));var n=m.coder.decode(f,h,m.arrayify(d)),o=new j,p=0,q=0;return a.inputs.forEach(function(a,b){a.indexed?null==c?o[b]=new i(null):k[b]?o[b]=new i(l[q++]):o[b]=l[q++]:o[b]=n[p++],a.name&&(o[a.name]=o[b])}),o.length=a.inputs.length,o};var g=e(new h,f);return m.defineFrozen(g,"topics",[m.keccak256(m.toUtf8Bytes(c))]),m.defineFrozen(g,"inputs",b),g}();a.name&&null==o[a.name]&&m.defineProperty(o,a.name,b),null==n[b.signature]&&m.defineProperty(n,b.signature,b);break;case"fallback":break;default:console.log("WARNING: unsupported ABI type - "+a.type)}}if(!(this instanceof k))throw new Error("missing new");if("string"==typeof a)try{a=JSON.parse(a)}catch(c){l("invalid abi",{input:a})}m.defineFrozen(this,"abi",a);var n={},o={},p=null;m.defineProperty(this,"functions",n),m.defineProperty(this,"events",o),this.abi.forEach(b,this),p||b({type:"constructor",inputs:[]}),m.defineProperty(this,"deployFunction",p)}var l=a("../utils/throw-error"),m=function(){var b=a("../utils/convert"),c=a("../utils/properties"),d=a("../utils/utf8");return{defineFrozen:c.defineFrozen,defineProperty:c.defineProperty,coder:a("../utils/abi-coder").defaultCoder,arrayify:b.arrayify,concat:b.concat,isHexString:b.isHexString,toUtf8Bytes:d.toUtf8Bytes,keccak256:a("../utils/keccak256")}}();b.exports=k},{"../utils/abi-coder":55,"../utils/convert":60,"../utils/keccak256":66,"../utils/properties":69,"../utils/throw-error":73,"../utils/utf8":75}],4:[function(a,b,c){"use strict";var d=a("./package.json").version,e=a("./contracts"),f=a("./providers"),g=a("./utils/errors"),h=a("./utils"),i=a("./wallet");b.exports={Wallet:i.Wallet,HDNode:i.HDNode,SigningKey:i.SigningKey,Contract:e.Contract,Interface:e.Interface,networks:f.networks,providers:f,errors:g,utils:h,version:d}},{"./contracts":2,"./package.json":45,"./providers":49,"./utils":65,"./utils/errors":62,"./wallet":77}],5:[function(b,c,d){"use strict";!function(b){function e(a){return parseInt(a)===a}function f(a){if(!e(a.length))return!1;for(var b=0;b255)return!1;return!0}function g(a,b){if(a.buffer&&ArrayBuffer.isView(a)&&"Uint8Array"===a.name)return b&&(a=a.slice?a.slice():Array.prototype.slice.call(a)),a;if(Array.isArray(a)){if(!f(a))throw new Error("Array contains invalid value: "+a);return new Uint8Array(a)}if(e(a.length)&&f(a))return new Uint8Array(a);throw new Error("unsupported array-like object")}function h(a){return new Uint8Array(a)}function i(a,b,c,d,e){null==d&&null==e||(a=a.slice?a.slice(d,e):Array.prototype.slice.call(a,d,e)),b.set(a,c)}function j(a){for(var b=[],c=0;c16)throw new Error("PKCS#7 padding byte out of range");for(var c=a.length-b,d=0;d191&&d<224?(b.push(String.fromCharCode((31&d)<<6|63&a[c+1])),c+=2):(b.push(String.fromCharCode((15&d)<<12|(63&a[c+1])<<6|63&a[c+2])),c+=3)}return b.join("")}return{toBytes:a,fromBytes:b}}(),n=function(){function a(a){for(var b=[],c=0;c>4]+c[15&e])}return b.join("")}var c="0123456789abcdef";return{toBytes:a,fromBytes:b}}(),o={16:10,24:12,32:14},p=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],q=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],r=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],s=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],t=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],u=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],v=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],w=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],x=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],y=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],z=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],B=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],C=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],D=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925],E=function(a){ +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.ethers=a()}}(function(){var a;return function(){function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gc.inputs.types.length)throw new Error("too many parameters");if(i.length=0&&(e=a.type.substring(f));var g=d(a.components);b.push({name:a.name||null,names:g.names}),c.push("tuple("+g.types.join(",")+")"+e)}else b.push(a.name||null),c.push(a.type)}),{names:b,types:c}}function e(a,b){for(var c in b)m.defineProperty(a,c,b[c]);return a}function f(){}function g(){}function h(){}function i(a){m.defineProperty(this,"indexed",!0),m.defineProperty(this,"hash",a)}function j(){}function k(a){function b(a){switch(a.type){case"constructor":var b=function(){var b=d(a.inputs),c=function(a){m.isHexString(a)||l("invalid bytecode",{input:a});var c=Array.prototype.slice.call(arguments,1);c.lengthb.types.length&&l("too many parameters");var d={bytecode:a+m.coder.encode(b.names,b.types,c).substring(2),type:"deploy"};return e(new f,d)};return m.defineFrozen(c,"inputs",b),m.defineProperty(c,"payable",null==a.payable||!!a.payable),c}();p||(p=b);break;case"function":var b=function(){var b=d(a.inputs),c=d(a.outputs),f="("+b.types.join(",")+")";f=f.replace(/tuple/g,""),f=a.name+f;var h=function(a){return m.coder.decode(c.names,c.types,m.arrayify(a))},i=m.keccak256(m.toUtf8Bytes(f)).substring(0,10),j=function(){var c={name:a.name,signature:f,sighash:i,type:a.constant?"call":"transaction"},d=Array.prototype.slice.call(arguments,0);return d.lengthb.types.length&&l("too many parameters"),c.data=i+m.coder.encode(b.names,b.types,d).substring(2),c.parse=h,e(new g,c)};return m.defineFrozen(j,"inputs",b),m.defineFrozen(j,"outputs",c),m.defineProperty(j,"payable",null==a.payable||!!a.payable),m.defineProperty(j,"parseResult",h),m.defineProperty(j,"signature",f),m.defineProperty(j,"sighash",i),j}();a.name&&null==n[a.name]&&m.defineProperty(n,a.name,b),null==n[b.signature]&&m.defineProperty(n,b.signature,b);break;case"event":var b=function(){var b=d(a.inputs),c="("+b.types.join(",")+")";c=c.replace(/tuple/g,""),c=a.name+c;var f={anonymous:!!a.anonymous,name:a.name,signature:c,type:"event"};f.parse=function(c,d){null==d&&(d=c,c=null),null==c||a.anonymous||(c=c.slice(1));var e=[],f=[],g=[],h=[],k=[];if(a.inputs.forEach(function(a,c){var d=b.types[c],i=b.names[c];a.indexed?("string"===d||"bytes"===d||d.indexOf("[")>=0||"tuple"===d.substring(0,5)?(g.push("bytes32"),k.push(!0)):(g.push(d),k.push(!1)),e.push(i)):(f.push(i),h.push(d),k.push(!1))}),null!=c)var l=m.coder.decode(e,g,m.concat(c));var n=m.coder.decode(f,h,m.arrayify(d)),o=new j,p=0,q=0;return a.inputs.forEach(function(a,b){a.indexed?null==c?o[b]=new i(null):k[b]?o[b]=new i(l[q++]):o[b]=l[q++]:o[b]=n[p++],a.name&&(o[a.name]=o[b])}),o.length=a.inputs.length,o};var g=e(new h,f);return m.defineFrozen(g,"topics",[m.keccak256(m.toUtf8Bytes(c))]),m.defineFrozen(g,"inputs",b),g}();a.name&&null==o[a.name]&&m.defineProperty(o,a.name,b),null==n[b.signature]&&m.defineProperty(n,b.signature,b);break;case"fallback":break;default:console.log("WARNING: unsupported ABI type - "+a.type)}}if(!(this instanceof k))throw new Error("missing new");if("string"==typeof a)try{a=JSON.parse(a)}catch(c){l("invalid abi",{input:a})}m.defineFrozen(this,"abi",a);var n={},o={},p=null;m.defineProperty(this,"functions",n),m.defineProperty(this,"events",o),this.abi.forEach(b,this),p||b({type:"constructor",inputs:[]}),m.defineProperty(this,"deployFunction",p)}var l=a("../utils/throw-error"),m=function(){var b=a("../utils/convert"),c=a("../utils/properties"),d=a("../utils/utf8");return{defineFrozen:c.defineFrozen,defineProperty:c.defineProperty,coder:a("../utils/abi-coder").defaultCoder,arrayify:b.arrayify,concat:b.concat,isHexString:b.isHexString,toUtf8Bytes:d.toUtf8Bytes,keccak256:a("../utils/keccak256")}}();b.exports=k},{"../utils/abi-coder":55,"../utils/convert":61,"../utils/keccak256":67,"../utils/properties":70,"../utils/throw-error":74,"../utils/utf8":76}],4:[function(a,b,c){"use strict";var d=a("./package.json").version,e=a("./contracts"),f=a("./providers"),g=a("./utils/errors"),h=a("./utils"),i=a("./wallet");b.exports={Wallet:i.Wallet,HDNode:i.HDNode,SigningKey:i.SigningKey,Contract:e.Contract,Interface:e.Interface,networks:f.networks,providers:f,errors:g,utils:h,version:d}},{"./contracts":2,"./package.json":45,"./providers":49,"./utils":66,"./utils/errors":63,"./wallet":78}],5:[function(b,c,d){"use strict";!function(b){function e(a){return parseInt(a)===a}function f(a){if(!e(a.length))return!1;for(var b=0;b255)return!1;return!0}function g(a,b){if(a.buffer&&ArrayBuffer.isView(a)&&"Uint8Array"===a.name)return b&&(a=a.slice?a.slice():Array.prototype.slice.call(a)),a;if(Array.isArray(a)){if(!f(a))throw new Error("Array contains invalid value: "+a);return new Uint8Array(a)}if(e(a.length)&&f(a))return new Uint8Array(a);throw new Error("unsupported array-like object")}function h(a){return new Uint8Array(a)}function i(a,b,c,d,e){null==d&&null==e||(a=a.slice?a.slice(d,e):Array.prototype.slice.call(a,d,e)),b.set(a,c)}function j(a){for(var b=[],c=0;c16)throw new Error("PKCS#7 padding byte out of range");for(var c=a.length-b,d=0;d191&&d<224?(b.push(String.fromCharCode((31&d)<<6|63&a[c+1])),c+=2):(b.push(String.fromCharCode((15&d)<<12|(63&a[c+1])<<6|63&a[c+2])),c+=3)}return b.join("")}return{toBytes:a,fromBytes:b}}(),n=function(){function a(a){for(var b=[],c=0;c>4]+c[15&e])}return b.join("")}var c="0123456789abcdef";return{toBytes:a,fromBytes:b}}(),o={16:10,24:12,32:14},p=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],q=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],r=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],s=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],t=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],u=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],v=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],w=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],x=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],y=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],z=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],B=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],C=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],D=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925],E=function(a){ if(!(this instanceof E))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:g(a,!0)}),this._prepare()};E.prototype._prepare=function(){var a=o[this.key.length];if(null==a)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var b=0;b<=a;b++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var c,d=4*(a+1),e=this.key.length/4,f=j(this.key),b=0;b>2,this._Ke[c][b%4]=f[b],this._Kd[a-c][b%4]=f[b];for(var g,h=0,i=e;i>16&255]<<24^q[g>>8&255]<<16^q[255&g]<<8^q[g>>24&255]^p[h]<<24,h+=1,8!=e)for(var b=1;b>8&255]<<8^q[g>>16&255]<<16^q[g>>24&255]<<24;for(var b=e/2+1;b>2,l=i%4,this._Ke[k][l]=f[b],this._Kd[a-k][l]=f[b++],i++}for(var k=1;k>24&255]^B[g>>16&255]^C[g>>8&255]^D[255&g]},E.prototype.encrypt=function(a){if(16!=a.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var b=this._Ke.length-1,c=[0,0,0,0],d=j(a),e=0;e<4;e++)d[e]^=this._Ke[0][e];for(var f=1;f>24&255]^t[d[(e+1)%4]>>16&255]^u[d[(e+2)%4]>>8&255]^v[255&d[(e+3)%4]]^this._Ke[f][e];d=c.slice()}for(var g,i=h(16),e=0;e<4;e++)g=this._Ke[b][e],i[4*e]=255&(q[d[e]>>24&255]^g>>24),i[4*e+1]=255&(q[d[(e+1)%4]>>16&255]^g>>16),i[4*e+2]=255&(q[d[(e+2)%4]>>8&255]^g>>8),i[4*e+3]=255&(q[255&d[(e+3)%4]]^g);return i},E.prototype.decrypt=function(a){if(16!=a.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var b=this._Kd.length-1,c=[0,0,0,0],d=j(a),e=0;e<4;e++)d[e]^=this._Kd[0][e];for(var f=1;f>24&255]^x[d[(e+3)%4]>>16&255]^y[d[(e+2)%4]>>8&255]^z[255&d[(e+1)%4]]^this._Kd[f][e];d=c.slice()}for(var g,i=h(16),e=0;e<4;e++)g=this._Kd[b][e],i[4*e]=255&(r[d[e]>>24&255]^g>>24),i[4*e+1]=255&(r[d[(e+3)%4]>>16&255]^g>>16),i[4*e+2]=255&(r[d[(e+2)%4]>>8&255]^g>>8),i[4*e+3]=255&(r[255&d[(e+1)%4]]^g);return i};var F=function(a){if(!(this instanceof F))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new E(a)};F.prototype.encrypt=function(a){if(a=g(a),a.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var b=h(a.length),c=h(16),d=0;d=0;--b)this._counter[b]=a%256,a>>=8},J.prototype.setBytes=function(a){if(a=g(a,!0),16!=a.length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=a},J.prototype.increment=function(){for(var a=15;a>=0;a--){if(255!==this._counter[a]){this._counter[a]++;break}this._counter[a]=0}};var K=function(a,b){if(!(this instanceof K))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",b instanceof J||(b=new J(b)),this._counter=b,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new E(a)};K.prototype.encrypt=function(a){for(var b=g(a,!0),c=0;c=49&&g<=54?g-49+10:g>=17&&g<=22?g-17+10:15&g}return d}function h(a,b,c,d){for(var e=0,f=Math.min(a.length,c),g=b;g=49?h-49+10:h>=17?h-17+10:h}return e}function i(a){for(var b=new Array(a.bitLength()),c=0;c>>e}return b}function j(a,b,c){c.negative=b.negative^a.negative;var d=a.length+b.length|0;c.length=d,d=d-1|0;var e=0|a.words[0],f=0|b.words[0],g=e*f,h=67108863&g,i=g/67108864|0;c.words[0]=h;for(var j=1;j>>26,l=67108863&i,m=Math.min(j,b.length-1),n=Math.max(0,j-a.length+1);n<=m;n++){var o=j-n|0;e=0|a.words[o],f=0|b.words[n],g=e*f+l,k+=g/67108864|0,l=67108863&g}c.words[j]=0|l,i=0|k}return 0!==i?c.words[j]=0|i:c.length--,c.strip()}function k(a,b,c){c.negative=b.negative^a.negative,c.length=a.length+b.length;for(var d=0,e=0,f=0;f>>26)|0,e+=g>>>26,g&=67108863}c.words[f]=h,d=g,g=e}return 0!==d?c.words[f]=d:c.length--,c.strip()}function l(a,b,c){var d=new m;return d.mulp(a,b,c)}function m(a,b){this.x=a,this.y=b}function n(a,b){this.name=a,this.p=new f(b,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function o(){n.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){n.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function q(){n.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function r(){n.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function s(a){if("string"==typeof a){var b=f._prime(a);this.m=b.p,this.prime=b}else d(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}function t(a){s.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof b?b.exports=f:c.BN=f,f.BN=f,f.wordSize=26;var u;try{u=a("buffer").Buffer}catch(v){}f.isBN=function(a){return a instanceof f||null!==a&&"object"==typeof a&&a.constructor.wordSize===f.wordSize&&Array.isArray(a.words)},f.max=function(a,b){return a.cmp(b)>0?a:b},f.min=function(a,b){return a.cmp(b)<0?a:b},f.prototype._init=function(a,b,c){if("number"==typeof a)return this._initNumber(a,b,c);if("object"==typeof a)return this._initArray(a,b,c);"hex"===b&&(b=16),d(b===(0|b)&&b>=2&&b<=36),a=a.toString().replace(/\s+/g,"");var e=0;"-"===a[0]&&e++,16===b?this._parseHex(a,e):this._parseBase(a,b,e),"-"===a[0]&&(this.negative=1),this.strip(),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initNumber=function(a,b,c){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[67108863&a],this.length=1):a<4503599627370496?(this.words=[67108863&a,a/67108864&67108863],this.length=2):(d(a<9007199254740992),this.words=[67108863&a,a/67108864&67108863,1],this.length=3),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initArray=function(a,b,c){if(d("number"==typeof a.length),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var e=0;e=0;e-=3)g=a[e]|a[e-1]<<8|a[e-2]<<16,this.words[f]|=g<>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);else if("le"===c)for(e=0,f=0;e>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);return this.strip()},f.prototype._parseHex=function(a,b){this.length=Math.ceil((a.length-b)/6),this.words=new Array(this.length);for(var c=0;c=b;c-=6)e=g(a,c,c+6),this.words[d]|=e<>>26-f&4194303,f+=24,f>=26&&(f-=26,d++);c+6!==b&&(e=g(a,b,c+6),this.words[d]|=e<>>26-f&4194303),this.strip()},f.prototype._parseBase=function(a,b,c){this.words=[0],this.length=1;for(var d=0,e=1;e<=67108863;e*=b)d++;d--,e=e/b|0;for(var f=a.length-c,g=f%d,i=Math.min(f,f-g)+c,j=0,k=c;k1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(a,b){a=a||10,b=0|b||1;var c;if(16===a||"hex"===a){c="";for(var e=0,f=0,g=0;g>>24-e&16777215,c=0!==f||g!==this.length-1?w[6-i.length]+i+c:i+c,e+=2,e>=26&&(e-=26,g--)}for(0!==f&&(c=f.toString(16)+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(a===(0|a)&&a>=2&&a<=36){var j=x[a],k=y[a];c="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modn(k).toString(a);l=l.idivn(k),c=l.isZero()?m+c:w[j-m.length]+m+c}for(this.isZero()&&(c="0"+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}d(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var a=this.words[0];return 2===this.length?a+=67108864*this.words[1]:3===this.length&&1===this.words[2]?a+=4503599627370496+67108864*this.words[1]:this.length>2&&d(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-a:a},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(a,b){return d("undefined"!=typeof u),this.toArrayLike(u,a,b)},f.prototype.toArray=function(a,b){return this.toArrayLike(Array,a,b)},f.prototype.toArrayLike=function(a,b,c){var e=this.byteLength(),f=c||Math.max(1,e);d(e<=f,"byte array longer than desired length"),d(f>0,"Requested array length <= 0"),this.strip();var g,h,i="le"===b,j=new a(f),k=this.clone();if(i){for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[h]=g;for(;h=4096&&(c+=13,b>>>=13),b>=64&&(c+=7,b>>>=7),b>=8&&(c+=4,b>>>=4),b>=2&&(c+=2,b>>>=2),c+b},f.prototype._zeroBits=function(a){if(0===a)return 26;var b=a,c=0;return 0===(8191&b)&&(c+=13,b>>>=13),0===(127&b)&&(c+=7,b>>>=7),0===(15&b)&&(c+=4,b>>>=4),0===(3&b)&&(c+=2,b>>>=2),0===(1&b)&&c++,c},f.prototype.bitLength=function(){var a=this.words[this.length-1],b=this._countBits(a);return 26*(this.length-1)+b},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,b=0;ba.length?this.clone().ior(a):a.clone().ior(this)},f.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},f.prototype.iuand=function(a){var b;b=this.length>a.length?a:this;for(var c=0;ca.length?this.clone().iand(a):a.clone().iand(this)},f.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},f.prototype.iuxor=function(a){var b,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(var d=0;da.length?this.clone().ixor(a):a.clone().ixor(this)},f.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},f.prototype.inotn=function(a){d("number"==typeof a&&a>=0);var b=0|Math.ceil(a/26),c=a%26;this._expand(b),c>0&&b--;for(var e=0;e0&&(this.words[e]=~this.words[e]&67108863>>26-c),this.strip()},f.prototype.notn=function(a){return this.clone().inotn(a)},f.prototype.setn=function(a,b){d("number"==typeof a&&a>=0);var c=a/26|0,e=a%26;return this._expand(c+1),b?this.words[c]=this.words[c]|1<a.length?(c=this,d=a):(c=a,d=this);for(var e=0,f=0;f>>26;for(;0!==e&&f>>26;if(this.length=c.length,0!==e)this.words[this.length]=e,this.length++;else if(c!==this)for(;fa.length?this.clone().iadd(a):a.clone().iadd(this)},f.prototype.isub=function(a){if(0!==a.negative){a.negative=0;var b=this.iadd(a);return a.negative=1,b._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var c=this.cmp(a);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;var d,e;c>0?(d=this,e=a):(d=a,e=this);for(var f=0,g=0;g>26,this.words[g]=67108863&b;for(;0!==f&&g>26,this.words[g]=67108863&b;if(0===f&&g>>13,n=0|g[1],o=8191&n,p=n>>>13,q=0|g[2],r=8191&q,s=q>>>13,t=0|g[3],u=8191&t,v=t>>>13,w=0|g[4],x=8191&w,y=w>>>13,z=0|g[5],A=8191&z,B=z>>>13,C=0|g[6],D=8191&C,E=C>>>13,F=0|g[7],G=8191&F,H=F>>>13,I=0|g[8],J=8191&I,K=I>>>13,L=0|g[9],M=8191&L,N=L>>>13,O=0|h[0],P=8191&O,Q=O>>>13,R=0|h[1],S=8191&R,T=R>>>13,U=0|h[2],V=8191&U,W=U>>>13,X=0|h[3],Y=8191&X,Z=X>>>13,$=0|h[4],_=8191&$,aa=$>>>13,ba=0|h[5],ca=8191&ba,da=ba>>>13,ea=0|h[6],fa=8191&ea,ga=ea>>>13,ha=0|h[7],ia=8191&ha,ja=ha>>>13,ka=0|h[8],la=8191&ka,ma=ka>>>13,na=0|h[9],oa=8191&na,pa=na>>>13;c.negative=a.negative^b.negative,c.length=19,d=Math.imul(l,P),e=Math.imul(l,Q),e=e+Math.imul(m,P)|0,f=Math.imul(m,Q);var qa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(qa>>>26)|0,qa&=67108863,d=Math.imul(o,P),e=Math.imul(o,Q),e=e+Math.imul(p,P)|0,f=Math.imul(p,Q),d=d+Math.imul(l,S)|0,e=e+Math.imul(l,T)|0,e=e+Math.imul(m,S)|0,f=f+Math.imul(m,T)|0;var ra=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ra>>>26)|0,ra&=67108863,d=Math.imul(r,P),e=Math.imul(r,Q),e=e+Math.imul(s,P)|0,f=Math.imul(s,Q),d=d+Math.imul(o,S)|0,e=e+Math.imul(o,T)|0,e=e+Math.imul(p,S)|0,f=f+Math.imul(p,T)|0,d=d+Math.imul(l,V)|0,e=e+Math.imul(l,W)|0,e=e+Math.imul(m,V)|0,f=f+Math.imul(m,W)|0;var sa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(sa>>>26)|0,sa&=67108863,d=Math.imul(u,P),e=Math.imul(u,Q),e=e+Math.imul(v,P)|0,f=Math.imul(v,Q),d=d+Math.imul(r,S)|0,e=e+Math.imul(r,T)|0,e=e+Math.imul(s,S)|0,f=f+Math.imul(s,T)|0,d=d+Math.imul(o,V)|0,e=e+Math.imul(o,W)|0,e=e+Math.imul(p,V)|0,f=f+Math.imul(p,W)|0,d=d+Math.imul(l,Y)|0,e=e+Math.imul(l,Z)|0,e=e+Math.imul(m,Y)|0,f=f+Math.imul(m,Z)|0;var ta=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ta>>>26)|0,ta&=67108863,d=Math.imul(x,P),e=Math.imul(x,Q),e=e+Math.imul(y,P)|0,f=Math.imul(y,Q),d=d+Math.imul(u,S)|0,e=e+Math.imul(u,T)|0,e=e+Math.imul(v,S)|0,f=f+Math.imul(v,T)|0,d=d+Math.imul(r,V)|0,e=e+Math.imul(r,W)|0,e=e+Math.imul(s,V)|0,f=f+Math.imul(s,W)|0,d=d+Math.imul(o,Y)|0,e=e+Math.imul(o,Z)|0,e=e+Math.imul(p,Y)|0,f=f+Math.imul(p,Z)|0,d=d+Math.imul(l,_)|0,e=e+Math.imul(l,aa)|0,e=e+Math.imul(m,_)|0,f=f+Math.imul(m,aa)|0;var ua=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ua>>>26)|0,ua&=67108863,d=Math.imul(A,P),e=Math.imul(A,Q),e=e+Math.imul(B,P)|0,f=Math.imul(B,Q),d=d+Math.imul(x,S)|0,e=e+Math.imul(x,T)|0,e=e+Math.imul(y,S)|0,f=f+Math.imul(y,T)|0,d=d+Math.imul(u,V)|0,e=e+Math.imul(u,W)|0,e=e+Math.imul(v,V)|0,f=f+Math.imul(v,W)|0,d=d+Math.imul(r,Y)|0,e=e+Math.imul(r,Z)|0,e=e+Math.imul(s,Y)|0,f=f+Math.imul(s,Z)|0,d=d+Math.imul(o,_)|0,e=e+Math.imul(o,aa)|0,e=e+Math.imul(p,_)|0,f=f+Math.imul(p,aa)|0,d=d+Math.imul(l,ca)|0,e=e+Math.imul(l,da)|0,e=e+Math.imul(m,ca)|0,f=f+Math.imul(m,da)|0;var va=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(va>>>26)|0,va&=67108863,d=Math.imul(D,P),e=Math.imul(D,Q),e=e+Math.imul(E,P)|0,f=Math.imul(E,Q),d=d+Math.imul(A,S)|0,e=e+Math.imul(A,T)|0,e=e+Math.imul(B,S)|0,f=f+Math.imul(B,T)|0,d=d+Math.imul(x,V)|0,e=e+Math.imul(x,W)|0,e=e+Math.imul(y,V)|0,f=f+Math.imul(y,W)|0,d=d+Math.imul(u,Y)|0,e=e+Math.imul(u,Z)|0,e=e+Math.imul(v,Y)|0,f=f+Math.imul(v,Z)|0,d=d+Math.imul(r,_)|0,e=e+Math.imul(r,aa)|0,e=e+Math.imul(s,_)|0,f=f+Math.imul(s,aa)|0,d=d+Math.imul(o,ca)|0,e=e+Math.imul(o,da)|0,e=e+Math.imul(p,ca)|0,f=f+Math.imul(p,da)|0,d=d+Math.imul(l,fa)|0,e=e+Math.imul(l,ga)|0,e=e+Math.imul(m,fa)|0,f=f+Math.imul(m,ga)|0;var wa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(wa>>>26)|0,wa&=67108863,d=Math.imul(G,P),e=Math.imul(G,Q),e=e+Math.imul(H,P)|0,f=Math.imul(H,Q),d=d+Math.imul(D,S)|0,e=e+Math.imul(D,T)|0,e=e+Math.imul(E,S)|0,f=f+Math.imul(E,T)|0,d=d+Math.imul(A,V)|0,e=e+Math.imul(A,W)|0,e=e+Math.imul(B,V)|0,f=f+Math.imul(B,W)|0,d=d+Math.imul(x,Y)|0,e=e+Math.imul(x,Z)|0,e=e+Math.imul(y,Y)|0,f=f+Math.imul(y,Z)|0,d=d+Math.imul(u,_)|0,e=e+Math.imul(u,aa)|0,e=e+Math.imul(v,_)|0,f=f+Math.imul(v,aa)|0,d=d+Math.imul(r,ca)|0,e=e+Math.imul(r,da)|0,e=e+Math.imul(s,ca)|0,f=f+Math.imul(s,da)|0,d=d+Math.imul(o,fa)|0,e=e+Math.imul(o,ga)|0,e=e+Math.imul(p,fa)|0,f=f+Math.imul(p,ga)|0,d=d+Math.imul(l,ia)|0,e=e+Math.imul(l,ja)|0,e=e+Math.imul(m,ia)|0,f=f+Math.imul(m,ja)|0;var xa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(xa>>>26)|0,xa&=67108863,d=Math.imul(J,P),e=Math.imul(J,Q),e=e+Math.imul(K,P)|0,f=Math.imul(K,Q),d=d+Math.imul(G,S)|0,e=e+Math.imul(G,T)|0,e=e+Math.imul(H,S)|0,f=f+Math.imul(H,T)|0,d=d+Math.imul(D,V)|0,e=e+Math.imul(D,W)|0,e=e+Math.imul(E,V)|0,f=f+Math.imul(E,W)|0,d=d+Math.imul(A,Y)|0,e=e+Math.imul(A,Z)|0,e=e+Math.imul(B,Y)|0,f=f+Math.imul(B,Z)|0,d=d+Math.imul(x,_)|0,e=e+Math.imul(x,aa)|0,e=e+Math.imul(y,_)|0,f=f+Math.imul(y,aa)|0,d=d+Math.imul(u,ca)|0,e=e+Math.imul(u,da)|0,e=e+Math.imul(v,ca)|0,f=f+Math.imul(v,da)|0,d=d+Math.imul(r,fa)|0,e=e+Math.imul(r,ga)|0,e=e+Math.imul(s,fa)|0,f=f+Math.imul(s,ga)|0,d=d+Math.imul(o,ia)|0,e=e+Math.imul(o,ja)|0,e=e+Math.imul(p,ia)|0,f=f+Math.imul(p,ja)|0,d=d+Math.imul(l,la)|0,e=e+Math.imul(l,ma)|0,e=e+Math.imul(m,la)|0,f=f+Math.imul(m,ma)|0;var ya=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ya>>>26)|0,ya&=67108863,d=Math.imul(M,P),e=Math.imul(M,Q),e=e+Math.imul(N,P)|0,f=Math.imul(N,Q),d=d+Math.imul(J,S)|0,e=e+Math.imul(J,T)|0,e=e+Math.imul(K,S)|0,f=f+Math.imul(K,T)|0,d=d+Math.imul(G,V)|0,e=e+Math.imul(G,W)|0,e=e+Math.imul(H,V)|0,f=f+Math.imul(H,W)|0,d=d+Math.imul(D,Y)|0,e=e+Math.imul(D,Z)|0,e=e+Math.imul(E,Y)|0,f=f+Math.imul(E,Z)|0,d=d+Math.imul(A,_)|0,e=e+Math.imul(A,aa)|0,e=e+Math.imul(B,_)|0,f=f+Math.imul(B,aa)|0,d=d+Math.imul(x,ca)|0,e=e+Math.imul(x,da)|0,e=e+Math.imul(y,ca)|0,f=f+Math.imul(y,da)|0,d=d+Math.imul(u,fa)|0,e=e+Math.imul(u,ga)|0,e=e+Math.imul(v,fa)|0,f=f+Math.imul(v,ga)|0,d=d+Math.imul(r,ia)|0,e=e+Math.imul(r,ja)|0,e=e+Math.imul(s,ia)|0,f=f+Math.imul(s,ja)|0,d=d+Math.imul(o,la)|0,e=e+Math.imul(o,ma)|0,e=e+Math.imul(p,la)|0,f=f+Math.imul(p,ma)|0,d=d+Math.imul(l,oa)|0,e=e+Math.imul(l,pa)|0,e=e+Math.imul(m,oa)|0,f=f+Math.imul(m,pa)|0;var za=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(za>>>26)|0,za&=67108863,d=Math.imul(M,S),e=Math.imul(M,T),e=e+Math.imul(N,S)|0,f=Math.imul(N,T),d=d+Math.imul(J,V)|0,e=e+Math.imul(J,W)|0,e=e+Math.imul(K,V)|0,f=f+Math.imul(K,W)|0,d=d+Math.imul(G,Y)|0,e=e+Math.imul(G,Z)|0,e=e+Math.imul(H,Y)|0,f=f+Math.imul(H,Z)|0,d=d+Math.imul(D,_)|0,e=e+Math.imul(D,aa)|0,e=e+Math.imul(E,_)|0,f=f+Math.imul(E,aa)|0,d=d+Math.imul(A,ca)|0,e=e+Math.imul(A,da)|0,e=e+Math.imul(B,ca)|0,f=f+Math.imul(B,da)|0,d=d+Math.imul(x,fa)|0,e=e+Math.imul(x,ga)|0,e=e+Math.imul(y,fa)|0,f=f+Math.imul(y,ga)|0,d=d+Math.imul(u,ia)|0,e=e+Math.imul(u,ja)|0,e=e+Math.imul(v,ia)|0,f=f+Math.imul(v,ja)|0,d=d+Math.imul(r,la)|0,e=e+Math.imul(r,ma)|0,e=e+Math.imul(s,la)|0,f=f+Math.imul(s,ma)|0,d=d+Math.imul(o,oa)|0,e=e+Math.imul(o,pa)|0,e=e+Math.imul(p,oa)|0,f=f+Math.imul(p,pa)|0;var Aa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,d=Math.imul(M,V),e=Math.imul(M,W),e=e+Math.imul(N,V)|0,f=Math.imul(N,W),d=d+Math.imul(J,Y)|0,e=e+Math.imul(J,Z)|0,e=e+Math.imul(K,Y)|0,f=f+Math.imul(K,Z)|0,d=d+Math.imul(G,_)|0,e=e+Math.imul(G,aa)|0,e=e+Math.imul(H,_)|0,f=f+Math.imul(H,aa)|0,d=d+Math.imul(D,ca)|0,e=e+Math.imul(D,da)|0,e=e+Math.imul(E,ca)|0,f=f+Math.imul(E,da)|0,d=d+Math.imul(A,fa)|0,e=e+Math.imul(A,ga)|0,e=e+Math.imul(B,fa)|0,f=f+Math.imul(B,ga)|0,d=d+Math.imul(x,ia)|0,e=e+Math.imul(x,ja)|0,e=e+Math.imul(y,ia)|0,f=f+Math.imul(y,ja)|0,d=d+Math.imul(u,la)|0,e=e+Math.imul(u,ma)|0,e=e+Math.imul(v,la)|0,f=f+Math.imul(v,ma)|0,d=d+Math.imul(r,oa)|0,e=e+Math.imul(r,pa)|0,e=e+Math.imul(s,oa)|0,f=f+Math.imul(s,pa)|0;var Ba=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,d=Math.imul(M,Y),e=Math.imul(M,Z),e=e+Math.imul(N,Y)|0,f=Math.imul(N,Z),d=d+Math.imul(J,_)|0,e=e+Math.imul(J,aa)|0,e=e+Math.imul(K,_)|0,f=f+Math.imul(K,aa)|0,d=d+Math.imul(G,ca)|0,e=e+Math.imul(G,da)|0,e=e+Math.imul(H,ca)|0,f=f+Math.imul(H,da)|0,d=d+Math.imul(D,fa)|0,e=e+Math.imul(D,ga)|0,e=e+Math.imul(E,fa)|0,f=f+Math.imul(E,ga)|0,d=d+Math.imul(A,ia)|0,e=e+Math.imul(A,ja)|0,e=e+Math.imul(B,ia)|0,f=f+Math.imul(B,ja)|0,d=d+Math.imul(x,la)|0,e=e+Math.imul(x,ma)|0,e=e+Math.imul(y,la)|0,f=f+Math.imul(y,ma)|0,d=d+Math.imul(u,oa)|0,e=e+Math.imul(u,pa)|0,e=e+Math.imul(v,oa)|0,f=f+Math.imul(v,pa)|0;var Ca=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,d=Math.imul(M,_),e=Math.imul(M,aa),e=e+Math.imul(N,_)|0,f=Math.imul(N,aa),d=d+Math.imul(J,ca)|0,e=e+Math.imul(J,da)|0,e=e+Math.imul(K,ca)|0,f=f+Math.imul(K,da)|0,d=d+Math.imul(G,fa)|0,e=e+Math.imul(G,ga)|0,e=e+Math.imul(H,fa)|0,f=f+Math.imul(H,ga)|0,d=d+Math.imul(D,ia)|0,e=e+Math.imul(D,ja)|0,e=e+Math.imul(E,ia)|0,f=f+Math.imul(E,ja)|0,d=d+Math.imul(A,la)|0,e=e+Math.imul(A,ma)|0,e=e+Math.imul(B,la)|0,f=f+Math.imul(B,ma)|0,d=d+Math.imul(x,oa)|0,e=e+Math.imul(x,pa)|0,e=e+Math.imul(y,oa)|0,f=f+Math.imul(y,pa)|0;var Da=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Da>>>26)|0,Da&=67108863,d=Math.imul(M,ca),e=Math.imul(M,da),e=e+Math.imul(N,ca)|0,f=Math.imul(N,da),d=d+Math.imul(J,fa)|0,e=e+Math.imul(J,ga)|0,e=e+Math.imul(K,fa)|0,f=f+Math.imul(K,ga)|0,d=d+Math.imul(G,ia)|0,e=e+Math.imul(G,ja)|0,e=e+Math.imul(H,ia)|0,f=f+Math.imul(H,ja)|0,d=d+Math.imul(D,la)|0,e=e+Math.imul(D,ma)|0,e=e+Math.imul(E,la)|0,f=f+Math.imul(E,ma)|0,d=d+Math.imul(A,oa)|0,e=e+Math.imul(A,pa)|0,e=e+Math.imul(B,oa)|0,f=f+Math.imul(B,pa)|0;var Ea=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,d=Math.imul(M,fa),e=Math.imul(M,ga),e=e+Math.imul(N,fa)|0,f=Math.imul(N,ga),d=d+Math.imul(J,ia)|0,e=e+Math.imul(J,ja)|0,e=e+Math.imul(K,ia)|0,f=f+Math.imul(K,ja)|0,d=d+Math.imul(G,la)|0,e=e+Math.imul(G,ma)|0,e=e+Math.imul(H,la)|0,f=f+Math.imul(H,ma)|0,d=d+Math.imul(D,oa)|0,e=e+Math.imul(D,pa)|0,e=e+Math.imul(E,oa)|0,f=f+Math.imul(E,pa)|0;var Fa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,d=Math.imul(M,ia),e=Math.imul(M,ja),e=e+Math.imul(N,ia)|0,f=Math.imul(N,ja),d=d+Math.imul(J,la)|0,e=e+Math.imul(J,ma)|0,e=e+Math.imul(K,la)|0,f=f+Math.imul(K,ma)|0,d=d+Math.imul(G,oa)|0,e=e+Math.imul(G,pa)|0,e=e+Math.imul(H,oa)|0,f=f+Math.imul(H,pa)|0;var Ga=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,d=Math.imul(M,la),e=Math.imul(M,ma),e=e+Math.imul(N,la)|0,f=Math.imul(N,ma),d=d+Math.imul(J,oa)|0,e=e+Math.imul(J,pa)|0,e=e+Math.imul(K,oa)|0,f=f+Math.imul(K,pa)|0;var Ha=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,d=Math.imul(M,oa),e=Math.imul(M,pa),e=e+Math.imul(N,oa)|0,f=Math.imul(N,pa);var Ia=(j+d|0)+((8191&e)<<13)|0;return j=(f+(e>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,i[0]=qa,i[1]=ra,i[2]=sa,i[3]=ta,i[4]=ua,i[5]=va,i[6]=wa,i[7]=xa,i[8]=ya,i[9]=za,i[10]=Aa,i[11]=Ba,i[12]=Ca,i[13]=Da,i[14]=Ea,i[15]=Fa,i[16]=Ga,i[17]=Ha,i[18]=Ia,0!==j&&(i[19]=j,c.length++),c};Math.imul||(z=j),f.prototype.mulTo=function(a,b){var c,d=this.length+a.length;return c=10===this.length&&10===a.length?z(this,a,b):d<63?j(this,a,b):d<1024?k(this,a,b):l(this,a,b)},m.prototype.makeRBT=function(a){for(var b=new Array(a),c=f.prototype._countBits(a)-1,d=0;d>=1;return d},m.prototype.permute=function(a,b,c,d,e,f){for(var g=0;g>>=1)e++;return 1<>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return 0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){return this.clone().imuln(a)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(a){var b=i(a);if(0===b.length)return new f(1);for(var c=this,d=0;d=0);var b,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){var g=0;for(b=0;b>>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=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<g)for(this.length-=g,j=0;j=0&&(0!==k||j>=e);j--){var l=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&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){return d(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){return this.clone().ishln(a)},f.prototype.ushln=function(a){return this.clone().iushln(a)},f.prototype.shrn=function(a){return this.clone().ishrn(a)},f.prototype.ushrn=function(a){return this.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26,e=1<=0);var b=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){var e=67108863^67108863>>>b<=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},f.prototype.isubn=function(a){if(d("number"==typeof a),d(a<67108864),a<0)return this.iaddn(-a);if(0!==this.negative)return this.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;else for(var b=0;b>26)-(i/67108864|0),this.words[e+c]=67108863&g}for(;e>26,this.words[e+c]=67108863&g;if(0===h)return this.strip();for(d(h===-1),h=0,e=0;e>26,this.words[e]=67108863&g;return this.negative=1,this.strip()},f.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),e=a,g=0|e.words[e.length-1],h=this._countBits(g);c=26-h,0!==c&&(e=e.ushln(c),d.iushln(c),g=0|e.words[e.length-1]);var i,j=d.length-e.length;if("mod"!==b){i=new f(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k=0;m--){var n=67108864*(0|d.words[e.length+m])+(0|d.words[e.length+m-1]);for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(e,n,m);0!==d.negative;)n--,d.negative=0,d._ishlnsubmul(e,1,m),d.isZero()||(d.negative^=1);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.iushrn(c),{div:i||null,mod:d}},f.prototype.divmod=function(a,b,c){if(d(!a.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var e,g,h;return 0!==this.negative&&0===a.negative?(h=this.neg().divmod(a,b),"mod"!==b&&(e=h.div.neg()),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.iadd(a)),{div:e,mod:g}):0===this.negative&&0!==a.negative?(h=this.divmod(a.neg(),b),"mod"!==b&&(e=h.div.neg()),{div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new f(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new f(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new f(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){return this.divmod(a,"div",!1).div},f.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){var b=this.divmod(a);if(b.mod.isZero())return b.div;var c=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);return f<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(var b=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;return c},f.prototype.idivn=function(a){d(a<=67108863);for(var b=0,c=this.length-1;c>=0;c--){var e=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}return this.strip()},f.prototype.divn=function(a){return this.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=new f(0),i=new f(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(var k=c.clone(),l=b.clone();!b.isZero();){for(var m=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-- >0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(var o=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-- >0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(var i=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-- >0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(var k=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}var m;return m=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var b=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(var d=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);var e=b.cmp(c);if(e<0){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.iushln(d)},f.prototype.invm=function(a){return this.egcd(a).a.umod(a)},f.prototype.isEven=function(){return 0===(1&this.words[0])},f.prototype.isOdd=function(){return 1===(1&this.words[0])},f.prototype.andln=function(a){return this.words[0]&a},f.prototype.bincn=function(a){d("number"==typeof a);var b=a%26,c=(a-b)/26,e=1<>>26,h&=67108863,this.words[g]=h}return 0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){var b=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return 1;this.strip();var c;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");var e=0|this.words[0];c=e===a?0:ea.length)return 1;if(this.length=0;c--){var d=0|this.words[c],e=0|a.words[c];if(d!==e){de&&(b=1);break}}return b},f.prototype.gtn=function(a){return 1===this.cmpn(a)},f.prototype.gt=function(a){return 1===this.cmp(a)},f.prototype.gten=function(a){return this.cmpn(a)>=0},f.prototype.gte=function(a){return this.cmp(a)>=0},f.prototype.ltn=function(a){return this.cmpn(a)===-1},f.prototype.lt=function(a){return this.cmp(a)===-1},f.prototype.lten=function(a){return this.cmpn(a)<=0},f.prototype.lte=function(a){return this.cmp(a)<=0},f.prototype.eqn=function(a){return 0===this.cmpn(a)},f.prototype.eq=function(a){return 0===this.cmp(a)},f.red=function(a){return new s(a)},f.prototype.toRed=function(a){return d(!this.red,"Already a number in reduction context"),d(0===this.negative,"red works only with positives"),a.convertTo(this)._forceRed(a)},f.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(a){return this.red=a,this},f.prototype.forceRed=function(a){return d(!this.red,"Already a number in reduction context"),this._forceRed(a)},f.prototype.redAdd=function(a){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},f.prototype.redIAdd=function(a){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},f.prototype.redSub=function(a){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},f.prototype.redISub=function(a){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},f.prototype.redShl=function(a){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},f.prototype.redMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},f.prototype.redIMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},f.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(a){return d(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var a=new f(null);return a.words=new Array(Math.ceil(this.n/13)),a},n.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b0?c.isub(this.p):c.strip(),c},n.prototype.split=function(a,b){a.iushrn(this.n,0,b)},n.prototype.imulK=function(a){return a.imul(this.k)},e(o,n),o.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;e>>22,f=g}f>>>=22,a.words[e-10]=f,0===f&&a.length>10?a.length-=10:a.length-=9},o.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b=0,c=0;c>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},f._prime=function B(a){if(A[a])return A[a];var B;if("k256"===a)B=new o;else if("p224"===a)B=new p;else if("p192"===a)B=new q;else{if("p25519"!==a)throw new Error("Unknown prime "+a);B=new r}return A[a]=B,B},s.prototype._verify1=function(a){d(0===a.negative,"red works only with positives"),d(a.red,"red works only with red numbers")},s.prototype._verify2=function(a,b){d(0===(a.negative|b.negative),"red works only with positives"),d(a.red&&a.red===b.red,"red works only with red numbers")},s.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:8}],7:[function(a,b,c){var d=a("../../utils").randomBytes;b.exports=function(a){return d(a)}},{"../../utils":65}],8:[function(a,b,c){},{}],9:[function(a,b,c){"use strict";var d=c;d.version=a("../package.json").version,d.utils=a("./elliptic/utils"),d.rand=a("brorand"),d.hmacDRBG=a("./elliptic/hmac-drbg"),d.curve=a("./elliptic/curve"),d.curves=a("./elliptic/curves"),d.ec=a("./elliptic/ec"),d.eddsa=a("./elliptic/eddsa")},{"../package.json":23,"./elliptic/curve":12,"./elliptic/curves":15,"./elliptic/ec":16,"./elliptic/eddsa":19,"./elliptic/hmac-drbg":20,"./elliptic/utils":22,brorand:7}],10:[function(a,b,c){"use strict";function d(a,b){this.type=a,this.p=new f(b.p,16),this.red=b.prime?f.red(b.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=b.n&&new f(b.n,16),this.g=b.g&&this.pointFromJSON(b.g,b.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function e(a,b){this.curve=a,this.type=b,this.precomputed=null}var f=a("bn.js"),g=a("../../elliptic"),h=g.utils,i=h.getNAF,j=h.getJSF,k=h.assert;b.exports=d,d.prototype.point=function(){throw new Error("Not implemented")},d.prototype.validate=function(){throw new Error("Not implemented")},d.prototype._fixedNafMul=function(a,b){k(a.precomputed);var c=a._getDoubles(),d=i(b,1),e=(1<=g;b--)h=(h<<1)+d[b];f.push(h)}for(var j=this.jpoint(null,null,null),l=this.jpoint(null,null,null),m=e;m>0;m--){for(var g=0;g=0;h--){for(var b=0;h>=0&&0===f[h];h--)b++;if(h>=0&&b++,g=g.dblp(b),h<0)break;var j=f[h];k(0!==j),g="affine"===a.type?j>0?g.mixedAdd(e[j-1>>1]):g.mixedAdd(e[-j-1>>1].neg()):j>0?g.add(e[j-1>>1]):g.add(e[-j-1>>1].neg())}return"affine"===a.type?g.toP():g},d.prototype._wnafMulAdd=function(a,b,c,d,e){for(var f=this._wnafT1,g=this._wnafT2,h=this._wnafT3,k=0,l=0;l=1;l-=2){var o=l-1,p=l;if(1===f[o]&&1===f[p]){var q=[b[o],null,null,b[p]];0===b[o].y.cmp(b[p].y)?(q[1]=b[o].add(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg())):0===b[o].y.cmp(b[p].y.redNeg())?(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].add(b[p].neg())):(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg()));var r=[-3,-1,-5,-7,0,7,5,1,3],s=j(c[o],c[p]);k=Math.max(s[0].length,k),h[o]=new Array(k),h[p]=new Array(k);for(var t=0;t=0;l--){for(var y=0;l>=0;){for(var z=!0,t=0;t=0&&y++,w=w.dblp(y),l<0)break;for(var t=0;t0?m=g[t][A-1>>1]:A<0&&(m=g[t][-A-1>>1].neg()),w="affine"===m.type?w.mixedAdd(m):w.add(m))}}for(var l=0;l=Math.ceil((a.bitLength()+1)/b.step)},e.prototype._getDoubles=function(a,b){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],d=this,e=0;e=0&&(f=b,g=c),d.negative&&(d=d.neg(),e=e.neg()),f.negative&&(f=f.neg(),g=g.neg()),[{a:d,b:e},{a:f,b:g}]},d.prototype._endoSplit=function(a){var b=this.endo.basis,c=b[0],d=b[1],e=d.b.mul(a).divRound(this.n),f=c.b.neg().mul(a).divRound(this.n),g=e.mul(c.a),h=f.mul(d.a),i=e.mul(c.b),j=f.mul(d.b),k=a.sub(g).sub(h),l=i.add(j).neg();return{k1:k,k2:l}},d.prototype.pointFromX=function(a,b){a=new i(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr().redMul(a).redIAdd(a.redMul(this.a)).redIAdd(this.b),d=c.redSqrt();if(0!==d.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var e=d.fromRed().isOdd();return(b&&!e||!b&&e)&&(d=d.redNeg()),this.point(a,d)},d.prototype.validate=function(a){if(a.inf)return!0;var b=a.x,c=a.y,d=this.a.redMul(b),e=b.redSqr().redMul(b).redIAdd(d).redIAdd(this.b);return 0===c.redSqr().redISub(e).cmpn(0)},d.prototype._endoWnafMulAdd=function(a,b,c){for(var d=this._endoWnafT1,e=this._endoWnafT2,f=0;f":""},e.prototype.isInfinity=function(){return this.inf},e.prototype.add=function(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(0===this.x.cmp(a.x))return this.curve.point(null,null);var b=this.y.redSub(a.y);0!==b.cmpn(0)&&(b=b.redMul(this.x.redSub(a.x).redInvm()));var c=b.redSqr().redISub(this.x).redISub(a.x),d=b.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,d)},e.prototype.dbl=function(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(0===a.cmpn(0))return this.curve.point(null,null);var b=this.curve.a,c=this.x.redSqr(),d=a.redInvm(),e=c.redAdd(c).redIAdd(c).redIAdd(b).redMul(d),f=e.redSqr().redISub(this.x.redAdd(this.x)),g=e.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,g)},e.prototype.getX=function(){return this.x.fromRed()},e.prototype.getY=function(){return this.y.fromRed()},e.prototype.mul=function(a){return a=new i(a,16),this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)},e.prototype.mulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e):this.curve._wnafMulAdd(1,d,e,2)},e.prototype.jmulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e,!0):this.curve._wnafMulAdd(1,d,e,2,!0)},e.prototype.eq=function(a){return this===a||this.inf===a.inf&&(this.inf||0===this.x.cmp(a.x)&&0===this.y.cmp(a.y))},e.prototype.neg=function(a){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(a&&this.precomputed){var c=this.precomputed,d=function(a){return a.neg()};b.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(d)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(d)}}}return b},e.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a},j(f,k.BasePoint),d.prototype.jpoint=function(a,b,c){return new f(this,a,b,c)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),b=a.redSqr(),c=this.x.redMul(b),d=this.y.redMul(b).redMul(a);return this.curve.point(c,d)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.z.redSqr(),c=this.z.redSqr(),d=this.x.redMul(b),e=a.x.redMul(c),f=this.y.redMul(b.redMul(a.z)),g=a.y.redMul(c.redMul(this.z)),h=d.redSub(e),i=f.redSub(g);if(0===h.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var j=h.redSqr(),k=j.redMul(h),l=d.redMul(j),m=i.redSqr().redIAdd(k).redISub(l).redISub(l),n=i.redMul(l.redISub(m)).redISub(f.redMul(k)),o=this.z.redMul(a.z).redMul(h);return this.curve.jpoint(m,n,o)},f.prototype.mixedAdd=function(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var b=this.z.redSqr(),c=this.x,d=a.x.redMul(b),e=this.y,f=a.y.redMul(b).redMul(this.z),g=c.redSub(d),h=e.redSub(f);if(0===g.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=g.redSqr(),j=i.redMul(g),k=c.redMul(i),l=h.redSqr().redIAdd(j).redISub(k).redISub(k),m=h.redMul(k.redISub(l)).redISub(e.redMul(j)),n=this.z.redMul(g); +f>>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return 0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){return this.clone().imuln(a)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(a){var b=i(a);if(0===b.length)return new f(1);for(var c=this,d=0;d=0);var b,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){var g=0;for(b=0;b>>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=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<g)for(this.length-=g,j=0;j=0&&(0!==k||j>=e);j--){var l=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&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){return d(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){return this.clone().ishln(a)},f.prototype.ushln=function(a){return this.clone().iushln(a)},f.prototype.shrn=function(a){return this.clone().ishrn(a)},f.prototype.ushrn=function(a){return this.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26,e=1<=0);var b=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){var e=67108863^67108863>>>b<=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},f.prototype.isubn=function(a){if(d("number"==typeof a),d(a<67108864),a<0)return this.iaddn(-a);if(0!==this.negative)return this.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;else for(var b=0;b>26)-(i/67108864|0),this.words[e+c]=67108863&g}for(;e>26,this.words[e+c]=67108863&g;if(0===h)return this.strip();for(d(h===-1),h=0,e=0;e>26,this.words[e]=67108863&g;return this.negative=1,this.strip()},f.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),e=a,g=0|e.words[e.length-1],h=this._countBits(g);c=26-h,0!==c&&(e=e.ushln(c),d.iushln(c),g=0|e.words[e.length-1]);var i,j=d.length-e.length;if("mod"!==b){i=new f(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k=0;m--){var n=67108864*(0|d.words[e.length+m])+(0|d.words[e.length+m-1]);for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(e,n,m);0!==d.negative;)n--,d.negative=0,d._ishlnsubmul(e,1,m),d.isZero()||(d.negative^=1);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.iushrn(c),{div:i||null,mod:d}},f.prototype.divmod=function(a,b,c){if(d(!a.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var e,g,h;return 0!==this.negative&&0===a.negative?(h=this.neg().divmod(a,b),"mod"!==b&&(e=h.div.neg()),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.iadd(a)),{div:e,mod:g}):0===this.negative&&0!==a.negative?(h=this.divmod(a.neg(),b),"mod"!==b&&(e=h.div.neg()),{div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new f(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new f(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new f(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){return this.divmod(a,"div",!1).div},f.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){var b=this.divmod(a);if(b.mod.isZero())return b.div;var c=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);return f<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(var b=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;return c},f.prototype.idivn=function(a){d(a<=67108863);for(var b=0,c=this.length-1;c>=0;c--){var e=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}return this.strip()},f.prototype.divn=function(a){return this.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=new f(0),i=new f(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(var k=c.clone(),l=b.clone();!b.isZero();){for(var m=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-- >0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(var o=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-- >0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(var i=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-- >0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(var k=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}var m;return m=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var b=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(var d=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);var e=b.cmp(c);if(e<0){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.iushln(d)},f.prototype.invm=function(a){return this.egcd(a).a.umod(a)},f.prototype.isEven=function(){return 0===(1&this.words[0])},f.prototype.isOdd=function(){return 1===(1&this.words[0])},f.prototype.andln=function(a){return this.words[0]&a},f.prototype.bincn=function(a){d("number"==typeof a);var b=a%26,c=(a-b)/26,e=1<>>26,h&=67108863,this.words[g]=h}return 0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){var b=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return 1;this.strip();var c;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");var e=0|this.words[0];c=e===a?0:ea.length)return 1;if(this.length=0;c--){var d=0|this.words[c],e=0|a.words[c];if(d!==e){de&&(b=1);break}}return b},f.prototype.gtn=function(a){return 1===this.cmpn(a)},f.prototype.gt=function(a){return 1===this.cmp(a)},f.prototype.gten=function(a){return this.cmpn(a)>=0},f.prototype.gte=function(a){return this.cmp(a)>=0},f.prototype.ltn=function(a){return this.cmpn(a)===-1},f.prototype.lt=function(a){return this.cmp(a)===-1},f.prototype.lten=function(a){return this.cmpn(a)<=0},f.prototype.lte=function(a){return this.cmp(a)<=0},f.prototype.eqn=function(a){return 0===this.cmpn(a)},f.prototype.eq=function(a){return 0===this.cmp(a)},f.red=function(a){return new s(a)},f.prototype.toRed=function(a){return d(!this.red,"Already a number in reduction context"),d(0===this.negative,"red works only with positives"),a.convertTo(this)._forceRed(a)},f.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(a){return this.red=a,this},f.prototype.forceRed=function(a){return d(!this.red,"Already a number in reduction context"),this._forceRed(a)},f.prototype.redAdd=function(a){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},f.prototype.redIAdd=function(a){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},f.prototype.redSub=function(a){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},f.prototype.redISub=function(a){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},f.prototype.redShl=function(a){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},f.prototype.redMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},f.prototype.redIMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},f.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(a){return d(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var a=new f(null);return a.words=new Array(Math.ceil(this.n/13)),a},n.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b0?c.isub(this.p):c.strip(),c},n.prototype.split=function(a,b){a.iushrn(this.n,0,b)},n.prototype.imulK=function(a){return a.imul(this.k)},e(o,n),o.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;e>>22,f=g}f>>>=22,a.words[e-10]=f,0===f&&a.length>10?a.length-=10:a.length-=9},o.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b=0,c=0;c>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},f._prime=function B(a){if(A[a])return A[a];var B;if("k256"===a)B=new o;else if("p224"===a)B=new p;else if("p192"===a)B=new q;else{if("p25519"!==a)throw new Error("Unknown prime "+a);B=new r}return A[a]=B,B},s.prototype._verify1=function(a){d(0===a.negative,"red works only with positives"),d(a.red,"red works only with red numbers")},s.prototype._verify2=function(a,b){d(0===(a.negative|b.negative),"red works only with positives"),d(a.red&&a.red===b.red,"red works only with red numbers")},s.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:8}],7:[function(a,b,c){var d=a("../../utils").randomBytes;b.exports=function(a){return d(a)}},{"../../utils":66}],8:[function(a,b,c){},{}],9:[function(a,b,c){"use strict";var d=c;d.version=a("../package.json").version,d.utils=a("./elliptic/utils"),d.rand=a("brorand"),d.hmacDRBG=a("./elliptic/hmac-drbg"),d.curve=a("./elliptic/curve"),d.curves=a("./elliptic/curves"),d.ec=a("./elliptic/ec"),d.eddsa=a("./elliptic/eddsa")},{"../package.json":23,"./elliptic/curve":12,"./elliptic/curves":15,"./elliptic/ec":16,"./elliptic/eddsa":19,"./elliptic/hmac-drbg":20,"./elliptic/utils":22,brorand:7}],10:[function(a,b,c){"use strict";function d(a,b){this.type=a,this.p=new f(b.p,16),this.red=b.prime?f.red(b.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=b.n&&new f(b.n,16),this.g=b.g&&this.pointFromJSON(b.g,b.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function e(a,b){this.curve=a,this.type=b,this.precomputed=null}var f=a("bn.js"),g=a("../../elliptic"),h=g.utils,i=h.getNAF,j=h.getJSF,k=h.assert;b.exports=d,d.prototype.point=function(){throw new Error("Not implemented")},d.prototype.validate=function(){throw new Error("Not implemented")},d.prototype._fixedNafMul=function(a,b){k(a.precomputed);var c=a._getDoubles(),d=i(b,1),e=(1<=g;b--)h=(h<<1)+d[b];f.push(h)}for(var j=this.jpoint(null,null,null),l=this.jpoint(null,null,null),m=e;m>0;m--){for(var g=0;g=0;h--){for(var b=0;h>=0&&0===f[h];h--)b++;if(h>=0&&b++,g=g.dblp(b),h<0)break;var j=f[h];k(0!==j),g="affine"===a.type?j>0?g.mixedAdd(e[j-1>>1]):g.mixedAdd(e[-j-1>>1].neg()):j>0?g.add(e[j-1>>1]):g.add(e[-j-1>>1].neg())}return"affine"===a.type?g.toP():g},d.prototype._wnafMulAdd=function(a,b,c,d,e){for(var f=this._wnafT1,g=this._wnafT2,h=this._wnafT3,k=0,l=0;l=1;l-=2){var o=l-1,p=l;if(1===f[o]&&1===f[p]){var q=[b[o],null,null,b[p]];0===b[o].y.cmp(b[p].y)?(q[1]=b[o].add(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg())):0===b[o].y.cmp(b[p].y.redNeg())?(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].add(b[p].neg())):(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg()));var r=[-3,-1,-5,-7,0,7,5,1,3],s=j(c[o],c[p]);k=Math.max(s[0].length,k),h[o]=new Array(k),h[p]=new Array(k);for(var t=0;t=0;l--){for(var y=0;l>=0;){for(var z=!0,t=0;t=0&&y++,w=w.dblp(y),l<0)break;for(var t=0;t0?m=g[t][A-1>>1]:A<0&&(m=g[t][-A-1>>1].neg()),w="affine"===m.type?w.mixedAdd(m):w.add(m))}}for(var l=0;l=Math.ceil((a.bitLength()+1)/b.step)},e.prototype._getDoubles=function(a,b){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],d=this,e=0;e=0&&(f=b,g=c),d.negative&&(d=d.neg(),e=e.neg()),f.negative&&(f=f.neg(),g=g.neg()),[{a:d,b:e},{a:f,b:g}]},d.prototype._endoSplit=function(a){var b=this.endo.basis,c=b[0],d=b[1],e=d.b.mul(a).divRound(this.n),f=c.b.neg().mul(a).divRound(this.n),g=e.mul(c.a),h=f.mul(d.a),i=e.mul(c.b),j=f.mul(d.b),k=a.sub(g).sub(h),l=i.add(j).neg();return{k1:k,k2:l}},d.prototype.pointFromX=function(a,b){a=new i(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr().redMul(a).redIAdd(a.redMul(this.a)).redIAdd(this.b),d=c.redSqrt();if(0!==d.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var e=d.fromRed().isOdd();return(b&&!e||!b&&e)&&(d=d.redNeg()),this.point(a,d)},d.prototype.validate=function(a){if(a.inf)return!0;var b=a.x,c=a.y,d=this.a.redMul(b),e=b.redSqr().redMul(b).redIAdd(d).redIAdd(this.b);return 0===c.redSqr().redISub(e).cmpn(0)},d.prototype._endoWnafMulAdd=function(a,b,c){for(var d=this._endoWnafT1,e=this._endoWnafT2,f=0;f":""},e.prototype.isInfinity=function(){return this.inf},e.prototype.add=function(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(0===this.x.cmp(a.x))return this.curve.point(null,null);var b=this.y.redSub(a.y);0!==b.cmpn(0)&&(b=b.redMul(this.x.redSub(a.x).redInvm()));var c=b.redSqr().redISub(this.x).redISub(a.x),d=b.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,d)},e.prototype.dbl=function(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(0===a.cmpn(0))return this.curve.point(null,null);var b=this.curve.a,c=this.x.redSqr(),d=a.redInvm(),e=c.redAdd(c).redIAdd(c).redIAdd(b).redMul(d),f=e.redSqr().redISub(this.x.redAdd(this.x)),g=e.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,g)},e.prototype.getX=function(){return this.x.fromRed()},e.prototype.getY=function(){return this.y.fromRed()},e.prototype.mul=function(a){return a=new i(a,16),this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)},e.prototype.mulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e):this.curve._wnafMulAdd(1,d,e,2)},e.prototype.jmulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e,!0):this.curve._wnafMulAdd(1,d,e,2,!0)},e.prototype.eq=function(a){return this===a||this.inf===a.inf&&(this.inf||0===this.x.cmp(a.x)&&0===this.y.cmp(a.y))},e.prototype.neg=function(a){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(a&&this.precomputed){var c=this.precomputed,d=function(a){return a.neg()};b.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(d)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(d)}}}return b},e.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a},j(f,k.BasePoint),d.prototype.jpoint=function(a,b,c){return new f(this,a,b,c)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),b=a.redSqr(),c=this.x.redMul(b),d=this.y.redMul(b).redMul(a);return this.curve.point(c,d)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.z.redSqr(),c=this.z.redSqr(),d=this.x.redMul(b),e=a.x.redMul(c),f=this.y.redMul(b.redMul(a.z)),g=a.y.redMul(c.redMul(this.z)),h=d.redSub(e),i=f.redSub(g);if(0===h.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var j=h.redSqr(),k=j.redMul(h),l=d.redMul(j),m=i.redSqr().redIAdd(k).redISub(l).redISub(l),n=i.redMul(l.redISub(m)).redISub(f.redMul(k)),o=this.z.redMul(a.z).redMul(h);return this.curve.jpoint(m,n,o)},f.prototype.mixedAdd=function(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var b=this.z.redSqr(),c=this.x,d=a.x.redMul(b),e=this.y,f=a.y.redMul(b).redMul(this.z),g=c.redSub(d),h=e.redSub(f);if(0===g.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=g.redSqr(),j=i.redMul(g),k=c.redMul(i),l=h.redSqr().redIAdd(j).redISub(k).redISub(k),m=h.redMul(k.redISub(l)).redISub(e.redMul(j)),n=this.z.redMul(g); return this.curve.jpoint(l,m,n)},f.prototype.dblp=function(a){if(0===a)return this;if(this.isInfinity())return this;if(!a)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var b=this,c=0;c=0)return!1;if(c.redIAdd(e),0===this.x.cmp(c))return!0}return!1},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":9,"../curve":12,"bn.js":6,inherits:37}],15:[function(a,b,c){"use strict";function d(a){"short"===a.type?this.curve=new h.curve["short"](a):"edwards"===a.type?this.curve=new h.curve.edwards(a):this.curve=new h.curve.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function e(a,b){Object.defineProperty(f,a,{configurable:!0,enumerable:!0,get:function(){var c=new d(b);return Object.defineProperty(f,a,{configurable:!0,enumerable:!0,value:c}),c}})}var f=c,g=a("hash.js"),h=a("../elliptic"),i=h.utils.assert;f.PresetCurve=d,e("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:g.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),e("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:g.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),e("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:g.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),e("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:g.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),e("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:g.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),e("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["9"]}),e("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var j;try{j=a("./precomputed/secp256k1")}catch(k){j=void 0}e("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:g.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",j]})},{"../elliptic":9,"./precomputed/secp256k1":21,"hash.js":24}],16:[function(a,b,c){"use strict";function d(a){return this instanceof d?("string"==typeof a&&(h(f.curves.hasOwnProperty(a),"Unknown curve "+a),a=f.curves[a]),a instanceof f.curves.PresetCurve&&(a={curve:a}),this.curve=a.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=a.curve.g,this.g.precompute(a.curve.n.bitLength()+1),void(this.hash=a.hash||a.curve.hash)):new d(a)}var e=a("bn.js"),f=a("../../elliptic"),g=f.utils,h=g.assert,i=a("./key"),j=a("./signature");b.exports=d,d.prototype.keyPair=function(a){return new i(this,a)},d.prototype.keyFromPrivate=function(a,b){return i.fromPrivate(this,a,b)},d.prototype.keyFromPublic=function(a,b){return i.fromPublic(this,a,b)},d.prototype.genKeyPair=function(a){a||(a={});for(var b=new f.hmacDRBG({hash:this.hash,pers:a.pers,entropy:a.entropy||f.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),c=this.n.byteLength(),d=this.n.sub(new e(2));;){var g=new e(b.generate(c));if(!(g.cmp(d)>0))return g.iaddn(1),this.keyFromPrivate(g)}},d.prototype._truncateToN=function(a,b){var c=8*a.byteLength()-this.n.bitLength();return c>0&&(a=a.ushrn(c)),!b&&a.cmp(this.n)>=0?a.sub(this.n):a},d.prototype.sign=function(a,b,c,d){"object"==typeof c&&(d=c,c=null),d||(d={}),b=this.keyFromPrivate(b,c),a=this._truncateToN(new e(a,16));for(var g=this.n.byteLength(),h=b.getPrivate().toArray("be",g),i=a.toArray("be",g),k=new f.hmacDRBG({hash:this.hash,entropy:h,nonce:i,pers:d.pers,persEnc:d.persEnc}),l=this.n.sub(new e(1)),m=0;!0;m++){var n=d.k?d.k(m):new e(k.generate(this.n.byteLength()));if(n=this._truncateToN(n,!0),!(n.cmpn(1)<=0||n.cmp(l)>=0)){var o=this.g.mul(n);if(!o.isInfinity()){var p=o.getX(),q=p.umod(this.n);if(0!==q.cmpn(0)){var r=n.invm(this.n).mul(q.mul(b.getPrivate()).iadd(a));if(r=r.umod(this.n),0!==r.cmpn(0)){var s=(o.getY().isOdd()?1:0)|(0!==p.cmp(q)?2:0);return d.canonical&&r.cmp(this.nh)>0&&(r=this.n.sub(r),s^=1),new j({r:q,s:r,recoveryParam:s})}}}}}},d.prototype.verify=function(a,b,c,d){a=this._truncateToN(new e(a,16)),c=this.keyFromPublic(c,d),b=new j(b,"hex");var f=b.r,g=b.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;if(g.cmpn(1)<0||g.cmp(this.n)>=0)return!1;var h=g.invm(this.n),i=h.mul(a).umod(this.n),k=h.mul(f).umod(this.n);if(!this.curve._maxwellTrick){var l=this.g.mulAdd(i,c.getPublic(),k);return!l.isInfinity()&&0===l.getX().umod(this.n).cmp(f)}var l=this.g.jmulAdd(i,c.getPublic(),k);return!l.isInfinity()&&l.eqXToP(f)},d.prototype.recoverPubKey=function(a,b,c,d){h((3&c)===c,"The recovery param is more than two bits"),b=new j(b,d);var f=this.n,g=new e(a),i=b.r,k=b.s,l=1&c,m=c>>1;if(i.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");i=m?this.curve.pointFromX(i.add(this.curve.n),l):this.curve.pointFromX(i,l);var n=b.r.invm(f),o=f.sub(g).mul(n).umod(f),p=k.mul(n).umod(f);return this.g.mulAdd(o,i,p)},d.prototype.getKeyRecoveryParam=function(a,b,c,d){if(b=new j(b,d),null!==b.recoveryParam)return b.recoveryParam;for(var e=0;e<4;e++){var f;try{f=this.recoverPubKey(a,b,e)}catch(a){continue}if(f.eq(c))return e}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":9,"./key":17,"./signature":18,"bn.js":6}],17:[function(a,b,c){"use strict";function d(a,b){this.ec=a,this.priv=null,this.pub=null,b.priv&&this._importPrivate(b.priv,b.privEnc),b.pub&&this._importPublic(b.pub,b.pubEnc)}var e=a("bn.js"),f=a("../../elliptic"),g=f.utils,h=g.assert;b.exports=d,d.fromPublic=function(a,b,c){return b instanceof d?b:new d(a,{pub:b,pubEnc:c})},d.fromPrivate=function(a,b,c){return b instanceof d?b:new d(a,{priv:b,privEnc:c})},d.prototype.validate=function(){var a=this.getPublic();return a.isInfinity()?{result:!1,reason:"Invalid public key"}:a.validate()?a.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(a,b){return"string"==typeof a&&(b=a,a=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),b?this.pub.encode(b,a):this.pub},d.prototype.getPrivate=function(a){return"hex"===a?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(a,b){this.priv=new e(a,b||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(a,b){return a.x||a.y?("mont"===this.ec.curve.type?h(a.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||h(a.x&&a.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(a.x,a.y))):void(this.pub=this.ec.curve.decodePoint(a,b))},d.prototype.derive=function(a){return a.mul(this.priv).getX()},d.prototype.sign=function(a,b,c){return this.ec.sign(a,this,b,c)},d.prototype.verify=function(a,b){return this.ec.verify(a,b,this)},d.prototype.inspect=function(){return""}},{"../../elliptic":9,"bn.js":6}],18:[function(a,b,c){"use strict";function d(a,b){return a instanceof d?a:void(this._importDER(a,b)||(l(a.r&&a.s,"Signature without r or s"),this.r=new i(a.r,16),this.s=new i(a.s,16),void 0===a.recoveryParam?this.recoveryParam=null:this.recoveryParam=a.recoveryParam))}function e(){this.place=0}function f(a,b){var c=a[b.place++];if(!(128&c))return c;for(var d=15&c,e=0,f=0,g=b.place;f>>3);for(a.push(128|c);--c;)a.push(b>>>(c<<3)&255);a.push(b)}var i=a("bn.js"),j=a("../../elliptic"),k=j.utils,l=k.assert;b.exports=d,d.prototype._importDER=function(a,b){a=k.toArray(a,b);var c=new e;if(48!==a[c.place++])return!1;var d=f(a,c);if(d+c.place!==a.length)return!1;if(2!==a[c.place++])return!1;var g=f(a,c),h=a.slice(c.place,g+c.place);if(c.place+=g,2!==a[c.place++])return!1;var j=f(a,c);if(a.length!==j+c.place)return!1;var l=a.slice(c.place,j+c.place);return 0===h[0]&&128&h[1]&&(h=h.slice(1)),0===l[0]&&128&l[1]&&(l=l.slice(1)),this.r=new i(h),this.s=new i(l),this.recoveryParam=null,!0},d.prototype.toDER=function(a){var b=this.r.toArray(),c=this.s.toArray();for(128&b[0]&&(b=[0].concat(b)),128&c[0]&&(c=[0].concat(c)),b=g(b),c=g(c);!(c[0]||128&c[1]);)c=c.slice(1);var d=[2];h(d,b.length),d=d.concat(b),d.push(2),h(d,c.length);var e=d.concat(c),f=[48];return h(f,e.length),f=f.concat(e),k.encode(f,a)}},{"../../elliptic":9,"bn.js":6}],19:[function(a,b,c){arguments[4][11][0].apply(c,arguments)},{dup:11}],20:[function(a,b,c){"use strict";function d(a){if(!(this instanceof d))return new d(a);this.hash=a.hash,this.predResist=!!a.predResist,this.outLen=this.hash.outSize,this.minEntropy=a.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var b=g.toArray(a.entropy,a.entropyEnc),c=g.toArray(a.nonce,a.nonceEnc),e=g.toArray(a.pers,a.persEnc);h(b.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(b,c,e)}var e=a("hash.js"),f=a("../elliptic"),g=f.utils,h=g.assert;b.exports=d,d.prototype._init=function(a,b,c){var d=a.concat(b).concat(c);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var e=0;e=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(a.concat(c||[])),this.reseed=1},d.prototype.generate=function(a,b,c,d){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof b&&(d=c,c=b,b=null),c&&(c=g.toArray(c,d),this._update(c));for(var e=[];e.length>8,g=255&e;f?c.push(f,g):c.push(g)}return c}function e(a){return 1===a.length?"0"+a:a}function f(a){for(var b="",c=0;c=0;){var f;if(e.isOdd()){var g=e.andln(d-1);f=g>(d>>1)-1?(d>>1)-g:g,e.isubn(f)}else f=0;c.push(f);for(var h=0!==e.cmpn(0)&&0===e.andln(d-1)?b+1:1,i=1;i0||b.cmpn(-e)>0;){var f=a.andln(3)+d&3,g=b.andln(3)+e&3;3===f&&(f=-1),3===g&&(g=-1);var h;if(0===(1&f))h=0;else{var i=a.andln(7)+d&7;h=3!==i&&5!==i||2!==g?f:-f}c[0].push(h);var j;if(0===(1&g))j=0;else{var i=b.andln(7)+e&7;j=3!==i&&5!==i||2!==f?g:-g}c[1].push(j),2*d===h+1&&(d=1-d),2*e===j+1&&(e=1-e),a.iushrn(1),b.iushrn(1)}return c}function i(a,b,c){var d="_"+b;a.prototype[b]=function(){return void 0!==this[d]?this[d]:this[d]=c.call(this)}}function j(a){return"string"==typeof a?l.toArray(a,"hex"):a}function k(a){return new m(a,"hex","le")}var l=c,m=a("bn.js");l.assert=function(a,b){if(!a)throw new Error(b||"Assertion failed")},l.toArray=d,l.zero2=e,l.toHex=f,l.encode=function(a,b){return"hex"===b?f(a):a},l.getNAF=g,l.getJSF=h,l.cachedProperty=i,l.parseBytes=j,l.intFromLE=k},{"bn.js":6}],23:[function(a,b,c){b.exports={version:"6.3.3"}},{}],24:[function(a,b,c){var d=c;d.utils=a("./hash/utils"),d.common=a("./hash/common"),d.sha=a("./hash/sha"),d.ripemd=a("./hash/ripemd"),d.hmac=a("./hash/hmac"),d.sha1=d.sha.sha1,d.sha256=d.sha.sha256,d.sha224=d.sha.sha224,d.sha384=d.sha.sha384,d.sha512=d.sha.sha512,d.ripemd160=d.ripemd.ripemd160},{"./hash/common":25,"./hash/hmac":26,"./hash/ripemd":27,"./hash/sha":28,"./hash/utils":35}],25:[function(a,b,c){"use strict";function d(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var e=a("./utils"),f=a("minimalistic-assert");c.BlockHash=d,d.prototype.update=function(a,b){if(a=e.toArray(a,b),this.pending?this.pending=this.pending.concat(a):this.pending=a,this.pendingTotal+=a.length,this.pending.length>=this._delta8){a=this.pending;var c=a.length%this._delta8;this.pending=a.slice(a.length-c,a.length),0===this.pending.length&&(this.pending=null),a=e.join32(a,0,a.length-c,this.endian);for(var d=0;d>>24&255,d[e++]=a>>>16&255,d[e++]=a>>>8&255,d[e++]=255&a}else for(d[e++]=255&a,d[e++]=a>>>8&255,d[e++]=a>>>16&255,d[e++]=a>>>24&255,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=0,f=8;fthis.blockSize&&(a=(new this.Hash).update(a).digest()),f(a.length<=this.blockSize);for(var b=a.length;b>>3}function k(a){return m(a,17)^m(a,19)^a>>>10}var l=a("../utils"),m=l.rotr32;c.ft_1=d,c.ch32=e,c.maj32=f,c.p32=g,c.s0_256=h,c.s1_256=i,c.g0_256=j,c.g1_256=k},{"../utils":35}],35:[function(a,b,c){"use strict";function d(a,b){if(Array.isArray(a))return a.slice();if(!a)return[];var c=[];if("string"==typeof a)if(b){if("hex"===b)for(a=a.replace(/[^a-z0-9]+/gi,""),a.length%2!==0&&(a="0"+a),d=0;d>8,g=255&e;f?c.push(f,g):c.push(g)}else for(d=0;d>>24|a>>>8&65280|a<<8&16711680|(255&a)<<24;return b>>>0}function g(a,b){for(var c="",d=0;d>>0}return f}function k(a,b){for(var c=new Array(4*a.length),d=0,e=0;d>>24,c[e+1]=f>>>16&255,c[e+2]=f>>>8&255,c[e+3]=255&f):(c[e+3]=f>>>24,c[e+2]=f>>>16&255,c[e+1]=f>>>8&255,c[e]=255&f)}return c}function l(a,b){return a>>>b|a<<32-b}function m(a,b){return a<>>32-b}function n(a,b){return a+b>>>0}function o(a,b,c){return a+b+c>>>0}function p(a,b,c,d){return a+b+c+d>>>0}function q(a,b,c,d,e){return a+b+c+d+e>>>0}function r(a,b,c,d){var e=a[b],f=a[b+1],g=d+f>>>0,h=(g>>0,a[b+1]=g}function s(a,b,c,d){var e=b+d>>>0,f=(e>>0}function t(a,b,c,d){var e=b+d;return e>>>0}function u(a,b,c,d,e,f,g,h){var i=0,j=b;j=j+d>>>0,i+=j>>0,i+=j>>0,i+=j>>0}function v(a,b,c,d,e,f,g,h){var i=b+d+f+h;return i>>>0}function w(a,b,c,d,e,f,g,h,i,j){var k=0,l=b;l=l+d>>>0,k+=l>>0,k+=l>>0,k+=l>>0,k+=l>>0}function x(a,b,c,d,e,f,g,h,i,j){var k=b+d+f+h+j;return k>>>0}function y(a,b,c){var d=b<<32-c|a>>>c;return d>>>0; -}function z(a,b,c){var d=a<<32-c|b>>>c;return d>>>0}function A(a,b,c){return a>>>c}function B(a,b,c){var d=a<<32-c|b>>>c;return d>>>0}var C=a("minimalistic-assert"),D=a("inherits");c.inherits=D,c.toArray=d,c.toHex=e,c.htonl=f,c.toHex32=g,c.zero2=h,c.zero8=i,c.join32=j,c.split32=k,c.rotr32=l,c.rotl32=m,c.sum32=n,c.sum32_3=o,c.sum32_4=p,c.sum32_5=q,c.sum64=r,c.sum64_hi=s,c.sum64_lo=t,c.sum64_4_hi=u,c.sum64_4_lo=v,c.sum64_5_hi=w,c.sum64_5_lo=x,c.rotr64_hi=y,c.rotr64_lo=z,c.shr64_hi=A,c.shr64_lo=B},{inherits:36,"minimalistic-assert":39}],36:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],37:[function(a,b,c){arguments[4][36][0].apply(c,arguments)},{dup:36}],38:[function(a,b,c){(function(a,c){!function(){"use strict";function d(a,b,c){this.blocks=[],this.s=[],this.padding=b,this.outputBits=c,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(a<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=c>>5,this.extraBytes=(31&c)>>3;for(var d=0;d<50;++d)this.s[d]=0}var e="object"==typeof window?window:{},f=!e.JS_SHA3_NO_NODE_JS&&"object"==typeof a&&a.versions&&a.versions.node;f&&(e=c);for(var g=!e.JS_SHA3_NO_COMMON_JS&&"object"==typeof b&&b.exports,h="0123456789abcdef".split(""),i=[31,7936,2031616,520093696],j=[1,256,65536,16777216],k=[6,1536,393216,100663296],l=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],n=[224,256,384,512],o=[128,256],p=["hex","buffer","arrayBuffer","array"],q=function(a,b,c){return function(e){return new d(a,b,a).update(e)[c]()}},r=function(a,b,c){return function(e,f){return new d(a,b,f).update(e)[c]()}},s=function(a,b){var c=q(a,b,"hex");c.create=function(){return new d(a,b,a)},c.update=function(a){return c.create().update(a)};for(var e=0;e>2]|=a[i]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(f[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=g){for(this.start=c-g,this.block=f[h],c=0;c>2]|=this.padding[3&b],this.lastByteIndex===this.byteCount)for(a[0]=a[c],b=1;b>4&15]+h[15&a]+h[a>>12&15]+h[a>>8&15]+h[a>>20&15]+h[a>>16&15]+h[a>>28&15]+h[a>>24&15];g%b===0&&(C(c),f=0)}return e&&(a=c[f],e>0&&(i+=h[a>>4&15]+h[15&a]),e>1&&(i+=h[a>>12&15]+h[a>>8&15]),e>2&&(i+=h[a>>20&15]+h[a>>16&15])),i},d.prototype.arrayBuffer=function(){this.finalize();var a,b=this.blockCount,c=this.s,d=this.outputBlocks,e=this.extraBytes,f=0,g=0,h=this.outputBits>>3;a=e?new ArrayBuffer(d+1<<2):new ArrayBuffer(h);for(var i=new Uint32Array(a);g>8&255,i[a+2]=b>>16&255,i[a+3]=b>>24&255;h%c===0&&C(d)}return f&&(a=h<<2,b=d[g],f>0&&(i[a]=255&b),f>1&&(i[a+1]=b>>8&255),f>2&&(i[a+2]=b>>16&255)),i};var C=function(a){var b,c,d,e,f,g,h,i,j,k,l,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka;for(d=0;d<48;d+=2)e=a[0]^a[10]^a[20]^a[30]^a[40],f=a[1]^a[11]^a[21]^a[31]^a[41],g=a[2]^a[12]^a[22]^a[32]^a[42],h=a[3]^a[13]^a[23]^a[33]^a[43],i=a[4]^a[14]^a[24]^a[34]^a[44],j=a[5]^a[15]^a[25]^a[35]^a[45],k=a[6]^a[16]^a[26]^a[36]^a[46],l=a[7]^a[17]^a[27]^a[37]^a[47],n=a[8]^a[18]^a[28]^a[38]^a[48],o=a[9]^a[19]^a[29]^a[39]^a[49],b=n^(g<<1|h>>>31),c=o^(h<<1|g>>>31),a[0]^=b,a[1]^=c,a[10]^=b,a[11]^=c,a[20]^=b,a[21]^=c,a[30]^=b,a[31]^=c,a[40]^=b,a[41]^=c,b=e^(i<<1|j>>>31),c=f^(j<<1|i>>>31),a[2]^=b,a[3]^=c,a[12]^=b,a[13]^=c,a[22]^=b,a[23]^=c,a[32]^=b,a[33]^=c,a[42]^=b,a[43]^=c,b=g^(k<<1|l>>>31),c=h^(l<<1|k>>>31),a[4]^=b,a[5]^=c,a[14]^=b,a[15]^=c,a[24]^=b,a[25]^=c,a[34]^=b,a[35]^=c,a[44]^=b,a[45]^=c,b=i^(n<<1|o>>>31),c=j^(o<<1|n>>>31),a[6]^=b,a[7]^=c,a[16]^=b,a[17]^=c,a[26]^=b,a[27]^=c,a[36]^=b,a[37]^=c,a[46]^=b,a[47]^=c,b=k^(e<<1|f>>>31),c=l^(f<<1|e>>>31),a[8]^=b,a[9]^=c,a[18]^=b,a[19]^=c,a[28]^=b,a[29]^=c,a[38]^=b,a[39]^=c,a[48]^=b,a[49]^=c,p=a[0],q=a[1],V=a[11]<<4|a[10]>>>28,W=a[10]<<4|a[11]>>>28,D=a[20]<<3|a[21]>>>29,E=a[21]<<3|a[20]>>>29,ha=a[31]<<9|a[30]>>>23,ia=a[30]<<9|a[31]>>>23,R=a[40]<<18|a[41]>>>14,S=a[41]<<18|a[40]>>>14,J=a[2]<<1|a[3]>>>31,K=a[3]<<1|a[2]>>>31,r=a[13]<<12|a[12]>>>20,s=a[12]<<12|a[13]>>>20,X=a[22]<<10|a[23]>>>22,Y=a[23]<<10|a[22]>>>22,F=a[33]<<13|a[32]>>>19,G=a[32]<<13|a[33]>>>19,ja=a[42]<<2|a[43]>>>30,ka=a[43]<<2|a[42]>>>30,ba=a[5]<<30|a[4]>>>2,ca=a[4]<<30|a[5]>>>2,L=a[14]<<6|a[15]>>>26,M=a[15]<<6|a[14]>>>26,t=a[25]<<11|a[24]>>>21,u=a[24]<<11|a[25]>>>21,Z=a[34]<<15|a[35]>>>17,$=a[35]<<15|a[34]>>>17,H=a[45]<<29|a[44]>>>3,I=a[44]<<29|a[45]>>>3,z=a[6]<<28|a[7]>>>4,A=a[7]<<28|a[6]>>>4,da=a[17]<<23|a[16]>>>9,ea=a[16]<<23|a[17]>>>9,N=a[26]<<25|a[27]>>>7,O=a[27]<<25|a[26]>>>7,v=a[36]<<21|a[37]>>>11,w=a[37]<<21|a[36]>>>11,_=a[47]<<24|a[46]>>>8,aa=a[46]<<24|a[47]>>>8,T=a[8]<<27|a[9]>>>5,U=a[9]<<27|a[8]>>>5,B=a[18]<<20|a[19]>>>12,C=a[19]<<20|a[18]>>>12,fa=a[29]<<7|a[28]>>>25,ga=a[28]<<7|a[29]>>>25,P=a[38]<<8|a[39]>>>24,Q=a[39]<<8|a[38]>>>24,x=a[48]<<14|a[49]>>>18,y=a[49]<<14|a[48]>>>18,a[0]=p^~r&t,a[1]=q^~s&u,a[10]=z^~B&D,a[11]=A^~C&E,a[20]=J^~L&N,a[21]=K^~M&O,a[30]=T^~V&X,a[31]=U^~W&Y,a[40]=ba^~da&fa,a[41]=ca^~ea&ga,a[2]=r^~t&v,a[3]=s^~u&w,a[12]=B^~D&F,a[13]=C^~E&G,a[22]=L^~N&P,a[23]=M^~O&Q,a[32]=V^~X&Z,a[33]=W^~Y&$,a[42]=da^~fa&ha,a[43]=ea^~ga&ia,a[4]=t^~v&x,a[5]=u^~w&y,a[14]=D^~F&H,a[15]=E^~G&I,a[24]=N^~P&R,a[25]=O^~Q&S,a[34]=X^~Z&_,a[35]=Y^~$&aa,a[44]=fa^~ha&ja,a[45]=ga^~ia&ka,a[6]=v^~x&p,a[7]=w^~y&q,a[16]=F^~H&z,a[17]=G^~I&A,a[26]=P^~R&J,a[27]=Q^~S&K,a[36]=Z^~_&T,a[37]=$^~aa&U,a[46]=ha^~ja&ba,a[47]=ia^~ka&ca,a[8]=x^~p&r,a[9]=y^~q&s,a[18]=H^~z&B,a[19]=I^~A&C,a[28]=R^~J&L,a[29]=S^~K&M,a[38]=_^~T&V,a[39]=aa^~U&W,a[48]=ja^~ba&da,a[49]=ka^~ca&ea,a[0]^=m[d],a[1]^=m[d+1]};if(g)b.exports=v;else for(var x=0;x=64;){var n,o,p,q,r,s=d,t=e,u=f,v=g,w=h,x=i,y=j,z=k;for(o=0;o<16;o++)p=b+4*o,l[o]=(255&a[p])<<24|(255&a[p+1])<<16|(255&a[p+2])<<8|255&a[p+3];for(o=16;o<64;o++)n=l[o-2],q=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,n=l[o-15],r=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,l[o]=(q+l[o-7]|0)+(r+l[o-16]|0)|0;for(o=0;o<64;o++)q=(((w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7))+(w&x^~w&y)|0)+(z+(c[o]+l[o]|0)|0)|0,r=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&t^s&u^t&u)|0,z=y,y=x,x=w,w=v+q|0,v=u,u=t,t=s,s=q+r|0;d=d+s|0,e=e+t|0,f=f+u|0,g=g+v|0,h=h+w|0,i=i+x|0,j=j+y|0,k=k+z|0,b+=64,m-=64}}var c=[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],d=1779033703,e=3144134277,f=1013904242,g=2773480762,h=1359893119,i=2600822924,j=528734635,k=1541459225,l=new Array(64);b(a);var m,n=a.length%64,o=a.length/536870912|0,p=a.length<<3,q=n<56?56:120,r=a.slice(a.length-n,a.length);for(r.push(128),m=n+1;m>>24&255),r.push(o>>>16&255),r.push(o>>>8&255),r.push(o>>>0&255),r.push(p>>>24&255),r.push(p>>>16&255),r.push(p>>>8&255),r.push(p>>>0&255),b(r),[d>>>24&255,d>>>16&255,d>>>8&255,d>>>0&255,e>>>24&255,e>>>16&255,e>>>8&255,e>>>0&255,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255,g>>>24&255,g>>>16&255,g>>>8&255,g>>>0&255,h>>>24&255,h>>>16&255,h>>>8&255,h>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,j>>>24&255,j>>>16&255,j>>>8&255,j>>>0&255,k>>>24&255,k>>>16&255,k>>>8&255,k>>>0&255]}function f(a,b,c){function d(){for(var a=g-1;a>=g-4;a--){if(h[a]++,h[a]<=255)return;h[a]=0}}a=a.length<=64?a:e(a);var f,g=64+b.length+4,h=new Array(g),i=new Array(64),j=[];for(f=0;f<64;f++)h[f]=54;for(f=0;f=32;)d(),j=j.concat(e(i.concat(e(h)))),c-=32;return c>0&&(d(),j=j.concat(e(i.concat(e(h))).slice(0,c))),j}function g(a,b,c,d,e){var f;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>>32-b}function i(a,b){k(a,0,b,0,16);for(var c=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]}function j(a,b,c,d){for(var e=0;e=256)return!1}return!0}function m(a,b){var c=parseInt(a);if(a!=c)throw new Error("invalid "+b);return c}function n(a,b,c,d,e,h,i){if(!i)throw new Error("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))throw new Error("N must be power of 2");if(c>o/128/d)throw new Error("N too large");if(d>o/128/e)throw new Error("r too large");if(!l(a))throw new Error("password must be an array or buffer");if(!l(b))throw new Error("salt must be an array or buffer");for(var n=f(a,b,128*e*d),p=new Uint32Array(32*e*d),q=0;qF&&(b=F);for(var l=0;lF&&(b=F);for(var l=0;l>0&255),n.push(p[l]>>8&255),n.push(p[l]>>16&255),n.push(p[l]>>24&255);var r=f(a,n,h);return i(null,1,r)}G(H)};H()}var o=2147483647;"undefined"!=typeof d?c.exports=n:"function"==typeof a&&a.amd?a(n):b&&(b.scrypt&&(b._scrypt=b.scrypt),b.scrypt=n)}(this)},{}],42:[function(a,b,c){(function(a,b){!function(b,c){"use strict";function d(a){return p[o]=e.apply(c,a),o++}function e(a){var b=[].slice.call(arguments,1);return function(){"function"==typeof a?a.apply(c,b):new Function(""+a)()}}function f(a){if(q)setTimeout(e(f,a),0);else{var b=p[a];if(b){q=!0;try{b()}finally{g(a),q=!1}}}}function g(a){delete p[a]}function h(){n=function(){var b=d(arguments);return a.nextTick(e(f,b)),b}}function i(){if(b.postMessage&&!b.importScripts){var a=!0,c=b.onmessage;return b.onmessage=function(){a=!1},b.postMessage("","*"),b.onmessage=c,a}}function j(){var a="setImmediate$"+Math.random()+"$",c=function(c){c.source===b&&"string"==typeof c.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(){var c=d(arguments);return b.postMessage(a+c,"*"),c}}function k(){var a=new MessageChannel;a.port1.onmessage=function(a){var b=a.data;f(b)},n=function(){var b=d(arguments);return a.port2.postMessage(b),b}}function l(){var a=r.documentElement;n=function(){var b=d(arguments),c=r.createElement("script");return c.onreadystatechange=function(){f(b),c.onreadystatechange=null,a.removeChild(c),c=null},a.appendChild(c),b}}function m(){n=function(){var a=d(arguments);return setTimeout(e(f,a),0),a}}if(!b.setImmediate){var n,o=1,p={},q=!1,r=b.document,s=Object.getPrototypeOf&&Object.getPrototypeOf(b);s=s&&s.setTimeout?s:b,"[object process]"==={}.toString.call(b.process)?h():i()?j():b.MessageChannel?k():r&&"onreadystatechange"in r.createElement("script")?l():m(),s.setImmediate=n,s.clearImmediate=g}}("undefined"==typeof self?"undefined"==typeof b?this:b:self)}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:40}],43:[function(a,b,c){(function(a){var c;if(a.crypto&&crypto.getRandomValues){var d=new Uint8Array(16);c=function(){return crypto.getRandomValues(d),d}}if(!c){var e=new Array(16);c=function(){for(var a,b=0;b<16;b++)0===(3&b)&&(a=4294967296*Math.random()),e[b]=a>>>((3&b)<<3)&255;return e}}b.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],44:[function(a,b,c){function d(a,b,c){var d=b&&c||0,e=0;for(b=b||[],a.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){e<16&&(b[d+e++]=j[a])});e<16;)b[d+e++]=0;return b}function e(a,b){var c=b||0,d=i;return d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]}function f(a,b,c){var d=b&&c||0,f=b||[];a=a||{};var g=void 0!==a.clockseq?a.clockseq:n,h=void 0!==a.msecs?a.msecs:(new Date).getTime(),i=void 0!==a.nsecs?a.nsecs:p+1,j=h-o+(i-p)/1e4;if(j<0&&void 0===a.clockseq&&(g=g+1&16383),(j<0||h>o)&&void 0===a.nsecs&&(i=0),i>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");o=h,p=i,n=g,h+=122192928e5;var k=(1e4*(268435455&h)+i)%4294967296;f[d++]=k>>>24&255,f[d++]=k>>>16&255,f[d++]=k>>>8&255,f[d++]=255&k;var l=h/4294967296*1e4&268435455;f[d++]=l>>>8&255,f[d++]=255&l,f[d++]=l>>>24&15|16,f[d++]=l>>>16&255,f[d++]=g>>>8|128,f[d++]=255&g;for(var q=a.node||m,r=0;r<6;r++)f[d+r]=q[r];return b?b:e(f)}function g(a,b,c){var d=b&&c||0;"string"==typeof a&&(b="binary"==a?new Array(16):null,a=null),a=a||{};var f=a.random||(a.rng||h)();if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b)for(var g=0;g<16;g++)b[d+g]=f[g];return b||e(f)}for(var h=a("./rng"),i=[],j={},k=0;k<256;k++)i[k]=(k+256).toString(16).substr(1),j[i[k]]=k;var l=h(),m=[1|l[0],l[1],l[2],l[3],l[4],l[5]],n=16383&(l[6]<<8|l[7]),o=0,p=0,q=g;q.v1=f,q.v4=g,q.parse=d,q.unparse=e,b.exports=q},{"./rng":43}],45:[function(a,b,c){b.exports={version:"3.0.11"}},{}],46:[function(a,b,c){"use strict";try{b.exports.XMLHttpRequest=XMLHttpRequest}catch(d){console.log("Warning: XMLHttpRequest is not defined"),b.exports.XMLHttpRequest=null}},{}],47:[function(a,b,c){"use strict";function d(a){var b=[];for(var c in a)if(null!=a[c]){var d=j.hexlify(a[c]);({gasLimit:!0,gasPrice:!0,nonce:!0,value:!0})[c]&&(d=j.hexStripZeros(d)),b.push(c+"="+d)}return b.join("&")}function e(a,b){i.call(this,a);var c=null;switch(this.name){case"homestead":c="https://api.etherscan.io";break;case"ropsten":c="https://ropsten.etherscan.io";break;case"rinkeby":c="https://rinkeby.etherscan.io";break;case"kovan":c="https://kovan.etherscan.io";break;default:throw new Error("unsupported network")}j.defineProperty(this,"baseUrl",c),j.defineProperty(this,"apiKey",b||null)}function f(a){if(0==a.status&&"No records found"===a.message)return a.result;if(1!=a.status||"OK"!=a.message){var b=new Error("invalid response");throw b.result=JSON.stringify(a),b}return a.result}function g(a){if("2.0"!=a.jsonrpc){var b=new Error("invalid response");throw b.result=JSON.stringify(a),b}if(a.error){var b=new Error(a.error.message||"unknown error");throw a.error.code&&(b.code=a.error.code),a.error.data&&(b.data=a.error.data),b}return a.result}function h(a){if("pending"===a)throw new Error("pending not supported");return"latest"===a?a:parseInt(a.substring(2),16)}var i=a("./provider.js"),j=function(){var b=a("../utils/convert.js");return{defineProperty:a("../utils/properties.js").defineProperty,hexlify:b.hexlify,hexStripZeros:b.hexStripZeros}}();i.inherits(e),j.defineProperty(e.prototype,"_call",function(){}),j.defineProperty(e.prototype,"_callProxy",function(){}),j.defineProperty(e.prototype,"perform",function(a,b){b||(b={});var c=this.baseUrl,e="";switch(this.apiKey&&(e+="&apikey="+this.apiKey),a){case"getBlockNumber":return c+="/api?module=proxy&action=eth_blockNumber"+e,i.fetchJSON(c,null,g);case"getGasPrice":return c+="/api?module=proxy&action=eth_gasPrice"+e,i.fetchJSON(c,null,g);case"getBalance":return c+="/api?module=account&action=balance&address="+b.address,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,f);case"getTransactionCount":return c+="/api?module=proxy&action=eth_getTransactionCount&address="+b.address,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,g);case"getCode":return c+="/api?module=proxy&action=eth_getCode&address="+b.address,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,g);case"getStorageAt":return c+="/api?module=proxy&action=eth_getStorageAt&address="+b.address,c+="&position="+b.position,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,g);case"sendTransaction":return c+="/api?module=proxy&action=eth_sendRawTransaction&hex="+b.signedTransaction,c+=e,i.fetchJSON(c,null,g);case"getBlock":if(b.blockTag)return c+="/api?module=proxy&action=eth_getBlockByNumber&tag="+b.blockTag,c+="&boolean=false",c+=e,i.fetchJSON(c,null,g);throw new Error("getBlock by blockHash not implmeneted");case"getTransaction":return c+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+b.transactionHash,c+=e,i.fetchJSON(c,null,g);case"getTransactionReceipt":return c+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+b.transactionHash,c+=e,i.fetchJSON(c,null,g);case"call":var j=d(b.transaction);return j&&(j="&"+j),c+="/api?module=proxy&action=eth_call"+j,c+=e,i.fetchJSON(c,null,g);case"estimateGas":var j=d(b.transaction);return j&&(j="&"+j),c+="/api?module=proxy&action=eth_estimateGas&"+j,c+=e,i.fetchJSON(c,null,g);case"getLogs":c+="/api?module=logs&action=getLogs";try{if(b.filter.fromBlock&&(c+="&fromBlock="+h(b.filter.fromBlock)),b.filter.toBlock&&(c+="&toBlock="+h(b.filter.toBlock)),b.filter.address&&(c+="&address="+b.filter.address),b.filter.topics&&b.filter.topics.length>0){if(b.filter.topics.length>1)throw new Error("unsupported topic format");var k=b.filter.topics[0];if("string"!=typeof k||66!==k.length)throw new Error("unsupported topic0 format");c+="&topic0="+k}}catch(l){return Promise.reject(l)}c+=e;var m=this;return i.fetchJSON(c,null,f).then(function(a){var b={},c=Promise.resolve();return a.forEach(function(a){c=c.then(function(){if(null==a.blockHash)return a.blockHash=b[a.transactionHash],null==a.blockHash?m.getTransaction(a.transactionHash).then(function(c){b[a.transactionHash]=c.blockHash,a.blockHash=c.blockHash}):void 0})}),c.then(function(){return a})});case"getEtherPrice":return"homestead"!==this.name?Promise.resolve(0):(c+="/api?module=stats&action=ethprice",c+=e,i.fetchJSON(c,null,f).then(function(a){return parseFloat(a.ethusd)}))}return Promise.reject(new Error("not implemented - "+a))}),j.defineProperty(e.prototype,"getHistory",function(a,b,c){var d=this.baseUrl,e="";return this.apiKey&&(e+="&apikey="+this.apiKey),null==b&&(b=0),null==c&&(c=99999999),this.resolveName(a).then(function(a){return d+="/api?module=account&action=txlist&address="+a,d+="&startblock="+b,d+="&endblock="+c,d+="&sort=asc",i.fetchJSON(d,null,f).then(function(a){var b=[];return a.forEach(function(a){["contractAddress","to"].forEach(function(b){""==a[b]&&delete a[b]}),null==a.creates&&null!=a.contractAddress&&(a.creates=a.contractAddress),b.push(i._formatters.checkTransactionResponse(a))}),b})})}),b.exports=e},{"../utils/convert.js":60,"../utils/properties.js":69,"./provider.js":53}],48:[function(a,b,c){"use strict";function d(a){if(0===a.length)throw new Error("no providers");var b={};if(["chainId","ensAddress","name","testnet"].forEach(function(c){for(var d=1;db+12&&delete e._emitted[a]})),e.emit("block",b);var c={};Object.keys(d).forEach(function(b){var d=B(b);"transaction"===d.type?e.getTransaction(d.hash).then(function(a){a&&null!=a.blockNumber&&(e._emitted["t:"+a.hash.toLowerCase()]=a.blockNumber,e.emit(d.hash,a))}):"address"===d.type?(g[d.address]&&(c[d.address]=g[d.address]),e.getBalance(d.address,"latest").then(function(a){var b=g[d.address];b&&a.eq(b)||(g[d.address]=a,e.emit(d.address,a))})):"topic"===d.type&&e.getLogs({fromBlock:f+1,toBlock:a,topics:d.topic}).then(function(a){0!==a.length&&a.forEach(function(a){e._emitted["b:"+a.blockHash.toLowerCase()]=a.blockNumber,e._emitted["t:"+a.transactionHash.toLowerCase()]=a.blockNumber,e.emit(d.topic,a)})})}),f=a,g=c}}),e.doPoll()}if(!(this instanceof w))throw new Error("missing new");a=w.getNetwork(a);var c=null;a.ensAddress&&(c=F.getAddress(a.ensAddress)),F.defineProperty(this,"chainId",a.chainId),F.defineProperty(this,"ensAddress",c),F.defineProperty(this,"name",a.name);var d={};F.defineProperty(this,"_events",d),F.defineProperty(this,"_emitted",{block:-1});var e=this,f=null,g={};F.defineProperty(this,"resetEventsBlock",function(a){f=a,e.doPoll()});var h=4e3,i=null;Object.defineProperty(this,"polling",{get:function(){return null!=i},set:function(a){setTimeout(function(){a&&!i?i=setInterval(b,h):!a&&i&&(clearInterval(i),i=null)},0)}}),Object.defineProperty(this,"pollingInterval",{get:function(){return h},set:function(a){if("number"!=typeof a||a<=0||parseInt(a)!=a)throw new Error("invalid polling interval");h=a,i&&(clearInterval(i),i=setInterval(b,h))}})}function x(a){return function(b){C(b,a),F.defineProperty(b,"inherits",x(b))}}function y(a,b){return new Promise(function(c,d){function e(){b().then(function(b){if(b||a())c(b);else{f++;var d=500+250*parseInt(Math.random()*(1<1e4&&(d=1e4),setTimeout(e,d)}},function(a){d(a)})}var f=0;e()})}function z(a,b){if(Array.isArray(a)){var c=[];return a.forEach(function(a){c.push(z(a,b))}),c}return b(a)}function A(a){try{return"address:"+F.getAddress(a)}catch(b){}if("block"===a)return"block";if("pending"===a)return"pending";if(F.isHexString(a)){if(66===a.length)return"tx:"+a}else if(Array.isArray(a)){a=z(a,function(a){return null==a&&(a="0x"),a});try{return"topic:"+F.RLP.encode(a)}catch(b){console.log(b)}}throw new Error("invalid event - "+a)}function B(a){if("tx:"===a.substring(0,3))return{type:"transaction",hash:a.substring(3)};if("block"===a)return{type:"block"};if("pending"===a)return{type:"pending"};if("address:"===a.substring(0,8))return{type:"address",address:a.substring(8)};if("topic:"===a.substring(0,6))try{var b=F.RLP.decode(a.substring(6));return b=z(b,function(a){return"0x"===a&&(a=null),a}),{type:"topic",topic:b}}catch(c){console.log(c)}throw new Error("invalid event string")}var C=a("inherits"),D=a("xmlhttprequest").XMLHttpRequest,E=a("./networks.json"),F=function(){var b=a("../utils/convert");return{defineProperty:a("../utils/properties").defineProperty,getAddress:a("../utils/address").getAddress,getContractAddress:a("../utils/contract-address").getContractAddress,bigNumberify:a("../utils/bignumber").bigNumberify,arrayify:b.arrayify,hexlify:b.hexlify,isHexString:b.isHexString,concat:b.concat,hexStripZeros:b.hexStripZeros,stripZeros:b.stripZeros,namehash:a("../utils/namehash"),toUtf8String:a("../utils/utf8").toUtf8String,RLP:a("../utils/rlp")}}(),G={hash:i,parentHash:i,number:j,timestamp:j,nonce:f(F.hexlify),difficulty:k,gasLimit:F.bigNumberify,gasUsed:F.bigNumberify,miner:F.getAddress,extraData:F.hexlify,transactions:f(h(i))},H={hash:i,blockHash:f(i,null),blockNumber:f(j,null),transactionIndex:f(j,null),from:F.getAddress,gasPrice:F.bigNumberify,gasLimit:F.bigNumberify,to:f(F.getAddress,null),value:F.bigNumberify,nonce:j,data:F.hexlify,r:f(m),s:f(m),v:f(j),creates:f(F.getAddress,null),raw:f(F.hexlify)},I={from:f(F.getAddress),nonce:f(j),gasLimit:f(F.bigNumberify),gasPrice:f(F.bigNumberify),to:f(F.getAddress),value:f(F.bigNumberify),data:f(F.hexlify)},J={transactionLogIndex:f(j),transactionIndex:j,blockNumber:j,transactionHash:i,address:F.getAddress,topics:h(i),data:F.hexlify,logIndex:j,blockHash:i},K={contractAddress:f(F.getAddress,null),transactionIndex:j,root:f(i),gasUsed:F.bigNumberify,logsBloom:f(F.hexlify),blockHash:i,transactionHash:i,logs:h(r),blockNumber:j,cumulativeGasUsed:F.bigNumberify,status:f(j)},L={fromBlock:f(n,void 0),toBlock:f(n,void 0),address:f(F.getAddress,void 0),topics:f(t,void 0)},M={blockNumber:f(j),blockHash:f(i),transactionIndex:j,removed:f(l),address:F.getAddress,data:g(F.hexlify,"0x"),topics:h(i),transactionHash:i,logIndex:j};F.defineProperty(w,"inherits",x(w)),F.defineProperty(w,"getNetwork",function(a){if("string"==typeof a){if(a=E[a],!a)throw new Error("unknown network")}else null==a&&(a=E.homestead);if("number"!=typeof a.chainId)throw new Error("invalid chainId");return a}),F.defineProperty(w,"networks",E),F.defineProperty(w,"fetchJSON",function(a,b,c){return new Promise(function(d,e){var f=new D;b?(f.open("POST",a,!0),f.setRequestHeader("Content-Type","application/json")):f.open("GET",a,!0),f.onreadystatechange=function(){if(4===f.readyState){try{var g=JSON.parse(f.responseText)}catch(h){var i=new Error("invalid json response");return i.orginialError=h,i.responseText=f.responseText,i.url=a,void e(i)}if(c)try{g=c(g)}catch(h){return h.url=a,h.body=b,h.responseText=f.responseText,void e(h)}if(200!=f.status){var h=new Error("invalid response - "+f.status);return h.statusCode=f.statusCode,void e(h)}d(g)}},f.onerror=function(a){e(a)};try{b?f.send(b):f.send()}catch(g){var h=new Error("connection error");h.error=g,e(h)}})}),F.defineProperty(w.prototype,"waitForTransaction",function(a,b){var c=this;return new Promise(function(d,e){function f(a){g&&clearTimeout(g),d(a)}var g=null;c.once(a,f),"number"==typeof b&&b>0&&(g=setTimeout(function(){c.removeListener(a,f),e(new Error("timeout"))},b))})}),F.defineProperty(w.prototype,"getBlockNumber",function(){try{return this.perform("getBlockNumber").then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getBlockNumber");return b})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"getGasPrice",function(){try{return this.perform("getGasPrice").then(function(a){return F.bigNumberify(a)})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"getBalance",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getBalance",d).then(function(a){return F.bigNumberify(a)})})}),F.defineProperty(w.prototype,"getTransactionCount",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getTransactionCount",d).then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getTransactionCount");return b})})}),F.defineProperty(w.prototype,"getCode",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getCode",d).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"getStorageAt",function(a,b,c){var d=this;return this.resolveName(a).then(function(a){var e={address:a,blockTag:n(c),position:F.hexStripZeros(F.hexlify(b))};return d.perform("getStorageAt",e).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"sendTransaction",function(a){try{var b={signedTransaction:F.hexlify(a)};return this.perform("sendTransaction",b).then(function(a){if(a=F.hexlify(a),66!==a.length)throw new Error("invalid response - sendTransaction");return a})}catch(c){return Promise.reject(c)}}),F.defineProperty(w.prototype,"call",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:q(a)};return b.perform("call",c).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"estimateGas",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:q(a)};return b.perform("estimateGas",c).then(function(a){return F.bigNumberify(a)})})}),F.defineProperty(w.prototype,"getBlock",function(a){var b=this;try{var c=F.hexlify(a);if(66===c.length)return y(function(){return null==b._emitted["b:"+c.toLowerCase()]},function(){return b.perform("getBlock",{blockHash:c}).then(function(a){return null==a?null:o(a)})})}catch(d){}try{var e=n(a);return y(function(){if(F.isHexString(e)){var a=parseInt(e.substring(2),16);return a>b._emitted.block}return!0},function(){return b.perform("getBlock",{blockTag:e}).then(function(a){return null==a?null:o(a)})})}catch(d){}return Promise.reject(new Error("invalid block hash or block tag"))}),F.defineProperty(w.prototype,"getTransaction",function(a){var b=this;try{var c={transactionHash:i(a)};return y(function(){return null==b._emitted["t:"+a.toLowerCase()]},function(){return b.perform("getTransaction",c).then(function(a){return null!=a&&(a=p(a)),a})})}catch(d){return Promise.reject(d)}}),F.defineProperty(w.prototype,"getTransactionReceipt",function(a){var b=this;try{var c={transactionHash:i(a)};return y(function(){return null==b._emitted["t:"+a.toLowerCase()]},function(){return b.perform("getTransactionReceipt",c).then(function(a){return null!=a&&(a=s(a)),a})})}catch(d){return Promise.reject(d)}}),F.defineProperty(w.prototype,"getLogs",function(a){var b=this;return this._resolveNames(a,["address"]).then(function(a){var c={filter:u(a)};return b.perform("getLogs",c).then(function(a){return h(v)(a)})})}),F.defineProperty(w.prototype,"getEtherPrice",function(){try{return this.perform("getEtherPrice",{}).then(function(a){return a})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"_resolveNames",function(a,b){var c=[],e=d(a);return b.forEach(function(a){void 0!==e[a]&&c.push(this.resolveName(e[a]).then(function(b){e[a]=b}))},this),Promise.all(c).then(function(){return e})}),F.defineProperty(w.prototype,"_getResolver",function(a){var b=F.namehash(a),c="0x0178b8bf"+b.substring(2),d={to:this.ensAddress,data:c};return this.call(d).then(function(a){return 66!=a.length?null:F.getAddress("0x"+a.substring(26))})}),F.defineProperty(w.prototype,"resolveName",function(a){try{return Promise.resolve(F.getAddress(a))}catch(b){}if(!this.ensAddress)throw new Error("network does not have ENS deployed");var c=this,d=F.namehash(a);return this._getResolver(a).then(function(a){var b="0x3b3b57de"+d.substring(2),e={to:a,data:b};return c.call(e)}).then(function(a){if(66!=a.length)return null;var b=F.getAddress("0x"+a.substring(26));return"0x0000000000000000000000000000000000000000"===b?null:b})}),F.defineProperty(w.prototype,"lookupAddress",function(a){if(!this.ensAddress)throw new Error("network does not have ENS deployed");a=F.getAddress(a);var b=a.substring(2)+".addr.reverse",c=F.namehash(b),d=this;return this._getResolver(b).then(function(a){if(!a)return null;var b="0x691f3431"+c.substring(2),e={to:a,data:b};return d.call(e)}).then(function(b){if(b=b.substring(2),b.length<64)return null;if(b=b.substring(64),b.length<64)return null;var c=F.bigNumberify("0x"+b.substring(0,64)).toNumber();if(b=b.substring(64),2*c>b.length)return null;var e=F.toUtf8String("0x"+b.substring(0,2*c));return d.resolveName(e).then(function(b){return b!=a?null:e})})}),F.defineProperty(w.prototype,"doPoll",function(){}),F.defineProperty(w.prototype,"perform",function(a,b){return Promise.reject(new Error("not implemented - "+a))}),F.defineProperty(w.prototype,"_startPending",function(){console.log("WARNING: this provider does not support pending events")}),F.defineProperty(w.prototype,"_stopPending",function(){}),F.defineProperty(w.prototype,"on",function(a,b){var c=A(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"on"}),"pending"===c&&this._startPending(),this.polling=!0}),F.defineProperty(w.prototype,"once",function(a,b){var c=A(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"once"}),"pending"===c&&this._startPending(),this.polling=!0}),F.defineProperty(w.prototype,"emit",function(a){var b=A(a),c=Array.prototype.slice.call(arguments,1),d=this._events[b];if(d){for(var e=0;e=0?c:"")+"]";return{coder:b,localName:d,length:c,name:"array",type:e,encode:function(a){Array.isArray(a)||n("invalid array");var d=c,e=new Uint8Array(0);d===-1&&(d=a.length,e=v.encode(d)),d!==a.length&&n("size mismatch");var f=[];return a.forEach(function(a){f.push(b)}),o.concat([e,g(f,a)])},decode:function(d,f){var g=0,i=c;if(i===-1){var j=v.decode(d,f);i=j.value.toNumber(),g+=j.consumed,f+=j.consumed}for(var k=[],l=0;l256||f%8!==0)&&n("invalid type",{type:b}),u(a,f/8,"int"===e[1],c)}var e=b.match(p);if(e){var f=parseInt(e[1]);return(0===f||f>32)&&n("invalid type "+b),x(a,f,c)}var e=b.match(r);if(e){var f=parseInt(e[2]||-1);return i(a,l(a,e[1],c),f,c)}if("tuple("===b.substring(0,6)&&")"===b.substring(b.length-1)){var g=[],h=[];return c&&"object"==typeof c&&(Array.isArray(c.names)&&(h=c.names),"string"==typeof c.name&&(c=c.name)),k(b.substring(6,b.length-1)).forEach(function(b,c){g.push(l(a,b,h[c]))}),j(a,g,c)}return""===b?t(a):void n("invalid type",{type:b})}function m(a){if(!(this instanceof m))throw new Error("missing new");a||(a=s),o.defineProperty(this,"coerceFunc",a)}var n=a("../utils/throw-error"),o=function(){var b=a("../utils/convert.js"),c=a("../utils/utf8.js");return{defineProperty:a("../utils/properties.js").defineProperty,arrayify:b.arrayify,padZeros:b.padZeros,bigNumberify:a("../utils/bignumber.js").bigNumberify,getAddress:a("../utils/address").getAddress,concat:b.concat,toUtf8Bytes:c.toUtf8Bytes,toUtf8String:c.toUtf8String,hexlify:b.hexlify}}(),p=new RegExp(/^bytes([0-9]*)$/),q=new RegExp(/^(u?int)([0-9]*)$/),r=new RegExp(/^(.*)\[([0-9]*)\]$/),s=function(a,b){var c=a.match(q);return c&&parseInt(c[2])<=48?b.toNumber():b},t=function(a){return{name:"null",type:"",encode:function(a){return o.arrayify([])},decode:function(b,c){if(c>b.length)throw new Error("invalid null");return{consumed:0,value:a("null",void 0)}},dynamic:!1}},u=function(a,b,c,d){var e=(c?"int":"uint")+8*b;return{localName:d,name:e,type:e,encode:function(a){return a=o.bigNumberify(a).toTwos(8*b).maskn(8*b),c&&(a=a.fromTwos(8*b).toTwos(256)),o.padZeros(o.arrayify(a),32)},decode:function(d,f){d.length>1]>>4>=8&&(a[c]=a[c].toUpperCase()),(15&b[c>>1])>=8&&(a[c+1]=a[c+1].toUpperCase());return"0x"+a.join("")}function e(a){return Math.log10?Math.log10(a):Math.log(a)/Math.LN10}function f(a,b){var c=null;if("string"!=typeof a&&i("invalid address",{input:a}),a.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==a.substring(0,2)&&(a="0x"+a),c=d(a),a.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&c!==a&&i("invalid address checksum",{input:a,expected:c});else if(a.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(a.substring(2,4)!==l(a)&&i("invalid address icap checksum",{input:a}),c=new g(a.substring(4),36).toString(16);c.length<40;)c="0"+c;c=d("0x"+c)}else i("invalid address",{input:a});if(b){for(var e=new g(c.substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e}return c}var g=a("bn.js"),h=a("./convert"),i=a("./throw-error"),j=a("./keccak256"),k=9007199254740991,l=function(){for(var a={},b=0;b<10;b++)a[String(b)]=String(b);for(var b=0;b<26;b++)a[String.fromCharCode(65+b)]=String(10+b);var c=Math.floor(e(k));return function(b){b=b.toUpperCase(),b=b.substring(4)+b.substring(0,2)+"00";for(var d=b.split(""),e=0;e=c;){var f=d.substring(0,c);d=parseInt(f,10)%97+d.substring(f.length)}for(var g=String(98-parseInt(d,10)%97);g.length<2;)g="0"+g;return g}}();b.exports={getAddress:f}},{"./convert":60,"./keccak256":66,"./throw-error":73,"bn.js":6}],57:[function(a,b,c){function d(a){if(!(this instanceof d))throw new Error("missing new");i.isHexString(a)?("0x"==a&&(a="0x0"),a=new g(a.substring(2),16)):"string"==typeof a&&"-"===a[0]&&i.isHexString(a.substring(1))?a=new g(a.substring(3),16).mul(d.constantNegativeOne._bn):"string"==typeof a&&a.match(/^-?[0-9]*$/)?(""==a&&(a="0"),a=new g(a)):"number"==typeof a&&parseInt(a)==a?a=new g(a):g.isBN(a)||(e(a)?a=a._bn:i.isArrayish(a)?a=new g(i.hexlify(a).substring(2),16):j("invalid BigNumber value",{input:a})),h(this,"_bn",a)}function e(a){return a._bn&&a._bn.mod}function f(a){return e(a)?a:new d(a)}var g=a("bn.js"),h=a("./properties").defineProperty,i=a("./convert"),j=a("./throw-error");h(d,"constantNegativeOne",f(-1)),h(d,"constantZero",f(0)),h(d,"constantOne",f(1)),h(d,"constantTwo",f(2)),h(d,"constantWeiPerEther",f(new g("1000000000000000000"))),h(d.prototype,"fromTwos",function(a){return new d(this._bn.fromTwos(a))}),h(d.prototype,"toTwos",function(a){return new d(this._bn.toTwos(a))}),h(d.prototype,"add",function(a){return new d(this._bn.add(f(a)._bn))}),h(d.prototype,"sub",function(a){return new d(this._bn.sub(f(a)._bn))}),h(d.prototype,"div",function(a){return new d(this._bn.div(f(a)._bn))}),h(d.prototype,"mul",function(a){return new d(this._bn.mul(f(a)._bn))}),h(d.prototype,"mod",function(a){return new d(this._bn.mod(f(a)._bn))}),h(d.prototype,"pow",function(a){return new d(this._bn.pow(f(a)._bn))}),h(d.prototype,"maskn",function(a){return new d(this._bn.maskn(a))}),h(d.prototype,"eq",function(a){return this._bn.eq(f(a)._bn)}),h(d.prototype,"lt",function(a){return this._bn.lt(f(a)._bn)}),h(d.prototype,"lte",function(a){return this._bn.lte(f(a)._bn)}),h(d.prototype,"gt",function(a){return this._bn.gt(f(a)._bn)}),h(d.prototype,"gte",function(a){return this._bn.gte(f(a)._bn)}),h(d.prototype,"isZero",function(){return this._bn.isZero()}),h(d.prototype,"toNumber",function(a){return this._bn.toNumber()}),h(d.prototype,"toString",function(){return this._bn.toString(10)}),h(d.prototype,"toHexString",function(){var a=this._bn.toString(16);return a.length%2&&(a="0"+a),"0x"+a}),b.exports={isBigNumber:e,bigNumberify:f,BigNumber:d}},{"./convert":60,"./properties":69,"./throw-error":73,"bn.js":6}],58:[function(a,b,c){(function(c){"use strict";function d(a){if(a<=0||a>1024||parseInt(a)!=a)throw new Error("invalid length");var b=new Uint8Array(a);return g.getRandomValues(b),e.arrayify(b)}var e=a("./convert"),f=a("./properties").defineProperty,g=c.crypto||c.msCrypto;g&&g.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),g={getRandomValues:function(a){for(var b=0;b<20;b++)for(var c=0;c=256||parseInt(c)!=c)return!1}return!0}function f(a){if(null==a&&o.throwError("cannot convert null value to array",o.INVALID_ARGUMENT,{arg:"value",value:a}),a&&a.toHexString&&(a=a.toHexString()),j(a)){a=a.substring(2),a.length%2&&(a="0"+a);for(var b=[],c=0;c>4]+p[15&f])}return"0x"+c.join("")}o.throwError("invalid hexlify value",{arg:"value",value:a})}function l(a){for(;a.length>3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function m(a,b){for(;a.length<2*b+2;)a="0x0"+a.substring(2);return a}function n(a){if(a=f(a),65!==a.length)throw new Error("invalid signature");var b=a[64];return 27!==b&&28!==b&&(b=27+b%2),{r:k(a.slice(0,32)),s:k(a.slice(32,64)),v:b}}var o=(a("./properties.js").defineProperty,a("./errors")),p="0123456789abcdef";b.exports={arrayify:f,isArrayish:e,concat:g,padZeros:i,stripZeros:h,splitSignature:n,hexlify:k,isHexString:j,hexStripZeros:l,hexZeroPad:m}},{"./errors":62,"./properties.js":69}],61:[function(a,b,c){b.exports=void 0},{}],62:[function(a,b,c){"use strict";var d=a("./properties").defineProperty,e={};["UNKNOWN_ERROR","NOT_IMPLEMENTED","MISSING_NEW","INVALID_ARGUMENT","MISSING_ARGUMENT","UNEXPECTED_ARGUMENT","UNSUPPORTED_OPERATION"].forEach(function(a){d(e,a,a)}),d(e,"throwError",function(a,b,c){b||(b=e.UNKNOWN_ERROR),c||(c={});var d=[];Object.keys(c).forEach(function(a){d.push(a+"="+JSON.stringify(c[a]))});var f=a;d.length&&(a+=" ("+d.join(", ")+")");var g=new Error(a);throw g.reason=f,g.code=b,Object.keys(c).forEach(function(a){g[a]=c[a]}),g}),d(e,"checkNew",function(a,b){a instanceof b||e.throwError("missing new",e.MISSING_NEW,{name:b.name})}),b.exports=e},{"./properties":69}],63:[function(a,b,c){"use strict";function d(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha256,a)}function e(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha512,a)}var f=a("hash.js"),g=a("./sha2.js"),h=a("./convert.js");b.exports={createSha256Hmac:d,createSha512Hmac:e}},{"./convert.js":60,"./sha2.js":71,"hash.js":24}],64:[function(a,b,c){"use strict";function d(a){return e(f.toUtf8Bytes(a))}var e=a("./keccak256"),f=a("./utf8");b.exports=d},{"./keccak256":66,"./utf8":75}],65:[function(a,b,c){"use strict";var d=a("./address"),e=a("./abi-coder"),f=a("./bignumber"),g=a("./contract-address"),h=a("./convert"),i=a("./id"),j=a("./keccak256"),k=a("./namehash"),l=a("./sha2").sha256,m=a("./solidity"),n=a("./random-bytes"),o=a("./properties"),p=a("./rlp"),q=a("./utf8"),r=a("./units"); -b.exports={AbiCoder:e,RLP:p,defineProperty:o.defineProperty,etherSymbol:"Ξ",arrayify:h.arrayify,concat:h.concat,padZeros:h.padZeros,stripZeros:h.stripZeros,bigNumberify:f.bigNumberify,BigNumber:f.BigNumber,hexlify:h.hexlify,toUtf8Bytes:q.toUtf8Bytes,toUtf8String:q.toUtf8String,namehash:k,id:i,getAddress:d.getAddress,getContractAddress:g.getContractAddress,formatEther:r.formatEther,parseEther:r.parseEther,formatUnits:r.formatUnits,parseUnits:r.parseUnits,keccak256:j,sha256:l,randomBytes:n,solidityPack:m.pack,solidityKeccak256:m.keccak256,soliditySha256:m.sha256,splitSignature:h.splitSignature}},{"./abi-coder":55,"./address":56,"./bignumber":57,"./contract-address":59,"./convert":60,"./id":64,"./keccak256":66,"./namehash":67,"./properties":69,"./random-bytes":58,"./rlp":70,"./sha2":71,"./solidity":72,"./units":74,"./utf8":75}],66:[function(a,b,c){"use strict";function d(a){return a=f.arrayify(a),"0x"+e.keccak_256(a)}var e=a("js-sha3"),f=a("./convert.js");b.exports=d},{"./convert.js":60,"js-sha3":38}],67:[function(a,b,c){"use strict";function d(a,b){if(a=a.toLowerCase(),!a.match(j))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var c=h,d=0;a.length&&(!b||d>24&255,j[b.length+1]=m>>16&255,j[b.length+2]=m>>8&255,j[b.length+3]=255&m;var n=f(a).update(j).digest();g||(g=n.length,l=new Uint8Array(g),h=Math.ceil(d/g),k=d-(h-1)*g),l.set(n);for(var o=1;o>=8;return b}function e(a,b,c){for(var d=0,e=0;eb+1+d)throw new Error("invalid rlp")}return{consumed:1+d,result:e}}function i(a,b){if(0===a.length)throw new Error("invalid rlp data");if(a[b]>=248){var c=a[b]-247;if(b+1+c>a.length)throw new Error("too short");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("to short");return h(a,b,b+1+c,c+d)}if(a[b]>=192){var d=a[b]-192;if(b+1+d>a.length)throw new Error("invalid rlp data");return h(a,b,b+1,d)}if(a[b]>=184){var c=a[b]-183;if(b+1+c>a.length)throw new Error("invalid rlp data");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("invalid rlp data");var f=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){var d=a[b]-128;if(b+1+d>a.offset)throw new Error("invlaid rlp data");var f=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}function j(a){a=k.arrayify(a);var b=i(a,0);if(b.consumed!==a.length)throw new Error("invalid rlp data");return b.result}var k=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":60}],71:[function(a,b,c){"use strict";function d(a){return a=g.arrayify(a),"0x"+f.sha256().update(a).digest("hex")}function e(a){return a=g.arrayify(a),"0x"+f.sha512().update(a).digest("hex")}var f=a("hash.js"),g=a("./convert.js");b.exports={sha256:d,sha512:e,createSha256:f.sha256,createSha512:f.sha512}},{"./convert.js":60,"hash.js":24}],72:[function(a,b,c){"use strict";function d(a,b,c){switch(a){case"address":return c?i.padZeros(b,32):i.arrayify(b);case"string":return j.toUtf8Bytes(b);case"bytes":return i.arrayify(b);case"bool":return b=b?"0x01":"0x00",c?i.padZeros(b,32):i.arrayify(b)}var e=a.match(n);if(e){var f=("int"===e[1],parseInt(e[2]||"256"));if(f%8!=0||0===f||f>256)throw new Error("invalid number type - "+a);return c&&(f=256),b=h(b).toTwos(f),i.padZeros(b,f/8)}if(e=a.match(m)){var f=e[1];if(f!=parseInt(f)||0===f||f>32)throw new Error("invalid number type - "+a);if(f=parseInt(f),i.arrayify(b).byteLength!==f)throw new Error("invalid value for "+a);return c?(b+p).substring(0,66):b}if(e=a.match(o)){var g=e[1],k=parseInt(e[2]||b.length);if(k!=b.length)throw new Error("invalid value for "+a);var l=[];return b.forEach(function(a){a=d(g,a,!0),l.push(a)}),i.concat(l)}throw new Error("unknown type - "+a)}function e(a,b){if(a.length!=b.length)throw new Error("type/value count mismatch");var c=[];return a.forEach(function(a,e){c.push(d(a,b[e]))}),i.hexlify(i.concat(c))}function f(a,b){return k(e(a,b))}function g(a,b){return l(e(a,b))}var h=a("./bignumber").bigNumberify,i=a("./convert"),j=(a("./address").getAddress,a("./utf8")),k=a("./keccak256"),l=a("./sha2").sha256,m=new RegExp("^bytes([0-9]+)$"),n=new RegExp("^(u?int)([0-9]*)$"),o=new RegExp("^(.*)\\[([0-9]*)\\]$"),p="0000000000000000000000000000000000000000000000000000000000000000";b.exports={pack:e,keccak256:f,sha256:g}},{"./address":56,"./bignumber":57,"./convert":60,"./keccak256":66,"./sha2":71,"./utf8":75}],73:[function(a,b,c){"use strict";function d(a,b){var c=new Error(a);for(var d in b)c[d]=b[d];throw c}b.exports=d},{}],74:[function(a,b,c){function d(a,b,c){"object"!=typeof b||c||(c=b,b=void 0),null==b&&(b=18);var d=m(b);a=h(a),c||(c={});var e=a.lt(j);e&&(a=a.mul(k));for(var f=a.mod(d.tenPower).toString(10);f.length2&&i("too many decimal points",{input:a});var f=e[0],g=e[1];for(f||(f="0"),g||(g="0"),g.length>c.decimals&&i("too many decimal places",{input:a,decimals:g.length});g.length=0&&c<=256){for(var e="1",f=0;f>6|192,b[c++]=63&e|128):55296==(64512&e)&&d+1>18|240,b[c++]=e>>12&63|128,b[c++]=e>>6&63|128,b[c++]=63&e|128):(b[c++]=e>>12|224,b[c++]=e>>6&63|128,b[c++]=63&e|128)}return f.arrayify(b)}function e(a){a=f.arrayify(a);for(var b="",c=0;c>7!=0){if(d>>6!=2){var e=null;if(d>>5==6)e=1;else if(d>>4==14)e=2;else if(d>>3==30)e=3;else if(d>>2==62)e=4;else{if(d>>1!=126)continue;e=5}if(c+e>a.length){for(;c>6==2;c++);if(c!=a.length)continue;return b}var g,h=d&(1<<8-e-1)-1;for(g=0;g>6!=2)break;h=h<<6|63&i}g==e?h<=65535?b+=String.fromCharCode(h):(h-=65536,b+=String.fromCharCode((h>>10&1023)+55296,(1023&h)+56320)):c--}}else b+=String.fromCharCode(d)}return b}var f=a("./convert.js");b.exports={toUtf8Bytes:d,toUtf8String:e}},{"./convert.js":60}],76:[function(a,b,c){function d(a){return(1<127)throw new Error("passwords with non-ASCII characters not supported in this environment")}else b="";a=m.toUtf8Bytes(a,"NFKD");var e=m.toUtf8Bytes("mnemonic"+b,"NFKD");return m.hexlify(m.pbkdf2(a,e,2048,64,m.createSha512Hmac))}function h(a){var b=a.toLowerCase().split(" ");if(b.length%3!==0)throw new Error("invalid mnemonic");for(var c=m.arrayify(new Uint8Array(Math.ceil(11*b.length/8))),e=0,f=0;f>3]|=1<<7-e%8),e++}var i=32*b.length/3,j=b.length/3,k=d(j),n=m.arrayify(m.sha256(c.slice(0,i/8)))[0];if(n&=k,n!==(c[c.length-1]&k))throw new Error("invalid checksum");return m.hexlify(c.slice(0,i/8))}function i(a){if(a=m.arrayify(a),a.length%4!==0||a.length<16||a.length>32)throw new Error("invalid entropy");for(var b=[0],c=11,f=0;f8?(b[b.length-1]<<=8,b[b.length-1]|=a[f],c-=8):(b[b.length-1]<<=c,b[b.length-1]|=a[f]>>8-c,b.push(a[f]&e(8-c)),c+=3);var g=m.arrayify(m.sha256(a))[0],h=a.length/4;g&=d(h),b[b.length-1]<<=h,b[b.length-1]|=g>>8-h;for(var f=0;f=o)throw new Error("cannot derive child of neutered node");throw new Error("not implemented")}var b=new Uint8Array(37);a&o?b.set(m.arrayify(this.privateKey),1):b.set(this._keyPair.getPublic().encode(null,!0));for(var c=24;c>=0;c-=8)b[33+(c>>3)]=a>>24-c&255;var d=m.arrayify(m.createSha512Hmac(this.chainCode).update(b).digest()),e=m.bigNumberify(d.slice(0,32)),g=(d.slice(32),e.add("0x"+this._keyPair.getPrivate("hex")).mod("0x"+k.curve.n.toString(16)));return new f(k.keyFromPrivate(m.arrayify(g)),d.slice(32),a,this.depth+1)}),m.defineProperty(f.prototype,"derivePath",function(a){var b=a.split("/");if(0===b.length||"m"===b[0]&&0!==this.depth)throw new Error("invalid path");"m"===b[0]&&b.shift();for(var c=this,d=0;d=o)throw new Error("invalid path index - "+e);c=c._derive(o+f)}else{if(!e.match(/^[0-9]+$/))throw new Error("invlaid path component - "+e);var f=parseInt(e);if(f>=o)throw new Error("invalid path index - "+e);c=c._derive(f)}}return c}),m.defineProperty(f,"fromMnemonic",function(a){return h(a),f.fromSeed(g(a))}),m.defineProperty(f,"fromSeed",function(a){if(a=m.arrayify(a),a.length<16||a.length>64)throw new Error("invalid seed");var b=m.arrayify(m.createSha512Hmac(n).update(a).digest());return new f(k.keyFromPrivate(b.slice(0,32)),b.slice(32),0,0,0)}),b.exports={fromMnemonic:f.fromMnemonic,fromSeed:f.fromSeed,mnemonicToEntropy:h,entropyToMnemonic:i,mnemonicToSeed:g,isValidMnemonic:j}},{"../utils/bignumber.js":57,"../utils/convert.js":60,"../utils/hmac":63,"../utils/pbkdf2.js":68,"../utils/properties.js":69,"../utils/sha2":71,"../utils/utf8.js":75,"./words.json":81,elliptic:9}],77:[function(a,b,c){"use strict";var d=a("./wallet"),e=a("./hdnode"),f=a("./signing-key");b.exports={HDNode:e,Wallet:d,SigningKey:f}},{"./hdnode":76,"./signing-key":79,"./wallet":80}],78:[function(a,b,c){"use strict";function d(a){return"string"==typeof a&&"0x"!==a.substring(0,2)&&(a="0x"+a),m.arrayify(a)}function e(a,b){for(a=String(a);a.length0){var e=new Error("invalid "+b.name);throw e.reason="wrong length",e.value=c,e}if(b.maxLength&&(c=g.stripZeros(c),c.length>b.maxLength)){var e=new Error("invalid "+b.name);throw e.reason="too long",e.value=c,e}d.push(g.hexlify(c))}),b&&(d.push(g.hexlify(b)),d.push("0x"),d.push("0x"));var e=g.keccak256(g.RLP.encode(d)),f=c.signDigest(e),h=27+f.recoveryParam;return b&&(d.pop(),d.pop(),d.pop(),h+=2*b+8),d.push(g.hexlify(h)),d.push(f.r),d.push(f.s),g.RLP.encode(d)})}function e(a){var b=g.concat([g.toUtf8Bytes("Ethereum Signed Message:\n"),g.toUtf8Bytes(String(a.length)),"string"==typeof a?g.toUtf8Bytes(a):a]);return g.keccak256(b)}var f=a("scrypt-js"),g=function(){var b=a("../utils/convert");return{defineProperty:a("../utils/properties").defineProperty,arrayify:b.arrayify,concat:b.concat,hexlify:b.hexlify,stripZeros:b.stripZeros,hexZeroPad:b.hexZeroPad,bigNumberify:a("../utils/bignumber").bigNumberify,toUtf8Bytes:a("../utils/utf8").toUtf8Bytes,getAddress:a("../utils/address").getAddress,keccak256:a("../utils/keccak256"),randomBytes:a("../utils").randomBytes,RLP:a("../utils/rlp")}}(),h=a("../utils/errors"),i=a("./hdnode"),j=a("./secret-storage"),k=a("./signing-key");a("setimmediate");var l="m/44'/60'/0'/0/0",m=[{name:"nonce",maxLength:32},{name:"gasPrice",maxLength:32},{name:"gasLimit",maxLength:32},{name:"to",length:20},{name:"value",maxLength:32},{name:"data"}];g.defineProperty(d,"parseTransaction",function(a){a=g.hexlify(a,"rawTransaction");var b=g.RLP.decode(a);if(9!==b.length)throw new Error("invalid transaction");var c=[],d={};m.forEach(function(a,e){d[a.name]=b[e],c.push(b[e])}),d.to&&("0x"==d.to?delete d.to:d.to=g.getAddress(d.to)),["gasPrice","gasLimit","nonce","value"].forEach(function(a){d[a]&&(0===d[a].length?d[a]=g.bigNumberify(0):d[a]=g.bigNumberify(d[a]))}),d.nonce?d.nonce=d.nonce.toNumber():d.nonce=0;var e=g.arrayify(b[6]),f=g.arrayify(b[7]),h=g.arrayify(b[8]);if(e.length>=1&&f.length>=1&&f.length<=32&&h.length>=1&&h.length<=32){d.v=g.bigNumberify(e).toNumber(),d.r=b[7],d.s=b[8];var i=(d.v-35)/2;i<0&&(i=0),i=parseInt(i),d.chainId=i;var j=d.v-27;i&&(c.push(g.hexlify(i)),c.push("0x"),c.push("0x"),j-=2*i+8);var l=g.keccak256(g.RLP.encode(c));try{d.from=k.recover(l,f,h,j)}catch(n){console.log(n)}}return d}),g.defineProperty(d.prototype,"getAddress",function(){return this.address}),g.defineProperty(d.prototype,"getBalance",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,a)}),g.defineProperty(d.prototype,"getTransactionCount",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,a)}),g.defineProperty(d.prototype,"estimateGas",function(a){if(!this.provider)throw new Error("missing provider");var b={};return["from","to","data","value"].forEach(function(c){null!=a[c]&&(b[c]=a[c])}),null==a.from&&(b.from=this.address),this.provider.estimateGas(b)}),g.defineProperty(d.prototype,"sendTransaction",function(a){if(!this.provider)throw new Error("missing provider");if(!a||"object"!=typeof a)throw new Error("invalid transaction object");var b=a.gasLimit;null==b&&(b=this.defaultGasLimit);var c=this,e=null;e=a.gasPrice?Promise.resolve(a.gasPrice):this.provider.getGasPrice();var f=null;f=a.nonce?Promise.resolve(a.nonce):this.provider.getTransactionCount(c.address,"pending");var h=this.provider.chainId,i=null;i=a.to?this.provider.resolveName(a.to):Promise.resolve(void 0);var j=g.hexlify(a.data||"0x"),k=g.hexlify(a.value||0);return Promise.all([e,f,i]).then(function(a){var e=c.sign({to:a[2],data:j,gasLimit:b,gasPrice:a[0],nonce:a[1],value:k,chainId:h});return c.provider.sendTransaction(e).then(function(a){var b=d.parseTransaction(e);return b.hash=a,b.wait=function(){return c.provider.waitForTransaction(a)},b})})}),g.defineProperty(d.prototype,"send",function(a,b,c){return c||(c={}),this.sendTransaction({to:a,gasLimit:c.gasLimit,gasPrice:c.gasPrice,nonce:c.nonce,value:b})}),g.defineProperty(d.prototype,"signMessage",function(a){var b=new k(this.privateKey),c=b.signDigest(e(a));return g.hexZeroPad(c.r,32)+g.hexZeroPad(c.s,32).substring(2)+(c.recoveryParam?"1c":"1b")}),g.defineProperty(d,"verifyMessage",function(a,b){if(b=g.hexlify(b),132!=b.length)throw new Error("invalid signature");var c=e(a),d=parseInt(b.substring(130),16);if(d>=27&&(d-=27),d<0)throw new Error("invalid signature");return k.recover(c,b.substring(0,66),"0x"+b.substring(66,130),d)}),g.defineProperty(d.prototype,"encrypt",function(a,b,c){if("function"!=typeof b||c||(c=b,b={}),c&&"function"!=typeof c)throw new Error("invalid callback");if(b||(b={}),this.mnemonic){var d={};for(var e in b)d[e]=b[e];b=d,b.mnemonic=this.mnemonic,b.path=this.path}return j.encrypt(this.privateKey,a,b,c)}),g.defineProperty(d,"isEncryptedWallet",function(a){return j.isValidWallet(a)||j.isCrowdsaleWallet(a)}),g.defineProperty(d,"createRandom",function(a){var b=g.randomBytes(16);a||(a={}),a.extraEntropy&&(b=g.keccak256(g.concat([b,a.extraEntropy])).substring(0,34));var c=i.entropyToMnemonic(b);return d.fromMnemonic(c,a.path)}),g.defineProperty(d,"fromEncryptedWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return new Promise(function(e,f){if(j.isCrowdsaleWallet(a))try{var h=j.decryptCrowdsale(a,b);e(new d(h))}catch(i){f(i)}else j.isValidWallet(a)?j.decrypt(a,b,c).then(function(a){var b=new d(a);a.mnemonic&&a.path&&(g.defineProperty(b,"mnemonic",a.mnemonic),g.defineProperty(b,"path",a.path)),e(b)},function(a){f(a)}):f("invalid wallet JSON")})}),g.defineProperty(d,"fromMnemonic",function(a,b){b||(b=l);var c=i.fromMnemonic(a).derivePath(b),e=new d(c.privateKey);return g.defineProperty(e,"mnemonic",a),g.defineProperty(e,"path",b),e}),g.defineProperty(d,"fromBrainWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return a="string"==typeof a?g.toUtf8Bytes(a,"NFKC"):g.arrayify(a,"password"),b="string"==typeof b?g.toUtf8Bytes(b,"NFKC"):g.arrayify(b,"password"),new Promise(function(e,h){f(b,a,1<<18,8,1,32,function(a,b,f){if(a)h(a);else if(f)e(new d(g.hexlify(f)));else if(c)return c(b)})})}),b.exports=d},{"../utils":65,"../utils/address":56,"../utils/bignumber":57,"../utils/convert":60,"../utils/errors":62,"../utils/keccak256":66,"../utils/properties":69,"../utils/rlp":70,"../utils/utf8":75,"./hdnode":76,"./secret-storage":78,"./signing-key":79,"scrypt-js":41,setimmediate:42}],81:[function(a,b,c){b.exports="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; +}function z(a,b,c){var d=a<<32-c|b>>>c;return d>>>0}function A(a,b,c){return a>>>c}function B(a,b,c){var d=a<<32-c|b>>>c;return d>>>0}var C=a("minimalistic-assert"),D=a("inherits");c.inherits=D,c.toArray=d,c.toHex=e,c.htonl=f,c.toHex32=g,c.zero2=h,c.zero8=i,c.join32=j,c.split32=k,c.rotr32=l,c.rotl32=m,c.sum32=n,c.sum32_3=o,c.sum32_4=p,c.sum32_5=q,c.sum64=r,c.sum64_hi=s,c.sum64_lo=t,c.sum64_4_hi=u,c.sum64_4_lo=v,c.sum64_5_hi=w,c.sum64_5_lo=x,c.rotr64_hi=y,c.rotr64_lo=z,c.shr64_hi=A,c.shr64_lo=B},{inherits:36,"minimalistic-assert":39}],36:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],37:[function(a,b,c){arguments[4][36][0].apply(c,arguments)},{dup:36}],38:[function(a,b,c){(function(a,c){!function(){"use strict";function d(a,b,c){this.blocks=[],this.s=[],this.padding=b,this.outputBits=c,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(a<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=c>>5,this.extraBytes=(31&c)>>3;for(var d=0;d<50;++d)this.s[d]=0}var e="object"==typeof window?window:{},f=!e.JS_SHA3_NO_NODE_JS&&"object"==typeof a&&a.versions&&a.versions.node;f&&(e=c);for(var g=!e.JS_SHA3_NO_COMMON_JS&&"object"==typeof b&&b.exports,h="0123456789abcdef".split(""),i=[31,7936,2031616,520093696],j=[1,256,65536,16777216],k=[6,1536,393216,100663296],l=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],n=[224,256,384,512],o=[128,256],p=["hex","buffer","arrayBuffer","array"],q=function(a,b,c){return function(e){return new d(a,b,a).update(e)[c]()}},r=function(a,b,c){return function(e,f){return new d(a,b,f).update(e)[c]()}},s=function(a,b){var c=q(a,b,"hex");c.create=function(){return new d(a,b,a)},c.update=function(a){return c.create().update(a)};for(var e=0;e>2]|=a[i]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(f[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=g){for(this.start=c-g,this.block=f[h],c=0;c>2]|=this.padding[3&b],this.lastByteIndex===this.byteCount)for(a[0]=a[c],b=1;b>4&15]+h[15&a]+h[a>>12&15]+h[a>>8&15]+h[a>>20&15]+h[a>>16&15]+h[a>>28&15]+h[a>>24&15];g%b===0&&(C(c),f=0)}return e&&(a=c[f],e>0&&(i+=h[a>>4&15]+h[15&a]),e>1&&(i+=h[a>>12&15]+h[a>>8&15]),e>2&&(i+=h[a>>20&15]+h[a>>16&15])),i},d.prototype.arrayBuffer=function(){this.finalize();var a,b=this.blockCount,c=this.s,d=this.outputBlocks,e=this.extraBytes,f=0,g=0,h=this.outputBits>>3;a=e?new ArrayBuffer(d+1<<2):new ArrayBuffer(h);for(var i=new Uint32Array(a);g>8&255,i[a+2]=b>>16&255,i[a+3]=b>>24&255;h%c===0&&C(d)}return f&&(a=h<<2,b=d[g],f>0&&(i[a]=255&b),f>1&&(i[a+1]=b>>8&255),f>2&&(i[a+2]=b>>16&255)),i};var C=function(a){var b,c,d,e,f,g,h,i,j,k,l,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka;for(d=0;d<48;d+=2)e=a[0]^a[10]^a[20]^a[30]^a[40],f=a[1]^a[11]^a[21]^a[31]^a[41],g=a[2]^a[12]^a[22]^a[32]^a[42],h=a[3]^a[13]^a[23]^a[33]^a[43],i=a[4]^a[14]^a[24]^a[34]^a[44],j=a[5]^a[15]^a[25]^a[35]^a[45],k=a[6]^a[16]^a[26]^a[36]^a[46],l=a[7]^a[17]^a[27]^a[37]^a[47],n=a[8]^a[18]^a[28]^a[38]^a[48],o=a[9]^a[19]^a[29]^a[39]^a[49],b=n^(g<<1|h>>>31),c=o^(h<<1|g>>>31),a[0]^=b,a[1]^=c,a[10]^=b,a[11]^=c,a[20]^=b,a[21]^=c,a[30]^=b,a[31]^=c,a[40]^=b,a[41]^=c,b=e^(i<<1|j>>>31),c=f^(j<<1|i>>>31),a[2]^=b,a[3]^=c,a[12]^=b,a[13]^=c,a[22]^=b,a[23]^=c,a[32]^=b,a[33]^=c,a[42]^=b,a[43]^=c,b=g^(k<<1|l>>>31),c=h^(l<<1|k>>>31),a[4]^=b,a[5]^=c,a[14]^=b,a[15]^=c,a[24]^=b,a[25]^=c,a[34]^=b,a[35]^=c,a[44]^=b,a[45]^=c,b=i^(n<<1|o>>>31),c=j^(o<<1|n>>>31),a[6]^=b,a[7]^=c,a[16]^=b,a[17]^=c,a[26]^=b,a[27]^=c,a[36]^=b,a[37]^=c,a[46]^=b,a[47]^=c,b=k^(e<<1|f>>>31),c=l^(f<<1|e>>>31),a[8]^=b,a[9]^=c,a[18]^=b,a[19]^=c,a[28]^=b,a[29]^=c,a[38]^=b,a[39]^=c,a[48]^=b,a[49]^=c,p=a[0],q=a[1],V=a[11]<<4|a[10]>>>28,W=a[10]<<4|a[11]>>>28,D=a[20]<<3|a[21]>>>29,E=a[21]<<3|a[20]>>>29,ha=a[31]<<9|a[30]>>>23,ia=a[30]<<9|a[31]>>>23,R=a[40]<<18|a[41]>>>14,S=a[41]<<18|a[40]>>>14,J=a[2]<<1|a[3]>>>31,K=a[3]<<1|a[2]>>>31,r=a[13]<<12|a[12]>>>20,s=a[12]<<12|a[13]>>>20,X=a[22]<<10|a[23]>>>22,Y=a[23]<<10|a[22]>>>22,F=a[33]<<13|a[32]>>>19,G=a[32]<<13|a[33]>>>19,ja=a[42]<<2|a[43]>>>30,ka=a[43]<<2|a[42]>>>30,ba=a[5]<<30|a[4]>>>2,ca=a[4]<<30|a[5]>>>2,L=a[14]<<6|a[15]>>>26,M=a[15]<<6|a[14]>>>26,t=a[25]<<11|a[24]>>>21,u=a[24]<<11|a[25]>>>21,Z=a[34]<<15|a[35]>>>17,$=a[35]<<15|a[34]>>>17,H=a[45]<<29|a[44]>>>3,I=a[44]<<29|a[45]>>>3,z=a[6]<<28|a[7]>>>4,A=a[7]<<28|a[6]>>>4,da=a[17]<<23|a[16]>>>9,ea=a[16]<<23|a[17]>>>9,N=a[26]<<25|a[27]>>>7,O=a[27]<<25|a[26]>>>7,v=a[36]<<21|a[37]>>>11,w=a[37]<<21|a[36]>>>11,_=a[47]<<24|a[46]>>>8,aa=a[46]<<24|a[47]>>>8,T=a[8]<<27|a[9]>>>5,U=a[9]<<27|a[8]>>>5,B=a[18]<<20|a[19]>>>12,C=a[19]<<20|a[18]>>>12,fa=a[29]<<7|a[28]>>>25,ga=a[28]<<7|a[29]>>>25,P=a[38]<<8|a[39]>>>24,Q=a[39]<<8|a[38]>>>24,x=a[48]<<14|a[49]>>>18,y=a[49]<<14|a[48]>>>18,a[0]=p^~r&t,a[1]=q^~s&u,a[10]=z^~B&D,a[11]=A^~C&E,a[20]=J^~L&N,a[21]=K^~M&O,a[30]=T^~V&X,a[31]=U^~W&Y,a[40]=ba^~da&fa,a[41]=ca^~ea&ga,a[2]=r^~t&v,a[3]=s^~u&w,a[12]=B^~D&F,a[13]=C^~E&G,a[22]=L^~N&P,a[23]=M^~O&Q,a[32]=V^~X&Z,a[33]=W^~Y&$,a[42]=da^~fa&ha,a[43]=ea^~ga&ia,a[4]=t^~v&x,a[5]=u^~w&y,a[14]=D^~F&H,a[15]=E^~G&I,a[24]=N^~P&R,a[25]=O^~Q&S,a[34]=X^~Z&_,a[35]=Y^~$&aa,a[44]=fa^~ha&ja,a[45]=ga^~ia&ka,a[6]=v^~x&p,a[7]=w^~y&q,a[16]=F^~H&z,a[17]=G^~I&A,a[26]=P^~R&J,a[27]=Q^~S&K,a[36]=Z^~_&T,a[37]=$^~aa&U,a[46]=ha^~ja&ba,a[47]=ia^~ka&ca,a[8]=x^~p&r,a[9]=y^~q&s,a[18]=H^~z&B,a[19]=I^~A&C,a[28]=R^~J&L,a[29]=S^~K&M,a[38]=_^~T&V,a[39]=aa^~U&W,a[48]=ja^~ba&da,a[49]=ka^~ca&ea,a[0]^=m[d],a[1]^=m[d+1]};if(g)b.exports=v;else for(var x=0;x=64;){var n,o,p,q,r,s=d,t=e,u=f,v=g,w=h,x=i,y=j,z=k;for(o=0;o<16;o++)p=b+4*o,l[o]=(255&a[p])<<24|(255&a[p+1])<<16|(255&a[p+2])<<8|255&a[p+3];for(o=16;o<64;o++)n=l[o-2],q=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,n=l[o-15],r=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,l[o]=(q+l[o-7]|0)+(r+l[o-16]|0)|0;for(o=0;o<64;o++)q=(((w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7))+(w&x^~w&y)|0)+(z+(c[o]+l[o]|0)|0)|0,r=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&t^s&u^t&u)|0,z=y,y=x,x=w,w=v+q|0,v=u,u=t,t=s,s=q+r|0;d=d+s|0,e=e+t|0,f=f+u|0,g=g+v|0,h=h+w|0,i=i+x|0,j=j+y|0,k=k+z|0,b+=64,m-=64}}var c=[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],d=1779033703,e=3144134277,f=1013904242,g=2773480762,h=1359893119,i=2600822924,j=528734635,k=1541459225,l=new Array(64);b(a);var m,n=a.length%64,o=a.length/536870912|0,p=a.length<<3,q=n<56?56:120,r=a.slice(a.length-n,a.length);for(r.push(128),m=n+1;m>>24&255),r.push(o>>>16&255),r.push(o>>>8&255),r.push(o>>>0&255),r.push(p>>>24&255),r.push(p>>>16&255),r.push(p>>>8&255),r.push(p>>>0&255),b(r),[d>>>24&255,d>>>16&255,d>>>8&255,d>>>0&255,e>>>24&255,e>>>16&255,e>>>8&255,e>>>0&255,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255,g>>>24&255,g>>>16&255,g>>>8&255,g>>>0&255,h>>>24&255,h>>>16&255,h>>>8&255,h>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,j>>>24&255,j>>>16&255,j>>>8&255,j>>>0&255,k>>>24&255,k>>>16&255,k>>>8&255,k>>>0&255]}function f(a,b,c){function d(){for(var a=g-1;a>=g-4;a--){if(h[a]++,h[a]<=255)return;h[a]=0}}a=a.length<=64?a:e(a);var f,g=64+b.length+4,h=new Array(g),i=new Array(64),j=[];for(f=0;f<64;f++)h[f]=54;for(f=0;f=32;)d(),j=j.concat(e(i.concat(e(h)))),c-=32;return c>0&&(d(),j=j.concat(e(i.concat(e(h))).slice(0,c))),j}function g(a,b,c,d,e){var f;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>>32-b}function i(a,b){k(a,0,b,0,16);for(var c=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]}function j(a,b,c,d){for(var e=0;e=256)return!1}return!0}function m(a,b){var c=parseInt(a);if(a!=c)throw new Error("invalid "+b);return c}function n(a,b,c,d,e,h,i){if(!i)throw new Error("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))throw new Error("N must be power of 2");if(c>o/128/d)throw new Error("N too large");if(d>o/128/e)throw new Error("r too large");if(!l(a))throw new Error("password must be an array or buffer");if(!l(b))throw new Error("salt must be an array or buffer");for(var n=f(a,b,128*e*d),p=new Uint32Array(32*e*d),q=0;qF&&(b=F);for(var l=0;lF&&(b=F);for(var l=0;l>0&255),n.push(p[l]>>8&255),n.push(p[l]>>16&255),n.push(p[l]>>24&255);var r=f(a,n,h);return i(null,1,r)}G(H)};H()}var o=2147483647;"undefined"!=typeof d?c.exports=n:"function"==typeof a&&a.amd?a(n):b&&(b.scrypt&&(b._scrypt=b.scrypt),b.scrypt=n)}(this)},{}],42:[function(a,b,c){(function(a,b){!function(b,c){"use strict";function d(a){return p[o]=e.apply(c,a),o++}function e(a){var b=[].slice.call(arguments,1);return function(){"function"==typeof a?a.apply(c,b):new Function(""+a)()}}function f(a){if(q)setTimeout(e(f,a),0);else{var b=p[a];if(b){q=!0;try{b()}finally{g(a),q=!1}}}}function g(a){delete p[a]}function h(){n=function(){var b=d(arguments);return a.nextTick(e(f,b)),b}}function i(){if(b.postMessage&&!b.importScripts){var a=!0,c=b.onmessage;return b.onmessage=function(){a=!1},b.postMessage("","*"),b.onmessage=c,a}}function j(){var a="setImmediate$"+Math.random()+"$",c=function(c){c.source===b&&"string"==typeof c.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(){var c=d(arguments);return b.postMessage(a+c,"*"),c}}function k(){var a=new MessageChannel;a.port1.onmessage=function(a){var b=a.data;f(b)},n=function(){var b=d(arguments);return a.port2.postMessage(b),b}}function l(){var a=r.documentElement;n=function(){var b=d(arguments),c=r.createElement("script");return c.onreadystatechange=function(){f(b),c.onreadystatechange=null,a.removeChild(c),c=null},a.appendChild(c),b}}function m(){n=function(){var a=d(arguments);return setTimeout(e(f,a),0),a}}if(!b.setImmediate){var n,o=1,p={},q=!1,r=b.document,s=Object.getPrototypeOf&&Object.getPrototypeOf(b);s=s&&s.setTimeout?s:b,"[object process]"==={}.toString.call(b.process)?h():i()?j():b.MessageChannel?k():r&&"onreadystatechange"in r.createElement("script")?l():m(),s.setImmediate=n,s.clearImmediate=g}}("undefined"==typeof self?"undefined"==typeof b?this:b:self)}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:40}],43:[function(a,b,c){(function(a){var c;if(a.crypto&&crypto.getRandomValues){var d=new Uint8Array(16);c=function(){return crypto.getRandomValues(d),d}}if(!c){var e=new Array(16);c=function(){for(var a,b=0;b<16;b++)0===(3&b)&&(a=4294967296*Math.random()),e[b]=a>>>((3&b)<<3)&255;return e}}b.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],44:[function(a,b,c){function d(a,b,c){var d=b&&c||0,e=0;for(b=b||[],a.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){e<16&&(b[d+e++]=j[a])});e<16;)b[d+e++]=0;return b}function e(a,b){var c=b||0,d=i;return d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]}function f(a,b,c){var d=b&&c||0,f=b||[];a=a||{};var g=void 0!==a.clockseq?a.clockseq:n,h=void 0!==a.msecs?a.msecs:(new Date).getTime(),i=void 0!==a.nsecs?a.nsecs:p+1,j=h-o+(i-p)/1e4;if(j<0&&void 0===a.clockseq&&(g=g+1&16383),(j<0||h>o)&&void 0===a.nsecs&&(i=0),i>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");o=h,p=i,n=g,h+=122192928e5;var k=(1e4*(268435455&h)+i)%4294967296;f[d++]=k>>>24&255,f[d++]=k>>>16&255,f[d++]=k>>>8&255,f[d++]=255&k;var l=h/4294967296*1e4&268435455;f[d++]=l>>>8&255,f[d++]=255&l,f[d++]=l>>>24&15|16,f[d++]=l>>>16&255,f[d++]=g>>>8|128,f[d++]=255&g;for(var q=a.node||m,r=0;r<6;r++)f[d+r]=q[r];return b?b:e(f)}function g(a,b,c){var d=b&&c||0;"string"==typeof a&&(b="binary"==a?new Array(16):null,a=null),a=a||{};var f=a.random||(a.rng||h)();if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b)for(var g=0;g<16;g++)b[d+g]=f[g];return b||e(f)}for(var h=a("./rng"),i=[],j={},k=0;k<256;k++)i[k]=(k+256).toString(16).substr(1),j[i[k]]=k;var l=h(),m=[1|l[0],l[1],l[2],l[3],l[4],l[5]],n=16383&(l[6]<<8|l[7]),o=0,p=0,q=g;q.v1=f,q.v4=g,q.parse=d,q.unparse=e,b.exports=q},{"./rng":43}],45:[function(a,b,c){b.exports={version:"3.0.12"}},{}],46:[function(a,b,c){"use strict";try{b.exports.XMLHttpRequest=XMLHttpRequest}catch(d){console.log("Warning: XMLHttpRequest is not defined"),b.exports.XMLHttpRequest=null}},{}],47:[function(a,b,c){"use strict";function d(a){var b=[];for(var c in a)if(null!=a[c]){var d=j.hexlify(a[c]);({gasLimit:!0,gasPrice:!0,nonce:!0,value:!0})[c]&&(d=j.hexStripZeros(d)),b.push(c+"="+d)}return b.join("&")}function e(a,b){i.call(this,a);var c=null;switch(this.name){case"homestead":c="https://api.etherscan.io";break;case"ropsten":c="https://ropsten.etherscan.io";break;case"rinkeby":c="https://rinkeby.etherscan.io";break;case"kovan":c="https://kovan.etherscan.io";break;default:throw new Error("unsupported network")}j.defineProperty(this,"baseUrl",c),j.defineProperty(this,"apiKey",b||null)}function f(a){if(0==a.status&&"No records found"===a.message)return a.result;if(1!=a.status||"OK"!=a.message){var b=new Error("invalid response");throw b.result=JSON.stringify(a),b}return a.result}function g(a){if("2.0"!=a.jsonrpc){var b=new Error("invalid response");throw b.result=JSON.stringify(a),b}if(a.error){var b=new Error(a.error.message||"unknown error");throw a.error.code&&(b.code=a.error.code),a.error.data&&(b.data=a.error.data),b}return a.result}function h(a){if("pending"===a)throw new Error("pending not supported");return"latest"===a?a:parseInt(a.substring(2),16)}var i=a("./provider.js"),j=function(){var b=a("../utils/convert.js");return{defineProperty:a("../utils/properties.js").defineProperty,hexlify:b.hexlify,hexStripZeros:b.hexStripZeros}}();i.inherits(e),j.defineProperty(e.prototype,"_call",function(){}),j.defineProperty(e.prototype,"_callProxy",function(){}),j.defineProperty(e.prototype,"perform",function(a,b){b||(b={});var c=this.baseUrl,e="";switch(this.apiKey&&(e+="&apikey="+this.apiKey),a){case"getBlockNumber":return c+="/api?module=proxy&action=eth_blockNumber"+e,i.fetchJSON(c,null,g);case"getGasPrice":return c+="/api?module=proxy&action=eth_gasPrice"+e,i.fetchJSON(c,null,g);case"getBalance":return c+="/api?module=account&action=balance&address="+b.address,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,f);case"getTransactionCount":return c+="/api?module=proxy&action=eth_getTransactionCount&address="+b.address,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,g);case"getCode":return c+="/api?module=proxy&action=eth_getCode&address="+b.address,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,g);case"getStorageAt":return c+="/api?module=proxy&action=eth_getStorageAt&address="+b.address,c+="&position="+b.position,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,g);case"sendTransaction":return c+="/api?module=proxy&action=eth_sendRawTransaction&hex="+b.signedTransaction,c+=e,i.fetchJSON(c,null,g);case"getBlock":if(b.blockTag)return c+="/api?module=proxy&action=eth_getBlockByNumber&tag="+b.blockTag,c+="&boolean=false",c+=e,i.fetchJSON(c,null,g);throw new Error("getBlock by blockHash not implmeneted");case"getTransaction":return c+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+b.transactionHash,c+=e,i.fetchJSON(c,null,g);case"getTransactionReceipt":return c+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+b.transactionHash,c+=e,i.fetchJSON(c,null,g);case"call":var j=d(b.transaction);return j&&(j="&"+j),c+="/api?module=proxy&action=eth_call"+j,c+=e,i.fetchJSON(c,null,g);case"estimateGas":var j=d(b.transaction);return j&&(j="&"+j),c+="/api?module=proxy&action=eth_estimateGas&"+j,c+=e,i.fetchJSON(c,null,g);case"getLogs":c+="/api?module=logs&action=getLogs";try{if(b.filter.fromBlock&&(c+="&fromBlock="+h(b.filter.fromBlock)),b.filter.toBlock&&(c+="&toBlock="+h(b.filter.toBlock)),b.filter.address&&(c+="&address="+b.filter.address),b.filter.topics&&b.filter.topics.length>0){if(b.filter.topics.length>1)throw new Error("unsupported topic format");var k=b.filter.topics[0];if("string"!=typeof k||66!==k.length)throw new Error("unsupported topic0 format");c+="&topic0="+k}}catch(l){return Promise.reject(l)}c+=e;var m=this;return i.fetchJSON(c,null,f).then(function(a){var b={},c=Promise.resolve();return a.forEach(function(a){c=c.then(function(){if(null==a.blockHash)return a.blockHash=b[a.transactionHash],null==a.blockHash?m.getTransaction(a.transactionHash).then(function(c){b[a.transactionHash]=c.blockHash,a.blockHash=c.blockHash}):void 0})}),c.then(function(){return a})});case"getEtherPrice":return"homestead"!==this.name?Promise.resolve(0):(c+="/api?module=stats&action=ethprice",c+=e,i.fetchJSON(c,null,f).then(function(a){return parseFloat(a.ethusd)}))}return Promise.reject(new Error("not implemented - "+a))}),j.defineProperty(e.prototype,"getHistory",function(a,b,c){var d=this.baseUrl,e="";return this.apiKey&&(e+="&apikey="+this.apiKey),null==b&&(b=0),null==c&&(c=99999999),this.resolveName(a).then(function(a){return d+="/api?module=account&action=txlist&address="+a,d+="&startblock="+b,d+="&endblock="+c,d+="&sort=asc",i.fetchJSON(d,null,f).then(function(a){var b=[];return a.forEach(function(a){["contractAddress","to"].forEach(function(b){""==a[b]&&delete a[b]}),null==a.creates&&null!=a.contractAddress&&(a.creates=a.contractAddress),b.push(i._formatters.checkTransactionResponse(a))}),b})})}),b.exports=e},{"../utils/convert.js":61,"../utils/properties.js":70,"./provider.js":53}],48:[function(a,b,c){"use strict";function d(a){if(0===a.length)throw new Error("no providers");var b={};if(["chainId","ensAddress","name","testnet"].forEach(function(c){for(var d=1;db+12&&delete e._emitted[a]})),e.emit("block",b);var c={};Object.keys(d).forEach(function(b){var d=B(b);"transaction"===d.type?e.getTransaction(d.hash).then(function(a){a&&null!=a.blockNumber&&(e._emitted["t:"+a.hash.toLowerCase()]=a.blockNumber,e.emit(d.hash,a))}):"address"===d.type?(g[d.address]&&(c[d.address]=g[d.address]),e.getBalance(d.address,"latest").then(function(a){var b=g[d.address];b&&a.eq(b)||(g[d.address]=a,e.emit(d.address,a))})):"topic"===d.type&&e.getLogs({fromBlock:f+1,toBlock:a,topics:d.topic}).then(function(a){0!==a.length&&a.forEach(function(a){e._emitted["b:"+a.blockHash.toLowerCase()]=a.blockNumber,e._emitted["t:"+a.transactionHash.toLowerCase()]=a.blockNumber,e.emit(d.topic,a)})})}),f=a,g=c}}),e.doPoll()}if(!(this instanceof w))throw new Error("missing new");a=w.getNetwork(a);var c=null;a.ensAddress&&(c=F.getAddress(a.ensAddress)),F.defineProperty(this,"chainId",a.chainId),F.defineProperty(this,"ensAddress",c),F.defineProperty(this,"name",a.name);var d={};F.defineProperty(this,"_events",d),F.defineProperty(this,"_emitted",{block:-1});var e=this,f=null,g={};F.defineProperty(this,"resetEventsBlock",function(a){f=a,e.doPoll()});var h=4e3,i=null;Object.defineProperty(this,"polling",{get:function(){return null!=i},set:function(a){setTimeout(function(){a&&!i?i=setInterval(b,h):!a&&i&&(clearInterval(i),i=null)},0)}}),Object.defineProperty(this,"pollingInterval",{get:function(){return h},set:function(a){if("number"!=typeof a||a<=0||parseInt(a)!=a)throw new Error("invalid polling interval");h=a,i&&(clearInterval(i),i=setInterval(b,h))}})}function x(a){return function(b){C(b,a),F.defineProperty(b,"inherits",x(b))}}function y(a,b){return new Promise(function(c,d){function e(){b().then(function(b){if(b||a())c(b);else{f++;var d=500+250*parseInt(Math.random()*(1<1e4&&(d=1e4),setTimeout(e,d)}},function(a){d(a)})}var f=0;e()})}function z(a,b){if(Array.isArray(a)){var c=[];return a.forEach(function(a){c.push(z(a,b))}),c}return b(a)}function A(a){try{return"address:"+F.getAddress(a)}catch(b){}if("block"===a)return"block";if("pending"===a)return"pending";if(F.isHexString(a)){if(66===a.length)return"tx:"+a}else if(Array.isArray(a)){a=z(a,function(a){return null==a&&(a="0x"),a});try{return"topic:"+F.RLP.encode(a)}catch(b){console.log(b)}}throw new Error("invalid event - "+a)}function B(a){if("tx:"===a.substring(0,3))return{type:"transaction",hash:a.substring(3)};if("block"===a)return{type:"block"};if("pending"===a)return{type:"pending"};if("address:"===a.substring(0,8))return{type:"address",address:a.substring(8)};if("topic:"===a.substring(0,6))try{var b=F.RLP.decode(a.substring(6));return b=z(b,function(a){return"0x"===a&&(a=null),a}),{type:"topic",topic:b}}catch(c){console.log(c)}throw new Error("invalid event string")}var C=a("inherits"),D=a("xmlhttprequest").XMLHttpRequest,E=a("./networks.json"),F=function(){var b=a("../utils/convert"),c=a("../utils/utf8");return{defineProperty:a("../utils/properties").defineProperty,getAddress:a("../utils/address").getAddress,getContractAddress:a("../utils/contract-address").getContractAddress,bigNumberify:a("../utils/bignumber").bigNumberify,arrayify:b.arrayify,hexlify:b.hexlify,isHexString:b.isHexString,concat:b.concat,hexStripZeros:b.hexStripZeros,stripZeros:b.stripZeros,base64:a("../utils/base64"),namehash:a("../utils/namehash"),toUtf8String:c.toUtf8String,toUtf8Bytes:c.toUtf8Bytes,RLP:a("../utils/rlp")}}(),G=a("../utils/errors"),H={hash:i,parentHash:i,number:j,timestamp:j,nonce:f(F.hexlify),difficulty:k,gasLimit:F.bigNumberify,gasUsed:F.bigNumberify,miner:F.getAddress,extraData:F.hexlify,transactions:f(h(i))},I={hash:i,blockHash:f(i,null),blockNumber:f(j,null),transactionIndex:f(j,null),from:F.getAddress,gasPrice:F.bigNumberify,gasLimit:F.bigNumberify,to:f(F.getAddress,null),value:F.bigNumberify,nonce:j,data:F.hexlify,r:f(m),s:f(m),v:f(j),creates:f(F.getAddress,null),raw:f(F.hexlify)},J={from:f(F.getAddress),nonce:f(j),gasLimit:f(F.bigNumberify),gasPrice:f(F.bigNumberify),to:f(F.getAddress),value:f(F.bigNumberify),data:f(F.hexlify)},K={transactionLogIndex:f(j),transactionIndex:j,blockNumber:j,transactionHash:i,address:F.getAddress,topics:h(i),data:F.hexlify,logIndex:j,blockHash:i},L={contractAddress:f(F.getAddress,null),transactionIndex:j,root:f(i),gasUsed:F.bigNumberify,logsBloom:f(F.hexlify),blockHash:i,transactionHash:i,logs:h(r),blockNumber:j,cumulativeGasUsed:F.bigNumberify,status:f(j)},M={fromBlock:f(n,void 0),toBlock:f(n,void 0),address:f(F.getAddress,void 0),topics:f(t,void 0)},N={blockNumber:f(j),blockHash:f(i),transactionIndex:j,removed:f(l),address:F.getAddress,data:g(F.hexlify,"0x"),topics:h(i),transactionHash:i,logIndex:j};F.defineProperty(w,"inherits",x(w)),F.defineProperty(w,"getNetwork",function(a){if("string"==typeof a){if(a=E[a],!a)throw new Error("unknown network")}else null==a&&(a=E.homestead);if("number"!=typeof a.chainId)throw new Error("invalid chainId");return a}),F.defineProperty(w,"networks",E),F.defineProperty(w,"fetchJSON",function(a,b,c){var d=[];if("object"==typeof a&&null!=a.url&&null!=a.user&&null!=a.password){"https:"!==a.url.substring(0,6)&&a.forceInsecure!==!0&&G.throwError("basic authentication requires a secure https url",G.INVALID_ARGUMENT,{arg:"url",url:a.url,user:a.user,password:"[REDACTED]"});var e=a.user+":"+a.password;d.push({key:"Authorization",value:"Basic "+F.base64.encode(F.toUtf8Bytes(e))}),a=a.url}return new Promise(function(e,f){var g=new D;b?(g.open("POST",a,!0),d.push({key:"Content-Type",value:"application/json"})):g.open("GET",a,!0),d.forEach(function(a){g.setRequestHeader(a.key,a.value)}),g.onreadystatechange=function(){if(4===g.readyState){try{var d=JSON.parse(g.responseText)}catch(h){var i=new Error("invalid json response");return i.orginialError=h,i.responseText=g.responseText,i.url=a,void f(i)}if(c)try{d=c(d)}catch(h){return h.url=a,h.body=b,h.responseText=g.responseText,void f(h)}if(200!=g.status){var h=new Error("invalid response - "+g.status);return h.statusCode=g.statusCode,void f(h)}e(d)}},g.onerror=function(a){f(a)};try{b?g.send(b):g.send()}catch(h){var i=new Error("connection error");i.error=h,f(i)}})}),F.defineProperty(w.prototype,"waitForTransaction",function(a,b){var c=this;return new Promise(function(d,e){function f(a){g&&clearTimeout(g),d(a)}var g=null;c.once(a,f),"number"==typeof b&&b>0&&(g=setTimeout(function(){c.removeListener(a,f),e(new Error("timeout"))},b))})}),F.defineProperty(w.prototype,"getBlockNumber",function(){try{return this.perform("getBlockNumber").then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getBlockNumber");return b})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"getGasPrice",function(){try{return this.perform("getGasPrice").then(function(a){return F.bigNumberify(a)})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"getBalance",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getBalance",d).then(function(a){return F.bigNumberify(a)})})}),F.defineProperty(w.prototype,"getTransactionCount",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getTransactionCount",d).then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getTransactionCount");return b})})}),F.defineProperty(w.prototype,"getCode",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:n(b)};return c.perform("getCode",d).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"getStorageAt",function(a,b,c){var d=this;return this.resolveName(a).then(function(a){var e={address:a,blockTag:n(c),position:F.hexStripZeros(F.hexlify(b))};return d.perform("getStorageAt",e).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"sendTransaction",function(a){try{var b={signedTransaction:F.hexlify(a)};return this.perform("sendTransaction",b).then(function(a){if(a=F.hexlify(a),66!==a.length)throw new Error("invalid response - sendTransaction");return a})}catch(c){return Promise.reject(c)}}),F.defineProperty(w.prototype,"call",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:q(a)};return b.perform("call",c).then(function(a){return F.hexlify(a)})})}),F.defineProperty(w.prototype,"estimateGas",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:q(a)};return b.perform("estimateGas",c).then(function(a){return F.bigNumberify(a)})})}),F.defineProperty(w.prototype,"getBlock",function(a){var b=this;try{var c=F.hexlify(a);if(66===c.length)return y(function(){return null==b._emitted["b:"+c.toLowerCase()]},function(){return b.perform("getBlock",{blockHash:c}).then(function(a){return null==a?null:o(a)})})}catch(d){}try{var e=n(a);return y(function(){if(F.isHexString(e)){var a=parseInt(e.substring(2),16);return a>b._emitted.block}return!0},function(){return b.perform("getBlock",{blockTag:e}).then(function(a){return null==a?null:o(a)})})}catch(d){}return Promise.reject(new Error("invalid block hash or block tag"))}),F.defineProperty(w.prototype,"getTransaction",function(a){var b=this;try{var c={transactionHash:i(a)};return y(function(){return null==b._emitted["t:"+a.toLowerCase()]},function(){return b.perform("getTransaction",c).then(function(a){return null!=a&&(a=p(a)),a})})}catch(d){return Promise.reject(d)}}),F.defineProperty(w.prototype,"getTransactionReceipt",function(a){var b=this;try{var c={transactionHash:i(a)};return y(function(){return null==b._emitted["t:"+a.toLowerCase()]},function(){return b.perform("getTransactionReceipt",c).then(function(a){return null!=a&&(a=s(a)),a})})}catch(d){return Promise.reject(d)}}),F.defineProperty(w.prototype,"getLogs",function(a){var b=this;return this._resolveNames(a,["address"]).then(function(a){var c={filter:u(a)};return b.perform("getLogs",c).then(function(a){return h(v)(a)})})}),F.defineProperty(w.prototype,"getEtherPrice",function(){try{return this.perform("getEtherPrice",{}).then(function(a){return a})}catch(a){return Promise.reject(a)}}),F.defineProperty(w.prototype,"_resolveNames",function(a,b){var c=[],e=d(a);return b.forEach(function(a){void 0!==e[a]&&c.push(this.resolveName(e[a]).then(function(b){e[a]=b}))},this),Promise.all(c).then(function(){return e})}),F.defineProperty(w.prototype,"_getResolver",function(a){var b=F.namehash(a),c="0x0178b8bf"+b.substring(2),d={to:this.ensAddress,data:c};return this.call(d).then(function(a){return 66!=a.length?null:F.getAddress("0x"+a.substring(26))})}),F.defineProperty(w.prototype,"resolveName",function(a){try{return Promise.resolve(F.getAddress(a))}catch(b){}if(!this.ensAddress)throw new Error("network does not have ENS deployed");var c=this,d=F.namehash(a);return this._getResolver(a).then(function(a){var b="0x3b3b57de"+d.substring(2),e={to:a,data:b};return c.call(e)}).then(function(a){if(66!=a.length)return null;var b=F.getAddress("0x"+a.substring(26));return"0x0000000000000000000000000000000000000000"===b?null:b})}),F.defineProperty(w.prototype,"lookupAddress",function(a){if(!this.ensAddress)throw new Error("network does not have ENS deployed");a=F.getAddress(a);var b=a.substring(2)+".addr.reverse",c=F.namehash(b),d=this;return this._getResolver(b).then(function(a){if(!a)return null;var b="0x691f3431"+c.substring(2),e={to:a,data:b};return d.call(e)}).then(function(b){if(b=b.substring(2),b.length<64)return null;if(b=b.substring(64),b.length<64)return null;var c=F.bigNumberify("0x"+b.substring(0,64)).toNumber();if(b=b.substring(64),2*c>b.length)return null;var e=F.toUtf8String("0x"+b.substring(0,2*c));return d.resolveName(e).then(function(b){return b!=a?null:e})})}),F.defineProperty(w.prototype,"doPoll",function(){}),F.defineProperty(w.prototype,"perform",function(a,b){return Promise.reject(new Error("not implemented - "+a))}),F.defineProperty(w.prototype,"_startPending",function(){console.log("WARNING: this provider does not support pending events")}),F.defineProperty(w.prototype,"_stopPending",function(){}),F.defineProperty(w.prototype,"on",function(a,b){var c=A(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"on"}),"pending"===c&&this._startPending(),this.polling=!0}),F.defineProperty(w.prototype,"once",function(a,b){var c=A(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"once"}),"pending"===c&&this._startPending(),this.polling=!0}),F.defineProperty(w.prototype,"emit",function(a){var b=A(a),c=Array.prototype.slice.call(arguments,1),d=this._events[b];if(d){for(var e=0;e=0?c:"")+"]";return{coder:b,localName:d,length:c,name:"array",type:e,encode:function(a){Array.isArray(a)||n("invalid array");var d=c,e=new Uint8Array(0);d===-1&&(d=a.length,e=v.encode(d)),d!==a.length&&n("size mismatch");var f=[];return a.forEach(function(a){f.push(b)}),o.concat([e,g(f,a)])},decode:function(d,f){var g=0,i=c;if(i===-1){var j=v.decode(d,f);i=j.value.toNumber(),g+=j.consumed,f+=j.consumed}for(var k=[],l=0;l256||f%8!==0)&&n("invalid type",{type:b}),u(a,f/8,"int"===e[1],c)}var e=b.match(p);if(e){var f=parseInt(e[1]);return(0===f||f>32)&&n("invalid type "+b),x(a,f,c)}var e=b.match(r);if(e){var f=parseInt(e[2]||-1);return i(a,l(a,e[1],c),f,c)}if("tuple("===b.substring(0,6)&&")"===b.substring(b.length-1)){var g=[],h=[];return c&&"object"==typeof c&&(Array.isArray(c.names)&&(h=c.names),"string"==typeof c.name&&(c=c.name)),k(b.substring(6,b.length-1)).forEach(function(b,c){g.push(l(a,b,h[c]))}),j(a,g,c)}return""===b?t(a):void n("invalid type",{type:b})}function m(a){if(!(this instanceof m))throw new Error("missing new");a||(a=s),o.defineProperty(this,"coerceFunc",a)}var n=a("../utils/throw-error"),o=function(){var b=a("../utils/convert.js"),c=a("../utils/utf8.js");return{defineProperty:a("../utils/properties.js").defineProperty,arrayify:b.arrayify,padZeros:b.padZeros,bigNumberify:a("../utils/bignumber.js").bigNumberify,getAddress:a("../utils/address").getAddress,concat:b.concat,toUtf8Bytes:c.toUtf8Bytes,toUtf8String:c.toUtf8String,hexlify:b.hexlify}}(),p=new RegExp(/^bytes([0-9]*)$/),q=new RegExp(/^(u?int)([0-9]*)$/),r=new RegExp(/^(.*)\[([0-9]*)\]$/),s=function(a,b){var c=a.match(q);return c&&parseInt(c[2])<=48?b.toNumber():b},t=function(a){return{name:"null",type:"",encode:function(a){return o.arrayify([])},decode:function(b,c){if(c>b.length)throw new Error("invalid null");return{consumed:0,value:a("null",void 0)}},dynamic:!1}},u=function(a,b,c,d){var e=(c?"int":"uint")+8*b;return{localName:d,name:e,type:e,encode:function(a){return a=o.bigNumberify(a).toTwos(8*b).maskn(8*b),c&&(a=a.fromTwos(8*b).toTwos(256)),o.padZeros(o.arrayify(a),32)},decode:function(d,f){d.length>1]>>4>=8&&(a[c]=a[c].toUpperCase()),(15&b[c>>1])>=8&&(a[c+1]=a[c+1].toUpperCase());return"0x"+a.join("")}function e(a){return Math.log10?Math.log10(a):Math.log(a)/Math.LN10}function f(a,b){var c=null;if("string"!=typeof a&&i("invalid address",{input:a}),a.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==a.substring(0,2)&&(a="0x"+a),c=d(a),a.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&c!==a&&i("invalid address checksum",{input:a,expected:c});else if(a.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(a.substring(2,4)!==l(a)&&i("invalid address icap checksum",{input:a}),c=new g(a.substring(4),36).toString(16);c.length<40;)c="0"+c;c=d("0x"+c)}else i("invalid address",{input:a});if(b){for(var e=new g(c.substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e}return c}var g=a("bn.js"),h=a("./convert"),i=a("./throw-error"),j=a("./keccak256"),k=9007199254740991,l=function(){for(var a={},b=0;b<10;b++)a[String(b)]=String(b);for(var b=0;b<26;b++)a[String.fromCharCode(65+b)]=String(10+b);var c=Math.floor(e(k));return function(b){b=b.toUpperCase(),b=b.substring(4)+b.substring(0,2)+"00";for(var d=b.split(""),e=0;e=c;){var f=d.substring(0,c);d=parseInt(f,10)%97+d.substring(f.length)}for(var g=String(98-parseInt(d,10)%97);g.length<2;)g="0"+g;return g}}();b.exports={getAddress:f}},{"./convert":61,"./keccak256":67,"./throw-error":74,"bn.js":6}],57:[function(a,b,c){function d(a){if(!(this instanceof d))throw new Error("missing new");i.isHexString(a)?("0x"==a&&(a="0x0"),a=new g(a.substring(2),16)):"string"==typeof a&&"-"===a[0]&&i.isHexString(a.substring(1))?a=new g(a.substring(3),16).mul(d.constantNegativeOne._bn):"string"==typeof a&&a.match(/^-?[0-9]*$/)?(""==a&&(a="0"),a=new g(a)):"number"==typeof a&&parseInt(a)==a?a=new g(a):g.isBN(a)||(e(a)?a=a._bn:i.isArrayish(a)?a=new g(i.hexlify(a).substring(2),16):j("invalid BigNumber value",{input:a})),h(this,"_bn",a)}function e(a){return a._bn&&a._bn.mod}function f(a){return e(a)?a:new d(a)}var g=a("bn.js"),h=a("./properties").defineProperty,i=a("./convert"),j=a("./throw-error");h(d,"constantNegativeOne",f(-1)),h(d,"constantZero",f(0)),h(d,"constantOne",f(1)),h(d,"constantTwo",f(2)),h(d,"constantWeiPerEther",f(new g("1000000000000000000"))),h(d.prototype,"fromTwos",function(a){return new d(this._bn.fromTwos(a))}),h(d.prototype,"toTwos",function(a){return new d(this._bn.toTwos(a))}),h(d.prototype,"add",function(a){return new d(this._bn.add(f(a)._bn))}),h(d.prototype,"sub",function(a){return new d(this._bn.sub(f(a)._bn))}),h(d.prototype,"div",function(a){return new d(this._bn.div(f(a)._bn))}),h(d.prototype,"mul",function(a){return new d(this._bn.mul(f(a)._bn))}),h(d.prototype,"mod",function(a){return new d(this._bn.mod(f(a)._bn))}),h(d.prototype,"pow",function(a){return new d(this._bn.pow(f(a)._bn))}),h(d.prototype,"maskn",function(a){return new d(this._bn.maskn(a))}),h(d.prototype,"eq",function(a){return this._bn.eq(f(a)._bn)}),h(d.prototype,"lt",function(a){return this._bn.lt(f(a)._bn)}),h(d.prototype,"lte",function(a){return this._bn.lte(f(a)._bn)}),h(d.prototype,"gt",function(a){return this._bn.gt(f(a)._bn)}),h(d.prototype,"gte",function(a){return this._bn.gte(f(a)._bn)}),h(d.prototype,"isZero",function(){return this._bn.isZero()}),h(d.prototype,"toNumber",function(a){return this._bn.toNumber()}),h(d.prototype,"toString",function(){return this._bn.toString(10)}),h(d.prototype,"toHexString",function(){var a=this._bn.toString(16);return a.length%2&&(a="0"+a),"0x"+a}),b.exports={isBigNumber:e,bigNumberify:f,BigNumber:d}},{"./convert":61,"./properties":70,"./throw-error":74,"bn.js":6}],58:[function(a,b,c){"use strict";var d=a("./convert");b.exports={decode:function(a){a=atob(a);for(var b=[],c=0;c1024||parseInt(a)!=a)throw new Error("invalid length");var b=new Uint8Array(a);return g.getRandomValues(b),e.arrayify(b)}var e=a("./convert"),f=a("./properties").defineProperty,g=c.crypto||c.msCrypto;g&&g.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),g={getRandomValues:function(a){for(var b=0;b<20;b++)for(var c=0;c=256||parseInt(c)!=c)return!1}return!0}function f(a){if(null==a&&o.throwError("cannot convert null value to array",o.INVALID_ARGUMENT,{arg:"value",value:a}),a&&a.toHexString&&(a=a.toHexString()),j(a)){a=a.substring(2),a.length%2&&(a="0"+a);for(var b=[],c=0;c>4]+p[15&f])}return"0x"+c.join("")}o.throwError("invalid hexlify value",{arg:"value",value:a})}function l(a){for(;a.length>3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function m(a,b){for(;a.length<2*b+2;)a="0x0"+a.substring(2);return a}function n(a){if(a=f(a),65!==a.length)throw new Error("invalid signature");var b=a[64];return 27!==b&&28!==b&&(b=27+b%2),{r:k(a.slice(0,32)),s:k(a.slice(32,64)),v:b}}var o=(a("./properties.js").defineProperty,a("./errors")),p="0123456789abcdef";b.exports={arrayify:f,isArrayish:e,concat:g,padZeros:i,stripZeros:h,splitSignature:n,hexlify:k,isHexString:j,hexStripZeros:l,hexZeroPad:m}},{"./errors":63,"./properties.js":70}],62:[function(a,b,c){b.exports=void 0},{}],63:[function(a,b,c){"use strict";var d=a("./properties").defineProperty,e={};["UNKNOWN_ERROR","NOT_IMPLEMENTED","MISSING_NEW","INVALID_ARGUMENT","MISSING_ARGUMENT","UNEXPECTED_ARGUMENT","UNSUPPORTED_OPERATION"].forEach(function(a){d(e,a,a)}),d(e,"throwError",function(a,b,c){b||(b=e.UNKNOWN_ERROR),c||(c={});var d=[];Object.keys(c).forEach(function(a){d.push(a+"="+JSON.stringify(c[a]))});var f=a;d.length&&(a+=" ("+d.join(", ")+")"); +var g=new Error(a);throw g.reason=f,g.code=b,Object.keys(c).forEach(function(a){g[a]=c[a]}),g}),d(e,"checkNew",function(a,b){a instanceof b||e.throwError("missing new",e.MISSING_NEW,{name:b.name})}),b.exports=e},{"./properties":70}],64:[function(a,b,c){"use strict";function d(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha256,a)}function e(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha512,a)}var f=a("hash.js"),g=a("./sha2.js"),h=a("./convert.js");b.exports={createSha256Hmac:d,createSha512Hmac:e}},{"./convert.js":61,"./sha2.js":72,"hash.js":24}],65:[function(a,b,c){"use strict";function d(a){return e(f.toUtf8Bytes(a))}var e=a("./keccak256"),f=a("./utf8");b.exports=d},{"./keccak256":67,"./utf8":76}],66:[function(a,b,c){"use strict";var d=a("./address"),e=a("./abi-coder"),f=a("./base64"),g=a("./bignumber"),h=a("./contract-address"),i=a("./convert"),j=a("./id"),k=a("./keccak256"),l=a("./namehash"),m=a("./sha2").sha256,n=a("./solidity"),o=a("./random-bytes"),p=a("./properties"),q=a("./rlp"),r=a("./utf8"),s=a("./units");b.exports={AbiCoder:e,RLP:q,defineProperty:p.defineProperty,etherSymbol:"Ξ",arrayify:i.arrayify,concat:i.concat,padZeros:i.padZeros,stripZeros:i.stripZeros,base64:f,bigNumberify:g.bigNumberify,BigNumber:g.BigNumber,hexlify:i.hexlify,toUtf8Bytes:r.toUtf8Bytes,toUtf8String:r.toUtf8String,namehash:l,id:j,getAddress:d.getAddress,getContractAddress:h.getContractAddress,formatEther:s.formatEther,parseEther:s.parseEther,formatUnits:s.formatUnits,parseUnits:s.parseUnits,keccak256:k,sha256:m,randomBytes:o,solidityPack:n.pack,solidityKeccak256:n.keccak256,soliditySha256:n.sha256,splitSignature:i.splitSignature}},{"./abi-coder":55,"./address":56,"./base64":58,"./bignumber":57,"./contract-address":60,"./convert":61,"./id":65,"./keccak256":67,"./namehash":68,"./properties":70,"./random-bytes":59,"./rlp":71,"./sha2":72,"./solidity":73,"./units":75,"./utf8":76}],67:[function(a,b,c){"use strict";function d(a){return a=f.arrayify(a),"0x"+e.keccak_256(a)}var e=a("js-sha3"),f=a("./convert.js");b.exports=d},{"./convert.js":61,"js-sha3":38}],68:[function(a,b,c){"use strict";function d(a,b){if(a=a.toLowerCase(),!a.match(j))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var c=h,d=0;a.length&&(!b||d>24&255,j[b.length+1]=m>>16&255,j[b.length+2]=m>>8&255,j[b.length+3]=255&m;var n=f(a).update(j).digest();g||(g=n.length,l=new Uint8Array(g),h=Math.ceil(d/g),k=d-(h-1)*g),l.set(n);for(var o=1;o>=8;return b}function e(a,b,c){for(var d=0,e=0;eb+1+d)throw new Error("invalid rlp")}return{consumed:1+d,result:e}}function i(a,b){if(0===a.length)throw new Error("invalid rlp data");if(a[b]>=248){var c=a[b]-247;if(b+1+c>a.length)throw new Error("too short");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("to short");return h(a,b,b+1+c,c+d)}if(a[b]>=192){var d=a[b]-192;if(b+1+d>a.length)throw new Error("invalid rlp data");return h(a,b,b+1,d)}if(a[b]>=184){var c=a[b]-183;if(b+1+c>a.length)throw new Error("invalid rlp data");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("invalid rlp data");var f=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){var d=a[b]-128;if(b+1+d>a.offset)throw new Error("invlaid rlp data");var f=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}function j(a){a=k.arrayify(a);var b=i(a,0);if(b.consumed!==a.length)throw new Error("invalid rlp data");return b.result}var k=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":61}],72:[function(a,b,c){"use strict";function d(a){return a=g.arrayify(a),"0x"+f.sha256().update(a).digest("hex")}function e(a){return a=g.arrayify(a),"0x"+f.sha512().update(a).digest("hex")}var f=a("hash.js"),g=a("./convert.js");b.exports={sha256:d,sha512:e,createSha256:f.sha256,createSha512:f.sha512}},{"./convert.js":61,"hash.js":24}],73:[function(a,b,c){"use strict";function d(a,b,c){switch(a){case"address":return c?i.padZeros(b,32):i.arrayify(b);case"string":return j.toUtf8Bytes(b);case"bytes":return i.arrayify(b);case"bool":return b=b?"0x01":"0x00",c?i.padZeros(b,32):i.arrayify(b)}var e=a.match(n);if(e){var f=("int"===e[1],parseInt(e[2]||"256"));if(f%8!=0||0===f||f>256)throw new Error("invalid number type - "+a);return c&&(f=256),b=h(b).toTwos(f),i.padZeros(b,f/8)}if(e=a.match(m)){var f=e[1];if(f!=parseInt(f)||0===f||f>32)throw new Error("invalid number type - "+a);if(f=parseInt(f),i.arrayify(b).byteLength!==f)throw new Error("invalid value for "+a);return c?(b+p).substring(0,66):b}if(e=a.match(o)){var g=e[1],k=parseInt(e[2]||b.length);if(k!=b.length)throw new Error("invalid value for "+a);var l=[];return b.forEach(function(a){a=d(g,a,!0),l.push(a)}),i.concat(l)}throw new Error("unknown type - "+a)}function e(a,b){if(a.length!=b.length)throw new Error("type/value count mismatch");var c=[];return a.forEach(function(a,e){c.push(d(a,b[e]))}),i.hexlify(i.concat(c))}function f(a,b){return k(e(a,b))}function g(a,b){return l(e(a,b))}var h=a("./bignumber").bigNumberify,i=a("./convert"),j=(a("./address").getAddress,a("./utf8")),k=a("./keccak256"),l=a("./sha2").sha256,m=new RegExp("^bytes([0-9]+)$"),n=new RegExp("^(u?int)([0-9]*)$"),o=new RegExp("^(.*)\\[([0-9]*)\\]$"),p="0000000000000000000000000000000000000000000000000000000000000000";b.exports={pack:e,keccak256:f,sha256:g}},{"./address":56,"./bignumber":57,"./convert":61,"./keccak256":67,"./sha2":72,"./utf8":76}],74:[function(a,b,c){"use strict";function d(a,b){var c=new Error(a);for(var d in b)c[d]=b[d];throw c}b.exports=d},{}],75:[function(a,b,c){function d(a,b,c){"object"!=typeof b||c||(c=b,b=void 0),null==b&&(b=18);var d=m(b);a=h(a),c||(c={});var e=a.lt(j);e&&(a=a.mul(k));for(var f=a.mod(d.tenPower).toString(10);f.length2&&i("too many decimal points",{input:a});var f=e[0],g=e[1];for(f||(f="0"),g||(g="0"),g.length>c.decimals&&i("too many decimal places",{input:a,decimals:g.length});g.length=0&&c<=256){for(var e="1",f=0;f>6|192,b[c++]=63&e|128):55296==(64512&e)&&d+1>18|240,b[c++]=e>>12&63|128,b[c++]=e>>6&63|128,b[c++]=63&e|128):(b[c++]=e>>12|224,b[c++]=e>>6&63|128,b[c++]=63&e|128)}return f.arrayify(b)}function e(a){a=f.arrayify(a);for(var b="",c=0;c>7!=0){if(d>>6!=2){var e=null;if(d>>5==6)e=1;else if(d>>4==14)e=2;else if(d>>3==30)e=3;else if(d>>2==62)e=4;else{if(d>>1!=126)continue;e=5}if(c+e>a.length){for(;c>6==2;c++);if(c!=a.length)continue;return b}var g,h=d&(1<<8-e-1)-1;for(g=0;g>6!=2)break;h=h<<6|63&i}g==e?h<=65535?b+=String.fromCharCode(h):(h-=65536,b+=String.fromCharCode((h>>10&1023)+55296,(1023&h)+56320)):c--}}else b+=String.fromCharCode(d)}return b}var f=a("./convert.js");b.exports={toUtf8Bytes:d,toUtf8String:e}},{"./convert.js":61}],77:[function(a,b,c){function d(a){return(1<127)throw new Error("passwords with non-ASCII characters not supported in this environment")}else b="";a=m.toUtf8Bytes(a,"NFKD");var e=m.toUtf8Bytes("mnemonic"+b,"NFKD");return m.hexlify(m.pbkdf2(a,e,2048,64,m.createSha512Hmac))}function h(a){var b=a.toLowerCase().split(" ");if(b.length%3!==0)throw new Error("invalid mnemonic");for(var c=m.arrayify(new Uint8Array(Math.ceil(11*b.length/8))),e=0,f=0;f>3]|=1<<7-e%8),e++}var i=32*b.length/3,j=b.length/3,k=d(j),n=m.arrayify(m.sha256(c.slice(0,i/8)))[0];if(n&=k,n!==(c[c.length-1]&k))throw new Error("invalid checksum");return m.hexlify(c.slice(0,i/8))}function i(a){if(a=m.arrayify(a),a.length%4!==0||a.length<16||a.length>32)throw new Error("invalid entropy");for(var b=[0],c=11,f=0;f8?(b[b.length-1]<<=8,b[b.length-1]|=a[f],c-=8):(b[b.length-1]<<=c,b[b.length-1]|=a[f]>>8-c,b.push(a[f]&e(8-c)),c+=3);var g=m.arrayify(m.sha256(a))[0],h=a.length/4;g&=d(h),b[b.length-1]<<=h,b[b.length-1]|=g>>8-h;for(var f=0;f=o)throw new Error("cannot derive child of neutered node");throw new Error("not implemented")}var b=new Uint8Array(37);a&o?b.set(m.arrayify(this.privateKey),1):b.set(this._keyPair.getPublic().encode(null,!0));for(var c=24;c>=0;c-=8)b[33+(c>>3)]=a>>24-c&255;var d=m.arrayify(m.createSha512Hmac(this.chainCode).update(b).digest()),e=m.bigNumberify(d.slice(0,32)),g=(d.slice(32),e.add("0x"+this._keyPair.getPrivate("hex")).mod("0x"+k.curve.n.toString(16)));return new f(k.keyFromPrivate(m.arrayify(g)),d.slice(32),a,this.depth+1)}),m.defineProperty(f.prototype,"derivePath",function(a){var b=a.split("/");if(0===b.length||"m"===b[0]&&0!==this.depth)throw new Error("invalid path");"m"===b[0]&&b.shift();for(var c=this,d=0;d=o)throw new Error("invalid path index - "+e);c=c._derive(o+f)}else{if(!e.match(/^[0-9]+$/))throw new Error("invlaid path component - "+e);var f=parseInt(e);if(f>=o)throw new Error("invalid path index - "+e);c=c._derive(f)}}return c}),m.defineProperty(f,"fromMnemonic",function(a){return h(a),f.fromSeed(g(a))}),m.defineProperty(f,"fromSeed",function(a){if(a=m.arrayify(a),a.length<16||a.length>64)throw new Error("invalid seed");var b=m.arrayify(m.createSha512Hmac(n).update(a).digest());return new f(k.keyFromPrivate(b.slice(0,32)),b.slice(32),0,0,0)}),b.exports={fromMnemonic:f.fromMnemonic,fromSeed:f.fromSeed,mnemonicToEntropy:h,entropyToMnemonic:i,mnemonicToSeed:g,isValidMnemonic:j}},{"../utils/bignumber.js":57,"../utils/convert.js":61,"../utils/hmac":64,"../utils/pbkdf2.js":69,"../utils/properties.js":70,"../utils/sha2":72,"../utils/utf8.js":76,"./words.json":82,elliptic:9}],78:[function(a,b,c){"use strict";var d=a("./wallet"),e=a("./hdnode"),f=a("./signing-key");b.exports={HDNode:e,Wallet:d,SigningKey:f}},{"./hdnode":77,"./signing-key":80,"./wallet":81}],79:[function(a,b,c){"use strict";function d(a){return"string"==typeof a&&"0x"!==a.substring(0,2)&&(a="0x"+a),m.arrayify(a)}function e(a,b){for(a=String(a);a.length0){var e=new Error("invalid "+b.name);throw e.reason="wrong length",e.value=c,e}if(b.maxLength&&(c=g.stripZeros(c),c.length>b.maxLength)){var e=new Error("invalid "+b.name);throw e.reason="too long",e.value=c,e}d.push(g.hexlify(c))}),b&&(d.push(g.hexlify(b)),d.push("0x"),d.push("0x"));var e=g.keccak256(g.RLP.encode(d)),f=c.signDigest(e),h=27+f.recoveryParam;return b&&(d.pop(),d.pop(),d.pop(),h+=2*b+8),d.push(g.hexlify(h)),d.push(f.r),d.push(f.s),g.RLP.encode(d)})}function e(a){var b=g.concat([g.toUtf8Bytes("Ethereum Signed Message:\n"),g.toUtf8Bytes(String(a.length)),"string"==typeof a?g.toUtf8Bytes(a):a]);return g.keccak256(b)}var f=a("scrypt-js"),g=function(){var b=a("../utils/convert");return{defineProperty:a("../utils/properties").defineProperty,arrayify:b.arrayify,concat:b.concat,hexlify:b.hexlify,stripZeros:b.stripZeros,hexZeroPad:b.hexZeroPad,bigNumberify:a("../utils/bignumber").bigNumberify,toUtf8Bytes:a("../utils/utf8").toUtf8Bytes,getAddress:a("../utils/address").getAddress,keccak256:a("../utils/keccak256"),randomBytes:a("../utils").randomBytes,RLP:a("../utils/rlp")}}(),h=a("../utils/errors"),i=a("./hdnode"),j=a("./secret-storage"),k=a("./signing-key");a("setimmediate");var l="m/44'/60'/0'/0/0",m=[{name:"nonce",maxLength:32},{name:"gasPrice",maxLength:32},{name:"gasLimit",maxLength:32},{name:"to",length:20},{name:"value",maxLength:32},{name:"data"}];g.defineProperty(d,"parseTransaction",function(a){a=g.hexlify(a,"rawTransaction");var b=g.RLP.decode(a);if(9!==b.length)throw new Error("invalid transaction");var c=[],d={};m.forEach(function(a,e){d[a.name]=b[e],c.push(b[e])}),d.to&&("0x"==d.to?delete d.to:d.to=g.getAddress(d.to)),["gasPrice","gasLimit","nonce","value"].forEach(function(a){d[a]&&(0===d[a].length?d[a]=g.bigNumberify(0):d[a]=g.bigNumberify(d[a]))}),d.nonce?d.nonce=d.nonce.toNumber():d.nonce=0;var e=g.arrayify(b[6]),f=g.arrayify(b[7]),h=g.arrayify(b[8]);if(e.length>=1&&f.length>=1&&f.length<=32&&h.length>=1&&h.length<=32){d.v=g.bigNumberify(e).toNumber(),d.r=b[7],d.s=b[8];var i=(d.v-35)/2;i<0&&(i=0),i=parseInt(i),d.chainId=i;var j=d.v-27;i&&(c.push(g.hexlify(i)),c.push("0x"),c.push("0x"),j-=2*i+8);var l=g.keccak256(g.RLP.encode(c));try{d.from=k.recover(l,f,h,j)}catch(n){console.log(n)}}return d}),g.defineProperty(d.prototype,"getAddress",function(){return this.address}),g.defineProperty(d.prototype,"getBalance",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,a)}),g.defineProperty(d.prototype,"getTransactionCount",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,a)}),g.defineProperty(d.prototype,"estimateGas",function(a){if(!this.provider)throw new Error("missing provider");var b={};return["from","to","data","value"].forEach(function(c){null!=a[c]&&(b[c]=a[c])}),null==a.from&&(b.from=this.address),this.provider.estimateGas(b)}),g.defineProperty(d.prototype,"sendTransaction",function(a){if(!this.provider)throw new Error("missing provider");if(!a||"object"!=typeof a)throw new Error("invalid transaction object");var b=a.gasLimit;null==b&&(b=this.defaultGasLimit);var c=this,e=null;e=a.gasPrice?Promise.resolve(a.gasPrice):this.provider.getGasPrice();var f=null;f=a.nonce?Promise.resolve(a.nonce):this.provider.getTransactionCount(c.address,"pending");var h=this.provider.chainId,i=null;i=a.to?this.provider.resolveName(a.to):Promise.resolve(void 0);var j=g.hexlify(a.data||"0x"),k=g.hexlify(a.value||0);return Promise.all([e,f,i]).then(function(a){var e=c.sign({to:a[2],data:j,gasLimit:b,gasPrice:a[0],nonce:a[1],value:k,chainId:h});return c.provider.sendTransaction(e).then(function(a){var b=d.parseTransaction(e);return b.hash=a,b.wait=function(){return c.provider.waitForTransaction(a)},b})})}),g.defineProperty(d.prototype,"send",function(a,b,c){return c||(c={}),this.sendTransaction({to:a,gasLimit:c.gasLimit,gasPrice:c.gasPrice,nonce:c.nonce,value:b})}),g.defineProperty(d.prototype,"signMessage",function(a){var b=new k(this.privateKey),c=b.signDigest(e(a));return g.hexZeroPad(c.r,32)+g.hexZeroPad(c.s,32).substring(2)+(c.recoveryParam?"1c":"1b")}),g.defineProperty(d,"verifyMessage",function(a,b){if(b=g.hexlify(b),132!=b.length)throw new Error("invalid signature");var c=e(a),d=parseInt(b.substring(130),16);if(d>=27&&(d-=27),d<0)throw new Error("invalid signature");return k.recover(c,b.substring(0,66),"0x"+b.substring(66,130),d)}),g.defineProperty(d.prototype,"encrypt",function(a,b,c){if("function"!=typeof b||c||(c=b,b={}),c&&"function"!=typeof c)throw new Error("invalid callback");if(b||(b={}),this.mnemonic){var d={};for(var e in b)d[e]=b[e];b=d,b.mnemonic=this.mnemonic,b.path=this.path}return j.encrypt(this.privateKey,a,b,c)}),g.defineProperty(d,"isEncryptedWallet",function(a){return j.isValidWallet(a)||j.isCrowdsaleWallet(a)}),g.defineProperty(d,"createRandom",function(a){var b=g.randomBytes(16);a||(a={}),a.extraEntropy&&(b=g.keccak256(g.concat([b,a.extraEntropy])).substring(0,34));var c=i.entropyToMnemonic(b);return d.fromMnemonic(c,a.path)}),g.defineProperty(d,"fromEncryptedWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return new Promise(function(e,f){if(j.isCrowdsaleWallet(a))try{var h=j.decryptCrowdsale(a,b);e(new d(h))}catch(i){f(i)}else j.isValidWallet(a)?j.decrypt(a,b,c).then(function(a){var b=new d(a);a.mnemonic&&a.path&&(g.defineProperty(b,"mnemonic",a.mnemonic),g.defineProperty(b,"path",a.path)),e(b)},function(a){f(a)}):f("invalid wallet JSON")})}),g.defineProperty(d,"fromMnemonic",function(a,b){b||(b=l);var c=i.fromMnemonic(a).derivePath(b),e=new d(c.privateKey);return g.defineProperty(e,"mnemonic",a),g.defineProperty(e,"path",b),e}),g.defineProperty(d,"fromBrainWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return a="string"==typeof a?g.toUtf8Bytes(a,"NFKC"):g.arrayify(a,"password"),b="string"==typeof b?g.toUtf8Bytes(b,"NFKC"):g.arrayify(b,"password"),new Promise(function(e,h){f(b,a,1<<18,8,1,32,function(a,b,f){if(a)h(a);else if(f)e(new d(g.hexlify(f)));else if(c)return c(b)})})}),b.exports=d},{"../utils":66,"../utils/address":56,"../utils/bignumber":57,"../utils/convert":61,"../utils/errors":63,"../utils/keccak256":67,"../utils/properties":70,"../utils/rlp":71,"../utils/utf8":76,"./hdnode":77,"./secret-storage":79,"./signing-key":80,"scrypt-js":41,setimmediate:42}],82:[function(a,b,c){b.exports="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; },{}]},{},[4])(4)}); \ No newline at end of file diff --git a/package.json b/package.json index 14d057043..52c5d5d57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ethers", - "version": "3.0.11", + "version": "3.0.12", "description": "Ethereum wallet library.", "main": "index.js", "scripts": { @@ -35,6 +35,7 @@ "browser": { "fs": "./tests/browser-fs.js", "zlib": "browserify-zlib", + "./utils/base64.js": "./utils/browser-base64.js", "./utils/random-bytes.js": "./utils/browser-random-bytes.js", "./providers/ipc-provider.js": "./utils/empty.js", "xmlhttprequest": "./providers/browser-xmlhttprequest.js" diff --git a/providers/json-rpc-provider.js b/providers/json-rpc-provider.js index 92f48529d..88f02b239 100644 --- a/providers/json-rpc-provider.js +++ b/providers/json-rpc-provider.js @@ -159,7 +159,7 @@ function JsonRpcProvider(url, network) { network = Provider.getNetwork(url); url = null; } catch (error) { } - } else { + } else if (url && url.url == null) { network = url; url = null; } diff --git a/providers/provider.js b/providers/provider.js index d762e9acc..871459628 100644 --- a/providers/provider.js +++ b/providers/provider.js @@ -8,6 +8,7 @@ var networks = require('./networks.json'); var utils = (function() { var convert = require('../utils/convert'); + var utf8 = require('../utils/utf8'); return { defineProperty: require('../utils/properties').defineProperty, @@ -24,14 +25,19 @@ var utils = (function() { hexStripZeros: convert.hexStripZeros, stripZeros: convert.stripZeros, + base64: require('../utils/base64'), + namehash: require('../utils/namehash'), - toUtf8String: require('../utils/utf8').toUtf8String, + toUtf8String: utf8.toUtf8String, + toUtf8Bytes: utf8.toUtf8Bytes, RLP: require('../utils/rlp'), } })(); +var errors = require('../utils/errors'); + function copyObject(obj) { var result = {}; for (var key in obj) { result[key] = obj[key]; } @@ -561,17 +567,36 @@ utils.defineProperty(Provider, 'getNetwork', function(network) { utils.defineProperty(Provider, 'networks', networks); utils.defineProperty(Provider, 'fetchJSON', function(url, json, processFunc) { + var headers = [ ]; + + if (typeof(url) === 'object' && url.url != null && url.user != null && url.password != null) { + if (url.url.substring(0, 6) !== 'https:' && url.forceInsecure !== true) { + errors.throwError('basic authentication requires a secure https url', errors.INVALID_ARGUMENT, { arg: 'url', url: url.url, user: url.user, password: '[REDACTED]' }); + } + + var authorization = url.user + ':' + url.password; + headers.push({ + key: 'Authorization', + value: 'Basic ' + utils.base64.encode(utils.toUtf8Bytes(authorization)) + }); + + url = url.url; + } return new Promise(function(resolve, reject) { var request = new XMLHttpRequest(); if (json) { request.open('POST', url, true); - request.setRequestHeader('Content-Type','application/json'); + headers.push({ key: 'Content-Type', value: 'application/json' }); } else { request.open('GET', url, true); } + headers.forEach(function(header) { + request.setRequestHeader(header.key, header.value); + }); + request.onreadystatechange = function() { if (request.readyState !== 4) { return; } diff --git a/tests/test-providers.js b/tests/test-providers.js index bee9afc49..5036dc5cc 100644 --- a/tests/test-providers.js +++ b/tests/test-providers.js @@ -407,3 +407,47 @@ describe('Test extra Etherscan operations', function() { }); }); }); + +describe('Test Basic Authentication', function() { + // https://stackoverflow.com/questions/6509278/authentication-test-servers#16756383 + + var Provider = require('..').providers.Provider; + + function test(name, url) { + it('tests ' + name, function() { + return Provider.fetchJSON(url).then(function(data) { + assert.equal(data.authenticated, true, 'authenticates user'); + }); + }); + } + + var secure = { + url: 'https://httpbin.org/basic-auth/user/passwd', + user: 'user', + password: 'passwd' + }; + + var insecure = { + url: 'http://httpbin.org/basic-auth/user/passwd', + user: 'user', + password: 'passwd' + }; + + var insecureForced = { + url: 'http://httpbin.org/basic-auth/user/passwd', + user: 'user', + password: 'passwd', + forceInsecure: true + }; + + test('secure url', secure); + test('insecure url', insecureForced); + + it('tests insecure connections fail', function() { + assert.throws(function() { + Provider.fetchJSON(insecure); + }, function(error) { + return (error.reason === 'basic authentication requires a secure https url'); + }, 'throws an exception for insecure connections'); + }) +}); diff --git a/tests/test-utils.js b/tests/test-utils.js index acdd3c76e..2a843bd92 100644 --- a/tests/test-utils.js +++ b/tests/test-utils.js @@ -211,3 +211,18 @@ describe('Test Solidity splitSignature', function() { } }); }); + +describe('Test Base64 coder', function() { + + var utf8 = require('../utils/utf8') + var base64 = require('../utils').base64; + + // https://en.wikipedia.org/wiki/Base64#Examples + it('encodes and decodes the example from wikipedia', function() { + var decodedText = 'Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.'; + var decoded = utf8.toUtf8Bytes(decodedText); + var encoded = 'TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4='; + assert.equal(base64.encode(decoded), encoded, 'encodes to base64 string'); + assert.equal(utf8.toUtf8String(base64.decode(encoded)), decodedText, 'decodes from base64 sstring'); + }); +}); diff --git a/utils/base64.js b/utils/base64.js new file mode 100644 index 000000000..6f9381aaf --- /dev/null +++ b/utils/base64.js @@ -0,0 +1,13 @@ +'use strict'; + +var convert = require('./convert'); + +module.exports = { + decode: function(textData) { + return convert.arrayify(new Buffer(textData, 'base64')); + }, + + encode: function(data) { + return (new Buffer(convert.arrayify(data))).toString('base64'); + } +}; diff --git a/utils/browser-base64.js b/utils/browser-base64.js new file mode 100644 index 000000000..319a83c91 --- /dev/null +++ b/utils/browser-base64.js @@ -0,0 +1,24 @@ +'use strict'; + +var convert = require('./convert'); + +module.exports = { + decode: function(textData) { + textData = atob(textData); + var data = []; + for (var i = 0; i < textData.length; i++) { + data.push(textData.charCodeAt(i)); + } + return convert.arrayify(data); + }, + encode: function(data) { + data = convert.arrayify(data); + var textData = ''; + for (var i = 0; i < data.length; i++) { + textData += String.fromCharCode(data[i]); + } + return btoa(textData); + } +}; + + diff --git a/utils/index.js b/utils/index.js index 37ec15a39..7ecd626fd 100644 --- a/utils/index.js +++ b/utils/index.js @@ -5,6 +5,7 @@ var address = require('./address'); var AbiCoder = require('./abi-coder'); +var base64 = require('./base64'); var bigNumber = require('./bignumber'); var contractAddress = require('./contract-address'); var convert = require('./convert'); @@ -39,6 +40,8 @@ module.exports = { padZeros: convert.padZeros, stripZeros: convert.stripZeros, + base64: base64, + bigNumberify: bigNumber.bigNumberify, BigNumber: bigNumber.BigNumber,