diff --git a/b.bash b/b.bash index f7a50d7..5368639 100755 --- a/b.bash +++ b/b.bash @@ -1,3 +1,5 @@ #!/bin/sh browserify -r multihashes -r Buffer -r bs58 -r utf8 -r web3 -r etherid-js -r cookies-js -r progressbar.js -r sweetalert | uglifyjs > www/js/bundle.js + +#browserify -r multihashes -r Buffer -r bs58 -r utf8 -r web3 -r etherid-js -r cookies-js -r progressbar.js -r sweetalert > www/js/bundle.js diff --git a/node_modules/base-x/index.js b/node_modules/base-x/index.js index a3732ef..9b0ee3f 100644 --- a/node_modules/base-x/index.js +++ b/node_modules/base-x/index.js @@ -6,10 +6,6 @@ // Merged Buffer refactorings from base58-native by Stephen Pair // Copyright (c) 2013 BitPay Inc -/** - * @param {string} ALPHABET - * @return {encode: function, decode: function} - */ module.exports = function base (ALPHABET) { var ALPHABET_MAP = {} var BASE = ALPHABET.length @@ -20,20 +16,12 @@ module.exports = function base (ALPHABET) { ALPHABET_MAP[ALPHABET.charAt(i)] = i } - /** - * @param {(Buffer|number[])} source - * @return {string} - */ function encode (source) { if (source.length === 0) return '' var digits = [0] for (var i = 0; i < source.length; ++i) { - var carry = (digits[0] << 8) + source[i] - digits[0] = carry % BASE - carry = (carry / BASE) | 0 - - for (var j = 1; j < digits.length; ++j) { + for (var j = 0, carry = source[i]; j < digits.length; ++j) { carry += digits[j] << 8 digits[j] = carry % BASE carry = (carry / BASE) | 0 @@ -60,10 +48,6 @@ module.exports = function base (ALPHABET) { return digits.join('') } - /** - * @param {string} string - * @return {number[]} - */ function decode (string) { if (string.length === 0) return [] @@ -72,11 +56,7 @@ module.exports = function base (ALPHABET) { var value = ALPHABET_MAP[string[i]] if (value === undefined) throw new Error('Non-base' + BASE + ' character') - var carry = bytes[0] * BASE + value - bytes[0] = carry & 0xff - carry >>= 8 - - for (var j = 1; j < bytes.length; ++j) { + for (var j = 0, carry = value; j < bytes.length; ++j) { carry += bytes[j] * BASE bytes[j] = carry & 0xff carry >>= 8 diff --git a/node_modules/base-x/package.json b/node_modules/base-x/package.json index 30eee2e..e1fca15 100644 --- a/node_modules/base-x/package.json +++ b/node_modules/base-x/package.json @@ -1,62 +1,7 @@ { - "_args": [ - [ - "base-x@^1.0.1", - "/Users/alexn/projects/etherid.org/node_modules/bs58" - ] - ], - "_from": "base-x@>=1.0.1 <2.0.0", - "_id": "base-x@1.0.3", - "_inCache": true, - "_installable": true, - "_location": "/base-x", - "_nodeVersion": "5.4.1", - "_npmUser": { - "email": "email@dcousens.com", - "name": "dcousens" - }, - "_npmVersion": "3.5.3", - "_phantomChildren": {}, - "_requested": { - "name": "base-x", - "raw": "base-x@^1.0.1", - "rawSpec": "^1.0.1", - "scope": null, - "spec": ">=1.0.1 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/bs58" - ], - "_resolved": "https://registry.npmjs.org/base-x/-/base-x-1.0.3.tgz", - "_shasum": "97ad0e37a363eff347646dc61c4868729fddcb36", - "_shrinkwrap": null, - "_spec": "base-x@^1.0.1", - "_where": "/Users/alexn/projects/etherid.org/node_modules/bs58", - "author": { - "name": "Daniel Cousens" - }, - "bugs": { - "url": "https://github.com/cryptocoinjs/base-x/issues" - }, - "dependencies": {}, + "name": "base-x", + "version": "1.0.4", "description": "Fast base encoding / decoding of any given alphabet", - "devDependencies": { - "benchmark": "^2.0.0", - "mocha": "^2.3.4", - "standard": "^5.4.1" - }, - "directories": {}, - "dist": { - "shasum": "97ad0e37a363eff347646dc61c4868729fddcb36", - "tarball": "http://registry.npmjs.org/base-x/-/base-x-1.0.3.tgz" - }, - "files": [ - "README.md", - "index.js" - ], - "gitHead": "71235a53df859f1e78083c3dc0b058156adc05fa", - "homepage": "https://github.com/cryptocoinjs/base-x", "keywords": [ "base-x", "base58", @@ -69,17 +14,18 @@ "encode", "encoding" ], + "homepage": "https://github.com/cryptocoinjs/base-x", + "bugs": { + "url": "https://github.com/cryptocoinjs/base-x/issues" + }, "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "dcousens", - "email": "email@dcousens.com" - } + "author": { + "name": "Daniel Cousens" + }, + "files": [ + "index.js" ], - "name": "base-x", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", + "main": "index.js", "repository": { "type": "git", "url": "git+https://github.com/cryptocoinjs/base-x.git" @@ -88,7 +34,38 @@ "benchmark:node": "node benchmark/benchmark.js", "standard": "standard", "test": "npm run unit && npm run standard", - "unit": "mocha" + "unit": "tape test/*.js" }, - "version": "1.0.3" + "devDependencies": { + "benchmark": "^2.0.0", + "standard": "^5.4.1", + "tape": "^4.5.1" + }, + "gitHead": "fd05cce3a060b617d61991b521783a98c9524c09", + "_id": "base-x@1.0.4", + "_shasum": "309b0bf6e6da33b760797d7ba838a7a305478278", + "_from": "base-x@1.0.4", + "_npmVersion": "3.8.1", + "_nodeVersion": "5.8.0", + "_npmUser": { + "name": "dcousens", + "email": "email@dcousens.com" + }, + "dist": { + "shasum": "309b0bf6e6da33b760797d7ba838a7a305478278", + "tarball": "http://registry.npmjs.org/base-x/-/base-x-1.0.4.tgz" + }, + "maintainers": [ + { + "name": "dcousens", + "email": "email@dcousens.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/base-x-1.0.4.tgz_1458269490929_0.42356922710314393" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/base-x/-/base-x-1.0.4.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bignumber.js/README.md b/node_modules/bignumber.js/README.md index 63ac065..191a030 100644 --- a/node_modules/bignumber.js/README.md +++ b/node_modules/bignumber.js/README.md @@ -46,7 +46,7 @@ var BigNumber = require('bignumber.js'); To load with AMD loader libraries such as [requireJS](http://requirejs.org/): ```javascript -require(['path/to/bignumber'], function(BigNumber) { +require(['path/to/bignumber'], function(BigNumber) { // Use BigNumber here in local scope. No global BigNumber. }); ``` @@ -76,10 +76,10 @@ y = new BigNumber('zz.9', 36) // "1295.25" z = x.plus(y) // "1306.25" ``` -A BigNumber is immutable in the sense that it is not changed by its methods. +A BigNumber is immutable in the sense that it is not changed by its methods. ```javascript -0.3 - 0.1 // 0.19999999999999998 +0.3 - 0.1 // 0.19999999999999998 x = new BigNumber(0.3) x.minus(0.1) // "0.2" x // "0.3" @@ -202,9 +202,9 @@ To test a single method, e.g. $ node test/toFraction -For the browser, see *every-test.html* and *single-test.html* in the *test/browser* directory. +For the browser, see *every-test.html* and *single-test.html* in the *test/browser* directory. -*bignumber-vs-number.html* enables some of the methods of bignumber.js to be compared with those of JavaScript's number type. +*bignumber-vs-number.html* enables some of the methods of bignumber.js to be compared with those of JavaScript's number type. ## Versions @@ -230,7 +230,7 @@ A source map will also be created in the root directory. ## Feedback -Open an issue, or email +Open an issue, or email Michael @@ -244,6 +244,14 @@ See [LICENCE](https://github.com/MikeMcl/bignumber.js/blob/master/LICENCE). ## Change Log +####2.3.0 +* 07/03/2016 +* #86 Add modulus parameter to `toPower`. + +####2.2.0 +* 03/03/2016 +* #91 Permit larger JS integers. + ####2.1.4 * 15/12/2015 * Correct UMD. @@ -340,7 +348,7 @@ See [LICENCE](https://github.com/MikeMcl/bignumber.js/blob/master/LICENCE). ####1.1.0 * 1/8/2013 -* Allow numbers with trailing radix point. +* Allow numbers with trailing radix point. ####1.0.1 * Bugfix: error messages with incorrect method name diff --git a/node_modules/bignumber.js/bignumber.js b/node_modules/bignumber.js/bignumber.js index 8f19dae..0dfcd22 100644 --- a/node_modules/bignumber.js/bignumber.js +++ b/node_modules/bignumber.js/bignumber.js @@ -1,13 +1,13 @@ -/*! bignumber.js v2.1.3 https://github.com/MikeMcl/bignumber.js/LICENCE */ +/*! bignumber.js v2.3.0 https://github.com/MikeMcl/bignumber.js/LICENCE */ ;(function (globalObj) { 'use strict'; /* - bignumber.js v2.1.3 + bignumber.js v2.3.0 A JavaScript library for arbitrary-precision arithmetic. https://github.com/MikeMcl/bignumber.js - Copyright (c) 2015 Michael Mclaughlin + Copyright (c) 2016 Michael Mclaughlin MIT Expat Licence */ @@ -260,7 +260,9 @@ // Disallow numbers with over 15 significant digits if number type. // 'new BigNumber() number type has more than 15 significant digits: {n}' - if ( num && ERRORS && len > 15 ) raise( id, tooManyDigits, x.s * n ); + if ( num && ERRORS && len > 15 && ( n > MAX_SAFE_INTEGER || n !== mathfloor(n) ) ) { + raise( id, tooManyDigits, x.s * n ); + } e = e - i - 1; @@ -2361,50 +2363,85 @@ /* * Return a BigNumber whose value is the value of this BigNumber raised to the power n. + * If m is present, return the result modulo m. * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. - * If POW_PRECISION is not 0, round to POW_PRECISION using ROUNDING_MODE. + * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using + * ROUNDING_MODE. + * + * The modular power operation works efficiently when x, n, and m are positive integers, + * otherwise it is equivalent to calculating x.toPower(n).modulo(m) (with POW_PRECISION 0). * - * n {number} Integer, -9007199254740992 to 9007199254740992 inclusive. - * (Performs 54 loop iterations for n of 9007199254740992.) + * n {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. + * [m] {number|string|BigNumber} The modulus. * * 'pow() exponent not an integer: {n}' * 'pow() exponent out of range: {n}' + * + * Performs 54 loop iterations for n of 9007199254740991. */ - P.toPower = P.pow = function (n) { - var k, y, + P.toPower = P.pow = function ( n, m ) { + var k, y, z, i = mathfloor( n < 0 ? -n : +n ), x = this; + if ( m != null ) { + id = 23; + m = new BigNumber(m); + } + // Pass ±Infinity to Math.pow if exponent is out of range. if ( !isValidInt( n, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER, 23, 'exponent' ) && ( !isFinite(n) || i > MAX_SAFE_INTEGER && ( n /= 0 ) || - parseFloat(n) != n && !( n = NaN ) ) ) { - return new BigNumber( Math.pow( +x, n ) ); + parseFloat(n) != n && !( n = NaN ) ) || n == 0 ) { + k = Math.pow( +x, n ); + return new BigNumber( m ? k % m : k ); + } + + if (m) { + if ( n > 1 && x.gt(ONE) && x.isInt() && m.gt(ONE) && m.isInt() ) { + x = x.mod(m); + } else { + z = m; + + // Nullify m so only a single mod operation is performed at the end. + m = null; + } + } else if (POW_PRECISION) { + + // Truncating each coefficient array to a length of k after each multiplication + // equates to truncating significant digits to POW_PRECISION + [28, 41], + // i.e. there will be a minimum of 28 guard digits retained. + // (Using + 1.5 would give [9, 21] guard digits.) + k = mathceil( POW_PRECISION / LOG_BASE + 2 ); } - // Truncating each coefficient array to a length of k after each multiplication equates - // to truncating significant digits to POW_PRECISION + [28, 41], i.e. there will be a - // minimum of 28 guard digits retained. (Using + 1.5 would give [9, 21] guard digits.) - k = POW_PRECISION ? mathceil( POW_PRECISION / LOG_BASE + 2 ) : 0; y = new BigNumber(ONE); for ( ; ; ) { - if ( i % 2 ) { y = y.times(x); if ( !y.c ) break; - if ( k && y.c.length > k ) y.c.length = k; + if (k) { + if ( y.c.length > k ) y.c.length = k; + } else if (m) { + y = y.mod(m); + } } i = mathfloor( i / 2 ); if ( !i ) break; - x = x.times(x); - if ( k && x.c && x.c.length > k ) x.c.length = k; + if (k) { + if ( x.c && x.c.length > k ) x.c.length = k; + } else if (m) { + x = x.mod(m); + } } + if (m) return y; if ( n < 0 ) y = ONE.div(y); - return k ? round( y, POW_PRECISION, ROUNDING_MODE ) : y; + + return z ? y.mod(z) : k ? round( y, POW_PRECISION, ROUNDING_MODE ) : y; }; diff --git a/node_modules/bignumber.js/bignumber.js.map b/node_modules/bignumber.js/bignumber.js.map index 906e789..27f146a 100644 --- a/node_modules/bignumber.js/bignumber.js.map +++ b/node_modules/bignumber.js/bignumber.js.map @@ -1 +1 @@ -{"version":3,"file":"bignumber.min.js","sources":["bignumber.js"],"names":["globalObj","constructorFactory","configObj","BigNumber","n","b","c","e","i","num","len","str","x","this","ERRORS","raise","isValidInt","id","round","DECIMAL_PLACES","ROUNDING_MODE","RegExp","ALPHABET","slice","test","parseNumeric","s","replace","length","tooManyDigits","charCodeAt","convertBase","isNumeric","indexOf","search","substring","MAX_EXP","MIN_EXP","LOG_BASE","push","baseOut","baseIn","sign","d","k","r","xc","y","dp","rm","toLowerCase","POW_PRECISION","pow","toBaseOut","toFixedPoint","coeffToString","pop","div","unshift","charAt","format","caller","c0","ne","roundingMode","toString","TO_EXP_NEG","toExponential","maxOrMin","args","method","m","isArray","call","intValidatorWithErrors","min","max","name","truncate","normalise","j","msg","val","error","Error","sd","ni","rd","pows10","POWS_TEN","out","mathceil","mathfloor","BASE","P","prototype","ONE","TO_EXP_POS","CRYPTO","MODULO_MODE","FORMAT","decimalSeparator","groupSeparator","groupSize","secondaryGroupSize","fractionGroupSeparator","fractionGroupSize","another","ROUND_UP","ROUND_DOWN","ROUND_CEIL","ROUND_FLOOR","ROUND_HALF_UP","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_CEIL","ROUND_HALF_FLOOR","EUCLID","config","v","p","a","arguments","o","has","hasOwnProperty","MAX","intValidatorNoErrors","notBool","cryptoObj","lt","gt","random","pow2_53","random53bitInt","Math","rand","getRandomValues","Uint32Array","randomBytes","copy","shift","multiply","base","temp","xlo","xhi","carry","klo","SQRT_BASE","khi","compare","aL","bL","cmp","subtract","more","prod","prodL","q","qc","rem","remL","rem0","xi","xL","yc0","yL","yz","yc","NaN","bitFloor","basePrefix","dotAfter","dotBefore","isInfinityOrNaN","whitespaceOrPlus","isNaN","p1","p2","absoluteValue","abs","ceil","comparedTo","decimalPlaces","dividedBy","dividedToIntegerBy","divToInt","equals","eq","floor","greaterThan","greaterThanOrEqualTo","gte","isFinite","isInteger","isInt","isNegative","isNeg","isZero","lessThan","lessThanOrEqualTo","lte","minus","sub","t","xLTy","plus","xe","ye","reverse","modulo","mod","times","negated","neg","add","precision","z","MAX_SAFE_INTEGER","squareRoot","sqrt","rep","half","mul","xcL","ycL","ylo","yhi","zc","sqrtBase","toDigits","toFixed","toFormat","arr","split","g1","g2","intPart","fractionPart","intDigits","substr","toFraction","md","d0","d2","exp","n0","n1","d1","toNumber","toPower","parseFloat","toPrecision","truncated","trunc","valueOf","toJSON","l","obj","Object","arrL","crypto","define","amd","module","exports","require","self","Function"],"mappings":";CAEC,SAAWA,GACR,YAuCA,SAASC,GAAmBC,GAiHxB,QAASC,GAAWC,EAAGC,GACnB,GAAIC,GAAGC,EAAGC,EAAGC,EAAKC,EAAKC,EACnBC,EAAIC,IAGR,MAAQD,YAAaT,IAIjB,MADIW,IAAQC,EAAO,GAAI,+BAAgCX,GAChD,GAAID,GAAWC,EAAGC,EAK7B,IAAU,MAALA,GAAcW,EAAYX,EAAG,EAAG,GAAIY,EAAI,QA4BtC,CAMH,GALAZ,EAAQ,EAAJA,EACJM,EAAMP,EAAI,GAIA,IAALC,EAED,MADAO,GAAI,GAAIT,GAAWC,YAAaD,GAAYC,EAAIO,GACzCO,EAAON,EAAGO,EAAiBP,EAAEL,EAAI,EAAGa,EAK/C,KAAOX,EAAkB,gBAALL,KAAuB,EAAJA,GAAS,IAC7C,GAAMiB,QAAQ,OAAUf,EAAI,IAAMgB,EAASC,MAAO,EAAGlB,GAAM,MAC1D,SAAWC,EAAI,MAAU,GAAJD,EAAS,IAAM,IAAOmB,KAAKb,GAChD,MAAOc,GAAcb,EAAGD,EAAKF,EAAKJ,EAGlCI,IACAG,EAAEc,EAAY,EAAR,EAAItB,GAAUO,EAAMA,EAAIY,MAAM,GAAI,IAAO,EAE1CT,GAAUH,EAAIgB,QAAS,YAAa,IAAKC,OAAS,IAGnDb,EAAOE,EAAIY,EAAezB,GAI9BK,GAAM,GAENG,EAAEc,EAA0B,KAAtBf,EAAImB,WAAW,IAAcnB,EAAMA,EAAIY,MAAM,GAAI,IAAO,EAGlEZ,EAAMoB,EAAapB,EAAK,GAAIN,EAAGO,EAAEc,OA9DmB,CAGpD,GAAKtB,YAAaD,GAKd,MAJAS,GAAEc,EAAItB,EAAEsB,EACRd,EAAEL,EAAIH,EAAEG,EACRK,EAAEN,GAAMF,EAAIA,EAAEE,G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I/DP,KAAYA,EAA2B,mBAAR4Q,MAAsBA,KAAOC,SAAS,kBAC3E7Q,EAAUG,UAAYF,KAE3BY"} \ No newline at end of file +{"version":3,"file":"bignumber.min.js","sources":["bignumber.js"],"names":["globalObj","constructorFactory","configObj","BigNumber","n","b","c","e","i","num","len","str","x","this","ERRORS","raise","isValidInt","id","round","DECIMAL_PLACES","ROUNDING_MODE","RegExp","ALPHABET","slice","test","parseNumeric","s","replace","length","tooManyDigits","charCodeAt","convertBase","isNumeric","indexOf","search","substring","MAX_SAFE_INTEGER","mathfloor","MAX_EXP","MIN_EXP","LOG_BASE","push","baseOut","baseIn","sign","d","k","r","xc","y","dp","rm","toLowerCase","POW_PRECISION","pow","toBaseOut","toFixedPoint","coeffToString","pop","div","unshift","charAt","format","caller","c0","ne","roundingMode","toString","TO_EXP_NEG","toExponential","maxOrMin","args","method","m","isArray","call","intValidatorWithErrors","min","max","name","truncate","normalise","j","msg","val","error","Error","sd","ni","rd","pows10","POWS_TEN","out","mathceil","BASE","P","prototype","ONE","TO_EXP_POS","CRYPTO","MODULO_MODE","FORMAT","decimalSeparator","groupSeparator","groupSize","secondaryGroupSize","fractionGroupSeparator","fractionGroupSize","another","ROUND_UP","ROUND_DOWN","ROUND_CEIL","ROUND_FLOOR","ROUND_HALF_UP","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_CEIL","ROUND_HALF_FLOOR","EUCLID","config","v","p","a","arguments","o","has","hasOwnProperty","MAX","intValidatorNoErrors","notBool","cryptoObj","lt","gt","random","pow2_53","random53bitInt","Math","rand","getRandomValues","Uint32Array","randomBytes","copy","shift","multiply","base","temp","xlo","xhi","carry","klo","SQRT_BASE","khi","compare","aL","bL","cmp","subtract","more","prod","prodL","q","qc","rem","remL","rem0","xi","xL","yc0","yL","yz","yc","NaN","bitFloor","basePrefix","dotAfter","dotBefore","isInfinityOrNaN","whitespaceOrPlus","isNaN","p1","p2","absoluteValue","abs","ceil","comparedTo","decimalPlaces","dividedBy","dividedToIntegerBy","divToInt","equals","eq","floor","greaterThan","greaterThanOrEqualTo","gte","isFinite","isInteger","isInt","isNegative","isNeg","isZero","lessThan","lessThanOrEqualTo","lte","minus","sub","t","xLTy","plus","xe","ye","reverse","modulo","mod","times","negated","neg","add","precision","z","squareRoot","sqrt","rep","half","mul","xcL","ycL","ylo","yhi","zc","sqrtBase","toDigits","toFixed","toFormat","arr","split","g1","g2","intPart","fractionPart","intDigits","substr","toFraction","md","d0","d2","exp","n0","n1","d1","toNumber","toPower","parseFloat","toPrecision","truncated","trunc","valueOf","toJSON","l","obj","Object","arrL","crypto","define","amd","module","exports","require","self","Function"],"mappings":";CAEC,SAAWA,GACR,YAuCA,SAASC,GAAmBC,GAiHxB,QAASC,GAAWC,EAAGC,GACnB,GAAIC,GAAGC,EAAGC,EAAGC,EAAKC,EAAKC,EACnBC,EAAIC,IAGR,MAAQD,YAAaT,IAIjB,MADIW,IAAQC,EAAO,GAAI,+BAAgCX,GAChD,GAAID,GAAWC,EAAGC,EAK7B,IAAU,MAALA,GAAcW,EAAYX,EAAG,EAAG,GAAIY,EAAI,QA4BtC,CAMH,GALAZ,EAAQ,EAAJA,EACJM,EAAMP,EAAI,GAIA,IAALC,EAED,MADAO,GAAI,GAAIT,GAAWC,YAAaD,GAAYC,EAAIO,GACzCO,EAAON,EAAGO,EAAiBP,EAAEL,EAAI,EAAGa,EAK/C,KAAOX,EAAkB,gBAALL,KAAuB,EAAJA,GAAS,IAC7C,GAAMiB,QAAQ,OAAUf,EAAI,IAAMgB,EAASC,MAAO,EAAGlB,GAAM,MAC1D,SAAWC,EAAI,MAAU,GAAJD,EAAS,IAAM,IAAOmB,KAAKb,GAChD,MAAOc,GAAcb,EAAGD,EAAKF,EAAKJ,EAGlCI,IACAG,EAAEc,EAAY,EAAR,EAAItB,GAAUO,EAAMA,EAAIY,MAAM,GAAI,IAAO,EAE1CT,GAAUH,EAAIgB,QAAS,YAAa,IAAKC,OAAS,IAGnDb,EAAOE,EAAI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AAKG,IAAOH,EAAGoN,GAAK,KACnChN,GAAOgN,MACKjN,GAAJH,IACRI,EAAMA,EAAIY,MAAO,EAAGhB,GAAM,IAAMI,EAAIY,MAAMhB,GAIlD,OAAOI,GAIX,QAASqE,GAAS5E,GAEd,MADAA,GAAIwP,WAAWxP,GACJ,EAAJA,EAAQyF,EAASzF,GAAKiC,EAAUjC,GAvoF3C,GAAI8H,GAAWzG,EACXO,EAAY,uCACZ6D,EAAW2C,KAAK+C,KAChBlJ,EAAYmG,KAAKuD,MACjB9D,EAAU,iCACV/D,EAAe,gBACfrC,EAAgB,kDAChBP,EAAW,mEACXwE,EAAO,KACPtD,EAAW,GACXJ,EAAmB,iBAEnBuD,GAAY,EAAG,GAAI,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,KAAM,KAAM,KAAM,MAC7E2D,EAAY,IAOZvB,EAAM,GA2nFV,IAznFsB,mBAAVuI,UAAwBpI,EAAYoI,QAynF1B,kBAAVC,SAAwBA,OAAOC,IACvCD,OAAQ,WAAc,MAAOtQ,WAG1B,IAAsB,mBAAVwQ,SAAyBA,OAAOC,SAI/C,GAHAD,OAAOC,QAAUzQ,KAGXiI,EAAY,IAAMA,EAAYyI,QAAQ,UAAkB,MAAOpQ,SAI/DP,KAAYA,EAA2B,mBAAR4Q,MAAsBA,KAAOC,SAAS,kBAC3E7Q,EAAUG,UAAYF,KAE3BY"} \ No newline at end of file diff --git a/node_modules/bignumber.js/bignumber.min.js b/node_modules/bignumber.js/bignumber.min.js index cc583c4..ec19b34 100644 --- a/node_modules/bignumber.js/bignumber.min.js +++ b/node_modules/bignumber.js/bignumber.min.js @@ -1,3 +1,3 @@ -/* bignumber.js v2.1.4 https://github.com/MikeMcl/bignumber.js/LICENCE */ -!function(e){"use strict";function n(e){function E(e,n){var t,r,i,o,u,s,f=this;if(!(f instanceof E))return j&&L(26,"constructor call without new",e),new E(e,n);if(null!=n&&H(n,2,64,M,"base")){if(n=0|n,s=e+"",10==n)return f=new E(e instanceof E?e:s),U(f,P+f.e+1,k);if((o="number"==typeof e)&&0*e!=0||!new RegExp("^-?"+(t="["+N.slice(0,n)+"]+")+"(?:\\."+t+")?$",37>n?"i":"").test(s))return h(f,s,o,n);o?(f.s=0>1/e?(s=s.slice(1),-1):1,j&&s.replace(/^0\.0*|\./,"").length>15&&L(M,v,e),o=!1):f.s=45===s.charCodeAt(0)?(s=s.slice(1),-1):1,s=D(s,10,n,f.s)}else{if(e instanceof E)return f.s=e.s,f.e=e.e,f.c=(e=e.c)?e.slice():e,void(M=0);if((o="number"==typeof e)&&0*e==0){if(f.s=0>1/e?(e=-e,-1):1,e===~~e){for(r=0,i=e;i>=10;i/=10,r++);return f.e=r,f.c=[e],void(M=0)}s=e+""}else{if(!g.test(s=e+""))return h(f,s,o);f.s=45===s.charCodeAt(0)?(s=s.slice(1),-1):1}}for((r=s.indexOf("."))>-1&&(s=s.replace(".","")),(i=s.search(/e/i))>0?(0>r&&(r=i),r+=+s.slice(i+1),s=s.substring(0,i)):0>r&&(r=s.length),i=0;48===s.charCodeAt(i);i++);for(u=s.length;48===s.charCodeAt(--u););if(s=s.slice(i,u+1))if(u=s.length,o&&j&&u>15&&L(M,v,f.s*e),r=r-i-1,r>z)f.c=f.e=null;else if(G>r)f.c=[f.e=0];else{if(f.e=r,f.c=[],i=(r+1)%O,0>r&&(i+=O),u>i){for(i&&f.c.push(+s.slice(0,i)),u-=O;u>i;)f.c.push(+s.slice(i,i+=O));s=s.slice(i),i=O-s.length}else i-=u;for(;i--;s+="0");f.c.push(+s)}else f.c=[f.e=0];M=0}function D(e,n,t,i){var o,u,f,c,a,h,g,p=e.indexOf("."),d=P,m=k;for(37>t&&(e=e.toLowerCase()),p>=0&&(f=J,J=0,e=e.replace(".",""),g=new E(t),a=g.pow(e.length-p),J=f,g.c=s(l(r(a.c),a.e),10,n),g.e=g.c.length),h=s(e,t,n),u=f=h.length;0==h[--f];h.pop());if(!h[0])return"0";if(0>p?--u:(a.c=h,a.e=u,a.s=i,a=C(a,g,d,m,n),h=a.c,c=a.r,u=a.e),o=u+d+1,p=h[o],f=n/2,c=c||0>o||null!=h[o+1],c=4>m?(null!=p||c)&&(0==m||m==(a.s<0?3:2)):p>f||p==f&&(4==m||c||6==m&&1&h[o-1]||m==(a.s<0?8:7)),1>o||!h[0])e=c?l("1",-d):"0";else{if(h.length=o,c)for(--n;++h[--o]>n;)h[o]=0,o||(++u,h.unshift(1));for(f=h.length;!h[--f];);for(p=0,e="";f>=p;e+=N.charAt(h[p++]));e=l(e,u)}return e}function F(e,n,t,i){var o,u,s,c,a;if(t=null!=t&&H(t,0,8,i,w)?0|t:k,!e.c)return e.toString();if(o=e.c[0],s=e.e,null==n)a=r(e.c),a=19==i||24==i&&B>=s?f(a,s):l(a,s);else if(e=U(new E(e),n,t),u=e.e,a=r(e.c),c=a.length,19==i||24==i&&(u>=n||B>=u)){for(;n>c;a+="0",c++);a=f(a,u)}else if(n-=s,a=l(a,u),u+1>c){if(--n>0)for(a+=".";n--;a+="0");}else if(n+=u-c,n>0)for(u+1==c&&(a+=".");n--;a+="0");return e.s<0&&o?"-"+a:a}function _(e,n){var t,r,i=0;for(u(e[0])&&(e=e[0]),t=new E(e[0]);++ie||e>t||e!=c(e))&&L(r,(i||"decimal places")+(n>e||e>t?" out of range":" not an integer"),e),!0}function I(e,n,t){for(var r=1,i=n.length;!n[--i];n.pop());for(i=n[0];i>=10;i/=10,r++);return(t=r+t*O-1)>z?e.c=e.e=null:G>t?e.c=[e.e=0]:(e.e=t,e.c=n),e}function L(e,n,t){var r=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][e]+"() "+n+": "+t);throw r.name="BigNumber Error",M=0,r}function U(e,n,t,r){var i,o,u,s,f,l,c,a=e.c,h=S;if(a){e:{for(i=1,s=a[0];s>=10;s/=10,i++);if(o=n-i,0>o)o+=O,u=n,f=a[l=0],c=f/h[i-u-1]%10|0;else if(l=p((o+1)/O),l>=a.length){if(!r)break e;for(;a.length<=l;a.push(0));f=c=0,i=1,o%=O,u=o-O+1}else{for(f=s=a[l],i=1;s>=10;s/=10,i++);o%=O,u=o-O+i,c=0>u?0:f/h[i-u-1]%10|0}if(r=r||0>n||null!=a[l+1]||(0>u?f:f%h[i-u-1]),r=4>t?(c||r)&&(0==t||t==(e.s<0?3:2)):c>5||5==c&&(4==t||r||6==t&&(o>0?u>0?f/h[i-u]:0:a[l-1])%10&1||t==(e.s<0?8:7)),1>n||!a[0])return a.length=0,r?(n-=e.e+1,a[0]=h[(O-n%O)%O],e.e=-n||0):a[0]=e.e=0,e;if(0==o?(a.length=l,s=1,l--):(a.length=l+1,s=h[O-o],a[l]=u>0?d(f/h[i-u]%h[u])*s:0),r)for(;;){if(0==l){for(o=1,u=a[0];u>=10;u/=10,o++);for(u=a[0]+=s,s=1;u>=10;u/=10,s++);o!=s&&(e.e++,a[0]==b&&(a[0]=1));break}if(a[l]+=s,a[l]!=b)break;a[l--]=0,s=1}for(o=a.length;0===a[--o];a.pop());}e.e>z?e.c=e.e=null:e.et?null!=(e=i[t++]):void 0};return f(n="DECIMAL_PLACES")&&H(e,0,A,2,n)&&(P=0|e),r[n]=P,f(n="ROUNDING_MODE")&&H(e,0,8,2,n)&&(k=0|e),r[n]=k,f(n="EXPONENTIAL_AT")&&(u(e)?H(e[0],-A,0,2,n)&&H(e[1],0,A,2,n)&&(B=0|e[0],$=0|e[1]):H(e,-A,A,2,n)&&(B=-($=0|(0>e?-e:e)))),r[n]=[B,$],f(n="RANGE")&&(u(e)?H(e[0],-A,-1,2,n)&&H(e[1],1,A,2,n)&&(G=0|e[0],z=0|e[1]):H(e,-A,A,2,n)&&(0|e?G=-(z=0|(0>e?-e:e)):j&&L(2,n+" cannot be zero",e))),r[n]=[G,z],f(n="ERRORS")&&(e===!!e||1===e||0===e?(M=0,H=(j=!!e)?x:o):j&&L(2,n+m,e)),r[n]=j,f(n="CRYPTO")&&(e===!!e||1===e||0===e?(V=!(!e||!a),e&&!V&&j&&L(2,"crypto unavailable",a)):j&&L(2,n+m,e)),r[n]=V,f(n="MODULO_MODE")&&H(e,0,9,2,n)&&(W=0|e),r[n]=W,f(n="POW_PRECISION")&&H(e,0,A,2,n)&&(J=0|e),r[n]=J,f(n="FORMAT")&&("object"==typeof e?X=e:j&&L(2,n+" not an object",e)),r[n]=X,r},E.max=function(){return _(arguments,T.lt)},E.min=function(){return _(arguments,T.gt)},E.random=function(){var e=9007199254740992,n=Math.random()*e&2097151?function(){return d(Math.random()*e)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(e){var t,r,i,o,u,s=0,f=[],l=new E(q);if(e=null!=e&&H(e,0,A,14)?0|e:P,o=p(e/O),V)if(a&&a.getRandomValues){for(t=a.getRandomValues(new Uint32Array(o*=2));o>s;)u=131072*t[s]+(t[s+1]>>>11),u>=9e15?(r=a.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(f.push(u%1e14),s+=2);s=o/2}else if(a&&a.randomBytes){for(t=a.randomBytes(o*=7);o>s;)u=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6],u>=9e15?a.randomBytes(7).copy(t,s):(f.push(u%1e14),s+=7);s=o/7}else j&&L(14,"crypto unavailable",a);if(!s)for(;o>s;)u=n(),9e15>u&&(f[s++]=u%1e14);for(o=f[--s],e%=O,o&&e&&(u=S[O-e],f[s]=d(o/u)*u);0===f[s];f.pop(),s--);if(0>s)f=[i=0];else{for(i=-1;0===f[0];f.shift(),i-=O);for(s=1,u=f[0];u>=10;u/=10,s++);O>s&&(i-=O-s)}return l.e=i,l.c=f,l}}(),C=function(){function e(e,n,t){var r,i,o,u,s=0,f=e.length,l=n%R,c=n/R|0;for(e=e.slice();f--;)o=e[f]%R,u=e[f]/R|0,r=c*o+u*l,i=l*o+r%R*R+s,s=(i/t|0)+(r/R|0)+c*u,e[f]=i%t;return s&&e.unshift(s),e}function n(e,n,t,r){var i,o;if(t!=r)o=t>r?1:-1;else for(i=o=0;t>i;i++)if(e[i]!=n[i]){o=e[i]>n[i]?1:-1;break}return o}function r(e,n,t,r){for(var i=0;t--;)e[t]-=i,i=e[t]1;e.shift());}return function(i,o,u,s,f){var l,c,a,h,g,p,m,w,v,N,y,S,R,A,D,F,_,x=i.s==o.s?1:-1,I=i.c,L=o.c;if(!(I&&I[0]&&L&&L[0]))return new E(i.s&&o.s&&(I?!L||I[0]!=L[0]:L)?I&&0==I[0]||!L?0*x:x/0:NaN);for(w=new E(x),v=w.c=[],c=i.e-o.e,x=u+c+1,f||(f=b,c=t(i.e/O)-t(o.e/O),x=x/O|0),a=0;L[a]==(I[a]||0);a++);if(L[a]>(I[a]||0)&&c--,0>x)v.push(1),h=!0;else{for(A=I.length,F=L.length,a=0,x+=2,g=d(f/(L[0]+1)),g>1&&(L=e(L,g,f),I=e(I,g,f),F=L.length,A=I.length),R=F,N=I.slice(0,F),y=N.length;F>y;N[y++]=0);_=L.slice(),_.unshift(0),D=L[0],L[1]>=f/2&&D++;do{if(g=0,l=n(L,N,F,y),0>l){if(S=N[0],F!=y&&(S=S*f+(N[1]||0)),g=d(S/D),g>1)for(g>=f&&(g=f-1),p=e(L,g,f),m=p.length,y=N.length;1==n(p,N,m,y);)g--,r(p,m>F?_:L,m,f),m=p.length,l=1;else 0==g&&(l=g=1),p=L.slice(),m=p.length;if(y>m&&p.unshift(0),r(N,p,y,f),y=N.length,-1==l)for(;n(L,N,F,y)<1;)g++,r(N,y>F?_:L,y,f),y=N.length}else 0===l&&(g++,N=[0]);v[a++]=g,N[0]?N[y++]=I[R]||0:(N=[I[R]],y=1)}while((R++=10;x/=10,a++);U(w,u+(w.e=a+c*O-1)+1,s,h)}else w.e=c,w.r=+h;return w}}(),h=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,n=/^([^.]+)\.$/,t=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,u,s,f){var l,c=s?u:u.replace(i,"");if(r.test(c))o.s=isNaN(c)?null:0>c?-1:1;else{if(!s&&(c=c.replace(e,function(e,n,t){return l="x"==(t=t.toLowerCase())?16:"b"==t?2:8,f&&f!=l?e:n}),f&&(l=f,c=c.replace(n,"$1").replace(t,"0.$1")),u!=c))return new E(c,l);j&&L(M,"not a"+(f?" base "+f:"")+" number",u),o.s=null}o.c=o.e=null,M=0}}(),T.absoluteValue=T.abs=function(){var e=new E(this);return e.s<0&&(e.s=1),e},T.ceil=function(){return U(new E(this),this.e+1,2)},T.comparedTo=T.cmp=function(e,n){return M=1,i(this,new E(e,n))},T.decimalPlaces=T.dp=function(){var e,n,r=this.c;if(!r)return null;if(e=((n=r.length-1)-t(this.e/O))*O,n=r[n])for(;n%10==0;n/=10,e--);return 0>e&&(e=0),e},T.dividedBy=T.div=function(e,n){return M=3,C(this,new E(e,n),P,k)},T.dividedToIntegerBy=T.divToInt=function(e,n){return M=4,C(this,new E(e,n),0,1)},T.equals=T.eq=function(e,n){return M=5,0===i(this,new E(e,n))},T.floor=function(){return U(new E(this),this.e+1,3)},T.greaterThan=T.gt=function(e,n){return M=6,i(this,new E(e,n))>0},T.greaterThanOrEqualTo=T.gte=function(e,n){return M=7,1===(n=i(this,new E(e,n)))||0===n},T.isFinite=function(){return!!this.c},T.isInteger=T.isInt=function(){return!!this.c&&t(this.e/O)>this.c.length-2},T.isNaN=function(){return!this.s},T.isNegative=T.isNeg=function(){return this.s<0},T.isZero=function(){return!!this.c&&0==this.c[0]},T.lessThan=T.lt=function(e,n){return M=8,i(this,new E(e,n))<0},T.lessThanOrEqualTo=T.lte=function(e,n){return M=9,-1===(n=i(this,new E(e,n)))||0===n},T.minus=T.sub=function(e,n){var r,i,o,u,s=this,f=s.s;if(M=10,e=new E(e,n),n=e.s,!f||!n)return new E(NaN);if(f!=n)return e.s=-n,s.plus(e);var l=s.e/O,c=e.e/O,a=s.c,h=e.c;if(!l||!c){if(!a||!h)return a?(e.s=-n,e):new E(h?s:NaN);if(!a[0]||!h[0])return h[0]?(e.s=-n,e):new E(a[0]?s:3==k?-0:0)}if(l=t(l),c=t(c),a=a.slice(),f=l-c){for((u=0>f)?(f=-f,o=a):(c=l,o=h),o.reverse(),n=f;n--;o.push(0));o.reverse()}else for(i=(u=(f=a.length)<(n=h.length))?f:n,f=n=0;i>n;n++)if(a[n]!=h[n]){u=a[n]0)for(;n--;a[r++]=0);for(n=b-1;i>f;){if(a[--i]0?(s=u,r=l):(o=-o,r=f),r.reverse();o--;r.push(0));r.reverse()}for(o=f.length,n=l.length,0>o-n&&(r=l,l=f,f=r,n=o),o=0;n;)o=(f[--n]=f[n]+l[n]+o)/b|0,f[n]%=b;return o&&(f.unshift(o),++s),I(e,f,s)},T.precision=T.sd=function(e){var n,t,r=this,i=r.c;if(null!=e&&e!==!!e&&1!==e&&0!==e&&(j&&L(13,"argument"+m,e),e!=!!e&&(e=null)),!i)return null;if(t=i.length-1,n=t*O+1,t=i[t]){for(;t%10==0;t/=10,n--);for(t=i[0];t>=10;t/=10,n++);}return e&&r.e+1>n&&(n=r.e+1),n},T.round=function(e,n){var t=new E(this);return(null==e||H(e,0,A,15))&&U(t,~~e+this.e+1,null!=n&&H(n,0,8,15,w)?0|n:k),t},T.shift=function(e){var n=this;return H(e,-y,y,16,"argument")?n.times("1e"+c(e)):new E(n.c&&n.c[0]&&(-y>e||e>y)?n.s*(0>e?0:1/0):n)},T.squareRoot=T.sqrt=function(){var e,n,i,o,u,s=this,f=s.c,l=s.s,c=s.e,a=P+4,h=new E("0.5");if(1!==l||!f||!f[0])return new E(!l||0>l&&(!f||f[0])?NaN:f?s:1/0);if(l=Math.sqrt(+s),0==l||l==1/0?(n=r(f),(n.length+c)%2==0&&(n+="0"),l=Math.sqrt(n),c=t((c+1)/2)-(0>c||c%2),l==1/0?n="1e"+c:(n=l.toExponential(),n=n.slice(0,n.indexOf("e")+1)+c),i=new E(n)):i=new E(l+""),i.c[0])for(c=i.e,l=c+a,3>l&&(l=0);;)if(u=i,i=h.times(u.plus(C(s,u,a,1))),r(u.c).slice(0,l)===(n=r(i.c)).slice(0,l)){if(i.el&&(d=N,N=y,y=d,o=l,l=h,h=o),o=l+h,d=[];o--;d.push(0));for(m=b,w=R,o=h;--o>=0;){for(r=0,g=y[o]%w,p=y[o]/w|0,s=l,u=o+s;u>o;)c=N[--s]%w,a=N[s]/w|0,f=p*c+a*g,c=g*c+f%w*w+d[u]+r,r=(c/m|0)+(f/w|0)+p*a,d[u--]=c%m;d[u]=r}return r?++i:d.shift(),I(e,d,i)},T.toDigits=function(e,n){var t=new E(this);return e=null!=e&&H(e,1,A,18,"precision")?0|e:null,n=null!=n&&H(n,0,8,18,w)?0|n:k,e?U(t,e,n):t},T.toExponential=function(e,n){return F(this,null!=e&&H(e,0,A,19)?~~e+1:null,n,19)},T.toFixed=function(e,n){return F(this,null!=e&&H(e,0,A,20)?~~e+this.e+1:null,n,20)},T.toFormat=function(e,n){var t=F(this,null!=e&&H(e,0,A,21)?~~e+this.e+1:null,n,21);if(this.c){var r,i=t.split("."),o=+X.groupSize,u=+X.secondaryGroupSize,s=X.groupSeparator,f=i[0],l=i[1],c=this.s<0,a=c?f.slice(1):f,h=a.length;if(u&&(r=o,o=u,u=r,h-=r),o>0&&h>0){for(r=h%o||o,f=a.substr(0,r);h>r;r+=o)f+=s+a.substr(r,o);u>0&&(f+=s+a.slice(r)),c&&(f="-"+f)}t=l?f+X.decimalSeparator+((u=+X.fractionGroupSize)?l.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+X.fractionGroupSeparator):l):f}return t},T.toFraction=function(e){var n,t,i,o,u,s,f,l,c,a=j,h=this,g=h.c,p=new E(q),d=t=new E(q),m=f=new E(q);if(null!=e&&(j=!1,s=new E(e),j=a,(!(a=s.isInt())||s.lt(q))&&(j&&L(22,"max denominator "+(a?"out of range":"not an integer"),e),e=!a&&s.c&&U(s,s.e+1,1).gte(q)?s:null)),!g)return h.toString();for(c=r(g),o=p.e=c.length-h.e-1,p.c[0]=S[(u=o%O)<0?O+u:u],e=!e||s.cmp(p)>0?o>0?p:d:s,u=z,z=1/0,s=new E(c),f.c[0]=0;l=C(s,p,0,1),i=t.plus(l.times(m)),1!=i.cmp(e);)t=m,m=i,d=f.plus(l.times(i=d)),f=i,p=s.minus(l.times(i=p)),s=i;return i=C(e.minus(t),m,0,1),f=f.plus(i.times(d)),t=t.plus(i.times(m)),f.s=d.s=h.s,o*=2,n=C(d,m,o,k).minus(h).abs().cmp(C(f,t,o,k).minus(h).abs())<1?[d.toString(),m.toString()]:[f.toString(),t.toString()],z=u,n},T.toNumber=function(){return+this},T.toPower=T.pow=function(e){var n,t,r=d(0>e?-e:+e),i=this;if(!H(e,-y,y,23,"exponent")&&(!isFinite(e)||r>y&&(e/=0)||parseFloat(e)!=e&&!(e=NaN)))return new E(Math.pow(+i,e));for(n=J?p(J/O+2):0,t=new E(q);;){if(r%2){if(t=t.times(i),!t.c)break;n&&t.c.length>n&&(t.c.length=n)}if(r=d(r/2),!r)break;i=i.times(i),n&&i.c&&i.c.length>n&&(i.c.length=n)}return 0>e&&(t=q.div(t)),n?U(t,J,k):t},T.toPrecision=function(e,n){return F(this,null!=e&&H(e,1,A,24,"precision")?0|e:null,n,24)},T.toString=function(e){var n,t=this,i=t.s,o=t.e;return null===o?i?(n="Infinity",0>i&&(n="-"+n)):n="NaN":(n=r(t.c),n=null!=e&&H(e,2,64,25,"base")?D(l(n,o),0|e,10,i):B>=o||o>=$?f(n,o):l(n,o),0>i&&t.c[0]&&(n="-"+n)),n},T.truncated=T.trunc=function(){return U(new E(this),this.e+1,1)},T.valueOf=T.toJSON=function(){var e,n=this,t=n.e;return null===t?n.toString():(e=r(n.c),e=B>=t||t>=$?f(e,t):l(e,t),n.s<0?"-"+e:e)},null!=e&&E.config(e),E}function t(e){var n=0|e;return e>0||e===n?n:n-1}function r(e){for(var n,t,r=1,i=e.length,o=e[0]+"";i>r;){for(n=e[r++]+"",t=O-n.length;t--;n="0"+n);o+=n}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function i(e,n){var t,r,i=e.c,o=n.c,u=e.s,s=n.s,f=e.e,l=n.e;if(!u||!s)return null;if(t=i&&!i[0],r=o&&!o[0],t||r)return t?r?0:-s:u;if(u!=s)return u;if(t=0>u,r=f==l,!i||!o)return r?0:!i^t?1:-1;if(!r)return f>l^t?1:-1;for(s=(f=i.length)<(l=o.length)?f:l,u=0;s>u;u++)if(i[u]!=o[u])return i[u]>o[u]^t?1:-1;return f==l?0:f>l^t?1:-1}function o(e,n,t){return(e=c(e))>=n&&t>=e}function u(e){return"[object Array]"==Object.prototype.toString.call(e)}function s(e,n,t){for(var r,i,o=[0],u=0,s=e.length;s>u;){for(i=o.length;i--;o[i]*=n);for(o[r=0]+=N.indexOf(e.charAt(u++));rt-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/t|0,o[r]%=t)}return o.reverse()}function f(e,n){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(0>n?"e":"e+")+n}function l(e,n){var t,r;if(0>n){for(r="0.";++n;r+="0");e=r+e}else if(t=e.length,++n>t){for(r="0",n-=t;--n;r+="0");e+=r}else t>n&&(e=e.slice(0,n)+"."+e.slice(n));return e}function c(e){return e=parseFloat(e),0>e?p(e):d(e)}var a,h,g=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,p=Math.ceil,d=Math.floor,m=" not a boolean or binary digit",w="rounding mode",v="number type has more than 15 significant digits",N="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",b=1e14,O=14,y=9007199254740991,S=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],R=1e7,A=1e9;if("undefined"!=typeof crypto&&(a=crypto),"function"==typeof define&&define.amd)define(function(){return n()});else if("undefined"!=typeof module&&module.exports){if(module.exports=n(),!a)try{a=require("crypto")}catch(E){}}else e||(e="undefined"!=typeof self?self:Function("return this")()),e.BigNumber=n()}(this); +/* bignumber.js v2.3.0 https://github.com/MikeMcl/bignumber.js/LICENCE */ +!function(e){"use strict";function n(e){function E(e,n){var t,r,i,o,u,s,f=this;if(!(f instanceof E))return j&&L(26,"constructor call without new",e),new E(e,n);if(null!=n&&H(n,2,64,M,"base")){if(n=0|n,s=e+"",10==n)return f=new E(e instanceof E?e:s),U(f,P+f.e+1,k);if((o="number"==typeof e)&&0*e!=0||!new RegExp("^-?"+(t="["+N.slice(0,n)+"]+")+"(?:\\."+t+")?$",37>n?"i":"").test(s))return h(f,s,o,n);o?(f.s=0>1/e?(s=s.slice(1),-1):1,j&&s.replace(/^0\.0*|\./,"").length>15&&L(M,v,e),o=!1):f.s=45===s.charCodeAt(0)?(s=s.slice(1),-1):1,s=D(s,10,n,f.s)}else{if(e instanceof E)return f.s=e.s,f.e=e.e,f.c=(e=e.c)?e.slice():e,void(M=0);if((o="number"==typeof e)&&0*e==0){if(f.s=0>1/e?(e=-e,-1):1,e===~~e){for(r=0,i=e;i>=10;i/=10,r++);return f.e=r,f.c=[e],void(M=0)}s=e+""}else{if(!g.test(s=e+""))return h(f,s,o);f.s=45===s.charCodeAt(0)?(s=s.slice(1),-1):1}}for((r=s.indexOf("."))>-1&&(s=s.replace(".","")),(i=s.search(/e/i))>0?(0>r&&(r=i),r+=+s.slice(i+1),s=s.substring(0,i)):0>r&&(r=s.length),i=0;48===s.charCodeAt(i);i++);for(u=s.length;48===s.charCodeAt(--u););if(s=s.slice(i,u+1))if(u=s.length,o&&j&&u>15&&(e>y||e!==d(e))&&L(M,v,f.s*e),r=r-i-1,r>z)f.c=f.e=null;else if(G>r)f.c=[f.e=0];else{if(f.e=r,f.c=[],i=(r+1)%O,0>r&&(i+=O),u>i){for(i&&f.c.push(+s.slice(0,i)),u-=O;u>i;)f.c.push(+s.slice(i,i+=O));s=s.slice(i),i=O-s.length}else i-=u;for(;i--;s+="0");f.c.push(+s)}else f.c=[f.e=0];M=0}function D(e,n,t,i){var o,u,f,c,a,h,g,p=e.indexOf("."),d=P,m=k;for(37>t&&(e=e.toLowerCase()),p>=0&&(f=J,J=0,e=e.replace(".",""),g=new E(t),a=g.pow(e.length-p),J=f,g.c=s(l(r(a.c),a.e),10,n),g.e=g.c.length),h=s(e,t,n),u=f=h.length;0==h[--f];h.pop());if(!h[0])return"0";if(0>p?--u:(a.c=h,a.e=u,a.s=i,a=C(a,g,d,m,n),h=a.c,c=a.r,u=a.e),o=u+d+1,p=h[o],f=n/2,c=c||0>o||null!=h[o+1],c=4>m?(null!=p||c)&&(0==m||m==(a.s<0?3:2)):p>f||p==f&&(4==m||c||6==m&&1&h[o-1]||m==(a.s<0?8:7)),1>o||!h[0])e=c?l("1",-d):"0";else{if(h.length=o,c)for(--n;++h[--o]>n;)h[o]=0,o||(++u,h.unshift(1));for(f=h.length;!h[--f];);for(p=0,e="";f>=p;e+=N.charAt(h[p++]));e=l(e,u)}return e}function F(e,n,t,i){var o,u,s,c,a;if(t=null!=t&&H(t,0,8,i,w)?0|t:k,!e.c)return e.toString();if(o=e.c[0],s=e.e,null==n)a=r(e.c),a=19==i||24==i&&B>=s?f(a,s):l(a,s);else if(e=U(new E(e),n,t),u=e.e,a=r(e.c),c=a.length,19==i||24==i&&(u>=n||B>=u)){for(;n>c;a+="0",c++);a=f(a,u)}else if(n-=s,a=l(a,u),u+1>c){if(--n>0)for(a+=".";n--;a+="0");}else if(n+=u-c,n>0)for(u+1==c&&(a+=".");n--;a+="0");return e.s<0&&o?"-"+a:a}function _(e,n){var t,r,i=0;for(u(e[0])&&(e=e[0]),t=new E(e[0]);++ie||e>t||e!=c(e))&&L(r,(i||"decimal places")+(n>e||e>t?" out of range":" not an integer"),e),!0}function I(e,n,t){for(var r=1,i=n.length;!n[--i];n.pop());for(i=n[0];i>=10;i/=10,r++);return(t=r+t*O-1)>z?e.c=e.e=null:G>t?e.c=[e.e=0]:(e.e=t,e.c=n),e}function L(e,n,t){var r=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][e]+"() "+n+": "+t);throw r.name="BigNumber Error",M=0,r}function U(e,n,t,r){var i,o,u,s,f,l,c,a=e.c,h=S;if(a){e:{for(i=1,s=a[0];s>=10;s/=10,i++);if(o=n-i,0>o)o+=O,u=n,f=a[l=0],c=f/h[i-u-1]%10|0;else if(l=p((o+1)/O),l>=a.length){if(!r)break e;for(;a.length<=l;a.push(0));f=c=0,i=1,o%=O,u=o-O+1}else{for(f=s=a[l],i=1;s>=10;s/=10,i++);o%=O,u=o-O+i,c=0>u?0:f/h[i-u-1]%10|0}if(r=r||0>n||null!=a[l+1]||(0>u?f:f%h[i-u-1]),r=4>t?(c||r)&&(0==t||t==(e.s<0?3:2)):c>5||5==c&&(4==t||r||6==t&&(o>0?u>0?f/h[i-u]:0:a[l-1])%10&1||t==(e.s<0?8:7)),1>n||!a[0])return a.length=0,r?(n-=e.e+1,a[0]=h[(O-n%O)%O],e.e=-n||0):a[0]=e.e=0,e;if(0==o?(a.length=l,s=1,l--):(a.length=l+1,s=h[O-o],a[l]=u>0?d(f/h[i-u]%h[u])*s:0),r)for(;;){if(0==l){for(o=1,u=a[0];u>=10;u/=10,o++);for(u=a[0]+=s,s=1;u>=10;u/=10,s++);o!=s&&(e.e++,a[0]==b&&(a[0]=1));break}if(a[l]+=s,a[l]!=b)break;a[l--]=0,s=1}for(o=a.length;0===a[--o];a.pop());}e.e>z?e.c=e.e=null:e.et?null!=(e=i[t++]):void 0};return f(n="DECIMAL_PLACES")&&H(e,0,A,2,n)&&(P=0|e),r[n]=P,f(n="ROUNDING_MODE")&&H(e,0,8,2,n)&&(k=0|e),r[n]=k,f(n="EXPONENTIAL_AT")&&(u(e)?H(e[0],-A,0,2,n)&&H(e[1],0,A,2,n)&&(B=0|e[0],$=0|e[1]):H(e,-A,A,2,n)&&(B=-($=0|(0>e?-e:e)))),r[n]=[B,$],f(n="RANGE")&&(u(e)?H(e[0],-A,-1,2,n)&&H(e[1],1,A,2,n)&&(G=0|e[0],z=0|e[1]):H(e,-A,A,2,n)&&(0|e?G=-(z=0|(0>e?-e:e)):j&&L(2,n+" cannot be zero",e))),r[n]=[G,z],f(n="ERRORS")&&(e===!!e||1===e||0===e?(M=0,H=(j=!!e)?x:o):j&&L(2,n+m,e)),r[n]=j,f(n="CRYPTO")&&(e===!!e||1===e||0===e?(V=!(!e||!a),e&&!V&&j&&L(2,"crypto unavailable",a)):j&&L(2,n+m,e)),r[n]=V,f(n="MODULO_MODE")&&H(e,0,9,2,n)&&(W=0|e),r[n]=W,f(n="POW_PRECISION")&&H(e,0,A,2,n)&&(J=0|e),r[n]=J,f(n="FORMAT")&&("object"==typeof e?X=e:j&&L(2,n+" not an object",e)),r[n]=X,r},E.max=function(){return _(arguments,T.lt)},E.min=function(){return _(arguments,T.gt)},E.random=function(){var e=9007199254740992,n=Math.random()*e&2097151?function(){return d(Math.random()*e)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(e){var t,r,i,o,u,s=0,f=[],l=new E(q);if(e=null!=e&&H(e,0,A,14)?0|e:P,o=p(e/O),V)if(a&&a.getRandomValues){for(t=a.getRandomValues(new Uint32Array(o*=2));o>s;)u=131072*t[s]+(t[s+1]>>>11),u>=9e15?(r=a.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(f.push(u%1e14),s+=2);s=o/2}else if(a&&a.randomBytes){for(t=a.randomBytes(o*=7);o>s;)u=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6],u>=9e15?a.randomBytes(7).copy(t,s):(f.push(u%1e14),s+=7);s=o/7}else j&&L(14,"crypto unavailable",a);if(!s)for(;o>s;)u=n(),9e15>u&&(f[s++]=u%1e14);for(o=f[--s],e%=O,o&&e&&(u=S[O-e],f[s]=d(o/u)*u);0===f[s];f.pop(),s--);if(0>s)f=[i=0];else{for(i=-1;0===f[0];f.shift(),i-=O);for(s=1,u=f[0];u>=10;u/=10,s++);O>s&&(i-=O-s)}return l.e=i,l.c=f,l}}(),C=function(){function e(e,n,t){var r,i,o,u,s=0,f=e.length,l=n%R,c=n/R|0;for(e=e.slice();f--;)o=e[f]%R,u=e[f]/R|0,r=c*o+u*l,i=l*o+r%R*R+s,s=(i/t|0)+(r/R|0)+c*u,e[f]=i%t;return s&&e.unshift(s),e}function n(e,n,t,r){var i,o;if(t!=r)o=t>r?1:-1;else for(i=o=0;t>i;i++)if(e[i]!=n[i]){o=e[i]>n[i]?1:-1;break}return o}function r(e,n,t,r){for(var i=0;t--;)e[t]-=i,i=e[t]1;e.shift());}return function(i,o,u,s,f){var l,c,a,h,g,p,m,w,v,N,y,S,R,A,D,F,_,x=i.s==o.s?1:-1,I=i.c,L=o.c;if(!(I&&I[0]&&L&&L[0]))return new E(i.s&&o.s&&(I?!L||I[0]!=L[0]:L)?I&&0==I[0]||!L?0*x:x/0:NaN);for(w=new E(x),v=w.c=[],c=i.e-o.e,x=u+c+1,f||(f=b,c=t(i.e/O)-t(o.e/O),x=x/O|0),a=0;L[a]==(I[a]||0);a++);if(L[a]>(I[a]||0)&&c--,0>x)v.push(1),h=!0;else{for(A=I.length,F=L.length,a=0,x+=2,g=d(f/(L[0]+1)),g>1&&(L=e(L,g,f),I=e(I,g,f),F=L.length,A=I.length),R=F,N=I.slice(0,F),y=N.length;F>y;N[y++]=0);_=L.slice(),_.unshift(0),D=L[0],L[1]>=f/2&&D++;do{if(g=0,l=n(L,N,F,y),0>l){if(S=N[0],F!=y&&(S=S*f+(N[1]||0)),g=d(S/D),g>1)for(g>=f&&(g=f-1),p=e(L,g,f),m=p.length,y=N.length;1==n(p,N,m,y);)g--,r(p,m>F?_:L,m,f),m=p.length,l=1;else 0==g&&(l=g=1),p=L.slice(),m=p.length;if(y>m&&p.unshift(0),r(N,p,y,f),y=N.length,-1==l)for(;n(L,N,F,y)<1;)g++,r(N,y>F?_:L,y,f),y=N.length}else 0===l&&(g++,N=[0]);v[a++]=g,N[0]?N[y++]=I[R]||0:(N=[I[R]],y=1)}while((R++=10;x/=10,a++);U(w,u+(w.e=a+c*O-1)+1,s,h)}else w.e=c,w.r=+h;return w}}(),h=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,n=/^([^.]+)\.$/,t=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,u,s,f){var l,c=s?u:u.replace(i,"");if(r.test(c))o.s=isNaN(c)?null:0>c?-1:1;else{if(!s&&(c=c.replace(e,function(e,n,t){return l="x"==(t=t.toLowerCase())?16:"b"==t?2:8,f&&f!=l?e:n}),f&&(l=f,c=c.replace(n,"$1").replace(t,"0.$1")),u!=c))return new E(c,l);j&&L(M,"not a"+(f?" base "+f:"")+" number",u),o.s=null}o.c=o.e=null,M=0}}(),T.absoluteValue=T.abs=function(){var e=new E(this);return e.s<0&&(e.s=1),e},T.ceil=function(){return U(new E(this),this.e+1,2)},T.comparedTo=T.cmp=function(e,n){return M=1,i(this,new E(e,n))},T.decimalPlaces=T.dp=function(){var e,n,r=this.c;if(!r)return null;if(e=((n=r.length-1)-t(this.e/O))*O,n=r[n])for(;n%10==0;n/=10,e--);return 0>e&&(e=0),e},T.dividedBy=T.div=function(e,n){return M=3,C(this,new E(e,n),P,k)},T.dividedToIntegerBy=T.divToInt=function(e,n){return M=4,C(this,new E(e,n),0,1)},T.equals=T.eq=function(e,n){return M=5,0===i(this,new E(e,n))},T.floor=function(){return U(new E(this),this.e+1,3)},T.greaterThan=T.gt=function(e,n){return M=6,i(this,new E(e,n))>0},T.greaterThanOrEqualTo=T.gte=function(e,n){return M=7,1===(n=i(this,new E(e,n)))||0===n},T.isFinite=function(){return!!this.c},T.isInteger=T.isInt=function(){return!!this.c&&t(this.e/O)>this.c.length-2},T.isNaN=function(){return!this.s},T.isNegative=T.isNeg=function(){return this.s<0},T.isZero=function(){return!!this.c&&0==this.c[0]},T.lessThan=T.lt=function(e,n){return M=8,i(this,new E(e,n))<0},T.lessThanOrEqualTo=T.lte=function(e,n){return M=9,-1===(n=i(this,new E(e,n)))||0===n},T.minus=T.sub=function(e,n){var r,i,o,u,s=this,f=s.s;if(M=10,e=new E(e,n),n=e.s,!f||!n)return new E(NaN);if(f!=n)return e.s=-n,s.plus(e);var l=s.e/O,c=e.e/O,a=s.c,h=e.c;if(!l||!c){if(!a||!h)return a?(e.s=-n,e):new E(h?s:NaN);if(!a[0]||!h[0])return h[0]?(e.s=-n,e):new E(a[0]?s:3==k?-0:0)}if(l=t(l),c=t(c),a=a.slice(),f=l-c){for((u=0>f)?(f=-f,o=a):(c=l,o=h),o.reverse(),n=f;n--;o.push(0));o.reverse()}else for(i=(u=(f=a.length)<(n=h.length))?f:n,f=n=0;i>n;n++)if(a[n]!=h[n]){u=a[n]0)for(;n--;a[r++]=0);for(n=b-1;i>f;){if(a[--i]0?(s=u,r=l):(o=-o,r=f),r.reverse();o--;r.push(0));r.reverse()}for(o=f.length,n=l.length,0>o-n&&(r=l,l=f,f=r,n=o),o=0;n;)o=(f[--n]=f[n]+l[n]+o)/b|0,f[n]%=b;return o&&(f.unshift(o),++s),I(e,f,s)},T.precision=T.sd=function(e){var n,t,r=this,i=r.c;if(null!=e&&e!==!!e&&1!==e&&0!==e&&(j&&L(13,"argument"+m,e),e!=!!e&&(e=null)),!i)return null;if(t=i.length-1,n=t*O+1,t=i[t]){for(;t%10==0;t/=10,n--);for(t=i[0];t>=10;t/=10,n++);}return e&&r.e+1>n&&(n=r.e+1),n},T.round=function(e,n){var t=new E(this);return(null==e||H(e,0,A,15))&&U(t,~~e+this.e+1,null!=n&&H(n,0,8,15,w)?0|n:k),t},T.shift=function(e){var n=this;return H(e,-y,y,16,"argument")?n.times("1e"+c(e)):new E(n.c&&n.c[0]&&(-y>e||e>y)?n.s*(0>e?0:1/0):n)},T.squareRoot=T.sqrt=function(){var e,n,i,o,u,s=this,f=s.c,l=s.s,c=s.e,a=P+4,h=new E("0.5");if(1!==l||!f||!f[0])return new E(!l||0>l&&(!f||f[0])?NaN:f?s:1/0);if(l=Math.sqrt(+s),0==l||l==1/0?(n=r(f),(n.length+c)%2==0&&(n+="0"),l=Math.sqrt(n),c=t((c+1)/2)-(0>c||c%2),l==1/0?n="1e"+c:(n=l.toExponential(),n=n.slice(0,n.indexOf("e")+1)+c),i=new E(n)):i=new E(l+""),i.c[0])for(c=i.e,l=c+a,3>l&&(l=0);;)if(u=i,i=h.times(u.plus(C(s,u,a,1))),r(u.c).slice(0,l)===(n=r(i.c)).slice(0,l)){if(i.el&&(d=N,N=y,y=d,o=l,l=h,h=o),o=l+h,d=[];o--;d.push(0));for(m=b,w=R,o=h;--o>=0;){for(r=0,g=y[o]%w,p=y[o]/w|0,s=l,u=o+s;u>o;)c=N[--s]%w,a=N[s]/w|0,f=p*c+a*g,c=g*c+f%w*w+d[u]+r,r=(c/m|0)+(f/w|0)+p*a,d[u--]=c%m;d[u]=r}return r?++i:d.shift(),I(e,d,i)},T.toDigits=function(e,n){var t=new E(this);return e=null!=e&&H(e,1,A,18,"precision")?0|e:null,n=null!=n&&H(n,0,8,18,w)?0|n:k,e?U(t,e,n):t},T.toExponential=function(e,n){return F(this,null!=e&&H(e,0,A,19)?~~e+1:null,n,19)},T.toFixed=function(e,n){return F(this,null!=e&&H(e,0,A,20)?~~e+this.e+1:null,n,20)},T.toFormat=function(e,n){var t=F(this,null!=e&&H(e,0,A,21)?~~e+this.e+1:null,n,21);if(this.c){var r,i=t.split("."),o=+X.groupSize,u=+X.secondaryGroupSize,s=X.groupSeparator,f=i[0],l=i[1],c=this.s<0,a=c?f.slice(1):f,h=a.length;if(u&&(r=o,o=u,u=r,h-=r),o>0&&h>0){for(r=h%o||o,f=a.substr(0,r);h>r;r+=o)f+=s+a.substr(r,o);u>0&&(f+=s+a.slice(r)),c&&(f="-"+f)}t=l?f+X.decimalSeparator+((u=+X.fractionGroupSize)?l.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+X.fractionGroupSeparator):l):f}return t},T.toFraction=function(e){var n,t,i,o,u,s,f,l,c,a=j,h=this,g=h.c,p=new E(q),d=t=new E(q),m=f=new E(q);if(null!=e&&(j=!1,s=new E(e),j=a,(!(a=s.isInt())||s.lt(q))&&(j&&L(22,"max denominator "+(a?"out of range":"not an integer"),e),e=!a&&s.c&&U(s,s.e+1,1).gte(q)?s:null)),!g)return h.toString();for(c=r(g),o=p.e=c.length-h.e-1,p.c[0]=S[(u=o%O)<0?O+u:u],e=!e||s.cmp(p)>0?o>0?p:d:s,u=z,z=1/0,s=new E(c),f.c[0]=0;l=C(s,p,0,1),i=t.plus(l.times(m)),1!=i.cmp(e);)t=m,m=i,d=f.plus(l.times(i=d)),f=i,p=s.minus(l.times(i=p)),s=i;return i=C(e.minus(t),m,0,1),f=f.plus(i.times(d)),t=t.plus(i.times(m)),f.s=d.s=h.s,o*=2,n=C(d,m,o,k).minus(h).abs().cmp(C(f,t,o,k).minus(h).abs())<1?[d.toString(),m.toString()]:[f.toString(),t.toString()],z=u,n},T.toNumber=function(){return+this},T.toPower=T.pow=function(e,n){var t,r,i,o=d(0>e?-e:+e),u=this;if(null!=n&&(M=23,n=new E(n)),!H(e,-y,y,23,"exponent")&&(!isFinite(e)||o>y&&(e/=0)||parseFloat(e)!=e&&!(e=NaN))||0==e)return t=Math.pow(+u,e),new E(n?t%n:t);for(n?e>1&&u.gt(q)&&u.isInt()&&n.gt(q)&&n.isInt()?u=u.mod(n):(i=n,n=null):J&&(t=p(J/O+2)),r=new E(q);;){if(o%2){if(r=r.times(u),!r.c)break;t?r.c.length>t&&(r.c.length=t):n&&(r=r.mod(n))}if(o=d(o/2),!o)break;u=u.times(u),t?u.c&&u.c.length>t&&(u.c.length=t):n&&(u=u.mod(n))}return n?r:(0>e&&(r=q.div(r)),i?r.mod(i):t?U(r,J,k):r)},T.toPrecision=function(e,n){return F(this,null!=e&&H(e,1,A,24,"precision")?0|e:null,n,24)},T.toString=function(e){var n,t=this,i=t.s,o=t.e;return null===o?i?(n="Infinity",0>i&&(n="-"+n)):n="NaN":(n=r(t.c),n=null!=e&&H(e,2,64,25,"base")?D(l(n,o),0|e,10,i):B>=o||o>=$?f(n,o):l(n,o),0>i&&t.c[0]&&(n="-"+n)),n},T.truncated=T.trunc=function(){return U(new E(this),this.e+1,1)},T.valueOf=T.toJSON=function(){var e,n=this,t=n.e;return null===t?n.toString():(e=r(n.c),e=B>=t||t>=$?f(e,t):l(e,t),n.s<0?"-"+e:e)},null!=e&&E.config(e),E}function t(e){var n=0|e;return e>0||e===n?n:n-1}function r(e){for(var n,t,r=1,i=e.length,o=e[0]+"";i>r;){for(n=e[r++]+"",t=O-n.length;t--;n="0"+n);o+=n}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function i(e,n){var t,r,i=e.c,o=n.c,u=e.s,s=n.s,f=e.e,l=n.e;if(!u||!s)return null;if(t=i&&!i[0],r=o&&!o[0],t||r)return t?r?0:-s:u;if(u!=s)return u;if(t=0>u,r=f==l,!i||!o)return r?0:!i^t?1:-1;if(!r)return f>l^t?1:-1;for(s=(f=i.length)<(l=o.length)?f:l,u=0;s>u;u++)if(i[u]!=o[u])return i[u]>o[u]^t?1:-1;return f==l?0:f>l^t?1:-1}function o(e,n,t){return(e=c(e))>=n&&t>=e}function u(e){return"[object Array]"==Object.prototype.toString.call(e)}function s(e,n,t){for(var r,i,o=[0],u=0,s=e.length;s>u;){for(i=o.length;i--;o[i]*=n);for(o[r=0]+=N.indexOf(e.charAt(u++));rt-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/t|0,o[r]%=t)}return o.reverse()}function f(e,n){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(0>n?"e":"e+")+n}function l(e,n){var t,r;if(0>n){for(r="0.";++n;r+="0");e=r+e}else if(t=e.length,++n>t){for(r="0",n-=t;--n;r+="0");e+=r}else t>n&&(e=e.slice(0,n)+"."+e.slice(n));return e}function c(e){return e=parseFloat(e),0>e?p(e):d(e)}var a,h,g=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,p=Math.ceil,d=Math.floor,m=" not a boolean or binary digit",w="rounding mode",v="number type has more than 15 significant digits",N="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",b=1e14,O=14,y=9007199254740991,S=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],R=1e7,A=1e9;if("undefined"!=typeof crypto&&(a=crypto),"function"==typeof define&&define.amd)define(function(){return n()});else if("undefined"!=typeof module&&module.exports){if(module.exports=n(),!a)try{a=require("crypto")}catch(E){}}else e||(e="undefined"!=typeof self?self:Function("return this")()),e.BigNumber=n()}(this); //# sourceMappingURL=bignumber.js.map \ No newline at end of file diff --git a/node_modules/bignumber.js/bower.json b/node_modules/bignumber.js/bower.json index 536f0d4..3b1a9ca 100644 --- a/node_modules/bignumber.js/bower.json +++ b/node_modules/bignumber.js/bower.json @@ -1,7 +1,7 @@ { "name": "bignumber.js", "main": "bignumber.js", - "version": "2.1.4", + "version": "2.3.0", "homepage": "https://github.com/MikeMcl/bignumber.js", "authors": [ "Michael Mclaughlin " diff --git a/node_modules/bignumber.js/doc/API.html b/node_modules/bignumber.js/doc/API.html index 9135fd0..1c19cfb 100644 --- a/node_modules/bignumber.js/doc/API.html +++ b/node_modules/bignumber.js/doc/API.html @@ -354,7 +354,7 @@
configconfig([obj]) ⇒ objectROUNDING_MODE
number: integer, 0 to 8 inclusive
- Default value: 4 (ROUND_HALF_UP) + Default value: 4 (ROUND_HALF_UP)
The rounding mode used in the above operations and the default rounding mode of @@ -590,7 +590,8 @@
configconfig([obj]) ⇒ object100
- The maximum number of significant digits of the result of the power operation. + The maximum number of significant digits of the result of the power operation + (unless a modulus is specified).
If set to 0, the number of signifcant digits will not be limited.
See toPower.
@@ -1601,14 +1602,15 @@
toNumber.toNumber() ⇒ number -
toPower.pow(n) ⇒ BigNumber
+
toPower.pow(n [, m]) ⇒ BigNumber

n: number: integer, - -9007199254740991 to 9007199254740991 inclusive + -9007199254740991 to 9007199254740991 inclusive
+ m: number|string|BigNumber

Returns a BigNumber whose value is the value of this BigNumber raised to the power - n. + n, and optionally modulo a modulus m.

If n is negative the result is rounded according to the current @@ -1632,7 +1634,7 @@

toPower.pow(n) ⇒ BigNumber10000 has over 50000 digits, the number of significant digits calculated is limited to the value of the POW_PRECISION setting (default value: - 100). + 100) unless a modulus m is specified.

Set POW_PRECISION to 0 for an @@ -1644,6 +1646,13 @@

toPower.pow(n) ⇒ BigNumberDECIMAL_PLACES (but not to more than POW_PRECISION significant digits).

+

+ If m is specified and the value of m, n and this + BigNumber are positive integers, then a fast modular exponentiation algorithm is used, + otherwise if any of the values is not a positive integer the operation will simply be + performed as x.toPower(n).modulo(m) with a + POW_PRECISION of 0. +

 Math.pow(0.7, 2)                // 0.48999999999999994
 x = new BigNumber(0.7)
diff --git a/node_modules/bignumber.js/package.json b/node_modules/bignumber.js/package.json
index 2db4e02..e11d8fd 100644
--- a/node_modules/bignumber.js/package.json
+++ b/node_modules/bignumber.js/package.json
@@ -1,90 +1,66 @@
 {
-  "_args": [
-    [
-      "bignumber.js",
-      "/Users/alexn/projects/etherid.org"
-    ]
-  ],
-  "_from": "bignumber.js@*",
-  "_id": "bignumber.js@2.1.4",
-  "_inCache": true,
-  "_installable": true,
-  "_location": "/bignumber.js",
-  "_nodeVersion": "5.1.1",
-  "_npmUser": {
-    "email": "M8ch88l@gmail.com",
-    "name": "mikemcl"
-  },
-  "_npmVersion": "3.3.12",
-  "_phantomChildren": {},
-  "_requested": {
-    "name": "bignumber.js",
-    "raw": "bignumber.js",
-    "rawSpec": "",
-    "scope": null,
-    "spec": "*",
-    "type": "range"
-  },
-  "_requiredBy": [
-    "#USER"
-  ],
-  "_resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-2.1.4.tgz",
-  "_shasum": "29b3bb693dbb238e88b72eac2fb89650888b2d59",
-  "_shrinkwrap": null,
-  "_spec": "bignumber.js",
-  "_where": "/Users/alexn/projects/etherid.org",
-  "author": {
-    "email": "M8ch88l@gmail.com",
-    "name": "Michael Mclaughlin"
-  },
-  "bugs": {
-    "url": "https://github.com/MikeMcl/bignumber.js/issues"
-  },
-  "dependencies": {},
+  "name": "bignumber.js",
   "description": "A library for arbitrary-precision decimal and non-decimal arithmetic",
-  "devDependencies": {},
-  "directories": {},
-  "dist": {
-    "shasum": "29b3bb693dbb238e88b72eac2fb89650888b2d59",
-    "tarball": "http://registry.npmjs.org/bignumber.js/-/bignumber.js-2.1.4.tgz"
-  },
-  "engines": {
-    "node": "*"
-  },
-  "gitHead": "ad704dc44f9e2de5cd8bf027b0ff3fcc18e83811",
-  "homepage": "https://github.com/MikeMcl/bignumber.js#readme",
+  "version": "2.3.0",
   "keywords": [
     "arbitrary",
+    "precision",
     "arithmetic",
     "big",
-    "bigdecimal",
-    "bigint",
-    "biginteger",
-    "bignum",
-    "bignumber",
+    "number",
     "decimal",
     "float",
-    "number",
-    "precision"
+    "biginteger",
+    "bigdecimal",
+    "bignumber",
+    "bigint",
+    "bignum"
   ],
-  "license": "MIT",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/MikeMcl/bignumber.js.git"
+  },
   "main": "bignumber",
+  "author": {
+    "name": "Michael Mclaughlin",
+    "email": "M8ch88l@gmail.com"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "license": "MIT",
+  "scripts": {
+    "test": "node ./test/every-test.js",
+    "build": "uglifyjs bignumber.js --source-map bignumber.js.map -c -m -o bignumber.min.js --preamble \"/* bignumber.js v2.3.0 https://github.com/MikeMcl/bignumber.js/LICENCE */\""
+  },
+  "gitHead": "65e21f202adab641efda0d43b85a605791c0816a",
+  "bugs": {
+    "url": "https://github.com/MikeMcl/bignumber.js/issues"
+  },
+  "homepage": "https://github.com/MikeMcl/bignumber.js#readme",
+  "_id": "bignumber.js@2.3.0",
+  "_shasum": "597a02d791edc3d64f17850e21789e7a4095df66",
+  "_from": "bignumber.js@2.3.0",
+  "_npmVersion": "3.7.1",
+  "_nodeVersion": "5.7.0",
+  "_npmUser": {
+    "name": "mikemcl",
+    "email": "M8ch88l@gmail.com"
+  },
+  "dist": {
+    "shasum": "597a02d791edc3d64f17850e21789e7a4095df66",
+    "tarball": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-2.3.0.tgz"
+  },
   "maintainers": [
     {
       "name": "mikemcl",
       "email": "M8ch88l@gmail.com"
     }
   ],
-  "name": "bignumber.js",
-  "optionalDependencies": {},
-  "readme": "ERROR: No README data found!",
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/MikeMcl/bignumber.js.git"
+  "_npmOperationalInternal": {
+    "host": "packages-13-west.internal.npmjs.com",
+    "tmp": "tmp/bignumber.js-2.3.0.tgz_1457392338289_0.9482216306496412"
   },
-  "scripts": {
-    "build": "uglifyjs bignumber.js --source-map bignumber.js.map -c -m -o bignumber.min.js --preamble \"/* bignumber.js v2.1.4 https://github.com/MikeMcl/bignumber.js/LICENCE */\"",
-    "test": "node ./test/every-test.js"
-  },
-  "version": "2.1.4"
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-2.3.0.tgz"
 }
diff --git a/node_modules/etherid-js/README.md b/node_modules/etherid-js/README.md
index 05c31fa..0da25c1 100644
--- a/node_modules/etherid-js/README.md
+++ b/node_modules/etherid-js/README.md
@@ -46,7 +46,9 @@ var etherid = require('etherid')
 ### Getting total number of registered domains
 
 ```javascript
-etherid.getNumberOfDomains( web3 )
+EID.getNumberOfDomains( web3, function( error, result ) {
+    document.getElementById( "n_domains" ).innerHTML = result
+})
 ```
 Returns total number of registered domains
 
@@ -74,6 +76,20 @@ The call returns a struct:
     domainHex   // HEX domain name    
 }
 ```
+Example:
+
+```javascript
+domain = EID.getDomain( web3, "test", function( error, domain ) {
+    if( !error ) {
+        document.getElementById( "expires" ).innerHTML = domain.expires
+        document.getElementById( "owner" ).innerHTML = web3.toHex( domain.owner )
+        document.getElementById( "price" ).innerHTML = domain.price
+        document.getElementById( "transfer" ).innerHTML = web3.toHex( domain.transfer )
+        document.getElementById( "next" ).innerHTML = web3.toHex( domain.next_domain )
+        document.getElementById( "root_id" ).innerHTML = web3.toHex( domain.root_id )
+    }
+});
+```
 
 ### Reading the domain ID
 
@@ -100,29 +116,22 @@ The call returns a struct:
     prev_id     // Previous ID in the linked list
 }
 ```
-
-
-### Reading string ID
-
-```javascript
-etherid.getStr( web3, {DOMAIN_NAME}, {ID} )
-```
-Returns string ID value
-
-### Reading integer ID
-
-```javascript
-etherid.getInt( web3, {DOMAIN_NAME}, {ID} )
-```
-Returns integer ID value
-
-### Reading hash ID
+Example:
 
 ```javascript
-etherid.getInt( web3, {DOMAIN_NAME}, {ID} )
+EID.getId( web3, "test", "test_number", function( error, id ) {
+    if( !error ) 
+        document.getElementById( "test_int" ).innerHTML = id.valueInt
+});
+
+EID.getId( web3, "test", "test_text", function( error, id ) {
+    if( !error ) document.getElementById( "test_text" ).innerHTML = id.valueStr
+});
+
+EID.getId( web3, "test", "test_ipfs", function( error, id ) {
+    if( !error ) document.getElementById( "test_ipfs" ).innerHTML = id.valueHash
+});
 ```
-Returns the ID value interpreted as a [multihash](https://github.com/jbenet/multihash) sha2-512. (Same that is used by [ipfs](https://ipfs.io/)
-
 
 ### Event handler
 You can setup a handler that will be called everytime someone changes a domain.
@@ -166,6 +175,74 @@ while ( id ) {
 NOTE: The enumerator properly treats the ID with name 0x0 registered in the system. If you implement the loop yourself, do not forget that first 0x0 ID you get might be the real ID, and the second is in fact the end of the list. You should check if the 0x0 ID has value.
 
 
+### Changing domain
+To cahnge the domain record call:
+
+```javascript
+EID.changeDomain( web3, {ADDRESS_TO USE}, {DOMAIN}, {EXPIRATION}, {PRICE}, TRANSFER}, callback )
+```
+
+
+Example:
+
+```javascript
+function onProlong()
+{
+    document.getElementById( "prolong_status" ).innerHTML = "Reading domain..."
+    
+    
+    domain = EID.getDomain( web3, "test", function( error, domain ) {
+        if( !error ) {
+            document.getElementById( "prolong_status" ).innerHTML = "Channging..."
+            EID.changeDomain( web3, domain.owner, "test", 2000000, 0, 0, function( error, domain ) {
+                if( !error ) {
+                    document.getElementById( "prolong_status" ).innerHTML = "Transaction completed"
+                }
+                else
+                {
+                    document.getElementById( "prolong_status" ).innerHTML = error
+                }
+            });    
+        }
+        else { document.getElementById( "prolong_status" ).innerHTML = error }
+    });    
+}
+```
+
+### Changing ID
+To cahnge the domain ID call:
+
+```javascript
+EID.changeId( web3, {ADDRESS_TO USE}, {DOMAIN}, {ID}, {VALUE} callback )
+```
+
+
+Example:
+
+```javascript
+function onChangeId()
+{
+    document.getElementById( "change_id_status" ).innerHTML = "Reading domain..."
+    
+    
+    domain = EID.getDomain( web3, "test", function( error, domain ) {
+        if( !error ) {
+            document.getElementById( "change_id_status" ).innerHTML = "Channging..."
+            EID.changeId( web3, domain.owner, "test", "time", new Date().getTime(), function( error, domain ) {
+                if( !error ) {
+                    document.getElementById( "change_id_status" ).innerHTML = "Transaction completed"
+                }
+                else
+                {
+                    document.getElementById( "change_id_status" ).innerHTML = error
+                }
+            });    
+        }
+        else { document.getElementById( "change_id_status" ).innerHTML = error }
+    });    
+}
+```
+
 ## License
 
 Apache 2.0
diff --git a/node_modules/etherid-js/dist/etherid.js b/node_modules/etherid-js/dist/etherid.js
index 3fec239..093841b 100644
--- a/node_modules/etherid-js/dist/etherid.js
+++ b/node_modules/etherid-js/dist/etherid.js
@@ -1,6 +1,11 @@
 require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0) {
         digits.push(carry % BASE)
-
         carry = (carry / BASE) | 0
       }
     }
 
     // deal with leading zeros
-    for (i = 0; buffer[i] === 0 && i < buffer.length - 1; i++) {
+    for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) {
       digits.push(0)
     }
 
-    return digits.reverse().map(function (digit) {
-      return ALPHABET[digit]
-    }).join('')
+    // convert digits to a string
+    for (var ii = 0, jj = digits.length - 1; ii <= jj; ++ii, --jj) {
+      var tmp = ALPHABET[digits[ii]]
+      digits[ii] = ALPHABET[digits[jj]]
+      digits[jj] = tmp
+    }
+
+    return digits.join('')
   }
 
   function decode (string) {
     if (string.length === 0) return []
 
-    var i, j
     var bytes = [0]
+    for (var i = 0; i < string.length; i++) {
+      var value = ALPHABET_MAP[string[i]]
+      if (value === undefined) throw new Error('Non-base' + BASE + ' character')
 
-    for (i = 0; i < string.length; i++) {
-      var c = string[i]
-      if (!(c in ALPHABET_MAP)) throw new Error('Non-base' + BASE + ' character')
-
-      for (j = 0; j < bytes.length; j++) bytes[j] *= BASE
-      bytes[0] += ALPHABET_MAP[c]
-
-      var carry = 0
-      for (j = 0; j < bytes.length; ++j) {
-        bytes[j] += carry
-
-        carry = bytes[j] >> 8
-        bytes[j] &= 0xff
+      for (var j = 0, carry = value; j < bytes.length; ++j) {
+        carry += bytes[j] * BASE
+        bytes[j] = carry & 0xff
+        carry >>= 8
       }
 
-      while (carry) {
+      while (carry > 0) {
         bytes.push(carry & 0xff)
-
         carry >>= 8
       }
     }
 
     // deal with leading zeros
-    for (i = 0; string[i] === LEADER && i < string.length - 1; i++) {
+    for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) {
       bytes.push(0)
     }
 
@@ -353,2704 +346,6 @@ module.exports = invert
 
 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
 },{}],4:[function(require,module,exports){
-/*! bignumber.js v2.1.3 https://github.com/MikeMcl/bignumber.js/LICENCE */
-
-;(function (globalObj) {
-    'use strict';
-
-    /*
-      bignumber.js v2.1.3
-      A JavaScript library for arbitrary-precision arithmetic.
-      https://github.com/MikeMcl/bignumber.js
-      Copyright (c) 2015 Michael Mclaughlin 
-      MIT Expat Licence
-    */
-
-
-    var cryptoObj, parseNumeric,
-        isNumeric = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,
-        mathceil = Math.ceil,
-        mathfloor = Math.floor,
-        notBool = ' not a boolean or binary digit',
-        roundingMode = 'rounding mode',
-        tooManyDigits = 'number type has more than 15 significant digits',
-        ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_',
-        BASE = 1e14,
-        LOG_BASE = 14,
-        MAX_SAFE_INTEGER = 0x1fffffffffffff,         // 2^53 - 1
-        // MAX_INT32 = 0x7fffffff,                   // 2^31 - 1
-        POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],
-        SQRT_BASE = 1e7,
-
-        /*
-         * The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and
-         * the arguments to toExponential, toFixed, toFormat, and toPrecision, beyond which an
-         * exception is thrown (if ERRORS is true).
-         */
-        MAX = 1E9;                                   // 0 to MAX_INT32
-
-    if ( typeof crypto != 'undefined' ) cryptoObj = crypto;
-
-
-    /*
-     * Create and return a BigNumber constructor.
-     */
-    function constructorFactory(configObj) {
-        var div,
-
-            // id tracks the caller function, so its name can be included in error messages.
-            id = 0,
-            P = BigNumber.prototype,
-            ONE = new BigNumber(1),
-
-
-            /********************************* EDITABLE DEFAULTS **********************************/
-
-
-            /*
-             * The default values below must be integers within the inclusive ranges stated.
-             * The values can also be changed at run-time using BigNumber.config.
-             */
-
-            // The maximum number of decimal places for operations involving division.
-            DECIMAL_PLACES = 20,                     // 0 to MAX
-
-            /*
-             * The rounding mode used when rounding to the above decimal places, and when using
-             * toExponential, toFixed, toFormat and toPrecision, and round (default value).
-             * UP         0 Away from zero.
-             * DOWN       1 Towards zero.
-             * CEIL       2 Towards +Infinity.
-             * FLOOR      3 Towards -Infinity.
-             * HALF_UP    4 Towards nearest neighbour. If equidistant, up.
-             * HALF_DOWN  5 Towards nearest neighbour. If equidistant, down.
-             * HALF_EVEN  6 Towards nearest neighbour. If equidistant, towards even neighbour.
-             * HALF_CEIL  7 Towards nearest neighbour. If equidistant, towards +Infinity.
-             * HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
-             */
-            ROUNDING_MODE = 4,                       // 0 to 8
-
-            // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]
-
-            // The exponent value at and beneath which toString returns exponential notation.
-            // Number type: -7
-            TO_EXP_NEG = -7,                         // 0 to -MAX
-
-            // The exponent value at and above which toString returns exponential notation.
-            // Number type: 21
-            TO_EXP_POS = 21,                         // 0 to MAX
-
-            // RANGE : [MIN_EXP, MAX_EXP]
-
-            // The minimum exponent value, beneath which underflow to zero occurs.
-            // Number type: -324  (5e-324)
-            MIN_EXP = -1e7,                          // -1 to -MAX
-
-            // The maximum exponent value, above which overflow to Infinity occurs.
-            // Number type:  308  (1.7976931348623157e+308)
-            // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.
-            MAX_EXP = 1e7,                           // 1 to MAX
-
-            // Whether BigNumber Errors are ever thrown.
-            ERRORS = true,                           // true or false
-
-            // Change to intValidatorNoErrors if ERRORS is false.
-            isValidInt = intValidatorWithErrors,     // intValidatorWithErrors/intValidatorNoErrors
-
-            // Whether to use cryptographically-secure random number generation, if available.
-            CRYPTO = false,                          // true or false
-
-            /*
-             * The modulo mode used when calculating the modulus: a mod n.
-             * The quotient (q = a / n) is calculated according to the corresponding rounding mode.
-             * The remainder (r) is calculated as: r = a - n * q.
-             *
-             * UP        0 The remainder is positive if the dividend is negative, else is negative.
-             * DOWN      1 The remainder has the same sign as the dividend.
-             *             This modulo mode is commonly known as 'truncated division' and is
-             *             equivalent to (a % n) in JavaScript.
-             * FLOOR     3 The remainder has the same sign as the divisor (Python %).
-             * HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.
-             * EUCLID    9 Euclidian division. q = sign(n) * floor(a / abs(n)).
-             *             The remainder is always positive.
-             *
-             * The truncated division, floored division, Euclidian division and IEEE 754 remainder
-             * modes are commonly used for the modulus operation.
-             * Although the other rounding modes can also be used, they may not give useful results.
-             */
-            MODULO_MODE = 1,                         // 0 to 9
-
-            // The maximum number of significant digits of the result of the toPower operation.
-            // If POW_PRECISION is 0, there will be unlimited significant digits.
-            POW_PRECISION = 100,                     // 0 to MAX
-
-            // The format specification used by the BigNumber.prototype.toFormat method.
-            FORMAT = {
-                decimalSeparator: '.',
-                groupSeparator: ',',
-                groupSize: 3,
-                secondaryGroupSize: 0,
-                fractionGroupSeparator: '\xA0',      // non-breaking space
-                fractionGroupSize: 0
-            };
-
-
-        /******************************************************************************************/
-
-
-        // CONSTRUCTOR
-
-
-        /*
-         * The BigNumber constructor and exported function.
-         * Create and return a new instance of a BigNumber object.
-         *
-         * n {number|string|BigNumber} A numeric value.
-         * [b] {number} The base of n. Integer, 2 to 64 inclusive.
-         */
-        function BigNumber( n, b ) {
-            var c, e, i, num, len, str,
-                x = this;
-
-            // Enable constructor usage without new.
-            if ( !( x instanceof BigNumber ) ) {
-
-                // 'BigNumber() constructor call without new: {n}'
-                if (ERRORS) raise( 26, 'constructor call without new', n );
-                return new BigNumber( n, b );
-            }
-
-            // 'new BigNumber() base not an integer: {b}'
-            // 'new BigNumber() base out of range: {b}'
-            if ( b == null || !isValidInt( b, 2, 64, id, 'base' ) ) {
-
-                // Duplicate.
-                if ( n instanceof BigNumber ) {
-                    x.s = n.s;
-                    x.e = n.e;
-                    x.c = ( n = n.c ) ? n.slice() : n;
-                    id = 0;
-                    return;
-                }
-
-                if ( ( num = typeof n == 'number' ) && n * 0 == 0 ) {
-                    x.s = 1 / n < 0 ? ( n = -n, -1 ) : 1;
-
-                    // Fast path for integers.
-                    if ( n === ~~n ) {
-                        for ( e = 0, i = n; i >= 10; i /= 10, e++ );
-                        x.e = e;
-                        x.c = [n];
-                        id = 0;
-                        return;
-                    }
-
-                    str = n + '';
-                } else {
-                    if ( !isNumeric.test( str = n + '' ) ) return parseNumeric( x, str, num );
-                    x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1;
-                }
-            } else {
-                b = b | 0;
-                str = n + '';
-
-                // Ensure return value is rounded to DECIMAL_PLACES as with other bases.
-                // Allow exponential notation to be used with base 10 argument.
-                if ( b == 10 ) {
-                    x = new BigNumber( n instanceof BigNumber ? n : str );
-                    return round( x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE );
-                }
-
-                // Avoid potential interpretation of Infinity and NaN as base 44+ values.
-                // Any number in exponential form will fail due to the [Ee][+-].
-                if ( ( num = typeof n == 'number' ) && n * 0 != 0 ||
-                  !( new RegExp( '^-?' + ( c = '[' + ALPHABET.slice( 0, b ) + ']+' ) +
-                    '(?:\\.' + c + ')?$',b < 37 ? 'i' : '' ) ).test(str) ) {
-                    return parseNumeric( x, str, num, b );
-                }
-
-                if (num) {
-                    x.s = 1 / n < 0 ? ( str = str.slice(1), -1 ) : 1;
-
-                    if ( ERRORS && str.replace( /^0\.0*|\./, '' ).length > 15 ) {
-
-                        // 'new BigNumber() number type has more than 15 significant digits: {n}'
-                        raise( id, tooManyDigits, n );
-                    }
-
-                    // Prevent later check for length on converted number.
-                    num = false;
-                } else {
-                    x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1;
-                }
-
-                str = convertBase( str, 10, b, x.s );
-            }
-
-            // Decimal point?
-            if ( ( e = str.indexOf('.') ) > -1 ) str = str.replace( '.', '' );
-
-            // Exponential form?
-            if ( ( i = str.search( /e/i ) ) > 0 ) {
-
-                // Determine exponent.
-                if ( e < 0 ) e = i;
-                e += +str.slice( i + 1 );
-                str = str.substring( 0, i );
-            } else if ( e < 0 ) {
-
-                // Integer.
-                e = str.length;
-            }
-
-            // Determine leading zeros.
-            for ( i = 0; str.charCodeAt(i) === 48; i++ );
-
-            // Determine trailing zeros.
-            for ( len = str.length; str.charCodeAt(--len) === 48; );
-            str = str.slice( i, len + 1 );
-
-            if (str) {
-                len = str.length;
-
-                // Disallow numbers with over 15 significant digits if number type.
-                // 'new BigNumber() number type has more than 15 significant digits: {n}'
-                if ( num && ERRORS && len > 15 ) raise( id, tooManyDigits, x.s * n );
-
-                e = e - i - 1;
-
-                 // Overflow?
-                if ( e > MAX_EXP ) {
-
-                    // Infinity.
-                    x.c = x.e = null;
-
-                // Underflow?
-                } else if ( e < MIN_EXP ) {
-
-                    // Zero.
-                    x.c = [ x.e = 0 ];
-                } else {
-                    x.e = e;
-                    x.c = [];
-
-                    // Transform base
-
-                    // e is the base 10 exponent.
-                    // i is where to slice str to get the first element of the coefficient array.
-                    i = ( e + 1 ) % LOG_BASE;
-                    if ( e < 0 ) i += LOG_BASE;
-
-                    if ( i < len ) {
-                        if (i) x.c.push( +str.slice( 0, i ) );
-
-                        for ( len -= LOG_BASE; i < len; ) {
-                            x.c.push( +str.slice( i, i += LOG_BASE ) );
-                        }
-
-                        str = str.slice(i);
-                        i = LOG_BASE - str.length;
-                    } else {
-                        i -= len;
-                    }
-
-                    for ( ; i--; str += '0' );
-                    x.c.push( +str );
-                }
-            } else {
-
-                // Zero.
-                x.c = [ x.e = 0 ];
-            }
-
-            id = 0;
-        }
-
-
-        // CONSTRUCTOR PROPERTIES
-
-
-        BigNumber.another = constructorFactory;
-
-        BigNumber.ROUND_UP = 0;
-        BigNumber.ROUND_DOWN = 1;
-        BigNumber.ROUND_CEIL = 2;
-        BigNumber.ROUND_FLOOR = 3;
-        BigNumber.ROUND_HALF_UP = 4;
-        BigNumber.ROUND_HALF_DOWN = 5;
-        BigNumber.ROUND_HALF_EVEN = 6;
-        BigNumber.ROUND_HALF_CEIL = 7;
-        BigNumber.ROUND_HALF_FLOOR = 8;
-        BigNumber.EUCLID = 9;
-
-
-        /*
-         * Configure infrequently-changing library-wide settings.
-         *
-         * Accept an object or an argument list, with one or many of the following properties or
-         * parameters respectively:
-         *
-         *   DECIMAL_PLACES  {number}  Integer, 0 to MAX inclusive
-         *   ROUNDING_MODE   {number}  Integer, 0 to 8 inclusive
-         *   EXPONENTIAL_AT  {number|number[]}  Integer, -MAX to MAX inclusive or
-         *                                      [integer -MAX to 0 incl., 0 to MAX incl.]
-         *   RANGE           {number|number[]}  Non-zero integer, -MAX to MAX inclusive or
-         *                                      [integer -MAX to -1 incl., integer 1 to MAX incl.]
-         *   ERRORS          {boolean|number}   true, false, 1 or 0
-         *   CRYPTO          {boolean|number}   true, false, 1 or 0
-         *   MODULO_MODE     {number}           0 to 9 inclusive
-         *   POW_PRECISION   {number}           0 to MAX inclusive
-         *   FORMAT          {object}           See BigNumber.prototype.toFormat
-         *      decimalSeparator       {string}
-         *      groupSeparator         {string}
-         *      groupSize              {number}
-         *      secondaryGroupSize     {number}
-         *      fractionGroupSeparator {string}
-         *      fractionGroupSize      {number}
-         *
-         * (The values assigned to the above FORMAT object properties are not checked for validity.)
-         *
-         * E.g.
-         * BigNumber.config(20, 4) is equivalent to
-         * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })
-         *
-         * Ignore properties/parameters set to null or undefined.
-         * Return an object with the properties current values.
-         */
-        BigNumber.config = function () {
-            var v, p,
-                i = 0,
-                r = {},
-                a = arguments,
-                o = a[0],
-                has = o && typeof o == 'object'
-                  ? function () { if ( o.hasOwnProperty(p) ) return ( v = o[p] ) != null; }
-                  : function () { if ( a.length > i ) return ( v = a[i++] ) != null; };
-
-            // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.
-            // 'config() DECIMAL_PLACES not an integer: {v}'
-            // 'config() DECIMAL_PLACES out of range: {v}'
-            if ( has( p = 'DECIMAL_PLACES' ) && isValidInt( v, 0, MAX, 2, p ) ) {
-                DECIMAL_PLACES = v | 0;
-            }
-            r[p] = DECIMAL_PLACES;
-
-            // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.
-            // 'config() ROUNDING_MODE not an integer: {v}'
-            // 'config() ROUNDING_MODE out of range: {v}'
-            if ( has( p = 'ROUNDING_MODE' ) && isValidInt( v, 0, 8, 2, p ) ) {
-                ROUNDING_MODE = v | 0;
-            }
-            r[p] = ROUNDING_MODE;
-
-            // EXPONENTIAL_AT {number|number[]}
-            // Integer, -MAX to MAX inclusive or [integer -MAX to 0 inclusive, 0 to MAX inclusive].
-            // 'config() EXPONENTIAL_AT not an integer: {v}'
-            // 'config() EXPONENTIAL_AT out of range: {v}'
-            if ( has( p = 'EXPONENTIAL_AT' ) ) {
-
-                if ( isArray(v) ) {
-                    if ( isValidInt( v[0], -MAX, 0, 2, p ) && isValidInt( v[1], 0, MAX, 2, p ) ) {
-                        TO_EXP_NEG = v[0] | 0;
-                        TO_EXP_POS = v[1] | 0;
-                    }
-                } else if ( isValidInt( v, -MAX, MAX, 2, p ) ) {
-                    TO_EXP_NEG = -( TO_EXP_POS = ( v < 0 ? -v : v ) | 0 );
-                }
-            }
-            r[p] = [ TO_EXP_NEG, TO_EXP_POS ];
-
-            // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or
-            // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].
-            // 'config() RANGE not an integer: {v}'
-            // 'config() RANGE cannot be zero: {v}'
-            // 'config() RANGE out of range: {v}'
-            if ( has( p = 'RANGE' ) ) {
-
-                if ( isArray(v) ) {
-                    if ( isValidInt( v[0], -MAX, -1, 2, p ) && isValidInt( v[1], 1, MAX, 2, p ) ) {
-                        MIN_EXP = v[0] | 0;
-                        MAX_EXP = v[1] | 0;
-                    }
-                } else if ( isValidInt( v, -MAX, MAX, 2, p ) ) {
-                    if ( v | 0 ) MIN_EXP = -( MAX_EXP = ( v < 0 ? -v : v ) | 0 );
-                    else if (ERRORS) raise( 2, p + ' cannot be zero', v );
-                }
-            }
-            r[p] = [ MIN_EXP, MAX_EXP ];
-
-            // ERRORS {boolean|number} true, false, 1 or 0.
-            // 'config() ERRORS not a boolean or binary digit: {v}'
-            if ( has( p = 'ERRORS' ) ) {
-
-                if ( v === !!v || v === 1 || v === 0 ) {
-                    id = 0;
-                    isValidInt = ( ERRORS = !!v ) ? intValidatorWithErrors : intValidatorNoErrors;
-                } else if (ERRORS) {
-                    raise( 2, p + notBool, v );
-                }
-            }
-            r[p] = ERRORS;
-
-            // CRYPTO {boolean|number} true, false, 1 or 0.
-            // 'config() CRYPTO not a boolean or binary digit: {v}'
-            // 'config() crypto unavailable: {crypto}'
-            if ( has( p = 'CRYPTO' ) ) {
-
-                if ( v === !!v || v === 1 || v === 0 ) {
-                    CRYPTO = !!( v && cryptoObj );
-                    if ( v && !CRYPTO && ERRORS ) raise( 2, 'crypto unavailable', cryptoObj );
-                } else if (ERRORS) {
-                    raise( 2, p + notBool, v );
-                }
-            }
-            r[p] = CRYPTO;
-
-            // MODULO_MODE {number} Integer, 0 to 9 inclusive.
-            // 'config() MODULO_MODE not an integer: {v}'
-            // 'config() MODULO_MODE out of range: {v}'
-            if ( has( p = 'MODULO_MODE' ) && isValidInt( v, 0, 9, 2, p ) ) {
-                MODULO_MODE = v | 0;
-            }
-            r[p] = MODULO_MODE;
-
-            // POW_PRECISION {number} Integer, 0 to MAX inclusive.
-            // 'config() POW_PRECISION not an integer: {v}'
-            // 'config() POW_PRECISION out of range: {v}'
-            if ( has( p = 'POW_PRECISION' ) && isValidInt( v, 0, MAX, 2, p ) ) {
-                POW_PRECISION = v | 0;
-            }
-            r[p] = POW_PRECISION;
-
-            // FORMAT {object}
-            // 'config() FORMAT not an object: {v}'
-            if ( has( p = 'FORMAT' ) ) {
-
-                if ( typeof v == 'object' ) {
-                    FORMAT = v;
-                } else if (ERRORS) {
-                    raise( 2, p + ' not an object', v );
-                }
-            }
-            r[p] = FORMAT;
-
-            return r;
-        };
-
-
-        /*
-         * Return a new BigNumber whose value is the maximum of the arguments.
-         *
-         * arguments {number|string|BigNumber}
-         */
-        BigNumber.max = function () { return maxOrMin( arguments, P.lt ); };
-
-
-        /*
-         * Return a new BigNumber whose value is the minimum of the arguments.
-         *
-         * arguments {number|string|BigNumber}
-         */
-        BigNumber.min = function () { return maxOrMin( arguments, P.gt ); };
-
-
-        /*
-         * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,
-         * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing
-         * zeros are produced).
-         *
-         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
-         *
-         * 'random() decimal places not an integer: {dp}'
-         * 'random() decimal places out of range: {dp}'
-         * 'random() crypto unavailable: {crypto}'
-         */
-        BigNumber.random = (function () {
-            var pow2_53 = 0x20000000000000;
-
-            // Return a 53 bit integer n, where 0 <= n < 9007199254740992.
-            // Check if Math.random() produces more than 32 bits of randomness.
-            // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.
-            // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.
-            var random53bitInt = (Math.random() * pow2_53) & 0x1fffff
-              ? function () { return mathfloor( Math.random() * pow2_53 ); }
-              : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +
-                  (Math.random() * 0x800000 | 0); };
-
-            return function (dp) {
-                var a, b, e, k, v,
-                    i = 0,
-                    c = [],
-                    rand = new BigNumber(ONE);
-
-                dp = dp == null || !isValidInt( dp, 0, MAX, 14 ) ? DECIMAL_PLACES : dp | 0;
-                k = mathceil( dp / LOG_BASE );
-
-                if (CRYPTO) {
-
-                    // Browsers supporting crypto.getRandomValues.
-                    if ( cryptoObj && cryptoObj.getRandomValues ) {
-
-                        a = cryptoObj.getRandomValues( new Uint32Array( k *= 2 ) );
-
-                        for ( ; i < k; ) {
-
-                            // 53 bits:
-                            // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)
-                            // 11111 11111111 11111111 11111111 11100000 00000000 00000000
-                            // ((Math.pow(2, 32) - 1) >>> 11).toString(2)
-                            //                                     11111 11111111 11111111
-                            // 0x20000 is 2^21.
-                            v = a[i] * 0x20000 + (a[i + 1] >>> 11);
-
-                            // Rejection sampling:
-                            // 0 <= v < 9007199254740992
-                            // Probability that v >= 9e15, is
-                            // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251
-                            if ( v >= 9e15 ) {
-                                b = cryptoObj.getRandomValues( new Uint32Array(2) );
-                                a[i] = b[0];
-                                a[i + 1] = b[1];
-                            } else {
-
-                                // 0 <= v <= 8999999999999999
-                                // 0 <= (v % 1e14) <= 99999999999999
-                                c.push( v % 1e14 );
-                                i += 2;
-                            }
-                        }
-                        i = k / 2;
-
-                    // Node.js supporting crypto.randomBytes.
-                    } else if ( cryptoObj && cryptoObj.randomBytes ) {
-
-                        // buffer
-                        a = cryptoObj.randomBytes( k *= 7 );
-
-                        for ( ; i < k; ) {
-
-                            // 0x1000000000000 is 2^48, 0x10000000000 is 2^40
-                            // 0x100000000 is 2^32, 0x1000000 is 2^24
-                            // 11111 11111111 11111111 11111111 11111111 11111111 11111111
-                            // 0 <= v < 9007199254740992
-                            v = ( ( a[i] & 31 ) * 0x1000000000000 ) + ( a[i + 1] * 0x10000000000 ) +
-                                  ( a[i + 2] * 0x100000000 ) + ( a[i + 3] * 0x1000000 ) +
-                                  ( a[i + 4] << 16 ) + ( a[i + 5] << 8 ) + a[i + 6];
-
-                            if ( v >= 9e15 ) {
-                                cryptoObj.randomBytes(7).copy( a, i );
-                            } else {
-
-                                // 0 <= (v % 1e14) <= 99999999999999
-                                c.push( v % 1e14 );
-                                i += 7;
-                            }
-                        }
-                        i = k / 7;
-                    } else if (ERRORS) {
-                        raise( 14, 'crypto unavailable', cryptoObj );
-                    }
-                }
-
-                // Use Math.random: CRYPTO is false or crypto is unavailable and ERRORS is false.
-                if (!i) {
-
-                    for ( ; i < k; ) {
-                        v = random53bitInt();
-                        if ( v < 9e15 ) c[i++] = v % 1e14;
-                    }
-                }
-
-                k = c[--i];
-                dp %= LOG_BASE;
-
-                // Convert trailing digits to zeros according to dp.
-                if ( k && dp ) {
-                    v = POWS_TEN[LOG_BASE - dp];
-                    c[i] = mathfloor( k / v ) * v;
-                }
-
-                // Remove trailing elements which are zero.
-                for ( ; c[i] === 0; c.pop(), i-- );
-
-                // Zero?
-                if ( i < 0 ) {
-                    c = [ e = 0 ];
-                } else {
-
-                    // Remove leading elements which are zero and adjust exponent accordingly.
-                    for ( e = -1 ; c[0] === 0; c.shift(), e -= LOG_BASE);
-
-                    // Count the digits of the first element of c to determine leading zeros, and...
-                    for ( i = 1, v = c[0]; v >= 10; v /= 10, i++);
-
-                    // adjust the exponent accordingly.
-                    if ( i < LOG_BASE ) e -= LOG_BASE - i;
-                }
-
-                rand.e = e;
-                rand.c = c;
-                return rand;
-            };
-        })();
-
-
-        // PRIVATE FUNCTIONS
-
-
-        // Convert a numeric string of baseIn to a numeric string of baseOut.
-        function convertBase( str, baseOut, baseIn, sign ) {
-            var d, e, k, r, x, xc, y,
-                i = str.indexOf( '.' ),
-                dp = DECIMAL_PLACES,
-                rm = ROUNDING_MODE;
-
-            if ( baseIn < 37 ) str = str.toLowerCase();
-
-            // Non-integer.
-            if ( i >= 0 ) {
-                k = POW_PRECISION;
-
-                // Unlimited precision.
-                POW_PRECISION = 0;
-                str = str.replace( '.', '' );
-                y = new BigNumber(baseIn);
-                x = y.pow( str.length - i );
-                POW_PRECISION = k;
-
-                // Convert str as if an integer, then restore the fraction part by dividing the
-                // result by its base raised to a power.
-                y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );
-                y.e = y.c.length;
-            }
-
-            // Convert the number as integer.
-            xc = toBaseOut( str, baseIn, baseOut );
-            e = k = xc.length;
-
-            // Remove trailing zeros.
-            for ( ; xc[--k] == 0; xc.pop() );
-            if ( !xc[0] ) return '0';
-
-            if ( i < 0 ) {
-                --e;
-            } else {
-                x.c = xc;
-                x.e = e;
-
-                // sign is needed for correct rounding.
-                x.s = sign;
-                x = div( x, y, dp, rm, baseOut );
-                xc = x.c;
-                r = x.r;
-                e = x.e;
-            }
-
-            d = e + dp + 1;
-
-            // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.
-            i = xc[d];
-            k = baseOut / 2;
-            r = r || d < 0 || xc[d + 1] != null;
-
-            r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )
-                       : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||
-                         rm == ( x.s < 0 ? 8 : 7 ) );
-
-            if ( d < 1 || !xc[0] ) {
-
-                // 1^-dp or 0.
-                str = r ? toFixedPoint( '1', -dp ) : '0';
-            } else {
-                xc.length = d;
-
-                if (r) {
-
-                    // Rounding up may mean the previous digit has to be rounded up and so on.
-                    for ( --baseOut; ++xc[--d] > baseOut; ) {
-                        xc[d] = 0;
-
-                        if ( !d ) {
-                            ++e;
-                            xc.unshift(1);
-                        }
-                    }
-                }
-
-                // Determine trailing zeros.
-                for ( k = xc.length; !xc[--k]; );
-
-                // E.g. [4, 11, 15] becomes 4bf.
-                for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );
-                str = toFixedPoint( str, e );
-            }
-
-            // The caller will add the sign.
-            return str;
-        }
-
-
-        // Perform division in the specified base. Called by div and convertBase.
-        div = (function () {
-
-            // Assume non-zero x and k.
-            function multiply( x, k, base ) {
-                var m, temp, xlo, xhi,
-                    carry = 0,
-                    i = x.length,
-                    klo = k % SQRT_BASE,
-                    khi = k / SQRT_BASE | 0;
-
-                for ( x = x.slice(); i--; ) {
-                    xlo = x[i] % SQRT_BASE;
-                    xhi = x[i] / SQRT_BASE | 0;
-                    m = khi * xlo + xhi * klo;
-                    temp = klo * xlo + ( ( m % SQRT_BASE ) * SQRT_BASE ) + carry;
-                    carry = ( temp / base | 0 ) + ( m / SQRT_BASE | 0 ) + khi * xhi;
-                    x[i] = temp % base;
-                }
-
-                if (carry) x.unshift(carry);
-
-                return x;
-            }
-
-            function compare( a, b, aL, bL ) {
-                var i, cmp;
-
-                if ( aL != bL ) {
-                    cmp = aL > bL ? 1 : -1;
-                } else {
-
-                    for ( i = cmp = 0; i < aL; i++ ) {
-
-                        if ( a[i] != b[i] ) {
-                            cmp = a[i] > b[i] ? 1 : -1;
-                            break;
-                        }
-                    }
-                }
-                return cmp;
-            }
-
-            function subtract( a, b, aL, base ) {
-                var i = 0;
-
-                // Subtract b from a.
-                for ( ; aL--; ) {
-                    a[aL] -= i;
-                    i = a[aL] < b[aL] ? 1 : 0;
-                    a[aL] = i * base + a[aL] - b[aL];
-                }
-
-                // Remove leading zeros.
-                for ( ; !a[0] && a.length > 1; a.shift() );
-            }
-
-            // x: dividend, y: divisor.
-            return function ( x, y, dp, rm, base ) {
-                var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,
-                    yL, yz,
-                    s = x.s == y.s ? 1 : -1,
-                    xc = x.c,
-                    yc = y.c;
-
-                // Either NaN, Infinity or 0?
-                if ( !xc || !xc[0] || !yc || !yc[0] ) {
-
-                    return new BigNumber(
-
-                      // Return NaN if either NaN, or both Infinity or 0.
-                      !x.s || !y.s || ( xc ? yc && xc[0] == yc[0] : !yc ) ? NaN :
-
-                        // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
-                        xc && xc[0] == 0 || !yc ? s * 0 : s / 0
-                    );
-                }
-
-                q = new BigNumber(s);
-                qc = q.c = [];
-                e = x.e - y.e;
-                s = dp + e + 1;
-
-                if ( !base ) {
-                    base = BASE;
-                    e = bitFloor( x.e / LOG_BASE ) - bitFloor( y.e / LOG_BASE );
-                    s = s / LOG_BASE | 0;
-                }
-
-                // Result exponent may be one less then the current value of e.
-                // The coefficients of the BigNumbers from convertBase may have trailing zeros.
-                for ( i = 0; yc[i] == ( xc[i] || 0 ); i++ );
-                if ( yc[i] > ( xc[i] || 0 ) ) e--;
-
-                if ( s < 0 ) {
-                    qc.push(1);
-                    more = true;
-                } else {
-                    xL = xc.length;
-                    yL = yc.length;
-                    i = 0;
-                    s += 2;
-
-                    // Normalise xc and yc so highest order digit of yc is >= base / 2.
-
-                    n = mathfloor( base / ( yc[0] + 1 ) );
-
-                    // Not necessary, but to handle odd bases where yc[0] == ( base / 2 ) - 1.
-                    // if ( n > 1 || n++ == 1 && yc[0] < base / 2 ) {
-                    if ( n > 1 ) {
-                        yc = multiply( yc, n, base );
-                        xc = multiply( xc, n, base );
-                        yL = yc.length;
-                        xL = xc.length;
-                    }
-
-                    xi = yL;
-                    rem = xc.slice( 0, yL );
-                    remL = rem.length;
-
-                    // Add zeros to make remainder as long as divisor.
-                    for ( ; remL < yL; rem[remL++] = 0 );
-                    yz = yc.slice();
-                    yz.unshift(0);
-                    yc0 = yc[0];
-                    if ( yc[1] >= base / 2 ) yc0++;
-                    // Not necessary, but to prevent trial digit n > base, when using base 3.
-                    // else if ( base == 3 && yc0 == 1 ) yc0 = 1 + 1e-15;
-
-                    do {
-                        n = 0;
-
-                        // Compare divisor and remainder.
-                        cmp = compare( yc, rem, yL, remL );
-
-                        // If divisor < remainder.
-                        if ( cmp < 0 ) {
-
-                            // Calculate trial digit, n.
-
-                            rem0 = rem[0];
-                            if ( yL != remL ) rem0 = rem0 * base + ( rem[1] || 0 );
-
-                            // n is how many times the divisor goes into the current remainder.
-                            n = mathfloor( rem0 / yc0 );
-
-                            //  Algorithm:
-                            //  1. product = divisor * trial digit (n)
-                            //  2. if product > remainder: product -= divisor, n--
-                            //  3. remainder -= product
-                            //  4. if product was < remainder at 2:
-                            //    5. compare new remainder and divisor
-                            //    6. If remainder > divisor: remainder -= divisor, n++
-
-                            if ( n > 1 ) {
-
-                                // n may be > base only when base is 3.
-                                if (n >= base) n = base - 1;
-
-                                // product = divisor * trial digit.
-                                prod = multiply( yc, n, base );
-                                prodL = prod.length;
-                                remL = rem.length;
-
-                                // Compare product and remainder.
-                                // If product > remainder.
-                                // Trial digit n too high.
-                                // n is 1 too high about 5% of the time, and is not known to have
-                                // ever been more than 1 too high.
-                                while ( compare( prod, rem, prodL, remL ) == 1 ) {
-                                    n--;
-
-                                    // Subtract divisor from product.
-                                    subtract( prod, yL < prodL ? yz : yc, prodL, base );
-                                    prodL = prod.length;
-                                    cmp = 1;
-                                }
-                            } else {
-
-                                // n is 0 or 1, cmp is -1.
-                                // If n is 0, there is no need to compare yc and rem again below,
-                                // so change cmp to 1 to avoid it.
-                                // If n is 1, leave cmp as -1, so yc and rem are compared again.
-                                if ( n == 0 ) {
-
-                                    // divisor < remainder, so n must be at least 1.
-                                    cmp = n = 1;
-                                }
-
-                                // product = divisor
-                                prod = yc.slice();
-                                prodL = prod.length;
-                            }
-
-                            if ( prodL < remL ) prod.unshift(0);
-
-                            // Subtract product from remainder.
-                            subtract( rem, prod, remL, base );
-                            remL = rem.length;
-
-                             // If product was < remainder.
-                            if ( cmp == -1 ) {
-
-                                // Compare divisor and new remainder.
-                                // If divisor < new remainder, subtract divisor from remainder.
-                                // Trial digit n too low.
-                                // n is 1 too low about 5% of the time, and very rarely 2 too low.
-                                while ( compare( yc, rem, yL, remL ) < 1 ) {
-                                    n++;
-
-                                    // Subtract divisor from remainder.
-                                    subtract( rem, yL < remL ? yz : yc, remL, base );
-                                    remL = rem.length;
-                                }
-                            }
-                        } else if ( cmp === 0 ) {
-                            n++;
-                            rem = [0];
-                        } // else cmp === 1 and n will be 0
-
-                        // Add the next digit, n, to the result array.
-                        qc[i++] = n;
-
-                        // Update the remainder.
-                        if ( rem[0] ) {
-                            rem[remL++] = xc[xi] || 0;
-                        } else {
-                            rem = [ xc[xi] ];
-                            remL = 1;
-                        }
-                    } while ( ( xi++ < xL || rem[0] != null ) && s-- );
-
-                    more = rem[0] != null;
-
-                    // Leading zero?
-                    if ( !qc[0] ) qc.shift();
-                }
-
-                if ( base == BASE ) {
-
-                    // To calculate q.e, first get the number of digits of qc[0].
-                    for ( i = 1, s = qc[0]; s >= 10; s /= 10, i++ );
-                    round( q, dp + ( q.e = i + e * LOG_BASE - 1 ) + 1, rm, more );
-
-                // Caller is convertBase.
-                } else {
-                    q.e = e;
-                    q.r = +more;
-                }
-
-                return q;
-            };
-        })();
-
-
-        /*
-         * Return a string representing the value of BigNumber n in fixed-point or exponential
-         * notation rounded to the specified decimal places or significant digits.
-         *
-         * n is a BigNumber.
-         * i is the index of the last digit required (i.e. the digit that may be rounded up).
-         * rm is the rounding mode.
-         * caller is caller id: toExponential 19, toFixed 20, toFormat 21, toPrecision 24.
-         */
-        function format( n, i, rm, caller ) {
-            var c0, e, ne, len, str;
-
-            rm = rm != null && isValidInt( rm, 0, 8, caller, roundingMode )
-              ? rm | 0 : ROUNDING_MODE;
-
-            if ( !n.c ) return n.toString();
-            c0 = n.c[0];
-            ne = n.e;
-
-            if ( i == null ) {
-                str = coeffToString( n.c );
-                str = caller == 19 || caller == 24 && ne <= TO_EXP_NEG
-                  ? toExponential( str, ne )
-                  : toFixedPoint( str, ne );
-            } else {
-                n = round( new BigNumber(n), i, rm );
-
-                // n.e may have changed if the value was rounded up.
-                e = n.e;
-
-                str = coeffToString( n.c );
-                len = str.length;
-
-                // toPrecision returns exponential notation if the number of significant digits
-                // specified is less than the number of digits necessary to represent the integer
-                // part of the value in fixed-point notation.
-
-                // Exponential notation.
-                if ( caller == 19 || caller == 24 && ( i <= e || e <= TO_EXP_NEG ) ) {
-
-                    // Append zeros?
-                    for ( ; len < i; str += '0', len++ );
-                    str = toExponential( str, e );
-
-                // Fixed-point notation.
-                } else {
-                    i -= ne;
-                    str = toFixedPoint( str, e );
-
-                    // Append zeros?
-                    if ( e + 1 > len ) {
-                        if ( --i > 0 ) for ( str += '.'; i--; str += '0' );
-                    } else {
-                        i += e - len;
-                        if ( i > 0 ) {
-                            if ( e + 1 == len ) str += '.';
-                            for ( ; i--; str += '0' );
-                        }
-                    }
-                }
-            }
-
-            return n.s < 0 && c0 ? '-' + str : str;
-        }
-
-
-        // Handle BigNumber.max and BigNumber.min.
-        function maxOrMin( args, method ) {
-            var m, n,
-                i = 0;
-
-            if ( isArray( args[0] ) ) args = args[0];
-            m = new BigNumber( args[0] );
-
-            for ( ; ++i < args.length; ) {
-                n = new BigNumber( args[i] );
-
-                // If any number is NaN, return NaN.
-                if ( !n.s ) {
-                    m = n;
-                    break;
-                } else if ( method.call( m, n ) ) {
-                    m = n;
-                }
-            }
-
-            return m;
-        }
-
-
-        /*
-         * Return true if n is an integer in range, otherwise throw.
-         * Use for argument validation when ERRORS is true.
-         */
-        function intValidatorWithErrors( n, min, max, caller, name ) {
-            if ( n < min || n > max || n != truncate(n) ) {
-                raise( caller, ( name || 'decimal places' ) +
-                  ( n < min || n > max ? ' out of range' : ' not an integer' ), n );
-            }
-
-            return true;
-        }
-
-
-        /*
-         * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.
-         * Called by minus, plus and times.
-         */
-        function normalise( n, c, e ) {
-            var i = 1,
-                j = c.length;
-
-             // Remove trailing zeros.
-            for ( ; !c[--j]; c.pop() );
-
-            // Calculate the base 10 exponent. First get the number of digits of c[0].
-            for ( j = c[0]; j >= 10; j /= 10, i++ );
-
-            // Overflow?
-            if ( ( e = i + e * LOG_BASE - 1 ) > MAX_EXP ) {
-
-                // Infinity.
-                n.c = n.e = null;
-
-            // Underflow?
-            } else if ( e < MIN_EXP ) {
-
-                // Zero.
-                n.c = [ n.e = 0 ];
-            } else {
-                n.e = e;
-                n.c = c;
-            }
-
-            return n;
-        }
-
-
-        // Handle values that fail the validity test in BigNumber.
-        parseNumeric = (function () {
-            var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i,
-                dotAfter = /^([^.]+)\.$/,
-                dotBefore = /^\.([^.]+)$/,
-                isInfinityOrNaN = /^-?(Infinity|NaN)$/,
-                whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
-
-            return function ( x, str, num, b ) {
-                var base,
-                    s = num ? str : str.replace( whitespaceOrPlus, '' );
-
-                // No exception on ±Infinity or NaN.
-                if ( isInfinityOrNaN.test(s) ) {
-                    x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
-                } else {
-                    if ( !num ) {
-
-                        // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i
-                        s = s.replace( basePrefix, function ( m, p1, p2 ) {
-                            base = ( p2 = p2.toLowerCase() ) == 'x' ? 16 : p2 == 'b' ? 2 : 8;
-                            return !b || b == base ? p1 : m;
-                        });
-
-                        if (b) {
-                            base = b;
-
-                            // E.g. '1.' to '1', '.1' to '0.1'
-                            s = s.replace( dotAfter, '$1' ).replace( dotBefore, '0.$1' );
-                        }
-
-                        if ( str != s ) return new BigNumber( s, base );
-                    }
-
-                    // 'new BigNumber() not a number: {n}'
-                    // 'new BigNumber() not a base {b} number: {n}'
-                    if (ERRORS) raise( id, 'not a' + ( b ? ' base ' + b : '' ) + ' number', str );
-                    x.s = null;
-                }
-
-                x.c = x.e = null;
-                id = 0;
-            }
-        })();
-
-
-        // Throw a BigNumber Error.
-        function raise( caller, msg, val ) {
-            var error = new Error( [
-                'new BigNumber',     // 0
-                'cmp',               // 1
-                'config',            // 2
-                'div',               // 3
-                'divToInt',          // 4
-                'eq',                // 5
-                'gt',                // 6
-                'gte',               // 7
-                'lt',                // 8
-                'lte',               // 9
-                'minus',             // 10
-                'mod',               // 11
-                'plus',              // 12
-                'precision',         // 13
-                'random',            // 14
-                'round',             // 15
-                'shift',             // 16
-                'times',             // 17
-                'toDigits',          // 18
-                'toExponential',     // 19
-                'toFixed',           // 20
-                'toFormat',          // 21
-                'toFraction',        // 22
-                'pow',               // 23
-                'toPrecision',       // 24
-                'toString',          // 25
-                'BigNumber'          // 26
-            ][caller] + '() ' + msg + ': ' + val );
-
-            error.name = 'BigNumber Error';
-            id = 0;
-            throw error;
-        }
-
-
-        /*
-         * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.
-         * If r is truthy, it is known that there are more digits after the rounding digit.
-         */
-        function round( x, sd, rm, r ) {
-            var d, i, j, k, n, ni, rd,
-                xc = x.c,
-                pows10 = POWS_TEN;
-
-            // if x is not Infinity or NaN...
-            if (xc) {
-
-                // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.
-                // n is a base 1e14 number, the value of the element of array x.c containing rd.
-                // ni is the index of n within x.c.
-                // d is the number of digits of n.
-                // i is the index of rd within n including leading zeros.
-                // j is the actual index of rd within n (if < 0, rd is a leading zero).
-                out: {
-
-                    // Get the number of digits of the first element of xc.
-                    for ( d = 1, k = xc[0]; k >= 10; k /= 10, d++ );
-                    i = sd - d;
-
-                    // If the rounding digit is in the first element of xc...
-                    if ( i < 0 ) {
-                        i += LOG_BASE;
-                        j = sd;
-                        n = xc[ ni = 0 ];
-
-                        // Get the rounding digit at index j of n.
-                        rd = n / pows10[ d - j - 1 ] % 10 | 0;
-                    } else {
-                        ni = mathceil( ( i + 1 ) / LOG_BASE );
-
-                        if ( ni >= xc.length ) {
-
-                            if (r) {
-
-                                // Needed by sqrt.
-                                for ( ; xc.length <= ni; xc.push(0) );
-                                n = rd = 0;
-                                d = 1;
-                                i %= LOG_BASE;
-                                j = i - LOG_BASE + 1;
-                            } else {
-                                break out;
-                            }
-                        } else {
-                            n = k = xc[ni];
-
-                            // Get the number of digits of n.
-                            for ( d = 1; k >= 10; k /= 10, d++ );
-
-                            // Get the index of rd within n.
-                            i %= LOG_BASE;
-
-                            // Get the index of rd within n, adjusted for leading zeros.
-                            // The number of leading zeros of n is given by LOG_BASE - d.
-                            j = i - LOG_BASE + d;
-
-                            // Get the rounding digit at index j of n.
-                            rd = j < 0 ? 0 : n / pows10[ d - j - 1 ] % 10 | 0;
-                        }
-                    }
-
-                    r = r || sd < 0 ||
-
-                    // Are there any non-zero digits after the rounding digit?
-                    // The expression  n % pows10[ d - j - 1 ]  returns all digits of n to the right
-                    // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
-                      xc[ni + 1] != null || ( j < 0 ? n : n % pows10[ d - j - 1 ] );
-
-                    r = rm < 4
-                      ? ( rd || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )
-                      : rd > 5 || rd == 5 && ( rm == 4 || r || rm == 6 &&
-
-                        // Check whether the digit to the left of the rounding digit is odd.
-                        ( ( i > 0 ? j > 0 ? n / pows10[ d - j ] : 0 : xc[ni - 1] ) % 10 ) & 1 ||
-                          rm == ( x.s < 0 ? 8 : 7 ) );
-
-                    if ( sd < 1 || !xc[0] ) {
-                        xc.length = 0;
-
-                        if (r) {
-
-                            // Convert sd to decimal places.
-                            sd -= x.e + 1;
-
-                            // 1, 0.1, 0.01, 0.001, 0.0001 etc.
-                            xc[0] = pows10[ ( LOG_BASE - sd % LOG_BASE ) % LOG_BASE ];
-                            x.e = -sd || 0;
-                        } else {
-
-                            // Zero.
-                            xc[0] = x.e = 0;
-                        }
-
-                        return x;
-                    }
-
-                    // Remove excess digits.
-                    if ( i == 0 ) {
-                        xc.length = ni;
-                        k = 1;
-                        ni--;
-                    } else {
-                        xc.length = ni + 1;
-                        k = pows10[ LOG_BASE - i ];
-
-                        // E.g. 56700 becomes 56000 if 7 is the rounding digit.
-                        // j > 0 means i > number of leading zeros of n.
-                        xc[ni] = j > 0 ? mathfloor( n / pows10[ d - j ] % pows10[j] ) * k : 0;
-                    }
-
-                    // Round up?
-                    if (r) {
-
-                        for ( ; ; ) {
-
-                            // If the digit to be rounded up is in the first element of xc...
-                            if ( ni == 0 ) {
-
-                                // i will be the length of xc[0] before k is added.
-                                for ( i = 1, j = xc[0]; j >= 10; j /= 10, i++ );
-                                j = xc[0] += k;
-                                for ( k = 1; j >= 10; j /= 10, k++ );
-
-                                // if i != k the length has increased.
-                                if ( i != k ) {
-                                    x.e++;
-                                    if ( xc[0] == BASE ) xc[0] = 1;
-                                }
-
-                                break;
-                            } else {
-                                xc[ni] += k;
-                                if ( xc[ni] != BASE ) break;
-                                xc[ni--] = 0;
-                                k = 1;
-                            }
-                        }
-                    }
-
-                    // Remove trailing zeros.
-                    for ( i = xc.length; xc[--i] === 0; xc.pop() );
-                }
-
-                // Overflow? Infinity.
-                if ( x.e > MAX_EXP ) {
-                    x.c = x.e = null;
-
-                // Underflow? Zero.
-                } else if ( x.e < MIN_EXP ) {
-                    x.c = [ x.e = 0 ];
-                }
-            }
-
-            return x;
-        }
-
-
-        // PROTOTYPE/INSTANCE METHODS
-
-
-        /*
-         * Return a new BigNumber whose value is the absolute value of this BigNumber.
-         */
-        P.absoluteValue = P.abs = function () {
-            var x = new BigNumber(this);
-            if ( x.s < 0 ) x.s = 1;
-            return x;
-        };
-
-
-        /*
-         * Return a new BigNumber whose value is the value of this BigNumber rounded to a whole
-         * number in the direction of Infinity.
-         */
-        P.ceil = function () {
-            return round( new BigNumber(this), this.e + 1, 2 );
-        };
-
-
-        /*
-         * Return
-         * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),
-         * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),
-         * 0 if they have the same value,
-         * or null if the value of either is NaN.
-         */
-        P.comparedTo = P.cmp = function ( y, b ) {
-            id = 1;
-            return compare( this, new BigNumber( y, b ) );
-        };
-
-
-        /*
-         * Return the number of decimal places of the value of this BigNumber, or null if the value
-         * of this BigNumber is ±Infinity or NaN.
-         */
-        P.decimalPlaces = P.dp = function () {
-            var n, v,
-                c = this.c;
-
-            if ( !c ) return null;
-            n = ( ( v = c.length - 1 ) - bitFloor( this.e / LOG_BASE ) ) * LOG_BASE;
-
-            // Subtract the number of trailing zeros of the last number.
-            if ( v = c[v] ) for ( ; v % 10 == 0; v /= 10, n-- );
-            if ( n < 0 ) n = 0;
-
-            return n;
-        };
-
-
-        /*
-         *  n / 0 = I
-         *  n / N = N
-         *  n / I = 0
-         *  0 / n = 0
-         *  0 / 0 = N
-         *  0 / N = N
-         *  0 / I = 0
-         *  N / n = N
-         *  N / 0 = N
-         *  N / N = N
-         *  N / I = N
-         *  I / n = I
-         *  I / 0 = I
-         *  I / N = N
-         *  I / I = N
-         *
-         * Return a new BigNumber whose value is the value of this BigNumber divided by the value of
-         * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.
-         */
-        P.dividedBy = P.div = function ( y, b ) {
-            id = 3;
-            return div( this, new BigNumber( y, b ), DECIMAL_PLACES, ROUNDING_MODE );
-        };
-
-
-        /*
-         * Return a new BigNumber whose value is the integer part of dividing the value of this
-         * BigNumber by the value of BigNumber(y, b).
-         */
-        P.dividedToIntegerBy = P.divToInt = function ( y, b ) {
-            id = 4;
-            return div( this, new BigNumber( y, b ), 0, 1 );
-        };
-
-
-        /*
-         * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),
-         * otherwise returns false.
-         */
-        P.equals = P.eq = function ( y, b ) {
-            id = 5;
-            return compare( this, new BigNumber( y, b ) ) === 0;
-        };
-
-
-        /*
-         * Return a new BigNumber whose value is the value of this BigNumber rounded to a whole
-         * number in the direction of -Infinity.
-         */
-        P.floor = function () {
-            return round( new BigNumber(this), this.e + 1, 3 );
-        };
-
-
-        /*
-         * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),
-         * otherwise returns false.
-         */
-        P.greaterThan = P.gt = function ( y, b ) {
-            id = 6;
-            return compare( this, new BigNumber( y, b ) ) > 0;
-        };
-
-
-        /*
-         * Return true if the value of this BigNumber is greater than or equal to the value of
-         * BigNumber(y, b), otherwise returns false.
-         */
-        P.greaterThanOrEqualTo = P.gte = function ( y, b ) {
-            id = 7;
-            return ( b = compare( this, new BigNumber( y, b ) ) ) === 1 || b === 0;
-
-        };
-
-
-        /*
-         * Return true if the value of this BigNumber is a finite number, otherwise returns false.
-         */
-        P.isFinite = function () {
-            return !!this.c;
-        };
-
-
-        /*
-         * Return true if the value of this BigNumber is an integer, otherwise return false.
-         */
-        P.isInteger = P.isInt = function () {
-            return !!this.c && bitFloor( this.e / LOG_BASE ) > this.c.length - 2;
-        };
-
-
-        /*
-         * Return true if the value of this BigNumber is NaN, otherwise returns false.
-         */
-        P.isNaN = function () {
-            return !this.s;
-        };
-
-
-        /*
-         * Return true if the value of this BigNumber is negative, otherwise returns false.
-         */
-        P.isNegative = P.isNeg = function () {
-            return this.s < 0;
-        };
-
-
-        /*
-         * Return true if the value of this BigNumber is 0 or -0, otherwise returns false.
-         */
-        P.isZero = function () {
-            return !!this.c && this.c[0] == 0;
-        };
-
-
-        /*
-         * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),
-         * otherwise returns false.
-         */
-        P.lessThan = P.lt = function ( y, b ) {
-            id = 8;
-            return compare( this, new BigNumber( y, b ) ) < 0;
-        };
-
-
-        /*
-         * Return true if the value of this BigNumber is less than or equal to the value of
-         * BigNumber(y, b), otherwise returns false.
-         */
-        P.lessThanOrEqualTo = P.lte = function ( y, b ) {
-            id = 9;
-            return ( b = compare( this, new BigNumber( y, b ) ) ) === -1 || b === 0;
-        };
-
-
-        /*
-         *  n - 0 = n
-         *  n - N = N
-         *  n - I = -I
-         *  0 - n = -n
-         *  0 - 0 = 0
-         *  0 - N = N
-         *  0 - I = -I
-         *  N - n = N
-         *  N - 0 = N
-         *  N - N = N
-         *  N - I = N
-         *  I - n = I
-         *  I - 0 = I
-         *  I - N = N
-         *  I - I = N
-         *
-         * Return a new BigNumber whose value is the value of this BigNumber minus the value of
-         * BigNumber(y, b).
-         */
-        P.minus = P.sub = function ( y, b ) {
-            var i, j, t, xLTy,
-                x = this,
-                a = x.s;
-
-            id = 10;
-            y = new BigNumber( y, b );
-            b = y.s;
-
-            // Either NaN?
-            if ( !a || !b ) return new BigNumber(NaN);
-
-            // Signs differ?
-            if ( a != b ) {
-                y.s = -b;
-                return x.plus(y);
-            }
-
-            var xe = x.e / LOG_BASE,
-                ye = y.e / LOG_BASE,
-                xc = x.c,
-                yc = y.c;
-
-            if ( !xe || !ye ) {
-
-                // Either Infinity?
-                if ( !xc || !yc ) return xc ? ( y.s = -b, y ) : new BigNumber( yc ? x : NaN );
-
-                // Either zero?
-                if ( !xc[0] || !yc[0] ) {
-
-                    // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.
-                    return yc[0] ? ( y.s = -b, y ) : new BigNumber( xc[0] ? x :
-
-                      // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
-                      ROUNDING_MODE == 3 ? -0 : 0 );
-                }
-            }
-
-            xe = bitFloor(xe);
-            ye = bitFloor(ye);
-            xc = xc.slice();
-
-            // Determine which is the bigger number.
-            if ( a = xe - ye ) {
-
-                if ( xLTy = a < 0 ) {
-                    a = -a;
-                    t = xc;
-                } else {
-                    ye = xe;
-                    t = yc;
-                }
-
-                t.reverse();
-
-                // Prepend zeros to equalise exponents.
-                for ( b = a; b--; t.push(0) );
-                t.reverse();
-            } else {
-
-                // Exponents equal. Check digit by digit.
-                j = ( xLTy = ( a = xc.length ) < ( b = yc.length ) ) ? a : b;
-
-                for ( a = b = 0; b < j; b++ ) {
-
-                    if ( xc[b] != yc[b] ) {
-                        xLTy = xc[b] < yc[b];
-                        break;
-                    }
-                }
-            }
-
-            // x < y? Point xc to the array of the bigger number.
-            if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;
-
-            b = ( j = yc.length ) - ( i = xc.length );
-
-            // Append zeros to xc if shorter.
-            // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.
-            if ( b > 0 ) for ( ; b--; xc[i++] = 0 );
-            b = BASE - 1;
-
-            // Subtract yc from xc.
-            for ( ; j > a; ) {
-
-                if ( xc[--j] < yc[j] ) {
-                    for ( i = j; i && !xc[--i]; xc[i] = b );
-                    --xc[i];
-                    xc[j] += BASE;
-                }
-
-                xc[j] -= yc[j];
-            }
-
-            // Remove leading zeros and adjust exponent accordingly.
-            for ( ; xc[0] == 0; xc.shift(), --ye );
-
-            // Zero?
-            if ( !xc[0] ) {
-
-                // Following IEEE 754 (2008) 6.3,
-                // n - n = +0  but  n - n = -0  when rounding towards -Infinity.
-                y.s = ROUNDING_MODE == 3 ? -1 : 1;
-                y.c = [ y.e = 0 ];
-                return y;
-            }
-
-            // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity
-            // for finite x and y.
-            return normalise( y, xc, ye );
-        };
-
-
-        /*
-         *   n % 0 =  N
-         *   n % N =  N
-         *   n % I =  n
-         *   0 % n =  0
-         *  -0 % n = -0
-         *   0 % 0 =  N
-         *   0 % N =  N
-         *   0 % I =  0
-         *   N % n =  N
-         *   N % 0 =  N
-         *   N % N =  N
-         *   N % I =  N
-         *   I % n =  N
-         *   I % 0 =  N
-         *   I % N =  N
-         *   I % I =  N
-         *
-         * Return a new BigNumber whose value is the value of this BigNumber modulo the value of
-         * BigNumber(y, b). The result depends on the value of MODULO_MODE.
-         */
-        P.modulo = P.mod = function ( y, b ) {
-            var q, s,
-                x = this;
-
-            id = 11;
-            y = new BigNumber( y, b );
-
-            // Return NaN if x is Infinity or NaN, or y is NaN or zero.
-            if ( !x.c || !y.s || y.c && !y.c[0] ) {
-                return new BigNumber(NaN);
-
-            // Return x if y is Infinity or x is zero.
-            } else if ( !y.c || x.c && !x.c[0] ) {
-                return new BigNumber(x);
-            }
-
-            if ( MODULO_MODE == 9 ) {
-
-                // Euclidian division: q = sign(y) * floor(x / abs(y))
-                // r = x - qy    where  0 <= r < abs(y)
-                s = y.s;
-                y.s = 1;
-                q = div( x, y, 0, 3 );
-                y.s = s;
-                q.s *= s;
-            } else {
-                q = div( x, y, 0, MODULO_MODE );
-            }
-
-            return x.minus( q.times(y) );
-        };
-
-
-        /*
-         * Return a new BigNumber whose value is the value of this BigNumber negated,
-         * i.e. multiplied by -1.
-         */
-        P.negated = P.neg = function () {
-            var x = new BigNumber(this);
-            x.s = -x.s || null;
-            return x;
-        };
-
-
-        /*
-         *  n + 0 = n
-         *  n + N = N
-         *  n + I = I
-         *  0 + n = n
-         *  0 + 0 = 0
-         *  0 + N = N
-         *  0 + I = I
-         *  N + n = N
-         *  N + 0 = N
-         *  N + N = N
-         *  N + I = N
-         *  I + n = I
-         *  I + 0 = I
-         *  I + N = N
-         *  I + I = I
-         *
-         * Return a new BigNumber whose value is the value of this BigNumber plus the value of
-         * BigNumber(y, b).
-         */
-        P.plus = P.add = function ( y, b ) {
-            var t,
-                x = this,
-                a = x.s;
-
-            id = 12;
-            y = new BigNumber( y, b );
-            b = y.s;
-
-            // Either NaN?
-            if ( !a || !b ) return new BigNumber(NaN);
-
-            // Signs differ?
-             if ( a != b ) {
-                y.s = -b;
-                return x.minus(y);
-            }
-
-            var xe = x.e / LOG_BASE,
-                ye = y.e / LOG_BASE,
-                xc = x.c,
-                yc = y.c;
-
-            if ( !xe || !ye ) {
-
-                // Return ±Infinity if either ±Infinity.
-                if ( !xc || !yc ) return new BigNumber( a / 0 );
-
-                // Either zero?
-                // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.
-                if ( !xc[0] || !yc[0] ) return yc[0] ? y : new BigNumber( xc[0] ? x : a * 0 );
-            }
-
-            xe = bitFloor(xe);
-            ye = bitFloor(ye);
-            xc = xc.slice();
-
-            // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.
-            if ( a = xe - ye ) {
-                if ( a > 0 ) {
-                    ye = xe;
-                    t = yc;
-                } else {
-                    a = -a;
-                    t = xc;
-                }
-
-                t.reverse();
-                for ( ; a--; t.push(0) );
-                t.reverse();
-            }
-
-            a = xc.length;
-            b = yc.length;
-
-            // Point xc to the longer array, and b to the shorter length.
-            if ( a - b < 0 ) t = yc, yc = xc, xc = t, b = a;
-
-            // Only start adding at yc.length - 1 as the further digits of xc can be ignored.
-            for ( a = 0; b; ) {
-                a = ( xc[--b] = xc[b] + yc[b] + a ) / BASE | 0;
-                xc[b] %= BASE;
-            }
-
-            if (a) {
-                xc.unshift(a);
-                ++ye;
-            }
-
-            // No need to check for zero, as +x + +y != 0 && -x + -y != 0
-            // ye = MAX_EXP + 1 possible
-            return normalise( y, xc, ye );
-        };
-
-
-        /*
-         * Return the number of significant digits of the value of this BigNumber.
-         *
-         * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.
-         */
-        P.precision = P.sd = function (z) {
-            var n, v,
-                x = this,
-                c = x.c;
-
-            // 'precision() argument not a boolean or binary digit: {z}'
-            if ( z != null && z !== !!z && z !== 1 && z !== 0 ) {
-                if (ERRORS) raise( 13, 'argument' + notBool, z );
-                if ( z != !!z ) z = null;
-            }
-
-            if ( !c ) return null;
-            v = c.length - 1;
-            n = v * LOG_BASE + 1;
-
-            if ( v = c[v] ) {
-
-                // Subtract the number of trailing zeros of the last element.
-                for ( ; v % 10 == 0; v /= 10, n-- );
-
-                // Add the number of digits of the first element.
-                for ( v = c[0]; v >= 10; v /= 10, n++ );
-            }
-
-            if ( z && x.e + 1 > n ) n = x.e + 1;
-
-            return n;
-        };
-
-
-        /*
-         * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of
-         * dp decimal places using rounding mode rm, or to 0 and ROUNDING_MODE respectively if
-         * omitted.
-         *
-         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
-         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
-         *
-         * 'round() decimal places out of range: {dp}'
-         * 'round() decimal places not an integer: {dp}'
-         * 'round() rounding mode not an integer: {rm}'
-         * 'round() rounding mode out of range: {rm}'
-         */
-        P.round = function ( dp, rm ) {
-            var n = new BigNumber(this);
-
-            if ( dp == null || isValidInt( dp, 0, MAX, 15 ) ) {
-                round( n, ~~dp + this.e + 1, rm == null ||
-                  !isValidInt( rm, 0, 8, 15, roundingMode ) ? ROUNDING_MODE : rm | 0 );
-            }
-
-            return n;
-        };
-
-
-        /*
-         * Return a new BigNumber whose value is the value of this BigNumber shifted by k places
-         * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.
-         *
-         * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.
-         *
-         * If k is out of range and ERRORS is false, the result will be ±0 if k < 0, or ±Infinity
-         * otherwise.
-         *
-         * 'shift() argument not an integer: {k}'
-         * 'shift() argument out of range: {k}'
-         */
-        P.shift = function (k) {
-            var n = this;
-            return isValidInt( k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER, 16, 'argument' )
-
-              // k < 1e+21, or truncate(k) will produce exponential notation.
-              ? n.times( '1e' + truncate(k) )
-              : new BigNumber( n.c && n.c[0] && ( k < -MAX_SAFE_INTEGER || k > MAX_SAFE_INTEGER )
-                ? n.s * ( k < 0 ? 0 : 1 / 0 )
-                : n );
-        };
-
-
-        /*
-         *  sqrt(-n) =  N
-         *  sqrt( N) =  N
-         *  sqrt(-I) =  N
-         *  sqrt( I) =  I
-         *  sqrt( 0) =  0
-         *  sqrt(-0) = -0
-         *
-         * Return a new BigNumber whose value is the square root of the value of this BigNumber,
-         * rounded according to DECIMAL_PLACES and ROUNDING_MODE.
-         */
-        P.squareRoot = P.sqrt = function () {
-            var m, n, r, rep, t,
-                x = this,
-                c = x.c,
-                s = x.s,
-                e = x.e,
-                dp = DECIMAL_PLACES + 4,
-                half = new BigNumber('0.5');
-
-            // Negative/NaN/Infinity/zero?
-            if ( s !== 1 || !c || !c[0] ) {
-                return new BigNumber( !s || s < 0 && ( !c || c[0] ) ? NaN : c ? x : 1 / 0 );
-            }
-
-            // Initial estimate.
-            s = Math.sqrt( +x );
-
-            // Math.sqrt underflow/overflow?
-            // Pass x to Math.sqrt as integer, then adjust the exponent of the result.
-            if ( s == 0 || s == 1 / 0 ) {
-                n = coeffToString(c);
-                if ( ( n.length + e ) % 2 == 0 ) n += '0';
-                s = Math.sqrt(n);
-                e = bitFloor( ( e + 1 ) / 2 ) - ( e < 0 || e % 2 );
-
-                if ( s == 1 / 0 ) {
-                    n = '1e' + e;
-                } else {
-                    n = s.toExponential();
-                    n = n.slice( 0, n.indexOf('e') + 1 ) + e;
-                }
-
-                r = new BigNumber(n);
-            } else {
-                r = new BigNumber( s + '' );
-            }
-
-            // Check for zero.
-            // r could be zero if MIN_EXP is changed after the this value was created.
-            // This would cause a division by zero (x/t) and hence Infinity below, which would cause
-            // coeffToString to throw.
-            if ( r.c[0] ) {
-                e = r.e;
-                s = e + dp;
-                if ( s < 3 ) s = 0;
-
-                // Newton-Raphson iteration.
-                for ( ; ; ) {
-                    t = r;
-                    r = half.times( t.plus( div( x, t, dp, 1 ) ) );
-
-                    if ( coeffToString( t.c   ).slice( 0, s ) === ( n =
-                         coeffToString( r.c ) ).slice( 0, s ) ) {
-
-                        // The exponent of r may here be one less than the final result exponent,
-                        // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits
-                        // are indexed correctly.
-                        if ( r.e < e ) --s;
-                        n = n.slice( s - 3, s + 1 );
-
-                        // The 4th rounding digit may be in error by -1 so if the 4 rounding digits
-                        // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the
-                        // iteration.
-                        if ( n == '9999' || !rep && n == '4999' ) {
-
-                            // On the first iteration only, check to see if rounding up gives the
-                            // exact result as the nines may infinitely repeat.
-                            if ( !rep ) {
-                                round( t, t.e + DECIMAL_PLACES + 2, 0 );
-
-                                if ( t.times(t).eq(x) ) {
-                                    r = t;
-                                    break;
-                                }
-                            }
-
-                            dp += 4;
-                            s += 4;
-                            rep = 1;
-                        } else {
-
-                            // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact
-                            // result. If not, then there are further digits and m will be truthy.
-                            if ( !+n || !+n.slice(1) && n.charAt(0) == '5' ) {
-
-                                // Truncate to the first rounding digit.
-                                round( r, r.e + DECIMAL_PLACES + 2, 1 );
-                                m = !r.times(r).eq(x);
-                            }
-
-                            break;
-                        }
-                    }
-                }
-            }
-
-            return round( r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m );
-        };
-
-
-        /*
-         *  n * 0 = 0
-         *  n * N = N
-         *  n * I = I
-         *  0 * n = 0
-         *  0 * 0 = 0
-         *  0 * N = N
-         *  0 * I = N
-         *  N * n = N
-         *  N * 0 = N
-         *  N * N = N
-         *  N * I = N
-         *  I * n = I
-         *  I * 0 = N
-         *  I * N = N
-         *  I * I = I
-         *
-         * Return a new BigNumber whose value is the value of this BigNumber times the value of
-         * BigNumber(y, b).
-         */
-        P.times = P.mul = function ( y, b ) {
-            var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,
-                base, sqrtBase,
-                x = this,
-                xc = x.c,
-                yc = ( id = 17, y = new BigNumber( y, b ) ).c;
-
-            // Either NaN, ±Infinity or ±0?
-            if ( !xc || !yc || !xc[0] || !yc[0] ) {
-
-                // Return NaN if either is NaN, or one is 0 and the other is Infinity.
-                if ( !x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc ) {
-                    y.c = y.e = y.s = null;
-                } else {
-                    y.s *= x.s;
-
-                    // Return ±Infinity if either is ±Infinity.
-                    if ( !xc || !yc ) {
-                        y.c = y.e = null;
-
-                    // Return ±0 if either is ±0.
-                    } else {
-                        y.c = [0];
-                        y.e = 0;
-                    }
-                }
-
-                return y;
-            }
-
-            e = bitFloor( x.e / LOG_BASE ) + bitFloor( y.e / LOG_BASE );
-            y.s *= x.s;
-            xcL = xc.length;
-            ycL = yc.length;
-
-            // Ensure xc points to longer array and xcL to its length.
-            if ( xcL < ycL ) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;
-
-            // Initialise the result array with zeros.
-            for ( i = xcL + ycL, zc = []; i--; zc.push(0) );
-
-            base = BASE;
-            sqrtBase = SQRT_BASE;
-
-            for ( i = ycL; --i >= 0; ) {
-                c = 0;
-                ylo = yc[i] % sqrtBase;
-                yhi = yc[i] / sqrtBase | 0;
-
-                for ( k = xcL, j = i + k; j > i; ) {
-                    xlo = xc[--k] % sqrtBase;
-                    xhi = xc[k] / sqrtBase | 0;
-                    m = yhi * xlo + xhi * ylo;
-                    xlo = ylo * xlo + ( ( m % sqrtBase ) * sqrtBase ) + zc[j] + c;
-                    c = ( xlo / base | 0 ) + ( m / sqrtBase | 0 ) + yhi * xhi;
-                    zc[j--] = xlo % base;
-                }
-
-                zc[j] = c;
-            }
-
-            if (c) {
-                ++e;
-            } else {
-                zc.shift();
-            }
-
-            return normalise( y, zc, e );
-        };
-
-
-        /*
-         * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of
-         * sd significant digits using rounding mode rm, or ROUNDING_MODE if rm is omitted.
-         *
-         * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.
-         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
-         *
-         * 'toDigits() precision out of range: {sd}'
-         * 'toDigits() precision not an integer: {sd}'
-         * 'toDigits() rounding mode not an integer: {rm}'
-         * 'toDigits() rounding mode out of range: {rm}'
-         */
-        P.toDigits = function ( sd, rm ) {
-            var n = new BigNumber(this);
-            sd = sd == null || !isValidInt( sd, 1, MAX, 18, 'precision' ) ? null : sd | 0;
-            rm = rm == null || !isValidInt( rm, 0, 8, 18, roundingMode ) ? ROUNDING_MODE : rm | 0;
-            return sd ? round( n, sd, rm ) : n;
-        };
-
-
-        /*
-         * Return a string representing the value of this BigNumber in exponential notation and
-         * rounded using ROUNDING_MODE to dp fixed decimal places.
-         *
-         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
-         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
-         *
-         * 'toExponential() decimal places not an integer: {dp}'
-         * 'toExponential() decimal places out of range: {dp}'
-         * 'toExponential() rounding mode not an integer: {rm}'
-         * 'toExponential() rounding mode out of range: {rm}'
-         */
-        P.toExponential = function ( dp, rm ) {
-            return format( this,
-              dp != null && isValidInt( dp, 0, MAX, 19 ) ? ~~dp + 1 : null, rm, 19 );
-        };
-
-
-        /*
-         * Return a string representing the value of this BigNumber in fixed-point notation rounding
-         * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.
-         *
-         * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',
-         * but e.g. (-0.00001).toFixed(0) is '-0'.
-         *
-         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
-         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
-         *
-         * 'toFixed() decimal places not an integer: {dp}'
-         * 'toFixed() decimal places out of range: {dp}'
-         * 'toFixed() rounding mode not an integer: {rm}'
-         * 'toFixed() rounding mode out of range: {rm}'
-         */
-        P.toFixed = function ( dp, rm ) {
-            return format( this, dp != null && isValidInt( dp, 0, MAX, 20 )
-              ? ~~dp + this.e + 1 : null, rm, 20 );
-        };
-
-
-        /*
-         * Return a string representing the value of this BigNumber in fixed-point notation rounded
-         * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties
-         * of the FORMAT object (see BigNumber.config).
-         *
-         * FORMAT = {
-         *      decimalSeparator : '.',
-         *      groupSeparator : ',',
-         *      groupSize : 3,
-         *      secondaryGroupSize : 0,
-         *      fractionGroupSeparator : '\xA0',    // non-breaking space
-         *      fractionGroupSize : 0
-         * };
-         *
-         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
-         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
-         *
-         * 'toFormat() decimal places not an integer: {dp}'
-         * 'toFormat() decimal places out of range: {dp}'
-         * 'toFormat() rounding mode not an integer: {rm}'
-         * 'toFormat() rounding mode out of range: {rm}'
-         */
-        P.toFormat = function ( dp, rm ) {
-            var str = format( this, dp != null && isValidInt( dp, 0, MAX, 21 )
-              ? ~~dp + this.e + 1 : null, rm, 21 );
-
-            if ( this.c ) {
-                var i,
-                    arr = str.split('.'),
-                    g1 = +FORMAT.groupSize,
-                    g2 = +FORMAT.secondaryGroupSize,
-                    groupSeparator = FORMAT.groupSeparator,
-                    intPart = arr[0],
-                    fractionPart = arr[1],
-                    isNeg = this.s < 0,
-                    intDigits = isNeg ? intPart.slice(1) : intPart,
-                    len = intDigits.length;
-
-                if (g2) i = g1, g1 = g2, g2 = i, len -= i;
-
-                if ( g1 > 0 && len > 0 ) {
-                    i = len % g1 || g1;
-                    intPart = intDigits.substr( 0, i );
-
-                    for ( ; i < len; i += g1 ) {
-                        intPart += groupSeparator + intDigits.substr( i, g1 );
-                    }
-
-                    if ( g2 > 0 ) intPart += groupSeparator + intDigits.slice(i);
-                    if (isNeg) intPart = '-' + intPart;
-                }
-
-                str = fractionPart
-                  ? intPart + FORMAT.decimalSeparator + ( ( g2 = +FORMAT.fractionGroupSize )
-                    ? fractionPart.replace( new RegExp( '\\d{' + g2 + '}\\B', 'g' ),
-                      '$&' + FORMAT.fractionGroupSeparator )
-                    : fractionPart )
-                  : intPart;
-            }
-
-            return str;
-        };
-
-
-        /*
-         * Return a string array representing the value of this BigNumber as a simple fraction with
-         * an integer numerator and an integer denominator. The denominator will be a positive
-         * non-zero value less than or equal to the specified maximum denominator. If a maximum
-         * denominator is not specified, the denominator will be the lowest value necessary to
-         * represent the number exactly.
-         *
-         * [md] {number|string|BigNumber} Integer >= 1 and < Infinity. The maximum denominator.
-         *
-         * 'toFraction() max denominator not an integer: {md}'
-         * 'toFraction() max denominator out of range: {md}'
-         */
-        P.toFraction = function (md) {
-            var arr, d0, d2, e, exp, n, n0, q, s,
-                k = ERRORS,
-                x = this,
-                xc = x.c,
-                d = new BigNumber(ONE),
-                n1 = d0 = new BigNumber(ONE),
-                d1 = n0 = new BigNumber(ONE);
-
-            if ( md != null ) {
-                ERRORS = false;
-                n = new BigNumber(md);
-                ERRORS = k;
-
-                if ( !( k = n.isInt() ) || n.lt(ONE) ) {
-
-                    if (ERRORS) {
-                        raise( 22,
-                          'max denominator ' + ( k ? 'out of range' : 'not an integer' ), md );
-                    }
-
-                    // ERRORS is false:
-                    // If md is a finite non-integer >= 1, round it to an integer and use it.
-                    md = !k && n.c && round( n, n.e + 1, 1 ).gte(ONE) ? n : null;
-                }
-            }
-
-            if ( !xc ) return x.toString();
-            s = coeffToString(xc);
-
-            // Determine initial denominator.
-            // d is a power of 10 and the minimum max denominator that specifies the value exactly.
-            e = d.e = s.length - x.e - 1;
-            d.c[0] = POWS_TEN[ ( exp = e % LOG_BASE ) < 0 ? LOG_BASE + exp : exp ];
-            md = !md || n.cmp(d) > 0 ? ( e > 0 ? d : n1 ) : n;
-
-            exp = MAX_EXP;
-            MAX_EXP = 1 / 0;
-            n = new BigNumber(s);
-
-            // n0 = d1 = 0
-            n0.c[0] = 0;
-
-            for ( ; ; )  {
-                q = div( n, d, 0, 1 );
-                d2 = d0.plus( q.times(d1) );
-                if ( d2.cmp(md) == 1 ) break;
-                d0 = d1;
-                d1 = d2;
-                n1 = n0.plus( q.times( d2 = n1 ) );
-                n0 = d2;
-                d = n.minus( q.times( d2 = d ) );
-                n = d2;
-            }
-
-            d2 = div( md.minus(d0), d1, 0, 1 );
-            n0 = n0.plus( d2.times(n1) );
-            d0 = d0.plus( d2.times(d1) );
-            n0.s = n1.s = x.s;
-            e *= 2;
-
-            // Determine which fraction is closer to x, n0/d0 or n1/d1
-            arr = div( n1, d1, e, ROUNDING_MODE ).minus(x).abs().cmp(
-                  div( n0, d0, e, ROUNDING_MODE ).minus(x).abs() ) < 1
-                    ? [ n1.toString(), d1.toString() ]
-                    : [ n0.toString(), d0.toString() ];
-
-            MAX_EXP = exp;
-            return arr;
-        };
-
-
-        /*
-         * Return the value of this BigNumber converted to a number primitive.
-         */
-        P.toNumber = function () {
-            return +this;
-        };
-
-
-        /*
-         * Return a BigNumber whose value is the value of this BigNumber raised to the power n.
-         * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.
-         * If POW_PRECISION is not 0, round to POW_PRECISION using ROUNDING_MODE.
-         *
-         * n {number} Integer, -9007199254740992 to 9007199254740992 inclusive.
-         * (Performs 54 loop iterations for n of 9007199254740992.)
-         *
-         * 'pow() exponent not an integer: {n}'
-         * 'pow() exponent out of range: {n}'
-         */
-        P.toPower = P.pow = function (n) {
-            var k, y,
-                i = mathfloor( n < 0 ? -n : +n ),
-                x = this;
-
-            // Pass ±Infinity to Math.pow if exponent is out of range.
-            if ( !isValidInt( n, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER, 23, 'exponent' ) &&
-              ( !isFinite(n) || i > MAX_SAFE_INTEGER && ( n /= 0 ) ||
-                parseFloat(n) != n && !( n = NaN ) ) ) {
-                return new BigNumber( Math.pow( +x, n ) );
-            }
-
-            // Truncating each coefficient array to a length of k after each multiplication equates
-            // to truncating significant digits to POW_PRECISION + [28, 41], i.e. there will be a
-            // minimum of 28 guard digits retained. (Using + 1.5 would give [9, 21] guard digits.)
-            k = POW_PRECISION ? mathceil( POW_PRECISION / LOG_BASE + 2 ) : 0;
-            y = new BigNumber(ONE);
-
-            for ( ; ; ) {
-
-                if ( i % 2 ) {
-                    y = y.times(x);
-                    if ( !y.c ) break;
-                    if ( k && y.c.length > k ) y.c.length = k;
-                }
-
-                i = mathfloor( i / 2 );
-                if ( !i ) break;
-
-                x = x.times(x);
-                if ( k && x.c && x.c.length > k ) x.c.length = k;
-            }
-
-            if ( n < 0 ) y = ONE.div(y);
-            return k ? round( y, POW_PRECISION, ROUNDING_MODE ) : y;
-        };
-
-
-        /*
-         * Return a string representing the value of this BigNumber rounded to sd significant digits
-         * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits
-         * necessary to represent the integer part of the value in fixed-point notation, then use
-         * exponential notation.
-         *
-         * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.
-         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
-         *
-         * 'toPrecision() precision not an integer: {sd}'
-         * 'toPrecision() precision out of range: {sd}'
-         * 'toPrecision() rounding mode not an integer: {rm}'
-         * 'toPrecision() rounding mode out of range: {rm}'
-         */
-        P.toPrecision = function ( sd, rm ) {
-            return format( this, sd != null && isValidInt( sd, 1, MAX, 24, 'precision' )
-              ? sd | 0 : null, rm, 24 );
-        };
-
-
-        /*
-         * Return a string representing the value of this BigNumber in base b, or base 10 if b is
-         * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and
-         * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent
-         * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than
-         * TO_EXP_NEG, return exponential notation.
-         *
-         * [b] {number} Integer, 2 to 64 inclusive.
-         *
-         * 'toString() base not an integer: {b}'
-         * 'toString() base out of range: {b}'
-         */
-        P.toString = function (b) {
-            var str,
-                n = this,
-                s = n.s,
-                e = n.e;
-
-            // Infinity or NaN?
-            if ( e === null ) {
-
-                if (s) {
-                    str = 'Infinity';
-                    if ( s < 0 ) str = '-' + str;
-                } else {
-                    str = 'NaN';
-                }
-            } else {
-                str = coeffToString( n.c );
-
-                if ( b == null || !isValidInt( b, 2, 64, 25, 'base' ) ) {
-                    str = e <= TO_EXP_NEG || e >= TO_EXP_POS
-                      ? toExponential( str, e )
-                      : toFixedPoint( str, e );
-                } else {
-                    str = convertBase( toFixedPoint( str, e ), b | 0, 10, s );
-                }
-
-                if ( s < 0 && n.c[0] ) str = '-' + str;
-            }
-
-            return str;
-        };
-
-
-        /*
-         * Return a new BigNumber whose value is the value of this BigNumber truncated to a whole
-         * number.
-         */
-        P.truncated = P.trunc = function () {
-            return round( new BigNumber(this), this.e + 1, 1 );
-        };
-
-
-
-        /*
-         * Return as toString, but do not accept a base argument, and include the minus sign for
-         * negative zero.
-         */
-        P.valueOf = P.toJSON = function () {
-            var str,
-                n = this,
-                e = n.e;
-
-            if ( e === null ) return n.toString();
-
-            str = coeffToString( n.c );
-
-            str = e <= TO_EXP_NEG || e >= TO_EXP_POS
-                ? toExponential( str, e )
-                : toFixedPoint( str, e );
-
-            return n.s < 0 ? '-' + str : str;
-        };
-
-
-        // Aliases for BigDecimal methods.
-        //P.add = P.plus;         // P.add included above
-        //P.subtract = P.minus;   // P.sub included above
-        //P.multiply = P.times;   // P.mul included above
-        //P.divide = P.div;
-        //P.remainder = P.mod;
-        //P.compareTo = P.cmp;
-        //P.negate = P.neg;
-
-
-        if ( configObj != null ) BigNumber.config(configObj);
-
-        return BigNumber;
-    }
-
-
-    // PRIVATE HELPER FUNCTIONS
-
-
-    function bitFloor(n) {
-        var i = n | 0;
-        return n > 0 || n === i ? i : i - 1;
-    }
-
-
-    // Return a coefficient array as a string of base 10 digits.
-    function coeffToString(a) {
-        var s, z,
-            i = 1,
-            j = a.length,
-            r = a[0] + '';
-
-        for ( ; i < j; ) {
-            s = a[i++] + '';
-            z = LOG_BASE - s.length;
-            for ( ; z--; s = '0' + s );
-            r += s;
-        }
-
-        // Determine trailing zeros.
-        for ( j = r.length; r.charCodeAt(--j) === 48; );
-        return r.slice( 0, j + 1 || 1 );
-    }
-
-
-    // Compare the value of BigNumbers x and y.
-    function compare( x, y ) {
-        var a, b,
-            xc = x.c,
-            yc = y.c,
-            i = x.s,
-            j = y.s,
-            k = x.e,
-            l = y.e;
-
-        // Either NaN?
-        if ( !i || !j ) return null;
-
-        a = xc && !xc[0];
-        b = yc && !yc[0];
-
-        // Either zero?
-        if ( a || b ) return a ? b ? 0 : -j : i;
-
-        // Signs differ?
-        if ( i != j ) return i;
-
-        a = i < 0;
-        b = k == l;
-
-        // Either Infinity?
-        if ( !xc || !yc ) return b ? 0 : !xc ^ a ? 1 : -1;
-
-        // Compare exponents.
-        if ( !b ) return k > l ^ a ? 1 : -1;
-
-        j = ( k = xc.length ) < ( l = yc.length ) ? k : l;
-
-        // Compare digit by digit.
-        for ( i = 0; i < j; i++ ) if ( xc[i] != yc[i] ) return xc[i] > yc[i] ^ a ? 1 : -1;
-
-        // Compare lengths.
-        return k == l ? 0 : k > l ^ a ? 1 : -1;
-    }
-
-
-    /*
-     * Return true if n is a valid number in range, otherwise false.
-     * Use for argument validation when ERRORS is false.
-     * Note: parseInt('1e+1') == 1 but parseFloat('1e+1') == 10.
-     */
-    function intValidatorNoErrors( n, min, max ) {
-        return ( n = truncate(n) ) >= min && n <= max;
-    }
-
-
-    function isArray(obj) {
-        return Object.prototype.toString.call(obj) == '[object Array]';
-    }
-
-
-    /*
-     * Convert string of baseIn to an array of numbers of baseOut.
-     * Eg. convertBase('255', 10, 16) returns [15, 15].
-     * Eg. convertBase('ff', 16, 10) returns [2, 5, 5].
-     */
-    function toBaseOut( str, baseIn, baseOut ) {
-        var j,
-            arr = [0],
-            arrL,
-            i = 0,
-            len = str.length;
-
-        for ( ; i < len; ) {
-            for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );
-            arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );
-
-            for ( ; j < arr.length; j++ ) {
-
-                if ( arr[j] > baseOut - 1 ) {
-                    if ( arr[j + 1] == null ) arr[j + 1] = 0;
-                    arr[j + 1] += arr[j] / baseOut | 0;
-                    arr[j] %= baseOut;
-                }
-            }
-        }
-
-        return arr.reverse();
-    }
-
-
-    function toExponential( str, e ) {
-        return ( str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str ) +
-          ( e < 0 ? 'e' : 'e+' ) + e;
-    }
-
-
-    function toFixedPoint( str, e ) {
-        var len, z;
-
-        // Negative exponent?
-        if ( e < 0 ) {
-
-            // Prepend zeros.
-            for ( z = '0.'; ++e; z += '0' );
-            str = z + str;
-
-        // Positive exponent
-        } else {
-            len = str.length;
-
-            // Append zeros.
-            if ( ++e > len ) {
-                for ( z = '0', e -= len; --e; z += '0' );
-                str += z;
-            } else if ( e < len ) {
-                str = str.slice( 0, e ) + '.' + str.slice(e);
-            }
-        }
-
-        return str;
-    }
-
-
-    function truncate(n) {
-        n = parseFloat(n);
-        return n < 0 ? mathceil(n) : mathfloor(n);
-    }
-
-
-    // EXPORT
-
-
-   // AMD.
-    if ( typeof define == 'function' && define.amd ) {
-        define( function () { return constructorFactory(); } );
-
-    // Node.js and other environments that support module.exports.
-    } else if ( typeof module != 'undefined' && module.exports ) {
-        module.exports = constructorFactory();
-
-        // Split string stops browserify adding crypto shim.
-        if ( !cryptoObj ) try { cryptoObj = require('cry' + 'pto'); } catch (e) {}
-
-    // Browser.
-    } else {
-        if ( !globalObj ) globalObj = typeof self != 'undefined' ? self : Function('return this')();
-        globalObj.BigNumber = constructorFactory();
-    }
-})(this);
-
-},{}],5:[function(require,module,exports){
 module.exports=[
   {
     "constant": true,
@@ -3306,7 +601,7 @@ module.exports=[
   }
 ]
 
-},{}],6:[function(require,module,exports){
+},{}],5:[function(require,module,exports){
 module.exports=[
   {
     "constant": true,
@@ -3416,7 +711,7 @@ module.exports=[
   }
 ]
 
-},{}],7:[function(require,module,exports){
+},{}],6:[function(require,module,exports){
 module.exports=[
   {
     "constant": false,
@@ -3564,7 +859,7 @@ module.exports=[
   }
 ]
 
-},{}],8:[function(require,module,exports){
+},{}],7:[function(require,module,exports){
 var f = require('./formatters');
 var SolidityType = require('./type');
 
@@ -3597,7 +892,7 @@ SolidityTypeAddress.prototype.staticPartLength = function (name) {
 module.exports = SolidityTypeAddress;
 
 
-},{"./formatters":13,"./type":18}],9:[function(require,module,exports){
+},{"./formatters":12,"./type":17}],8:[function(require,module,exports){
 var f = require('./formatters');
 var SolidityType = require('./type');
 
@@ -3629,7 +924,7 @@ SolidityTypeBool.prototype.staticPartLength = function (name) {
 
 module.exports = SolidityTypeBool;
 
-},{"./formatters":13,"./type":18}],10:[function(require,module,exports){
+},{"./formatters":12,"./type":17}],9:[function(require,module,exports){
 var f = require('./formatters');
 var SolidityType = require('./type');
 
@@ -3669,7 +964,7 @@ SolidityTypeBytes.prototype.staticPartLength = function (name) {
 
 module.exports = SolidityTypeBytes;
 
-},{"./formatters":13,"./type":18}],11:[function(require,module,exports){
+},{"./formatters":12,"./type":17}],10:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -3931,7 +1226,7 @@ var coder = new SolidityCoder([
 module.exports = coder;
 
 
-},{"./address":8,"./bool":9,"./bytes":10,"./dynamicbytes":12,"./formatters":13,"./int":14,"./real":16,"./string":17,"./uint":19,"./ureal":20}],12:[function(require,module,exports){
+},{"./address":7,"./bool":8,"./bytes":9,"./dynamicbytes":11,"./formatters":12,"./int":13,"./real":15,"./string":16,"./uint":18,"./ureal":19}],11:[function(require,module,exports){
 var f = require('./formatters');
 var SolidityType = require('./type');
 
@@ -3958,7 +1253,7 @@ SolidityTypeDynamicBytes.prototype.isDynamicType = function () {
 module.exports = SolidityTypeDynamicBytes;
 
 
-},{"./formatters":13,"./type":18}],13:[function(require,module,exports){
+},{"./formatters":12,"./type":17}],12:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -4210,7 +1505,7 @@ module.exports = {
 };
 
 
-},{"../utils/config":22,"../utils/utils":24,"./param":15,"bignumber.js":52}],14:[function(require,module,exports){
+},{"../utils/config":21,"../utils/utils":23,"./param":14,"bignumber.js":51}],13:[function(require,module,exports){
 var f = require('./formatters');
 var SolidityType = require('./type');
 
@@ -4248,7 +1543,7 @@ SolidityTypeInt.prototype.staticPartLength = function (name) {
 
 module.exports = SolidityTypeInt;
 
-},{"./formatters":13,"./type":18}],15:[function(require,module,exports){
+},{"./formatters":12,"./type":17}],14:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -4402,7 +1697,7 @@ SolidityParam.encodeList = function (params) {
 module.exports = SolidityParam;
 
 
-},{"../utils/utils":24}],16:[function(require,module,exports){
+},{"../utils/utils":23}],15:[function(require,module,exports){
 var f = require('./formatters');
 var SolidityType = require('./type');
 
@@ -4440,7 +1735,7 @@ SolidityTypeReal.prototype.staticPartLength = function (name) {
 
 module.exports = SolidityTypeReal;
 
-},{"./formatters":13,"./type":18}],17:[function(require,module,exports){
+},{"./formatters":12,"./type":17}],16:[function(require,module,exports){
 var f = require('./formatters');
 var SolidityType = require('./type');
 
@@ -4467,7 +1762,7 @@ SolidityTypeString.prototype.isDynamicType = function () {
 module.exports = SolidityTypeString;
 
 
-},{"./formatters":13,"./type":18}],18:[function(require,module,exports){
+},{"./formatters":12,"./type":17}],17:[function(require,module,exports){
 var f = require('./formatters');
 var SolidityParam = require('./param');
 
@@ -4714,7 +2009,7 @@ SolidityType.prototype.decode = function (bytes, offset, name) {
 
 module.exports = SolidityType;
 
-},{"./formatters":13,"./param":15}],19:[function(require,module,exports){
+},{"./formatters":12,"./param":14}],18:[function(require,module,exports){
 var f = require('./formatters');
 var SolidityType = require('./type');
 
@@ -4752,7 +2047,7 @@ SolidityTypeUInt.prototype.staticPartLength = function (name) {
 
 module.exports = SolidityTypeUInt;
 
-},{"./formatters":13,"./type":18}],20:[function(require,module,exports){
+},{"./formatters":12,"./type":17}],19:[function(require,module,exports){
 var f = require('./formatters');
 var SolidityType = require('./type');
 
@@ -4790,7 +2085,7 @@ SolidityTypeUReal.prototype.staticPartLength = function (name) {
 
 module.exports = SolidityTypeUReal;
 
-},{"./formatters":13,"./type":18}],21:[function(require,module,exports){
+},{"./formatters":12,"./type":17}],20:[function(require,module,exports){
 'use strict';
 
 // go env doesn't have and need XMLHttpRequest
@@ -4801,7 +2096,7 @@ if (typeof XMLHttpRequest === 'undefined') {
 }
 
 
-},{}],22:[function(require,module,exports){
+},{}],21:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -4882,7 +2177,7 @@ module.exports = {
 };
 
 
-},{"bignumber.js":52}],23:[function(require,module,exports){
+},{"bignumber.js":51}],22:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -4922,7 +2217,7 @@ module.exports = function (value, options) {
 };
 
 
-},{"crypto-js":61,"crypto-js/sha3":82}],24:[function(require,module,exports){
+},{"crypto-js":60,"crypto-js/sha3":81}],23:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -5455,12 +2750,12 @@ module.exports = {
     isJson: isJson
 };
 
-},{"bignumber.js":52,"utf8":87}],25:[function(require,module,exports){
+},{"bignumber.js":51,"utf8":86}],24:[function(require,module,exports){
 module.exports={
     "version": "0.15.1"
 }
 
-},{}],26:[function(require,module,exports){
+},{}],25:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -5600,7 +2895,7 @@ Web3.prototype.createBatch = function () {
 module.exports = Web3;
 
 
-},{"./utils/sha3":23,"./utils/utils":24,"./version.json":25,"./web3/batch":28,"./web3/extend":32,"./web3/httpprovider":36,"./web3/iban":37,"./web3/ipcprovider":38,"./web3/methods/db":41,"./web3/methods/eth":42,"./web3/methods/net":43,"./web3/methods/shh":44,"./web3/property":47,"./web3/requestmanager":48,"./web3/settings":49}],27:[function(require,module,exports){
+},{"./utils/sha3":22,"./utils/utils":23,"./version.json":24,"./web3/batch":27,"./web3/extend":31,"./web3/httpprovider":35,"./web3/iban":36,"./web3/ipcprovider":37,"./web3/methods/db":40,"./web3/methods/eth":41,"./web3/methods/net":42,"./web3/methods/shh":43,"./web3/property":46,"./web3/requestmanager":47,"./web3/settings":48}],26:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -5690,7 +2985,7 @@ AllSolidityEvents.prototype.attachToContract = function (contract) {
 module.exports = AllSolidityEvents;
 
 
-},{"../utils/sha3":23,"../utils/utils":24,"./event":31,"./filter":33,"./formatters":34,"./methods/watches":45}],28:[function(require,module,exports){
+},{"../utils/sha3":22,"../utils/utils":23,"./event":30,"./filter":32,"./formatters":33,"./methods/watches":44}],27:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -5758,7 +3053,7 @@ Batch.prototype.execute = function () {
 module.exports = Batch;
 
 
-},{"./errors":30,"./jsonrpc":39}],29:[function(require,module,exports){
+},{"./errors":29,"./jsonrpc":38}],28:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -6057,7 +3352,7 @@ var Contract = function (eth, abi, address) {
 module.exports = ContractFactory;
 
 
-},{"../solidity/coder":11,"../utils/utils":24,"./allevents":27,"./event":31,"./function":35}],30:[function(require,module,exports){
+},{"../solidity/coder":10,"../utils/utils":23,"./allevents":26,"./event":30,"./function":34}],29:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -6097,7 +3392,7 @@ module.exports = {
 };
 
 
-},{}],31:[function(require,module,exports){
+},{}],30:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -6307,7 +3602,7 @@ SolidityEvent.prototype.attachToContract = function (contract) {
 module.exports = SolidityEvent;
 
 
-},{"../solidity/coder":11,"../utils/sha3":23,"../utils/utils":24,"./filter":33,"./formatters":34,"./methods/watches":45}],32:[function(require,module,exports){
+},{"../solidity/coder":10,"../utils/sha3":22,"../utils/utils":23,"./filter":32,"./formatters":33,"./methods/watches":44}],31:[function(require,module,exports){
 var formatters = require('./formatters');
 var utils = require('./../utils/utils');
 var Method = require('./method');
@@ -6357,7 +3652,7 @@ var extend = function (web3) {
 module.exports = extend;
 
 
-},{"./../utils/utils":24,"./formatters":34,"./method":40,"./property":47}],33:[function(require,module,exports){
+},{"./../utils/utils":23,"./formatters":33,"./method":39,"./property":46}],32:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -6589,7 +3884,7 @@ Filter.prototype.get = function (callback) {
 module.exports = Filter;
 
 
-},{"../utils/utils":24,"./formatters":34}],34:[function(require,module,exports){
+},{"../utils/utils":23,"./formatters":33}],33:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -6889,7 +4184,7 @@ module.exports = {
 };
 
 
-},{"../utils/config":22,"../utils/utils":24,"./iban":37}],35:[function(require,module,exports){
+},{"../utils/config":21,"../utils/utils":23,"./iban":36}],34:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -7138,7 +4433,7 @@ SolidityFunction.prototype.attachToContract = function (contract) {
 module.exports = SolidityFunction;
 
 
-},{"../solidity/coder":11,"../utils/sha3":23,"../utils/utils":24,"./formatters":34}],36:[function(require,module,exports){
+},{"../solidity/coder":10,"../utils/sha3":22,"../utils/utils":23,"./formatters":33}],35:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -7286,7 +4581,7 @@ HttpProvider.prototype.isConnected = function() {
 module.exports = HttpProvider;
 
 
-},{"./errors":30,"xmlhttprequest":21}],37:[function(require,module,exports){
+},{"./errors":29,"xmlhttprequest":20}],36:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -7515,7 +4810,7 @@ Iban.prototype.toString = function () {
 module.exports = Iban;
 
 
-},{"bignumber.js":52}],38:[function(require,module,exports){
+},{"bignumber.js":51}],37:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -7724,7 +5019,7 @@ IpcProvider.prototype.sendAsync = function (payload, callback) {
 module.exports = IpcProvider;
 
 
-},{"../utils/utils":24,"./errors":30}],39:[function(require,module,exports){
+},{"../utils/utils":23,"./errors":29}],38:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -7817,7 +5112,7 @@ Jsonrpc.prototype.toBatchPayload = function (messages) {
 module.exports = Jsonrpc;
 
 
-},{}],40:[function(require,module,exports){
+},{}],39:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -7984,7 +5279,7 @@ Method.prototype.request = function () {
 module.exports = Method;
 
 
-},{"../utils/utils":24,"./errors":30}],41:[function(require,module,exports){
+},{"../utils/utils":23,"./errors":29}],40:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -8052,7 +5347,7 @@ var methods = function () {
 
 module.exports = DB;
 
-},{"../method":40}],42:[function(require,module,exports){
+},{"../method":39}],41:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -8389,7 +5684,7 @@ Eth.prototype.isSyncing = function (callback) {
 module.exports = Eth;
 
 
-},{"../../utils/config":22,"../../utils/utils":24,"../contract":29,"../filter":33,"../formatters":34,"../iban":37,"../method":40,"../namereg":46,"../property":47,"../syncing":50,"../transfer":51,"./watches":45}],43:[function(require,module,exports){
+},{"../../utils/config":21,"../../utils/utils":23,"../contract":28,"../filter":32,"../formatters":33,"../iban":36,"../method":39,"../namereg":45,"../property":46,"../syncing":49,"../transfer":50,"./watches":44}],42:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -8443,7 +5738,7 @@ var properties = function () {
 
 module.exports = Net;
 
-},{"../../utils/utils":24,"../property":47}],44:[function(require,module,exports){
+},{"../../utils/utils":23,"../property":46}],43:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -8531,7 +5826,7 @@ var methods = function () {
 module.exports = Shh;
 
 
-},{"../filter":33,"../formatters":34,"../method":40,"./watches":45}],45:[function(require,module,exports){
+},{"../filter":32,"../formatters":33,"../method":39,"./watches":44}],44:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -8647,7 +5942,7 @@ module.exports = {
 };
 
 
-},{"../method":40}],46:[function(require,module,exports){
+},{"../method":39}],45:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -8688,7 +5983,7 @@ module.exports = {
 };
 
 
-},{"../contracts/GlobalRegistrar.json":5,"../contracts/ICAPRegistrar.json":6}],47:[function(require,module,exports){
+},{"../contracts/GlobalRegistrar.json":4,"../contracts/ICAPRegistrar.json":5}],46:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -8833,7 +6128,7 @@ Property.prototype.request = function () {
 module.exports = Property;
 
 
-},{"../utils/utils":24}],48:[function(require,module,exports){
+},{"../utils/utils":23}],47:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -9100,7 +6395,7 @@ RequestManager.prototype.poll = function () {
 module.exports = RequestManager;
 
 
-},{"../utils/config":22,"../utils/utils":24,"./errors":30,"./jsonrpc":39}],49:[function(require,module,exports){
+},{"../utils/config":21,"../utils/utils":23,"./errors":29,"./jsonrpc":38}],48:[function(require,module,exports){
 
 
 var Settings = function () {
@@ -9111,7 +6406,7 @@ var Settings = function () {
 module.exports = Settings;
 
 
-},{}],50:[function(require,module,exports){
+},{}],49:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -9206,7 +6501,7 @@ IsSyncing.prototype.stopWatching = function () {
 module.exports = IsSyncing;
 
 
-},{"../utils/utils":24,"./formatters":34}],51:[function(require,module,exports){
+},{"../utils/utils":23,"./formatters":33}],50:[function(require,module,exports){
 /*
     This file is part of web3.js.
 
@@ -9300,7 +6595,7 @@ var deposit = function (eth, from, to, value, client, callback) {
 module.exports = transfer;
 
 
-},{"../contracts/SmartExchange.json":7,"./iban":37}],52:[function(require,module,exports){
+},{"../contracts/SmartExchange.json":6,"./iban":36}],51:[function(require,module,exports){
 /*! bignumber.js v2.0.7 https://github.com/MikeMcl/bignumber.js/LICENCE */
 
 ;(function (global) {
@@ -11985,7 +9280,7 @@ module.exports = transfer;
     }
 })(this);
 
-},{"crypto":93}],53:[function(require,module,exports){
+},{"crypto":92}],52:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -12213,7 +9508,7 @@ module.exports = transfer;
 	return CryptoJS.AES;
 
 }));
-},{"./cipher-core":54,"./core":55,"./enc-base64":56,"./evpkdf":58,"./md5":63}],54:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54,"./enc-base64":55,"./evpkdf":57,"./md5":62}],53:[function(require,module,exports){
 ;(function (root, factory) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -13089,7 +10384,7 @@ module.exports = transfer;
 
 
 }));
-},{"./core":55}],55:[function(require,module,exports){
+},{"./core":54}],54:[function(require,module,exports){
 ;(function (root, factory) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -13832,7 +11127,7 @@ module.exports = transfer;
 	return CryptoJS;
 
 }));
-},{}],56:[function(require,module,exports){
+},{}],55:[function(require,module,exports){
 ;(function (root, factory) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -13957,7 +11252,7 @@ module.exports = transfer;
 	return CryptoJS.enc.Base64;
 
 }));
-},{"./core":55}],57:[function(require,module,exports){
+},{"./core":54}],56:[function(require,module,exports){
 ;(function (root, factory) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -14107,7 +11402,7 @@ module.exports = transfer;
 	return CryptoJS.enc.Utf16;
 
 }));
-},{"./core":55}],58:[function(require,module,exports){
+},{"./core":54}],57:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -14240,7 +11535,7 @@ module.exports = transfer;
 	return CryptoJS.EvpKDF;
 
 }));
-},{"./core":55,"./hmac":60,"./sha1":79}],59:[function(require,module,exports){
+},{"./core":54,"./hmac":59,"./sha1":78}],58:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -14307,7 +11602,7 @@ module.exports = transfer;
 	return CryptoJS.format.Hex;
 
 }));
-},{"./cipher-core":54,"./core":55}],60:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54}],59:[function(require,module,exports){
 ;(function (root, factory) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -14451,7 +11746,7 @@ module.exports = transfer;
 
 
 }));
-},{"./core":55}],61:[function(require,module,exports){
+},{"./core":54}],60:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -14470,7 +11765,7 @@ module.exports = transfer;
 	return CryptoJS;
 
 }));
-},{"./aes":53,"./cipher-core":54,"./core":55,"./enc-base64":56,"./enc-utf16":57,"./evpkdf":58,"./format-hex":59,"./hmac":60,"./lib-typedarrays":62,"./md5":63,"./mode-cfb":64,"./mode-ctr":66,"./mode-ctr-gladman":65,"./mode-ecb":67,"./mode-ofb":68,"./pad-ansix923":69,"./pad-iso10126":70,"./pad-iso97971":71,"./pad-nopadding":72,"./pad-zeropadding":73,"./pbkdf2":74,"./rabbit":76,"./rabbit-legacy":75,"./rc4":77,"./ripemd160":78,"./sha1":79,"./sha224":80,"./sha256":81,"./sha3":82,"./sha384":83,"./sha512":84,"./tripledes":85,"./x64-core":86}],62:[function(require,module,exports){
+},{"./aes":52,"./cipher-core":53,"./core":54,"./enc-base64":55,"./enc-utf16":56,"./evpkdf":57,"./format-hex":58,"./hmac":59,"./lib-typedarrays":61,"./md5":62,"./mode-cfb":63,"./mode-ctr":65,"./mode-ctr-gladman":64,"./mode-ecb":66,"./mode-ofb":67,"./pad-ansix923":68,"./pad-iso10126":69,"./pad-iso97971":70,"./pad-nopadding":71,"./pad-zeropadding":72,"./pbkdf2":73,"./rabbit":75,"./rabbit-legacy":74,"./rc4":76,"./ripemd160":77,"./sha1":78,"./sha224":79,"./sha256":80,"./sha3":81,"./sha384":82,"./sha512":83,"./tripledes":84,"./x64-core":85}],61:[function(require,module,exports){
 ;(function (root, factory) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -14547,7 +11842,7 @@ module.exports = transfer;
 	return CryptoJS.lib.WordArray;
 
 }));
-},{"./core":55}],63:[function(require,module,exports){
+},{"./core":54}],62:[function(require,module,exports){
 ;(function (root, factory) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -14816,7 +12111,7 @@ module.exports = transfer;
 	return CryptoJS.MD5;
 
 }));
-},{"./core":55}],64:[function(require,module,exports){
+},{"./core":54}],63:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -14895,7 +12190,7 @@ module.exports = transfer;
 	return CryptoJS.mode.CFB;
 
 }));
-},{"./cipher-core":54,"./core":55}],65:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54}],64:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15012,7 +12307,7 @@ module.exports = transfer;
 	return CryptoJS.mode.CTRGladman;
 
 }));
-},{"./cipher-core":54,"./core":55}],66:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54}],65:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15071,7 +12366,7 @@ module.exports = transfer;
 	return CryptoJS.mode.CTR;
 
 }));
-},{"./cipher-core":54,"./core":55}],67:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54}],66:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15112,7 +12407,7 @@ module.exports = transfer;
 	return CryptoJS.mode.ECB;
 
 }));
-},{"./cipher-core":54,"./core":55}],68:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54}],67:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15167,7 +12462,7 @@ module.exports = transfer;
 	return CryptoJS.mode.OFB;
 
 }));
-},{"./cipher-core":54,"./core":55}],69:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54}],68:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15217,7 +12512,7 @@ module.exports = transfer;
 	return CryptoJS.pad.Ansix923;
 
 }));
-},{"./cipher-core":54,"./core":55}],70:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54}],69:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15262,7 +12557,7 @@ module.exports = transfer;
 	return CryptoJS.pad.Iso10126;
 
 }));
-},{"./cipher-core":54,"./core":55}],71:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54}],70:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15303,7 +12598,7 @@ module.exports = transfer;
 	return CryptoJS.pad.Iso97971;
 
 }));
-},{"./cipher-core":54,"./core":55}],72:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54}],71:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15334,7 +12629,7 @@ module.exports = transfer;
 	return CryptoJS.pad.NoPadding;
 
 }));
-},{"./cipher-core":54,"./core":55}],73:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54}],72:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15380,7 +12675,7 @@ module.exports = transfer;
 	return CryptoJS.pad.ZeroPadding;
 
 }));
-},{"./cipher-core":54,"./core":55}],74:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54}],73:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15526,7 +12821,7 @@ module.exports = transfer;
 	return CryptoJS.PBKDF2;
 
 }));
-},{"./core":55,"./hmac":60,"./sha1":79}],75:[function(require,module,exports){
+},{"./core":54,"./hmac":59,"./sha1":78}],74:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15717,7 +13012,7 @@ module.exports = transfer;
 	return CryptoJS.RabbitLegacy;
 
 }));
-},{"./cipher-core":54,"./core":55,"./enc-base64":56,"./evpkdf":58,"./md5":63}],76:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54,"./enc-base64":55,"./evpkdf":57,"./md5":62}],75:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -15910,7 +13205,7 @@ module.exports = transfer;
 	return CryptoJS.Rabbit;
 
 }));
-},{"./cipher-core":54,"./core":55,"./enc-base64":56,"./evpkdf":58,"./md5":63}],77:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54,"./enc-base64":55,"./evpkdf":57,"./md5":62}],76:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -16050,7 +13345,7 @@ module.exports = transfer;
 	return CryptoJS.RC4;
 
 }));
-},{"./cipher-core":54,"./core":55,"./enc-base64":56,"./evpkdf":58,"./md5":63}],78:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54,"./enc-base64":55,"./evpkdf":57,"./md5":62}],77:[function(require,module,exports){
 ;(function (root, factory) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -16318,7 +13613,7 @@ module.exports = transfer;
 	return CryptoJS.RIPEMD160;
 
 }));
-},{"./core":55}],79:[function(require,module,exports){
+},{"./core":54}],78:[function(require,module,exports){
 ;(function (root, factory) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -16469,7 +13764,7 @@ module.exports = transfer;
 	return CryptoJS.SHA1;
 
 }));
-},{"./core":55}],80:[function(require,module,exports){
+},{"./core":54}],79:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -16550,7 +13845,7 @@ module.exports = transfer;
 	return CryptoJS.SHA224;
 
 }));
-},{"./core":55,"./sha256":81}],81:[function(require,module,exports){
+},{"./core":54,"./sha256":80}],80:[function(require,module,exports){
 ;(function (root, factory) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -16750,7 +14045,7 @@ module.exports = transfer;
 	return CryptoJS.SHA256;
 
 }));
-},{"./core":55}],82:[function(require,module,exports){
+},{"./core":54}],81:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -17074,7 +14369,7 @@ module.exports = transfer;
 	return CryptoJS.SHA3;
 
 }));
-},{"./core":55,"./x64-core":86}],83:[function(require,module,exports){
+},{"./core":54,"./x64-core":85}],82:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -17158,7 +14453,7 @@ module.exports = transfer;
 	return CryptoJS.SHA384;
 
 }));
-},{"./core":55,"./sha512":84,"./x64-core":86}],84:[function(require,module,exports){
+},{"./core":54,"./sha512":83,"./x64-core":85}],83:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -17482,7 +14777,7 @@ module.exports = transfer;
 	return CryptoJS.SHA512;
 
 }));
-},{"./core":55,"./x64-core":86}],85:[function(require,module,exports){
+},{"./core":54,"./x64-core":85}],84:[function(require,module,exports){
 ;(function (root, factory, undef) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -18253,7 +15548,7 @@ module.exports = transfer;
 	return CryptoJS.TripleDES;
 
 }));
-},{"./cipher-core":54,"./core":55,"./enc-base64":56,"./evpkdf":58,"./md5":63}],86:[function(require,module,exports){
+},{"./cipher-core":53,"./core":54,"./enc-base64":55,"./evpkdf":57,"./md5":62}],85:[function(require,module,exports){
 ;(function (root, factory) {
 	if (typeof exports === "object") {
 		// CommonJS
@@ -18558,11 +15853,11 @@ module.exports = transfer;
 	return CryptoJS;
 
 }));
-},{"./core":55}],87:[function(require,module,exports){
+},{"./core":54}],86:[function(require,module,exports){
 arguments[4][3][0].apply(exports,arguments)
-},{"dup":3}],88:[function(require,module,exports){
+},{"dup":3}],87:[function(require,module,exports){
 
-},{}],89:[function(require,module,exports){
+},{}],88:[function(require,module,exports){
 (function (global){
 /*!
  * The buffer module from node.js, for the browser.
@@ -20018,7 +17313,7 @@ function blitBuffer (src, dst, offset, length) {
 }
 
 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"base64-js":90,"ieee754":91,"isarray":92}],90:[function(require,module,exports){
+},{"base64-js":89,"ieee754":90,"isarray":91}],89:[function(require,module,exports){
 ;(function (exports) {
   'use strict'
 
@@ -20138,7 +17433,7 @@ function blitBuffer (src, dst, offset, length) {
   exports.fromByteArray = uint8ToBase64
 }(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
 
-},{}],91:[function(require,module,exports){
+},{}],90:[function(require,module,exports){
 exports.read = function (buffer, offset, isLE, mLen, nBytes) {
   var e, m
   var eLen = nBytes * 8 - mLen - 1
@@ -20224,14 +17519,14 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
   buffer[offset + i - d] |= s * 128
 }
 
-},{}],92:[function(require,module,exports){
+},{}],91:[function(require,module,exports){
 var toString = {}.toString;
 
 module.exports = Array.isArray || function (arr) {
   return toString.call(arr) == '[object Array]';
 };
 
-},{}],93:[function(require,module,exports){
+},{}],92:[function(require,module,exports){
 'use strict'
 
 exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes')
@@ -20310,7 +17605,7 @@ var publicEncrypt = require('public-encrypt')
   }
 })
 
-},{"browserify-cipher":94,"browserify-sign":124,"browserify-sign/algos":123,"create-ecdh":191,"create-hash":217,"create-hmac":230,"diffie-hellman":231,"pbkdf2":238,"public-encrypt":239,"randombytes":284}],94:[function(require,module,exports){
+},{"browserify-cipher":93,"browserify-sign":123,"browserify-sign/algos":122,"create-ecdh":190,"create-hash":216,"create-hmac":229,"diffie-hellman":230,"pbkdf2":237,"public-encrypt":238,"randombytes":283}],93:[function(require,module,exports){
 var ebtk = require('evp_bytestokey')
 var aes = require('browserify-aes/browser')
 var DES = require('browserify-des')
@@ -20385,7 +17680,7 @@ function getCiphers () {
 }
 exports.listCiphers = exports.getCiphers = getCiphers
 
-},{"browserify-aes/browser":97,"browserify-aes/modes":101,"browserify-des":112,"browserify-des/modes":113,"evp_bytestokey":122}],95:[function(require,module,exports){
+},{"browserify-aes/browser":96,"browserify-aes/modes":100,"browserify-des":111,"browserify-des/modes":112,"evp_bytestokey":121}],94:[function(require,module,exports){
 (function (Buffer){
 // based on the aes implimentation in triple sec
 // https://github.com/keybase/triplesec
@@ -20566,7 +17861,7 @@ AES.prototype._doCryptBlock = function (M, keySchedule, SUB_MIX, SBOX) {
 exports.AES = AES
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89}],96:[function(require,module,exports){
+},{"buffer":88}],95:[function(require,module,exports){
 (function (Buffer){
 var aes = require('./aes')
 var Transform = require('cipher-base')
@@ -20667,7 +17962,7 @@ function xorTest (a, b) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"./aes":95,"./ghash":100,"buffer":89,"buffer-xor":109,"cipher-base":110,"inherits":286}],97:[function(require,module,exports){
+},{"./aes":94,"./ghash":99,"buffer":88,"buffer-xor":108,"cipher-base":109,"inherits":285}],96:[function(require,module,exports){
 var ciphers = require('./encrypter')
 exports.createCipher = exports.Cipher = ciphers.createCipher
 exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv
@@ -20680,7 +17975,7 @@ function getCiphers () {
 }
 exports.listCiphers = exports.getCiphers = getCiphers
 
-},{"./decrypter":98,"./encrypter":99,"./modes":101}],98:[function(require,module,exports){
+},{"./decrypter":97,"./encrypter":98,"./modes":100}],97:[function(require,module,exports){
 (function (Buffer){
 var aes = require('./aes')
 var Transform = require('cipher-base')
@@ -20820,7 +18115,7 @@ exports.createDecipher = createDecipher
 exports.createDecipheriv = createDecipheriv
 
 }).call(this,require("buffer").Buffer)
-},{"./aes":95,"./authCipher":96,"./modes":101,"./modes/cbc":102,"./modes/cfb":103,"./modes/cfb1":104,"./modes/cfb8":105,"./modes/ctr":106,"./modes/ecb":107,"./modes/ofb":108,"./streamCipher":111,"buffer":89,"cipher-base":110,"evp_bytestokey":122,"inherits":286}],99:[function(require,module,exports){
+},{"./aes":94,"./authCipher":95,"./modes":100,"./modes/cbc":101,"./modes/cfb":102,"./modes/cfb1":103,"./modes/cfb8":104,"./modes/ctr":105,"./modes/ecb":106,"./modes/ofb":107,"./streamCipher":110,"buffer":88,"cipher-base":109,"evp_bytestokey":121,"inherits":285}],98:[function(require,module,exports){
 (function (Buffer){
 var aes = require('./aes')
 var Transform = require('cipher-base')
@@ -20945,7 +18240,7 @@ exports.createCipheriv = createCipheriv
 exports.createCipher = createCipher
 
 }).call(this,require("buffer").Buffer)
-},{"./aes":95,"./authCipher":96,"./modes":101,"./modes/cbc":102,"./modes/cfb":103,"./modes/cfb1":104,"./modes/cfb8":105,"./modes/ctr":106,"./modes/ecb":107,"./modes/ofb":108,"./streamCipher":111,"buffer":89,"cipher-base":110,"evp_bytestokey":122,"inherits":286}],100:[function(require,module,exports){
+},{"./aes":94,"./authCipher":95,"./modes":100,"./modes/cbc":101,"./modes/cfb":102,"./modes/cfb1":103,"./modes/cfb8":104,"./modes/ctr":105,"./modes/ecb":106,"./modes/ofb":107,"./streamCipher":110,"buffer":88,"cipher-base":109,"evp_bytestokey":121,"inherits":285}],99:[function(require,module,exports){
 (function (Buffer){
 var zeros = new Buffer(16)
 zeros.fill(0)
@@ -21047,7 +18342,7 @@ function xor (a, b) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89}],101:[function(require,module,exports){
+},{"buffer":88}],100:[function(require,module,exports){
 exports['aes-128-ecb'] = {
   cipher: 'AES',
   key: 128,
@@ -21220,7 +18515,7 @@ exports['aes-256-gcm'] = {
   type: 'auth'
 }
 
-},{}],102:[function(require,module,exports){
+},{}],101:[function(require,module,exports){
 var xor = require('buffer-xor')
 
 exports.encrypt = function (self, block) {
@@ -21239,7 +18534,7 @@ exports.decrypt = function (self, block) {
   return xor(out, pad)
 }
 
-},{"buffer-xor":109}],103:[function(require,module,exports){
+},{"buffer-xor":108}],102:[function(require,module,exports){
 (function (Buffer){
 var xor = require('buffer-xor')
 
@@ -21274,7 +18569,7 @@ function encryptStart (self, data, decrypt) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89,"buffer-xor":109}],104:[function(require,module,exports){
+},{"buffer":88,"buffer-xor":108}],103:[function(require,module,exports){
 (function (Buffer){
 function encryptByte (self, byteParam, decrypt) {
   var pad
@@ -21312,7 +18607,7 @@ function shiftIn (buffer, value) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89}],105:[function(require,module,exports){
+},{"buffer":88}],104:[function(require,module,exports){
 (function (Buffer){
 function encryptByte (self, byteParam, decrypt) {
   var pad = self._cipher.encryptBlock(self._prev)
@@ -21331,7 +18626,7 @@ exports.encrypt = function (self, chunk, decrypt) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89}],106:[function(require,module,exports){
+},{"buffer":88}],105:[function(require,module,exports){
 (function (Buffer){
 var xor = require('buffer-xor')
 
@@ -21366,7 +18661,7 @@ exports.encrypt = function (self, chunk) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89,"buffer-xor":109}],107:[function(require,module,exports){
+},{"buffer":88,"buffer-xor":108}],106:[function(require,module,exports){
 exports.encrypt = function (self, block) {
   return self._cipher.encryptBlock(block)
 }
@@ -21374,7 +18669,7 @@ exports.decrypt = function (self, block) {
   return self._cipher.decryptBlock(block)
 }
 
-},{}],108:[function(require,module,exports){
+},{}],107:[function(require,module,exports){
 (function (Buffer){
 var xor = require('buffer-xor')
 
@@ -21394,7 +18689,7 @@ exports.encrypt = function (self, chunk) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89,"buffer-xor":109}],109:[function(require,module,exports){
+},{"buffer":88,"buffer-xor":108}],108:[function(require,module,exports){
 (function (Buffer){
 module.exports = function xor (a, b) {
   var length = Math.min(a.length, b.length)
@@ -21408,7 +18703,7 @@ module.exports = function xor (a, b) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89}],110:[function(require,module,exports){
+},{"buffer":88}],109:[function(require,module,exports){
 (function (Buffer){
 var Transform = require('stream').Transform
 var inherits = require('inherits')
@@ -21502,7 +18797,7 @@ CipherBase.prototype._toString = function (value, enc, final) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89,"inherits":286,"stream":303,"string_decoder":304}],111:[function(require,module,exports){
+},{"buffer":88,"inherits":285,"stream":302,"string_decoder":303}],110:[function(require,module,exports){
 (function (Buffer){
 var aes = require('./aes')
 var Transform = require('cipher-base')
@@ -21531,7 +18826,7 @@ StreamCipher.prototype._final = function () {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"./aes":95,"buffer":89,"cipher-base":110,"inherits":286}],112:[function(require,module,exports){
+},{"./aes":94,"buffer":88,"cipher-base":109,"inherits":285}],111:[function(require,module,exports){
 (function (Buffer){
 var CipherBase = require('cipher-base')
 var des = require('des.js')
@@ -21578,7 +18873,7 @@ DES.prototype._final = function () {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89,"cipher-base":114,"des.js":115,"inherits":286}],113:[function(require,module,exports){
+},{"buffer":88,"cipher-base":113,"des.js":114,"inherits":285}],112:[function(require,module,exports){
 exports['des-ecb'] = {
   key: 8,
   iv: 0
@@ -21604,9 +18899,9 @@ exports['des-ede'] = {
   iv: 0
 }
 
-},{}],114:[function(require,module,exports){
-arguments[4][110][0].apply(exports,arguments)
-},{"buffer":89,"dup":110,"inherits":286,"stream":303,"string_decoder":304}],115:[function(require,module,exports){
+},{}],113:[function(require,module,exports){
+arguments[4][109][0].apply(exports,arguments)
+},{"buffer":88,"dup":109,"inherits":285,"stream":302,"string_decoder":303}],114:[function(require,module,exports){
 'use strict';
 
 exports.utils = require('./des/utils');
@@ -21615,7 +18910,7 @@ exports.DES = require('./des/des');
 exports.CBC = require('./des/cbc');
 exports.EDE = require('./des/ede');
 
-},{"./des/cbc":116,"./des/cipher":117,"./des/des":118,"./des/ede":119,"./des/utils":120}],116:[function(require,module,exports){
+},{"./des/cbc":115,"./des/cipher":116,"./des/des":117,"./des/ede":118,"./des/utils":119}],115:[function(require,module,exports){
 'use strict';
 
 var assert = require('minimalistic-assert');
@@ -21682,7 +18977,7 @@ proto._update = function _update(inp, inOff, out, outOff) {
   }
 };
 
-},{"inherits":286,"minimalistic-assert":121}],117:[function(require,module,exports){
+},{"inherits":285,"minimalistic-assert":120}],116:[function(require,module,exports){
 'use strict';
 
 var assert = require('minimalistic-assert');
@@ -21825,7 +19120,7 @@ Cipher.prototype._finalDecrypt = function _finalDecrypt() {
   return this._unpad(out);
 };
 
-},{"minimalistic-assert":121}],118:[function(require,module,exports){
+},{"minimalistic-assert":120}],117:[function(require,module,exports){
 'use strict';
 
 var assert = require('minimalistic-assert');
@@ -21970,7 +19265,7 @@ DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
   utils.rip(l, r, out, off);
 };
 
-},{"../des":115,"inherits":286,"minimalistic-assert":121}],119:[function(require,module,exports){
+},{"../des":114,"inherits":285,"minimalistic-assert":120}],118:[function(require,module,exports){
 'use strict';
 
 var assert = require('minimalistic-assert');
@@ -22027,7 +19322,7 @@ EDE.prototype._update = function _update(inp, inOff, out, outOff) {
 EDE.prototype._pad = DES.prototype._pad;
 EDE.prototype._unpad = DES.prototype._unpad;
 
-},{"../des":115,"inherits":286,"minimalistic-assert":121}],120:[function(require,module,exports){
+},{"../des":114,"inherits":285,"minimalistic-assert":120}],119:[function(require,module,exports){
 'use strict';
 
 exports.readUInt32BE = function readUInt32BE(bytes, off) {
@@ -22285,7 +19580,7 @@ exports.padSplit = function padSplit(num, size, group) {
   return out.join(' ');
 };
 
-},{}],121:[function(require,module,exports){
+},{}],120:[function(require,module,exports){
 module.exports = assert;
 
 function assert(val, msg) {
@@ -22298,7 +19593,7 @@ assert.equal = function assertEqual(l, r, msg) {
     throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
 };
 
-},{}],122:[function(require,module,exports){
+},{}],121:[function(require,module,exports){
 (function (Buffer){
 var md5 = require('create-hash/md5')
 module.exports = EVP_BytesToKey
@@ -22370,7 +19665,7 @@ function EVP_BytesToKey (password, salt, keyLen, ivLen) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89,"create-hash/md5":219}],123:[function(require,module,exports){
+},{"buffer":88,"create-hash/md5":218}],122:[function(require,module,exports){
 (function (Buffer){
 'use strict'
 exports['RSA-SHA224'] = exports.sha224WithRSAEncryption = {
@@ -22446,7 +19741,7 @@ exports['RSA-MD5'] = exports.md5WithRSAEncryption = {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89}],124:[function(require,module,exports){
+},{"buffer":88}],123:[function(require,module,exports){
 (function (Buffer){
 var _algos = require('./algos')
 var createHash = require('create-hash')
@@ -22553,7 +19848,7 @@ module.exports = {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"./algos":123,"./sign":189,"./verify":190,"buffer":89,"create-hash":217,"inherits":286,"stream":303}],125:[function(require,module,exports){
+},{"./algos":122,"./sign":188,"./verify":189,"buffer":88,"create-hash":216,"inherits":285,"stream":302}],124:[function(require,module,exports){
 'use strict'
 exports['1.3.132.0.10'] = 'secp256k1'
 
@@ -22567,7 +19862,7 @@ exports['1.3.132.0.34'] = 'p384'
 
 exports['1.3.132.0.35'] = 'p521'
 
-},{}],126:[function(require,module,exports){
+},{}],125:[function(require,module,exports){
 (function (module, exports) {
   'use strict';
 
@@ -25888,7 +23183,7 @@ exports['1.3.132.0.35'] = 'p521'
   };
 })(typeof module === 'undefined' || module, this);
 
-},{}],127:[function(require,module,exports){
+},{}],126:[function(require,module,exports){
 (function (Buffer){
 var bn = require('bn.js');
 var randomBytes = require('randombytes');
@@ -25932,7 +23227,7 @@ function getr(priv) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"bn.js":126,"buffer":89,"randombytes":284}],128:[function(require,module,exports){
+},{"bn.js":125,"buffer":88,"randombytes":283}],127:[function(require,module,exports){
 'use strict';
 
 var elliptic = exports;
@@ -25948,7 +23243,7 @@ elliptic.curves = require('./elliptic/curves');
 elliptic.ec = require('./elliptic/ec');
 elliptic.eddsa = require('./elliptic/eddsa');
 
-},{"../package.json":151,"./elliptic/curve":131,"./elliptic/curves":134,"./elliptic/ec":135,"./elliptic/eddsa":138,"./elliptic/hmac-drbg":141,"./elliptic/utils":143,"brorand":144}],129:[function(require,module,exports){
+},{"../package.json":150,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/eddsa":137,"./elliptic/hmac-drbg":140,"./elliptic/utils":142,"brorand":143}],128:[function(require,module,exports){
 'use strict';
 
 var BN = require('bn.js');
@@ -26301,7 +23596,7 @@ BasePoint.prototype.dblp = function dblp(k) {
   return r;
 };
 
-},{"../../elliptic":128,"bn.js":126}],130:[function(require,module,exports){
+},{"../../elliptic":127,"bn.js":125}],129:[function(require,module,exports){
 'use strict';
 
 var curve = require('../curve');
@@ -26709,7 +24004,7 @@ Point.prototype.eq = function eq(other) {
 Point.prototype.toP = Point.prototype.normalize;
 Point.prototype.mixedAdd = Point.prototype.add;
 
-},{"../../elliptic":128,"../curve":131,"bn.js":126,"inherits":286}],131:[function(require,module,exports){
+},{"../../elliptic":127,"../curve":130,"bn.js":125,"inherits":285}],130:[function(require,module,exports){
 'use strict';
 
 var curve = exports;
@@ -26719,7 +24014,7 @@ curve.short = require('./short');
 curve.mont = require('./mont');
 curve.edwards = require('./edwards');
 
-},{"./base":129,"./edwards":130,"./mont":132,"./short":133}],132:[function(require,module,exports){
+},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(require,module,exports){
 'use strict';
 
 var curve = require('../curve');
@@ -26897,7 +24192,7 @@ Point.prototype.getX = function getX() {
   return this.x.fromRed();
 };
 
-},{"../../elliptic":128,"../curve":131,"bn.js":126,"inherits":286}],133:[function(require,module,exports){
+},{"../../elliptic":127,"../curve":130,"bn.js":125,"inherits":285}],132:[function(require,module,exports){
 'use strict';
 
 var curve = require('../curve');
@@ -27806,7 +25101,7 @@ JPoint.prototype.isInfinity = function isInfinity() {
   return this.z.cmpn(0) === 0;
 };
 
-},{"../../elliptic":128,"../curve":131,"bn.js":126,"inherits":286}],134:[function(require,module,exports){
+},{"../../elliptic":127,"../curve":130,"bn.js":125,"inherits":285}],133:[function(require,module,exports){
 'use strict';
 
 var curves = exports;
@@ -28013,7 +25308,7 @@ defineCurve('secp256k1', {
   ]
 });
 
-},{"../elliptic":128,"./precomputed/secp256k1":142,"hash.js":145}],135:[function(require,module,exports){
+},{"../elliptic":127,"./precomputed/secp256k1":141,"hash.js":144}],134:[function(require,module,exports){
 'use strict';
 
 var BN = require('bn.js');
@@ -28230,7 +25525,7 @@ EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
   throw new Error('Unable to find valid recovery factor');
 };
 
-},{"../../elliptic":128,"./key":136,"./signature":137,"bn.js":126}],136:[function(require,module,exports){
+},{"../../elliptic":127,"./key":135,"./signature":136,"bn.js":125}],135:[function(require,module,exports){
 'use strict';
 
 var BN = require('bn.js');
@@ -28339,7 +25634,7 @@ KeyPair.prototype.inspect = function inspect() {
          ' pub: ' + (this.pub && this.pub.inspect()) + ' >';
 };
 
-},{"bn.js":126}],137:[function(require,module,exports){
+},{"bn.js":125}],136:[function(require,module,exports){
 'use strict';
 
 var BN = require('bn.js');
@@ -28476,7 +25771,7 @@ Signature.prototype.toDER = function toDER(enc) {
   return utils.encode(res, enc);
 };
 
-},{"../../elliptic":128,"bn.js":126}],138:[function(require,module,exports){
+},{"../../elliptic":127,"bn.js":125}],137:[function(require,module,exports){
 'use strict';
 
 var hash = require('hash.js');
@@ -28596,7 +25891,7 @@ EDDSA.prototype.isPoint = function isPoint(val) {
   return val instanceof this.pointClass;
 };
 
-},{"../../elliptic":128,"./key":139,"./signature":140,"hash.js":145}],139:[function(require,module,exports){
+},{"../../elliptic":127,"./key":138,"./signature":139,"hash.js":144}],138:[function(require,module,exports){
 'use strict';
 
 var elliptic = require('../../elliptic');
@@ -28694,7 +25989,7 @@ KeyPair.prototype.getPublic = function getPublic(enc) {
 
 module.exports = KeyPair;
 
-},{"../../elliptic":128}],140:[function(require,module,exports){
+},{"../../elliptic":127}],139:[function(require,module,exports){
 'use strict';
 
 var BN = require('bn.js');
@@ -28762,7 +26057,7 @@ Signature.prototype.toHex = function toHex() {
 
 module.exports = Signature;
 
-},{"../../elliptic":128,"bn.js":126}],141:[function(require,module,exports){
+},{"../../elliptic":127,"bn.js":125}],140:[function(require,module,exports){
 'use strict';
 
 var hash = require('hash.js');
@@ -28878,7 +26173,7 @@ HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
   return utils.encode(res, enc);
 };
 
-},{"../elliptic":128,"hash.js":145}],142:[function(require,module,exports){
+},{"../elliptic":127,"hash.js":144}],141:[function(require,module,exports){
 module.exports = {
   doubles: {
     step: 4,
@@ -29660,7 +26955,7 @@ module.exports = {
   }
 };
 
-},{}],143:[function(require,module,exports){
+},{}],142:[function(require,module,exports){
 'use strict';
 
 var utils = exports;
@@ -29835,7 +27130,7 @@ function intFromLE(bytes) {
 utils.intFromLE = intFromLE;
 
 
-},{"bn.js":126}],144:[function(require,module,exports){
+},{"bn.js":125}],143:[function(require,module,exports){
 var r;
 
 module.exports = function rand(len) {
@@ -29894,7 +27189,7 @@ if (typeof window === 'object') {
   }
 }
 
-},{}],145:[function(require,module,exports){
+},{}],144:[function(require,module,exports){
 var hash = exports;
 
 hash.utils = require('./hash/utils');
@@ -29911,7 +27206,7 @@ hash.sha384 = hash.sha.sha384;
 hash.sha512 = hash.sha.sha512;
 hash.ripemd160 = hash.ripemd.ripemd160;
 
-},{"./hash/common":146,"./hash/hmac":147,"./hash/ripemd":148,"./hash/sha":149,"./hash/utils":150}],146:[function(require,module,exports){
+},{"./hash/common":145,"./hash/hmac":146,"./hash/ripemd":147,"./hash/sha":148,"./hash/utils":149}],145:[function(require,module,exports){
 var hash = require('../hash');
 var utils = hash.utils;
 var assert = utils.assert;
@@ -30004,7 +27299,7 @@ BlockHash.prototype._pad = function pad() {
   return res;
 };
 
-},{"../hash":145}],147:[function(require,module,exports){
+},{"../hash":144}],146:[function(require,module,exports){
 var hmac = exports;
 
 var hash = require('../hash');
@@ -30054,7 +27349,7 @@ Hmac.prototype.digest = function digest(enc) {
   return this.outer.digest(enc);
 };
 
-},{"../hash":145}],148:[function(require,module,exports){
+},{"../hash":144}],147:[function(require,module,exports){
 var hash = require('../hash');
 var utils = hash.utils;
 
@@ -30200,7 +27495,7 @@ var sh = [
   8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
 ];
 
-},{"../hash":145}],149:[function(require,module,exports){
+},{"../hash":144}],148:[function(require,module,exports){
 var hash = require('../hash');
 var utils = hash.utils;
 var assert = utils.assert;
@@ -30766,7 +28061,7 @@ function g1_512_lo(xh, xl) {
   return r;
 }
 
-},{"../hash":145}],150:[function(require,module,exports){
+},{"../hash":144}],149:[function(require,module,exports){
 var utils = exports;
 var inherits = require('inherits');
 
@@ -31025,7 +28320,7 @@ function shr64_lo(ah, al, num) {
 };
 exports.shr64_lo = shr64_lo;
 
-},{"inherits":286}],151:[function(require,module,exports){
+},{"inherits":285}],150:[function(require,module,exports){
 module.exports={
   "name": "elliptic",
   "version": "6.1.0",
@@ -31096,7 +28391,7 @@ module.exports={
   "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.1.0.tgz"
 }
 
-},{}],152:[function(require,module,exports){
+},{}],151:[function(require,module,exports){
 module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb",
 "2.16.840.1.101.3.4.1.2": "aes-128-cbc",
 "2.16.840.1.101.3.4.1.3": "aes-128-ofb",
@@ -31110,7 +28405,7 @@ module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb",
 "2.16.840.1.101.3.4.1.43": "aes-256-ofb",
 "2.16.840.1.101.3.4.1.44": "aes-256-cfb"
 }
-},{}],153:[function(require,module,exports){
+},{}],152:[function(require,module,exports){
 // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js
 // Fedor, you are amazing.
 
@@ -31229,7 +28524,7 @@ exports.signature = asn1.define('signature', function () {
   )
 })
 
-},{"asn1.js":156}],154:[function(require,module,exports){
+},{"asn1.js":155}],153:[function(require,module,exports){
 (function (Buffer){
 // adapted from https://github.com/apatil/pemstrip
 var findProc = /Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m
@@ -31263,7 +28558,7 @@ module.exports = function (okey, password) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"browserify-aes":173,"buffer":89,"evp_bytestokey":188}],155:[function(require,module,exports){
+},{"browserify-aes":172,"buffer":88,"evp_bytestokey":187}],154:[function(require,module,exports){
 (function (Buffer){
 var asn1 = require('./asn1')
 var aesid = require('./aesid.json')
@@ -31368,7 +28663,7 @@ function decrypt (data, password) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"./aesid.json":152,"./asn1":153,"./fixProc":154,"browserify-aes":173,"buffer":89,"pbkdf2":238}],156:[function(require,module,exports){
+},{"./aesid.json":151,"./asn1":152,"./fixProc":153,"browserify-aes":172,"buffer":88,"pbkdf2":237}],155:[function(require,module,exports){
 var asn1 = exports;
 
 asn1.bignum = require('bn.js');
@@ -31379,7 +28674,7 @@ asn1.constants = require('./asn1/constants');
 asn1.decoders = require('./asn1/decoders');
 asn1.encoders = require('./asn1/encoders');
 
-},{"./asn1/api":157,"./asn1/base":159,"./asn1/constants":163,"./asn1/decoders":165,"./asn1/encoders":168,"bn.js":126}],157:[function(require,module,exports){
+},{"./asn1/api":156,"./asn1/base":158,"./asn1/constants":162,"./asn1/decoders":164,"./asn1/encoders":167,"bn.js":125}],156:[function(require,module,exports){
 var asn1 = require('../asn1');
 var inherits = require('inherits');
 
@@ -31440,7 +28735,7 @@ Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) {
   return this._getEncoder(enc).encode(data, reporter);
 };
 
-},{"../asn1":156,"inherits":286,"vm":305}],158:[function(require,module,exports){
+},{"../asn1":155,"inherits":285,"vm":304}],157:[function(require,module,exports){
 var inherits = require('inherits');
 var Reporter = require('../base').Reporter;
 var Buffer = require('buffer').Buffer;
@@ -31558,7 +28853,7 @@ EncoderBuffer.prototype.join = function join(out, offset) {
   return out;
 };
 
-},{"../base":159,"buffer":89,"inherits":286}],159:[function(require,module,exports){
+},{"../base":158,"buffer":88,"inherits":285}],158:[function(require,module,exports){
 var base = exports;
 
 base.Reporter = require('./reporter').Reporter;
@@ -31566,7 +28861,7 @@ base.DecoderBuffer = require('./buffer').DecoderBuffer;
 base.EncoderBuffer = require('./buffer').EncoderBuffer;
 base.Node = require('./node');
 
-},{"./buffer":158,"./node":160,"./reporter":161}],160:[function(require,module,exports){
+},{"./buffer":157,"./node":159,"./reporter":160}],159:[function(require,module,exports){
 var Reporter = require('../base').Reporter;
 var EncoderBuffer = require('../base').EncoderBuffer;
 var assert = require('minimalistic-assert');
@@ -32178,7 +29473,7 @@ Node.prototype._isNumstr = function isNumstr(str) {
 Node.prototype._isPrintstr = function isPrintstr(str) {
   return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str);
 };
-},{"../base":159,"minimalistic-assert":170}],161:[function(require,module,exports){
+},{"../base":158,"minimalistic-assert":169}],160:[function(require,module,exports){
 var inherits = require('inherits');
 
 function Reporter(options) {
@@ -32282,7 +29577,7 @@ ReporterError.prototype.rethrow = function rethrow(msg) {
   return this;
 };
 
-},{"inherits":286}],162:[function(require,module,exports){
+},{"inherits":285}],161:[function(require,module,exports){
 var constants = require('../constants');
 
 exports.tagClass = {
@@ -32326,7 +29621,7 @@ exports.tag = {
 };
 exports.tagByName = constants._reverse(exports.tag);
 
-},{"../constants":163}],163:[function(require,module,exports){
+},{"../constants":162}],162:[function(require,module,exports){
 var constants = exports;
 
 // Helper
@@ -32347,7 +29642,7 @@ constants._reverse = function reverse(map) {
 
 constants.der = require('./der');
 
-},{"./der":162}],164:[function(require,module,exports){
+},{"./der":161}],163:[function(require,module,exports){
 var inherits = require('inherits');
 
 var asn1 = require('../../asn1');
@@ -32671,13 +29966,13 @@ function derDecodeLen(buf, primitive, fail) {
   return len;
 }
 
-},{"../../asn1":156,"inherits":286}],165:[function(require,module,exports){
+},{"../../asn1":155,"inherits":285}],164:[function(require,module,exports){
 var decoders = exports;
 
 decoders.der = require('./der');
 decoders.pem = require('./pem');
 
-},{"./der":164,"./pem":166}],166:[function(require,module,exports){
+},{"./der":163,"./pem":165}],165:[function(require,module,exports){
 var inherits = require('inherits');
 var Buffer = require('buffer').Buffer;
 
@@ -32729,7 +30024,7 @@ PEMDecoder.prototype.decode = function decode(data, options) {
   return DERDecoder.prototype.decode.call(this, input, options);
 };
 
-},{"../../asn1":156,"./der":164,"buffer":89,"inherits":286}],167:[function(require,module,exports){
+},{"../../asn1":155,"./der":163,"buffer":88,"inherits":285}],166:[function(require,module,exports){
 var inherits = require('inherits');
 var Buffer = require('buffer').Buffer;
 
@@ -33029,13 +30324,13 @@ function encodeTag(tag, primitive, cls, reporter) {
   return res;
 }
 
-},{"../../asn1":156,"buffer":89,"inherits":286}],168:[function(require,module,exports){
+},{"../../asn1":155,"buffer":88,"inherits":285}],167:[function(require,module,exports){
 var encoders = exports;
 
 encoders.der = require('./der');
 encoders.pem = require('./pem');
 
-},{"./der":167,"./pem":169}],169:[function(require,module,exports){
+},{"./der":166,"./pem":168}],168:[function(require,module,exports){
 var inherits = require('inherits');
 var Buffer = require('buffer').Buffer;
 
@@ -33060,45 +30355,45 @@ PEMEncoder.prototype.encode = function encode(data, options) {
   return out.join('\n');
 };
 
-},{"../../asn1":156,"./der":167,"buffer":89,"inherits":286}],170:[function(require,module,exports){
-arguments[4][121][0].apply(exports,arguments)
-},{"dup":121}],171:[function(require,module,exports){
+},{"../../asn1":155,"./der":166,"buffer":88,"inherits":285}],169:[function(require,module,exports){
+arguments[4][120][0].apply(exports,arguments)
+},{"dup":120}],170:[function(require,module,exports){
+arguments[4][94][0].apply(exports,arguments)
+},{"buffer":88,"dup":94}],171:[function(require,module,exports){
 arguments[4][95][0].apply(exports,arguments)
-},{"buffer":89,"dup":95}],172:[function(require,module,exports){
+},{"./aes":170,"./ghash":175,"buffer":88,"buffer-xor":184,"cipher-base":185,"dup":95,"inherits":285}],172:[function(require,module,exports){
 arguments[4][96][0].apply(exports,arguments)
-},{"./aes":171,"./ghash":176,"buffer":89,"buffer-xor":185,"cipher-base":186,"dup":96,"inherits":286}],173:[function(require,module,exports){
+},{"./decrypter":173,"./encrypter":174,"./modes":176,"dup":96}],173:[function(require,module,exports){
 arguments[4][97][0].apply(exports,arguments)
-},{"./decrypter":174,"./encrypter":175,"./modes":177,"dup":97}],174:[function(require,module,exports){
+},{"./aes":170,"./authCipher":171,"./modes":176,"./modes/cbc":177,"./modes/cfb":178,"./modes/cfb1":179,"./modes/cfb8":180,"./modes/ctr":181,"./modes/ecb":182,"./modes/ofb":183,"./streamCipher":186,"buffer":88,"cipher-base":185,"dup":97,"evp_bytestokey":187,"inherits":285}],174:[function(require,module,exports){
 arguments[4][98][0].apply(exports,arguments)
-},{"./aes":171,"./authCipher":172,"./modes":177,"./modes/cbc":178,"./modes/cfb":179,"./modes/cfb1":180,"./modes/cfb8":181,"./modes/ctr":182,"./modes/ecb":183,"./modes/ofb":184,"./streamCipher":187,"buffer":89,"cipher-base":186,"dup":98,"evp_bytestokey":188,"inherits":286}],175:[function(require,module,exports){
+},{"./aes":170,"./authCipher":171,"./modes":176,"./modes/cbc":177,"./modes/cfb":178,"./modes/cfb1":179,"./modes/cfb8":180,"./modes/ctr":181,"./modes/ecb":182,"./modes/ofb":183,"./streamCipher":186,"buffer":88,"cipher-base":185,"dup":98,"evp_bytestokey":187,"inherits":285}],175:[function(require,module,exports){
 arguments[4][99][0].apply(exports,arguments)
-},{"./aes":171,"./authCipher":172,"./modes":177,"./modes/cbc":178,"./modes/cfb":179,"./modes/cfb1":180,"./modes/cfb8":181,"./modes/ctr":182,"./modes/ecb":183,"./modes/ofb":184,"./streamCipher":187,"buffer":89,"cipher-base":186,"dup":99,"evp_bytestokey":188,"inherits":286}],176:[function(require,module,exports){
+},{"buffer":88,"dup":99}],176:[function(require,module,exports){
 arguments[4][100][0].apply(exports,arguments)
-},{"buffer":89,"dup":100}],177:[function(require,module,exports){
+},{"dup":100}],177:[function(require,module,exports){
 arguments[4][101][0].apply(exports,arguments)
-},{"dup":101}],178:[function(require,module,exports){
+},{"buffer-xor":184,"dup":101}],178:[function(require,module,exports){
 arguments[4][102][0].apply(exports,arguments)
-},{"buffer-xor":185,"dup":102}],179:[function(require,module,exports){
+},{"buffer":88,"buffer-xor":184,"dup":102}],179:[function(require,module,exports){
 arguments[4][103][0].apply(exports,arguments)
-},{"buffer":89,"buffer-xor":185,"dup":103}],180:[function(require,module,exports){
+},{"buffer":88,"dup":103}],180:[function(require,module,exports){
 arguments[4][104][0].apply(exports,arguments)
-},{"buffer":89,"dup":104}],181:[function(require,module,exports){
+},{"buffer":88,"dup":104}],181:[function(require,module,exports){
 arguments[4][105][0].apply(exports,arguments)
-},{"buffer":89,"dup":105}],182:[function(require,module,exports){
+},{"buffer":88,"buffer-xor":184,"dup":105}],182:[function(require,module,exports){
 arguments[4][106][0].apply(exports,arguments)
-},{"buffer":89,"buffer-xor":185,"dup":106}],183:[function(require,module,exports){
+},{"dup":106}],183:[function(require,module,exports){
 arguments[4][107][0].apply(exports,arguments)
-},{"dup":107}],184:[function(require,module,exports){
+},{"buffer":88,"buffer-xor":184,"dup":107}],184:[function(require,module,exports){
 arguments[4][108][0].apply(exports,arguments)
-},{"buffer":89,"buffer-xor":185,"dup":108}],185:[function(require,module,exports){
+},{"buffer":88,"dup":108}],185:[function(require,module,exports){
 arguments[4][109][0].apply(exports,arguments)
-},{"buffer":89,"dup":109}],186:[function(require,module,exports){
+},{"buffer":88,"dup":109,"inherits":285,"stream":302,"string_decoder":303}],186:[function(require,module,exports){
 arguments[4][110][0].apply(exports,arguments)
-},{"buffer":89,"dup":110,"inherits":286,"stream":303,"string_decoder":304}],187:[function(require,module,exports){
-arguments[4][111][0].apply(exports,arguments)
-},{"./aes":171,"buffer":89,"cipher-base":186,"dup":111,"inherits":286}],188:[function(require,module,exports){
-arguments[4][122][0].apply(exports,arguments)
-},{"buffer":89,"create-hash/md5":219,"dup":122}],189:[function(require,module,exports){
+},{"./aes":170,"buffer":88,"cipher-base":185,"dup":110,"inherits":285}],187:[function(require,module,exports){
+arguments[4][121][0].apply(exports,arguments)
+},{"buffer":88,"create-hash/md5":218,"dup":121}],188:[function(require,module,exports){
 (function (Buffer){
 // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
 var createHmac = require('create-hmac')
@@ -33287,7 +30582,7 @@ module.exports.getKey = getKey
 module.exports.makeKey = makeKey
 
 }).call(this,require("buffer").Buffer)
-},{"./curves":125,"bn.js":126,"browserify-rsa":127,"buffer":89,"create-hmac":230,"elliptic":128,"parse-asn1":155}],190:[function(require,module,exports){
+},{"./curves":124,"bn.js":125,"browserify-rsa":126,"buffer":88,"create-hmac":229,"elliptic":127,"parse-asn1":154}],189:[function(require,module,exports){
 (function (Buffer){
 // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
 var curves = require('./curves')
@@ -33394,7 +30689,7 @@ function checkValue (b, q) {
 module.exports = verify
 
 }).call(this,require("buffer").Buffer)
-},{"./curves":125,"bn.js":126,"buffer":89,"elliptic":128,"parse-asn1":155}],191:[function(require,module,exports){
+},{"./curves":124,"bn.js":125,"buffer":88,"elliptic":127,"parse-asn1":154}],190:[function(require,module,exports){
 (function (Buffer){
 var elliptic = require('elliptic');
 var BN = require('bn.js');
@@ -33520,57 +30815,57 @@ function formatReturnValue(bn, enc, len) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"bn.js":192,"buffer":89,"elliptic":193}],192:[function(require,module,exports){
-arguments[4][126][0].apply(exports,arguments)
-},{"dup":126}],193:[function(require,module,exports){
+},{"bn.js":191,"buffer":88,"elliptic":192}],191:[function(require,module,exports){
+arguments[4][125][0].apply(exports,arguments)
+},{"dup":125}],192:[function(require,module,exports){
+arguments[4][127][0].apply(exports,arguments)
+},{"../package.json":215,"./elliptic/curve":195,"./elliptic/curves":198,"./elliptic/ec":199,"./elliptic/eddsa":202,"./elliptic/hmac-drbg":205,"./elliptic/utils":207,"brorand":208,"dup":127}],193:[function(require,module,exports){
 arguments[4][128][0].apply(exports,arguments)
-},{"../package.json":216,"./elliptic/curve":196,"./elliptic/curves":199,"./elliptic/ec":200,"./elliptic/eddsa":203,"./elliptic/hmac-drbg":206,"./elliptic/utils":208,"brorand":209,"dup":128}],194:[function(require,module,exports){
+},{"../../elliptic":192,"bn.js":191,"dup":128}],194:[function(require,module,exports){
 arguments[4][129][0].apply(exports,arguments)
-},{"../../elliptic":193,"bn.js":192,"dup":129}],195:[function(require,module,exports){
+},{"../../elliptic":192,"../curve":195,"bn.js":191,"dup":129,"inherits":285}],195:[function(require,module,exports){
 arguments[4][130][0].apply(exports,arguments)
-},{"../../elliptic":193,"../curve":196,"bn.js":192,"dup":130,"inherits":286}],196:[function(require,module,exports){
+},{"./base":193,"./edwards":194,"./mont":196,"./short":197,"dup":130}],196:[function(require,module,exports){
 arguments[4][131][0].apply(exports,arguments)
-},{"./base":194,"./edwards":195,"./mont":197,"./short":198,"dup":131}],197:[function(require,module,exports){
+},{"../../elliptic":192,"../curve":195,"bn.js":191,"dup":131,"inherits":285}],197:[function(require,module,exports){
 arguments[4][132][0].apply(exports,arguments)
-},{"../../elliptic":193,"../curve":196,"bn.js":192,"dup":132,"inherits":286}],198:[function(require,module,exports){
+},{"../../elliptic":192,"../curve":195,"bn.js":191,"dup":132,"inherits":285}],198:[function(require,module,exports){
 arguments[4][133][0].apply(exports,arguments)
-},{"../../elliptic":193,"../curve":196,"bn.js":192,"dup":133,"inherits":286}],199:[function(require,module,exports){
+},{"../elliptic":192,"./precomputed/secp256k1":206,"dup":133,"hash.js":209}],199:[function(require,module,exports){
 arguments[4][134][0].apply(exports,arguments)
-},{"../elliptic":193,"./precomputed/secp256k1":207,"dup":134,"hash.js":210}],200:[function(require,module,exports){
+},{"../../elliptic":192,"./key":200,"./signature":201,"bn.js":191,"dup":134}],200:[function(require,module,exports){
 arguments[4][135][0].apply(exports,arguments)
-},{"../../elliptic":193,"./key":201,"./signature":202,"bn.js":192,"dup":135}],201:[function(require,module,exports){
+},{"bn.js":191,"dup":135}],201:[function(require,module,exports){
 arguments[4][136][0].apply(exports,arguments)
-},{"bn.js":192,"dup":136}],202:[function(require,module,exports){
+},{"../../elliptic":192,"bn.js":191,"dup":136}],202:[function(require,module,exports){
 arguments[4][137][0].apply(exports,arguments)
-},{"../../elliptic":193,"bn.js":192,"dup":137}],203:[function(require,module,exports){
+},{"../../elliptic":192,"./key":203,"./signature":204,"dup":137,"hash.js":209}],203:[function(require,module,exports){
 arguments[4][138][0].apply(exports,arguments)
-},{"../../elliptic":193,"./key":204,"./signature":205,"dup":138,"hash.js":210}],204:[function(require,module,exports){
+},{"../../elliptic":192,"dup":138}],204:[function(require,module,exports){
 arguments[4][139][0].apply(exports,arguments)
-},{"../../elliptic":193,"dup":139}],205:[function(require,module,exports){
+},{"../../elliptic":192,"bn.js":191,"dup":139}],205:[function(require,module,exports){
 arguments[4][140][0].apply(exports,arguments)
-},{"../../elliptic":193,"bn.js":192,"dup":140}],206:[function(require,module,exports){
+},{"../elliptic":192,"dup":140,"hash.js":209}],206:[function(require,module,exports){
 arguments[4][141][0].apply(exports,arguments)
-},{"../elliptic":193,"dup":141,"hash.js":210}],207:[function(require,module,exports){
+},{"dup":141}],207:[function(require,module,exports){
 arguments[4][142][0].apply(exports,arguments)
-},{"dup":142}],208:[function(require,module,exports){
+},{"bn.js":191,"dup":142}],208:[function(require,module,exports){
 arguments[4][143][0].apply(exports,arguments)
-},{"bn.js":192,"dup":143}],209:[function(require,module,exports){
+},{"dup":143}],209:[function(require,module,exports){
 arguments[4][144][0].apply(exports,arguments)
-},{"dup":144}],210:[function(require,module,exports){
+},{"./hash/common":210,"./hash/hmac":211,"./hash/ripemd":212,"./hash/sha":213,"./hash/utils":214,"dup":144}],210:[function(require,module,exports){
 arguments[4][145][0].apply(exports,arguments)
-},{"./hash/common":211,"./hash/hmac":212,"./hash/ripemd":213,"./hash/sha":214,"./hash/utils":215,"dup":145}],211:[function(require,module,exports){
+},{"../hash":209,"dup":145}],211:[function(require,module,exports){
 arguments[4][146][0].apply(exports,arguments)
-},{"../hash":210,"dup":146}],212:[function(require,module,exports){
+},{"../hash":209,"dup":146}],212:[function(require,module,exports){
 arguments[4][147][0].apply(exports,arguments)
-},{"../hash":210,"dup":147}],213:[function(require,module,exports){
+},{"../hash":209,"dup":147}],213:[function(require,module,exports){
 arguments[4][148][0].apply(exports,arguments)
-},{"../hash":210,"dup":148}],214:[function(require,module,exports){
+},{"../hash":209,"dup":148}],214:[function(require,module,exports){
 arguments[4][149][0].apply(exports,arguments)
-},{"../hash":210,"dup":149}],215:[function(require,module,exports){
+},{"dup":149,"inherits":285}],215:[function(require,module,exports){
 arguments[4][150][0].apply(exports,arguments)
-},{"dup":150,"inherits":286}],216:[function(require,module,exports){
-arguments[4][151][0].apply(exports,arguments)
-},{"dup":151}],217:[function(require,module,exports){
+},{"dup":150}],216:[function(require,module,exports){
 (function (Buffer){
 'use strict';
 var inherits = require('inherits')
@@ -33626,7 +30921,7 @@ module.exports = function createHash (alg) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"./md5":219,"buffer":89,"cipher-base":220,"inherits":286,"ripemd160":221,"sha.js":223}],218:[function(require,module,exports){
+},{"./md5":218,"buffer":88,"cipher-base":219,"inherits":285,"ripemd160":220,"sha.js":222}],217:[function(require,module,exports){
 (function (Buffer){
 'use strict';
 var intSize = 4;
@@ -33663,7 +30958,7 @@ function hash(buf, fn, hashSize, bigEndian) {
 }
 exports.hash = hash;
 }).call(this,require("buffer").Buffer)
-},{"buffer":89}],219:[function(require,module,exports){
+},{"buffer":88}],218:[function(require,module,exports){
 'use strict';
 /*
  * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
@@ -33820,9 +31115,9 @@ function bit_rol(num, cnt)
 module.exports = function md5(buf) {
   return helpers.hash(buf, core_md5, 16);
 };
-},{"./helpers":218}],220:[function(require,module,exports){
-arguments[4][110][0].apply(exports,arguments)
-},{"buffer":89,"dup":110,"inherits":286,"stream":303,"string_decoder":304}],221:[function(require,module,exports){
+},{"./helpers":217}],219:[function(require,module,exports){
+arguments[4][109][0].apply(exports,arguments)
+},{"buffer":88,"dup":109,"inherits":285,"stream":302,"string_decoder":303}],220:[function(require,module,exports){
 (function (Buffer){
 /*
 CryptoJS v3.1.2
@@ -34036,7 +31331,7 @@ function ripemd160 (message) {
 module.exports = ripemd160
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89}],222:[function(require,module,exports){
+},{"buffer":88}],221:[function(require,module,exports){
 (function (Buffer){
 // prototype class for hash functions
 function Hash (blockSize, finalSize) {
@@ -34109,7 +31404,7 @@ Hash.prototype._update = function () {
 module.exports = Hash
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89}],223:[function(require,module,exports){
+},{"buffer":88}],222:[function(require,module,exports){
 var exports = module.exports = function SHA (algorithm) {
   algorithm = algorithm.toLowerCase()
 
@@ -34126,7 +31421,7 @@ exports.sha256 = require('./sha256')
 exports.sha384 = require('./sha384')
 exports.sha512 = require('./sha512')
 
-},{"./sha":224,"./sha1":225,"./sha224":226,"./sha256":227,"./sha384":228,"./sha512":229}],224:[function(require,module,exports){
+},{"./sha":223,"./sha1":224,"./sha224":225,"./sha256":226,"./sha384":227,"./sha512":228}],223:[function(require,module,exports){
 (function (Buffer){
 /*
  * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
@@ -34230,7 +31525,7 @@ module.exports = Sha
 
 
 }).call(this,require("buffer").Buffer)
-},{"./hash":222,"buffer":89,"inherits":286}],225:[function(require,module,exports){
+},{"./hash":221,"buffer":88,"inherits":285}],224:[function(require,module,exports){
 (function (Buffer){
 /*
  * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
@@ -34330,7 +31625,7 @@ Sha1.prototype._hash = function () {
 module.exports = Sha1
 
 }).call(this,require("buffer").Buffer)
-},{"./hash":222,"buffer":89,"inherits":286}],226:[function(require,module,exports){
+},{"./hash":221,"buffer":88,"inherits":285}],225:[function(require,module,exports){
 (function (Buffer){
 /**
  * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
@@ -34386,7 +31681,7 @@ Sha224.prototype._hash = function () {
 module.exports = Sha224
 
 }).call(this,require("buffer").Buffer)
-},{"./hash":222,"./sha256":227,"buffer":89,"inherits":286}],227:[function(require,module,exports){
+},{"./hash":221,"./sha256":226,"buffer":88,"inherits":285}],226:[function(require,module,exports){
 (function (Buffer){
 /**
  * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
@@ -34531,7 +31826,7 @@ Sha256.prototype._hash = function () {
 module.exports = Sha256
 
 }).call(this,require("buffer").Buffer)
-},{"./hash":222,"buffer":89,"inherits":286}],228:[function(require,module,exports){
+},{"./hash":221,"buffer":88,"inherits":285}],227:[function(require,module,exports){
 (function (Buffer){
 var inherits = require('inherits')
 var SHA512 = require('./sha512')
@@ -34591,7 +31886,7 @@ Sha384.prototype._hash = function () {
 module.exports = Sha384
 
 }).call(this,require("buffer").Buffer)
-},{"./hash":222,"./sha512":229,"buffer":89,"inherits":286}],229:[function(require,module,exports){
+},{"./hash":221,"./sha512":228,"buffer":88,"inherits":285}],228:[function(require,module,exports){
 (function (Buffer){
 var inherits = require('inherits')
 var Hash = require('./hash')
@@ -34861,7 +32156,7 @@ Sha512.prototype._hash = function () {
 module.exports = Sha512
 
 }).call(this,require("buffer").Buffer)
-},{"./hash":222,"buffer":89,"inherits":286}],230:[function(require,module,exports){
+},{"./hash":221,"buffer":88,"inherits":285}],229:[function(require,module,exports){
 (function (Buffer){
 'use strict';
 var createHash = require('create-hash/browser');
@@ -34933,7 +32228,7 @@ module.exports = function createHmac(alg, key) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89,"create-hash/browser":217,"inherits":286,"stream":303}],231:[function(require,module,exports){
+},{"buffer":88,"create-hash/browser":216,"inherits":285,"stream":302}],230:[function(require,module,exports){
 (function (Buffer){
 var generatePrime = require('./lib/generatePrime')
 var primes = require('./lib/primes')
@@ -34979,7 +32274,7 @@ exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffi
 exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman
 
 }).call(this,require("buffer").Buffer)
-},{"./lib/dh":232,"./lib/generatePrime":233,"./lib/primes":234,"buffer":89}],232:[function(require,module,exports){
+},{"./lib/dh":231,"./lib/generatePrime":232,"./lib/primes":233,"buffer":88}],231:[function(require,module,exports){
 (function (Buffer){
 var BN = require('bn.js');
 var MillerRabin = require('miller-rabin');
@@ -35147,7 +32442,7 @@ function formatReturnValue(bn, enc) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"./generatePrime":233,"bn.js":235,"buffer":89,"miller-rabin":236,"randombytes":284}],233:[function(require,module,exports){
+},{"./generatePrime":232,"bn.js":234,"buffer":88,"miller-rabin":235,"randombytes":283}],232:[function(require,module,exports){
 var randomBytes = require('randombytes');
 module.exports = findPrime;
 findPrime.simpleSieve = simpleSieve;
@@ -35254,7 +32549,7 @@ function findPrime(bits, gen) {
 
 }
 
-},{"bn.js":235,"miller-rabin":236,"randombytes":284}],234:[function(require,module,exports){
+},{"bn.js":234,"miller-rabin":235,"randombytes":283}],233:[function(require,module,exports){
 module.exports={
     "modp1": {
         "gen": "02",
@@ -35289,9 +32584,9 @@ module.exports={
         "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"
     }
 }
-},{}],235:[function(require,module,exports){
-arguments[4][126][0].apply(exports,arguments)
-},{"dup":126}],236:[function(require,module,exports){
+},{}],234:[function(require,module,exports){
+arguments[4][125][0].apply(exports,arguments)
+},{"dup":125}],235:[function(require,module,exports){
 var bn = require('bn.js');
 var brorand = require('brorand');
 
@@ -35406,9 +32701,9 @@ MillerRabin.prototype.getDivisor = function getDivisor(n, k) {
   return false;
 };
 
-},{"bn.js":235,"brorand":237}],237:[function(require,module,exports){
-arguments[4][144][0].apply(exports,arguments)
-},{"dup":144}],238:[function(require,module,exports){
+},{"bn.js":234,"brorand":236}],236:[function(require,module,exports){
+arguments[4][143][0].apply(exports,arguments)
+},{"dup":143}],237:[function(require,module,exports){
 (function (Buffer){
 var createHmac = require('create-hmac')
 var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs
@@ -35492,7 +32787,7 @@ function pbkdf2Sync (password, salt, iterations, keylen, digest) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89,"create-hmac":230}],239:[function(require,module,exports){
+},{"buffer":88,"create-hmac":229}],238:[function(require,module,exports){
 exports.publicEncrypt = require('./publicEncrypt');
 exports.privateDecrypt = require('./privateDecrypt');
 
@@ -35503,7 +32798,7 @@ exports.privateEncrypt = function privateEncrypt(key, buf) {
 exports.publicDecrypt = function publicDecrypt(key, buf) {
   return exports.privateDecrypt(key, buf, true);
 };
-},{"./privateDecrypt":280,"./publicEncrypt":281}],240:[function(require,module,exports){
+},{"./privateDecrypt":279,"./publicEncrypt":280}],239:[function(require,module,exports){
 (function (Buffer){
 var createHash = require('create-hash');
 module.exports = function (seed, len) {
@@ -35522,85 +32817,85 @@ function i2ops(c) {
   return out;
 }
 }).call(this,require("buffer").Buffer)
-},{"buffer":89,"create-hash":217}],241:[function(require,module,exports){
+},{"buffer":88,"create-hash":216}],240:[function(require,module,exports){
+arguments[4][125][0].apply(exports,arguments)
+},{"dup":125}],241:[function(require,module,exports){
 arguments[4][126][0].apply(exports,arguments)
-},{"dup":126}],242:[function(require,module,exports){
-arguments[4][127][0].apply(exports,arguments)
-},{"bn.js":241,"buffer":89,"dup":127,"randombytes":284}],243:[function(require,module,exports){
+},{"bn.js":240,"buffer":88,"dup":126,"randombytes":283}],242:[function(require,module,exports){
+arguments[4][151][0].apply(exports,arguments)
+},{"dup":151}],243:[function(require,module,exports){
 arguments[4][152][0].apply(exports,arguments)
-},{"dup":152}],244:[function(require,module,exports){
+},{"asn1.js":246,"dup":152}],244:[function(require,module,exports){
 arguments[4][153][0].apply(exports,arguments)
-},{"asn1.js":247,"dup":153}],245:[function(require,module,exports){
+},{"browserify-aes":263,"buffer":88,"dup":153,"evp_bytestokey":278}],245:[function(require,module,exports){
 arguments[4][154][0].apply(exports,arguments)
-},{"browserify-aes":264,"buffer":89,"dup":154,"evp_bytestokey":279}],246:[function(require,module,exports){
+},{"./aesid.json":242,"./asn1":243,"./fixProc":244,"browserify-aes":263,"buffer":88,"dup":154,"pbkdf2":237}],246:[function(require,module,exports){
 arguments[4][155][0].apply(exports,arguments)
-},{"./aesid.json":243,"./asn1":244,"./fixProc":245,"browserify-aes":264,"buffer":89,"dup":155,"pbkdf2":238}],247:[function(require,module,exports){
+},{"./asn1/api":247,"./asn1/base":249,"./asn1/constants":253,"./asn1/decoders":255,"./asn1/encoders":258,"bn.js":240,"dup":155}],247:[function(require,module,exports){
 arguments[4][156][0].apply(exports,arguments)
-},{"./asn1/api":248,"./asn1/base":250,"./asn1/constants":254,"./asn1/decoders":256,"./asn1/encoders":259,"bn.js":241,"dup":156}],248:[function(require,module,exports){
+},{"../asn1":246,"dup":156,"inherits":285,"vm":304}],248:[function(require,module,exports){
 arguments[4][157][0].apply(exports,arguments)
-},{"../asn1":247,"dup":157,"inherits":286,"vm":305}],249:[function(require,module,exports){
+},{"../base":249,"buffer":88,"dup":157,"inherits":285}],249:[function(require,module,exports){
 arguments[4][158][0].apply(exports,arguments)
-},{"../base":250,"buffer":89,"dup":158,"inherits":286}],250:[function(require,module,exports){
+},{"./buffer":248,"./node":250,"./reporter":251,"dup":158}],250:[function(require,module,exports){
 arguments[4][159][0].apply(exports,arguments)
-},{"./buffer":249,"./node":251,"./reporter":252,"dup":159}],251:[function(require,module,exports){
+},{"../base":249,"dup":159,"minimalistic-assert":260}],251:[function(require,module,exports){
 arguments[4][160][0].apply(exports,arguments)
-},{"../base":250,"dup":160,"minimalistic-assert":261}],252:[function(require,module,exports){
+},{"dup":160,"inherits":285}],252:[function(require,module,exports){
 arguments[4][161][0].apply(exports,arguments)
-},{"dup":161,"inherits":286}],253:[function(require,module,exports){
+},{"../constants":253,"dup":161}],253:[function(require,module,exports){
 arguments[4][162][0].apply(exports,arguments)
-},{"../constants":254,"dup":162}],254:[function(require,module,exports){
+},{"./der":252,"dup":162}],254:[function(require,module,exports){
 arguments[4][163][0].apply(exports,arguments)
-},{"./der":253,"dup":163}],255:[function(require,module,exports){
+},{"../../asn1":246,"dup":163,"inherits":285}],255:[function(require,module,exports){
 arguments[4][164][0].apply(exports,arguments)
-},{"../../asn1":247,"dup":164,"inherits":286}],256:[function(require,module,exports){
+},{"./der":254,"./pem":256,"dup":164}],256:[function(require,module,exports){
 arguments[4][165][0].apply(exports,arguments)
-},{"./der":255,"./pem":257,"dup":165}],257:[function(require,module,exports){
+},{"../../asn1":246,"./der":254,"buffer":88,"dup":165,"inherits":285}],257:[function(require,module,exports){
 arguments[4][166][0].apply(exports,arguments)
-},{"../../asn1":247,"./der":255,"buffer":89,"dup":166,"inherits":286}],258:[function(require,module,exports){
+},{"../../asn1":246,"buffer":88,"dup":166,"inherits":285}],258:[function(require,module,exports){
 arguments[4][167][0].apply(exports,arguments)
-},{"../../asn1":247,"buffer":89,"dup":167,"inherits":286}],259:[function(require,module,exports){
+},{"./der":257,"./pem":259,"dup":167}],259:[function(require,module,exports){
 arguments[4][168][0].apply(exports,arguments)
-},{"./der":258,"./pem":260,"dup":168}],260:[function(require,module,exports){
-arguments[4][169][0].apply(exports,arguments)
-},{"../../asn1":247,"./der":258,"buffer":89,"dup":169,"inherits":286}],261:[function(require,module,exports){
-arguments[4][121][0].apply(exports,arguments)
-},{"dup":121}],262:[function(require,module,exports){
+},{"../../asn1":246,"./der":257,"buffer":88,"dup":168,"inherits":285}],260:[function(require,module,exports){
+arguments[4][120][0].apply(exports,arguments)
+},{"dup":120}],261:[function(require,module,exports){
+arguments[4][94][0].apply(exports,arguments)
+},{"buffer":88,"dup":94}],262:[function(require,module,exports){
 arguments[4][95][0].apply(exports,arguments)
-},{"buffer":89,"dup":95}],263:[function(require,module,exports){
+},{"./aes":261,"./ghash":266,"buffer":88,"buffer-xor":275,"cipher-base":276,"dup":95,"inherits":285}],263:[function(require,module,exports){
 arguments[4][96][0].apply(exports,arguments)
-},{"./aes":262,"./ghash":267,"buffer":89,"buffer-xor":276,"cipher-base":277,"dup":96,"inherits":286}],264:[function(require,module,exports){
+},{"./decrypter":264,"./encrypter":265,"./modes":267,"dup":96}],264:[function(require,module,exports){
 arguments[4][97][0].apply(exports,arguments)
-},{"./decrypter":265,"./encrypter":266,"./modes":268,"dup":97}],265:[function(require,module,exports){
+},{"./aes":261,"./authCipher":262,"./modes":267,"./modes/cbc":268,"./modes/cfb":269,"./modes/cfb1":270,"./modes/cfb8":271,"./modes/ctr":272,"./modes/ecb":273,"./modes/ofb":274,"./streamCipher":277,"buffer":88,"cipher-base":276,"dup":97,"evp_bytestokey":278,"inherits":285}],265:[function(require,module,exports){
 arguments[4][98][0].apply(exports,arguments)
-},{"./aes":262,"./authCipher":263,"./modes":268,"./modes/cbc":269,"./modes/cfb":270,"./modes/cfb1":271,"./modes/cfb8":272,"./modes/ctr":273,"./modes/ecb":274,"./modes/ofb":275,"./streamCipher":278,"buffer":89,"cipher-base":277,"dup":98,"evp_bytestokey":279,"inherits":286}],266:[function(require,module,exports){
+},{"./aes":261,"./authCipher":262,"./modes":267,"./modes/cbc":268,"./modes/cfb":269,"./modes/cfb1":270,"./modes/cfb8":271,"./modes/ctr":272,"./modes/ecb":273,"./modes/ofb":274,"./streamCipher":277,"buffer":88,"cipher-base":276,"dup":98,"evp_bytestokey":278,"inherits":285}],266:[function(require,module,exports){
 arguments[4][99][0].apply(exports,arguments)
-},{"./aes":262,"./authCipher":263,"./modes":268,"./modes/cbc":269,"./modes/cfb":270,"./modes/cfb1":271,"./modes/cfb8":272,"./modes/ctr":273,"./modes/ecb":274,"./modes/ofb":275,"./streamCipher":278,"buffer":89,"cipher-base":277,"dup":99,"evp_bytestokey":279,"inherits":286}],267:[function(require,module,exports){
+},{"buffer":88,"dup":99}],267:[function(require,module,exports){
 arguments[4][100][0].apply(exports,arguments)
-},{"buffer":89,"dup":100}],268:[function(require,module,exports){
+},{"dup":100}],268:[function(require,module,exports){
 arguments[4][101][0].apply(exports,arguments)
-},{"dup":101}],269:[function(require,module,exports){
+},{"buffer-xor":275,"dup":101}],269:[function(require,module,exports){
 arguments[4][102][0].apply(exports,arguments)
-},{"buffer-xor":276,"dup":102}],270:[function(require,module,exports){
+},{"buffer":88,"buffer-xor":275,"dup":102}],270:[function(require,module,exports){
 arguments[4][103][0].apply(exports,arguments)
-},{"buffer":89,"buffer-xor":276,"dup":103}],271:[function(require,module,exports){
+},{"buffer":88,"dup":103}],271:[function(require,module,exports){
 arguments[4][104][0].apply(exports,arguments)
-},{"buffer":89,"dup":104}],272:[function(require,module,exports){
+},{"buffer":88,"dup":104}],272:[function(require,module,exports){
 arguments[4][105][0].apply(exports,arguments)
-},{"buffer":89,"dup":105}],273:[function(require,module,exports){
+},{"buffer":88,"buffer-xor":275,"dup":105}],273:[function(require,module,exports){
 arguments[4][106][0].apply(exports,arguments)
-},{"buffer":89,"buffer-xor":276,"dup":106}],274:[function(require,module,exports){
+},{"dup":106}],274:[function(require,module,exports){
 arguments[4][107][0].apply(exports,arguments)
-},{"dup":107}],275:[function(require,module,exports){
+},{"buffer":88,"buffer-xor":275,"dup":107}],275:[function(require,module,exports){
 arguments[4][108][0].apply(exports,arguments)
-},{"buffer":89,"buffer-xor":276,"dup":108}],276:[function(require,module,exports){
+},{"buffer":88,"dup":108}],276:[function(require,module,exports){
 arguments[4][109][0].apply(exports,arguments)
-},{"buffer":89,"dup":109}],277:[function(require,module,exports){
+},{"buffer":88,"dup":109,"inherits":285,"stream":302,"string_decoder":303}],277:[function(require,module,exports){
 arguments[4][110][0].apply(exports,arguments)
-},{"buffer":89,"dup":110,"inherits":286,"stream":303,"string_decoder":304}],278:[function(require,module,exports){
-arguments[4][111][0].apply(exports,arguments)
-},{"./aes":262,"buffer":89,"cipher-base":277,"dup":111,"inherits":286}],279:[function(require,module,exports){
-arguments[4][122][0].apply(exports,arguments)
-},{"buffer":89,"create-hash/md5":219,"dup":122}],280:[function(require,module,exports){
+},{"./aes":261,"buffer":88,"cipher-base":276,"dup":110,"inherits":285}],278:[function(require,module,exports){
+arguments[4][121][0].apply(exports,arguments)
+},{"buffer":88,"create-hash/md5":218,"dup":121}],279:[function(require,module,exports){
 (function (Buffer){
 var parseKeys = require('parse-asn1');
 var mgf = require('./mgf');
@@ -35711,7 +33006,7 @@ function compare(a, b){
   return dif;
 }
 }).call(this,require("buffer").Buffer)
-},{"./mgf":240,"./withPublic":282,"./xor":283,"bn.js":241,"browserify-rsa":242,"buffer":89,"create-hash":217,"parse-asn1":246}],281:[function(require,module,exports){
+},{"./mgf":239,"./withPublic":281,"./xor":282,"bn.js":240,"browserify-rsa":241,"buffer":88,"create-hash":216,"parse-asn1":245}],280:[function(require,module,exports){
 (function (Buffer){
 var parseKeys = require('parse-asn1');
 var randomBytes = require('randombytes');
@@ -35809,7 +33104,7 @@ function nonZero(len, crypto) {
   return out;
 }
 }).call(this,require("buffer").Buffer)
-},{"./mgf":240,"./withPublic":282,"./xor":283,"bn.js":241,"browserify-rsa":242,"buffer":89,"create-hash":217,"parse-asn1":246,"randombytes":284}],282:[function(require,module,exports){
+},{"./mgf":239,"./withPublic":281,"./xor":282,"bn.js":240,"browserify-rsa":241,"buffer":88,"create-hash":216,"parse-asn1":245,"randombytes":283}],281:[function(require,module,exports){
 (function (Buffer){
 var bn = require('bn.js');
 function withPublic(paddedMsg, key) {
@@ -35822,7 +33117,7 @@ function withPublic(paddedMsg, key) {
 
 module.exports = withPublic;
 }).call(this,require("buffer").Buffer)
-},{"bn.js":241,"buffer":89}],283:[function(require,module,exports){
+},{"bn.js":240,"buffer":88}],282:[function(require,module,exports){
 module.exports = function xor(a, b) {
   var len = a.length;
   var i = -1;
@@ -35831,7 +33126,7 @@ module.exports = function xor(a, b) {
   }
   return a
 };
-},{}],284:[function(require,module,exports){
+},{}],283:[function(require,module,exports){
 (function (process,global,Buffer){
 'use strict'
 
@@ -35870,7 +33165,7 @@ function randomBytes (size, cb) {
 }
 
 }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
-},{"_process":289,"buffer":89}],285:[function(require,module,exports){
+},{"_process":288,"buffer":88}],284:[function(require,module,exports){
 // Copyright Joyent, Inc. and other Node contributors.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a
@@ -36170,7 +33465,7 @@ function isUndefined(arg) {
   return arg === void 0;
 }
 
-},{}],286:[function(require,module,exports){
+},{}],285:[function(require,module,exports){
 if (typeof Object.create === 'function') {
   // implementation from standard node.js 'util' module
   module.exports = function inherits(ctor, superCtor) {
@@ -36195,7 +33490,7 @@ if (typeof Object.create === 'function') {
   }
 }
 
-},{}],287:[function(require,module,exports){
+},{}],286:[function(require,module,exports){
 /**
  * Determine if an object is Buffer
  *
@@ -36214,12 +33509,12 @@ module.exports = function (obj) {
     ))
 }
 
-},{}],288:[function(require,module,exports){
+},{}],287:[function(require,module,exports){
 module.exports = Array.isArray || function (arr) {
   return Object.prototype.toString.call(arr) == '[object Array]';
 };
 
-},{}],289:[function(require,module,exports){
+},{}],288:[function(require,module,exports){
 // shim for using process in browser
 
 var process = module.exports = {};
@@ -36312,10 +33607,10 @@ process.chdir = function (dir) {
 };
 process.umask = function() { return 0; };
 
-},{}],290:[function(require,module,exports){
+},{}],289:[function(require,module,exports){
 module.exports = require("./lib/_stream_duplex.js")
 
-},{"./lib/_stream_duplex.js":291}],291:[function(require,module,exports){
+},{"./lib/_stream_duplex.js":290}],290:[function(require,module,exports){
 // a duplex stream is just a stream that is both readable and writable.
 // Since JS doesn't have multiple prototypal inheritance, this class
 // prototypally inherits from Readable, and then parasitically from
@@ -36399,7 +33694,7 @@ function forEach (xs, f) {
   }
 }
 
-},{"./_stream_readable":293,"./_stream_writable":295,"core-util-is":296,"inherits":286,"process-nextick-args":297}],292:[function(require,module,exports){
+},{"./_stream_readable":292,"./_stream_writable":294,"core-util-is":295,"inherits":285,"process-nextick-args":296}],291:[function(require,module,exports){
 // a passthrough stream.
 // basically just the most minimal sort of Transform stream.
 // Every written chunk gets output as-is.
@@ -36428,7 +33723,7 @@ PassThrough.prototype._transform = function(chunk, encoding, cb) {
   cb(null, chunk);
 };
 
-},{"./_stream_transform":294,"core-util-is":296,"inherits":286}],293:[function(require,module,exports){
+},{"./_stream_transform":293,"core-util-is":295,"inherits":285}],292:[function(require,module,exports){
 (function (process){
 'use strict';
 
@@ -37407,7 +34702,7 @@ function indexOf (xs, x) {
 }
 
 }).call(this,require('_process'))
-},{"./_stream_duplex":291,"_process":289,"buffer":89,"core-util-is":296,"events":285,"inherits":286,"isarray":288,"process-nextick-args":297,"string_decoder/":304,"util":88}],294:[function(require,module,exports){
+},{"./_stream_duplex":290,"_process":288,"buffer":88,"core-util-is":295,"events":284,"inherits":285,"isarray":287,"process-nextick-args":296,"string_decoder/":303,"util":87}],293:[function(require,module,exports){
 // a transform stream is a readable/writable stream where you do
 // something with the data.  Sometimes it's called a "filter",
 // but that's not a great name for it, since that implies a thing where
@@ -37606,7 +34901,7 @@ function done(stream, er) {
   return stream.push(null);
 }
 
-},{"./_stream_duplex":291,"core-util-is":296,"inherits":286}],295:[function(require,module,exports){
+},{"./_stream_duplex":290,"core-util-is":295,"inherits":285}],294:[function(require,module,exports){
 // A bit simpler than readable streams.
 // Implement an async ._write(chunk, encoding, cb), and it'll handle all
 // the drain event emission and buffering.
@@ -38137,7 +35432,7 @@ function endWritable(stream, state, cb) {
   state.ended = true;
 }
 
-},{"./_stream_duplex":291,"buffer":89,"core-util-is":296,"events":285,"inherits":286,"process-nextick-args":297,"util-deprecate":298}],296:[function(require,module,exports){
+},{"./_stream_duplex":290,"buffer":88,"core-util-is":295,"events":284,"inherits":285,"process-nextick-args":296,"util-deprecate":297}],295:[function(require,module,exports){
 (function (Buffer){
 // Copyright Joyent, Inc. and other Node contributors.
 //
@@ -38248,7 +35543,7 @@ function objectToString(o) {
 }
 
 }).call(this,{"isBuffer":require("../../../../insert-module-globals/node_modules/is-buffer/index.js")})
-},{"../../../../insert-module-globals/node_modules/is-buffer/index.js":287}],297:[function(require,module,exports){
+},{"../../../../insert-module-globals/node_modules/is-buffer/index.js":286}],296:[function(require,module,exports){
 (function (process){
 'use strict';
 
@@ -38272,7 +35567,7 @@ function nextTick(fn) {
 }
 
 }).call(this,require('_process'))
-},{"_process":289}],298:[function(require,module,exports){
+},{"_process":288}],297:[function(require,module,exports){
 (function (global){
 
 /**
@@ -38343,10 +35638,10 @@ function config (name) {
 }
 
 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],299:[function(require,module,exports){
+},{}],298:[function(require,module,exports){
 module.exports = require("./lib/_stream_passthrough.js")
 
-},{"./lib/_stream_passthrough.js":292}],300:[function(require,module,exports){
+},{"./lib/_stream_passthrough.js":291}],299:[function(require,module,exports){
 var Stream = (function (){
   try {
     return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify
@@ -38360,13 +35655,13 @@ exports.Duplex = require('./lib/_stream_duplex.js');
 exports.Transform = require('./lib/_stream_transform.js');
 exports.PassThrough = require('./lib/_stream_passthrough.js');
 
-},{"./lib/_stream_duplex.js":291,"./lib/_stream_passthrough.js":292,"./lib/_stream_readable.js":293,"./lib/_stream_transform.js":294,"./lib/_stream_writable.js":295}],301:[function(require,module,exports){
+},{"./lib/_stream_duplex.js":290,"./lib/_stream_passthrough.js":291,"./lib/_stream_readable.js":292,"./lib/_stream_transform.js":293,"./lib/_stream_writable.js":294}],300:[function(require,module,exports){
 module.exports = require("./lib/_stream_transform.js")
 
-},{"./lib/_stream_transform.js":294}],302:[function(require,module,exports){
+},{"./lib/_stream_transform.js":293}],301:[function(require,module,exports){
 module.exports = require("./lib/_stream_writable.js")
 
-},{"./lib/_stream_writable.js":295}],303:[function(require,module,exports){
+},{"./lib/_stream_writable.js":294}],302:[function(require,module,exports){
 // Copyright Joyent, Inc. and other Node contributors.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a
@@ -38495,7 +35790,7 @@ Stream.prototype.pipe = function(dest, options) {
   return dest;
 };
 
-},{"events":285,"inherits":286,"readable-stream/duplex.js":290,"readable-stream/passthrough.js":299,"readable-stream/readable.js":300,"readable-stream/transform.js":301,"readable-stream/writable.js":302}],304:[function(require,module,exports){
+},{"events":284,"inherits":285,"readable-stream/duplex.js":289,"readable-stream/passthrough.js":298,"readable-stream/readable.js":299,"readable-stream/transform.js":300,"readable-stream/writable.js":301}],303:[function(require,module,exports){
 // Copyright Joyent, Inc. and other Node contributors.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a
@@ -38718,7 +36013,7 @@ function base64DetectIncompleteChar(buffer) {
   this.charLength = this.charReceived ? 3 : 0;
 }
 
-},{"buffer":89}],305:[function(require,module,exports){
+},{"buffer":88}],304:[function(require,module,exports){
 var indexOf = require('indexof');
 
 var Object_keys = function (obj) {
@@ -38858,7 +36153,7 @@ exports.createContext = Script.createContext = function (context) {
     return copy;
 };
 
-},{"indexof":306}],306:[function(require,module,exports){
+},{"indexof":305}],305:[function(require,module,exports){
 
 var indexOf = [].indexOf;
 
@@ -38886,26 +36181,21 @@ module.exports = {
 
 module.exports = new function() {
     var HEXRE = /^0x[0-9A-Fa-f]+$/
-    var ETHERID_CONTRACT = "0x3589d05a1ec4af9f65b0e5554e645707775ee43c"
+    var SHA256RE = /^Qm[1-9A-Za-z]{44}$/     
+    
+    var ETHERID_CONTRACT = "0xd588b586d61c826a0e87919b3d1a239206d58bf2"
     var ETHERID_ABI = 
     [{"constant":true,"inputs":[],"name":"root_domain","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"domain","type":"uint256"}],"name":"getDomain","outputs":[{"name":"owner","type":"address"},{"name":"expires","type":"uint256"},{"name":"price","type":"uint256"},{"name":"transfer","type":"address"},{"name":"next_domain","type":"uint256"},{"name":"root_id","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"n_domains","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"domain","type":"uint256"},{"name":"id","type":"uint256"}],"name":"getId","outputs":[{"name":"v","type":"uint256"},{"name":"next_id","type":"uint256"},{"name":"prev_id","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"domain","type":"uint256"},{"name":"expires","type":"uint256"},{"name":"price","type":"uint256"},{"name":"transfer","type":"address"}],"name":"changeDomain","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"domain","type":"uint256"},{"name":"name","type":"uint256"},{"name":"value","type":"uint256"}],"name":"changeId","outputs":[],"type":"function"},{"inputs":[],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sender","type":"address"},{"indexed":false,"name":"domain","type":"uint256"},{"indexed":false,"name":"id","type":"uint256"}],"name":"DomainChanged","type":"event"}]
     ;    
     
-    var BigNumber = require( "bignumber.js" )
     var utf8 = require( "utf8" )
     var MH = require('multihashes')
     var bs58 = require( 'bs58')
     
-    this.version = "1.1.0"
+    this.version = "2.0.0"
     
     this.ether_contract = undefined
     
-    this.isBigNumber = function (object) {
-        return object instanceof BigNumber ||
-            (object && object.constructor && object.constructor.name === 'BigNumber');
-    };    
-    
-    
     this.getContract = function ( web3 ){
         if( this.ether_contract ) return this.ether_contract;
         this.ether_contract = web3.eth.contract( ETHERID_ABI).at(ETHERID_CONTRACT);
@@ -38943,17 +36233,14 @@ module.exports = new function() {
     }
 
     this.getDomain = function ( web3, name, callback ) {
+        var domain = name;
         
-        test = web3.toHex( name )
-        
-        domain = name;
-        
-        if( this.isBigNumber( name ) ) { domain = name }
-        else if( HEXRE.test( name ) )  { domain = new BigNumber( name ) }
+        if( web3._extend.utils.isBigNumber( name ) ) { domain = name }
+        else if( HEXRE.test( name ) )  { domain = web3.toBigNumber( name ) }
         else { //string
             utf = utf8.encode( name ).slice(0, 32);
             hex = "0x" + this.asciiToHex( utf )    
-            domain = new BigNumber( hex )
+            domain = web3.toBigNumber( hex )
         }
         
         if( !callback ) { // NOT RECOMMENDED !!!
@@ -39004,34 +36291,34 @@ module.exports = new function() {
     }
 
     this.getId = function ( web3, d, i, callback ) {
-        domain = d;
-        if( this.isBigNumber( d ) ) { domain = d }
-        else if( HEXRE.test( d ) )  { domain = new BigNumber( d ) }
+        var domain = d;
+        if( web3._extend.utils.isBigNumber( d ) ) { domain = d }
+        else if( HEXRE.test( d ) )  { domain = web3.toBigNumber( d ) }
         else { //string
             utf = utf8.encode( d ).slice(0, 32);
             hex = "0x" + this.asciiToHex( utf )    
-            domain = new BigNumber( hex )
+            domain = web3.toBigNumber( hex )
         }
         
-        id = i;
-        if( this.isBigNumber( i ) ) { id = i }
-        else if( HEXRE.test( i ) )  { id = new BigNumber( i ) }
+        var id = i;
+        if( web3._extend.utils.isBigNumber( i ) ) { id = i }
+        else if( HEXRE.test( i ) )  { id = web3.toBigNumber( i ) }
         else { //string
             utf = utf8.encode( id ).slice(0, 32);
             hex = "0x" + this.asciiToHex( utf )    
-            id = new BigNumber( hex )
+            id = web3.toBigNumber( hex )
         }
         
         if( !callback ) { // NOT RECOMMENDED !!!
             res = this.getContract( web3 ).getId( domain, id ) 
 
-            h =  web3.toHex( res[0] )
-            a = this.hexToArray( h )
+            var h =  web3.toHex( res[0] )
+            var a = this.hexToArray( h )
             while( a.length < 32 ) { a.splice( 0, 0, 0) } //make it 32 for sure
-            mh =  MH.encode( new Buffer( a ), 18, 32 ) 
-            hash = bs58.encode( mh )        
+            var mh =  MH.encode( new Buffer( a ), 18, 32 ) 
+            var hash = bs58.encode( mh )        
 
-            r =  
+            var r =  
             {
                 name: id,
                 nameStr: this.toUTF( web3, id ),
@@ -39053,13 +36340,13 @@ module.exports = new function() {
             res = this.getContract( web3 ).getId( domain, id, function( error, res ) {
                 if( error ) { callback( error, null ) }
                 else {
-                    h =  web3.toHex( res[0] ) 
-                    a = EtherId.hexToArray( h )
+                    var h =  web3.toHex( res[0] ) 
+                    var a = EtherId.hexToArray( h )
                     while( a.length < 32 ) { a.splice( 0, 0, 0) } //make it 32 for sure
-                    mh =  MH.encode( new Buffer( a ), 18, 32 ) 
-                    hash = bs58.encode( mh )        
+                    var mh =  MH.encode( new Buffer( a ), 18, 32 ) 
+                    var hash = bs58.encode( mh )        
 
-                    r =  
+                    var r =  
                     {
                         name: id,
                         nameStr: EtherId.toUTF( web3, id ),
@@ -39079,6 +36366,95 @@ module.exports = new function() {
         }
     }
 
+    
+    
+    this.changeDomain = function( web3, addr, d, expires, price ,transfer, params, callback )
+    {
+        var domain = d;
+        if( web3._extend.utils.isBigNumber( d ) ) { domain = d }
+        else if( HEXRE.test( d ) )  { domain = web3.toBigNumber( d ) }
+        else { //string
+            var utf = utf8.encode( d ).slice(0, 32);
+            var hex = "0x" + this.asciiToHex( utf )    
+            domain = web3.toBigNumber( hex )
+        } 
+        
+        if( typeof params == "function"){
+            callback = params
+            params = {}
+        }
+        
+        if( params == undefined ) 
+        {
+            params = {}
+        }
+        
+        params.from = addr
+        params.value = 0
+        params.gas = 160000
+        
+        
+        this.getContract( web3 ).changeDomain.sendTransaction( domain, expires, price, transfer, params, callback );    
+    }    
+    
+    this.changeId = function( web3, addr, d, i, v, params, callback ) {
+        var domain = d, id, value;
+        if( web3._extend.utils.isBigNumber( d ) ) { domain = d }
+        else if( HEXRE.test( d ) )  { domain = web3.toBigNumber( d ) }
+        else { //string
+            var utf = utf8.encode( d ).slice(0, 32);
+            var hex = "0x" + this.asciiToHex( utf )    
+            domain = web3.toBigNumber( hex )
+        }
+        
+        var id = i;
+        if( web3._extend.utils.isBigNumber( i ) ) { id = i }
+        else if( HEXRE.test( i ) )  { id = web3.toBigNumber( i ) }
+        else { //string
+            var utf = utf8.encode( id ).slice(0, 32);
+            var hex = "0x" + this.asciiToHex( utf )    
+            id = web3.toBigNumber( hex )
+        }
+        
+        var value = ""
+        if( web3._extend.utils.isBigNumber( v ) ) { value = v }
+        else if( HEXRE.test( v ) )  { value = web3.toBigNumber( v ) }
+        else if( SHA256RE.test( v ) ) 
+        {
+            var out = bs58.decode( v )
+            ar = MH.decode( new Buffer( out ) )
+            if ( ar.length != 32 ) throw "HASH code should be 32 bytes long"
+            if ( ar.code != 0x12 ) throw "Only sha2-256 hashes are excepted"
+            var hex =  "0x" + arrayToHex( ar.digest )
+            value = web3.toBigNumber( hex ) 
+        }
+        else
+        {
+            var utf = utf8.encode( v ).slice(0, 32);
+            var hex = "0x" + this.asciiToHex( utf ) 
+            value = web3.toBigNumber( hex ) 
+        }
+        
+        if( v == 0 ) throw "Value cannot be zero"
+
+        if( typeof params == "function"){
+            callback = params
+            params = {}
+        }
+        
+        if( params == undefined ) 
+        {
+            params = {}
+        }
+        
+        params.from = addr
+        params.value = 0
+        params.gas = 160000
+        
+        this.getContract( web3 ).changeId.sendTransaction( domain, id, value, params, callback );     
+    }
+
+    
     this.toAscii = function (hex) { //fixed version
     // Find termination
         var str = "";
@@ -39138,9 +36514,9 @@ module.exports = new function() {
     this.getIdEnum = function( web3, domain )
     {
         
-        d = this.getDomain( web3, domain )
+        var d = this.getDomain( web3, domain )
         
-        e = 
+        var e = 
         {
             domain: d.domain,
             current_id: d.root_id,
@@ -39153,7 +36529,7 @@ module.exports = new function() {
     
     this.getNextId = function( web3, e ) {
         
-        id = this.getId( web3, e.domain, e.current_id ) 
+        var id = this.getId( web3, e.domain, e.current_id ) 
         
         if( e.current_id.toNumber() == 0 ) 
         {
@@ -39168,12 +36544,13 @@ module.exports = new function() {
         return id
     }    
     
+    
 }();
 
 
 
 }).call(this,require("buffer").Buffer)
-},{"bignumber.js":4,"bs58":"bs58","buffer":89,"multihashes":"multihashes","utf8":3}],"multihashes":[function(require,module,exports){
+},{"bs58":"bs58","buffer":88,"multihashes":"multihashes","utf8":3}],"multihashes":[function(require,module,exports){
 (function (Buffer){
 var invert = require('invert-hash')
 
@@ -39301,7 +36678,7 @@ mh.isAppCode = function isAppCode (code) {
 }
 
 }).call(this,require("buffer").Buffer)
-},{"buffer":89,"invert-hash":2}],"web3":[function(require,module,exports){
+},{"buffer":88,"invert-hash":2}],"web3":[function(require,module,exports){
 var Web3 = require('./lib/web3');
 
 // dont override global variable
@@ -39311,4 +36688,4 @@ if (typeof window !== 'undefined' && typeof window.Web3 === 'undefined') {
 
 module.exports = Web3;
 
-},{"./lib/web3":26}]},{},[]);
+},{"./lib/web3":25}]},{},[]);
diff --git a/node_modules/etherid-js/dist/etherid.min.js b/node_modules/etherid-js/dist/etherid.min.js
index 9ce018e..ff38431 100644
--- a/node_modules/etherid-js/dist/etherid.min.js
+++ b/node_modules/etherid-js/dist/etherid.min.js
@@ -1,15 +1,14 @@
-require=function e(t,n,r){function i(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return i(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var s=typeof require=="function"&&require;for(var o=0;o>8,o[s]&=255;while(a)o.push(a&255),a>>=8}for(t=0;e[t]===i&&t=55296&&i<=56319&&n65535&&(r-=65536,i+=u(r>>>10&1023|55296),r=56320|r&1023),i+=u(r);return i}function l(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function c(e,t){return u(e>>t&63|128)}function h(e){if((e&4294967168)==0)return u(e);var t="";return(e&4294965248)==0?t=u(e>>6&31|192):(e&4294901760)==0?(l(e),t=u(e>>12&15|224),t+=c(e,6)):(e&4292870144)==0&&(t=u(e>>18&7|240),t+=c(e,12),t+=c(e,6)),t+=u(e&63|128),t}function p(e){var t=a(e),n=t.length,r=-1,i,s="";while(++r=g)throw Error("Invalid byte index");var e=m[y]&255;y++;if((e&192)==128)return e&63;throw Error("Invalid continuation byte")}function v(){var e,t,n,r,i;if(y>g)throw Error("Invalid byte index");if(y==g)return!1;e=m[y]&255,y++;if((e&128)==0)return e;if((e&224)==192){var t=d();i=(e&31)<<6|t;if(i>=128)return i;throw Error("Invalid continuation byte")}if((e&240)==224){t=d(),n=d(),i=(e&15)<<12|t<<6|n;if(i>=2048)return l(i),i;throw Error("Invalid continuation byte")}if((e&248)==240){t=d(),n=d(),r=d(),i=(e&15)<<18|t<<12|n<<6|r;if(i>=65536&&i<=1114111)return i}throw Error("Invalid UTF-8 detected")}function b(e){m=a(e),g=m.length,y=0;var t=[],n;while((n=v())!==!1)t.push(n);return f(t)}var i=typeof n=="object"&&n,s=typeof t=="object"&&t&&t.exports==i&&t,o=typeof e=="object"&&e;if(o.global===o||o.window===o)r=o;var u=String.fromCharCode,m,g,y,w={version:"2.0.0",encode:p,decode:b};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd)define(function(){return w});else if(i&&!i.nodeType)if(s)s.exports=w;else{var E={},S=E.hasOwnProperty;for(var x in w)S.call(w,x)&&(i[x]=w[x])}else r.utf8=w})(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],4:[function(e,t,n){(function(n){"use strict";function y(e){function U(e,t){var r,o,u,a,f,h,d=this;if(!(d instanceof U))return B&&J(26,"constructor call without new",e),new U(e,t);if(t==null||!j(t,2,64,n,"base")){if(e instanceof U){d.s=e.s,d.e=e.e,d.c=(e=e.c)?e.slice():e,n=0;return}if((a=typeof e=="number")&&e*0==0){d.s=1/e<0?(e=-e,-1):1;if(e===~~e){for(o=0,u=e;u>=10;u/=10,o++);d.e=o,d.c=[e],n=0;return}h=e+""}else{if(!s.test(h=e+""))return i(d,h,a);d.s=h.charCodeAt(0)===45?(h=h.slice(1),-1):1}}else{t|=0,h=e+"";if(t==10)return d=new U(e instanceof U?e:h),K(d,O+d.e+1,M);if((a=typeof e=="number")&&e*0!=0||!(new RegExp("^-?"+(r="["+c.slice(0,t)+"]+")+"(?:\\."+r+")?$",t<37?"i":"")).test(h))return i(d,h,a,t);a?(d.s=1/e<0?(h=h.slice(1),-1):1,B&&h.replace(/^0\.0*|\./,"").length>15&&J(n,l,e),a=!1):d.s=h.charCodeAt(0)===45?(h=h.slice(1),-1):1,h=z(h,10,t,d.s)}(o=h.indexOf("."))>-1&&(h=h.replace(".","")),(u=h.search(/e/i))>0?(o<0&&(o=u),o+=+h.slice(u+1),h=h.substring(0,u)):o<0&&(o=h.length);for(u=0;h.charCodeAt(u)===48;u++);for(f=h.length;h.charCodeAt(--f)===48;);h=h.slice(u,f+1);if(h){f=h.length,a&&B&&f>15&&J(n,l,d.s*e),o=o-u-1;if(o>H)d.c=d.e=null;else if(o=0&&(u=q,q=0,e=e.replace(".",""),h=new U(r),f=h.pow(e.length-p),q=u,h.c=T(C(w(f.c),f.e),10,n),h.e=h.c.length),l=T(e,r,n),o=u=l.length;for(;l[--u]==0;l.pop());if(!l[0])return"0";p<0?--o:(f.c=l,f.e=o,f.s=i,f=t(f,h,d,v,n),l=f.c,a=f.r,o=f.e),s=o+d+1,p=l[s],u=n/2,a=a||s<0||l[s+1]!=null,a=v<4?(p!=null||a)&&(v==0||v==(f.s<0?3:2)):p>u||p==u&&(v==4||a||v==6&&l[s-1]&1||v==(f.s<0?8:7));if(s<1||!l[0])e=a?C("1",-d):"0";else{l.length=s;if(a)for(--n;++l[--s]>n;)l[s]=0,s||(++o,l.unshift(1));for(u=l.length;!l[--u];);for(p=0,e="";p<=u;e+=c.charAt(l[p++]));e=C(e,o)}return e}function W(e,t,n,r){var i,s,o,u,a;n=n!=null&&j(n,0,8,r,f)?n|0:M;if(!e.c)return e.toString();i=e.c[0],o=e.e;if(t==null)a=w(e.c),a=r==19||r==24&&o<=_?N(a,o):C(a,o);else{e=K(new U(e),t,n),s=e.e,a=w(e.c),u=a.length;if(r==19||r==24&&(t<=s||s<=_)){for(;uu){if(--t>0)for(a+=".";t--;a+="0");}else{t+=s-u;if(t>0){s+1==u&&(a+=".");for(;t--;a+="0");}}}}return e.s<0&&i?"-"+a:a}function X(e,t){var n,r,i=0;x(e[0])&&(e=e[0]),n=new U(e[0]);for(;++in||e!=k(e))&&J(r,(i||"decimal places")+(en?" out of range":" not an integer"),e),!0}function $(e,t,n){var r=1,i=t.length;for(;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*p-1)>H?e.c=e.e=null:n=10;f/=10,i++);s=t-i;if(s<0)s+=p,a=t,l=m[c=0],d=l/g[i-a-1]%10|0;else{c=o((s+1)/p);if(c>=m.length){if(!r)break e;for(;m.length<=c;m.push(0));l=d=0,i=1,s%=p,a=s-p+1}else{l=f=m[c];for(i=1;f>=10;f/=10,i++);s%=p,a=s-p+i,d=a<0?0:l/g[i-a-1]%10|0}}r=r||t<0||m[c+1]!=null||(a<0?l:l%g[i-a-1]),r=n<4?(d||r)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||r||n==6&&(s>0?a>0?l/g[i-a]:0:m[c-1])%10&1||n==(e.s<0?8:7));if(t<1||!m[0])return m.length=0,r?(t-=e.e+1,m[0]=g[(p-t%p)%p],e.e=-t||0):m[0]=e.e=0,e;s==0?(m.length=c,f=1,c--):(m.length=c+1,f=g[p-s],m[c]=a>0?u(l/g[i-a]%g[a])*f:0);if(r)for(;;){if(c==0){for(s=1,a=m[0];a>=10;a/=10,s++);a=m[0]+=f;for(f=1;a>=10;a/=10,f++);s!=f&&(e.e++,m[0]==h&&(m[0]=1));break}m[c]+=f;if(m[c]!=h)break;m[c--]=0,f=1}for(s=m.length;m[--s]===0;m.pop());}e.e>H?e.c=e.e=null:e.ei)return(e=o[i++])!=null};return f(t="DECIMAL_PLACES")&&j(e,0,g,2,t)&&(O=e|0),s[t]=O,f(t="ROUNDING_MODE")&&j(e,0,8,2,t)&&(M=e|0),s[t]=M,f(t="EXPONENTIAL_AT")&&(x(e)?j(e[0],-g,0,2,t)&&j(e[1],0,g,2,t)&&(_=e[0]|0,D=e[1]|0):j(e,-g,g,2,t)&&(_=-(D=(e<0?-e:e)|0))),s[t]=[_,D],f(t="RANGE")&&(x(e)?j(e[0],-g,-1,2,t)&&j(e[1],1,g,2,t)&&(P=e[0]|0,H=e[1]|0):j(e,-g,g,2,t)&&(e|0?P=-(H=(e<0?-e:e)|0):B&&J(2,t+" cannot be zero",e))),s[t]=[P,H],f(t="ERRORS")&&(e===!!e||e===1||e===0?(n=0,j=(B=!!e)?V:S):B&&J(2,t+a,e)),s[t]=B,f(t="CRYPTO")&&(e===!!e||e===1||e===0?(F=!!e&&!!r,e&&!F&&B&&J(2,"crypto unavailable",r)):B&&J(2,t+a,e)),s[t]=F,f(t="MODULO_MODE")&&j(e,0,9,2,t)&&(I=e|0),s[t]=I,f(t="POW_PRECISION")&&j(e,0,g,2,t)&&(q=e|0),s[t]=q,f(t="FORMAT")&&(typeof e=="object"?R=e:B&&J(2,t+" not an object",e)),s[t]=R,s},U.max=function(){return X(arguments,L.lt)},U.min=function(){return X(arguments,L.gt)},U.random=function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return u(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,i,s,a,f,l=0,c=[],h=new U(A);e=e==null||!j(e,0,g,14)?O:e|0,a=o(e/p);if(F)if(r&&r.getRandomValues){n=r.getRandomValues(new Uint32Array(a*=2));for(;l>>11),f>=9e15?(i=r.getRandomValues(new Uint32Array(2)),n[l]=i[0],n[l+1]=i[1]):(c.push(f%1e14),l+=2);l=a/2}else if(r&&r.randomBytes){n=r.randomBytes(a*=7);for(;l=9e15?r.randomBytes(7).copy(n,l):(c.push(f%1e14),l+=7);l=a/7}else B&&J(14,"crypto unavailable",r);if(!l)for(;l=10;f/=10,l++);lr?1:-1;else for(i=s=0;it[i]?1:-1;break}return s}function n(e,t,n,r){var i=0;for(;n--;)e[n]-=i,i=e[n]1;e.shift());}return function(r,i,s,o,a){var f,l,c,d,v,m,g,y,w,E,S,x,T,N,C,k,L,A=r.s==i.s?1:-1,O=r.c,M=i.c;if(!O||!O[0]||!M||!M[0])return new U(!r.s||!i.s||(O?M&&O[0]==M[0]:!M)?NaN:O&&O[0]==0||!M?A*0:A/0);y=new U(A),w=y.c=[],l=r.e-i.e,A=s+l+1,a||(a=h,l=b(r.e/p)-b(i.e/p),A=A/p|0);for(c=0;M[c]==(O[c]||0);c++);M[c]>(O[c]||0)&&l--;if(A<0)w.push(1),d=!0;else{N=O.length,k=M.length,c=0,A+=2,v=u(a/(M[0]+1)),v>1&&(M=e(M,v,a),O=e(O,v,a),k=M.length,N=O.length),T=k,E=O.slice(0,k),S=E.length;for(;S=a/2&&C++;do{v=0,f=t(M,E,k,S);if(f<0){x=E[0],k!=S&&(x=x*a+(E[1]||0)),v=u(x/C);if(v>1){v>=a&&(v=a-1),m=e(M,v,a),g=m.length,S=E.length;while(t(m,E,g,S)==1)v--,n(m,k=10;A/=10,c++);K(y,s+(y.e=c+l*p-1)+1,o,d)}else y.e=l,y.r=+d;return y}}(),i=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,r=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,s=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,u,a,f){var l,c=a?u:u.replace(s,"");if(i.test(c))o.s=isNaN(c)?null:c<0?-1:1;else{if(!a){c=c.replace(e,function(e,t,n){return l=(n=n.toLowerCase())=="x"?16:n=="b"?2:8,!f||f==l?t:e}),f&&(l=f,c=c.replace(t,"$1").replace(r,"0.$1"));if(u!=c)return new U(c,l)}B&&J(n,"not a"+(f?" base "+f:"")+" number",u),o.s=null}o.c=o.e=null,n=0}}(),L.absoluteValue=L.abs=function(){var e=new U(this);return e.s<0&&(e.s=1),e},L.ceil=function(){return K(new U(this),this.e+1,2)},L.comparedTo=L.cmp=function(e,t){return n=1,E(this,new U(e,t))},L.decimalPlaces=L.dp=function(){var e,t,n=this.c;if(!n)return null;e=((t=n.length-1)-b(this.e/p))*p;if(t=n[t])for(;t%10==0;t/=10,e--);return e<0&&(e=0),e},L.dividedBy=L.div=function(e,r){return n=3,t(this,new U(e,r),O,M)},L.dividedToIntegerBy=L.divToInt=function(e,r){return n=4,t(this,new U(e,r),0,1)},L.equals=L.eq=function(e,t){return n=5,E(this,new U(e,t))===0},L.floor=function(){return K(new U(this),this.e+1,3)},L.greaterThan=L.gt=function(e,t){return n=6,E(this,new U(e,t))>0},L.greaterThanOrEqualTo=L.gte=function(e,t){return n=7,(t=E(this,new U(e,t)))===1||t===0},L.isFinite=function(){return!!this.c},L.isInteger=L.isInt=function(){return!!this.c&&b(this.e/p)>this.c.length-2},L.isNaN=function(){return!this.s},L.isNegative=L.isNeg=function(){return this.s<0},L.isZero=function(){return!!this.c&&this.c[0]==0},L.lessThan=L.lt=function(e,t){return n=8,E(this,new U(e,t))<0},L.lessThanOrEqualTo=L.lte=function(e,t){return n=9,(t=E(this,new U(e,t)))===-1||t===0},L.minus=L.sub=function(e,t){var r,i,s,o,u=this,a=u.s;n=10,e=new U(e,t),t=e.s;if(!a||!t)return new U(NaN);if(a!=t)return e.s=-t,u.plus(e);var f=u.e/p,l=e.e/p,c=u.c,d=e.c;if(!f||!l){if(!c||!d)return c?(e.s=-t,e):new U(d?u:NaN);if(!c[0]||!d[0])return d[0]?(e.s=-t,e):new U(c[0]?u:M==3?0:0)}f=b(f),l=b(l),c=c.slice();if(a=f-l){(o=a<0)?(a=-a,s=c):(l=f,s=d),s.reverse();for(t=a;t--;s.push(0));s.reverse()}else{i=(o=(a=c.length)<(t=d.length))?a:t;for(a=t=0;t0)for(;t--;c[r++]=0);t=h-1;for(;i>a;){if(c[--i]0?(u=o,r=f):(s=-s,r=a),r.reverse();for(;s--;r.push(0));r.reverse()}s=a.length,t=f.length,s-t<0&&(r=f,f=a,a=r,t=s);for(s=0;t;)s=(a[--t]=a[t]+f[t]+s)/h|0,a[t]%=h;return s&&(a.unshift(s),++u),$(e,a,u)},L.precision=L.sd=function(e){var t,n,r=this,i=r.c;e!=null&&e!==!!e&&e!==1&&e!==0&&(B&&J(13,"argument"+a,e),e!=!!e&&(e=null));if(!i)return null;n=i.length-1,t=n*p+1;if(n=i[n]){for(;n%10==0;n/=10,t--);for(n=i[0];n>=10;n/=10,t++);}return e&&r.e+1>t&&(t=r.e+1),t},L.round=function(e,t){var n=new U(this);return(e==null||j(e,0,g,15))&&K(n,~~e+this.e+1,t==null||!j(t,0,8,15,f)?M:t|0),n},L.shift=function(e){var t=this;return j(e,-d,d,16,"argument")?t.times("1e"+k(e)):new U(t.c&&t.c[0]&&(e<-d||e>d)?t.s*(e<0?0:1/0):t)},L.squareRoot=L.sqrt=function(){var e,n,r,i,s,o=this,u=o.c,a=o.s,f=o.e,l=O+4,c=new U("0.5");if(a!==1||!u||!u[0])return new U(!a||a<0&&(!u||u[0])?NaN:u?o:1/0);a=Math.sqrt(+o),a==0||a==1/0?(n=w(u),(n.length+f)%2==0&&(n+="0"),a=Math.sqrt(n),f=b((f+1)/2)-(f<0||f%2),a==1/0?n="1e"+f:(n=a.toExponential(),n=n.slice(0,n.indexOf("e")+1)+f),r=new U(n)):r=new U(a+"");if(r.c[0]){f=r.e,a=f+l,a<3&&(a=0);for(;;){s=r,r=c.times(s.plus(t(o,s,l,1)));if(w(s.c).slice(0,a)===(n=w(r.c)).slice(0,a)){r.e=0;){r=0,v=T[s]%E,g=T[s]/E|0;for(u=f,o=s+u;o>s;)l=x[--u]%E,c=x[u]/E|0,a=g*l+c*v,l=v*l+a%E*E+y[o]+r,r=(l/w|0)+(a/E|0)+g*c,y[o--]=l%w;y[o]=r}return r?++i:y.shift(),$(e,y,i)},L.toDigits=function(e,t){var n=new U(this);return e=e==null||!j(e,1,g,18,"precision")?null:e|0,t=t==null||!j(t,0,8,18,f)?M:t|0,e?K(n,e,t):n},L.toExponential=function(e,t){return W(this,e!=null&&j(e,0,g,19)?~~e+1:null,t,19)},L.toFixed=function(e,t){return W(this,e!=null&&j(e,0,g,20)?~~e+this.e+1:null,t,20)},L.toFormat=function(e,t){var n=W(this,e!=null&&j(e,0,g,21)?~~e+this.e+1:null,t,21);if(this.c){var r,i=n.split("."),s=+R.groupSize,o=+R.secondaryGroupSize,u=R.groupSeparator,a=i[0],f=i[1],l=this.s<0,c=l?a.slice(1):a,h=c.length;o&&(r=s,s=o,o=r,h-=r);if(s>0&&h>0){r=h%s||s,a=c.substr(0,r);for(;r0&&(a+=u+c.slice(r)),l&&(a="-"+a)}n=f?a+R.decimalSeparator+((o=+R.fractionGroupSize)?f.replace(new RegExp("\\d{"+o+"}\\B","g"),"$&"+R.fractionGroupSeparator):f):a}return n},L.toFraction=function(e){var n,r,i,s,o,u,a,f,l,c=B,h=this,d=h.c,m=new U(A),g=r=new U(A),y=a=new U(A);if(e!=null){B=!1,u=new U(e),B=c;if(!(c=u.isInt())||u.lt(A))B&&J(22,"max denominator "+(c?"out of range":"not an integer"),e),e=!c&&u.c&&K(u,u.e+1,1).gte(A)?u:null}if(!d)return h.toString();l=w(d),s=m.e=l.length-h.e-1,m.c[0]=v[(o=s%p)<0?p+o:o],e=!e||u.cmp(m)>0?s>0?m:g:u,o=H,H=1/0,u=new U(l),a.c[0]=0;for(;;){f=t(u,m,0,1),i=r.plus(f.times(y));if(i.cmp(e)==1)break;r=y,y=i,g=a.plus(f.times(i=g)),a=i,m=u.minus(f.times(i=m)),u=i}return i=t(e.minus(r),y,0,1),a=a.plus(i.times(g)),r=r.plus(i.times(y)),a.s=g.s=h.s,s*=2,n=t(g,y,s,M).minus(h).abs().cmp(t(a,r,s,M).minus(h).abs())<1?[g.toString(),y.toString()]:[a.toString(),r.toString()],H=o,n},L.toNumber=function(){return+this},L.toPower=L.pow=function(e){var t,n,r=u(e<0?-e:+e),i=this;if(!j(e,-d,d,23,"exponent")&&(!isFinite(e)||r>d&&(e/=0)||parseFloat(e)!=e&&!(e=NaN)))return new U(Math.pow(+i,e));t=q?o(q/p+2):0,n=new U(A);for(;;){if(r%2){n=n.times(i);if(!n.c)break;t&&n.c.length>t&&(n.c.length=t)}r=u(r/2);if(!r)break;i=i.times(i),t&&i.c&&i.c.length>t&&(i.c.length=t)}return e<0&&(n=A.div(n)),t?K(n,q,M):n},L.toPrecision=function(e,t){return W(this,e!=null&&j(e,1,g,24,"precision")?e|0:null,t,24)},L.toString=function(e){var t,n=this,r=n.s,i=n.e;return i===null?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=w(n.c),e==null||!j(e,2,64,25,"base")?t=i<=_||i>=D?N(t,i):C(t,i):t=z(C(t,i),e|0,10,r),r<0&&n.c[0]&&(t="-"+t)),t},L.truncated=L.trunc=function(){return K(new U(this),this.e+1,1)},L.valueOf=L.toJSON=function(){var e,t=this,n=t.e;return n===null?t.toString():(e=w(t.c),e=n<=_||n>=D?N(e,n):C(e,n),t.s<0?"-"+e:e)},e!=null&&U.config(e),U}function b(e){var t=e|0;return e>0||e===t?t:t-1}function w(e){var t,n,r=1,i=e.length,s=e[0]+"";for(;rf^n?1:-1;u=(a=i.length)<(f=s.length)?a:f;for(o=0;os[o]^n?1:-1;return a==f?0:a>f^n?1:-1}function S(e,t,n){return(e=k(e))>=t&&e<=n}function x(e){return Object.prototype.toString.call(e)=="[object Array]"}function T(e,t,n){var r,i=[0],s,o=0,u=e.length;for(;on-1&&(i[r+1]==null&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function N(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function C(e,t){var n,r;if(t<0){for(r="0.";++t;r+="0");e=r+e}else{n=e.length;if(++t>n){for(r="0",t-=n;--t;r+="0");e+=r}else t2&&e.substr(0,2)==="0x"&&(e=e.substr(2)),e=r.enc.Hex.parse(e)),i(e,{outputLength:256}).toString()}},{"crypto-js":61,"crypto-js/sha3":82}],24:[function(e,t,n){var r=e("bignumber.js"),i=e("utf8"),s={wei:"1",kwei:"1000",ada:"1000",femtoether:"1000",mwei:"1000000",babbage:"1000000",picoether:"1000000",gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},o=function(e,t,n){return(new Array(t-e.length+1)).join(n?n:"0")+e},u=function(e,t,n){return e+(new Array(t-e.length+1)).join(n?n:"0")},a=function(e){var t="",n=0,r=e.length;e.substring(0,2)==="0x"&&(n=2);for(;n50){i.stopWatching(),r=!0;if(!t)throw new Error("Contract transaction couldn't be found after 50 blocks");t(new Error("Contract transaction couldn't be found after 50 blocks"))}else e._eth.getTransactionReceipt(e.transactionHash,function(n,s){s&&!r&&e._eth.getCode(s.contractAddress,function(n,o){if(r||!o)return;i.stopWatching(),r=!0;if(o.length>2)e.address=s.contractAddress,f(e),l(e),t&&t(null,e);else{if(!t)throw new Error("The contract code couldn't be stored, please check your gas amount.");t(new Error("The contract code couldn't be stored, please check your gas amount."))}})})}})},h=function(e,t){this.eth=e,this.abi=t,this.new.getData=this.getData.bind(this)};h.prototype.new=function(){var e=new p(this.eth,this.abi),t={},n,i=Array.prototype.slice.call(arguments);r.isFunction(i[i.length-1])&&(n=i.pop());var s=i[i.length-1];r.isObject(s)&&!r.isArray(s)&&(t=i.pop());var o=a(this.abi,i);t.data+=o;if(n)this.eth.sendTransaction(t,function(t,r){t?n(t):(e.transactionHash=r,n(null,e),c(e,n))});else{var u=this.eth.sendTransaction(t);e.transactionHash=u,c(e)}return e},h.prototype.at=function(e,t){var n=new p(this.eth,this.abi,e);return f(n),l(n),t&&t(null,n),n},h.prototype.getData=function(){var e={},t=Array.prototype.slice.call(arguments),n=t[t.length-1];r.isObject(n)&&!r.isArray(n)&&(e=t.pop());var i=a(this.abi,t);return e.data+=i,e.data};var p=function(e,t,n){this._eth=e,this.transactionHash=null,this.address=n,this.abi=t};t.exports=h},{"../solidity/coder":11,"../utils/utils":24,"./allevents":27,"./event":31,"./function":35}],30:[function(e,t,n){t.exports={InvalidNumberOfParams:function(){return new Error("Invalid number of input parameters")},InvalidConnection:function(e){return new Error("CONNECTION ERROR: Couldn't connect to node "+e+".")},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(e){var t=!e||!e.error||!e.error.message?"Invalid JSON RPC response: "+JSON.stringify(e):e.error.message;return new Error(t)}}},{}],31:[function(e,t,n){var r=e("../utils/utils"),i=e("../solidity/coder"),s=e("./formatters"),o=e("../utils/sha3"),u=e("./filter"),a=e("./methods/watches"),f=function(e,t,n){this._requestManager=e,this._params=t.inputs,this._name=r.transformToFullName(t),this._address=n,this._anonymous=t.anonymous};f.prototype.types=function(e){return this._params.filter(function(t){return t.indexed===e}).map(function(e){return e.type})},f.prototype.displayName=function(){return r.extractDisplayName(this._name)},f.prototype.typeName=function(){return r.extractTypeName(this._name)},f.prototype.signature=function(){return o(this._name)},f.prototype.encode=function(e,t){e=e||{},t=t||{};var n={};["fromBlock","toBlock"].filter(function(e){return t[e]!==undefined}).forEach(function(e){n[e]=s.inputBlockNumberFormatter(t[e])}),n.topics=[],n.address=this._address,this._anonymous||n.topics.push("0x"+this.signature());var o=this._params.filter(function(e){return e.indexed===!0}).map(function(t){var n=e[t.name];return n===undefined||n===null?null:r.isArray(n)?n.map(function(e){return"0x"+i.encodeParam(t.type,e)}):"0x"+i.encodeParam(t.type,n)});return n.topics=n.topics.concat(o),n},f.prototype.decode=function(e){e.data=e.data||"",e.topics=e.topics||[];var t=this._anonymous?e.topics:e.topics.slice(1),n=t.map(function(e){return e.slice(2)}).join(""),r=i.decodeParams(this.types(!0),n),o=e.data.slice(2),u=i.decodeParams(this.types(!1),o),a=s.outputLogFormatter(e);return a.event=this.displayName(),a.address=e.address,a.args=this._params.reduce(function(e,t){return e[t.name]=t.indexed?r.shift():u.shift(),e},{}),delete a.data,delete a.topics,a},f.prototype.execute=function(e,t,n){r.isFunction(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],arguments.length===2&&(t=null),arguments.length===1&&(t=null,e={}));var i=this.encode(e,t),s=this.decode.bind(this);return new u(this._requestManager,i,a.eth(),s,n)},f.prototype.attachToContract=function(e){var t=this.execute.bind(this),n=this.displayName();e[n]||(e[n]=t),e[n][this.typeName()]=this.execute.bind(this,e)},t.exports=f},{"../solidity/coder":11,"../utils/sha3":23,"../utils/utils":24,"./filter":33,"./formatters":34,"./methods/watches":45}],32:[function(e,t,n){var r=e("./formatters"),i=e("./../utils/utils"),s=e("./method"),o=e("./property"),u=function(e){var t=function(t){var n;t.property?(e[t.property]||(e[t.property]={}),n=e[t.property]):n=e,t.methods&&t.methods.forEach(function(t){t.attachToObject(n),t.setRequestManager(e._requestManager)}),t.properties&&t.properties.forEach(function(t){t.attachToObject(n),t.setRequestManager(e._requestManager)})};return t.formatters=r,t.utils=i,t.Method=s,t.Property=o,t};t.exports=u},{"./../utils/utils":24,"./formatters":34,"./method":40,"./property":47}],33:[function(e,t,n){var r=e("./formatters"),i=e("../utils/utils"),s=function(e){return e===null||typeof e=="undefined"?null:(e=String(e),e.indexOf("0x")===0?e:i.fromUtf8(e))},o=function(e){return i.isString(e)?e:(e=e||{},e.topics=e.topics||[],e.topics=e.topics.map(function(e){return i.isArray(e)?e.map(s):s(e)}),{topics:e.topics,to:e.to,address:e.address,fromBlock:r.inputBlockNumberFormatter(e.fromBlock),toBlock:r.inputBlockNumberFormatter(e.toBlock)})},u=function(e,t){i.isString(e.options)||e.get(function(e,n){e&&t(e),i.isArray(n)&&n.forEach(function(e){t(null,e)})})},a=function(e){var t=function(t,n){if(t)return e.callbacks.forEach(function(e){e(t)});i.isArray(n)&&n.forEach(function(t){t=e.formatter?e.formatter(t):t,e.callbacks.forEach(function(e){e(null,t)})})};e.requestManager.startPolling({method:e.implementation.poll.call,params:[e.filterId]},e.filterId,t,e.stopWatching.bind(e))},f=function(e,t,n,r,i){var s=this,f={};return n.forEach(function(t){t.setRequestManager(e),t.attachToObject(f)}),this.requestManager=e,this.options=o(t),this.implementation=f,this.filterId=null,this.callbacks=[],this.getLogsCallbacks=[],this.pollFilters=[],this.formatter=r,this.implementation.newFilter(this.options,function(e,t){if(e)s.callbacks.forEach(function(t){t(e)});else{s.filterId=t,s.getLogsCallbacks.forEach(function(e){s.get(e)}),s.getLogsCallbacks=[],s.callbacks.forEach(function(e){u(s,e)}),s.callbacks.length>0&&a(s);if(i)return s.watch(i)}}),this};f.prototype.watch=function(e){return this.callbacks.push(e),this.filterId&&(u(this,e),a(this)),this},f.prototype.stopWatching=function(){this.requestManager.stopPolling(this.filterId),this.implementation.uninstallFilter(this.filterId,function(){}),this.callbacks=[]},f.prototype.get=function(e){var t=this;if(!i.isFunction(e)){if(this.filterId===null)throw new Error("Filter ID Error: filter().get() can't be chained synchronous, please provide a callback for the get() method.");var n=this.implementation.getLogs(this.filterId);return n.map(function(e){return t.formatter?t.formatter(e):e})}return this.filterId===null?this.getLogsCallbacks.push(e):this.implementation.getLogs(this.filterId,function(n,r){n?e(n):e(null,r.map(function(e){return t.formatter?t.formatter(e):e}))}),this},t.exports=f},{"../utils/utils":24,"./formatters":34}],34:[function(e,t,n){var r=e("../utils/utils"),i=e("../utils/config"),s=e("./iban"),o=function(e){return r.toBigNumber(e)},u=function(e){return e==="latest"||e==="pending"||e==="earliest"},a=function(e){return e===undefined?i.defaultBlock:f(e)},f=function(e){return e===undefined?undefined:u(e)?e:r.toHex(e)},l=function(e){return e.from=e.from||i.defaultAccount,e.from&&(e.from=y(e.from)),e.to&&(e.to=y(e.to)),["gasPrice","gas","value","nonce"].filter(function(t){return e[t]!==undefined}).forEach(function(t){e[t]=r.fromDecimal(e[t])}),e},c=function(e){return e.from=e.from||i.defaultAccount,e.from=y(e.from),e.to&&(e.to=y(e.to)),["gasPrice","gas","value","nonce"].filter(function(t){return e[t]!==undefined}).forEach(function(t){e[t]=r.fromDecimal(e[t])}),e},h=function(e){return e.blockNumber!==null&&(e.blockNumber=r.toDecimal(e.blockNumber)),e.transactionIndex!==null&&(e.transactionIndex=r.toDecimal(e.transactionIndex)),e.nonce=r.toDecimal(e.nonce),e.gas=r.toDecimal(e.gas),e.gasPrice=r.toBigNumber(e.gasPrice),e.value=r.toBigNumber(e.value),e},p=function(e){return e.blockNumber!==null&&(e.blockNumber=r.toDecimal(e.blockNumber)),e.transactionIndex!==null&&(e.transactionIndex=r.toDecimal(e.transactionIndex)),e.cumulativeGasUsed=r.toDecimal(e.cumulativeGasUsed),e.gasUsed=r.toDecimal(e.gasUsed),r.isArray(e.logs)&&(e.logs=e.logs.map(function(e){return v(e)})),e},d=function(e){return e.gasLimit=r.toDecimal(e.gasLimit),e.gasUsed=r.toDecimal(e.gasUsed),e.size=r.toDecimal(e.size),e.timestamp=r.toDecimal(e.timestamp),e.number!==null&&(e.number=r.toDecimal(e.number)),e.difficulty=r.toBigNumber(e.difficulty),e.totalDifficulty=r.toBigNumber(e.totalDifficulty),r.isArray(e.transactions)&&e.transactions.forEach(function(e){if(!r.isString(e))return h(e)}),e},v=function(e){return e.blockNumber!==null&&(e.blockNumber=r.toDecimal(e.blockNumber)),e.transactionIndex!==null&&(e.transactionIndex=r.toDecimal(e.transactionIndex)),e.logIndex!==null&&(e.logIndex=r.toDecimal(e.logIndex)),e},m=function(e){return e.payload=r.toHex(e.payload),e.ttl=r.fromDecimal(e.ttl),e.workToProve=r.fromDecimal(e.workToProve),e.priority=r.fromDecimal(e.priority),r.isArray(e.topics)||(e.topics=e.topics?[e.topics]:[]),e.topics=e.topics.map(function(e){return r.fromUtf8(e)}),e},g=function(e){return e.expiry=r.toDecimal(e.expiry),e.sent=r.toDecimal(e.sent),e.ttl=r.toDecimal(e.ttl),e.workProved=r.toDecimal(e.workProved),e.payloadRaw=e.payload,e.payload=r.toUtf8(e.payload),r.isJson(e.payload)&&(e.payload=JSON.parse(e.payload)),e.topics||(e.topics=[]),e.topics=e.topics.map(function(e){return r.toUtf8(e)}),e},y=function(e){var t=new s(e);if(t.isValid()&&t.isDirect())return"0x"+t.address();if(r.isStrictAddress(e))return e;if(r.isAddress(e))return"0x"+e;throw"invalid address"},b=function(e){return e.startingBlock=r.toDecimal(e.startingBlock),e.currentBlock=r.toDecimal(e.currentBlock),e.highestBlock=r.toDecimal(e.highestBlock),e};t.exports={inputDefaultBlockNumberFormatter:a,inputBlockNumberFormatter:f,inputCallFormatter:l,inputTransactionFormatter:c,inputAddressFormatter:y,inputPostFormatter:m,outputBigNumberFormatter:o,outputTransactionFormatter:h,outputTransactionReceiptFormatter:p,outputBlockFormatter:d,outputLogFormatter:v,outputPostFormatter:g,outputSyncingFormatter:b}},{"../utils/config":22,"../utils/utils":24,"./iban":37}],35:[function(e,t,n){var r=e("../solidity/coder"),i=e("../utils/utils"),s=e("./formatters"),o=e("../utils/sha3"),u=function(e,t,n){this._eth=e,this._inputTypes=t.inputs.map(function(e){return e.type}),this._outputTypes=t.outputs.map(function(e){return e.type}),this._constant=t.constant,this._name=i.transformToFullName(t),this._address=n};u.prototype.extractCallback=function(e){if(i.isFunction(e[e.length-1]))return e.pop()},u.prototype.extractDefaultBlock=function(e){if(e.length>this._inputTypes.length&&!i.isObject(e[e.length-1]))return s.inputDefaultBlockNumberFormatter(e.pop())},u.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&i.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+r.encodeParams(this._inputTypes,e),t},u.prototype.signature=function(){return o(this._name).slice(0,8)},u.prototype.unpackOutput=function(e){if(!e)return;e=e.length>=2?e.slice(2):e;var t=r.decodeParams(this._outputTypes,e);return t.length===1?t[0]:t},u.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return e!==undefined}),t=this.extractCallback(e),n=this.extractDefaultBlock(e),r=this.toPayload(e);if(!t){var i=this._eth.call(r,n);return this.unpackOutput(i)}var s=this;this._eth.call(r,n,function(e,n){t(e,s.unpackOutput(n))})},u.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return e!==undefined}),t=this.extractCallback(e),n=this.toPayload(e);if(!t)return this._eth.sendTransaction(n);this._eth.sendTransaction(n,t)},u.prototype.estimateGas=function(){var e=Array.prototype.slice.call(arguments),t=this.extractCallback(e),n=this.toPayload(e);if(!t)return this._eth.estimateGas(n);this._eth.estimateGas(n,t)},u.prototype.getData=function(){var e=Array.prototype.slice.call(arguments),t=this.toPayload(e);return t.data},u.prototype.displayName=function(){return i.extractDisplayName(this._name)},u.prototype.typeName=function(){return i.extractTypeName(this._name)},u.prototype.request=function(){var e=Array.prototype.slice.call(arguments),t=this.extractCallback(e),n=this.toPayload(e),r=this.unpackOutput.bind(this);return{method:this._constant?"eth_call":"eth_sendTransaction",callback:t,params:[n],format:r}},u.prototype.execute=function(){var e=!this._constant;return e?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},u.prototype.attachToContract=function(e){var t=this.execute.bind(this);t.request=this.request.bind(this),t.call=this.call.bind(this),t.sendTransaction=this.sendTransaction.bind(this),t.estimateGas=this.estimateGas.bind(this),t.getData=this.getData.bind(this);var n=this.displayName();e[n]||(e[n]=t),e[n][this.typeName()]=t},t.exports=u},{"../solidity/coder":11,"../utils/sha3":23,"../utils/utils":24,"./formatters":34}],36:[function(e,t,n){"use strict";var r=e("./errors"),i;typeof Meteor!="undefined"&&Meteor.isServer?i=Npm.require("xmlhttprequest").XMLHttpRequest:typeof window!="undefined"&&window.XMLHttpRequest?i=window.XMLHttpRequest:i=e("xmlhttprequest").XMLHttpRequest;var s=function(e){this.host=e||"http://localhost:8545"};s.prototype.prepareRequest=function(e){var t=new i;return t.open("POST",this.host,e),t.setRequestHeader("Content-Type","application/json"),t},s.prototype.send=function(e){var t=this.prepareRequest(!1);try{t.send(JSON.stringify(e))}catch(n){throw r.InvalidConnection(this.host)}var i=t.responseText;try{i=JSON.parse(i)}catch(s){throw r.InvalidResponse(t.responseText)}return i},s.prototype.sendAsync=function(e,t){var n=this.prepareRequest(!0);n.onreadystatechange=function(){if(n.readyState===4){var e=n.responseText,i=null;try{e=JSON.parse(e)}catch(s){i=r.InvalidResponse(n.responseText)}t(i,e)}};try{n.send(JSON.stringify(e))}catch(i){t(r.InvalidConnection(this.host))}},s.prototype.isConnected=function(){try{return this.send({id:9999999999,jsonrpc:"2.0",method:"net_listening",params:[]}),!0}catch(e){return!1}},t.exports=s},{"./errors":30,xmlhttprequest:21}],37:[function(e,t,n){var r=e("bignumber.js"),i=function(e,t){var n=e;while(n.length=t&&r<=n?r-t+10:e}).join("")},o=function(e){var t=e,n;while(t.length>2)n=t.slice(0,9),t=parseInt(n,10)%97+t.slice(n.length);return parseInt(t,10)%97},u=function(e){this._iban=e};u.fromAddress=function(e){var t=new r(e,16),n=t.toString(36),s=i(n,15);return u.fromBban(s.toUpperCase())},u.fromBban=function(e){var t="XE",n=o(s(t+"00"+e)),r=("0"+(98-n)).slice(-2);return new u(t+r+e)},u.createIndirect=function(e){return u.fromBban("ETH"+e.institution+e.identifier)},u.isValid=function(e){var t=new u(e);return t.isValid()},u.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&o(s(this._iban))===1},u.prototype.isDirect=function(){return this._iban.length===34||this._iban.length===35},u.prototype.isIndirect=function(){return this._iban.length===20},u.prototype.checksum=function(){return this._iban.substr(2,2)},u.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},u.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},u.prototype.address=function(){if(this.isDirect()){var e=this._iban.substr(4),t=new r(e,36);return i(t.toString(16),20)}return""},u.prototype.toString=function(){return this._iban},t.exports=u},{"bignumber.js":52}],38:[function(e,t,n){"use strict";var r=e("../utils/utils"),i=e("./errors"),s=function(e,t){var n=this;this.responseCallbacks={},this.path=e,this.connection=t.connect({path:this.path}),this.connection.on("error",function(e){console.error("IPC Connection Error",e),n._timeout()}),this.connection.on("end",function(){n._timeout()}),this.connection.on("data",function(e){n._parseResponse(e.toString()).forEach(function(e){var t=null;r.isArray(e)?e.forEach(function(e){n.responseCallbacks[e.id]&&(t=e.id)}):t=e.id,n.responseCallbacks[t]&&(n.responseCallbacks[t](null,e),delete n.responseCallbacks[t])})})};s.prototype._parseResponse=function(e){var t=this,n=[],r=e.replace(/\}\{/g,"}|--|{").replace(/\}\]\[\{/g,"}]|--|[{").replace(/\}\[\{/g,"}|--|[{").replace(/\}\]\{/g,"}]|--|{").split("|--|");return r.forEach(function(e){t.lastChunk&&(e=t.lastChunk+e);var r=null;try{r=JSON.parse(e)}catch(s){t.lastChunk=e,clearTimeout(t.lastChunkTimeout),t.lastChunkTimeout=setTimeout(function(){throw t.timeout(),i.InvalidResponse(e)},15e3);return}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,r&&n.push(r)}),n},s.prototype._addResponseCallback=function(e,t){var n=e.id||e[0].id,r=e.method||e[0].method;this.responseCallbacks[n]=t,this.responseCallbacks[n].method=r},s.prototype._timeout=function(){for(var e in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(e)&&(this.responseCallbacks[e](i.InvalidConnection("on IPC")),delete this.responseCallbacks[e])},s.prototype.isConnected=function(){var e=this;return e.connection.writable||e.connection.connect({path:e.path}),!!this.connection.writable},s.prototype.send=function(e){if(this.connection.writeSync){var t;this.connection.writable||this.connection.connect({path:this.path});var n=this.connection.writeSync(JSON.stringify(e));try{t=JSON.parse(n)}catch(r){throw i.InvalidResponse(n)}return t}throw new Error('You tried to send "'+e.method+'" synchronously. Synchronous requests are not supported by the IPC provider.')},s.prototype.sendAsync=function(e,t){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(e)),this._addResponseCallback(e,t)},t.exports=s},{"../utils/utils":24,"./errors":30}],39:[function(e,t,n){var r=function(){if(arguments.callee._singletonInstance)return arguments.callee._singletonInstance;arguments.callee._singletonInstance=this,this.messageId=1};r.getInstance=function(){var e=new r;return e},r.prototype.toPayload=function(e,t){return e||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:e,params:t||[],id:this.messageId++}},r.prototype.isValidResponse=function(e){return!!e&&!e.error&&e.jsonrpc==="2.0"&&typeof e.id=="number"&&e.result!==undefined},r.prototype.toBatchPayload=function(e){var t=this;return e.map(function(e){return t.toPayload(e.method,e.params)})},t.exports=r},{}],40:[function(e,t,n){var r=e("../utils/utils"),i=e("./errors"),s=function(e){this.name=e.name,this.call=e.call,this.params=e.params||0,this.inputFormatter=e.inputFormatter,this.outputFormatter=e.outputFormatter,this.requestManager=null};s.prototype.setRequestManager=function(e){this.requestManager=e},s.prototype.getCall=function(e){return r.isFunction(this.call)?this.call(e):this.call},s.prototype.extractCallback=function(e){if(r.isFunction(e[e.length-1]))return e.pop()},s.prototype.validateArgs=function(e){if(e.length!==this.params)throw i.InvalidNumberOfParams()},s.prototype.formatInput=function(e){return this.inputFormatter?this.inputFormatter.map(function(t,n){return t?t(e[n]):e[n]}):e},s.prototype.formatOutput=function(e){return this.outputFormatter&&e?this.outputFormatter(e):e},s.prototype.toPayload=function(e){var t=this.getCall(e),n=this.extractCallback(e),r=this.formatInput(e);return this.validateArgs(r),{method:t,params:r,callback:n}},
-s.prototype.attachToObject=function(e){var t=this.buildCall();t.call=this.call;var n=this.name.split(".");n.length>1?(e[n[0]]=e[n[0]]||{},e[n[0]][n[1]]=t):e[n[0]]=t},s.prototype.buildCall=function(){var e=this,t=function(){var t=e.toPayload(Array.prototype.slice.call(arguments));return t.callback?e.requestManager.sendAsync(t,function(n,r){t.callback(n,e.formatOutput(r))}):e.formatOutput(e.requestManager.send(t))};return t.request=this.request.bind(this),t},s.prototype.request=function(){var e=this.toPayload(Array.prototype.slice.call(arguments));return e.format=this.formatOutput.bind(this),e},t.exports=s},{"../utils/utils":24,"./errors":30}],41:[function(e,t,n){var r=e("../method"),i=function(e){this._requestManager=e._requestManager;var t=this;s().forEach(function(n){n.attachToObject(t),n.setRequestManager(e._requestManager)})},s=function(){var e=new r({name:"putString",call:"db_putString",params:3}),t=new r({name:"getString",call:"db_getString",params:2}),n=new r({name:"putHex",call:"db_putHex",params:3}),i=new r({name:"getHex",call:"db_getHex",params:2});return[e,t,n,i]};t.exports=i},{"../method":40}],42:[function(e,t,n){"use strict";function w(e){this._requestManager=e._requestManager;var t=this;E().forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)}),S().forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)}),this.iban=p,this.sendIBANTransaction=d.bind(null,this)}var r=e("../formatters"),i=e("../../utils/utils"),s=e("../method"),o=e("../property"),u=e("../../utils/config"),a=e("../contract"),f=e("./watches"),l=e("../filter"),c=e("../syncing"),h=e("../namereg"),p=e("../iban"),d=e("../transfer"),v=function(e){return i.isString(e[0])&&e[0].indexOf("0x")===0?"eth_getBlockByHash":"eth_getBlockByNumber"},m=function(e){return i.isString(e[0])&&e[0].indexOf("0x")===0?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},g=function(e){return i.isString(e[0])&&e[0].indexOf("0x")===0?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},y=function(e){return i.isString(e[0])&&e[0].indexOf("0x")===0?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},b=function(e){return i.isString(e[0])&&e[0].indexOf("0x")===0?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"};Object.defineProperty(w.prototype,"defaultBlock",{get:function(){return u.defaultBlock},set:function(e){return u.defaultBlock=e,e}}),Object.defineProperty(w.prototype,"defaultAccount",{get:function(){return u.defaultAccount},set:function(e){return u.defaultAccount=e,e}});var E=function(){var e=new s({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[r.inputAddressFormatter,r.inputDefaultBlockNumberFormatter],outputFormatter:r.outputBigNumberFormatter}),t=new s({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[null,i.toHex,r.inputDefaultBlockNumberFormatter]}),n=new s({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[r.inputAddressFormatter,r.inputDefaultBlockNumberFormatter]}),o=new s({name:"getBlock",call:v,params:2,inputFormatter:[r.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:r.outputBlockFormatter}),u=new s({name:"getUncle",call:g,params:2,inputFormatter:[r.inputBlockNumberFormatter,i.toHex],outputFormatter:r.outputBlockFormatter}),a=new s({name:"getCompilers",call:"eth_getCompilers",params:0}),f=new s({name:"getBlockTransactionCount",call:y,params:1,inputFormatter:[r.inputBlockNumberFormatter],outputFormatter:i.toDecimal}),l=new s({name:"getBlockUncleCount",call:b,params:1,inputFormatter:[r.inputBlockNumberFormatter],outputFormatter:i.toDecimal}),c=new s({name:"getTransaction",call:"eth_getTransactionByHash",params:1,outputFormatter:r.outputTransactionFormatter}),h=new s({name:"getTransactionFromBlock",call:m,params:2,inputFormatter:[r.inputBlockNumberFormatter,i.toHex],outputFormatter:r.outputTransactionFormatter}),p=new s({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,outputFormatter:r.outputTransactionReceiptFormatter}),d=new s({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[null,r.inputDefaultBlockNumberFormatter],outputFormatter:i.toDecimal}),w=new s({name:"sendRawTransaction",call:"eth_sendRawTransaction",params:1,inputFormatter:[null]}),E=new s({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[r.inputTransactionFormatter]}),S=new s({name:"call",call:"eth_call",params:2,inputFormatter:[r.inputCallFormatter,r.inputDefaultBlockNumberFormatter]}),x=new s({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[r.inputCallFormatter],outputFormatter:i.toDecimal}),T=new s({name:"compile.solidity",call:"eth_compileSolidity",params:1}),N=new s({name:"compile.lll",call:"eth_compileLLL",params:1}),C=new s({name:"compile.serpent",call:"eth_compileSerpent",params:1}),k=new s({name:"submitWork",call:"eth_submitWork",params:3}),L=new s({name:"getWork",call:"eth_getWork",params:0});return[e,t,n,o,u,a,f,l,c,h,p,d,S,x,w,E,T,N,C,k,L]},S=function(){return[new o({name:"coinbase",getter:"eth_coinbase"}),new o({name:"mining",getter:"eth_mining"}),new o({name:"hashrate",getter:"eth_hashrate",outputFormatter:i.toDecimal}),new o({name:"syncing",getter:"eth_syncing",outputFormatter:r.outputSyncingFormatter}),new o({name:"gasPrice",getter:"eth_gasPrice",outputFormatter:r.outputBigNumberFormatter}),new o({name:"accounts",getter:"eth_accounts"}),new o({name:"blockNumber",getter:"eth_blockNumber",outputFormatter:i.toDecimal})]};w.prototype.contract=function(e){var t=new a(this,e);return t},w.prototype.filter=function(e,t){return new l(this._requestManager,e,f.eth(),r.outputLogFormatter,t)},w.prototype.namereg=function(){return this.contract(h.global.abi).at(h.global.address)},w.prototype.icapNamereg=function(){return this.contract(h.icap.abi).at(h.icap.address)},w.prototype.isSyncing=function(e){return new c(this._requestManager,e)},t.exports=w},{"../../utils/config":22,"../../utils/utils":24,"../contract":29,"../filter":33,"../formatters":34,"../iban":37,"../method":40,"../namereg":46,"../property":47,"../syncing":50,"../transfer":51,"./watches":45}],43:[function(e,t,n){var r=e("../../utils/utils"),i=e("../property"),s=function(e){this._requestManager=e._requestManager;var t=this;o().forEach(function(n){n.attachToObject(t),n.setRequestManager(e._requestManager)})},o=function(){return[new i({name:"listening",getter:"net_listening"}),new i({name:"peerCount",getter:"net_peerCount",outputFormatter:r.toDecimal})]};t.exports=s},{"../../utils/utils":24,"../property":47}],44:[function(e,t,n){var r=e("../method"),i=e("../formatters"),s=e("../filter"),o=e("./watches"),u=function(e){this._requestManager=e._requestManager;var t=this;a().forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)})};u.prototype.filter=function(e,t){return new s(this._requestManager,e,o.shh(),i.outputPostFormatter,t)};var a=function(){var e=new r({name:"post",call:"shh_post",params:1,inputFormatter:[i.inputPostFormatter]}),t=new r({name:"newIdentity",call:"shh_newIdentity",params:0}),n=new r({name:"hasIdentity",call:"shh_hasIdentity",params:1}),s=new r({name:"newGroup",call:"shh_newGroup",params:0}),o=new r({name:"addToGroup",call:"shh_addToGroup",params:0});return[e,t,n,s,o]};t.exports=u},{"../filter":33,"../formatters":34,"../method":40,"./watches":45}],45:[function(e,t,n){var r=e("../method"),i=function(){var e=function(e){var t=e[0];switch(t){case"latest":return e.shift(),this.params=0,"eth_newBlockFilter";case"pending":return e.shift(),this.params=0,"eth_newPendingTransactionFilter";default:return"eth_newFilter"}},t=new r({name:"newFilter",call:e,params:1}),n=new r({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),i=new r({name:"getLogs",call:"eth_getFilterLogs",params:1}),s=new r({name:"poll",call:"eth_getFilterChanges",params:1});return[t,n,i,s]},s=function(){var e=new r({name:"newFilter",call:"shh_newFilter",params:1}),t=new r({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),n=new r({name:"getLogs",call:"shh_getMessages",params:1}),i=new r({name:"poll",call:"shh_getFilterChanges",params:1});return[e,t,n,i]};t.exports={eth:i,shh:s}},{"../method":40}],46:[function(e,t,n){var r=e("../contracts/GlobalRegistrar.json"),i=e("../contracts/ICAPRegistrar.json"),s="0xc6d9d2cd449a754c494264e1809c50e34d64562b",o="0xa1a111bc074c9cfa781f0c38e63bd51c91b8af00";t.exports={global:{abi:r,address:s},icap:{abi:i,address:o}}},{"../contracts/GlobalRegistrar.json":5,"../contracts/ICAPRegistrar.json":6}],47:[function(e,t,n){var r=e("../utils/utils"),i=function(e){this.name=e.name,this.getter=e.getter,this.setter=e.setter,this.outputFormatter=e.outputFormatter,this.inputFormatter=e.inputFormatter,this.requestManager=null};i.prototype.setRequestManager=function(e){this.requestManager=e},i.prototype.formatInput=function(e){return this.inputFormatter?this.inputFormatter(e):e},i.prototype.formatOutput=function(e){return this.outputFormatter&&e!==null?this.outputFormatter(e):e},i.prototype.extractCallback=function(e){if(r.isFunction(e[e.length-1]))return e.pop()},i.prototype.attachToObject=function(e){var t={get:this.buildGet()},n=this.name.split("."),r=n[0];n.length>1&&(e[n[0]]=e[n[0]]||{},e=e[n[0]],r=n[1]),Object.defineProperty(e,r,t),e[s(r)]=this.buildAsyncGet()};var s=function(e){return"get"+e.charAt(0).toUpperCase()+e.slice(1)};i.prototype.buildGet=function(){var e=this;return function(){return e.formatOutput(e.requestManager.send({method:e.getter}))}},i.prototype.buildAsyncGet=function(){var e=this,t=function(t){e.requestManager.sendAsync({method:e.getter},function(n,r){t(n,e.formatOutput(r))})};return t.request=this.request.bind(this),t},i.prototype.request=function(){var e={method:this.getter,params:[],callback:this.extractCallback(Array.prototype.slice.call(arguments))};return e.format=this.formatOutput.bind(this),e},t.exports=i},{"../utils/utils":24}],48:[function(e,t,n){var r=e("./jsonrpc"),i=e("../utils/utils"),s=e("../utils/config"),o=e("./errors"),u=function(e){this.provider=e,this.polls={},this.timeout=null};u.prototype.send=function(e){if(!this.provider)return console.error(o.InvalidProvider()),null;var t=r.getInstance().toPayload(e.method,e.params),n=this.provider.send(t);if(!r.getInstance().isValidResponse(n))throw o.InvalidResponse(n);return n.result},u.prototype.sendAsync=function(e,t){if(!this.provider)return t(o.InvalidProvider());var n=r.getInstance().toPayload(e.method,e.params);this.provider.sendAsync(n,function(e,n){if(e)return t(e);if(!r.getInstance().isValidResponse(n))return t(o.InvalidResponse(n));t(null,n.result)})},u.prototype.sendBatch=function(e,t){if(!this.provider)return t(o.InvalidProvider());var n=r.getInstance().toBatchPayload(e);this.provider.sendAsync(n,function(e,n){if(e)return t(e);if(!i.isArray(n))return t(o.InvalidResponse(n));t(e,n)})},u.prototype.setProvider=function(e){this.provider=e},u.prototype.startPolling=function(e,t,n,r){this.polls[t]={data:e,id:t,callback:n,uninstall:r},this.timeout||this.poll()},u.prototype.stopPolling=function(e){delete this.polls[e],Object.keys(this.polls).length===0&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},u.prototype.reset=function(e){for(var t in this.polls)if(!e||t.indexOf("syncPoll_")===-1)this.polls[t].uninstall(),delete this.polls[t];Object.keys(this.polls).length===0&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},u.prototype.poll=function(){this.timeout=setTimeout(this.poll.bind(this),s.ETH_POLLING_TIMEOUT);if(Object.keys(this.polls).length===0)return;if(!this.provider){console.error(o.InvalidProvider());return}var e=[],t=[];for(var n in this.polls)e.push(this.polls[n].data),t.push(n);if(e.length===0)return;var u=r.getInstance().toBatchPayload(e),a={};u.forEach(function(e,n){a[e.id]=t[n]});var f=this;this.provider.sendAsync(u,function(e,t){if(e)return;if(!i.isArray(t))throw o.InvalidResponse(t);t.map(function(e){var t=a[e.id];return f.polls[t]?(e.callback=f.polls[t].callback,e):!1}).filter(function(e){return!!e}).filter(function(e){var t=r.getInstance().isValidResponse(e);return t||e.callback(o.InvalidResponse(e)),t}).forEach(function(e){e.callback(null,e.result)})})},t.exports=u},{"../utils/config":22,"../utils/utils":24,"./errors":30,"./jsonrpc":39}],49:[function(e,t,n){var r=function(){this.defaultBlock="latest",this.defaultAccount=undefined};t.exports=r},{}],50:[function(e,t,n){var r=e("./formatters"),i=e("../utils/utils"),s=1,o=function(e){var t=function(t,n){if(t)return e.callbacks.forEach(function(e){e(t)});i.isObject(n)&&n.startingBlock&&(n=r.outputSyncingFormatter(n)),e.callbacks.forEach(function(t){e.lastSyncState!==n&&(!e.lastSyncState&&i.isObject(n)&&t(null,!0),setTimeout(function(){t(null,n)},0),e.lastSyncState=n)})};e.requestManager.startPolling({method:"eth_syncing",params:[]},e.pollId,t,e.stopWatching.bind(e))},u=function(e,t){return this.requestManager=e,this.pollId="syncPoll_"+s++,this.callbacks=[],this.addCallback(t),this.lastSyncState=!1,o(this),this};u.prototype.addCallback=function(e){return e&&this.callbacks.push(e),this},u.prototype.stopWatching=function(){this.requestManager.stopPolling(this.pollId),this.callbacks=[]},t.exports=u},{"../utils/utils":24,"./formatters":34}],51:[function(e,t,n){var r=e("./iban"),i=e("../contracts/SmartExchange.json"),s=function(e,t,n,i,s){var a=new r(n);if(!a.isValid())throw new Error("invalid iban address");if(a.isDirect())return o(e,t,a.address(),i,s);if(!s){var f=e.icapNamereg().addr(a.institution());return u(e,t,f,i,a.client())}e.icapNamereg().addr(a.institution(),function(n,r){return u(e,t,r,i,a.client(),s)})},o=function(e,t,n,r,i){return e.sendTransaction({address:n,from:t,value:r},i)},u=function(e,t,n,r,s,o){var u=i;return e.contract(u).at(n).deposit(s,{from:t,value:r},o)};t.exports=s},{"../contracts/SmartExchange.json":7,"./iban":37}],52:[function(e,t,n){(function(n){"use strict";function b(e){function U(e,t){var r,i,u,a,f,l,p=this;if(!(p instanceof U))return B&&J(26,"constructor call without new",e),new U(e,t);if(t==null||!j(t,2,64,n,"base")){if(e instanceof U){p.s=e.s,p.e=e.e,p.c=(e=e.c)?e.slice():e,n=0;return}if((a=typeof e=="number")&&e*0==0){p.s=1/e<0?(e=-e,-1):1;if(e===~~e){for(i=0,u=e;u>=10;u/=10,i++);p.e=i,p.c=[e],n=0;return}l=e+""}else{if(!o.test(l=e+""))return s(p,l,a);p.s=l.charCodeAt(0)===45?(l=l.slice(1),-1):1}}else{t|=0,l=e+"";if(t==10)return p=new U(e instanceof U?e:l),K(p,O+p.e+1,M);if((a=typeof e=="number")&&e*0!=0||!(new RegExp("^-?"+(r="["+h.slice(0,t)+"]+")+"(?:\\."+r+")?$",t<37?"i":"")).test(l))return s(p,l,a,t);a?(p.s=1/e<0?(l=l.slice(1),-1):1,B&&l.replace(/^0\.0*|\./,"").length>15&&J(n,c,e),a=!1):p.s=l.charCodeAt(0)===45?(l=l.slice(1),-1):1,l=z(l,10,t,p.s)}(i=l.indexOf("."))>-1&&(l=l.replace(".","")),(u=l.search(/e/i))>0?(i<0&&(i=u),i+=+l.slice(u+1),l=l.substring(0,u)):i<0&&(i=l.length);for(u=0;l.charCodeAt(u)===48;u++);for(f=l.length;l.charCodeAt(--f)===48;);l=l.slice(u,f+1);if(l){f=l.length,a&&B&&f>15&&J(n,c,p.s*e),i=i-u-1;if(i>H)p.c=p.e=null;else if(i=0&&(u=q,q=0,e=e.replace(".",""),c=new U(r),f=c.pow(e.length-p),q=u,c.c=N(k(E(f.c),f.e),10,n),c.e=c.c.length),l=N(e,r,n),o=u=l.length;for(;l[--u]==0;l.pop());if(!l[0])return"0";p<0?--o:(f.c=l,f.e=o,f.s=i,f=t(f,c,d,v,n),l=f.c,a=f.r,o=f.e),s=o+d+1,p=l[s],u=n/2,a=a||s<0||l[s+1]!=null,a=v<4?(p!=null||a)&&(v==0||v==(f.s<0?3:2)):p>u||p==u&&(v==4||a||v==6&&l[s-1]&1||v==(f.s<0?8:7));if(s<1||!l[0])e=a?k("1",-d):"0";else{l.length=s;if(a)for(--n;++l[--s]>n;)l[s]=0,s||(++o,l.unshift(1));for(u=l.length;!l[--u];);for(p=0,e="";p<=u;e+=h.charAt(l[p++]));e=k(e,o)}return e}function W(e,t,n,r){var i,s,o,u,a;n=n!=null&&j(n,0,8,r,l)?n|0:M;if(!e.c)return e.toString();i=e.c[0],o=e.e;if(t==null)a=E(e.c),a=r==19||r==24&&o<=_?C(a,o):k(a,o);else{e=K(new U(e),t,n),s=e.e,a=E(e.c),u=a.length;if(r==19||r==24&&(t<=s||s<=_)){for(;uu){if(--t>0)for(a+=".";t--;a+="0");}else{t+=s-u;if(t>0){s+1==u&&(a+=".");for(;t--;a+="0");}}}}return e.s<0&&i?"-"+a:a}function X(e,t){var n,r,i=0;T(e[0])&&(e=e[0]),n=new U(e[0]);for(;++in||e!=L(e))&&J(r,(i||"decimal places")+(en?" out of range":" not an integer"),e),!0}function $(e,t,n){var r=1,i=t.length;for(;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*d-1)>H?e.c=e.e=null:n=10;f/=10,i++);s=t-i;if(s<0)s+=d,o=t,l=v[c=0],h=l/g[i-o-1]%10|0;else{c=u((s+1)/d);if(c>=v.length){if(!r)break e;for(;v.length<=c;v.push(0));l=h=0,i=1,s%=d,o=s-d+1}else{l=f=v[c];for(i=1;f>=10;f/=10,i++);s%=d,o=s-d+i,h=o<0?0:l/g[i-o-1]%10|0}}r=r||t<0||v[c+1]!=null||(o<0?l:l%g[i-o-1]),r=n<4?(h||r)&&(n==0||n==(e.s<0?3:2)):h>5||h==5&&(n==4||r||n==6&&(s>0?o>0?l/g[i-o]:0:v[c-1])%10&1||n==(e.s<0?8:7));if(t<1||!v[0])return v.length=0,r?(t-=e.e+1,v[0]=g[t%d],e.e=-t||0):v[0]=e.e=0,e;s==0?(v.length=c,f=1,c--):(v.length=c+1,f=g[d-s],v[c]=o>0?a(l/g[i-o]%g[o])*f:0);if(r)for(;;){if(c==0){for(s=1,o=v[0];o>=10;o/=10,s++);o=v[0]+=f;for(f=1;o>=10;o/=10,f++);s!=f&&(e.e++,v[0]==p&&(v[0]=1));break}v[c]+=f;if(v[c]!=p)break;v[c--]=0,f=1}for(s=v.length;v[--s]===0;v.pop());}e.e>H?e.c=e.e=null:e.er)return(e=o[r++])!=null};return a(t="DECIMAL_PLACES")&&j(e,0,y,2,t)&&(O=e|0),s[t]=O,a(t="ROUNDING_MODE")&&j(e,0,8,2,t)&&(M=e|0),s[t]=M,a(t="EXPONENTIAL_AT")&&(T(e)?j(e[0],-y,0,2,t)&&j(e[1],0,y,2,t)&&(_=e[0]|0,D=e[1]|0):j(e,-y,y,2,t)&&(_=-(D=(e<0?-e:e)|0))),s[t]=[_,D],a(t="RANGE")&&(T(e)?j(e[0],-y,-1,2,t)&&j(e[1],1,y,2,t)&&(P=e[0]|0,H=e[1]|0):j(e,-y,y,2,t)&&(e|0?P=-(H=(e<0?-e:e)|0):B&&J(2,t+" cannot be zero",e))),s[t]=[P,H],a(t="ERRORS")&&(e===!!e||e===1||e===0?(n=0,j=(B=!!e)?V:x):B&&J(2,t+f,e)),s[t]=B,a(t="CRYPTO")&&(e===!!e||e===1||e===0?(F=!!e&&!!i&&typeof i=="object",e&&!F&&B&&J(2,"crypto unavailable",i)):B&&J(2,t+f,e)),s[t]=F,a(t="MODULO_MODE")&&j(e,0,9,2,t)&&(I=e|0),s[t]=I,a(t="POW_PRECISION")&&j(e,0,y,2,t)&&(q=e|0),s[t]=q,a(t="FORMAT")&&(typeof e=="object"?R=e:B&&J(2,t+" not an object",e)),s[t]=R,s},U.max=function(){return X(arguments,r.lt)},U.min=function(){return X(arguments,r.gt)},U.random=function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return a(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,s,o,f,l=0,c=[],h=new U(A);e=e==null||!j(e,0,y,14)?O:e|0,o=u(e/d);if(F)if(i&&i.getRandomValues){n=i.getRandomValues(new Uint32Array(o*=2));for(;l>>11),f>=9e15?(r=i.getRandomValues(new Uint32Array(2)),n[l]=r[0],n[l+1]=r[1]):(c.push(f%1e14),l+=2);l=o/2}else if(i&&i.randomBytes){n=i.randomBytes(o*=7);for(;l=9e15?i.randomBytes(7).copy(n,l):(c.push(f%1e14),l+=7);l=o/7}else B&&J(14,"crypto unavailable",i);if(!l)for(;l=10;f/=10,l++);lr?1:-1;else for(i=s=0;it[i]?1:-1;break}return s}function n(e,t,n,r){var i=0;for(;n--;)e[n]-=i,i=e[n]1;e.shift());}return function(r,i,s,o,u){var f,l,c,h,v,m,g,y,b,E,S,x,T,N,C,k,L,A=r.s==i.s?1:-1,O=r.c,M=i.c;if(!O||!O[0]||!M||!M[0])return new U(!r.s||!i.s||(O?M&&O[0]==M[0]:!M)?NaN:O&&O[0]==0||!M?A*0:A/0);y=new U(A),b=y.c=[],l=r.e-i.e,A=s+l+1,u||(u=p,l=w(r.e/d)-w(i.e/d),A=A/d|0);for(c=0;M[c]==(O[c]||0);c++);M[c]>(O[c]||0)&&l--;if(A<0)b.push(1),h=!0;else{N=O.length,k=M.length,c=0,A+=2,v=a(u/(M[0]+1)),v>1&&(M=e(M,v,u),O=e(O,v,u),k=M.length,N=O.length),T=k,E=O.slice(0,k),S=E.length;for(;S=u/2&&C++;do{v=0,f=t(M,E,k,S);if(f<0){x=E[0],k!=S&&(x=x*u+(E[1]||0)),v=a(x/C);if(v>1){v>=u&&(v=u-1),m=e(M,v,u),g=m.length,S=E.length;while(t(m,E,g,S)==1)v--,n(m,k=10;A/=10,c++);K(y,s+(y.e=c+l*d-1)+1,o,h)}else y.e=l,y.r=+h;return y}}(),s=function(){var e=/^(-?)0([xbo])/i,t=/^([^.]+)\.$/,r=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,s=/^\s*\+|^\s+|\s+$/g;return function(o,u,a,f){var l,c=a?u:u.replace(s,"");if(i.test(c))o.s=isNaN(c)?null:c<0?-1:1;else{if(!a){c=c.replace(e,function(e,t,n){return l=(n=n.toLowerCase())=="x"?16:n=="b"?2:8,!f||f==l?t:e}),f&&(l=f,c=c.replace(t,"$1").replace(r,"0.$1"));if(u!=c)return new U(c,l)}B&&J(n,"not a"+(f?" base "+f:"")+" number",u),o.s=null}o.c=o.e=null,n=0}}(),r.absoluteValue=r.abs=function(){var e=new U(this);return e.s<0&&(e.s=1),e},r.ceil=function(){return K(new U(this),this.e+1,2)},r.comparedTo=r.cmp=function(e,t){return n=1,S(this,new U(e,t))},r.decimalPlaces=r.dp=function(){var e,t,n=this.c;if(!n)return null;e=((t=n.length-1)-w(this.e/d))*d;if(t=n[t])for(;t%10==0;t/=10,e--);return e<0&&(e=0),e},r.dividedBy=r.div=function(e,r){return n=3,t(this,new U(e,r),O,M)},r.dividedToIntegerBy=r.divToInt=function(e,r){return n=4,t(this,new U(e,r),0,1)},r.equals=r.eq=function(e,t){return n=5,S(this,new U(e,t))===0},r.floor=function(){return K(new U(this),this.e+1,3)},r.greaterThan=r.gt=function(e,t){return n=6,S(this,new U(e,t))>0},r.greaterThanOrEqualTo=r.gte=function(e,t){return n=7,(t=S(this,new U(e,t)))===1||t===0},r.isFinite=function(){return!!this.c},r.isInteger=r.isInt=function(){return!!this.c&&w(this.e/d)>this.c.length-2},r.isNaN=function(){return!this.s},r.isNegative=r.isNeg=function(){return this.s<0},r.isZero=function(){return!!this.c&&this.c[0]==0},r.lessThan=r.lt=function(e,t){return n=8,S(this,new U(e,t))<0},r.lessThanOrEqualTo=r.lte=function(e,t){return n=9,(t=S(this,new U(e,t)))===-1||t===0},r.minus=r.sub=function(e,t){var r,i,s,o,u=this,a=u.s;n=10,e=new U(e,t),t=e.s;if(!a||!t)return new U(NaN);if(a!=t)return e.s=-t,u.plus(e);var f=u.e/d,l=e.e/d,c=u.c,h=e.c;if(!f||!l){if(!c||!h)return c?(e.s=-t,e):new U(h?u:NaN);if(!c[0]||!h[0])return h[0]?(e.s=-t,e):new U(c[0]?u:M==3?0:0)}f=w(f),l=w(l),c=c.slice();if(a=f-l){(o=a<0)?(a=-a,s=c):(l=f,s=h),s.reverse();for(t=a;t--;s.push(0));s.reverse()}else{i=(o=(a=c.length)<(t=h.length))?a:t;for(a=t=0;t0)for(;t--;c[r++]=0);t=p-1;for(;i>a;){if(c[--i]0?(u=o,r=f):(s=-s,r=a),r.reverse();for(;s--;r.push(0));r.reverse()}s=a.length,t=f.length,s-t<0&&(r=f,f=a,a=r,t=s);for(s=0;t;)s=(a[--t]=a[t]+f[t]+s)/p|0,a[t]%=p;return s&&(a.unshift(s),++u),$(e,a,u)},r.precision=r.sd=function(e){var t,n,r=this,i=r.c;e!=null&&e!==!!e&&e!==1&&e!==0&&(B&&J(13,"argument"+f,e),e!=!!e&&(e=null));if(!i)return null;n=i.length-1,t=n*d+1;if(n=i[n]){for(;n%10==0;n/=10,t--);for(n=i[0];n>=10;n/=10,t++);}return e&&r.e+1>t&&(t=r.e+1),t},r.round=function(e,t){var n=new U(this);return(e==null||j(e,0,y,15))&&K(n,~~e+this.e+1,t==null||!j(t,0,8,15,l)?M:t|0),n},r.shift=function(e){var t=this;return j(e,-v,v,16,"argument")?t.times("1e"+L(e)):new U(t.c&&t.c[0]&&(e<-v||e>v)?t.s*(e<0?0:1/0):t)},r.squareRoot=r.sqrt=function(){var e,n,r,i,s,o=this,u=o.c,a=o.s,f=o.e,l=O+4,c=new U("0.5");if(a!==1||!u||!u[0])return new U(!a||a<0&&(!u||u[0])?NaN:u?o:1/0);a=Math.sqrt(+o),a==0||a==1/0?(n=E(u),(n.length+f)%2==0&&(n+="0"),a=Math.sqrt(n),f=w((f+1)/2)-(f<0||f%2),a==1/0?n="1e"+f:(n=a.toExponential(),n=n.slice(0,n.indexOf("e")+1)+f),r=new U(n)):r=new U(a+"");if(r.c[0]){f=r.e,a=f+l,a<3&&(a=0);for(;;){s=r,r=c.times(s.plus(t(o,s,l,1)));if(E(s.c).slice(0,a)===(n=E(r.c)).slice(0,a)){r.e=0;){r=0,v=T[s]%E,m=T[s]/E|0;for(u=f,o=s+u;o>s;)l=x[--u]%E,c=x[u]/E|0,a=m*l+c*v,l=v*l+a%E*E+y[o]+r,r=(l/b|0)+(a/E|0)+m*c,y[o--]=l%b;y[o]=r}return r?++i:y.shift(),$(e,y,i)},r.toDigits=function(e,t){var n=new U(this);return e=e==null||!j(e,1,y,18,"precision")?null:e|0,t=t==null||!j(t,0,8,18,l)?M:t|0,e?K(n,e,t):n},r.toExponential=function(e,t){return W(this,e!=null&&j(e,0,y,19)?~~e+1:null,t,19)},r.toFixed=function(e,t){return W(this,e!=null&&j(e,0,y,20)?~~e+this.e+1:null,t,20)},r.toFormat=function(e,t){var n=W(this,e!=null&&j(e,0,y,21)?~~e+this.e+1:null,t,21);if(this.c){var r,i=n.split("."),s=+R.groupSize,o=+R.secondaryGroupSize,u=R.groupSeparator,a=i[0],f=i[1],l=this.s<0,c=l?a.slice(1):a,h=c.length;o&&(r=s,s=o,o=r,h-=r);if(s>0&&h>0){r=h%s||s,a=c.substr(0,r);for(;r0&&(a+=u+c.slice(r)),l&&(a="-"+a)}n=f?a+R.decimalSeparator+((o=+R.fractionGroupSize)?f.replace(new RegExp("\\d{"+o+"}\\B","g"),"$&"+R.fractionGroupSeparator):f):a}return n},r.toFraction=function(e){var n,r,i,s,o,u,a,f,l,c=B,h=this,p=h.c,v=new U(A),g=r=new U(A),y=a=new U(A);if(e!=null){B=!1,u=new U(e),B=c;if(!(c=u.isInt())||u.lt(A))B&&J(22,"max denominator "+(c?"out of range":"not an integer"),e),e=!c&&u.c&&K(u,u.e+1,1).gte(A)?u:null}if(!p)return h.toString();l=E(p),s=v.e=l.length-h.e-1,v.c[0]=m[(o=s%d)<0?d+o:o],e=!e||u.cmp(v)>0?s>0?v:g:u,o=H,H=1/0,u=new U(l),a.c[0]=0;for(;;){f=t(u,v,0,1),i=r.plus(f.times(y));if(i.cmp(e)==1)break;r=y,y=i,g=a.plus(f.times(i=g)),a=i,v=u.minus(f.times(i=v)),u=i}return i=t(e.minus(r),y,0,1),a=a.plus(i.times(g)),r=r.plus(i.times(y)),a.s=g.s=h.s,s*=2,n=t(g,y,s,M).minus(h).abs().cmp(t(a,r,s,M).minus(h).abs())<1?[g.toString(),y.toString()]:[a.toString(),r.toString()],H=o,n},r.toNumber=function(){var e=this;return+e||(e.s?e.s*0:NaN)},r.toPower=r.pow=function(e){var t,n,r=a(e<0?-e:+e),i=this;if(!j(e,-v,v,23,"exponent")&&(!isFinite(e)||r>v&&(e/=0)||parseFloat(e)!=e&&!(e=NaN)))return new U(Math.pow(+i,e));t=q?u(q/d+2):0,n=new U(A);for(;;){if(r%2){n=n.times(i);if(!n.c)break;t&&n.c.length>t&&(n.c.length=t)}r=a(r/2);if(!r)break;i=i.times(i),t&&i.c&&i.c.length>t&&(i.c.length=t)}return e<0&&(n=A.div(n)),t?K(n,q,M):n},r.toPrecision=function(e,t){return W(this,e!=null&&j(e,1,y,24,"precision")?e|0:null,t,24)},r.toString=function(e){var t,n=this,r=n.s,i=n.e;return i===null?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=E(n.c),e==null||!j(e,2,64,25,"base")?t=i<=_||i>=D?C(t,i):k(t,i):t=z(k(t,i),e|0,10,r),r<0&&n.c[0]&&(t="-"+t)),t},r.truncated=r.trunc=function(){return K(new U(this),this.e+1,1)},r.valueOf=r.toJSON=function(){return this.toString()},e!=null&&U.config(e),U}function w(e){var t=e|0;return e>0||e===t?t:t-1}function E(e){var t,n,r=1,i=e.length,s=e[0]+"";for(;rf^n?1:-1;u=(a=i.length)<(f=s.length)?a:f;for(o=0;os[o]^n?1:-1;return a==f?0:a>f^n?1:-1}function x(e,t,n){return(e=L(e))>=t&&e<=n}function T(e){return Object.prototype.toString.call(e)=="[object Array]"}function N(e,t,n){var r,i=[0],s,o=0,u=e.length;for(;on-1&&(i[r+1]==null&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function C(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t){var n,r;if(t<0){for(r="0.";++t;r+="0");e=r+e}else{n=e.length;if(++t>n){for(r="0",t-=n;--t;r+="0");e+=r}else t>>8^i&255^99,s[n]=i,o[i]=n;var v=e[n],m=e[v],g=e[m],y=e[i]*257^i*16843008;u[n]=y<<24|y>>>8,a[n]=y<<16|y>>>16,f[n]=y<<8|y>>>24,l[n]=y;var y=g*16843009^m*65537^v*257^n*16843008;c[i]=y<<24|y>>>8,h[i]=y<<16|y>>>16,p[i]=y<<8|y>>>24,d[i]=y,n?(n=v^e[e[e[g^v]]],r^=e[e[r]]):n=r=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],m=i.AES=r.extend({_doReset:function(){var e=this._key,t=e.words,n=e.sigBytes/4,r=this._nRounds=n+6,i=(r+1)*4,o=this._keySchedule=[];for(var u=0;u6&&u%n==4&&(a=s[a>>>24]<<24|s[a>>>16&255]<<16|s[a>>>8&255]<<8|s[a&255]):(a=a<<8|a>>>24,a=s[a>>>24]<<24|s[a>>>16&255]<<16|s[a>>>8&255]<<8|s[a&255],a^=v[u/n|0]<<24),o[u]=o[u-n]^a}var f=this._invKeySchedule=[];for(var l=0;l>>24]]^h[s[a>>>16&255]]^p[s[a>>>8&255]]^d[s[a&255]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,u,a,f,l,s)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,c,h,p,d,o);var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,s,o,u){var a=this._nRounds,f=e[t]^n[0],l=e[t+1]^n[1
-],c=e[t+2]^n[2],h=e[t+3]^n[3],p=4;for(var d=1;d>>24]^i[l>>>16&255]^s[c>>>8&255]^o[h&255]^n[p++],m=r[l>>>24]^i[c>>>16&255]^s[h>>>8&255]^o[f&255]^n[p++],g=r[c>>>24]^i[h>>>16&255]^s[f>>>8&255]^o[l&255]^n[p++],y=r[h>>>24]^i[f>>>16&255]^s[l>>>8&255]^o[c&255]^n[p++];f=v,l=m,c=g,h=y}var v=(u[f>>>24]<<24|u[l>>>16&255]<<16|u[c>>>8&255]<<8|u[h&255])^n[p++],m=(u[l>>>24]<<24|u[c>>>16&255]<<16|u[h>>>8&255]<<8|u[f&255])^n[p++],g=(u[c>>>24]<<24|u[h>>>16&255]<<16|u[f>>>8&255]<<8|u[l&255])^n[p++],y=(u[h>>>24]<<24|u[f>>>16&255]<<16|u[l>>>8&255]<<8|u[c&255])^n[p++];e[t]=v,e[t+1]=m,e[t+2]=g,e[t+3]=y},keySize:8});t.AES=r._createHelper(m)}(),e.AES})},{"./cipher-core":54,"./core":55,"./enc-base64":56,"./evpkdf":58,"./md5":63}],54:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,s=r.WordArray,o=r.BufferedBlockAlgorithm,u=n.enc,a=u.Utf8,f=u.Base64,l=n.algo,c=l.EvpKDF,h=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return typeof e=="string"?C:x}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()}),p=r.StreamCipher=h.extend({_doFinalize:function(){var e=this._process(!0);return e},blockSize:1}),d=n.mode={},v=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=d.CBC=function(){function n(e,n,r){var i=this._iv;if(i){var s=i;this._iv=t}else var s=this._prevBlock;for(var o=0;o>>2]&255;e.sigBytes-=t}},b=r.BlockCipher=h.extend({cfg:h.cfg.extend({mode:m,padding:y}),reset:function(){h.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else{var r=n.createDecryptor;this._minBufferSize=1}this._mode=r.call(n,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),w=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),E=n.format={},S=E.OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var r=s.create([1398893684,1701076831]).concat(n).concat(t);else var r=t;return r.toString(f)},parse:function(e){var t=f.parse(e),n=t.words;if(n[0]==1398893684&&n[1]==1701076831){var r=s.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return w.create({ciphertext:t,salt:r})}},x=r.SerializableCipher=i.extend({cfg:i.extend({format:S}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),s=i.finalize(t),o=i.cfg;return w.create({ciphertext:s,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=e.createDecryptor(n,r).finalize(t.ciphertext);return i},_parse:function(e,t){return typeof e=="string"?t.parse(e,this):e}}),T=n.kdf={},N=T.OpenSSL={execute:function(e,t,n,r){r||(r=s.random(8));var i=c.create({keySize:t+n}).compute(e,r),o=s.create(i.words.slice(t),n*4);return i.sigBytes=t*4,w.create({key:i,iv:o,salt:r})}},C=r.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:N}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=r.kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var s=x.encrypt.call(this,e,t,i.key,r);return s.mixIn(i),s},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);r.iv=i.iv;var s=x.decrypt.call(this,e,t,i.key,r);return s}})}()})},{"./core":55}],55:[function(e,t,n){(function(e,r){typeof n=="object"?t.exports=n=r():typeof define=="function"&&define.amd?define([],r):e.CryptoJS=r()})(this,function(){var e=e||function(e,t){var n={},r=n.lib={},i=r.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var n=new e;return t&&n.mixIn(t),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=r.WordArray=i.extend({init:function(e,n){e=this.words=e||[],n!=t?this.sigBytes=n:this.sigBytes=e.length*4},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;this.clamp();if(r%4)for(var s=0;s>>2]>>>24-s%4*8&255;t[r+s>>>2]|=o<<24-(r+s)%4*8}else for(var s=0;s>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){var n=[],r=function(t){var t=t,n=987654321,r=4294967295;return function(){n=36969*(n&65535)+(n>>16)&r,t=18e3*(t&65535)+(t>>16)&r;var i=(n<<16)+t&r;return i/=4294967296,i+=.5,i*(e.random()>.5?1:-1)}};for(var i=0,o;i>>2]>>>24-i%4*8&255;r.push((s>>>4).toString(16)),r.push((s&15).toString(16))}return r.join("")},parse:function(e){var t=e.length,n=[];for(var r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new s.init(n,t/2)}},a=o.Latin1={stringify:function(e){var t=e.words,n=e.sigBytes,r=[];for(var i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){var t=e.length,n=[];for(var r=0;r>>2]|=(e.charCodeAt(r)&255)<<24-r%4*8;return new s.init(n,t)}},f=o.Utf8={stringify:function(e){try{return decodeURIComponent(escape(a.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return a.parse(unescape(encodeURIComponent(e)))}},l=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){typeof e=="string"&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,u=o*4,a=i/u;t?a=e.ceil(a):a=e.max((a|0)-this._minBufferSize,0);var f=a*o,l=e.min(f*4,i);if(f){for(var c=0;c>>2]>>>24-s%4*8&255,u=t[s+1>>>2]>>>24-(s+1)%4*8&255,a=t[s+2>>>2]>>>24-(s+2)%4*8&255,f=o<<16|u<<8|a;for(var l=0;l<4&&s+l*.75>>6*(3-l)&63))}var c=r.charAt(64);if(c)while(i.length%4)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=n.charAt(64);if(i){var s=e.indexOf(i);s!=-1&&(t=s)}var o=[],u=0;for(var a=0;a>>6-a%4*2,c=f|l;o[u>>>2]|=c<<24-u%4*8,u++}return r.create(o,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64})},{"./core":55}],57:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(){function o(e){return e<<8&4278255360|e>>>8&16711935}var t=e,n=t.lib,r=n.WordArray,i=t.enc,s=i.Utf16=i.Utf16BE={stringify:function(e){var t=e.words,n=e.sigBytes,r=[];for(var i=0;i>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){var t=e.length,n=[];for(var i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return r.create(n,t*2)}};i.Utf16LE={stringify:function(e){var t=e.words,n=e.sigBytes,r=[];for(var i=0;i>>2]>>>16-i%4*8&65535);r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){var t=e.length,n=[];for(var i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return r.create(n,t*2)}}}(),e.enc.Utf16})},{"./core":55}],58:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./sha1"),e("./hmac")):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],i):i(r.CryptoJS)})(this,function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,s=t.algo,o=s.MD5,u=s.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){var n=this.cfg,r=n.hasher.create(),s=i.create(),o=s.words,u=n.keySize,a=n.iterations;while(o.lengthr&&(t=e.finalize(t)),t.clamp();var i=this._oKey=t.clone(),o=this._iKey=t.clone(),u=i.words,a=o.words;for(var f=0;f>>2]|=e[r]<<24-r%4*8;i.call(this,n,t)}else i.apply(this,arguments)};s.prototype=r}(),e.lib.WordArray})},{"./core":55}],63:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(t){function f(e,t,n,r,i,s,o){var u=e+(t&n|~t&r)+i+o;return(u<>>32-s)+t}function l(e,t,n,r,i,s,o){var u=e+(t&r|n&~r)+i+o;return(u<>>32-s)+t}function c(e,t,n,r,i,s,o){var u=e+(t^n^r)+i+o;return(u<>>32-s)+t}function h(e,t,n,r,i,s,o){var u=e+(n^(t|~r))+i+o;return(u<>>32-s)+t}var n=e,r=n.lib,i=r.WordArray,s=r.Hasher,o=n.algo,u=[];(function(){for(var e=0;e<64;e++)u[e]=t.abs(t.sin(e+1))*4294967296|0})();var a=o.MD5=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}var s=this._hash.words,o=e[t+0],a=e[t+1],p=e[t+2],d=e[t+3],v=e[t+4],m=e[t+5],g=e[t+6],y=e[t+7],b=e[t+8],w=e[t+9],E=e[t+10],S=e[t+11],x=e[t+12],N=e[t+13],C=e[t+14],k=e[t+15],L=s[0],A=s[1],O=s[2],M=s[3];L=f(L,A,O,M,o,7,u[0]),M=f(M,L,A,O,a,12,u[1]),O=f(O,M,L,A,p,17,u[2]),A=f(A,O,M,L,d,22,u[3]),L=f(L,A,O,M,v,7,u[4]),M=f(M,L,A,O,m,12,u[5]),O=f(O,M,L,A,g,17,u[6]),A=f(A,O,M,L,y,22,u[7]),L=f(L,A,O,M,b,7,u[8]),M=f(M,L,A,O,w,12,u[9]),O=f(O,M,L,A,E,17,u[10]),A=f(A,O,M,L,S,22,u[11]),L=f(L,A,O,M,x,7,u[12]),M=f(M,L,A,O,N,12,u[13]),O=f(O,M,L,A,C,17,u[14]),A=f(A,O,M,L,k,22,u[15]),L=l(L,A,O,M,a,5,u[16]),M=l(M,L,A,O,g,9,u[17]),O=l(O,M,L,A,S,14,u[18]),A=l(A,O,M,L,o,20,u[19]),L=l(L,A,O,M,m,5,u[20]),M=l(M,L,A,O,E,9,u[21]),O=l(O,M,L,A,k,14,u[22]),A=l(A,O,M,L,v,20,u[23]),L=l(L,A,O,M,w,5,u[24]),M=l(M,L,A,O,C,9,u[25]),O=l(O,M,L,A,d,14,u[26]),A=l(A,O,M,L,b,20,u[27]),L=l(L,A,O,M,N,5,u[28]),M=l(M,L,A,O,p,9,u[29]),O=l(O,M,L,A,y,14,u[30]),A=l(A,O,M,L,x,20,u[31]),L=c(L,A,O,M,m,4,u[32]),M=c(M,L,A,O,b,11,u[33]),O=c(O,M,L,A,S,16,u[34]),A=c(A,O,M,L,C,23,u[35]),L=c(L,A,O,M,a,4,u[36]),M=c(M,L,A,O,v,11,u[37]),O=c(O,M,L,A,y,16,u[38]),A=c(A,O,M,L,E,23,u[39]),L=c(L,A,O,M,N,4,u[40]),M=c(M,L,A,O,o,11,u[41]),O=c(O,M,L,A,d,16,u[42]),A=c(A,O,M,L,g,23,u[43]),L=c(L,A,O,M,w,4,u[44]),M=c(M,L,A,O,x,11,u[45]),O=c(O,M,L,A,k,16,u[46]),A=c(A,O,M,L,p,23,u[47]),L=h(L,A,O,M,o,6,u[48]),M=h(M,L,A,O,y,10,u[49]),O=h(O,M,L,A,C,15,u[50]),A=h(A,O,M,L,m,21,u[51]),L=h(L,A,O,M,x,6,u[52]),M=h(M,L,A,O,d,10,u[53]),O=h(O,M,L,A,E,15,u[54]),A=h(A,O,M,L,a,21,u[55]),L=h(L,A,O,M,b,6,u[56]),M=h(M,L,A,O,k,10,u[57]),O=h(O,M,L,A,g,15,u[58]),A=h(A,O,M,L,N,21,u[59]),L=h(L,A,O,M,v,6,u[60]),M=h(M,L,A,O,S,10,u[61]),O=h(O,M,L,A,p,15,u[62]),A=h(A,O,M,L,w,21,u[63]),s[0]=s[0]+L|0,s[1]=s[1]+A|0,s[2]=s[2]+O|0,s[3]=s[3]+M|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;n[i>>>5]|=128<<24-i%32;var s=t.floor(r/4294967296),o=r;n[(i+64>>>9<<4)+15]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,n[(i+64>>>9<<4)+14]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,e.sigBytes=(n.length+1)*4,this._process();var u=this._hash,a=u.words;for(var f=0;f<4;f++){var l=a[f];a[f]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360}return u},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});n.MD5=s._createHelper(a),n.HmacMD5=s._createHmacHelper(a)}(Math),e.MD5})},{"./core":55}],64:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return e.mode.CFB=function(){function n(e,t,n,r){var i=this._iv;if(i){var s=i.slice(0);this._iv=undefined}else var s=this._prevBlock;r.encryptBlock(s,0);for(var o=0;o>24&255)===255){var t=e>>16&255,n=e>>8&255,r=e&255;t===255?(t=0,n===255?(n=0,r===255?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}function r(e){return(e[0]=n(e[0]))===0&&(e[1]=n(e[1])),e}var t=e.lib.BlockCipherMode.extend(),i=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,s=this._iv,o=this._counter;s&&(o=this._counter=s.slice(0),this._iv=undefined),r(o);var u=o.slice(0);n.encryptBlock(u,0);for(var a=0;a>>2]|=i<<24-s%4*8,e.sigBytes+=i},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Ansix923})},{"./cipher-core":54,"./core":55}],70:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return e.pad.Iso10126={pad:function(t,n){var r=n*4,i=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Iso10126})},{"./cipher-core":54,"./core":55}],71:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})},{"./cipher-core":54,"./core":55}],72:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})},{"./cipher-core":54,"./core":55}],73:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=t*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;while(!(t[n>>>2]>>>24-n%4*8&255))n--;e.sigBytes=n+1}},e.pad.ZeroPadding})},{"./cipher-core":54,"./core":55}],74:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./sha1"),e("./hmac")):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],i):i(r.CryptoJS)})(this,function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,s=t.algo,o=s.SHA1,u=s.HMAC,a=s.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){var n=this.cfg,r=u.create(n.hasher,e),s=i.create(),o=i.create([1]),a=s.words,f=o.words,l=n.keySize,c=n.iterations;while(a.length>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16,a=((i*i>>>17)+i*s>>>15)+s*s,f=((r&4294901760)*r|0)+((r&65535)*r|0);u[n]=a^f}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}var t=e,n=t.lib,r=n.StreamCipher,i=t.algo,s=[],o=[],u=[],a=i.RabbitLegacy=r.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var i=0;i<4;i++)f.call(this);for(var i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var s=t.words,o=s[0],u=s[1],a=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,l=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,c=a>>>16|l&4294901760,h=l<<16|a&65535;r[0]^=a,r[1]^=c,r[2]^=l,r[3]^=h,r[4]^=a,r[5]^=c,r[6]^=l,r[7]^=h;for(var i=0;i<4;i++)f.call(this)}},_doProcessBlock:function(e,t){var n=this._X;f.call(this),s[0]=n[0]^n[5]>>>16^n[3]<<16,s[1]=n[2]^n[7]>>>16^n[5]<<16,s[2]=n[4]^n[1]>>>16^n[7]<<16,s[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)s[r]=(s[r]<<8|s[r]>>>24)&16711935|(s[r]<<24|s[r]>>>8)&4278255360,e[t+r]^=s[r]},blockSize:4,ivSize:2});t.RabbitLegacy=r._createHelper(a)}(),e.RabbitLegacy})},{"./cipher-core":54,"./core":55,"./enc-base64":56,"./evpkdf":58,"./md5":63}],76:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return function(){function f(){var e=this._X,t=this._C;for(var n=0;n<8;n++)o[n]=t[n];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16,a=((i*i>>>17)+i*s>>>15)+s*s,f=((r&4294901760)*r|0)+((r&65535)*r|0);u[n]=a^f}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}var t=e,n=t.lib,r=n.StreamCipher,i=t.algo,s=[],o=[],u=[],a=i.Rabbit=r.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv;for(var n=0;n<4;n++)e[n]=(e[n]<<8|e[n]>>>24)&16711935|(e[n]<<24|e[n]>>>8)&4278255360;var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var n=0;n<4;n++)f.call(this);for(var n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var s=t.words,o=s[0],u=s[1],a=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,l=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,c=a>>>16|l&4294901760,h=l<<16|a&65535;i[0]^=a,i[1]^=c,i[2]^=l,i[3]^=h,i[4]^=a,i[5]^=c,i[6]^=l,i[7]^=h;for(var n=0;n<4;n++)f.call(this)}},_doProcessBlock:function(e,t){var n=this._X;f.call(this),s[0]=n[0]^n[5]>>>16^n[3]<<16,s[1]=n[2]^n[7]>>>16^n[5]<<16,s[2]=n[4]^n[1]>>>16^n[7]<<16,s[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)s[r]=(s[r]<<8|s[r]>>>24)&16711935|(s[r]<<24|s[r]>>>8)&4278255360,e[t+r]^=s[r]},blockSize:4,ivSize:2});t.Rabbit=r._createHelper(a)}(),e.Rabbit})},{"./cipher-core":54,"./core":55,"./enc-base64":56,"./evpkdf":58,"./md5":63}],77:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return function(){function o(){var e=this._S,t=this._i,n=this._j,r=0;for(var i=0;i<4;i++){t=(t+1)%256,n=(n+e[t])%256;var s=e[t];e[t]=e[n],e[n]=s,r|=e[(e[t]+e[n])%256]<<24-i*8}return this._i=t,this._j=n,r}var t=e,n=t.lib,r=n.StreamCipher,i=t.algo,s=i.RC4=r.extend({_doReset:function(){var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[];for(var i=0;i<256;i++)r[i]=i;for(var i=0,s=0;i<256;i++){var o=i%n,u=t[o>>>2]>>>24-o%4*8&255;s=(s+r[i]+u)%256;var a=r[i];r[i]=r[s],r[s]=a}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});t.RC4=r._createHelper(s);var u=i.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});t.RC4Drop=r._createHelper(u)}(),e.RC4})},{"./cipher-core":54,"./core":55,"./enc-base64":56,"./evpkdf":58,"./md5":63}],78:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(t){function d(e,t,n){return e^t^n}function v(e,t,n){return e&t|~e&n}function m(e,t,n){return(e|~t)^n}function g(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function b(e,t){return e<>>32-t}var n=e,r=n.lib,i=r.WordArray,s=r.Hasher,o=n.algo,u=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),a=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),f=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),c=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=s.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}var s=this._hash.words,o=c.words,p=h.words,w=u.words,E=a.words,S=f.words,x=l.words,T,N,C,k,L,A,O,M,_,D;A=T=s[0],O=N=s[1],M=C=s[2],_=k=s[3],D=L=s[4];var P;for(var n=0;n<80;n+=1)P=T+e[t+w[n]]|0,n<16?P+=d(N,C,k)+o[0]:n<32?P+=v(N,C,k)+o[1]:n<48?P+=m(N,C,k)+o[2]:n<64?P+=g(N,C,k)+o[3]:P+=y(N,C,k)+o[4],P|=0,P=b(P,S[n]),P=P+L|0,T=L,L=k,k=b(C,10),C=N,N=P,P=A+e[t+E[n]]|0,n<16?P+=y(O,M,_)+
-p[0]:n<32?P+=g(O,M,_)+p[1]:n<48?P+=m(O,M,_)+p[2]:n<64?P+=v(O,M,_)+p[3]:P+=d(O,M,_)+p[4],P|=0,P=b(P,x[n]),P=P+D|0,A=D,D=_,_=b(M,10),M=O,O=P;P=s[1]+C+_|0,s[1]=s[2]+k+D|0,s[2]=s[3]+L+A|0,s[3]=s[4]+T+O|0,s[4]=s[0]+N+M|0,s[0]=P},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,e.sigBytes=(t.length+1)*4,this._process();var i=this._hash,s=i.words;for(var o=0;o<5;o++){var u=s[o];s[o]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360}return i},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});n.RIPEMD160=s._createHelper(p),n.HmacRIPEMD160=s._createHmacHelper(p)}(Math),e.RIPEMD160})},{"./core":55}],79:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,s=t.algo,o=[],u=s.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){var n=this._hash.words,r=n[0],i=n[1],s=n[2],u=n[3],a=n[4];for(var f=0;f<80;f++){if(f<16)o[f]=e[t+f]|0;else{var l=o[f-3]^o[f-8]^o[f-14]^o[f-16];o[f]=l<<1|l>>>31}var c=(r<<5|r>>>27)+a+o[f];f<20?c+=(i&s|~i&u)+1518500249:f<40?c+=(i^s^u)+1859775393:f<60?c+=(i&s|i&u|s&u)-1894007588:c+=(i^s^u)-899497514,a=u,u=s,s=i<<30|i>>>2,i=r,r=c}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+u|0,n[4]=n[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=Math.floor(n/4294967296),t[(r+64>>>9<<4)+15]=n,e.sigBytes=t.length*4,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(u),t.HmacSHA1=i._createHmacHelper(u)}(),e.SHA1})},{"./core":55}],80:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./sha256")):typeof define=="function"&&define.amd?define(["./core","./sha256"],i):i(r.CryptoJS)})(this,function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=t.algo,s=i.SHA256,o=i.SHA224=s.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=s._createHelper(o),t.HmacSHA224=s._createHmacHelper(o)}(),e.SHA224})},{"./core":55,"./sha256":81}],81:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,s=r.Hasher,o=n.algo,u=[],a=[];(function(){function e(e){var n=t.sqrt(e);for(var r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return(e-(e|0))*4294967296|0}var r=2,i=0;while(i<64)e(r)&&(i<8&&(u[i]=n(t.pow(r,.5))),a[i]=n(t.pow(r,1/3)),i++),r++})();var f=[],l=o.SHA256=s.extend({_doReset:function(){this._hash=new i.init(u.slice(0))},_doProcessBlock:function(e,t){var n=this._hash.words,r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],l=n[5],c=n[6],h=n[7];for(var p=0;p<64;p++){if(p<16)f[p]=e[t+p]|0;else{var d=f[p-15],v=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,m=f[p-2],g=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;f[p]=v+f[p-7]+g+f[p-16]}var y=u&l^~u&c,b=r&i^r&s^i&s,w=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),E=(u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25),S=h+E+y+a[p]+f[p],x=w+b;h=c,c=l,l=u,u=o+S|0,o=s,s=i,i=r,r=S+x|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+o|0,n[4]=n[4]+u|0,n[5]=n[5]+l|0,n[6]=n[6]+c|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;return n[i>>>5]|=128<<24-i%32,n[(i+64>>>9<<4)+14]=t.floor(r/4294967296),n[(i+64>>>9<<4)+15]=r,e.sigBytes=n.length*4,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=s._createHelper(l),n.HmacSHA256=s._createHmacHelper(l)}(Math),e.SHA256})},{"./core":55}],82:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./x64-core")):typeof define=="function"&&define.amd?define(["./core","./x64-core"],i):i(r.CryptoJS)})(this,function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,s=r.Hasher,o=n.x64,u=o.Word,a=n.algo,f=[],l=[],c=[];(function(){var e=1,t=0;for(var n=0;n<24;n++){f[e+5*t]=(n+1)*(n+2)/2%64;var r=t%5,i=(2*e+3*t)%5;e=r,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;var s=1;for(var o=0;o<24;o++){var a=0,h=0;for(var p=0;p<7;p++){if(s&1){var d=(1<>>24)&16711935|(s<<24|s>>>8)&4278255360,o=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360;var u=n[i];u.high^=o,u.low^=s}for(var a=0;a<24;a++){for(var p=0;p<5;p++){var d=0,v=0;for(var m=0;m<5;m++){var u=n[p+5*m];d^=u.high,v^=u.low}var g=h[p];g.high=d,g.low=v}for(var p=0;p<5;p++){var y=h[(p+4)%5],b=h[(p+1)%5],w=b.high,E=b.low,d=y.high^(w<<1|E>>>31),v=y.low^(E<<1|w>>>31);for(var m=0;m<5;m++){var u=n[p+5*m];u.high^=d,u.low^=v}}for(var S=1;S<25;S++){var u=n[S],x=u.high,N=u.low,C=f[S];if(C<32)var d=x<>>32-C,v=N<>>32-C;else var d=N<>>64-C,v=x<>>64-C;var k=h[l[S]];k.high=d,k.low=v}var L=h[0],A=n[0];L.high=A.high,L.low=A.low;for(var p=0;p<5;p++)for(var m=0;m<5;m++){var S=p+5*m,u=n[S],O=h[S],M=h[(p+1)%5+5*m],_=h[(p+2)%5+5*m];u.high=O.high^~M.high&_.high,u.low=O.low^~M.low&_.low}var u=n[0],D=c[a];u.high^=D.high,u.low^=D.low}},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,s=e.sigBytes*8,o=this.blockSize*32;n[s>>>5]|=1<<24-s%32,n[(t.ceil((s+1)/o)*o>>>5)-1]|=128,e.sigBytes=n.length*4,this._process();var u=this._state,a=this.cfg.outputLength/8,f=a/8,l=[];for(var c=0;c>>24)&16711935|(p<<24|p>>>8)&4278255360,d=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360,l.push(d),l.push(p)}return new i.init(l,a)},clone:function(){var e=s.clone.call(this),t=e._state=this._state.slice(0);for(var n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=s._createHelper(p),n.HmacSHA3=s._createHmacHelper(p)}(Math),e.SHA3})},{"./core":55,"./x64-core":86}],83:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./x64-core"),e("./sha512")):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],i):i(r.CryptoJS)})(this,function(e){return function(){var t=e,n=t.x64,r=n.Word,i=n.WordArray,s=t.algo,o=s.SHA512,u=s.SHA384=o.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=o._createHelper(u),t.HmacSHA384=o._createHmacHelper(u)}(),e.SHA384})},{"./core":55,"./sha512":84,"./x64-core":86}],84:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./x64-core")):typeof define=="function"&&define.amd?define(["./core","./x64-core"],i):i(r.CryptoJS)})(this,function(e){return function(){function a(){return s.create.apply(s,arguments)}var t=e,n=t.lib,r=n.Hasher,i=t.x64,s=i.Word,o=i.WordArray,u=t.algo,f=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],l=[];(function(){for(var e=0;e<80;e++)l[e]=a()})();var c=u.SHA512=r.extend({_doReset:function(){this._hash=new o.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(e,t){var n=this._hash.words,r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],a=n[5],c=n[6],h=n[7],p=r.high,d=r.low,v=i.high,m=i.low,g=s.high,y=s.low,b=o.high,w=o.low,E=u.high,S=u.low,x=a.high,T=a.low,N=c.high,C=c.low,k=h.high,L=h.low,A=p,O=d,M=v,_=m,D=g,P=y,H=b,B=w,j=E,F=S,I=x,q=T,R=N,U=C,z=k,X=L;for(var V=0;V<80;V++){var $=l[V];if(V<16)var J=$.high=e[t+V*2]|0,Q=$.low=e[t+V*2+1]|0;else{var G=l[V-15],Y=G.high,Z=G.low,et=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,tt=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),nt=l[V-2],rt=nt.high,it=nt.low,st=(rt>>>19|it<<13)^(rt<<3|it>>>29)^rt>>>6,ot=(it>>>19|rt<<13)^(it<<3|rt>>>29)^(it>>>6|rt<<26),ut=l[V-7],at=ut.high,ft=ut.low,lt=l[V-16],ct=lt.high,ht=lt.low,Q=tt+ft,J=et+at+(Q>>>0>>0?1:0),Q=Q+ot,J=J+st+(Q>>>0>>0?1:0),Q=Q+ht,J=J+ct+(Q>>>0>>0?1:0);$.high=J,$.low=Q}var pt=j&I^~j&R,dt=F&q^~F&U,vt=A&M^A&D^M&D,mt=O&_^O&P^_&P,gt=(A>>>28|O<<4)^(A<<30|O>>>2)^(A<<25|O>>>7),yt=(O>>>28|A<<4)^(O<<30|A>>>2)^(O<<25|A>>>7),bt=(j>>>14|F<<18)^(j>>>18|F<<14)^(j<<23|F>>>9),wt=(F>>>14|j<<18)^(F>>>18|j<<14)^(F<<23|j>>>9),Et=f[V],St=Et.high,xt=Et.low,Tt=X+wt,Nt=z+bt+(Tt>>>0>>0?1:0),Tt=Tt+dt,Nt=Nt+pt+(Tt>>>0
>>0?1:0),Tt=Tt+xt,Nt=Nt+St+(Tt>>>0>>0?1:0),Tt=Tt+Q,Nt=Nt+J+(Tt>>>0>>0?1:0),Ct=yt+mt,kt=gt+vt+(Ct>>>0>>0?1:0);z=R,X=U,R=I,U=q,I=j,q=F,F=B+Tt|0,j=H+Nt+(F>>>0>>0?1:0)|0,H=D,B=P,D=M,P=_,M=A,_=O,O=Tt+Ct|0,A=Nt+kt+(O>>>0>>0?1:0)|0}d=r.low=d+O,r.high=p+A+(d>>>0>>0?1:0),m=i.low=m+_,i.high=v+M+(m>>>0<_>>>0?1:0),y=s.low=y+P,s.high=g+D+(y>>>0

>>0?1:0),w=o.low=w+B,o.high=b+H+(w>>>0>>0?1:0),S=u.low=S+F,u.high=E+j+(S>>>0>>0?1:0),T=a.low=T+q,a.high=x+I+(T>>>0>>0?1:0),C=c.low=C+U,c.high=N+R+(C>>>0>>0?1:0),L=h.low=L+X,h.high=k+z+(L>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;t[r>>>5]|=128<<24-r%32,t[(r+128>>>10<<5)+30]=Math.floor(n/4294967296),t[(r+128>>>10<<5)+31]=n,e.sigBytes=t.length*4,this._process();var i=this._hash.toX32();return i},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=r._createHelper(c),t.HmacSHA512=r._createHmacHelper(c)}(),e.SHA512})},{"./core":55,"./x64-core":86}],85:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return function(){function h(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<>>5]>>>31-i%32&1}var s=this._subKeys=[];for(var f=0;f<16;f++){var l=s[f]=[],c=a[f];for(var r=0;r<24;r++)l[r/6|0]|=n[(u[r]-1+c)%28]<<31-r%6,l[4+(r/6|0)]|=n[28+(u[r+24]-1+c)%28]<<31-r%6;l[0]=l[0]<<1|l[0]>>>31;for(var r=1;r<7;r++)l[r]=l[r]>>>(r-1)*4+3;l[7]=l[7]<<5|l[7]>>>27}var h=this._invSubKeys=[];for(var r=0;r<16;r++)h[r]=s[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],h.call(this,4,252645135),h.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),h.call(this,1,1431655765);for(var r=0;r<16;r++){var i=n[r],s=this._lBlock,o=this._rBlock,u=0;for(var a=0;a<8;a++)u|=f[a][((o^i[a])&l[a])>>>0];this._lBlock=o,this._rBlock=s^u}var c=this._lBlock;this._lBlock=this._rBlock,this._rBlock=c,h.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});t.DES=i._createHelper(c);var d=s.TripleDES=i.extend({_doReset:function(){var e=this._key,t=e.words;this._des1=c.createEncryptor(r.create(t.slice(0,2))),this._des2=c.createEncryptor(r.create(t.slice(2,4))),this._des3=c.createEncryptor(r.create(t.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(d)}(),e.TripleDES})},{"./cipher-core":54,"./core":55,"./enc-base64":56,"./evpkdf":58,"./md5":63}],86:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(t){var n=e,r=n.lib,i=r.Base,s=r.WordArray,o=n.x64={},u=o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),a=o.WordArray=i.extend({init:function(e,n){e=this.words=e||[],n!=t?this.sigBytes=n:this.sigBytes=e.length*8},toX32:function(){var e=this.words,t=e.length,n=[];for(var r=0;r1?arguments[1]:"utf8"):h(this,e)):arguments.length>1?new f(e,arguments[1]):new f(e)}function l(e,t){e=b(e,t<0?0:w(t)|0);if(!f.TYPED_ARRAY_SUPPORT)for(var n=0;n>>1;return n&&(e.parent=o),e}function w(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return e|0}function E(e,t){if(this instanceof E){var n=new f(e,t);return delete n.parent,n}return new E(e,t)}function S(e,t){typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;var r=!1;for(;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(r)return K(e).length;t=(""+t).toLowerCase(),r=!0}}function x(e,t,n){var r=!1;t|=0,n=n===undefined||n===Infinity?this.length:n|0,e||(e="utf8"),t<0&&(t=0),n>this.length&&(n=this.length);if(n<=t)return"";for(;;)switch(e){case"hex":return B(this,t,n);case"utf8":case"utf-8":return M(this,t,n);case"ascii":return P(this,t,n);case"binary":return H(this,t,n);case"base64":return O(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function T(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var s=t.length;if(s%2!==0)throw new Error("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o239?4:s>223?3:s>191?2:1;if(i+u<=n){var a,f,l,c;switch(u){case 1:s<128&&(o=s);break;case 2:a=e[i+1],(a&192)===128&&(c=(s&31)<<6|a&63,c>127&&(o=c));break;case 3:a=e[i+1],f=e[i+2],(a&192)===128&&(f&192)===128&&(c=(s&15)<<12|(a&63)<<6|f&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:a=e[i+1],f=e[i+2],l=e[i+3],(a&192)===128&&(f&192)===128&&(l&192)===128&&(c=(s&15)<<18|(a&63)<<12|(f&63)<<6|l&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),i+=u}return D(r)}function D(e){var t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);var n="",r=0;while(rr)n=r;var i="";for(var s=t;sn)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,n,r,i,s){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||te.length)throw new RangeError("index out of range")}function q(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(e.length-n,2);i>>(r?i:1-i)*8}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(e.length-n,4);i>>(r?i:3-i)*8&255}function U(e,t,n,r,i,s){if(t>i||te.length)throw new RangeError("index out of range");if(n<0)throw new RangeError("index out of range")}function z(e,t,n,r,s){return s||U(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),i.write(e,t,n,r,23,4),n+4}function W(e,t,n,r,s){return s||U(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),i.write(e,t,n,r,52,8),n+8}function V(e){e=$(e).replace(X,"");if(e.length<2)return"";while(e.length%4!==0)e+="=";return e}function $(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function J(e){return e<16?"0"+e.toString(16):e.toString(16)}function K(e,t){t=t||Infinity;var n,r=e.length,i=null,s=[];for(var o=0;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);i=null;if(n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,n&63|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}}return s}function Q(e){var t=[];for(var n=0;n>8,i=n%256,s.push(i),s.push(r)}return s}function Y(e){return r.toByteArray(V(e))}function Z(e,t,n,r){for(var i=0;i=t.length||i>=e.length)break;t[i+n]=e[i]}return i}var r=e("base64-js"),i=e("ieee754"),s=e("isarray");n.Buffer=f,n.SlowBuffer=E,n.INSPECT_MAX_BYTES=50,f.poolSize=8192;var o={};f.TYPED_ARRAY_SUPPORT=t.TYPED_ARRAY_SUPPORT!==undefined?t.TYPED_ARRAY_SUPPORT:u(),f.TYPED_ARRAY_SUPPORT?(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array):(f.prototype.length=undefined,f.prototype.parent=undefined),f.isBuffer=function(t){return t!=null&&!!t._isBuffer},f.compare=function(t,n){if(!f.isBuffer(t)||!f.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(t===n)return 0;var r=t.length,i=n.length,s=0,o=Math.min(r,i);while(s0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},f.prototype.compare=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:f.compare(this,t)},f.prototype.indexOf=function(t,n){function r(e,t,n){var r=-1;for(var i=0;n+i2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n>>=0;if(this.length===0)return-1;if(n>=this.length)return-1;n<0&&(n=Math.max(this -.length+n,0));if(typeof t=="string")return t.length===0?-1:String.prototype.indexOf.call(this,t,n);if(f.isBuffer(t))return r(this,t,n);if(typeof t=="number")return f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"?Uint8Array.prototype.indexOf.call(this,t,n):r(this,[t],n);throw new TypeError("val must be string, number or Buffer")},f.prototype.write=function(t,n,r,i){if(n===undefined)i="utf8",r=this.length,n=0;else if(r===undefined&&typeof n=="string")i=n,r=this.length,n=0;else if(isFinite(n))n|=0,isFinite(r)?(r|=0,i===undefined&&(i="utf8")):(i=r,r=undefined);else{var s=i;i=n,n=r|0,r=s}var o=this.length-n;if(r===undefined||r>o)r=o;if(t.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("attempt to write outside buffer bounds");i||(i="utf8");var u=!1;for(;;)switch(i){case"hex":return T(this,t,n,r);case"utf8":case"utf-8":return N(this,t,n,r);case"ascii":return C(this,t,n,r);case"binary":return k(this,t,n,r);case"base64":return L(this,t,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,n,r);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;f.prototype.slice=function(t,n){var r=this.length;t=~~t,n=n===undefined?r:~~n,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n0&&(s*=256))i+=this[t+ --n]*s;return i},f.prototype.readUInt8=function(t,n){return n||F(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,n){return n||F(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,n){return n||F(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,n){return n||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},f.prototype.readUInt32BE=function(t,n){return n||F(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,n,r){t|=0,n|=0,r||F(t,n,this.length);var i=this[t],s=1,o=0;while(++o=s&&(i-=Math.pow(2,8*n)),i},f.prototype.readIntBE=function(t,n,r){t|=0,n|=0,r||F(t,n,this.length);var i=n,s=1,o=this[t+ --i];while(i>0&&(s*=256))o+=this[t+ --i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*n)),o},f.prototype.readInt8=function(t,n){return n||F(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},f.prototype.readInt16LE=function(t,n){n||F(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r},f.prototype.readInt16BE=function(t,n){n||F(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r},f.prototype.readInt32LE=function(t,n){return n||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,n){return n||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,n){return n||F(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,n){return n||F(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,n){return n||F(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,n){return n||F(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,n,r,i){t=+t,n|=0,r|=0,i||I(this,t,n,r,Math.pow(2,8*r),0);var s=1,o=0;this[n]=t&255;while(++o=0&&(o*=256))this[n+s]=t/o&255;return n+r},f.prototype.writeUInt8=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=t&255,n+1},f.prototype.writeUInt16LE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):q(this,t,n,!0),n+2},f.prototype.writeUInt16BE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):q(this,t,n,!1),n+2},f.prototype.writeUInt32LE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255):R(this,t,n,!0),n+4},f.prototype.writeUInt32BE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):R(this,t,n,!1),n+4},f.prototype.writeIntLE=function(t,n,r,i){t=+t,n|=0;if(!i){var s=Math.pow(2,8*r-1);I(this,t,n,r,s-1,-s)}var o=0,u=1,a=t<0?1:0;this[n]=t&255;while(++o>0)-a&255;return n+r},f.prototype.writeIntBE=function(t,n,r,i){t=+t,n|=0;if(!i){var s=Math.pow(2,8*r-1);I(this,t,n,r,s-1,-s)}var o=r-1,u=1,a=t<0?1:0;this[n+o]=t&255;while(--o>=0&&(u*=256))this[n+o]=(t/u>>0)-a&255;return n+r},f.prototype.writeInt8=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=t&255,n+1},f.prototype.writeInt16LE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):q(this,t,n,!0),n+2},f.prototype.writeInt16BE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):q(this,t,n,!1),n+2},f.prototype.writeInt32LE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):R(this,t,n,!0),n+4},f.prototype.writeInt32BE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):R(this,t,n,!1),n+4},f.prototype.writeFloatLE=function(t,n,r){return z(this,t,n,!0,r)},f.prototype.writeFloatBE=function(t,n,r){return z(this,t,n,!1,r)},f.prototype.writeDoubleLE=function(t,n,r){return W(this,t,n,!0,r)},f.prototype.writeDoubleBE=function(t,n,r){return W(this,t,n,!1,r)},f.prototype.copy=function(t,n,r,i){r||(r=0),!i&&i!==0&&(i=this.length),n>=t.length&&(n=t.length),n||(n=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-n=0;o--)t[o+n]=this[o+r];else if(s<1e3||!f.TYPED_ARRAY_SUPPORT)for(o=0;o=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof t=="number")for(i=n;i0)throw new Error("Invalid string. Length must be a multiple of 4");var a=e.length;o=e.charAt(a-2)==="="?2:e.charAt(a-1)==="="?1:0,u=new n(e.length*3/4-o),i=o>0?e.length-4:e.length;var f=0;for(t=0,r=0;t>16),c((s&65280)>>8),c(s&255);return o===2?(s=l(e.charAt(t))<<2|l(e.charAt(t+1))>>4,c(s&255)):o===1&&(s=l(e.charAt(t))<<10|l(e.charAt(t+1))<<4|l(e.charAt(t+2))>>2,c(s>>8&255),c(s&255)),u}function h(e){function u(e){return t.charAt(e)}function a(e){return u(e>>18&63)+u(e>>12&63)+u(e>>6&63)+u(e&63)}var n,r=e.length%3,i="",s,o;for(n=0,o=e.length-r;n>2),i+=u(s<<4&63),i+="==";break;case 2:s=(e[e.length-2]<<8)+e[e.length-1],i+=u(s>>10),i+=u(s>>4&63),i+=u(s<<2&63),i+="=";break;default:}return i}var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=typeof Uint8Array!="undefined"?Uint8Array:Array,r="+".charCodeAt(0),i="/".charCodeAt(0),s="0".charCodeAt(0),o="a".charCodeAt(0),u="A".charCodeAt(0),a="-".charCodeAt(0),f="_".charCodeAt(0);e.toByteArray=c,e.fromByteArray=h})(typeof n=="undefined"?this.base64js={}:n)},{}],91:[function(e,t,n){n.read=function(e,t,n,r,i){var s,o,u=i*8-r-1,a=(1<>1,l=-7,c=n?i-1:0,h=n?-1:1,p=e[t+c];c+=h,s=p&(1<<-l)-1,p>>=-l,l+=u;for(;l>0;s=s*256+e[t+c],c+=h,l-=8);o=s&(1<<-l)-1,s>>=-l,l+=r;for(;l>0;o=o*256+e[t+c],c+=h,l-=8);if(s===0)s=1-f;else{if(s===a)return o?NaN:(p?-1:1)*Infinity;o+=Math.pow(2,r),s-=f}return(p?-1:1)*o*Math.pow(2,s-r)},n.write=function(e,t,n,r,i,s){var o,u,a,f=s*8-i-1,l=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,d=r?1:-1,v=t<0||t===0&&1/t<0?1:0;t=Math.abs(t),isNaN(t)||t===Infinity?(u=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-o))<1&&(o--,a*=2),o+c>=1?t+=h/a:t+=h*Math.pow(2,1-c),t*a>=2&&(o++,a/=2),o+c>=l?(u=0,o=l):o+c>=1?(u=(t*a-1)*Math.pow(2,i),o+=c):(u=t*Math.pow(2,c-1)*Math.pow(2,i),o=0));for(;i>=8;e[n+p]=u&255,p+=d,u/=256,i-=8);o=o<0;e[n+p]=o&255,p+=d,o/=256,f-=8);e[n+p-d]|=v*128}},{}],92:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return r.call(e)=="[object Array]"}},{}],93:[function(e,t,n){"use strict";n.randomBytes=n.rng=n.pseudoRandomBytes=n.prng=e("randombytes"),n.createHash=n.Hash=e("create-hash"),n.createHmac=n.Hmac=e("create-hmac");var r=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(Object.keys(e("browserify-sign/algos")));n.getHashes=function(){return r};var i=e("pbkdf2");n.pbkdf2=i.pbkdf2,n.pbkdf2Sync=i.pbkdf2Sync;var s=e("browserify-cipher");["Cipher","createCipher","Cipheriv","createCipheriv","Decipher","createDecipher","Decipheriv","createDecipheriv","getCiphers","listCiphers"].forEach(function(e){n[e]=s[e]});var o=e("diffie-hellman");["DiffieHellmanGroup","createDiffieHellmanGroup","getDiffieHellman","createDiffieHellman","DiffieHellman"].forEach(function(e){n[e]=o[e]});var u=e("browserify-sign");["createSign","Sign","createVerify","Verify"].forEach(function(e){n[e]=u[e]}),n.createECDH=e("create-ecdh");var a=e("public-encrypt");["publicEncrypt","privateEncrypt","publicDecrypt","privateDecrypt"].forEach(function(e){n[e]=a[e]}),["createCredentials"].forEach(function(e){n[e]=function(){throw new Error(["sorry, "+e+" is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))}})},{"browserify-cipher":94,"browserify-sign":124,"browserify-sign/algos":123,"create-ecdh":191,"create-hash":217,"create-hmac":230,"diffie-hellman":231,pbkdf2:238,"public-encrypt":239,randombytes:284}],94:[function(e,t,n){function a(e,t){var n,i;e=e.toLowerCase();if(u[e])n=u[e].key,i=u[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");n=o[e].key*8,i=o[e].iv}var s=r(t,!1,n,i);return l(e,s.key,s.iv)}function f(e,t){var n,i;e=e.toLowerCase();if(u[e])n=u[e].key,i=u[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");n=o[e].key*8,i=o[e].iv}var s=r(t,!1,n,i);return c(e,s.key,s.iv)}function l(e,t,n){e=e.toLowerCase();if(u[e])return i.createCipheriv(e,t,n);if(o[e])return new s({key:t,iv:n,mode:e});throw new TypeError("invalid suite type")}function c(e,t,n){e=e.toLowerCase();if(u[e])return i.createDecipheriv(e,t,n);if(o[e])return new s({key:t,iv:n,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}function h(){return Object.keys(o).concat(i.getCiphers())}var r=e("evp_bytestokey"),i=e("browserify-aes/browser"),s=e("browserify-des"),o=e("browserify-des/modes"),u=e("browserify-aes/modes");n.createCipher=n.Cipher=a,n.createCipheriv=n.Cipheriv=l,n.createDecipher=n.Decipher=f,n.createDecipheriv=n.Decipheriv=c,n.listCiphers=n.getCiphers=h},{"browserify-aes/browser":97,"browserify-aes/modes":101,"browserify-des":112,"browserify-des/modes":113,evp_bytestokey:122}],95:[function(e,t,n){(function(e){function r(e){var n,r;return n=e>t||e<0?(r=Math.abs(e)%t,e<0?t-r:r):e,n}function i(e){for(var t=0;t>>8^n&255^99,this.SBOX[i]=n,this.INV_SBOX[n]=i,s=e[i],o=e[s],u=e[o],r=e[n]*257^n*16843008,this.SUB_MIX[0][i]=r<<24|r>>>8,this.SUB_MIX[1][i]=r<<16|r>>>16,this.SUB_MIX[2][i]=r<<8|r>>>24,this.SUB_MIX[3][i]=r,r=u*16843009^o*65537^s*257^i*16843008,this.INV_SUB_MIX[0][n]=r<<24|r>>>8,this.INV_SUB_MIX[1][n]=r<<16|r>>>16,this.INV_SUB_MIX[2][n]=r<<8|r>>>24,this.INV_SUB_MIX[3][n]=r,i===0?i=a=1:(i=s^e[e[e[u^s]]],a^=e[e[a]]);return!0};var o=new s;a.blockSize=16,a.prototype.blockSize=a.blockSize,a.keySize=32,a.prototype.keySize=a.keySize,a.prototype._doReset=function(){var e,t,n,r,i,s;n=this._key,t=n.length,this._nRounds=t+6,i=(this._nRounds+1)*4,this._keySchedule=[];for(r=0;r>>24,s=o.SBOX[s>>>24]<<24|o.SBOX[s>>>16&255]<<16|o.SBOX[s>>>8&255]<<8|o.SBOX[s&255],s^=o.RCON[r/t|0]<<24):t>6&&r%t===4?s=o.SBOX[s>>>24]<<24|o.SBOX[s>>>16&255]<<16|o.SBOX[s>>>8&255]<<8|o.SBOX[s&255]:void 0,this._keySchedule[r-t]^s);this._invKeySchedule=[];for(e=0;e>>24]]^o.INV_SUB_MIX[1][o.SBOX[s>>>16&255]]^o.INV_SUB_MIX[2][o.SBOX[s>>>8&255]]^o.INV_SUB_MIX[3][o.SBOX[s&255]];return!0},a.prototype.encryptBlock=function(t){t=u(new e(t));var n=this._doCryptBlock(t,this._keySchedule,o.SUB_MIX,o.SBOX),r=new e(16);return r.writeUInt32BE(n[0],0),r.writeUInt32BE(n[1],4),r.writeUInt32BE(n[2],8),r.writeUInt32BE(n[3],12),r},a.prototype.decryptBlock=function(t){t=u(new e(t));var n=[t[3],t[1]];t[1]=n[0],t[3]=n[1];var r=this._doCryptBlock(t,this._invKeySchedule,o.INV_SUB_MIX,o.INV_SBOX),i=new e(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},a.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},a.prototype._doCryptBlock=function(e,t,n,i){var s,o,u,a,f,l,c,h,p;o=e[0]^t[0],u=e[1]^t[1],a=e[2]^t[2],f=e[3]^t[3],s=4;for(var d=1;d>>24]^n[1][u>>>16&255]^n[2][a>>>8&255]^n[3][f&255]^t[s++],c=n[0][u>>>24]^n[1][a>>>16&255]^n[2][f>>>8&255]^n[3][o&255]^t[s++],h=n[0][a>>>24]^n[1][f>>>16&255]^n[2][o>>>8&255]^n[3][u&255]^t[s++],p=n[0][f>>>24]^n[1][o>>>16&255]^n[2][u>>>8&255]^n[3][a&255]^t[s++],o=l,u=c,a=h,f=p;return l=(i[o>>>24]<<24|i[u>>>16&255]<<16|i[a>>>8&255]<<8|i[f&255])^t[s++],c=(i[u>>>24]<<24|i[a>>>16&255]<<16|i[f>>>8&255]<<8|i[o&255])^t[s++],h=(i[a>>>24]<<24|i[f>>>16&255]<<16|i[o>>>8&255]<<8|i[u&255])^t[s++],p=(i[f>>>24]<<24|i[o>>>16&255]<<16|i[u>>>8&255]<<8|i[a&255])^t[s++],[r(l),r(c),r(h),r(p)]},n.AES=a}).call(this,e("buffer").Buffer)},{buffer:89}],96:[function(e,t,n){(function(n){function a(e,t,s,u){if(!(this instanceof a))return new a(e,t,s);i.call(this),this._finID=n.concat([s,new n([0,0,0,1])]),s=n.concat([s,new n([0,0,0,2])]),this._cipher=new r.AES(t),this._prev=new n(s.length),this._cache=new n(""),this._secCache=new n(""),this._decrypt=u,this._alen=0,this._len=0,s.copy(this._prev),this._mode=e;var f=new n(4);f.fill(0),this._ghash=new o(this._cipher.encryptBlock(f)),this._authTag=null,this._called=!1}function f(e,t){var n=0;e.length!==t.length&&n++;var r=Math.min(e.length,t.length),i=-1;while(++i16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache};var p={ECB:e("./modes/ecb"),CBC:e("./modes/cbc"),CFB:e("./modes/cfb"),CFB8:e("./modes/cfb8"),CFB1:e("./modes/cfb1"),OFB:e("./modes/ofb"),CTR:e("./modes/ctr"),GCM:e("./modes/ctr")};n.createDecipher=v,n.createDecipheriv=d}).call(this,e("buffer").Buffer)},{"./aes":95,"./authCipher":96,"./modes":101,"./modes/cbc":102,"./modes/cfb":103,"./modes/cfb1":104,"./modes/cfb8":105,"./modes/ctr":106,"./modes/ecb":107,"./modes/ofb":108,"./streamCipher":111,buffer:89,"cipher-base":110,evp_bytestokey:122,inherits:286}],99:[function(e,t,n){(function(t){function l(e,n,s){if(!(this instanceof l))return new l(e,n,s);i.call(this),this._cache=new c,this._cipher=new r.AES(n),this._prev=new t(s.length),s.copy(this._prev),this._mode=e,this._autopadding=!0}function c(){if(!(this instanceof c))return new c;this.cache=new t("")}function p(e,n,r){var i=o[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");typeof r=="string"&&(r=new t(r)),typeof n=="string"&&(n=new t(n));if(n.length!==i.key/8)throw new TypeError("invalid key length "+n.length);if(r.length!==i.iv)throw new TypeError("invalid iv length "+r.length);return i.type==="stream"?new a(h[i.mode],n,r):i.type==="auth"?new f(h[i.mode],n,r):new l(h[i.mode],n,r)}function d(e,t){var n=o[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var r=u(t,!1,n.key,n.iv);return p(e,r.key,r.iv)}var r=e("./aes"),i=e("cipher-base"),s=e("inherits"),o=e("./modes"),u=e("evp_bytestokey"),a=e("./streamCipher"),f=e("./authCipher");s(l,i),l.prototype._update=function(e){this._cache.add(e);var n,r,i=[];while(n=this._cache.get())r=this._mode.encrypt(this,n),i.push(r);return t.concat(i)},l.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(e.toString("hex")!=="10101010101010101010101010101010")throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(e){this._autopadding=!!e},c.prototype.add=function(e){this.cache=t.concat([this.cache,e])},c.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},c.prototype.flush=function(){var e=16-this.cache.length,n=new t(e),r=-1;while(++ro||e<0?(n=Math.abs(e)%o,e<0?o-n:n):e,t}function a(e,t){return[e[0]^t[0],e[1]^t[1],e[2]^t[2],e[3]^t[3]]}var n=new e(16);n.fill(0),t.exports=r,r.prototype.ghash=function(e){var t=-1;while(++t0;n--)e[n]=e[n]>>>1|(e[n-1]&1)<<31;e[0]=e[0]>>>1,o&&(e[0]=e[0]^225<<24)}this.state=s(t)},r.prototype.update=function(t){this.cache=e.concat([this.cache,t]);var n;while(this.cache.length>=16)n=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(n)},r.prototype.final=function(t,r){return this.cache.length&&this.ghash(e.concat([this.cache,n],16)),this.ghash(s([0,t,0,r])),this.state};var o=Math.pow(2,32)}).call(this,e("buffer").Buffer)},{buffer:89}],101:[function(e,t,n){n["aes-128-ecb"]={cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},n["aes-192-ecb"]={cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},n["aes-256-ecb"]={cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},n["aes-128-cbc"]={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},n["aes-192-cbc"]={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},n["aes-256-cbc"]={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},n.aes128=n["aes-128-cbc"],n.aes192=n["aes-192-cbc"],n.aes256=n["aes-256-cbc"],n["aes-128-cfb"]={cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},n["aes-192-cfb"]={cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},n["aes-256-cfb"]={cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},n["aes-128-cfb8"]={cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},n["aes-192-cfb8"]={cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},n["aes-256-cfb8"]={cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},n["aes-128-cfb1"]={cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},n["aes-192-cfb1"]={cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},n["aes-256-cfb1"]={cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},n["aes-128-ofb"]={cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},n["aes-192-ofb"]={cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},n["aes-256-ofb"]={cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},n["aes-128-ctr"]={cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},n["aes-192-ctr"]={cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},n["aes-256-ctr"]={cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},n["aes-128-gcm"]={cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},n["aes-192-gcm"]={cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},n["aes-256-gcm"]={cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},{}],102:[function(e,t,n){var r=e("buffer-xor");n.encrypt=function(e,t){var n=r(t,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},n.decrypt=function(e,t){var n=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return r(i,n)}},{"buffer-xor":109}],103:[function(e,t,n){(function(t){function i(e,n,i){var s=n.length,o=r(n,e._cache);return e._cache=e._cache.slice(s),e._prev=t.concat([e._prev,i?n:o]),o}var r=e("buffer-xor");n.encrypt=function(e,n,r){var s=new t(""),o;while(n.length){e._cache.length===0&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=new t(""));if(!(e._cache.length<=n.length)){s=t.concat([s,i(e,n,r)]);break}o=e._cache.length,s=t.concat([s,i(e,n.slice(0,o),r)]),n=n.slice(o)}return s}}).call(this,e("buffer").Buffer)},{buffer:89,"buffer-xor":109}],104:[function(e,t,n){(function(e){function t(e,t,n){var i,s=-1,o=8,u=0,a,f;while(++s>s%8,e._prev=r(e._prev,n?a:f);return u}function r(t,n){var r=t.length,i=-1,s=new e(t.length);t=e.concat([t,new e([n])]);while(++i>7;return s}n.encrypt=function(n,r,i){var s=r.length,o=new e(s),u=-1;while(++u0;i--)n+=this._buffer(t,n),r+=this._flushBuffer(s,r);return n+=this._buffer(t,n),s},i.prototype.final=function(t){var n;t&&(n=this.update(t));var r;return this.type==="encrypt"?r=this._finalEncrypt():r=this._finalDecrypt(),n?n.concat(r):r},i.prototype._pad=function(t,n){if(n===0)return!1;while(n>>1];i=o.r28shl(i,a),s=o.r28shl(s,a),o.pc2(i,s,t.keys,u)}},f.prototype._update=function(t,n,r,i){var s=this._desState,u=o.readUInt32BE(t,n),a=o.readUInt32BE(t,n+4);o.ip(u,a,s.tmp,0),u=s.tmp[0],a=s.tmp[1],this.type==="encrypt"?this._encrypt(s,u,a,s.tmp,0):this._decrypt(s,u,a,s.tmp,0),u=s.tmp[0],a=s.tmp[1],o.writeUInt32BE(r,u,i),o.writeUInt32BE(r,a,i+4)},f.prototype._pad=function(t,n){var r=t.length-n;for(var i=n;i>>0,u=d}o.rip(a,u,i,s)},f.prototype._decrypt=function(t,n,r,i,s){var u=r,a=n;for(var f=t.keys.length-2;f>=0;f-=2){var l=t.keys[f],c=t.keys[f+1];o.expand(u,t.tmp,0),l^=t.tmp[0],c^=t.tmp[1];var h=o.substitute(l,c),p=o.permute(h),d=u;u=(a^p)>>>0,a=d}o.rip(u,a,i,s)}},{"../des":115,inherits:286,"minimalistic-assert":121}],119:[function(e,t,n){"use strict";function a(e,t){r.equal(t.length,24,"Invalid key length");var n=t.slice(0,8),i=t.slice(8,16),s=t.slice(16,24);e==="encrypt"?this.ciphers=[u.create({type:"encrypt",key:n}),u.create({type:"decrypt",key:i}),u.create({type:"encrypt",key:s})]:this.ciphers=[u.create({type:"decrypt",key:s}),u.create({type:"encrypt",key:i}),u.create({type:"decrypt",key:n})]}function f(e){o.call(this,e);var t=new a(this.type,this.options.key);this._edeState=t}var r=e("minimalistic-assert"),i=e("inherits"),s=e("../des"),o=s.Cipher,u=s.DES;i(f,o),t.exports=f,f.create=function(t){return new f(t)},f.prototype._update=function(t,n,r,i){var s=this._edeState;s.ciphers[0]._update(t,n,r,i),s.ciphers[1]._update(r,i,r,i),s.ciphers[2]._update(r,i,r,i)},f.prototype._pad=u.prototype._pad,f.prototype._unpad=u.prototype._unpad},{"../des":115,inherits:286,"minimalistic-assert":121}],120:[function(e,t,n){"use strict";n.readUInt32BE=function(t,n){var r=t[0+n]<<24|t[1+n]<<16|t[2+n]<<8|t[3+n];return r>>>0},n.writeUInt32BE=function(t,n,r){t[0+r]=n>>>24,t[1+r]=n>>>16&255,t[2+r]=n>>>8&255,t[3+r]=n&255},n.ip=function(t,n,r,i){var s=0,o=0;for(var u=6;u>=0;u-=2){for(var a=0;a<=24;a+=8)s<<=1,s|=n>>>a+u&1;for(var a=0;a<=24;a+=8)s<<=1,s|=t>>>a+u&1}for(var u=6;u>=0;u-=2){for(var a=1;a<=25;a+=8)o<<=1,o|=n>>>a+u&1;for(var a=1;a<=25;a+=8)o<<=1,o|=t>>>a+u&1}r[i+0]=s>>>0,r[i+1]=o>>>0},n.rip=function(t,n,r,i){var s=0,o=0;for(var u=0;u<4;u++)for(var a=24;a>=0;a-=8)s<<=1,s|=n>>>a+u&1,s<<=1,s|=t>>>a+u&1;for(var u=4;u<8;u++)for(var a=24;a>=0;a-=8)o<<=1,o|=n>>>a+u&1,o<<=1,o|=t>>>a+u&1;r[i+0]=s>>>0,r[i+1]=o>>>0},n.pc1=function(t,n,r,i){var s=0,o=0;for(var u=7;u>=5;u--){for(var a=0;a<=24;a+=8)s<<=1,s|=n>>a+u&1;for(var a=0;a<=24;a+=8)s<<=1,s|=t>>a+u&1}for(var a=0;a<=24;a+=8)s<<=1,s|=n>>a+u&1;for(var u=1;u<=3;u++){for(var a=0;a<=24;a+=8)o<<=1,o|=n>>a+u&1;for(var a=0;a<=24;a+=8)o<<=1,o|=t>>a+u&1}for(var a=0;a<=24;a+=8)o<<=1,o|=t>>a+u&1;r[i+0]=s>>>0,r[i+1]=o>>>0},n.r28shl=function(t,n){return t<>>28-n};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];n.pc2=function(t,n,i,s){var o=0,u=0,a=r.length>>>1;for(var f=0;f>>r[f]&1;for(var f=a;f>>r[f]&1;i[s+0]=o>>>0,i[s+1]=u>>>0},n.expand=function(t,n,r){var i=0,s=0;i=(t&1)<<5|t>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=t>>>o&63;for(var o=11;o>=3;o-=4)s|=t>>>o&63,s<<=6;s|=(t&31)<<1|t>>>31,n[r+0]=i>>>0,n[r+1]=s>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];n.substitute=function(t,n){var r=0;for(var s=0;s<4;s++){var o=t>>>18-s*6&63,u=i[s*64+o];r<<=4,r|=u}for(var s=0;s<4;s++){var o=n>>>18-s*6&63,u=i[256+s*64+o];r<<=4,r|=u}return r>>>0};var s=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];n.permute=function(t){var n=0;for(var r=0;r>>s[r]&1;return n>>>0},n.padSplit=function(t,n,r){var i=t.toString(2);while(i.length0&&p.push(c),p.push(e),t&&p.push(t),c=r(n.concat(p)),p=[],h=0;if(i>0)for(;;){if(i===0)break;if(h===c.length)break;a[o++]=c[h],i--,h++}if(s>0&&h!==c.length)for(;;){if(s===0)break;if(h===c.length)break;f[u++]=c[h],s--,h++}if(i===0&&s===0)break}for(h=0;h=49&&o<=54?r|=o-49+10:o>=17&&o<=22?r|=o-17+10:r|=o&15}return r}function o(e,t,n,r){var i=0,s=Math.min(e.length,n);for(var o=t;o=49?i+=u-49+10:u>=17?i+=u-17+10:i+=u}return i}function l(e){var t=new Array(e.bitLength());for(var n=0;n>>i}return t}function c(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=e.words[0]|0,s=t.words[0]|0,o=i*s,u=o&67108863,a=o/67108864|0;n.words[0]=u;for(var f=1;f>>26,c=a&67108863,h=Math.min(f,t.length-1);for(var p=Math.max(0,f-e.length+1);p<=h;p++){var d=f-p|0;i=e.words[d]|0,s=t.words[p]|0,o=i*s+c,l+=o/67108864|0,c=o&67108863}n.words[f]=c|0,a=l|0}return a!==0?n.words[f]=a|0:n.length--,n.strip()}function p(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;var r=0,i=0;for(var s=0;s>>26)|0,i+=o>>>26,o&=67108863}n.words[s]=u,r=o,o=i}return r!==0?n.words[s]=r:n.length--,n.strip()}function d(e,t,n){var r=new v;return r.mulp(e,t,n)}function v(e,t){this.x=e,this.y=t}function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=(new i(1)).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if(typeof e=="string"){var t=i._prime(e);this.m=t.p,this.prime=t}else this.m=e,this.prime=null}function x(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=(new i(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)}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26,i.max=function(t,n){return t.cmp(n)>0?t:n},i.min=function(t,n){return t.cmp(n)<0?t:n},i.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),n(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var s=0;t[0]==="-"&&s++,r===16?this._parseHex(t,s):this._parseBase(t,r,s),t[0]==="-"&&(this.negative=1),this.strip();if(i!=="le")return;this._initArray(this.toArray(),r,i)},i.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3);if(i!=="le")return;this._initArray(this.toArray(),r,i)},i.prototype._initArray=function(t,r,i){n(typeof t.length=="number");if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var s=0;s=0;s-=3)u=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[o]|=u<>>26-a&67108863,a+=24,a>=26&&(a-=26,o++);else if(i==="le")for(s=0,o=0;s>>26-a&67108863,a+=24,a>=26&&(a-=26,o++);return this.strip()},i.prototype._parseHex=function(t,n){this.length=Math.ceil((t.length-n)/6),this.words=new Array(this.length);for(var r=0;r=n;r-=6)o=s(t,r,r+6),this.words[i]|=o<>>26-u&4194303,u+=24,u>=26&&(u-=26,i++);r+6!==n&&(o=s(t,n,r+6),this.words[i]|=o<>>26-u&4194303),this.strip()},i.prototype._parseBase=function(t,n,r){this.words=[0],this.length=1;for(var i=0,s=1;s<=67108863;s*=n)i++;i--,s=s/n|0;var u=t.length-r,a=u%i,f=Math.min(u,u-a)+r,l=0;for(var c=r;c1&&this.words[this.length-1]===0)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","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"],a=[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],f=[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];i.prototype.toString=function T(e,t){e=e||10,t=t|0||1;var r;if(e===16||e==="hex"){r="";var i=0,s=0;for(var o=0;o>>24-i&16777215,s!==0||o!==this.length-1?r=u[6-c.length]+c+r:r=c+r,i+=2,i>=26&&(i-=26,o--)}s!==0&&(r=s.toString(16)+r);while(r.length%t!==0)r="0"+r;return this.negative!==0&&(r="-"+r),r}if(e===(e|0)&&e>=2&&e<=36){var h=a[e],p=f[e];r="";var d=this.clone();d.negative=0;while(!d.isZero()){var v=d.modn(p).toString(e);d=d.idivn(p),d.isZero()?r=v+r:r=u[h-v.length]+v+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return this.negative!==0&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){return n(this.bitLength()<=53,"Number can only safely store up to 53 bits"),parseInt(this.toString(),10)},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(t,r){var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0"),this.strip();var o=t==="le",u=new Array(s),a,f,l=this.clone();if(!o){for(f=0;f=4096&&(r+=13,n>>>=13),n>=64&&(r+=7,n>>>=7),n>=8&&(r+=4,n>>>=4),n>=2&&(r+=2,n>>>=2),r+n},i.prototype._zeroBits=function(t){if(t===0)return 26;var n=t,r=0;return(n&8191)===0&&(r+=13,n>>>=13),(n&127)===0&&(r+=7,n>>>=7),(n&15)===0&&(r+=4,n>>>=4),(n&3)===0&&(r+=2,n>>>=2),(n&1)===0&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],n=this._countBits(t);return(this.length-1)*26+n},i.prototype.zeroBits=function(){if(this.isZero())return 0;var t=0;for(var n=0;nt.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var n;this.length>t.length?n=t:n=this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var n,r;this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;while(this.length0&&r--;for(var s=0;s0&&(this.words[s]=~this.words[s]&67108863>>26-i),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,r){n(typeof t=="number"&&t>=0);var i=t/26|0,s=t%26;while(this.length<=i)this.words[this.length++]=0;return r?this.words[i]=this.words[i]|1<t.length?(r=this,i=t):(r=t,i=this);var s=0;for(var o=0;o>>26;for(;s!==0&&o>>26;this.length=r.length;if(s!==0)this.words[this.length]=s,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var n=this.iadd(t);return t.negative=1,n._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(r===0)return this.negative=0,this.length=1,this.words[0]=0,this;var i,s;r>0?(i=this,s=t):(i=t,s=this);var o=0;for(var u=0;u>26,this.words[u]=n&67108863;for(;o!==0&&u>26,this.words[u]=n&67108863;if(o===0&&u>>13,d=i[1]|0,v=d&8191,m=d>>>13,g=i[2]|0,y=g&8191,b=g>>>13,w=i[3]|0,E=w&8191,S=w>>>13,x=i[4]|0,T=x&8191,N=x>>>13,C=i[5]|0,k=C&8191,L=C>>>13,A=i[6]|0,O=A&8191,M=A>>>13,_=i[7]|0,D=_&8191,P=_>>>13,H=i[8]|0,B=H&8191,j=H>>>13,F=i[9]|0,I=F&8191,q=F>>>13,R=s[0]|0,U=R&8191,z=R>>>13,W=s[1]|0,X=W&8191,V=W>>>13,$=s[2]|0,J=$&8191,K=$>>>13,Q=s[3]|0,G=Q&8191,Y=Q>>>13,Z=s[4]|0,et=Z&8191,tt=Z>>>13,nt=s[5]|0,rt=nt&8191,it=nt>>>13,st=s[6]|0,ot=st&8191,ut=st>>>13,at=s[7]|0,ft=at&8191,lt=at>>>13,ct=s[8]|0,ht=ct&8191,pt=ct>>>13,dt=s[9]|0,vt=dt&8191,mt=dt>>>13;r.length=19,a=Math.imul(h,U),f=Math.imul(h,z),f+=Math.imul(p,U),l=Math.imul(p,z);var gt=u+a+((f&8191)<<13);u=l+(f>>>13)+(gt>>>26),gt&=67108863,a=Math.imul(v,U),f=Math.imul(v,z),f+=Math.imul(m,U),l=Math.imul(m,z),a+=Math.imul(h,X),f+=Math.imul(h,V),f+=Math.imul(p,X),l+=Math.imul(p,V);var yt=u+a+((f&8191)<<13);u=l+(f>>>13)+(yt>>>26),yt&=67108863,a=Math.imul(y,U),f=Math.imul(y,z),f+=Math.imul(b,U),l=Math.imul(b,z),a+=Math.imul(v,X),f+=Math.imul(v,V),f+=Math.imul(m,X),l+=Math.imul(m,V),a+=Math.imul(h,J),f+=Math.imul(h,K),f+=Math.imul(p,J),l+=Math.imul(p,K);var bt=u+a+((f&8191)<<13);u=l+(f>>>13)+(bt>>>26),bt&=67108863,a=Math.imul(E,U),f=Math.imul(E,z),f+=Math.imul(S,U),l=Math.imul(S,z),a+=Math.imul(y,X),f+=Math.imul(y,V),f+=Math.imul(b,X),l+=Math.imul(b,V),a+=Math.imul(v,J),f+=Math.imul(v,K),f+=Math.imul(m,J),l+=Math.imul(m,K),a+=Math.imul(h,G),f+=Math.imul(h,Y),f+=Math.imul(p,G),l+=Math.imul(p,Y);var wt=u+a+((f&8191)<<13);u=l+(f>>>13)+(wt>>>26),wt&=67108863,a=Math.imul(T,U),f=Math.imul(T,z),f+=Math.imul(N,U),l=Math.imul(N,z),a+=Math.imul(E,X),f+=Math.imul(E,V),f+=Math.imul(S,X),l+=Math.imul(S,V),a+=Math.imul(y,J),f+=Math.imul(y,K),f+=Math.imul(b,J),l+=Math.imul(b,K),a+=Math.imul(v,G),f+=Math.imul(v,Y),f+=Math.imul(m,G),l+=Math.imul(m,Y),a+=Math.imul(h,et),f+=Math.imul(h,tt),f+=Math.imul(p,et),l+=Math.imul(p,tt);var Et=u+a+((f&8191)<<13);u=l+(f>>>13)+(Et>>>26),Et&=67108863,a=Math.imul(k,U),f=Math.imul(k,z),f+=Math.imul(L,U),l=Math.imul(L,z),a+=Math.imul(T,X),f+=Math.imul(T,V),f+=Math.imul(N,X),l+=Math.imul(N,V),a+=Math.imul(E,J),f+=Math.imul(E,K),f+=Math.imul(S,J),l+=Math.imul(S,K),a+=Math.imul(y,G),f+=Math.imul(y,Y),f+=Math.imul(b,G),l+=Math.imul(b,Y),a+=Math.imul(v,et),f+=Math.imul(v,tt),f+=Math.imul(m,et),l+=Math.imul(m,tt),a+=Math.imul(h,rt),f+=Math.imul(h,it),f+=Math.imul(p,rt),l+=Math.imul(p,it);var St=u+a+((f&8191)<<13);u=l+(f>>>13)+(St>>>26),St&=67108863,a=Math.imul(O,U),f=Math.imul(O,z),f+=Math.imul(M,U),l=Math.imul(M,z),a+=Math.imul(k,X),f+=Math.imul(k,V),f+=Math.imul(L,X),l+=Math.imul(L,V),a+=Math.imul(T,J),f+=Math.imul(T,K),f+=Math.imul(N,J),l+=Math.imul(N,K),a+=Math.imul(E,G),f+=Math.imul(E,Y),f+=Math.imul(S,G),l+=Math.imul(S,Y),a+=Math.imul(y,et),f+=Math.imul(y,tt),f+=Math.imul(b,et),l+=Math.imul(b,tt),a+=Math.imul(v,rt),f+=Math.imul(v,it),f+=Math.imul(m,rt),l+=Math.imul(m,it),a+=Math.imul(h,ot),f+=Math.imul(h,ut),f+=Math.imul(p,ot),l+=Math.imul(p,ut);var xt=u+a+((f&8191)<<13);u=l+(f>>>13)+(xt>>>26),xt&=67108863,a=Math.imul(D,U),f=Math.imul(D,z),f+=Math.imul(P,U),l=Math.imul(P,z),a+=Math.imul(O,X),f+=Math.imul(O,V),f+=Math.imul(M,X),l+=Math.imul(M,V),a+=Math.imul(k,J),f+=Math.imul(k,K),f+=Math.imul(L,J),l+=Math.imul(L,K),a+=Math.imul(T,G),f+=Math.imul(T,Y),f+=Math.imul(N,G),l+=Math.imul(N,Y),a+=Math.imul(E,et),f+=Math.imul(E,tt),f+=Math.imul(S,et),l+=Math.imul(S,tt),a+=Math.imul(y,rt),f+=Math.imul(y,it),f+=Math.imul(b,rt),l+=Math.imul(b,it),a+=Math.imul(v,ot),f+=Math.imul(v,ut),f+=Math.imul(m,ot),l+=Math.imul(m,ut),a+=Math.imul(h,ft),f+=Math.imul(h,lt),f+=Math.imul(p,ft),l+=Math.imul(p,lt);var Tt=u+a+((f&8191)<<13);u=l+(f>>>13)+(Tt>>>26),Tt&=67108863,a=Math.imul(B,U),f=Math.imul(B,z),f+=Math.imul(j,U),l=Math.imul(j,z),a+=Math.imul(D,X),f+=Math.imul(D,V),f+=Math.imul(P,X),l+=Math.imul(P,V),a+=Math.imul(O,J),f+=Math.imul(O,K),f+=Math.imul(M,J),l+=Math.imul(M,K),a+=Math.imul(k,G),f+=Math.imul(k,Y),f+=Math.imul(L,G),l+=Math.imul(L,Y),a+=Math.imul(T,et),f+=Math.imul(T,tt),f+=Math.imul(N,et),l+=Math.imul(N,tt),a+=Math.imul(E,rt),f+=Math.imul(E,it),f+=Math.imul(S,rt),l+=Math.imul(S,it),a+=Math.imul(y,ot),f+=Math.imul(y,ut),f+=Math.imul(b,ot),l+=Math.imul(b,ut),a+=Math.imul(v,ft),f+=Math.imul(v,lt),f+=Math.imul(m,ft),l+=Math.imul(m,lt),a+=Math.imul(h,ht),f+=Math.imul(h,pt),f+=Math.imul(p,ht),l+=Math.imul(p,pt);var Nt=u+a+((f&8191)<<13);u=l+(f>>>13)+(Nt>>>26),Nt&=67108863,a=Math.imul(I,U),f=Math.imul(I,z),f+=Math.imul(q,U),l=Math.imul(q,z),a+=Math.imul(B,X),f+=Math.imul(B,V),f+=Math.imul(j,X),l+=Math.imul(j,V),a+=Math.imul(D,J),f+=Math.imul(D,K),f+=Math.imul(P,J),l+=Math.imul(P,K),a+=Math.imul(O,G),f+=Math.imul(O,Y),f+=Math.imul(M,G),l+=Math.imul(M,Y),a+=Math.imul(k,et),f+=Math.imul(k,tt),f+=Math.imul(L,et),l+=Math.imul(L,tt),a+=Math.imul(T,rt),f+=Math.imul(T,it),f+=Math.imul(N,rt),l+=Math.imul(N,it),a+=Math.imul(E,ot),f+=Math.imul(E,ut),f+=Math.imul(S,ot),l+=Math.imul(S,ut),a+=Math.imul(y,ft),f+=Math.imul(y,lt),f+=Math.imul(b,ft),l+=Math.imul(b,lt),a+=Math.imul(v,ht),f+=Math.imul(v,pt),f+=Math.imul(m,ht),l+=Math.imul(m,pt),a+=Math.imul(h,vt),f+=Math.imul(h,mt),f+=Math.imul(p,vt),l+=Math.imul(p,mt);var Ct=u+a+((f&8191)<<13);u=l+(f>>>13)+(Ct>>>26),Ct&=67108863,a=Math.imul(I,X),f=Math.imul(I,V),f+=Math.imul(q,X),l=Math.imul(q,V),a+=Math.imul(B,J),f+=Math.imul(B,K),f+=Math.imul(j,J),l+=Math.imul(j,K),a+=Math.imul(D,G),f+=Math.imul(D,Y),f+=Math.imul(P,G),l+=Math.imul(P,Y),a+=Math.imul(O,et),f+=Math.imul(O,tt),f+=Math.imul(M,et),l+=Math.imul(M,tt),a+=Math.imul(k,rt),f+=Math.imul(k,it),f+=Math.imul(L,rt),l+=Math.imul(L,it),a+=Math.imul(T,ot),f+=Math.imul(T,ut),f+=Math.imul(N,ot),l+=Math.imul(N,ut),a+=Math.imul(E,ft),f+=Math.imul(E,lt),f+=Math.imul(S,ft),l+=Math.imul(S,lt),a+=Math.imul(y,ht),f+=Math.imul(y,pt),f+=Math.imul(b,ht),l+=Math.imul(b,pt),a+=Math.imul(v,vt),f+=Math.imul(v,mt),f+=Math.imul(m,vt),l+=Math.imul(m,mt);var kt=u+a+((f&8191)<<13);u=l+(f>>>13)+(kt>>>26),kt&=67108863,a=Math.imul(I,J),f=Math.imul(I,K),f+=Math.imul(q,J),l=Math.imul(q,K),a+=Math.imul(B,G),f+=Math.imul(B,Y),f+=Math.imul(j,G),l+=Math.imul(j,Y),a+=Math.imul(D,et),f+=Math.imul(D,tt),f+=Math.imul(P,et),l+=Math.imul(P,tt),a+=Math.imul(O,rt),f+=Math.imul(O,it),f+=Math.imul(M,rt),l+=Math.imul(M,it),a+=Math.imul(k,ot),f+=Math.imul(k,ut),f+=Math.imul(L,ot),l+=Math.imul(L,ut),a+=Math.imul(T,ft),f+=Math.imul(T,lt),f+=Math.imul(N,ft),l+=Math.imul(N,lt),a+=Math.imul(E,ht),f+=Math.imul(E,pt),f+=Math.imul(S,ht),l+=Math.imul(S,pt),a+=Math.imul(y,vt),f+=Math.imul(y,mt),f+=Math.imul(b,vt),l+=Math.imul(b,mt);var Lt=u+a+((f&8191)<<13);u=l+(f>>>13)+(Lt>>>26),Lt&=67108863,a=Math.imul(I,G),f=Math.imul(I,Y),f+=Math.imul(q,G),l=Math.imul(q,Y),a+=Math.imul(B,et),f+=Math.imul(B,tt),f+=Math.imul(j,et),l+=Math.imul(j,tt),a+=Math.imul(D,rt),f+=Math.imul(D,it),f+=Math.imul(P,rt),l+=Math.imul(P,it),a+=Math.imul(O,ot),f+=Math.imul(O,ut),f+=Math.imul(M,ot),l+=Math.imul(M,ut),a+=Math.imul(k,ft),f+=Math.imul(k,lt),f+=Math.imul(L,ft),l+=Math.imul(L,lt),a+=Math.imul(T,ht),f+=Math.imul(T,pt),f+=Math.imul(N,ht),l+=Math.imul(N,pt),a+=Math.imul(E,vt),f+=Math.imul(E,mt),f+=Math.imul(S,vt),l+=Math.imul(S,mt);var At=u+a+((f&8191)<<13);u=l+(f>>>13)+(At>>>26),At&=67108863,a=Math.imul(I,et),f=Math.imul(I,tt),f+=Math.imul(q,et),l=Math.imul(q,tt),a+=Math.imul(B,rt),f+=Math.imul(B,it),f+=Math.imul(j,rt),l+=Math.imul(j,it),a+=Math.imul(D,ot),f+=Math.imul(D,ut),f+=Math.imul(P,ot),l+=Math.imul(P,ut),a+=Math.imul(O,ft),f+=Math.imul(O,lt),f+=Math.imul(M,ft),l+=Math.imul(M,lt),a+=Math.imul(k,ht),f+=Math.imul(k,pt),f+=Math.imul(L,ht),l+=Math.imul(L,pt),a+=Math.imul(T,vt),f+=Math.imul(T,mt),f+=Math.imul(N,vt),l+=Math.imul(N,mt);var Ot=u+a+((f&8191)<<13);u=l+(f>>>13)+(Ot>>>26),Ot&=67108863,a=Math.imul(I,rt),f=Math.imul(I,it),f+=Math.imul(q,rt),l=Math.imul(q,it),a+=Math.imul(B,ot),f+=Math.imul(B,ut),f+=Math.imul(j,ot),l+=Math.imul(j,ut),a+=Math.imul(D,ft),f+=Math.imul(D,lt),f+=Math.imul(P,ft),l+=Math.imul(P,lt),a+=Math.imul(O,ht),f+=Math.imul(O,pt),f+=Math.imul(M,ht),l+=Math.imul(M,pt),a+=Math.imul(k,vt),f+=Math.imul(k,mt),f+=Math.imul(L,vt),l+=Math.imul(L,mt);var Mt=u+ -a+((f&8191)<<13);u=l+(f>>>13)+(Mt>>>26),Mt&=67108863,a=Math.imul(I,ot),f=Math.imul(I,ut),f+=Math.imul(q,ot),l=Math.imul(q,ut),a+=Math.imul(B,ft),f+=Math.imul(B,lt),f+=Math.imul(j,ft),l+=Math.imul(j,lt),a+=Math.imul(D,ht),f+=Math.imul(D,pt),f+=Math.imul(P,ht),l+=Math.imul(P,pt),a+=Math.imul(O,vt),f+=Math.imul(O,mt),f+=Math.imul(M,vt),l+=Math.imul(M,mt);var _t=u+a+((f&8191)<<13);u=l+(f>>>13)+(_t>>>26),_t&=67108863,a=Math.imul(I,ft),f=Math.imul(I,lt),f+=Math.imul(q,ft),l=Math.imul(q,lt),a+=Math.imul(B,ht),f+=Math.imul(B,pt),f+=Math.imul(j,ht),l+=Math.imul(j,pt),a+=Math.imul(D,vt),f+=Math.imul(D,mt),f+=Math.imul(P,vt),l+=Math.imul(P,mt);var Dt=u+a+((f&8191)<<13);u=l+(f>>>13)+(Dt>>>26),Dt&=67108863,a=Math.imul(I,ht),f=Math.imul(I,pt),f+=Math.imul(q,ht),l=Math.imul(q,pt),a+=Math.imul(B,vt),f+=Math.imul(B,mt),f+=Math.imul(j,vt),l+=Math.imul(j,mt);var Pt=u+a+((f&8191)<<13);u=l+(f>>>13)+(Pt>>>26),Pt&=67108863,a=Math.imul(I,vt),f=Math.imul(I,mt),f+=Math.imul(q,vt),l=Math.imul(q,mt);var Ht=u+a+((f&8191)<<13);return u=l+(f>>>13)+(Ht>>>26),Ht&=67108863,o[0]=gt,o[1]=yt,o[2]=bt,o[3]=wt,o[4]=Et,o[5]=St,o[6]=xt,o[7]=Tt,o[8]=Nt,o[9]=Ct,o[10]=kt,o[11]=Lt,o[12]=At,o[13]=Ot,o[14]=Mt,o[15]=_t,o[16]=Dt,o[17]=Pt,o[18]=Ht,u!==0&&(o[19]=u,r.length++),r};Math.imul||(h=c),i.prototype.mulTo=function(t,n){var r,i=this.length+t.length;return this.length===10&&t.length===10?r=h(this,t,n):i<63?r=c(this,t,n):i<1024?r=p(this,t,n):r=d(this,t,n),r},v.prototype.makeRBT=function(t){var n=new Array(t),r=i.prototype._countBits(t)-1;for(var s=0;s>=1;return i},v.prototype.permute=function(t,n,r,i,s,o){for(var u=0;u>>=1)s++;return 1<>>=13,i[2*u+1]=o&8191,o>>>=13;for(u=2*r;u>=26,r+=s/67108864|0,r+=o>>>26,this.words[i]=o&67108863}return r!==0&&(this.words[i]=r,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var n=l(t);if(n.length===0)return new i(1);var r=this;for(var s=0;s=0);var r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r,o;if(r!==0){var u=0;for(o=0;o>>26-r}u&&(this.words[o]=u,this.length++)}if(i!==0){for(o=this.length-1;o>=0;o--)this.words[o+i]=this.words[o];for(o=0;o=0);var s;r?s=(r-r%26)/26:s=0;var o=t%26,u=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<u){this.length-=u;for(l=0;l=0&&(c!==0||l>=s);l--){var h=this.words[l]|0;this.words[l]=c<<26-o|h>>>o,c=h&a}return f&&c!==0&&(f.words[f.length++]=c),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,r,i){return n(this.negative===0),this.iushrn(t,r,i)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,s=1<=0);var r=t%26,i=(t-r)/26;n(this.negative===0,"imaskn works only with positive numbers"),r!==0&&i++,this.length=Math.min(i,this.length);if(r!==0){var s=67108863^67108863>>>r<=67108864;n++)this.words[n]-=67108864,n===this.length-1?this.words[n+1]=1:this.words[n+1]++;return this.length=Math.max(this.length,n+1),this},i.prototype.isubn=function(t){n(typeof t=="number");if(t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;this.words[0]-=t;if(this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r>26)-(l/67108864|0),this.words[o+i]=a&67108863}for(;o>26,this.words[o+i]=a&67108863;if(f===0)return this.strip();n(f===-1),f=0;for(o=0;o>26,this.words[o]=a&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,n){var r=this.length-t.length,s=this.clone(),o=t,u=o.words[o.length-1]|0,a=this._countBits(u);r=26-a,r!==0&&(o=o.ushln(r),s.iushln(r),u=o.words[o.length-1]|0);var f=s.length-o.length,l;if(n!=="mod"){l=new i(null),l.length=f+1,l.words=new Array(l.length);for(var c=0;c=0;p--){var d=(s.words[o.length+p]|0)*67108864+(s.words[o.length+p-1]|0);d=Math.min(d/u|0,67108863),s._ishlnsubmul(o,d,p);while(s.negative!==0)d--,s.negative=0,s._ishlnsubmul(o,1,p),s.isZero()||(s.negative^=1);l&&(l.words[p]=d)}return l&&l.strip(),s.strip(),n!=="div"&&r!==0&&s.iushrn(r),{div:l||null,mod:s}},i.prototype.divmod=function(t,r,s){n(!t.isZero());var o,u,a;return this.negative!==0&&t.negative===0?(a=this.neg().divmod(t,r),r!=="mod"&&(o=a.div.neg()),r!=="div"&&(u=a.mod.neg(),s&&u.neg&&(u=u.add(t))),{div:o,mod:u}):this.negative===0&&t.negative!==0?(a=this.divmod(t.neg(),r),r!=="mod"&&(o=a.div.neg()),{div:o,mod:a.mod}):(this.negative&t.negative)!==0?(a=this.neg().divmod(t.neg(),r),r!=="div"&&(u=a.mod.neg(),s&&u.neg&&(u=u.isub(t))),{div:a.div,mod:u}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,r)},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var n=this.divmod(t);if(n.mod.isZero())return n.div;var r=n.div.negative!==0?n.mod.isub(t):n.mod,i=t.ushrn(1),s=t.andln(1),o=r.cmp(i);return o<0||s===1&&o===0?n.div:n.div.negative!==0?n.div.isubn(1):n.div.iaddn(1)},i.prototype.modn=function(t){n(t<=67108863);var r=(1<<26)%t,i=0;for(var s=this.length-1;s>=0;s--)i=(r*i+(this.words[s]|0))%t;return i},i.prototype.idivn=function(t){n(t<=67108863);var r=0;for(var i=this.length-1;i>=0;i--){var s=(this.words[i]|0)+r*67108864;this.words[i]=s/t|0,r=s%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(t.negative===0),n(!t.isZero());var r=this,s=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();var o=new i(1),u=new i(0),a=new i(0),f=new i(1),l=0;while(r.isEven()&&s.isEven())r.iushrn(1),s.iushrn(1),++l;var c=s.clone(),h=r.clone();while(!r.isZero()){for(var p=0,d=1;(r.words[0]&d)===0&&p<26;++p,d<<=1);if(p>0){r.iushrn(p);while(p-->0){if(o.isOdd()||u.isOdd())o.iadd(c),u.isub(h);o.iushrn(1),u.iushrn(1)}}for(var v=0,m=1;(s.words[0]&m)===0&&v<26;++v,m<<=1);if(v>0){s.iushrn(v);while(v-->0){if(a.isOdd()||f.isOdd())a.iadd(c),f.isub(h);a.iushrn(1),f.iushrn(1)}}r.cmp(s)>=0?(r.isub(s),o.isub(a),u.isub(f)):(s.isub(r),a.isub(o),f.isub(u))}return{a:a,b:f,gcd:s.iushln(l)}},i.prototype._invmp=function(t){n(t.negative===0),n(!t.isZero());var r=this,s=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();var o=new i(1),u=new i(0),a=s.clone();while(r.cmpn(1)>0&&s.cmpn(1)>0){for(var f=0,l=1;(r.words[0]&l)===0&&f<26;++f,l<<=1);if(f>0){r.iushrn(f);while(f-->0)o.isOdd()&&o.iadd(a),o.iushrn(1)}for(var c=0,h=1;(s.words[0]&h)===0&&c<26;++c,h<<=1);if(c>0){s.iushrn(c);while(c-->0)u.isOdd()&&u.iadd(a),u.iushrn(1)}r.cmp(s)>=0?(r.isub(s),o.isub(u)):(s.isub(r),u.isub(o))}var p;return r.cmpn(1)===0?p=o:p=u,p.cmpn(0)<0&&p.iadd(t),p},i.prototype.gcd=function(t){if(this.isZero())return t.clone();if(t.isZero())return this.clone();var n=this.clone(),r=t.clone();n.negative=0,r.negative=0;for(var i=0;n.isEven()&&r.isEven();i++)n.iushrn(1),r.iushrn(1);do{while(n.isEven())n.iushrn(1);while(r.isEven())r.iushrn(1);var s=n.cmp(r);if(s<0){var o=n;n=r,r=o}else if(s===0||r.cmpn(1)===0)break;n.isub(r)}while(!0);return r.iushln(i)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n(typeof t=="number");var r=t%26,i=(t-r)/26,s=1<>>26,a&=67108863,this.words[o]=a}return u!==0&&(this.words[o]=u,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var s=this.words[0]|0;i=s===t?0:st.length)return 1;if(this.length=0;r--){var i=this.words[r]|0,s=t.words[r]|0;if(i===s)continue;is&&(n=1);break}return n},i.red=function(t){return new S(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.ushl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};g.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var n=t,r;do this.split(n,this.tmp),n=this.imulK(n),n=n.iadd(this.tmp),r=n.bitLength();while(r>this.n);var i=r0?n.isub(this.p):n.strip(),n},g.prototype.split=function(t,n){t.iushrn(this.n,0,n)},g.prototype.imulK=function(t){return t.imul(this.k)},r(y,g),y.prototype.split=function(t,n){var r=4194303,i=Math.min(t.length,9);for(var s=0;s>>22,o=u}t.words[s-10]=o>>>22,t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;var n=0;for(var r=0;r>>=26,t.words[r]=s,n=i}return n!==0&&(t.words[t.length++]=n),t},i._prime=function N(e){if(m[e])return m[e];var N;if(e==="k256")N=new y;else if(e==="p224")N=new b;else if(e==="p192")N=new w;else{if(e!=="p25519")throw new Error("Unknown prime "+e);N=new E}return m[e]=N,N},S.prototype._verify1=function(t){n(t.negative===0,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,r){n((t.negative|r.negative)===0,"red works only with positives"),n(t.red&&t.red===r.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){var n=t.clone();return n.negative^=1,n.iadd(this.m)._forceRed(this)},S.prototype.add=function(t,n){this._verify2(t,n);var r=t.add(n);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,n){this._verify2(t,n);var r=t.iadd(n);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,n){this._verify2(t,n);var r=t.sub(n);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,n){this._verify2(t,n);var r=t.isub(n);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,n){return this._verify1(t),this.imod(t.ushln(n))},S.prototype.imul=function(t,n){return this._verify2(t,n),this.imod(t.imul(n))},S.prototype.mul=function(t,n){return this._verify2(t,n),this.imod(t.mul(n))},S.prototype.isqr=function(t){return this.imul(t,t)},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);n(r%2===1);if(r===3){var s=this.m.add(new i(1)).iushrn(2);return this.pow(t,s)}var o=this.m.subn(1),u=0;while(!o.isZero()&&o.andln(1)===0)u++,o.iushrn(1);n(!o.isZero());var a=(new i(1)).toRed(this),f=a.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();c=(new i(2*c*c)).toRed(this);while(this.pow(c,l).cmp(f)!==0)c.redIAdd(f);var h=this.pow(c,o),p=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),v=u;while(d.cmp(a)!==0){var m=d;for(var g=0;m.cmp(a)!==0;g++)m=m.redSqr();n(g=0;o--){var c=n.words[o];for(var h=l-1;h>=0;h--){var p=c>>h&1;u!==s[0]&&(u=this.sqr(u));if(p===0&&a===0){f=0;continue}a<<=1,a|=p,f++;if(f!==r&&(o!==0||h!==0))continue;u=this.mul(u,s[a]),f=0,a=0}l=26}return u},S.prototype.convertTo=function(t){var n=t.umod(this.m);return n===t?n.clone():n},S.prototype.convertFrom=function(t){var n=t.clone();return n.red=null,n},i.mont=function(t){return new x(t)},r(x,S),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var n=this.imod(t.mul(this.rinv));return n.red=null,n},x.prototype.imul=function(t,n){if(t.isZero()||n.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(n),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=r.isub(i).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):s.cmpn(0)<0&&(o=s.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,n){if(t.isZero()||n.isZero())return(new i(0))._forceRed(this);var r=t.mul(n),s=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(s).iushrn(this.shift),u=o;return o.cmp(this.m)>=0?u=o.isub(this.m):o.cmpn(0)<0&&(u=o.iadd(this.m)),u._forceRed(this)},x.prototype.invm=function(t){var n=this.imod(t._invmp(this.m).mul(this.r2));return n._forceRed(this)}})(typeof t=="undefined"||t,this)},{}],127:[function(e,t,n){(function(n){function s(e){var t=u(e),n=t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed();return{blinder:n,unblinder:t.invm(e.modulus)}}function o(e,t){var i=s(t),o=t.modulus.byteLength(),u=r.mont(t.modulus),a=(new r(e)).mul(i.blinder).umod(t.modulus),f=a.toRed(r.mont(t.prime1)),l=a.toRed(r.mont(t.prime2)),c=t.coefficient,h=t.prime1,p=t.prime2,d=f.redPow(t.exponent1),v=l.redPow(t.exponent2);d=d.fromRed(),v=v.fromRed();var m=d.isub(v).imul(c).umod(h);return m.imul(p),v.iadd(m),new n(v.imul(i.unblinder).umod(t.modulus).toArray(!1,o))}function u(e){var t=e.modulus.byteLength(),n=new r(i(t));while(n.cmp(e.modulus)>=0||!n.umod(e.prime1)||!n.umod(e.prime2))n=new r(i(t));return n}var r=e("bn.js"),i=e("randombytes");t.exports=o,o.getr=u}).call(this,e("buffer").Buffer)},{"bn.js":126,buffer:89,randombytes:284}],128:[function(e,t,n){"use strict";var r=n;r.version=e("../package.json").version,r.utils=e("./elliptic/utils"),r.rand=e("brorand"),r.hmacDRBG=e("./elliptic/hmac-drbg"),r.curve=e("./elliptic/curve"),r.curves=e("./elliptic/curves"),r.ec=e("./elliptic/ec"),r.eddsa=e("./elliptic/eddsa")},{"../package.json":151,"./elliptic/curve":131,"./elliptic/curves":134,"./elliptic/ec":135,"./elliptic/eddsa":138,"./elliptic/hmac-drbg":141,"./elliptic/utils":143,brorand:144}],129:[function(e,t,n){"use strict";function f(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=(new r(0)).toRed(this.red),this.one=(new r(1)).toRed(this.red),this.two=(new r(2)).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function l(e,t){this.curve=e,this.type=t,this.precomputed=null}var r=e("bn.js"),i=e("../../elliptic"),s=i.utils,o=s.getNAF,u=s.getJSF,a=s.assert;t.exports=f,f.prototype.point=function(){throw new Error("Not implemented")},f.prototype.validate=function(){throw new Error("Not implemented")},f.prototype._fixedNafMul=function(t,n){a(t.precomputed);var r=t._getDoubles(),i=o(n,1),s=(1<=f;n--)l=(l<<1)+i[n];u.push(l)}var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null);for(var p=s;p>0;p--){for(var f=0;f=0;l--){for(var n=0;l>=0&&u[l]===0;l--)n++;l>=0&&n++,f=f.dblp(n);if(l<0)break;var c=u[l];a(c!==0),t.type==="affine"?c>0?f=f.mixedAdd(s[c-1>>1]):f=f.mixedAdd(s[-c-1>>1].neg()):c>0?f=f.add(s[c-1>>1]):f=f.add(s[-c-1>>1].neg())}return t.type==="affine"?f.toP():f},f.prototype._wnafMulAdd=function(t,n,r,i){var s=this._wnafT1,a=this._wnafT2,f=this._wnafT3,l=0;for(var c=0;c=1;c-=2){var d=c-1,v=c;if(s[d]!==1||s[v]!==1){f[d]=o(r[d],s[d]),f[v]=o(r[v],s[v]),l=Math.max(f[d].length,l),l=Math.max(f[v].length,l);continue}var m=[n[d],null,null,n[v]];n[d].y.cmp(n[v].y)===0?(m[1]=n[d].add(n[v]),m[2]=n[d].toJ().mixedAdd(n[v].neg())):n[d].y.cmp(n[v].y.redNeg())===0?(m[1]=n[d].toJ().mixedAdd(n[v]),m[2]=n[d].add(n[v].neg())):(m[1]=n[d].toJ().mixedAdd(n[v]),m[2]=n[d].toJ().mixedAdd(n[v].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=u(r[d],r[v]);l=Math.max(y[0].length,l),f[d]=new Array(l),f[v]=new Array(l);for(var b=0;b=0;c--){var T=0;while(c>=0){var N=!0;for(var b=0;b=0&&T++,S=S.dblp(T);if(c<0)break;for(var b=0;b0?h=a[b][C-1>>1]:C<0&&(h=a[b][-C-1>>1].neg()),h.type==="affine"?S=S.mixedAdd(h):S=S.add(h)}}for(var c=0;c=Math.ceil((t.bitLength()+1)/n.step):!1},l.prototype._getDoubles=function(t,n){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var r=[this],i=this;for(var s=0;s":""},l.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&this.y.cmp(this.z)===0},l.prototype._extDbl=function(){var t=this.x.redSqr(),n=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),s=this.x.redAdd(this.y).redSqr().redISub(t).redISub(n),o=i.redAdd(n),u=o.redSub(r),a=i.redSub(n),f=s.redMul(u),l=o.redMul(a),c=s.redMul(a),h=u.redMul(o);return this.curve.point(f,l,h,c)},l.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),r=this.y.redSqr(),i,s,o;if(this.curve.twisted){var u=this.curve._mulA(n),a=u.redAdd(r);if(this.zOne)i=t.redSub(n).redSub(r).redMul(a.redSub(this.curve.two)),s=a.redMul(u.redSub(r)),o=a.redSqr().redSub(a).redSub(a);else{var f=this.z.redSqr(),l=a.redSub(f).redISub(f);i=t.redSub(n).redISub(r).redMul(l),s=a.redMul(u.redSub(r)),o=a.redMul(l)}}else{var u=n.redAdd(r),f=this.curve._mulC(this.c.redMul(this.z)).redSqr(),l=u.redSub(f).redSub(f);i=this.curve._mulC(t.redISub(u)).redMul(l),s=this.curve._mulC(u).redMul(n.redISub(r)),o=u.redMul(l)}return this.curve.point(i,s,o)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(t){var n=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),s=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(n),u=s.redSub(i),a=s.redAdd(i),f=r.redAdd(n),l=o.redMul(u),c=a.redMul(f),h=o.redMul(f),p=u.redMul(a);return this.curve.point(l,c,p,h)},l.prototype._projAdd=function(t){var n=this.z.redMul(t.z),r=n.redSqr(),i=this.x.redMul(t.x),s=this.y.redMul(t.y),o=this.curve.d.redMul(i).redMul(s),u=r.redSub(o),a=r.redAdd(o),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(i).redISub(s),l=n.redMul(u).redMul(f),c,h;return this.curve.twisted?(c=n.redMul(a).redMul(s.redSub(this.curve._mulA(i))),h=u.redMul(a)):(c=n.redMul(a).redMul(s.redSub(i)),h=this.curve._mulC(u).redMul(a)),this.curve.point(l,c,h)},l.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},l.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},l.prototype.mulAdd=function(t,n,r){return this.curve._wnafMulAdd(1,[this,n],[t,r],2)},l.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../../elliptic":128,"../curve":131,"bn.js":126,inherits:286}],131:[function(e,t,n){"use strict";var r=n;r.base=e("./base"),r.short=e("./short"),r.mont=e("./mont"),r.edwards=e("./edwards")},{"./base":129,"./edwards":130,"./mont":132,"./short":133}],132:[function(e,t,n){"use strict";function f(e){o.call(this,"mont",e),this.a=(new i(e.a,16)).toRed(this.red),this.b=(new i(e.b,16)).toRed(this.red),this.i4=(new i(4)).toRed(this.red).redInvm(),this.two=(new i(2)).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function l(e,t,n){o.BasePoint.call(this,e,"projective"),t===null&&n===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red) -),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var r=e("../curve"),i=e("bn.js"),s=e("inherits"),o=r.base,u=e("../../elliptic"),a=u.utils;s(f,o),t.exports=f,f.prototype.validate=function(t){var n=t.normalize().x,r=n.redSqr(),i=r.redMul(n).redAdd(r.redMul(this.a)).redAdd(n),s=i.redSqrt();return s.redSqr().cmp(i)===0},s(l,o.BasePoint),f.prototype.decodePoint=function(t,n){return this.point(a.toArray(t,n),1)},f.prototype.point=function(t,n){return new l(this,t,n)},f.prototype.pointFromJSON=function(t){return l.fromJSON(this,t)},l.prototype.precompute=function(){},l.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},l.fromJSON=function(t,n){return new l(t,n[0],n[1]||t.one)},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return this.z.cmpn(0)===0},l.prototype.dbl=function(){var t=this.x.redAdd(this.z),n=t.redSqr(),r=this.x.redSub(this.z),i=r.redSqr(),s=n.redSub(i),o=n.redMul(i),u=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(o,u)},l.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.diffAdd=function(t,n){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=t.x.redAdd(t.z),o=t.x.redSub(t.z),u=o.redMul(r),a=s.redMul(i),f=n.z.redMul(u.redAdd(a).redSqr()),l=n.x.redMul(u.redISub(a).redSqr());return this.curve.point(f,l)},l.prototype.mul=function(t){var n=t.clone(),r=this,i=this.curve.point(null,null),s=this;for(var o=[];n.cmpn(0)!==0;n.iushrn(1))o.push(n.andln(1));for(var u=o.length-1;u>=0;u--)o[u]===0?(r=r.diffAdd(i,s),i=i.dbl()):(i=r.diffAdd(i,s),r=r.dbl());return i},l.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.eq=function(t){return this.getX().cmp(t.getX())===0},l.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":128,"../curve":131,"bn.js":126,inherits:286}],133:[function(e,t,n){"use strict";function f(e){u.call(this,"short",e),this.a=(new s(e.a,16)).toRed(this.red),this.b=(new s(e.b,16)).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function l(e,t,n,r){u.BasePoint.call(this,e,"affine"),t===null&&n===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new s(t,16),this.y=new s(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(e,t,n,r){u.BasePoint.call(this,e,"jacobian"),t===null&&n===null&&r===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new s(0)):(this.x=new s(t,16),this.y=new s(n,16),this.z=new s(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var r=e("../curve"),i=e("../../elliptic"),s=e("bn.js"),o=e("inherits"),u=r.base,a=i.utils.assert;o(f,u),t.exports=f,f.prototype._getEndomorphism=function(t){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var n,r;if(t.beta)n=(new s(t.beta,16)).toRed(this.red);else{var i=this._getEndoRoots(this.p);n=i[0].cmp(i[1])<0?i[0]:i[1],n=n.toRed(this.red)}if(t.lambda)r=new s(t.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(n))===0?r=o[0]:(r=o[1],a(this.g.mul(r).x.cmp(this.g.x.redMul(n))===0))}var u;return t.basis?u=t.basis.map(function(e){return{a:new s(e.a,16),b:new s(e.b,16)}}):u=this._getEndoBasis(r),{beta:n,lambda:r,basis:u}},f.prototype._getEndoRoots=function(t){var n=t===this.p?this.red:s.mont(t),r=(new s(2)).toRed(n).redInvm(),i=r.redNeg(),o=(new s(3)).toRed(n).redNeg().redSqrt().redMul(r),u=i.redAdd(o).fromRed(),a=i.redSub(o).fromRed();return[u,a]},f.prototype._getEndoBasis=function(t){var n=this.n.ushrn(Math.floor(this.n.bitLength()/2)),r=t,i=this.n.clone(),o=new s(1),u=new s(0),a=new s(0),f=new s(1),l,c,h,p,d,v,m,g=0,y,b;while(r.cmpn(0)!==0){var w=i.div(r);y=i.sub(w.mul(r)),b=a.sub(w.mul(o));var E=f.sub(w.mul(u));if(!h&&y.cmp(n)<0)l=m.neg(),c=o,h=y.neg(),p=b;else if(h&&++g===2)break;m=y,i=r,r=y,a=o,o=b,f=u,u=E}d=y.neg(),v=b;var S=h.sqr().add(p.sqr()),x=d.sqr().add(v.sqr());return x.cmp(S)>=0&&(d=l,v=c),h.negative&&(h=h.neg(),p=p.neg()),d.negative&&(d=d.neg(),v=v.neg()),[{a:h,b:p},{a:d,b:v}]},f.prototype._endoSplit=function(t){var n=this.endo.basis,r=n[0],i=n[1],s=i.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),u=s.mul(r.a),a=o.mul(i.a),f=s.mul(r.b),l=o.mul(i.b),c=t.sub(u).sub(a),h=f.add(l).neg();return{k1:c,k2:h}},f.prototype.pointFromX=function(t,n){t=new s(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt(),o=i.fromRed().isOdd();if(n&&!o||!n&&o)i=i.redNeg();return this.point(t,i)},f.prototype.validate=function(t){if(t.inf)return!0;var n=t.x,r=t.y,i=this.a.redMul(n),s=n.redSqr().redMul(n).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(s).cmpn(0)===0},f.prototype._endoWnafMulAdd=function(t,n){var r=this._endoWnafT1,i=this._endoWnafT2;for(var s=0;s":""},l.prototype.isInfinity=function(){return this.inf},l.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var n=this.y.redSub(t.y);n.cmpn(0)!==0&&(n=n.redMul(this.x.redSub(t.x).redInvm()));var r=n.redSqr().redISub(this.x).redISub(t.x),i=n.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},l.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var n=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),s=r.redAdd(r).redIAdd(r).redIAdd(n).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,u)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(t){return t=new s(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},l.prototype.mulAdd=function(t,n,r){var i=[this,n],s=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},l.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},l.prototype.neg=function(t){if(this.inf)return this;var n=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};n.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return n},l.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t},o(c,u.BasePoint),f.prototype.jpoint=function(t,n,r){return new c(this,t,n,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),n=t.redSqr(),r=this.x.redMul(n),i=this.y.redMul(n).redMul(t);return this.curve.point(r,i)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var n=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(n),s=t.x.redMul(r),o=this.y.redMul(n.redMul(t.z)),u=t.y.redMul(r.redMul(this.z)),a=i.redSub(s),f=o.redSub(u);if(a.cmpn(0)===0)return f.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),c=l.redMul(a),h=i.redMul(l),p=f.redSqr().redIAdd(c).redISub(h).redISub(h),d=f.redMul(h.redISub(p)).redISub(o.redMul(c)),v=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(p,d,v)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var n=this.z.redSqr(),r=this.x,i=t.x.redMul(n),s=this.y,o=t.y.redMul(n).redMul(this.z),u=r.redSub(i),a=s.redSub(o);if(u.cmpn(0)===0)return a.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=u.redSqr(),l=f.redMul(u),c=r.redMul(f),h=a.redSqr().redIAdd(l).redISub(c).redISub(c),p=a.redMul(c.redISub(h)).redISub(s.redMul(l)),d=this.z.redMul(u);return this.curve.jpoint(h,p,d)},c.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var n=this;for(var r=0;r":""},c.prototype.isInfinity=function(){return this.z.cmpn(0)===0}},{"../../elliptic":128,"../curve":131,"bn.js":126,inherits:286}],134:[function(e,t,n){"use strict";function u(e){e.type==="short"?this.curve=new s.curve.short(e):e.type==="edwards"?this.curve=new s.curve.edwards(e):this.curve=new s.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new u(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}var r=n,i=e("hash.js"),s=e("../elliptic"),o=s.utils.assert;r.PresetCurve=u,a("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:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:i.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"]}),a("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:i.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),a("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:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var f;try{f=e("./precomputed/secp256k1")}catch(l){f=undefined}a("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:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})},{"../elliptic":128,"./precomputed/secp256k1":142,"hash.js":145}],135:[function(e,t,n){"use strict";function f(e){if(!(this instanceof f))return new f(e);typeof e=="string"&&(o(i.curves.hasOwnProperty(e),"Unknown curve "+e),e=i.curves[e]),e instanceof i.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var r=e("bn.js"),i=e("../../elliptic"),s=i.utils,o=s.assert,u=e("./key"),a=e("./signature");t.exports=f,f.prototype.keyPair=function(t){return new u(this,t)},f.prototype.keyFromPrivate=function(t,n){return u.fromPrivate(this,t,n)},f.prototype.keyFromPublic=function(t,n){return u.fromPublic(this,t,n)},f.prototype.genKeyPair=function(t){t||(t={});var n=new i.hmacDRBG({hash:this.hash,pers:t.pers,entropy:t.entropy||i.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),s=this.n.byteLength(),o=this.n.sub(new r(2));do{var u=new r(n.generate(s));if(u.cmp(o)>0)continue;return u.iaddn(1),this.keyFromPrivate(u)}while(!0)},f.prototype._truncateToN=function(t,n){var r=t.byteLength()*8-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!n&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,n,s,o){typeof s=="object"&&(o=s,s=null),o||(o={}),n=this.keyFromPrivate(n,s),t=this._truncateToN(new r(t,16));var u=this.n.byteLength(),f=n.getPrivate().toArray("be",u),l=t.toArray("be",u),c=new i.hmacDRBG({hash:this.hash,entropy:f,nonce:l}),h=this.n.sub(new r(1));for(var p=0;!0;p++){var d=o.k?o.k(p):new r(c.generate(this.n.byteLength()));d=this._truncateToN(d,!0);if(d.cmpn(1)<=0||d.cmp(h)>=0)continue;var v=this.g.mul(d);if(v.isInfinity())continue;var m=v.getX(),g=m.umod(this.n);if(g.cmpn(0)===0)continue;var y=d.invm(this.n).mul(g.mul(n.getPrivate()).iadd(t));y=y.umod(this.n);if(y.cmpn(0)===0)continue;var b=(v.getY().isOdd()?1:0)|(m.cmp(g)!==0?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),b^=1),new a({r:g,s:y,recoveryParam:b})}},f.prototype.verify=function(t,n,i,s){t=this._truncateToN(new r(t,16)),i=this.keyFromPublic(i,s),n=new a(n,"hex");var o=n.r,u=n.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var f=u.invm(this.n),l=f.mul(t).umod(this.n),c=f.mul(o).umod(this.n),h=this.g.mulAdd(l,i.getPublic(),c);return h.isInfinity()?!1:h.getX().umod(this.n).cmp(o)===0},f.prototype.recoverPubKey=function(e,t,n,i){o((3&n)===n,"The recovery param is more than two bits"),t=new a(t,i);var s=this.n,u=new r(e),f=t.r,l=t.s,c=n&1,h=n>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");h?f=this.curve.pointFromX(f.add(this.curve.n),c):f=this.curve.pointFromX(f,c);var p=s.sub(u),d=t.r.invm(s);return f.mul(l).add(this.g.mul(p)).mul(d)},f.prototype.getKeyRecoveryParam=function(e,t,n,r){t=new a(t,r);if(t.recoveryParam!==null)return t.recoveryParam;for(var i=0;i<4;i++){var s=this.recoverPubKey(e,t,i);if(s.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":128,"./key":136,"./signature":137,"bn.js":126}],136:[function(e,t,n){"use strict";function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var r=e("bn.js");t.exports=i,i.fromPublic=function(t,n,r){return n instanceof i?n:new i(t,{pub:n,pubEnc:r})},i.fromPrivate=function(t,n,r){return n instanceof i?n:new i(t,{priv:n,privEnc:r})},i.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},i.prototype.getPublic=function(t,n){return typeof t=="string"&&(n=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),n?this.pub.encode(n,t):this.pub},i.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(t,n){this.priv=new r(t,n||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(t,n){if(t.x||t.y){this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,n)},i.prototype.derive=function(t){return t.mul(this.priv).getX()},i.prototype.sign=function(t,n,r){return this.ec.sign(t,this,n,r)},i.prototype.verify=function(t,n){return this.ec.verify(t,n,this)},i.prototype.inspect=function(){return""}},{"bn.js":126}],137:[function(e,t,n){"use strict";function u(e,t){if(e instanceof u)return e;if(this._importDER(e,t))return;o(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),e.recoveryParam!==null?this.recoveryParam=e.recoveryParam:this.recoveryParam=null}function a(){this.place=0}function f(e,t){var n=e[t.place++];if(!(n&128))return n;var r=n&15,i=0;for(var s=0,o=t.place;s>>3);e.push(n|128);while(--n)e.push(t>>>(n<<3)&255);e.push(t)}var r=e("bn.js"),i=e("../../elliptic"),s=i.utils,o=s.assert;t.exports=u,u.prototype._importDER=function(t,n){t=s.toArray(t,n);var i=new a;if(t[i.place++]!==48)return!1;var o=f(t,i);if(o+i.place!==t.length)return!1;if(t[i.place++]!==2)return!1;var u=f(t,i),l=t.slice(i.place,u+i.place);i.place+=u;if(t[i.place++]!==2)return!1;var c=f(t,i);if(t.length!==c+i.place)return!1;var h=t.slice(i.place,c+i.place);return l[0]===0&&l[1]&128&&(l=l.slice(1)),h[0]===0&&h[1]&128&&(h=h.slice(1)),this.r=new r(l),this.s=new r(h),this.recoveryParam=null,!0},u.prototype.toDER=function(t){var n=this.r.toArray(),r=this.s.toArray();n[0]&128&&(n=[0].concat(n)),r[0]&128&&(r=[0].concat(r)),n=l(n),r=l(r);while(!r[0]&&!(r[1]&128))r=r.slice(1);var i=[2];c(i,n.length),i=i.concat(n),i.push(2),c(i,r.length);var o=i.concat(r),u=[48];return c(u,o.length),u=u.concat(o),s.encode(u,t)}},{"../../elliptic":128,"bn.js":126}],138:[function(e,t,n){"use strict";function l(e){o(e==="ed25519","only tested with ed25519 so far");if(!(this instanceof l))return new l(e);var e=i.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}var r=e("hash.js"),i=e("../../elliptic"),s=i.utils,o=s.assert,u=s.parseBytes,a=e("./key"),f=e("./signature");t.exports=l,l.prototype.sign=function(t,n){t=u(t);var r=this.keyFromSecret(n),i=this.hashInt(r.messagePrefix(),t),s=this.g.mul(i),o=this.encodePoint(s),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),f=i.add(a).umod(this.curve.n);return this.makeSignature({R:s,S:f,Rencoded:o})},l.prototype.verify=function(t,n,r){t=u(t),n=this.makeSignature(n);var i=this.keyFromPublic(r),s=this.hashInt(n.Rencoded(),i.pubBytes(),t),o=this.g.mul(n.S()),a=n.R().add(i.pub().mul(s));return a.eq(o)},l.prototype.hashInt=function(){var t=this.hash();for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var r=e("hash.js"),i=e("../elliptic"),s=i.utils,o=s.assert;t.exports=u,u.prototype._init=function(t,n,r){var i=t.concat(n).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this.reseed=1},u.prototype.generate=function(t,n,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");typeof n!="string"&&(i=r,r=n,n=null),r&&(r=s.toArray(r,i),this._update(r));var o=[];while(o.length>8,o=i&255;s?n.push(s,o):n.push(o)}else if(t==="hex"){e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e);for(var r=0;r=0){var s;if(i.isOdd()){var o=i.andln(r-1);o>(r>>1)-1?s=(r>>1)-o:s=o,i.isubn(s)}else s=0;n.push(s);var u=i.cmpn(0)!==0&&i.andln(r-1)===0?t+1:1;for(var a=1;a0||t.cmpn(-i)>0){var s=e.andln(3)+r&3,o=t.andln(3)+i&3;s===3&&(s=-1),o===3&&(o=-1);var u;if((s&1)===0)u=0;else{var a=e.andln(7)+r&7;a!==3&&a!==5||o!==2?u=s:u=-s}n[0].push(u);var f;if((o&1)===0)f=0;else{var a=t.andln(7)+i&7;a!==3&&a!==5||s!==2?f=o:f=-o}n[1].push(f),2*r===u+1&&(r=1-r),2*i===f+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return n}function l(e,t){var n=t.name,r="_"+n;e.prototype[n]=function(){return this[r]!==undefined?this[r]:this[r]=t.call(this)}}function c(e){return typeof e=="string"?r.toArray(e,"hex"):e}function h(e){return new i(e,"hex","le")}var r=n,i=e("bn.js");r.assert=function(t,n){if(!t)throw new Error(n||"Assertion failed")},r.toArray=s,r.zero2=o,r.toHex=u,r.encode=function(t,n){return n==="hex"?u(t):t},r.getNAF=a,r.getJSF=f,r.cachedProperty=l,r.parseBytes=c,r.intFromLE=h},{"bn.js":126}],144:[function(e,t,n){function i(e){this.rand=e}var r;t.exports=function(t){return r||(r=new i(null)),r.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)};if(typeof window=="object")window.crypto&&window.crypto.getRandomValues?i.prototype._rand=function(t){var n=new Uint8Array(t);return window.crypto.getRandomValues(n),n}:window.msCrypto&&window.msCrypto.getRandomValues?i.prototype._rand=function(t){var n=new Uint8Array(t);return window.msCrypto.getRandomValues(n),n}:i.prototype._rand=function(){throw new Error("Not implemented yet")};else try{var s=e("crypto");i.prototype._rand=function(t){return s.randomBytes(t)}}catch(o){i.prototype._rand=function(t){var n=new Uint8Array(t);for(var r=0;r=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),this.pending.length===0&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var s=0;s>>24&255,i[s++]=t>>>16&255,i[s++]=t>>>8&255,i[s++]=t&255}else{i[s++]=t&255,i[s++]=t>>>8&255,i[s++]=t>>>16&255,i[s++]=t>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0;for(var o=8;othis.blockSize&&(t=(new this.Hash).update(t).digest()),o(t.length<=this.blockSize);for(var n=t.length;n>>3}function j(e){return o(e,17)^o(e,19)^e>>>10}function F(e,t,n,r){if(e===0)return M(t,n,r);if(e===1||e===3)return D(t,n,r);if(e===2)return _(t,n,r)}function I(e,t,n,r,i,s){var o=e&n^~e&i;return o<0&&(o+=4294967296),o}function q(e,t,n,r,i,s){var o=t&r^~t&s;return o<0&&(o+=4294967296),o}function R(e,t,n,r,i,s){var o=e&n^e&i^n&i;return o<0&&(o+=4294967296),o}function U(e,t,n,r,i,s){var o=t&r^t&s^r&s;return o<0&&(o+=4294967296),o}function z(e,t){var n=c(e,t,28),r=c(t,e,2),i=c(t,e,7),s=n^r^i;return s<0&&(s+=4294967296),s}function W(e,t){var n=h(e,t,28),r=h(t,e,2),i=h(t,e,7),s=n^r^i;return s<0&&(s+=4294967296),s}function X(e,t){var n=c(e,t,14),r=c(e,t,18),i=c(t,e,9),s=n^r^i;return s<0&&(s+=4294967296),s}function V(e,t){var n=h(e,t,14),r=h(e,t,18),i=h(t,e,9),s=n^r^i;return s<0&&(s+=4294967296),s}function $(e,t){var n=c(e,t,1),r=c(e,t,8),i=p(e,t,7),s=n^r^i;return s<0&&(s+=4294967296),s}function J(e,t){var n=h(e,t,1),r=h(e,t,8),i=d(e,t,7),s=n^r^i;return s<0&&(s+=4294967296),s}function K(e,t){var n=c(e,t,19),r=c(t,e,29),i=p(e,t,6),s=n^r^i;return s<0&&(s+=4294967296),s}function Q(e,t){var n=h(e,t,19),r=h(t,e,29),i=d(e,t,6),s=n^r^i;return s<0&&(s+=4294967296),s}var r=e("../hash"),i=r.utils,s=i.assert,o=i.rotr32,u=i.rotl32,a=i.sum32,f=i.sum32_4,l=i.sum32_5,c=i.rotr64_hi,h=i.rotr64_lo,p=i.shr64_hi,d=i.shr64_lo,v=i.sum64,m=i.sum64_hi,g=i.sum64_lo,y=i.sum64_4_hi,b=i.sum64_4_lo,w=i.sum64_5_hi,E=i.sum64_5_lo,S=r.common.BlockHash,x=[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],T=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],N=[1518500249,1859775393,2400959708,3395469782];i.inherits(C,S),n.sha256=C,C.blockSize=512,C.outSize=256,C.hmacStrength=192,C.padLength=64,C.prototype._update=function(t,n){var r=this.W;for(var i=0;i<16;i++)r[i]=t[n+i];for(;i>8,o=i&255;s?n.push(s,o):n.push(o)}else if(t==="hex"){e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e);for(var r=0;r>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}function a(e,t){var n="";for(var r=0;r>>0}return s}function h(e,t){var n=new Array(e.length*4);for(var r=0,i=0;r>>24,n[i+1]=s>>>16&255,n[i+2]=s>>>8&255,n[i+3]=s&255):(n[i+3]=s>>>24,n[i+2]=s>>>16&255,n[i+1]=s>>>8&255,n[i]=s&255)}return n}function p(e,t){return e>>>t|e<<32-t}function d(e,t){return e<>>32-t}function v(e,t){return e+t>>>0}function m(e,t,n){return e+t+n>>>0}function g(e,t,n,r){return e+t+n+r>>>0}function y(e,t,n,r,i){return e+t+n+r+i>>>0}function b(e,t){if(!e)throw new Error(t||"Assertion failed")}function w(e,t,n,r){var i=e[t],s=e[t+1],o=r+s>>>0,u=(o>>0,e[t+1]=o}function E(e,t,n,r){var i=t+r>>>0,s=(i>>0}function S(e,t,n,r){var i=t+r;return i>>>0}function x(e,t,n,r,i,s,o,u){var a=0,f=t;f=f+r>>>0,a+=f>>0,a+=f>>0,a+=f>>0}function T(e,t,n,r,i,s,o,u){var a=t+r+s+u;return a>>>0}function N(e,t,n,r,i,s,o,u,a,f){var l=0,c=t;c=c+r>>>0,l+=c>>0,l+=c>>0,l+=c>>0,l+=c>>0}function C(e,t,n,r,i,s,o,u,a,f){var l=t+r+s+u+f;return l>>>0}function k(e,t,n){var r=t<<32-n|e>>>n;return r>>>0}function L(e,t,n){var r=e<<32-n|t>>>n;return r>>>0}function A(e,t,n){return e>>>n}function O(e,t,n){var r=e<<32-n|t>>>n;return r>>>0}var r=n,i=e("inherits");r.toArray=s,r.toHex=o,r.htonl=u,r.toHex32=a,r.zero2=f,r.zero8=l,r.join32=c,r.split32=h,r.rotr32=p,r.rotl32=d,r.sum32=v,r.sum32_3=m,r.sum32_4=g,r.sum32_5=y,r.assert=b,r.inherits=i,n.sum64=w,n.sum64_hi=E,n.sum64_lo=S,n.sum64_4_hi=x,n.sum64_4_lo=T,n.sum64_5_hi=N,n.sum64_5_lo=C,n.rotr64_hi=k,n.rotr64_lo=L,n.shr64_hi=A,n.shr64_lo=O},{inherits:286}],151:[function(e,t,n){t.exports={name:"elliptic",version:"6.1.0",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{test:"make lint && istanbul test _mocha --reporter=spec test/*-test.js",coveralls:"cat ./coverage/lcov.info | coveralls"},repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},keywords:["EC","Elliptic","curve","Cryptography"],author:{name:"Fedor Indutny",email:"fedor@indutny.com"},license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{browserify:"^3.44.2",coveralls:"^2.11.3",istanbul:"^0.3.17",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},dependencies:{"bn.js":"^4.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},gitHead:"b465fea90447f3b6c0b3f55e5fd6ecdedc1282f2",_id:"elliptic@6.1.0",_shasum:"68130e03823b4ce024955ad1be195e148099d654",_from:"elliptic@>=6.0.0 <7.0.0",_npmVersion:"3.3.12",_nodeVersion:"5.2.0",_npmUser:{name:"indutny",email:"fedor@indutny.com"},dist:{shasum:"68130e03823b4ce024955ad1be195e148099d654",tarball:"http://registry.npmjs.org/elliptic/-/elliptic-6.1.0.tgz"},maintainers:[{name:"indutny",email:"fedor@indutny.com"}],directories:{},_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.1.0.tgz"}},{}],152:[function(e,t,n){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],153:[function(e,t,n){var r=e("asn1.js"),i=r.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});n.RSAPrivateKey=i;var s=r.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});n.RSAPublicKey=s;var o=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(u),this.key("subjectPublicKey").bitstr())});n.PublicKey=o;var u=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),a=r.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(u),this.key("subjectPrivateKey").octstr())});n.PrivateKey=a;var f=r.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});n.EncryptedPrivateKey=f;var l=r.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});n.DSAPrivateKey=l,n.DSAparam=r.define("DSAparam",function(){this.int()});var c=r.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});n.ECPrivateKey=c;var h=r.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});n.signature=r.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"asn1.js":156}],154:[function(e,t,n){(function(n){var r=/Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m,i=/^-----BEGIN (.*) KEY-----\r?\n/m,s=/^-----BEGIN (.*) KEY-----\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n-----END \1 KEY-----$/m,o=e("evp_bytestokey"),u=e("browserify-aes");t.exports=function(e,t){var a=e.toString(),f=a.match(r),l;if(!f){var c=a.match(s);l=new n(c[2].replace(/\r?\n/g,""),"base64")}else{var h="aes"+f[1],p=new n(f[2],"hex"),d=new n(f[3].replace(/\r?\n/g,""),"base64"),v=o(t,p.slice(0,8),parseInt(f[1],10)).key,m=[],g=u.createDecipheriv(h,v,p);m.push(g.update(d)),m.push(g.final()),l=n.concat(m)}var y=a.match(i)[1]+" KEY";return{tag:y,data:l}}}).call(this,e("buffer").Buffer)},{"browserify-aes":173,buffer:89,evp_bytestokey:188}],155:[function(e,t,n){(function(n){function a(e){var t;typeof e=="object"&&!n.isBuffer(e)&&(t=e.passphrase,e=e.key),typeof e=="string"&&(e=new n(e));var i=s(e,t),o=i.tag,u=i.data,a,l;switch(o){case"PUBLIC KEY":l=r.PublicKey.decode(u,"der"),a=l.algorithm.algorithm.join(".");switch(a){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(l.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return l.subjectPrivateKey=l.subjectPublicKey,{type:"ec",data:l};case"1.2.840.10040.4.1":return l.algorithm.params.pub_key=r.DSAparam.decode(l.subjectPublicKey.data,"der"),{type:"dsa",data:l.algorithm.params};default:throw new Error("unknown key id "+a)}throw new Error("unknown key type "+o);case"ENCRYPTED PRIVATE KEY":u=r.EncryptedPrivateKey.decode(u,"der"),u=f(u,t);case"PRIVATE KEY":l=r.PrivateKey.decode(u,"der"),a=l.algorithm.algorithm.join(".");switch(a){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(l.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:l.algorithm.curve,privateKey:r.ECPrivateKey.decode(l.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return l.algorithm.params.priv_key=r.DSAparam.decode(l.subjectPrivateKey,"der"),{type:"dsa",params:l.algorithm.params};default:throw new Error("unknown key id "+a)}throw new Error("unknown key type "+o);case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(u,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(u,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(u,"der")};case"EC PRIVATE KEY":return u=r.ECPrivateKey.decode(u,"der"),{curve:u.parameters.value,privateKey:u.privateKey};default:throw new Error("unknown key type "+o)}}function f(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,s=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),a=i[e.algorithm.decrypt.cipher.algo.join(".")],f=e.algorithm.decrypt.cipher.iv,l=e.subjectPrivateKey,c=parseInt(a.split("-")[1],10)/8,h=u.pbkdf2Sync(t,r,s,c),p=o.createDecipheriv(a,h,f),d=[];return d.push(p.update(l)),d.push(p.final()),n.concat(d)}var r=e("./asn1"),i=e("./aesid.json"),s=e("./fixProc"),o=e("browserify-aes"),u=e("pbkdf2");t.exports=a,a.signature=r.signature}).call(this,e("buffer").Buffer)},{"./aesid.json":152,"./asn1":153,"./fixProc":154,"browserify-aes":173,buffer:89,pbkdf2:238}],156:[function(e,t,n){var r=n;r.bignum=e("bn.js"),r.define=e("./asn1/api").define,r.base=e("./asn1/base"),r.constants=e("./asn1/constants"),r.decoders=e("./asn1/decoders"),r.encoders=e("./asn1/encoders")},{"./asn1/api":157,"./asn1/base":159,"./asn1/constants":163,"./asn1/decoders":165,"./asn1/encoders":168,"bn.js":126}],157:[function(e,t,n){function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}var r=e("../asn1"),i=e("inherits"),s=n;s.define=function(t,n){return new o(t,n)},o.prototype._createNamed=function(n){var r;try{r=e("vm").runInThisContext("(function "+this.name+"(entity) {\n"+" this._initNamed(entity);\n"+"})")}catch(s){r=function(e){this._initNamed(e)}}return i(r,n),r.prototype._initNamed=function(t){n.call(this,t)},new r(this)},o.prototype._getDecoder=function(t){return this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(r.decoders[t])),this.decoders[t]},o.prototype.decode=function(t,n,r){return this._getDecoder(n).decode(t,r)},o.prototype._getEncoder=function(t){return this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(r.encoders[t])),this.encoders[t]},o.prototype.encode=function(t,n,r){return this._getEncoder(n).encode(t,r)}},{"../asn1":156,inherits:286,vm:305}],158:[function(e,t,n){function o(e,t){i.call(this,t);if(!s.isBuffer(e)){this.error("Input not Buffer");return}this.base=e,this.offset=0,this.length=e.length}function u(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof u||(e=new u(e,t)),this.length+=e.length,e},this);else if(typeof e=="number"){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if(typeof e=="string")this.value=e,this.length=s.byteLength(e);else{if(!s.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}var r=e("inherits"),i=e("../base").Reporter,s=e("buffer").Buffer;r(o,i),n.DecoderBuffer=o,o.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},o.prototype.restore=function(t){var n=new o(this.base);return n.offset=t.offset,n.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),n},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},o.prototype.skip=function(t,n){if(this.offset+t<=this.length){var r=new o(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r}return this.error(n||"DecoderBuffer overrun")},o.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},n.EncoderBuffer=u,u.prototype.join=function(t,n){return t||(t=new s(this.length)),n||(n=0),this.length===0?t:(Array.isArray(this.value)?this.value.forEach(function(e){e.join(t,n),n+=e.length}):(typeof this.value=="number"?t[n]=this.value:typeof this.value=="string"?t.write(this.value,n):s.isBuffer(this.value)&&this.value.copy(t,n),n+=this.length),t)}},{"../base":159,buffer:89,inherits:286}],159:[function(e,t,n){var r=n;r.Reporter=e("./reporter").Reporter,r.DecoderBuffer=e("./buffer").DecoderBuffer,r.EncoderBuffer=e("./buffer").EncoderBuffer,r.Node=e("./node")},{"./buffer":158,"./node":160,"./reporter":161}],160:[function(e,t,n){function f(e,t){var n={};this._baseState=n,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n["default"]=null,n.explicit=null,n.implicit=null,n.parent||(n.children=[],this._wrap())}var r=e("../base").Reporter,i=e("../base").EncoderBuffer,s=e("minimalistic-assert"),o=["seq","seqof","set","setof","octstr","bitstr","objid","bool","gentime","utctime","null_","enum","int","ia5str","utf8str","bmpstr","numstr","printstr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any"].concat(o),a=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];t.exports=f;var l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit"];f.prototype.clone=function(){var t=this._baseState,n={};l.forEach(function(e){n[e]=t[e]});var r=new this.constructor(n.parent);return r._baseState=n,r},f.prototype._wrap=function(){var t=this._baseState;u.forEach(function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}},this)},f.prototype._init=function(t){var n=this._baseState;s(n.parent===null),t.call(this),n.children=n.children.filter(function(e){return e._baseState.parent===this},this),s.equal(n.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(t){var n=this._baseState,r=t.filter(function(e){return e instanceof this.constructor},this);t=t.filter(function(e){return!(e instanceof this.constructor)},this),r.length!==0&&(s(n.children===null),n.children=r,r.forEach(function(e){e._baseState.parent=this},this)),t.length!==0&&(s(n.args===null),n.args=t,n.reverseArgs=t.map(function(e){if(typeof e!="object"||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(n){n==(n|0)&&(n|=0);var r=e[n];t[r]=n}),t}))},a.forEach(function(e){f.prototype[e]=function(){var n=this._baseState;throw new Error(e+" not implemented for encoding: "+n.enc)}}),o.forEach(function(e){f.prototype[e]=function(){var n=this._baseState,r=Array.prototype.slice.call(arguments);return s(n.tag===null),n.tag=e,this._useArgs(r),this}}),f.prototype.use=function(t){var n=this._baseState;return s(n.use===null),n.use=t,this},f.prototype.optional=function(){var t=this._baseState;return t.optional=!0,this},f.prototype.def=function(t){var n=this._baseState;return s(n["default"]===null),n["default"]=t,n.optional=!0,this},f.prototype.explicit=function(t){var n=this._baseState;return s(n.explicit===null&&n.implicit===null),n.explicit=t,this},f.prototype.implicit=function(t){var n=this._baseState;return s(n.explicit===null&&n.implicit===null),n.implicit=t,this},f.prototype.obj=function(){var t=this._baseState,n=Array.prototype.slice.call(arguments);return t.obj=!0,n.length!==0&&this._useArgs(n),this},f.prototype.key=function(t){var n=this._baseState;return s(n.key===null),n.key=t,this},f.prototype.any=function(){var t=this._baseState;return t.any=!0,this},f.prototype.choice=function(t){var n=this._baseState;return s(n.choice===null),n.choice=t,this._useArgs(Object.keys(t).map(function(e){return t[e]})),this},f.prototype._decode=function(t){var n=this._baseState;if(n.parent===null)return t.wrapResult(n.children[0]._decode(t));var r=n["default"],i=!0,s;n.key!==null&&(s=t.enterKey(n.key));if(n.optional){var o=null;n.explicit!==null?o=n.explicit:n.implicit!==null?o=n.implicit:n.tag!==null&&(o=n.tag);if(o===null&&!n.any){var u=t.save();try{n.choice===null?this._decodeGeneric(n.tag,t):this._decodeChoice(t),i=!0}catch(a){i=!1}t.restore(u)}else{i=this._peekTag(t,o,n.any);if(t.isError(i))return i}}var f;n.obj&&i&&(f=t.enterObject());if(i){if(n.explicit!==null){var l=this._decodeTag(t,n.explicit);if(t.isError(l))return l;t=l}if(n.use===null&&n.choice===null){if(n.any)var u=t.save();var c=this._decodeTag(t,n.implicit!==null?n.implicit:n.tag,n.any);if(t.isError(c))return c;n.any?r=t.raw(u):t=c}n.any?r=r:n.choice===null?r=this._decodeGeneric(n.tag,t):r=this._decodeChoice(t);if(t.isError(r))return r;if(!n.any&&n.choice===null&&n.children!==null){var h=n.children.some(function(n){n._decode(t)});if(h)return err}}return n.obj&&i&&(r=t.leaveObject(f)),n.key!==null&&(r!==null||i===!0)&&t.leaveKey(s,n.key,r),r},f.prototype._decodeGeneric=function(t,n){var r=this._baseState;return t==="seq"||t==="set"?null:t==="seqof"||t==="setof"?this._decodeList(n,t,r.args[0]):t==="octstr"||t==="bitstr"?this._decodeStr(n,t):t==="ia5str"||t==="utf8str"||t==="bmpstr"?this._decodeStr(n,t):t==="numstr"||t==="printstr"?this._decodeStr(n,t):t==="objid"&&r.args?this._decodeObjid(n,r.args[0],r.args[1]):t==="objid"?this._decodeObjid(n,null,null):t==="gentime"||t==="utctime"?this._decodeTime(n,t):t==="null_"?this._decodeNull(n):t==="bool"?this._decodeBool(n):t==="int"||t==="enum"?this._decodeInt(n,r.args&&r.args[0]):r.use!==null?this._getUse(r.use,n._reporterState.obj)._decode(n):n.error("unknown tag: "+t)},f.prototype._getUse=function(t,n){var r=this._baseState;return r.useDecoder=this._use(t,n),s(r.useDecoder._baseState.parent===null),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},f.prototype._decodeChoice=function(t){var n=this._baseState,r=null,i=!1;return Object.keys(n.choice).some(function(e){var s=t.save(),o=n.choice[e];try{var u=o._decode(t);if(t.isError(u))return!1;r={type:e,value:u},i=!0}catch(a){return t.restore(s),!1}return!0},this),i?r:t.error("Choice not matched")},f.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},f.prototype._encode=function(t,n,r){var i=this._baseState;if(i["default"]!==null&&i["default"]===t)return;var s=this._encodeValue(t,n,r);if(s===undefined)return;if(this._skipDefault(s,n,r))return;return s},f.prototype._encodeValue=function(t,n,i){var s=this._baseState;if(s.parent===null)return s.children[0]._encode(t,n||new r);var o=null,u=!0;this.reporter=n;if(s.optional&&t===undefined){if(s["default"]===null)return;t=s["default"]}var a,f=null,l=!1;if(s.any)o=this._createEncoderBuffer(t);else if(s.choice)o=this._encodeChoice(t,n);else if(s.children)f=s.children.map(function(e){if(e._baseState.tag==="null_")return e._encode(null,n,t);if(e._baseState.key===null)return n.error("Child should have a key");var r=n.enterKey(e._baseState.key);if(typeof t!="object")return n.error("Child expected, but input is not object");var i=e._encode(t[e._baseState.key],n,t);return n.leaveKey(r),i},this).filter(function(e){return e}),f=this._createEncoderBuffer(f);else if(s.tag==="seqof"||s.tag==="setof"){if(!s.args||s.args.length!==1)return n.error("Too many args for : "+s.tag);if(!Array.isArray(t))return n.error("seqof/setof, but data is not Array");var c=this.clone();c._baseState.implicit=null,f=this._createEncoderBuffer(t.map(function(e){var r=this._baseState;return this._getUse(r.args[0],t)._encode(e,n)},c))}else s.use!==null?o=this._getUse(s.use,i)._encode(t,n):(f=this._encodePrimitive(s.tag,t),l=!0);var o;if(!s.any&&s.choice===null){var h=s.implicit!==null?s.implicit:s.tag,p=s.implicit===null?"universal":"context";h===null?s.use===null&&n.error("Tag could be ommited only for .use()"):s.use===null&&(o=this._encodeComposite(h,l,p,f))}return s.explicit!==null&&(o=this._encodeComposite(s.explicit,!1,"context",o)),o},f.prototype._encodeChoice=function(t,n){var r=this._baseState,i=r.choice[t.type];return i||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(t.value,n)},f.prototype._encodePrimitive=function(t,n){var r=this._baseState;if(t==="octstr"||t==="bitstr"||t==="ia5str")return this._encodeStr(n,t);if(t==="utf8str"||t==="bmpstr")return this._encodeStr(n,t);if(t==="numstr"||t==="printstr")return this._encodeStr(n,t);if(t==="objid"&&r.args)return this._encodeObjid(n,r.reverseArgs[0],r.args[1]);if(t==="objid")return this._encodeObjid(n,null,null);if(t==="gentime"||t==="utctime")return this._encodeTime(n,t);if(t==="null_")return this._encodeNull();if(t==="int"||t==="enum")return this._encodeInt(n,r.args&&r.reverseArgs[0]);if(t==="bool")return this._encodeBool(n);throw new Error("Unsupported tag: "+t)},f.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},f.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}},{"../base":159,"minimalistic-assert":170}],161:[function(e,t,n){function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function s(e,t){this.path=e,this.rethrow(t)}var r=e("inherits");n.Reporter=i,i.prototype.isError=function(t){return t instanceof s},i.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){var n=this._reporterState;n.obj=t.obj,n.path=n.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.leaveKey=function(t,n,r){var i=this._reporterState;i.path=i.path.slice(0,t-1),i.obj!==null&&(i.obj[n]=r)},i.prototype.enterObject=function(){var t=this._reporterState,n=t.obj;return t.obj={},n},i.prototype.leaveObject=function(t){var n=this._reporterState,r=n.obj;return n.obj=t,r},i.prototype.error=function(t){var n,r=this._reporterState,i=t instanceof s;i?n=t:n=new s(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),t.message||t,t.stack);if(!r.options.partial)throw n;return i||r.errors.push(n),n},i.prototype.wrapResult=function(t){var n=this._reporterState;return n.options.partial?{result:this.isError(t)?null:t,errors:n.errors}:t},r(s,Error),s.prototype.rethrow=function(t){return this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace(this,s),this}},{inherits:286}],162:[function(e,t,n){var r=e("../constants");n.tagClass={0:"universal",1:"application",2:"context",3:"private"},n.tagClassByName=r._reverse(n.tagClass),n.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},n.tagByName=r._reverse(n.tag)},{"../constants":163}],163:[function(e,t,n){var r=n;r._reverse=function(t){var n={};return Object.keys(t).forEach(function(e){(e|0)==e&&(e|=0);var r=t[e];n[r]=e}),n},r.der=e("./der")},{"./der":162}],164:[function(e,t,n){function a(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new f,this.tree._init(e.body)}function f(e){s.Node.call(this,"der",e)}function l(e,t){var n=e.readUInt8(t);if(e.isError(n))return n;var r=u.tagClass[n>>6],i=(n&32)===0;if((n&31)===31){var s=n;n=0;while((s&128)===128){s=e.readUInt8(t);if(e.isError(s))return s;n<<=7,n|=s&127}}else n&=31;var o=u.tag[n];return{cls:r,primitive:i,tag:n,tagStr:o}}function c(e,t,n){var r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&r===128)return null;if((r&128)===0)return r;var i=r&127;if(i>=4)return e.error("length octect is too long");r=0;for(var s=0;s=31?r.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=a.tagClassByName[n||"universal"]<<6,i)}var r=e("inherits"),i=e("buffer").Buffer,s=e("../../asn1"),o=s.base,u=s.bignum,a=s.constants.der;t.exports=f,f.prototype.encode=function(t,n){return this.tree._encode(t,n).join()},r(l,o.Node),l.prototype._encodeComposite=function(t,n,r,s){var o=h(t,n,r,this.reporter);if(s.length<128){var u=new i(2);return u[0]=o,u[1]=s.length,this._createEncoderBuffer([u,s])}var a=1;for(var f=s.length;f>=256;f>>=8)a++;var u=new i(2+a);u[0]=o,u[1]=128|a;for(var f=1+a,l=s.length;l>0;f--,l>>=8)u[f]=l&255;return this._createEncoderBuffer([u,s])},l.prototype._encodeStr=function(t,n){if(n==="octstr")return this._createEncoderBuffer(t);if(n==="bitstr")return this._createEncoderBuffer([t.unused|0,t.data]);if(n==="ia5str"||n==="utf8str")return this._createEncoderBuffer(t);if(n==="bmpstr"){var r=new i(t.length*2);for(var s=0;s=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,t[0]*40+t[1])}var o=0;for(var s=0;s=128;u>>=7)o++}var a=new i(o),f=a.length-1;for(var s=t.length-1;s>=0;s--){var u=t[s];a[f--]=u&127;while((u>>=7)>0)a[f--]=128|u&127}return this._createEncoderBuffer(a)},l.prototype._encodeTime=function(t,n){var r,i=new Date(t);return n==="gentime"?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):n==="utctime"?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+n+" time is not supported yet"),this._encodeStr(r,"octstr")},l.prototype._encodeNull=function(){return this._createEncoderBuffer("")},l.prototype._encodeInt=function(t,n){if(typeof t=="string"){if(!n)return this.reporter.error("String int or enum given, but no values map");if(!n.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=n[t]}if(typeof t!="number"&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&r[0]&128&&r.unshift(0),t=new i(r)}if(i.isBuffer(t)){var s=t.length;t.length===0&&s++;var o=new i(s);return t.copy(o),t.length===0&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);var s=1;for(var u=t;u>=256;u>>=8)s++;var o=new Array(s);for(var u=o.length-1;u>=0;u--)o[u]=t&255,t>>=8;return o[0]&128&&o.unshift(0),this._createEncoderBuffer(new i(o))},l.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},l.prototype._use=function(t,n){return typeof t=="function"&&(t=t(n)),t._getEncoder("der").tree},l.prototype._skipDefault=function(t,n,r){var i=this._baseState,s;if(i["default"]===null)return!1;var o=t.join();i.defaultBuffer===undefined&&(i.defaultBuffer=this._encodeValue(i["default"],n,r).join());if(o.length!==i.defaultBuffer.length)return!1;for(s=0;s0&&n.ishrn(r),n}function m(e,t){e=v(e,t),e=e.mod(t);var r=new n(e.toArray());if(r.length=t)throw new Error("invalid sig")}var r=e("./curves"),i=e("elliptic"),s=e("parse-asn1"),o=e("bn.js"),u=i.ec;t.exports=a}).call(this,e("buffer").Buffer)},{"./curves":125,"bn.js":126,buffer:89,elliptic:128,"parse-asn1":155}],191:[function(e,t,n){(function(n){function o(e){this.curveType=s[e],this.curveType||(this.curveType={name:e}),this.curve=new r.ec(this.curveType.name),this.keys=void 0}function u(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new n(e);if(r&&i.length>5]|=128<>>9<<4)+14]=t;var n=1732584193,r=-271733879,i=-1732584194,s=271733878;for(var c=0;c>16)+(t>>16)+(n>>16);return r<<16|n&65535}function c(e,t){return e<>>32-t}var r=e("./helpers");t.exports=function(t){return r.hash(t,i,16)}},{"./helpers":218}],220:[function(e,t,n){arguments[4][110][0].apply(n,arguments)},{buffer:89,dup:110,inherits:286,stream:303,string_decoder:304}],221:[function(e,t,n){(function(e){function a(e){var t=[];for(var n=0,r=0;n>>5]|=e[n]<<24-r%32;return t}function f(e){var t=[];for(var n=0;n>>5]>>>24-n%32&255);return t}function l(e,t,a){for(var f=0;f<16;f++){var l=a+f,g=t[l];t[l]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}var y,b,w,E,S,x,T,N,C,k;x=y=e[0],T=b=e[1],N=w=e[2],C=E=e[3],k=S=e[4];var L;for(f=0;f<80;f+=1)L=y+t[a+n[f]]|0,f<16?L+=c(b,w,E)+o[0]:f<32?L+=h(b,w,E)+o[1]:f<48?L+=p(b,w,E)+o[2]:f<64?L+=d(b,w,E)+o[3]:L+=v(b,w,E)+o[4],L|=0,L=m(L,i[f]),L=L+S|0,y=S,S=E,E=m(w,10),w=b,b=L,L=x+t[a+r[f]]|0,f<16?L+=v(T,N,C)+u[0]:f<32?L+=d(T,N,C)+u[1]:f<48?L+=p(T,N,C)+u[2]:f<64?L+=h(T,N,C)+u[3]:L+=c(T,N,C)+u[4],L|=0,L=m(L,s[f]),L=L+k|0,x=k,k=C,C=m(N,10),N=T,T=L;L=e[1]+w+C|0,e[1]=e[2]+E+k|0,e[2]=e[3]+S+x|0,e[3]=e[4]+y+T|0,e[4]=e[0]+b+N|0,e[0]=L}function c(e,t,n){return e^t^n}function h(e,t,n){return e&t|~e&n}function p(e,t,n){return(e|~t)^n}function d(e,t,n){return e&n|t&~n}function v(e,t,n){return e^(t|~n)}function m(e,t){return e<>>32-t}function g(t){var n=[1732584193,4023233417,2562383102,271733878,3285377520];typeof t=="string"&&(t=new e(t,"utf8"));var r=a(t),i=t.length*8,s=t.length*8;r[i>>>5]|=128<<24-i%32,r[(i+64>>>9<<4)+14]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360;for(var o=0;o>>24)&16711935|(u<<24|u>>>8)&4278255360}var c=f(n);return new e(c)}var n=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],r=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],i=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],s=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],o=[0,1518500249,1859775393,2400959708,2840853838],u=[1352829926,1548603684,1836072691,2053994217,0];t.exports=g}).call(this,e("buffer").Buffer)},{buffer:89}],222:[function(e,t,n){(function(e){function n(t,n){this._block=new e(t),this._finalSize=n,this._blockSize=t,this._len=0,this._s=0}n.prototype.update=function(t,n){typeof t=="string"&&(n=n||"utf8",t=new e(t,n));var r=this._len+=t.length,i=this._s||0,s=0,o=this._block;while(i=this._finalSize*8&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(t,this._blockSize-4);var n=this._update(this._block)||this._hash();return e?n.toString(e):n},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n}).call(this,e("buffer").Buffer)},{buffer:89}],223:[function(e,t,n){var n=t.exports=function(t){t=t.toLowerCase();var r=n[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};n.sha=e("./sha"),n.sha1=e("./sha1"),n.sha224=e("./sha224"),n.sha256=e("./sha256"),n.sha384=e("./sha384"),n.sha512=e("./sha512")},{"./sha":224,"./sha1":225,"./sha224":226,"./sha256":227,"./sha384":228,"./sha512":229}],224:[function(e,t,n){(function(n){function o(){this.init(),this._w=s,i.call(this,64,56)}function u(e,t){return e<>>32-t}var r=e("inherits"),i=e("./hash"),s=new Array(80);r(o,i),o.prototype.init=function(){return this._a=1732584193,this._b=-271733879,this._c=-1732584194,this._d=271733878,this._e=-1009589776,this},o.prototype._update=function(e){function l(){return t[a-3]^t[a-8]^t[a-14]^t[a-16]}function c(e,l){t[a]=e;var c=u(n,5)+l+o+e+f;o=s,s=i,i=u(r,30),r=n,n=c,a++}var t=this._w,n=this._a,r=this._b,i=this._c,s=this._d,o=this._e,a=0,f;f=1518500249;while(a<16)c(e.readInt32BE(a*4),r&i|~r&s);while(a<20)c(l(),r&i|~r&s);f=1859775393;while(a<40)c(l(),r^i^s);f=-1894007588;while(a<60)c(l(),r&i|r&s|i&s);f=-899497514;while(a<80)c(l(),r^i^s);this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0},o.prototype._hash=function(){var e=new n(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e},t.exports=o}).call(this,e("buffer").Buffer)},{"./hash":222,buffer:89,inherits:286}],225:[function(e,t,n){(function(n){function o(){this.init(),this._w=s,i.call(this,64,56)}function u(e,t){return e<>>32-t}var r=e("inherits"),i=e("./hash"),s=new Array(80);r(o,i),o.prototype.init=function(){return this._a=1732584193,this._b=-271733879,this._c=-1732584194,this._d=271733878,this._e=-1009589776,this},o.prototype._update=function(e){function l(){return u(t[a-3]^t[a-8]^t[a-14]^t[a-16],1)}function c(e,l){t[a]=e;var c=u(n,5)+l+o+e+f;o=s,s=i,i=u(r,30),r=n,n=c,a++}var t=this._w,n=this._a,r=this._b,i=this._c,s=this._d,o=this._e,a=0,f;f=1518500249;while(a<16)c(e.readInt32BE(a*4),r&i|~r&s);while(a<20)c(l(),r&i|~r&s);f=1859775393;while(a<40)c(l(),r^i^s);f=-1894007588;while(a<60)c(l(),r&i|r&s|i&s);f=-899497514;while(a<80)c(l(),r^i^s);this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0},o.prototype._hash=function(){var e=new n(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e},t.exports=o}).call(this,e("buffer").Buffer)},{"./hash":222,buffer:89,inherits:286}],226:[function(e,t,n){(function(n){function u(){this.init(),this._w=o,s.call(this,64,56)}var r=e("inherits"),i=e("./sha256"),s=e("./hash"),o=new Array(64);r(u,i),u.prototype.init=function(){return this._a=-1056596264,this._b=914150663,this._c=812702999,this._d=-150054599,this._e=-4191439,this._f=1750603025,this._g=1694076839,this._h=-1090891868,this},u.prototype._hash=function(){var e=new n(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=u}).call(this,e("buffer").Buffer)},{"./hash":222,"./sha256":227,buffer:89,inherits:286}],227:[function(e,t,n){(function(n){function u(){this.init(),this._w=o,i.call(this,64,56)}function a(e,t,n){return n^e&(t^n)}function f(e,t,n){return e&t|n&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function c(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function p(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var r=e("inherits"),i=e("./hash"),s=[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],o=new Array(64);r(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){function y(){return p(t[g-2])+t[g-7]+h(t[g-15])+t[g-16]}function b(e){t[g]=e;var h=m+c(u)+a(u,d,v)+s[g]+e,p=l(n)+f(n,r,i);m=v,v=d,d=u,u=o+h,o=i,i=r,r=n,n=h+p,g++}var t=this._w,n=this._a|0,r=this._b|0,i=this._c|0,o=this._d|0,u=this._e|0,d=this._f|0,v=this._g|0,m=this._h|0,g=0;while(g<16)b(e.readInt32BE(g*4));while(g<64)b(y());this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=u+this._e|0,this._f=d+this._f|0,this._g=v+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=new n(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=u}).call(this,e("buffer").Buffer)},{"./hash":222,buffer:89,inherits:286}],228:[function(e,t,n){(function(n){function u(){this.init(),this._w=o,s.call(this,128,112)}var r=e("inherits"),i=e("./sha512"),s=e("./hash"),o=new Array(160);r(u,i),u.prototype.init=function(){return this._a=-876896931,this._b=1654270250,this._c=-1856437926,this._d=355462360 -,this._e=1731405415,this._f=-1900787065,this._g=-619958771,this._h=1203062813,this._al=-1056596264,this._bl=914150663,this._cl=812702999,this._dl=-150054599,this._el=-4191439,this._fl=1750603025,this._gl=1694076839,this._hl=-1090891868,this},u.prototype._hash=function(){function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}var e=new n(48);return t(this._a,this._al,0),t(this._b,this._bl,8),t(this._c,this._cl,16),t(this._d,this._dl,24),t(this._e,this._el,32),t(this._f,this._fl,40),e},t.exports=u}).call(this,e("buffer").Buffer)},{"./hash":222,"./sha512":229,buffer:89,inherits:286}],229:[function(e,t,n){(function(n){function u(){this.init(),this._w=o,i.call(this,128,112)}function a(e,t,n){return n^e&(t^n)}function f(e,t,n){return e&t|n&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function c(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function d(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}var r=e("inherits"),i=e("./hash"),s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],o=new Array(160);r(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this._al=-205731576,this._bl=-2067093701,this._cl=-23791573,this._dl=1595750129,this._el=-1377402159,this._fl=725511199,this._gl=-79577749,this._hl=327033209,this},u.prototype._update=function(e){function M(){var e=t[L-30],n=t[L-30+1],r=h(e,n),i=p(n,e);e=t[L-4],n=t[L-4+1];var s=d(e,n),o=v(n,e),u=t[L-14],a=t[L-14+1],f=t[L-32],l=t[L-32+1];O=i+a,A=r+u+(O>>>0>>0?1:0),O+=o,A=A+s+(O>>>0>>0?1:0),O+=l,A=A+f+(O>>>0>>0?1:0)}function _(){t[L]=A,t[L+1]=O;var e=f(n,r,i),h=f(b,w,E),p=l(n,b),d=l(b,n),v=c(u,x),M=c(x,u),_=s[L],D=s[L+1],P=a(u,m,g),H=a(x,T,N),B=C+M,F=y+v+(B>>>0>>0?1:0);B+=H,F=F+P+(B>>>0>>0?1:0),B+=D,F=F+_+(B>>>0>>0?1:0),B+=O,F=F+A+(B>>>0>>0?1:0);var I=d+h,q=p+e+(I>>>0>>0?1:0);y=g,C=N,g=m,N=T,m=u,T=x,x=S+B|0,u=o+F+(x>>>0>>0?1:0)|0,o=i,S=E,i=r,E=w,r=n,w=b,b=B+I|0,n=F+q+(b>>>0>>0?1:0)|0,k++,L+=2}var t=this._w,n=this._a|0,r=this._b|0,i=this._c|0,o=this._d|0,u=this._e|0,m=this._f|0,g=this._g|0,y=this._h|0,b=this._al|0,w=this._bl|0,E=this._cl|0,S=this._dl|0,x=this._el|0,T=this._fl|0,N=this._gl|0,C=this._hl|0,k=0,L=0,A,O;while(k<16)A=e.readInt32BE(L*4),O=e.readInt32BE(L*4+4),_();while(k<80)M(),_();this._al=this._al+b|0,this._bl=this._bl+w|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+x|0,this._fl=this._fl+T|0,this._gl=this._gl+N|0,this._hl=this._hl+C|0,this._a=this._a+n+(this._al>>>0>>0?1:0)|0,this._b=this._b+r+(this._bl>>>0>>0?1:0)|0,this._c=this._c+i+(this._cl>>>0>>0?1:0)|0,this._d=this._d+o+(this._dl>>>0>>0?1:0)|0,this._e=this._e+u+(this._el>>>0>>0?1:0)|0,this._f=this._f+m+(this._fl>>>0>>0?1:0)|0,this._g=this._g+g+(this._gl>>>0>>0?1:0)|0,this._h=this._h+y+(this._hl>>>0>>0?1:0)|0},u.prototype._hash=function(){function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}var e=new n(64);return t(this._a,this._al,0),t(this._b,this._bl,8),t(this._c,this._cl,16),t(this._d,this._dl,24),t(this._e,this._el,32),t(this._f,this._fl,40),t(this._g,this._gl,48),t(this._h,this._hl,56),e},t.exports=u}).call(this,e("buffer").Buffer)},{"./hash":222,buffer:89,inherits:286}],230:[function(e,t,n){(function(n){"use strict";function u(e,t){s.call(this),e=e.toLowerCase(),typeof t=="string"&&(t=new n(t));var i=e==="sha512"||e==="sha384"?128:64;this._alg=e,this._key=t,t.length>i?t=r(e).update(t).digest():t.lengthe)n.ishrn(1);n.isEven()&&n.iadd(a),n.testn(1)||n.iadd(f);if(!t.cmp(f))while(n.mod(s).cmp(m))n.iadd(g);else if(!t.cmp(l))while(n.mod(p).cmp(d))n.iadd(g);o=n.shrn(1);if(E(o)&&E(n)&&S(o)&&S(n)&&u.test(o)&&u.test(n))return n}}var r=e("randombytes");t.exports=x,x.simpleSieve=E,x.fermatTest=S;var i=e("bn.js"),s=new i(24),o=e("miller-rabin"),u=new o,a=new i(1),f=new i(2),l=new i(5),c=new i(16),h=new i(8),p=new i(10),d=new i(3),v=new i(7),m=new i(11),g=new i(4),y=new i(12),b=null},{"bn.js":235,"miller-rabin":236,randombytes:284}],234:[function(e,t,n){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],235:[function(e,t,n){arguments[4][126][0].apply(n,arguments)},{dup:126}],236:[function(e,t,n){function s(e){this.rand=e||new i.Rand}var r=e("bn.js"),i=e("brorand");t.exports=s,s.create=function(t){return new s(t)},s.prototype._rand=function(t){var n=t.bitLength(),i=this.rand.generate(Math.ceil(n/8));i[0]|=3;var s=n&7;return s!==0&&(i[i.length-1]>>=7-s),new r(i)},s.prototype.test=function(t,n,i){var s=t.bitLength(),o=r.mont(t),u=(new r(1)).toRed(o);n||(n=Math.max(1,s/48|0));var a=t.subn(1),f=a.subn(1);for(var l=0;!a.testn(l);l++);var c=t.shrn(l),h=a.toRed(o),p=!0;for(;n>0;n--){var d=this._rand(f);i&&i(d);var v=d.toRed(o).redPow(c);if(v.cmp(u)===0||v.cmp(h)===0)continue;for(var m=1;m0;n--){var h=this._rand(a),p=t.gcd(h);if(p.cmpn(1)!==0)return p;var d=h.toRed(s).redPow(l);if(d.cmp(o)===0||d.cmp(c)===0)continue;for(var v=1;vi)throw new TypeError("Bad key length");u=u||"sha1",t.isBuffer(e)||(e=new t(e,"binary")),t.isBuffer(n)||(n=new t(n,"binary"));var a,f=1,l=new t(o),c=new t(n.length+4);n.copy(c,0,0,n.length);var h,p;for(var d=1;d<=f;d++){c.writeUInt32BE(d,n.length);var v=r(u,e).update(c).digest();a||(a=v.length,p=new t(a),f=Math.ceil(o/a),h=o-(f-1)*a),v.copy(p,0,0,a);for(var m=1;m=t.length){s++;break}var o=t.slice(2,i-1),u=t.slice(i-1,i);(r.toString("hex")!=="0002"&&!n||r.toString("hex")!=="0001"&&n)&&s++,o.length<8&&s++;if(s)throw new Error("decryption error");return t.slice(i)}function h(e,t){e=new n(e),t=new n(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var s=-1;while(++sp||(new o(i)).cmp(h.modulus)>=0)throw new Error("decryption error");var d;s?d=f(new o(i),h):d=u(i,h);var v=new n(p-d.length);v.fill(0),d=n.concat([v,d],p);if(a===4)return l(h,d);if(a===1)return c(h,d,s);if(a===3)return d;throw new Error("unknown padding")}}).call(this,e("buffer").Buffer)},{"./mgf":240,"./withPublic":282,"./xor":283,"bn.js":241,"browserify-rsa":242,buffer:89,"create-hash":217,"parse-asn1":246}],281:[function(e,t,n){(function(n){function h(e,t){var r=e.modulus.byteLength(),f=t.length,l=s("sha1").update(new n("")).digest(),c=l.length,h=2*c;if(f>r-h-2)throw new Error("message too long");var p=new n(r-f-h-2);p.fill(0);var d=r-c-1,v=i(c),m=u(n.concat([l,p,new n([1]),t],d),o(v,d)),g=u(v,o(m,c));return new a(n.concat([new n([0]),g,m],r))}function p(e,t,r){var i=t.length,s=e.modulus.byteLength();if(i>s-11)throw new Error("message too long");var o;return r?(o=new n(s-i-3),o.fill(255)):o=d(s-i-3),new a(n.concat([new n([0,r?1:2]),o,new n([0]),t],s))}function d(e,t){var r=new n(e),s=0,o=i(e*2),u=0,a;while(s=0)throw new Error("data too long for modulus")}return i?l(u,o):f(u,o)}}).call(this,e("buffer").Buffer)},{"./mgf":240,"./withPublic":282,"./xor":283,"bn.js":241,"browserify-rsa":242,buffer:89,"create-hash":217,"parse-asn1":246,randombytes:284}],282:[function(e,t,n){(function(n){function i(e,t){return new n(e.toRed(r.mont(t.modulus)).redPow(new r(t.publicExponent)).fromRed().toArray())}var r=e("bn.js");t.exports=i}).call(this,e("buffer").Buffer)},{"bn.js":241,buffer:89}],283:[function(e,t,n){t.exports=function(t,n){var r=t.length,i=-1;while(++i65536)throw new Error("requested too many random bytes");var o=new n.Uint8Array(t);s.getRandomValues(o);var u=new r(o.buffer);return typeof i=="function"?e.nextTick(function(){i(null,u)}):u}var s=n.crypto||n.msCrypto;s&&s.getRandomValues?t.exports=o:t.exports=i}).call(this,e("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},e("buffer").Buffer)},{_process:289,buffer:89}],285:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||undefined}function i(e){return typeof e=="function"}function s(e){return typeof e=="number"}function o(e){return typeof e=="object"&&e!==null}function u(e){return e===void 0}t.exports=r,r.EventEmitter=r,r.prototype._events=undefined,r.prototype._maxListeners=undefined,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!s(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,s,a,f;this._events||(this._events={});if(e==="error")if(!this._events.error||o(this._events.error)&&!this._events.error.length)throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');n=this._events[e];if(u(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n)){s=Array.prototype.slice.call(arguments,1),f=n.slice(),r=f.length;for(a=0;a0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var n=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var n,r,s,u;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;n=this._events[e],s=n.length,r=-1;if(n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(u=s;u-->0;)if(n[u]===t||n[u].listener&&n[u].listener===t){r=u;break}if(r<0)return this;n.length===1?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}return this.removeAllListeners("removeListener"),this._events={},this}n=this._events[e];if(i(n))this.removeListener(e,n);else if(n)while(n.length)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return!this._events||!this._events[e]?t=[]:i(this._events[e])?t=[this._events[e]]:t=this._events[e].slice(),t},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],286:[function(e,t,n){typeof Object.create=="function"?t.exports=function(t,n){t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],287:[function(e,t,n){t.exports=function(e){return e!=null&&!!(e._isBuffer||e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))}},{}],288:[function(e,t,n){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],289:[function(e,t,n){function a(){s=!1,o.length?i=o.concat(i):u=-1,i.length&&f()}function f(){if(s)return;var e=setTimeout(a);s=!0;var t=i.length;while(t){o=i,i=[];while(++u1)for(var n=1;n0)if(t.ended&&!i){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&i){var o=new Error("stream.unshift() after end event");e.emit("error",o)}else t.decoder&&!i&&!r&&(n=t.decoder.write(n)),i||(t.reading=!1),t.flowing&&t.length===0&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&x(e)),N(e,t);else i||(t.reading=!1);return g(t)}function g(e){return!e.ended&&(e.needReadable||e.length=y?e=y:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function w(e,t){return t.length===0&&t.ended?0:t.objectMode?e===0?0:1:e===null||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=b(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function E(e,t){var n=null;return!s.isBuffer(t)&&typeof t!="string"&&t!==null&&t!==undefined&&!e.objectMode&&(n=new TypeError("Invalid non-string/buffer chunk")),n}function S(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,x(e)}function x(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?r(T,e):T(e))}function T(e){c("emit readable"),e.emit("readable"),M(e)}function N(e,t){t.readingMore||(t.readingMore=!0,r(C,e,t))}function C(e,t){var n=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=r)i?u=n.join(""):n.length===1?u=n[0]:u=s.concat(n,r),n.length=0;else if(e0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,r(P,t,e))}function P(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function H(e,t){for(var n=0,r=e.length;n0)t.emittedReadable=!1;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return c("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?D(this):x(this),null;e=w(e,t);if(e===0&&t.ended)return t.length===0&&D(this),null;var r=t.needReadable;c("need readable",r);if(t.length===0||t.length-e0?i=_(e,t):i=null,i===null&&(t.needReadable=!0,e=0),t.length-=e,t.length===0&&!t.ended&&(t.needReadable=!0),n!==e&&t.ended&&t.length===0&&D(this),i!==null&&this.emit("data",i),i},v.prototype._read=function(e){this.emit("error",new Error("not implemented"))},v.prototype.pipe=function(e,t){function l(e){c("onunpipe"),e===s&&v()}function h(){c("onend"),e.end()}function v(){c("cleanup"),e.removeListener("close",y),e.removeListener("finish",b),e.removeListener("drain",p),e.removeListener("error",g),e.removeListener("unpipe",l),s.removeListener("end",h),s.removeListener("end",v),s.removeListener("data",m),d=!0,o.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&p()}function m(t){c("ondata");var n=e.write(t);!1===n&&(o.pipesCount===1&&o.pipes[0]===e&&s.listenerCount("data")===1&&!d&&(c("false write response, pause",s._readableState.awaitDrain),s._readableState.awaitDrain++),s.pause())}function g(t){c("onerror",t),w(),e.removeListener("error",g),u(e,"error")===0&&e.emit("error",t)}function y(){e.removeListener("finish",b),w()}function b(){c("onfinish"),e.removeListener("close",y),w()}function w(){c("unpipe"),s.unpipe(e)}var s=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,c("pipe count=%d opts=%j",o.pipesCount,t);var a=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,f=a?h:v;o.endEmitted?r(f):s.once("end",f),e.on("unpipe",l);var p=k(s);e.on("drain",p);var d=!1;return s.on("data",m),!e._events||!e._events.error?e.on("error",g):i(e._events.error)?e._events.error.unshift(g):e._events.error=[g,e._events.error],e.once("close",y),e.once("finish",b),e.emit("pipe",s),o.flowing||(c("pipe resume"),s.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+t);this._writableState.defaultEncoding=t},h.prototype._write=function(e,t,n){n(new Error("not implemented"))},h.prototype._writev=null,h.prototype.end=function(e,t,n){var r=this._writableState;typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null),e!==null&&e!==undefined&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),!r.ending&&!r.finished&&k(this,r,n)}},{"./_stream_duplex":291,buffer:89,"core-util-is":296,events:285,inherits:286,"process-nextick-args":297,"util-deprecate":298}],296:[function(e,t,n){(function(e){function t(e){return Array.isArray?Array.isArray(e):m(e)==="[object Array]"}function r(e){return typeof e=="boolean"}function i(e){return e===null}function s(e){return e==null}function o(e){return typeof e=="number"}function u(e){return typeof e=="string"}function a(e){return typeof e=="symbol"}function f(e){return e===void 0}function l(e){return m(e)==="[object RegExp]"}function c(e){return typeof e=="object"&&e!==null}function h(e){return m(e)==="[object Date]"}function p(e){return m(e)==="[object Error]"||e instanceof Error}function d(e){return typeof e=="function"}function v(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e=="undefined"}function m(e){return Object.prototype.toString.call(e)}n.isArray=t,n.isBoolean=r,n.isNull=i,n.isNullOrUndefined=s,n.isNumber=o,n.isString=u,n.isSymbol=a,n.isUndefined=f,n.isRegExp=l,n.isObject=c,n.isDate=h,n.isError=p,n.isFunction=d,n.isPrimitive=v,n.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../../../insert-module-globals/node_modules/is-buffer/index.js")})},{"../../../../insert-module-globals/node_modules/is-buffer/index.js":287}],297:[function(e,t,n){(function(e){"use strict";function n(t){var n=new Array(arguments.length-1),r=0;while(r=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n;if(this.charReceived=55296&&r<=56319){this.charLength+=this.surrogateSize,t="";continue}this.charReceived=this.charLength=0;if(e.length===0)return t;break}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,r=t.charCodeAt(i);if(r>=55296&&r<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),e.copy(this.charBuffer,0,0,s),t.substring(0,i)}return t},o.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var n=e[e.length-t];if(t==1&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},o.prototype.end=function(e){var t="";e&&e.length&&(t=this.write(e));if(this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}},{buffer:89}],305:[function(require,module,exports){function Context(){}var indexOf=require("indexof"),Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in e)t.push(n);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n1)return i.encode.apply(this,arguments);throw new Error("multihash must be called with the encode or decode parameters.")};i.names={sha1:17,"sha2-256":18,"sha2-512":19,sha3:20,blake2b:64,blake2s:65},i.codes=r(i.names),i.defaultLengths={17:20,18:32,19:64,20:64,64:64,65:32},i.encode=function(t,r,s){if(!t||!r)throw new Error("multihash encode requires at least two args: hashfn, digest");r=i.coerceCode(r);if(!n.isBuffer(t))throw new Error("digest should be a Buffer");s||(s=t.length);if(s&&t.length!==s)throw new Error("digest length should be equal to specified length.");if(s>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return n.concat([new n([r,s]),t])},i.decode=function(t){var n=i.validate(t);if(n)throw n;var r={};return r.code=t[0],r.name=i.codes[r.code],r.length=t[1],r.digest=t.slice(2),r},i.validate=function(t){return n.isBuffer(t)?t.length<3?new Error("multihash too short. must be > 3 bytes."):t.length>129?new Error("multihash too long. must be < 129 bytes."):!i.isAppCode(t[0])&&!i.codes[t[0]]?new Error("multihash unknown function code: 0x"+t[0].toString(16)):t.slice(2).length!==t[1]?new Error("multihash length inconsistent: 0x"+t.toString("hex")):!1:new Error("multihash must be a Buffer")},i.coerceCode=function(t){var n=t;if(typeof t=="string"){if(!i.names[t])throw new Error("Unrecognized hash function named: "+t);n=i.names[t]}if(typeof n!="number")throw new Error("Hash function code should be a number. Got: "+n);if(!i.codes[n]&&!i.isAppCode(n))throw new Error("Unrecognized function code: "+n);return n},i.isAppCode=function(t){return t>0&&t<16}}).call(this,e("buffer").Buffer)},{buffer:89,"invert-hash":2}],web3:[function(e,t,n){var r=e("./lib/web3");typeof window!="undefined"&&typeof window.Web3=="undefined"&&(window.Web3=r),t.exports=r},{"./lib/web3":26}]},{},[]); \ No newline at end of file +require=function e(t,n,r){function i(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return i(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var s=typeof require=="function"&&require;for(var o=0;o0)n.push(o%r),o=o/r|0}for(var u=0;e[u]===0&&u>=8;while(a>0)t.push(a&255),a>>=8}for(var f=0;e[f]===i&&f=55296&&i<=56319&&n65535&&(r-=65536,i+=u(r>>>10&1023|55296),r=56320|r&1023),i+=u(r);return i}function l(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function c(e,t){return u(e>>t&63|128)}function h(e){if((e&4294967168)==0)return u(e);var t="";return(e&4294965248)==0?t=u(e>>6&31|192):(e&4294901760)==0?(l(e),t=u(e>>12&15|224),t+=c(e,6)):(e&4292870144)==0&&(t=u(e>>18&7|240),t+=c(e,12),t+=c(e,6)),t+=u(e&63|128),t}function p(e){var t=a(e),n=t.length,r=-1,i,s="";while(++r=g)throw Error("Invalid byte index");var e=m[y]&255;y++;if((e&192)==128)return e&63;throw Error("Invalid continuation byte")}function v(){var e,t,n,r,i;if(y>g)throw Error("Invalid byte index");if(y==g)return!1;e=m[y]&255,y++;if((e&128)==0)return e;if((e&224)==192){var t=d();i=(e&31)<<6|t;if(i>=128)return i;throw Error("Invalid continuation byte")}if((e&240)==224){t=d(),n=d(),i=(e&15)<<12|t<<6|n;if(i>=2048)return l(i),i;throw Error("Invalid continuation byte")}if((e&248)==240){t=d(),n=d(),r=d(),i=(e&15)<<18|t<<12|n<<6|r;if(i>=65536&&i<=1114111)return i}throw Error("Invalid UTF-8 detected")}function b(e){m=a(e),g=m.length,y=0;var t=[],n;while((n=v())!==!1)t.push(n);return f(t)}var i=typeof n=="object"&&n,s=typeof t=="object"&&t&&t.exports==i&&t,o=typeof e=="object"&&e;if(o.global===o||o.window===o)r=o;var u=String.fromCharCode,m,g,y,w={version:"2.0.0",encode:p,decode:b};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd)define(function(){return w});else if(i&&!i.nodeType)if(s)s.exports=w;else{var E={},S=E.hasOwnProperty;for(var x in w)S.call(w,x)&&(i[x]=w[x])}else r.utf8=w})(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],4:[function(e,t,n){t.exports=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"name",outputs:[{name:"o_name",type:"bytes32"}],type:"function"},{constant:!0,inputs:[{name:"_name",type:"bytes32"}],name:"owner",outputs:[{name:"",type:"address"}],type:"function"},{constant:!0,inputs:[{name:"_name",type:"bytes32"}],name:"content",outputs:[{name:"",type:"bytes32"}],type:"function"},{constant:!0,inputs:[{name:"_name",type:"bytes32"}],name:"addr",outputs:[{name:"",type:"address"}],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"}],name:"reserve",outputs:[],type:"function"},{constant:!0,inputs:[{name:"_name",type:"bytes32"}],name:"subRegistrar",outputs:[{name:"",type:"address"}],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_newOwner",type:"address"}],name:"transfer",outputs:[],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_registrar",type:"address"}],name:"setSubRegistrar",outputs:[],type:"function"},{constant:!1,inputs:[],name:"Registrar",outputs:[],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_a",type:"address"},{name:"_primary",type:"bool"}],name:"setAddress",outputs:[],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_content",type:"bytes32"}],name:"setContent",outputs:[],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"}],name:"disown",outputs:[],type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"_name",type:"bytes32"},{indexed:!1,name:"_winner",type:"address"}],name:"AuctionEnded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_name",type:"bytes32"},{indexed:!1,name:"_bidder",type:"address"},{indexed:!1,name:"_value",type:"uint256"}],name:"NewBid",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"name",type:"bytes32"}],name:"Changed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"name",type:"bytes32"},{indexed:!0,name:"addr",type:"address"}],name:"PrimaryChanged",type:"event"}]},{}],5:[function(e,t,n){t.exports=[{constant:!0,inputs:[{name:"_name",type:"bytes32"}],name:"owner",outputs:[{name:"",type:"address"}],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_refund",type:"address"}],name:"disown",outputs:[],type:"function"},{constant:!0,inputs:[{name:"_name",type:"bytes32"}],name:"addr",outputs:[{name:"",type:"address"}],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"}],name:"reserve",outputs:[],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_newOwner",type:"address"}],name:"transfer",outputs:[],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_a",type:"address"}],name:"setAddr",outputs:[],type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"name",type:"bytes32"}],name:"Changed",type:"event"}]},{}],6:[function(e,t,n){t.exports=[{constant:!1,inputs:[{name:"from",type:"bytes32"},{name:"to",type:"address"},{name:"value",type:"uint256"}],name:"transfer",outputs:[],type:"function"},{constant:!1,inputs:[{name:"from",type:"bytes32"},{name:"to",type:"address"},{name:"indirectId",type:"bytes32"},{name:"value",type:"uint256"}],name:"icapTransfer",outputs:[],type:"function"},{constant:!1,inputs:[{name:"to",type:"bytes32"}],name:"deposit",outputs:[],type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"AnonymousDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"bytes32"},{indexed:!1,name:"value",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"bytes32"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"bytes32"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"indirectId",type:"bytes32"},{indexed:!1,name:"value",type:"uint256"}],name:"IcapTransfer",type:"event"}]},{}],7:[function(e,t,n){var r=e("./formatters"),i=e("./type"),s=function(){this._inputFormatter=r.formatInputInt,this._outputFormatter=r.formatOutputAddress};s.prototype=new i({}),s.prototype.constructor=s,s.prototype.isType=function(e){return!!e.match(/address(\[([0-9]*)\])?/)},s.prototype.staticPartLength=function(e){return 32*this.staticArrayLength(e)},t.exports=s},{"./formatters":12,"./type":17}],8:[function(e,t,n){var r=e("./formatters"),i=e("./type"),s=function(){this._inputFormatter=r.formatInputBool,this._outputFormatter=r.formatOutputBool};s.prototype=new i({}),s.prototype.constructor=s,s.prototype.isType=function(e){return!!e.match(/^bool(\[([0-9]*)\])*$/)},s.prototype.staticPartLength=function(e){return 32*this.staticArrayLength(e)},t.exports=s},{"./formatters":12,"./type":17}],9:[function(e,t,n){var r=e("./formatters"),i=e("./type"),s=function(){this._inputFormatter=r.formatInputBytes,this._outputFormatter=r.formatOutputBytes};s.prototype=new i({}),s.prototype.constructor=s,s.prototype.isType=function(e){return!!e.match(/^bytes([0-9]{1,})(\[([0-9]*)\])*$/)},s.prototype.staticPartLength=function(e){var t=e.match(/^bytes([0-9]*)/),n=parseInt(t[1]);return n*this.staticArrayLength(e)},t.exports=s},{"./formatters":12,"./type":17}],10:[function(e,t,n){var r=e("./formatters"),i=e("./address"),s=e("./bool"),o=e("./int"),u=e("./uint"),a=e("./dynamicbytes"),f=e("./string"),l=e("./real"),c=e("./ureal"),h=e("./bytes"),p=function(e){this._types=e};p.prototype._requireType=function(e){var t=this._types.filter(function(t){return t.isType(e)})[0];if(!t)throw Error("invalid solidity type!: "+e);return t},p.prototype.encodeParam=function(e,t){return this.encodeParams([e],[t])},p.prototype.encodeParams=function(e,t){var n=this.getSolidityTypes(e),r=n.map(function(n,r){return n.encode(t[r],e[r])}),i=n.reduce(function(t,n,r){var i=n.staticPartLength(e[r]),s=Math.floor((i+31)/32)*32;return t+s},0),s=this.encodeMultiWithOffset(e,n,r,i);return s},p.prototype.encodeMultiWithOffset=function(e,t,n,i){var s="",o=this,u=function(n){return t[n].isDynamicArray(e[n])||t[n].isDynamicType(e[n])};return e.forEach(function(a,f){if(u(f)){s+=r.formatInputInt(i).encode();var l=o.encodeWithOffset(e[f],t[f],n[f],i);i+=l.length/2}else s+=o.encodeWithOffset(e[f],t[f],n[f],i)}),e.forEach(function(r,a){if(u(a)){var f=o.encodeWithOffset(e[a],t[a],n[a],i);i+=f.length/2,s+=f}}),s},p.prototype.encodeWithOffset=function(e,t,n,i){var s=this;return t.isDynamicArray(e)?function(){var o=t.nestedName(e),u=t.staticPartLength(o),a=n[0];return function(){var e=2;if(t.isDynamicArray(o))for(var s=1;s2&&e.substr(0,2)==="0x"&&(e=e.substr(2)),e=r.enc.Hex.parse(e)),i(e,{outputLength:256}).toString()}},{"crypto-js":60,"crypto-js/sha3":81}],23:[function(e,t,n){var r=e("bignumber.js"),i=e("utf8"),s={wei:"1",kwei:"1000",ada:"1000",femtoether:"1000",mwei:"1000000",babbage:"1000000",picoether:"1000000",gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},o=function(e,t,n){return(new Array(t-e.length+1)).join(n?n:"0")+e},u=function(e,t,n){return e+(new Array(t-e.length+1)).join(n?n:"0")},a=function(e){var t="",n=0,r=e.length;e.substring(0,2)==="0x"&&(n=2);for(;n50){i.stopWatching(),r=!0;if(!t)throw new Error("Contract transaction couldn't be found after 50 blocks");t(new Error("Contract transaction couldn't be found after 50 blocks"))}else e._eth.getTransactionReceipt(e.transactionHash,function(n,s){s&&!r&&e._eth.getCode(s.contractAddress,function(n,o){if(r||!o)return;i.stopWatching(),r=!0;if(o.length>2)e.address=s.contractAddress,f(e),l(e),t&&t(null,e);else{if(!t)throw new Error("The contract code couldn't be stored, please check your gas amount.");t(new Error("The contract code couldn't be stored, please check your gas amount."))}})})}})},h=function(e,t){this.eth=e,this.abi=t,this.new.getData=this.getData.bind(this)};h.prototype.new=function(){var e=new p(this.eth,this.abi),t={},n,i=Array.prototype.slice.call(arguments);r.isFunction(i[i.length-1])&&(n=i.pop());var s=i[i.length-1];r.isObject(s)&&!r.isArray(s)&&(t=i.pop());var o=a(this.abi,i);t.data+=o;if(n)this.eth.sendTransaction(t,function(t,r){t?n(t):(e.transactionHash=r,n(null,e),c(e,n))});else{var u=this.eth.sendTransaction(t);e.transactionHash=u,c(e)}return e},h.prototype.at=function(e,t){var n=new p(this.eth,this.abi,e);return f(n),l(n),t&&t(null,n),n},h.prototype.getData=function(){var e={},t=Array.prototype.slice.call(arguments),n=t[t.length-1];r.isObject(n)&&!r.isArray(n)&&(e=t.pop());var i=a(this.abi,t);return e.data+=i,e.data};var p=function(e,t,n){this._eth=e,this.transactionHash=null,this.address=n,this.abi=t};t.exports=h},{"../solidity/coder":10,"../utils/utils":23,"./allevents":26,"./event":30,"./function":34}],29:[function(e,t,n){t.exports={InvalidNumberOfParams:function(){return new Error("Invalid number of input parameters")},InvalidConnection:function(e){return new Error("CONNECTION ERROR: Couldn't connect to node "+e+".")},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(e){var t=!e||!e.error||!e.error.message?"Invalid JSON RPC response: "+JSON.stringify(e):e.error.message;return new Error(t)}}},{}],30:[function(e,t,n){var r=e("../utils/utils"),i=e("../solidity/coder"),s=e("./formatters"),o=e("../utils/sha3"),u=e("./filter"),a=e("./methods/watches"),f=function(e,t,n){this._requestManager=e,this._params=t.inputs,this._name=r.transformToFullName(t),this._address=n,this._anonymous=t.anonymous};f.prototype.types=function(e){return this._params.filter(function(t){return t.indexed===e}).map(function(e){return e.type})},f.prototype.displayName=function(){return r.extractDisplayName(this._name)},f.prototype.typeName=function(){return r.extractTypeName(this._name)},f.prototype.signature=function(){return o(this._name)},f.prototype.encode=function(e,t){e=e||{},t=t||{};var n={};["fromBlock","toBlock"].filter(function(e){return t[e]!==undefined}).forEach(function(e){n[e]=s.inputBlockNumberFormatter(t[e])}),n.topics=[],n.address=this._address,this._anonymous||n.topics.push("0x"+this.signature());var o=this._params.filter(function(e){return e.indexed===!0}).map(function(t){var n=e[t.name];return n===undefined||n===null?null:r.isArray(n)?n.map(function(e){return"0x"+i.encodeParam(t.type,e)}):"0x"+i.encodeParam(t.type,n)});return n.topics=n.topics.concat(o),n},f.prototype.decode=function(e){e.data=e.data||"",e.topics=e.topics||[];var t=this._anonymous?e.topics:e.topics.slice(1),n=t.map(function(e){return e.slice(2)}).join(""),r=i.decodeParams(this.types(!0),n),o=e.data.slice(2),u=i.decodeParams(this.types(!1),o),a=s.outputLogFormatter(e);return a.event=this.displayName(),a.address=e.address,a.args=this._params.reduce(function(e,t){return e[t.name]=t.indexed?r.shift():u.shift(),e},{}),delete a.data,delete a.topics,a},f.prototype.execute=function(e,t,n){r.isFunction(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],arguments.length===2&&(t=null),arguments.length===1&&(t=null,e={}));var i=this.encode(e,t),s=this.decode.bind(this);return new u(this._requestManager,i,a.eth(),s,n)},f.prototype.attachToContract=function(e){var t=this.execute.bind(this),n=this.displayName();e[n]||(e[n]=t),e[n][this.typeName()]=this.execute.bind(this,e)},t.exports=f},{"../solidity/coder":10,"../utils/sha3":22,"../utils/utils":23,"./filter":32,"./formatters":33,"./methods/watches":44}],31:[function(e,t,n){var r=e("./formatters"),i=e("./../utils/utils"),s=e("./method"),o=e("./property"),u=function(e){var t=function( +t){var n;t.property?(e[t.property]||(e[t.property]={}),n=e[t.property]):n=e,t.methods&&t.methods.forEach(function(t){t.attachToObject(n),t.setRequestManager(e._requestManager)}),t.properties&&t.properties.forEach(function(t){t.attachToObject(n),t.setRequestManager(e._requestManager)})};return t.formatters=r,t.utils=i,t.Method=s,t.Property=o,t};t.exports=u},{"./../utils/utils":23,"./formatters":33,"./method":39,"./property":46}],32:[function(e,t,n){var r=e("./formatters"),i=e("../utils/utils"),s=function(e){return e===null||typeof e=="undefined"?null:(e=String(e),e.indexOf("0x")===0?e:i.fromUtf8(e))},o=function(e){return i.isString(e)?e:(e=e||{},e.topics=e.topics||[],e.topics=e.topics.map(function(e){return i.isArray(e)?e.map(s):s(e)}),{topics:e.topics,to:e.to,address:e.address,fromBlock:r.inputBlockNumberFormatter(e.fromBlock),toBlock:r.inputBlockNumberFormatter(e.toBlock)})},u=function(e,t){i.isString(e.options)||e.get(function(e,n){e&&t(e),i.isArray(n)&&n.forEach(function(e){t(null,e)})})},a=function(e){var t=function(t,n){if(t)return e.callbacks.forEach(function(e){e(t)});i.isArray(n)&&n.forEach(function(t){t=e.formatter?e.formatter(t):t,e.callbacks.forEach(function(e){e(null,t)})})};e.requestManager.startPolling({method:e.implementation.poll.call,params:[e.filterId]},e.filterId,t,e.stopWatching.bind(e))},f=function(e,t,n,r,i){var s=this,f={};return n.forEach(function(t){t.setRequestManager(e),t.attachToObject(f)}),this.requestManager=e,this.options=o(t),this.implementation=f,this.filterId=null,this.callbacks=[],this.getLogsCallbacks=[],this.pollFilters=[],this.formatter=r,this.implementation.newFilter(this.options,function(e,t){if(e)s.callbacks.forEach(function(t){t(e)});else{s.filterId=t,s.getLogsCallbacks.forEach(function(e){s.get(e)}),s.getLogsCallbacks=[],s.callbacks.forEach(function(e){u(s,e)}),s.callbacks.length>0&&a(s);if(i)return s.watch(i)}}),this};f.prototype.watch=function(e){return this.callbacks.push(e),this.filterId&&(u(this,e),a(this)),this},f.prototype.stopWatching=function(){this.requestManager.stopPolling(this.filterId),this.implementation.uninstallFilter(this.filterId,function(){}),this.callbacks=[]},f.prototype.get=function(e){var t=this;if(!i.isFunction(e)){if(this.filterId===null)throw new Error("Filter ID Error: filter().get() can't be chained synchronous, please provide a callback for the get() method.");var n=this.implementation.getLogs(this.filterId);return n.map(function(e){return t.formatter?t.formatter(e):e})}return this.filterId===null?this.getLogsCallbacks.push(e):this.implementation.getLogs(this.filterId,function(n,r){n?e(n):e(null,r.map(function(e){return t.formatter?t.formatter(e):e}))}),this},t.exports=f},{"../utils/utils":23,"./formatters":33}],33:[function(e,t,n){var r=e("../utils/utils"),i=e("../utils/config"),s=e("./iban"),o=function(e){return r.toBigNumber(e)},u=function(e){return e==="latest"||e==="pending"||e==="earliest"},a=function(e){return e===undefined?i.defaultBlock:f(e)},f=function(e){return e===undefined?undefined:u(e)?e:r.toHex(e)},l=function(e){return e.from=e.from||i.defaultAccount,e.from&&(e.from=y(e.from)),e.to&&(e.to=y(e.to)),["gasPrice","gas","value","nonce"].filter(function(t){return e[t]!==undefined}).forEach(function(t){e[t]=r.fromDecimal(e[t])}),e},c=function(e){return e.from=e.from||i.defaultAccount,e.from=y(e.from),e.to&&(e.to=y(e.to)),["gasPrice","gas","value","nonce"].filter(function(t){return e[t]!==undefined}).forEach(function(t){e[t]=r.fromDecimal(e[t])}),e},h=function(e){return e.blockNumber!==null&&(e.blockNumber=r.toDecimal(e.blockNumber)),e.transactionIndex!==null&&(e.transactionIndex=r.toDecimal(e.transactionIndex)),e.nonce=r.toDecimal(e.nonce),e.gas=r.toDecimal(e.gas),e.gasPrice=r.toBigNumber(e.gasPrice),e.value=r.toBigNumber(e.value),e},p=function(e){return e.blockNumber!==null&&(e.blockNumber=r.toDecimal(e.blockNumber)),e.transactionIndex!==null&&(e.transactionIndex=r.toDecimal(e.transactionIndex)),e.cumulativeGasUsed=r.toDecimal(e.cumulativeGasUsed),e.gasUsed=r.toDecimal(e.gasUsed),r.isArray(e.logs)&&(e.logs=e.logs.map(function(e){return v(e)})),e},d=function(e){return e.gasLimit=r.toDecimal(e.gasLimit),e.gasUsed=r.toDecimal(e.gasUsed),e.size=r.toDecimal(e.size),e.timestamp=r.toDecimal(e.timestamp),e.number!==null&&(e.number=r.toDecimal(e.number)),e.difficulty=r.toBigNumber(e.difficulty),e.totalDifficulty=r.toBigNumber(e.totalDifficulty),r.isArray(e.transactions)&&e.transactions.forEach(function(e){if(!r.isString(e))return h(e)}),e},v=function(e){return e.blockNumber!==null&&(e.blockNumber=r.toDecimal(e.blockNumber)),e.transactionIndex!==null&&(e.transactionIndex=r.toDecimal(e.transactionIndex)),e.logIndex!==null&&(e.logIndex=r.toDecimal(e.logIndex)),e},m=function(e){return e.payload=r.toHex(e.payload),e.ttl=r.fromDecimal(e.ttl),e.workToProve=r.fromDecimal(e.workToProve),e.priority=r.fromDecimal(e.priority),r.isArray(e.topics)||(e.topics=e.topics?[e.topics]:[]),e.topics=e.topics.map(function(e){return r.fromUtf8(e)}),e},g=function(e){return e.expiry=r.toDecimal(e.expiry),e.sent=r.toDecimal(e.sent),e.ttl=r.toDecimal(e.ttl),e.workProved=r.toDecimal(e.workProved),e.payloadRaw=e.payload,e.payload=r.toUtf8(e.payload),r.isJson(e.payload)&&(e.payload=JSON.parse(e.payload)),e.topics||(e.topics=[]),e.topics=e.topics.map(function(e){return r.toUtf8(e)}),e},y=function(e){var t=new s(e);if(t.isValid()&&t.isDirect())return"0x"+t.address();if(r.isStrictAddress(e))return e;if(r.isAddress(e))return"0x"+e;throw"invalid address"},b=function(e){return e.startingBlock=r.toDecimal(e.startingBlock),e.currentBlock=r.toDecimal(e.currentBlock),e.highestBlock=r.toDecimal(e.highestBlock),e};t.exports={inputDefaultBlockNumberFormatter:a,inputBlockNumberFormatter:f,inputCallFormatter:l,inputTransactionFormatter:c,inputAddressFormatter:y,inputPostFormatter:m,outputBigNumberFormatter:o,outputTransactionFormatter:h,outputTransactionReceiptFormatter:p,outputBlockFormatter:d,outputLogFormatter:v,outputPostFormatter:g,outputSyncingFormatter:b}},{"../utils/config":21,"../utils/utils":23,"./iban":36}],34:[function(e,t,n){var r=e("../solidity/coder"),i=e("../utils/utils"),s=e("./formatters"),o=e("../utils/sha3"),u=function(e,t,n){this._eth=e,this._inputTypes=t.inputs.map(function(e){return e.type}),this._outputTypes=t.outputs.map(function(e){return e.type}),this._constant=t.constant,this._name=i.transformToFullName(t),this._address=n};u.prototype.extractCallback=function(e){if(i.isFunction(e[e.length-1]))return e.pop()},u.prototype.extractDefaultBlock=function(e){if(e.length>this._inputTypes.length&&!i.isObject(e[e.length-1]))return s.inputDefaultBlockNumberFormatter(e.pop())},u.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&i.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+r.encodeParams(this._inputTypes,e),t},u.prototype.signature=function(){return o(this._name).slice(0,8)},u.prototype.unpackOutput=function(e){if(!e)return;e=e.length>=2?e.slice(2):e;var t=r.decodeParams(this._outputTypes,e);return t.length===1?t[0]:t},u.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return e!==undefined}),t=this.extractCallback(e),n=this.extractDefaultBlock(e),r=this.toPayload(e);if(!t){var i=this._eth.call(r,n);return this.unpackOutput(i)}var s=this;this._eth.call(r,n,function(e,n){t(e,s.unpackOutput(n))})},u.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return e!==undefined}),t=this.extractCallback(e),n=this.toPayload(e);if(!t)return this._eth.sendTransaction(n);this._eth.sendTransaction(n,t)},u.prototype.estimateGas=function(){var e=Array.prototype.slice.call(arguments),t=this.extractCallback(e),n=this.toPayload(e);if(!t)return this._eth.estimateGas(n);this._eth.estimateGas(n,t)},u.prototype.getData=function(){var e=Array.prototype.slice.call(arguments),t=this.toPayload(e);return t.data},u.prototype.displayName=function(){return i.extractDisplayName(this._name)},u.prototype.typeName=function(){return i.extractTypeName(this._name)},u.prototype.request=function(){var e=Array.prototype.slice.call(arguments),t=this.extractCallback(e),n=this.toPayload(e),r=this.unpackOutput.bind(this);return{method:this._constant?"eth_call":"eth_sendTransaction",callback:t,params:[n],format:r}},u.prototype.execute=function(){var e=!this._constant;return e?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},u.prototype.attachToContract=function(e){var t=this.execute.bind(this);t.request=this.request.bind(this),t.call=this.call.bind(this),t.sendTransaction=this.sendTransaction.bind(this),t.estimateGas=this.estimateGas.bind(this),t.getData=this.getData.bind(this);var n=this.displayName();e[n]||(e[n]=t),e[n][this.typeName()]=t},t.exports=u},{"../solidity/coder":10,"../utils/sha3":22,"../utils/utils":23,"./formatters":33}],35:[function(e,t,n){"use strict";var r=e("./errors"),i;typeof Meteor!="undefined"&&Meteor.isServer?i=Npm.require("xmlhttprequest").XMLHttpRequest:typeof window!="undefined"&&window.XMLHttpRequest?i=window.XMLHttpRequest:i=e("xmlhttprequest").XMLHttpRequest;var s=function(e){this.host=e||"http://localhost:8545"};s.prototype.prepareRequest=function(e){var t=new i;return t.open("POST",this.host,e),t.setRequestHeader("Content-Type","application/json"),t},s.prototype.send=function(e){var t=this.prepareRequest(!1);try{t.send(JSON.stringify(e))}catch(n){throw r.InvalidConnection(this.host)}var i=t.responseText;try{i=JSON.parse(i)}catch(s){throw r.InvalidResponse(t.responseText)}return i},s.prototype.sendAsync=function(e,t){var n=this.prepareRequest(!0);n.onreadystatechange=function(){if(n.readyState===4){var e=n.responseText,i=null;try{e=JSON.parse(e)}catch(s){i=r.InvalidResponse(n.responseText)}t(i,e)}};try{n.send(JSON.stringify(e))}catch(i){t(r.InvalidConnection(this.host))}},s.prototype.isConnected=function(){try{return this.send({id:9999999999,jsonrpc:"2.0",method:"net_listening",params:[]}),!0}catch(e){return!1}},t.exports=s},{"./errors":29,xmlhttprequest:20}],36:[function(e,t,n){var r=e("bignumber.js"),i=function(e,t){var n=e;while(n.length=t&&r<=n?r-t+10:e}).join("")},o=function(e){var t=e,n;while(t.length>2)n=t.slice(0,9),t=parseInt(n,10)%97+t.slice(n.length);return parseInt(t,10)%97},u=function(e){this._iban=e};u.fromAddress=function(e){var t=new r(e,16),n=t.toString(36),s=i(n,15);return u.fromBban(s.toUpperCase())},u.fromBban=function(e){var t="XE",n=o(s(t+"00"+e)),r=("0"+(98-n)).slice(-2);return new u(t+r+e)},u.createIndirect=function(e){return u.fromBban("ETH"+e.institution+e.identifier)},u.isValid=function(e){var t=new u(e);return t.isValid()},u.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&o(s(this._iban))===1},u.prototype.isDirect=function(){return this._iban.length===34||this._iban.length===35},u.prototype.isIndirect=function(){return this._iban.length===20},u.prototype.checksum=function(){return this._iban.substr(2,2)},u.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},u.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},u.prototype.address=function(){if(this.isDirect()){var e=this._iban.substr(4),t=new r(e,36);return i(t.toString(16),20)}return""},u.prototype.toString=function(){return this._iban},t.exports=u},{"bignumber.js":51}],37:[function(e,t,n){"use strict";var r=e("../utils/utils"),i=e("./errors"),s=function(e,t){var n=this;this.responseCallbacks={},this.path=e,this.connection=t.connect({path:this.path}),this.connection.on("error",function(e){console.error("IPC Connection Error",e),n._timeout()}),this.connection.on("end",function(){n._timeout()}),this.connection.on("data",function(e){n._parseResponse(e.toString()).forEach(function(e){var t=null;r.isArray(e)?e.forEach(function(e){n.responseCallbacks[e.id]&&(t=e.id)}):t=e.id,n.responseCallbacks[t]&&(n.responseCallbacks[t](null,e),delete n.responseCallbacks[t])})})};s.prototype._parseResponse=function(e){var t=this,n=[],r=e.replace(/\}\{/g,"}|--|{").replace(/\}\]\[\{/g,"}]|--|[{").replace(/\}\[\{/g,"}|--|[{").replace(/\}\]\{/g,"}]|--|{").split("|--|");return r.forEach(function(e){t.lastChunk&&(e=t.lastChunk+e);var r=null;try{r=JSON.parse(e)}catch(s){t.lastChunk=e,clearTimeout(t.lastChunkTimeout),t.lastChunkTimeout=setTimeout(function(){throw t.timeout(),i.InvalidResponse(e)},15e3);return}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,r&&n.push(r)}),n},s.prototype._addResponseCallback=function(e,t){var n=e.id||e[0].id,r=e.method||e[0].method;this.responseCallbacks[n]=t,this.responseCallbacks[n].method=r},s.prototype._timeout=function(){for(var e in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(e)&&(this.responseCallbacks[e](i.InvalidConnection("on IPC")),delete this.responseCallbacks[e])},s.prototype.isConnected=function(){var e=this;return e.connection.writable||e.connection.connect({path:e.path}),!!this.connection.writable},s.prototype.send=function(e){if(this.connection.writeSync){var t;this.connection.writable||this.connection.connect({path:this.path});var n=this.connection.writeSync(JSON.stringify(e));try{t=JSON.parse(n)}catch(r){throw i.InvalidResponse(n)}return t}throw new Error('You tried to send "'+e.method+'" synchronously. Synchronous requests are not supported by the IPC provider.')},s.prototype.sendAsync=function(e,t){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(e)),this._addResponseCallback(e,t)},t.exports=s},{"../utils/utils":23,"./errors":29}],38:[function(e,t,n){var r=function(){if(arguments.callee._singletonInstance)return arguments.callee._singletonInstance;arguments.callee._singletonInstance=this,this.messageId=1};r.getInstance=function(){var e=new r;return e},r.prototype.toPayload=function(e,t){return e||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:e,params:t||[],id:this.messageId++}},r.prototype.isValidResponse=function(e){return!!e&&!e.error&&e.jsonrpc==="2.0"&&typeof e.id=="number"&&e.result!==undefined},r.prototype.toBatchPayload=function(e){var t=this;return e.map(function(e){return t.toPayload(e.method,e.params)})},t.exports=r},{}],39:[function(e,t,n){var r=e("../utils/utils"),i=e("./errors"),s=function(e){this.name=e.name,this.call=e.call,this.params=e.params||0,this.inputFormatter=e.inputFormatter,this.outputFormatter=e.outputFormatter,this.requestManager=null};s.prototype.setRequestManager=function(e){this.requestManager=e},s.prototype.getCall=function(e){return r.isFunction(this.call)?this.call(e):this.call},s.prototype.extractCallback=function(e){if(r.isFunction(e[e.length-1]))return e.pop()},s.prototype.validateArgs=function(e){if(e.length!==this.params)throw i.InvalidNumberOfParams()},s.prototype.formatInput=function(e){return this.inputFormatter?this.inputFormatter.map(function(t,n){return t?t(e[n]):e[n]}):e},s.prototype.formatOutput=function(e){return this.outputFormatter&&e?this.outputFormatter(e):e},s.prototype.toPayload=function(e){var t=this.getCall(e),n=this.extractCallback(e),r=this.formatInput(e);return this.validateArgs(r),{method:t,params:r,callback:n}},s.prototype.attachToObject=function(e){var t=this.buildCall();t.call=this.call;var n=this.name.split(".");n.length>1?(e[n[0]]=e[n[0]]||{},e[n[0]][n[1]]=t):e[n[0]]=t},s.prototype.buildCall=function(){var e=this,t=function(){var t=e.toPayload(Array.prototype.slice.call(arguments));return t.callback?e.requestManager.sendAsync(t,function(n,r){t.callback(n,e.formatOutput(r))}):e.formatOutput(e.requestManager.send(t))};return t.request=this.request.bind(this),t},s.prototype.request=function(){var e=this.toPayload(Array.prototype.slice.call(arguments));return e.format=this.formatOutput.bind(this),e},t.exports=s},{"../utils/utils":23,"./errors":29}],40:[function(e,t,n){var r=e("../method"),i=function(e){this._requestManager=e._requestManager;var t=this;s().forEach(function(n){n.attachToObject(t),n.setRequestManager(e._requestManager)})},s=function(){var e=new r({name:"putString",call:"db_putString",params:3}),t=new r({name:"getString",call:"db_getString",params:2}),n=new r({name:"putHex",call:"db_putHex",params:3}),i=new r({name:"getHex",call:"db_getHex",params:2});return[e,t,n,i]};t.exports=i},{"../method":39}],41:[function(e,t,n){"use strict";function w(e){this._requestManager=e._requestManager;var t=this;E().forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)}),S().forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)}),this.iban=p,this.sendIBANTransaction=d.bind(null,this)}var r=e("../formatters"),i=e("../../utils/utils"),s=e("../method"),o=e("../property"),u=e("../../utils/config"),a=e("../contract"),f=e("./watches"),l=e("../filter"),c=e("../syncing"),h=e("../namereg"),p=e("../iban"),d=e("../transfer"),v=function(e){return i.isString(e[0])&&e[0].indexOf("0x")===0?"eth_getBlockByHash":"eth_getBlockByNumber"},m=function(e){return i.isString(e[0])&&e[0].indexOf("0x")===0?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},g=function(e){return i.isString(e[0])&&e[0].indexOf("0x")===0?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},y=function(e){return i.isString(e[0])&&e[0].indexOf("0x")===0?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},b=function(e){return i.isString(e[0])&&e[0].indexOf("0x")===0?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"};Object.defineProperty(w.prototype,"defaultBlock",{get:function(){return u.defaultBlock},set:function(e){return u.defaultBlock=e,e}}),Object.defineProperty(w.prototype,"defaultAccount",{get:function(){return u.defaultAccount},set:function(e){return u.defaultAccount=e,e}});var E=function(){var e=new s({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[r.inputAddressFormatter,r.inputDefaultBlockNumberFormatter],outputFormatter:r.outputBigNumberFormatter}),t=new s({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[null,i.toHex,r.inputDefaultBlockNumberFormatter]}),n=new s({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[r.inputAddressFormatter,r.inputDefaultBlockNumberFormatter]}),o=new s({name:"getBlock",call:v,params:2,inputFormatter:[r.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:r.outputBlockFormatter}),u=new s({name:"getUncle",call:g,params:2,inputFormatter:[r.inputBlockNumberFormatter,i.toHex],outputFormatter:r.outputBlockFormatter}),a=new s({name:"getCompilers",call:"eth_getCompilers",params:0}),f=new s({name:"getBlockTransactionCount",call:y,params:1,inputFormatter:[r.inputBlockNumberFormatter],outputFormatter:i.toDecimal}),l=new s({name:"getBlockUncleCount",call:b,params:1,inputFormatter:[r.inputBlockNumberFormatter],outputFormatter:i.toDecimal}),c=new s({name:"getTransaction",call:"eth_getTransactionByHash",params:1,outputFormatter:r.outputTransactionFormatter}),h=new s({name:"getTransactionFromBlock",call:m,params:2,inputFormatter:[r.inputBlockNumberFormatter,i.toHex],outputFormatter:r.outputTransactionFormatter}),p=new s({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,outputFormatter:r.outputTransactionReceiptFormatter}),d=new s({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[null,r.inputDefaultBlockNumberFormatter],outputFormatter:i.toDecimal}),w=new s({name:"sendRawTransaction",call:"eth_sendRawTransaction",params:1,inputFormatter:[null]}),E=new s({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[r.inputTransactionFormatter]}),S=new s({name:"call",call:"eth_call",params:2,inputFormatter:[r.inputCallFormatter,r.inputDefaultBlockNumberFormatter]}),x=new s({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[r.inputCallFormatter],outputFormatter:i.toDecimal}),T=new s({name:"compile.solidity",call:"eth_compileSolidity",params:1}),N=new s({name:"compile.lll",call:"eth_compileLLL",params:1}),C=new s({name:"compile.serpent",call:"eth_compileSerpent",params:1}),k=new s({name:"submitWork",call:"eth_submitWork",params:3}),L=new s({name:"getWork",call:"eth_getWork",params:0});return[e,t,n,o,u,a,f,l,c,h,p,d,S,x,w,E,T,N,C,k,L]},S=function(){return[new o({name:"coinbase",getter:"eth_coinbase"}),new o({name:"mining",getter:"eth_mining"}),new o({name:"hashrate",getter:"eth_hashrate",outputFormatter:i.toDecimal}),new o({name:"syncing",getter:"eth_syncing",outputFormatter:r.outputSyncingFormatter}),new o({name:"gasPrice",getter:"eth_gasPrice",outputFormatter:r.outputBigNumberFormatter}),new o({name:"accounts",getter:"eth_accounts"}),new o({name:"blockNumber",getter:"eth_blockNumber",outputFormatter:i.toDecimal})]};w.prototype.contract=function(e){var t=new a(this,e);return t},w.prototype.filter=function(e,t){return new l(this._requestManager,e,f.eth(),r.outputLogFormatter,t)},w.prototype.namereg=function(){return this.contract(h.global.abi).at(h.global.address)},w.prototype.icapNamereg=function(){return this.contract(h.icap.abi).at(h.icap.address)},w.prototype.isSyncing=function(e){return new c(this._requestManager,e)},t.exports=w},{"../../utils/config":21,"../../utils/utils":23,"../contract":28,"../filter":32,"../formatters":33,"../iban":36,"../method":39,"../namereg":45,"../property":46,"../syncing":49,"../transfer":50,"./watches":44}],42:[function(e,t,n){var r=e("../../utils/utils"),i=e("../property"),s=function(e){this._requestManager=e._requestManager;var t=this;o().forEach(function(n){n.attachToObject(t),n.setRequestManager(e._requestManager)})},o=function(){return[new i({name:"listening",getter:"net_listening"}),new i({name:"peerCount",getter:"net_peerCount",outputFormatter:r.toDecimal})]};t.exports=s},{"../../utils/utils":23,"../property":46}],43:[function(e,t,n){var r=e("../method"),i=e("../formatters"),s=e("../filter"),o=e("./watches"),u=function(e){this._requestManager=e._requestManager;var t=this;a().forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)})};u.prototype.filter=function(e,t){return new s(this._requestManager,e,o.shh(),i.outputPostFormatter,t)};var a=function(){var e=new r({name:"post",call:"shh_post",params:1,inputFormatter:[i.inputPostFormatter]}),t=new r({name:"newIdentity",call:"shh_newIdentity",params:0}),n=new r({name:"hasIdentity",call:"shh_hasIdentity",params:1}),s=new r({name:"newGroup",call:"shh_newGroup",params:0}),o=new r({name:"addToGroup",call:"shh_addToGroup",params:0});return[e,t,n,s,o]};t.exports=u},{"../filter":32,"../formatters":33,"../method":39,"./watches":44}],44:[function(e,t,n){var r=e("../method"),i=function(){var e=function(e){var t=e[0];switch(t){case"latest":return e.shift(),this.params=0,"eth_newBlockFilter";case"pending":return e.shift(),this.params=0,"eth_newPendingTransactionFilter";default:return"eth_newFilter"}},t=new r({name:"newFilter",call:e,params:1}),n=new r({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),i=new r({name:"getLogs",call:"eth_getFilterLogs",params:1}),s=new r({name:"poll",call:"eth_getFilterChanges",params:1});return[t,n,i,s]},s=function(){var e=new r({name:"newFilter",call:"shh_newFilter",params:1}),t=new r({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),n=new r({name:"getLogs",call:"shh_getMessages",params:1}),i=new r({name:"poll",call:"shh_getFilterChanges",params:1});return[e,t,n,i]};t.exports={eth:i,shh:s}},{"../method":39}],45:[function(e,t,n){var r=e("../contracts/GlobalRegistrar.json"),i=e("../contracts/ICAPRegistrar.json"),s="0xc6d9d2cd449a754c494264e1809c50e34d64562b",o="0xa1a111bc074c9cfa781f0c38e63bd51c91b8af00";t.exports={global:{abi:r,address:s},icap:{abi:i,address:o}}},{"../contracts/GlobalRegistrar.json":4,"../contracts/ICAPRegistrar.json":5}],46:[function(e,t,n){var r=e("../utils/utils"),i=function(e){this.name=e.name,this.getter=e.getter,this.setter=e.setter,this.outputFormatter=e.outputFormatter,this.inputFormatter=e.inputFormatter,this.requestManager=null};i.prototype.setRequestManager=function(e){this.requestManager=e},i.prototype.formatInput=function(e){return this.inputFormatter?this.inputFormatter(e):e},i.prototype.formatOutput=function(e){return this.outputFormatter&&e!==null?this.outputFormatter(e):e},i.prototype.extractCallback=function(e){if(r.isFunction(e[e.length-1]))return e.pop()},i.prototype.attachToObject=function(e){var t={get:this.buildGet()},n=this.name.split("."),r=n[0];n.length>1&&(e[n[0]]=e[n[0]]||{},e=e[n[0]],r=n[1]),Object.defineProperty(e,r,t),e[s(r)]=this.buildAsyncGet()};var s=function(e){return"get"+e.charAt(0).toUpperCase()+e.slice(1)};i.prototype.buildGet=function(){var e=this;return function(){return e.formatOutput(e.requestManager.send({method:e.getter}))}},i.prototype.buildAsyncGet=function(){var e=this,t=function(t){e.requestManager.sendAsync({method:e.getter},function(n,r){t(n,e.formatOutput(r))})};return t.request=this.request.bind(this),t},i.prototype.request=function(){var e={method:this.getter,params:[],callback:this.extractCallback(Array.prototype.slice.call(arguments))};return e.format=this.formatOutput.bind(this),e},t.exports=i},{"../utils/utils":23}],47:[function(e,t,n){var r=e("./jsonrpc"),i=e("../utils/utils"),s=e("../utils/config"),o=e("./errors"),u=function(e){this.provider=e,this.polls={},this.timeout=null};u.prototype.send=function(e){if(!this.provider)return console.error(o.InvalidProvider()),null;var t=r.getInstance().toPayload(e.method,e.params),n=this.provider.send(t);if(!r.getInstance().isValidResponse(n))throw o.InvalidResponse(n);return n.result},u.prototype.sendAsync=function(e,t){if(!this.provider)return t(o.InvalidProvider());var n=r.getInstance().toPayload(e.method,e.params);this.provider.sendAsync(n,function(e,n){if(e)return t(e);if(!r.getInstance().isValidResponse(n))return t(o.InvalidResponse(n));t(null,n.result)})},u.prototype.sendBatch=function(e,t){if(!this.provider)return t(o.InvalidProvider());var n=r.getInstance().toBatchPayload(e);this.provider.sendAsync(n,function(e,n){if(e)return t(e);if(!i.isArray(n))return t(o.InvalidResponse(n));t(e,n)})},u.prototype.setProvider=function(e){this.provider=e},u.prototype.startPolling=function(e,t,n,r){this.polls[t]={data:e,id:t,callback:n,uninstall:r},this.timeout||this.poll()},u.prototype.stopPolling=function(e){delete this.polls[e],Object.keys(this.polls).length===0&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},u.prototype.reset=function(e){for(var t in this.polls)if(!e||t.indexOf("syncPoll_")===-1)this.polls[t].uninstall(),delete this.polls[t];Object.keys(this.polls).length===0&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},u.prototype.poll=function(){this.timeout=setTimeout(this.poll.bind(this),s.ETH_POLLING_TIMEOUT);if(Object.keys(this.polls).length===0)return;if(!this.provider){console.error(o.InvalidProvider());return}var e=[],t=[];for(var n in this.polls)e.push(this.polls[n].data),t.push(n);if(e.length===0)return;var u=r.getInstance().toBatchPayload(e),a={};u.forEach(function(e,n){a[e.id]=t[n]});var f=this;this.provider.sendAsync(u,function(e,t){if(e)return;if(!i.isArray(t))throw o.InvalidResponse(t);t.map(function(e){var t=a[e.id];return f.polls[t]?(e.callback=f.polls[t].callback,e):!1}).filter(function(e){return!!e}).filter(function(e){var t=r.getInstance().isValidResponse(e);return t||e.callback(o.InvalidResponse(e)),t}).forEach(function(e){e.callback(null,e.result)})})},t.exports=u},{"../utils/config":21,"../utils/utils":23,"./errors":29,"./jsonrpc":38}],48:[function(e,t,n){var r=function(){this.defaultBlock="latest",this.defaultAccount=undefined};t.exports=r},{}],49:[function(e,t,n){var r=e("./formatters"),i=e("../utils/utils"),s=1,o=function(e){var t=function(t,n){if(t)return e.callbacks.forEach(function(e){e(t)});i.isObject(n)&&n.startingBlock&&(n=r.outputSyncingFormatter(n)),e.callbacks.forEach(function(t){e.lastSyncState!==n&&(!e.lastSyncState&&i.isObject(n)&&t(null,!0),setTimeout(function(){t(null,n)},0),e.lastSyncState=n)})};e.requestManager.startPolling({method:"eth_syncing",params:[]},e.pollId,t,e.stopWatching.bind(e))},u=function(e,t){return this.requestManager=e,this.pollId="syncPoll_"+s++,this.callbacks=[],this.addCallback(t),this.lastSyncState=!1,o(this),this};u.prototype.addCallback=function(e){return e&&this.callbacks.push(e),this},u.prototype.stopWatching=function(){this.requestManager.stopPolling(this.pollId),this.callbacks=[]},t.exports=u},{"../utils/utils":23,"./formatters":33}],50:[function(e,t,n){var r=e("./iban"),i=e("../contracts/SmartExchange.json"),s=function(e,t,n,i,s){var a=new r(n);if(!a.isValid())throw new Error("invalid iban address");if(a.isDirect())return o(e,t,a.address(),i,s);if(!s){var f=e.icapNamereg().addr(a.institution());return u(e,t,f,i,a.client())}e.icapNamereg().addr(a.institution(),function(n,r){return u(e,t,r,i,a.client(),s)})},o=function(e,t,n,r,i){return e.sendTransaction({address:n,from:t,value:r},i)},u=function(e,t,n,r,s,o){var u=i;return e.contract(u).at(n).deposit(s,{from:t,value:r},o)};t.exports=s},{"../contracts/SmartExchange.json":6,"./iban":36}],51:[function(e,t,n){(function(n){"use strict";function b(e){function U(e,t){var r,i,u,a,f,l,p=this;if(!(p instanceof U))return B&&J(26,"constructor call without new",e),new U(e,t);if(t==null||!j(t,2,64,n,"base")){if(e instanceof U){p.s=e.s,p.e=e.e,p.c=(e=e.c)?e.slice():e,n=0;return}if((a=typeof e=="number")&&e*0==0){p.s=1/e<0?(e=-e,-1):1;if(e===~~e){for(i=0,u=e;u>=10;u/=10,i++);p.e=i,p.c=[e],n=0;return}l=e+""}else{if(!o.test(l=e+""))return s(p,l,a);p.s=l.charCodeAt(0)===45?(l=l.slice(1),-1):1}}else{t|=0,l=e+"";if(t==10)return p=new U(e instanceof U?e:l),K(p,O+p.e+1,M);if((a=typeof e=="number")&&e*0!=0||!(new RegExp("^-?"+(r="["+h.slice(0,t)+"]+")+"(?:\\."+r+")?$",t<37?"i":"")).test(l))return s(p,l,a,t);a?(p.s=1/e<0?(l=l.slice(1),-1):1,B&&l.replace(/^0\.0*|\./,"").length>15&&J(n,c,e),a=!1):p.s=l.charCodeAt(0)===45?(l=l.slice(1),-1):1,l=z(l,10,t,p.s)}(i=l.indexOf("."))>-1&&(l=l.replace(".","")),(u=l.search(/e/i))>0?(i<0&&(i=u),i+=+l.slice(u+1),l=l.substring(0,u)):i<0&&(i=l.length);for(u=0;l.charCodeAt(u)===48;u++);for(f=l.length;l.charCodeAt(--f)===48;);l=l.slice(u,f+1);if(l){f=l.length,a&&B&&f>15&&J(n,c,p.s*e),i=i-u-1;if(i>H)p.c=p.e=null;else if(i=0&&(u=q,q=0,e=e.replace(".",""),c=new U(r),f=c.pow(e.length-p),q=u,c.c=N(k(E(f.c),f.e),10,n),c.e=c.c.length),l=N(e,r,n),o=u=l.length;for(;l[--u]==0;l.pop());if(!l[0])return"0";p<0?--o:(f.c=l,f.e=o,f.s=i,f=t(f,c,d,v,n),l=f.c,a=f.r,o=f.e),s=o+d+1,p=l[s],u=n/2,a=a||s<0||l[s+1]!=null,a=v<4?(p!=null||a)&&(v==0||v==(f.s<0?3:2)):p>u||p==u&&(v==4||a||v==6&&l[s-1]&1||v==(f.s<0?8:7));if(s<1||!l[0])e=a?k("1",-d):"0";else{l.length=s;if(a)for(--n;++l[--s]>n;)l[s]=0,s||(++o,l.unshift(1));for(u=l.length;!l[--u];);for(p=0,e="";p<=u;e+=h.charAt(l[p++]));e=k(e,o)}return e}function W(e,t,n,r){var i,s,o,u,a;n=n!=null&&j(n,0,8,r,l)?n|0:M;if(!e.c)return e.toString();i=e.c[0],o=e.e;if(t==null)a=E(e.c),a=r==19||r==24&&o<=_?C(a,o):k(a,o);else{e=K(new U(e),t,n),s=e.e,a=E(e.c),u=a.length;if(r==19||r==24&&(t<=s||s<=_)){for(;uu){if(--t>0)for(a+=".";t--;a+="0");}else{t+=s-u;if(t>0){s+1==u&&(a+=".");for(;t--;a+="0");}}}}return e.s<0&&i?"-"+a:a}function X(e,t){var n,r,i=0;T(e[0])&&(e=e[0]),n=new U(e[0]);for(;++in||e!=L(e))&&J(r,(i||"decimal places")+(en?" out of range":" not an integer"),e),!0}function $(e,t,n){var r=1,i=t.length;for(;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*d-1)>H?e.c=e.e=null:n=10;f/=10,i++);s=t-i;if(s<0)s+=d,o=t,l=v[c=0],h=l/g[i-o-1]%10|0;else{c=u((s+1)/d);if(c>=v.length){if(!r)break e;for(;v.length<=c;v.push(0));l= +h=0,i=1,s%=d,o=s-d+1}else{l=f=v[c];for(i=1;f>=10;f/=10,i++);s%=d,o=s-d+i,h=o<0?0:l/g[i-o-1]%10|0}}r=r||t<0||v[c+1]!=null||(o<0?l:l%g[i-o-1]),r=n<4?(h||r)&&(n==0||n==(e.s<0?3:2)):h>5||h==5&&(n==4||r||n==6&&(s>0?o>0?l/g[i-o]:0:v[c-1])%10&1||n==(e.s<0?8:7));if(t<1||!v[0])return v.length=0,r?(t-=e.e+1,v[0]=g[t%d],e.e=-t||0):v[0]=e.e=0,e;s==0?(v.length=c,f=1,c--):(v.length=c+1,f=g[d-s],v[c]=o>0?a(l/g[i-o]%g[o])*f:0);if(r)for(;;){if(c==0){for(s=1,o=v[0];o>=10;o/=10,s++);o=v[0]+=f;for(f=1;o>=10;o/=10,f++);s!=f&&(e.e++,v[0]==p&&(v[0]=1));break}v[c]+=f;if(v[c]!=p)break;v[c--]=0,f=1}for(s=v.length;v[--s]===0;v.pop());}e.e>H?e.c=e.e=null:e.er)return(e=o[r++])!=null};return a(t="DECIMAL_PLACES")&&j(e,0,y,2,t)&&(O=e|0),s[t]=O,a(t="ROUNDING_MODE")&&j(e,0,8,2,t)&&(M=e|0),s[t]=M,a(t="EXPONENTIAL_AT")&&(T(e)?j(e[0],-y,0,2,t)&&j(e[1],0,y,2,t)&&(_=e[0]|0,D=e[1]|0):j(e,-y,y,2,t)&&(_=-(D=(e<0?-e:e)|0))),s[t]=[_,D],a(t="RANGE")&&(T(e)?j(e[0],-y,-1,2,t)&&j(e[1],1,y,2,t)&&(P=e[0]|0,H=e[1]|0):j(e,-y,y,2,t)&&(e|0?P=-(H=(e<0?-e:e)|0):B&&J(2,t+" cannot be zero",e))),s[t]=[P,H],a(t="ERRORS")&&(e===!!e||e===1||e===0?(n=0,j=(B=!!e)?V:x):B&&J(2,t+f,e)),s[t]=B,a(t="CRYPTO")&&(e===!!e||e===1||e===0?(F=!!e&&!!i&&typeof i=="object",e&&!F&&B&&J(2,"crypto unavailable",i)):B&&J(2,t+f,e)),s[t]=F,a(t="MODULO_MODE")&&j(e,0,9,2,t)&&(I=e|0),s[t]=I,a(t="POW_PRECISION")&&j(e,0,y,2,t)&&(q=e|0),s[t]=q,a(t="FORMAT")&&(typeof e=="object"?R=e:B&&J(2,t+" not an object",e)),s[t]=R,s},U.max=function(){return X(arguments,r.lt)},U.min=function(){return X(arguments,r.gt)},U.random=function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return a(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,s,o,f,l=0,c=[],h=new U(A);e=e==null||!j(e,0,y,14)?O:e|0,o=u(e/d);if(F)if(i&&i.getRandomValues){n=i.getRandomValues(new Uint32Array(o*=2));for(;l>>11),f>=9e15?(r=i.getRandomValues(new Uint32Array(2)),n[l]=r[0],n[l+1]=r[1]):(c.push(f%1e14),l+=2);l=o/2}else if(i&&i.randomBytes){n=i.randomBytes(o*=7);for(;l=9e15?i.randomBytes(7).copy(n,l):(c.push(f%1e14),l+=7);l=o/7}else B&&J(14,"crypto unavailable",i);if(!l)for(;l=10;f/=10,l++);lr?1:-1;else for(i=s=0;it[i]?1:-1;break}return s}function n(e,t,n,r){var i=0;for(;n--;)e[n]-=i,i=e[n]1;e.shift());}return function(r,i,s,o,u){var f,l,c,h,v,m,g,y,b,E,S,x,T,N,C,k,L,A=r.s==i.s?1:-1,O=r.c,M=i.c;if(!O||!O[0]||!M||!M[0])return new U(!r.s||!i.s||(O?M&&O[0]==M[0]:!M)?NaN:O&&O[0]==0||!M?A*0:A/0);y=new U(A),b=y.c=[],l=r.e-i.e,A=s+l+1,u||(u=p,l=w(r.e/d)-w(i.e/d),A=A/d|0);for(c=0;M[c]==(O[c]||0);c++);M[c]>(O[c]||0)&&l--;if(A<0)b.push(1),h=!0;else{N=O.length,k=M.length,c=0,A+=2,v=a(u/(M[0]+1)),v>1&&(M=e(M,v,u),O=e(O,v,u),k=M.length,N=O.length),T=k,E=O.slice(0,k),S=E.length;for(;S=u/2&&C++;do{v=0,f=t(M,E,k,S);if(f<0){x=E[0],k!=S&&(x=x*u+(E[1]||0)),v=a(x/C);if(v>1){v>=u&&(v=u-1),m=e(M,v,u),g=m.length,S=E.length;while(t(m,E,g,S)==1)v--,n(m,k=10;A/=10,c++);K(y,s+(y.e=c+l*d-1)+1,o,h)}else y.e=l,y.r=+h;return y}}(),s=function(){var e=/^(-?)0([xbo])/i,t=/^([^.]+)\.$/,r=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,s=/^\s*\+|^\s+|\s+$/g;return function(o,u,a,f){var l,c=a?u:u.replace(s,"");if(i.test(c))o.s=isNaN(c)?null:c<0?-1:1;else{if(!a){c=c.replace(e,function(e,t,n){return l=(n=n.toLowerCase())=="x"?16:n=="b"?2:8,!f||f==l?t:e}),f&&(l=f,c=c.replace(t,"$1").replace(r,"0.$1"));if(u!=c)return new U(c,l)}B&&J(n,"not a"+(f?" base "+f:"")+" number",u),o.s=null}o.c=o.e=null,n=0}}(),r.absoluteValue=r.abs=function(){var e=new U(this);return e.s<0&&(e.s=1),e},r.ceil=function(){return K(new U(this),this.e+1,2)},r.comparedTo=r.cmp=function(e,t){return n=1,S(this,new U(e,t))},r.decimalPlaces=r.dp=function(){var e,t,n=this.c;if(!n)return null;e=((t=n.length-1)-w(this.e/d))*d;if(t=n[t])for(;t%10==0;t/=10,e--);return e<0&&(e=0),e},r.dividedBy=r.div=function(e,r){return n=3,t(this,new U(e,r),O,M)},r.dividedToIntegerBy=r.divToInt=function(e,r){return n=4,t(this,new U(e,r),0,1)},r.equals=r.eq=function(e,t){return n=5,S(this,new U(e,t))===0},r.floor=function(){return K(new U(this),this.e+1,3)},r.greaterThan=r.gt=function(e,t){return n=6,S(this,new U(e,t))>0},r.greaterThanOrEqualTo=r.gte=function(e,t){return n=7,(t=S(this,new U(e,t)))===1||t===0},r.isFinite=function(){return!!this.c},r.isInteger=r.isInt=function(){return!!this.c&&w(this.e/d)>this.c.length-2},r.isNaN=function(){return!this.s},r.isNegative=r.isNeg=function(){return this.s<0},r.isZero=function(){return!!this.c&&this.c[0]==0},r.lessThan=r.lt=function(e,t){return n=8,S(this,new U(e,t))<0},r.lessThanOrEqualTo=r.lte=function(e,t){return n=9,(t=S(this,new U(e,t)))===-1||t===0},r.minus=r.sub=function(e,t){var r,i,s,o,u=this,a=u.s;n=10,e=new U(e,t),t=e.s;if(!a||!t)return new U(NaN);if(a!=t)return e.s=-t,u.plus(e);var f=u.e/d,l=e.e/d,c=u.c,h=e.c;if(!f||!l){if(!c||!h)return c?(e.s=-t,e):new U(h?u:NaN);if(!c[0]||!h[0])return h[0]?(e.s=-t,e):new U(c[0]?u:M==3?0:0)}f=w(f),l=w(l),c=c.slice();if(a=f-l){(o=a<0)?(a=-a,s=c):(l=f,s=h),s.reverse();for(t=a;t--;s.push(0));s.reverse()}else{i=(o=(a=c.length)<(t=h.length))?a:t;for(a=t=0;t0)for(;t--;c[r++]=0);t=p-1;for(;i>a;){if(c[--i]0?(u=o,r=f):(s=-s,r=a),r.reverse();for(;s--;r.push(0));r.reverse()}s=a.length,t=f.length,s-t<0&&(r=f,f=a,a=r,t=s);for(s=0;t;)s=(a[--t]=a[t]+f[t]+s)/p|0,a[t]%=p;return s&&(a.unshift(s),++u),$(e,a,u)},r.precision=r.sd=function(e){var t,n,r=this,i=r.c;e!=null&&e!==!!e&&e!==1&&e!==0&&(B&&J(13,"argument"+f,e),e!=!!e&&(e=null));if(!i)return null;n=i.length-1,t=n*d+1;if(n=i[n]){for(;n%10==0;n/=10,t--);for(n=i[0];n>=10;n/=10,t++);}return e&&r.e+1>t&&(t=r.e+1),t},r.round=function(e,t){var n=new U(this);return(e==null||j(e,0,y,15))&&K(n,~~e+this.e+1,t==null||!j(t,0,8,15,l)?M:t|0),n},r.shift=function(e){var t=this;return j(e,-v,v,16,"argument")?t.times("1e"+L(e)):new U(t.c&&t.c[0]&&(e<-v||e>v)?t.s*(e<0?0:1/0):t)},r.squareRoot=r.sqrt=function(){var e,n,r,i,s,o=this,u=o.c,a=o.s,f=o.e,l=O+4,c=new U("0.5");if(a!==1||!u||!u[0])return new U(!a||a<0&&(!u||u[0])?NaN:u?o:1/0);a=Math.sqrt(+o),a==0||a==1/0?(n=E(u),(n.length+f)%2==0&&(n+="0"),a=Math.sqrt(n),f=w((f+1)/2)-(f<0||f%2),a==1/0?n="1e"+f:(n=a.toExponential(),n=n.slice(0,n.indexOf("e")+1)+f),r=new U(n)):r=new U(a+"");if(r.c[0]){f=r.e,a=f+l,a<3&&(a=0);for(;;){s=r,r=c.times(s.plus(t(o,s,l,1)));if(E(s.c).slice(0,a)===(n=E(r.c)).slice(0,a)){r.e=0;){r=0,v=T[s]%E,m=T[s]/E|0;for(u=f,o=s+u;o>s;)l=x[--u]%E,c=x[u]/E|0,a=m*l+c*v,l=v*l+a%E*E+y[o]+r,r=(l/b|0)+(a/E|0)+m*c,y[o--]=l%b;y[o]=r}return r?++i:y.shift(),$(e,y,i)},r.toDigits=function(e,t){var n=new U(this);return e=e==null||!j(e,1,y,18,"precision")?null:e|0,t=t==null||!j(t,0,8,18,l)?M:t|0,e?K(n,e,t):n},r.toExponential=function(e,t){return W(this,e!=null&&j(e,0,y,19)?~~e+1:null,t,19)},r.toFixed=function(e,t){return W(this,e!=null&&j(e,0,y,20)?~~e+this.e+1:null,t,20)},r.toFormat=function(e,t){var n=W(this,e!=null&&j(e,0,y,21)?~~e+this.e+1:null,t,21);if(this.c){var r,i=n.split("."),s=+R.groupSize,o=+R.secondaryGroupSize,u=R.groupSeparator,a=i[0],f=i[1],l=this.s<0,c=l?a.slice(1):a,h=c.length;o&&(r=s,s=o,o=r,h-=r);if(s>0&&h>0){r=h%s||s,a=c.substr(0,r);for(;r0&&(a+=u+c.slice(r)),l&&(a="-"+a)}n=f?a+R.decimalSeparator+((o=+R.fractionGroupSize)?f.replace(new RegExp("\\d{"+o+"}\\B","g"),"$&"+R.fractionGroupSeparator):f):a}return n},r.toFraction=function(e){var n,r,i,s,o,u,a,f,l,c=B,h=this,p=h.c,v=new U(A),g=r=new U(A),y=a=new U(A);if(e!=null){B=!1,u=new U(e),B=c;if(!(c=u.isInt())||u.lt(A))B&&J(22,"max denominator "+(c?"out of range":"not an integer"),e),e=!c&&u.c&&K(u,u.e+1,1).gte(A)?u:null}if(!p)return h.toString();l=E(p),s=v.e=l.length-h.e-1,v.c[0]=m[(o=s%d)<0?d+o:o],e=!e||u.cmp(v)>0?s>0?v:g:u,o=H,H=1/0,u=new U(l),a.c[0]=0;for(;;){f=t(u,v,0,1),i=r.plus(f.times(y));if(i.cmp(e)==1)break;r=y,y=i,g=a.plus(f.times(i=g)),a=i,v=u.minus(f.times(i=v)),u=i}return i=t(e.minus(r),y,0,1),a=a.plus(i.times(g)),r=r.plus(i.times(y)),a.s=g.s=h.s,s*=2,n=t(g,y,s,M).minus(h).abs().cmp(t(a,r,s,M).minus(h).abs())<1?[g.toString(),y.toString()]:[a.toString(),r.toString()],H=o,n},r.toNumber=function(){var e=this;return+e||(e.s?e.s*0:NaN)},r.toPower=r.pow=function(e){var t,n,r=a(e<0?-e:+e),i=this;if(!j(e,-v,v,23,"exponent")&&(!isFinite(e)||r>v&&(e/=0)||parseFloat(e)!=e&&!(e=NaN)))return new U(Math.pow(+i,e));t=q?u(q/d+2):0,n=new U(A);for(;;){if(r%2){n=n.times(i);if(!n.c)break;t&&n.c.length>t&&(n.c.length=t)}r=a(r/2);if(!r)break;i=i.times(i),t&&i.c&&i.c.length>t&&(i.c.length=t)}return e<0&&(n=A.div(n)),t?K(n,q,M):n},r.toPrecision=function(e,t){return W(this,e!=null&&j(e,1,y,24,"precision")?e|0:null,t,24)},r.toString=function(e){var t,n=this,r=n.s,i=n.e;return i===null?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=E(n.c),e==null||!j(e,2,64,25,"base")?t=i<=_||i>=D?C(t,i):k(t,i):t=z(k(t,i),e|0,10,r),r<0&&n.c[0]&&(t="-"+t)),t},r.truncated=r.trunc=function(){return K(new U(this),this.e+1,1)},r.valueOf=r.toJSON=function(){return this.toString()},e!=null&&U.config(e),U}function w(e){var t=e|0;return e>0||e===t?t:t-1}function E(e){var t,n,r=1,i=e.length,s=e[0]+"";for(;rf^n?1:-1;u=(a=i.length)<(f=s.length)?a:f;for(o=0;os[o]^n?1:-1;return a==f?0:a>f^n?1:-1}function x(e,t,n){return(e=L(e))>=t&&e<=n}function T(e){return Object.prototype.toString.call(e)=="[object Array]"}function N(e,t,n){var r,i=[0],s,o=0,u=e.length;for(;on-1&&(i[r+1]==null&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function C(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t){var n,r;if(t<0){for(r="0.";++t;r+="0");e=r+e}else{n=e.length;if(++t>n){for(r="0",t-=n;--t;r+="0");e+=r}else t>>8^i&255^99,s[n]=i,o[i]=n;var v=e[n],m=e[v],g=e[m],y=e[i]*257^i*16843008;u[n]=y<<24|y>>>8,a[n]=y<<16|y>>>16,f[n]=y<<8|y>>>24,l[n]=y;var y=g*16843009^m*65537^v*257^n*16843008;c[i]=y<<24|y>>>8,h[i]=y<<16|y>>>16,p[i]=y<<8|y>>>24,d[i]=y,n?(n=v^e[e[e[g^v]]],r^=e[e[r]]):n=r=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],m=i.AES=r.extend({_doReset:function(){var e=this._key,t=e.words,n=e.sigBytes/4,r=this._nRounds=n+6,i=(r+1)*4,o=this._keySchedule=[];for(var u=0;u6&&u%n==4&&(a=s[a>>>24]<<24|s[a>>>16&255]<<16|s[a>>>8&255]<<8|s[a&255]):(a=a<<8|a>>>24,a=s[a>>>24]<<24|s[a>>>16&255]<<16|s[a>>>8&255]<<8|s[a&255],a^=v[u/n|0]<<24),o[u]=o[u-n]^a}var f=this._invKeySchedule=[];for(var l=0;l>>24]]^h[s[a>>>16&255]]^p[s[a>>>8&255]]^d[s[a&255]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,u,a,f,l,s)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,c,h,p,d,o);var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,s,o,u){var a=this._nRounds,f=e[t]^n[0],l=e[t+1]^n[1],c=e[t+2]^n[2],h=e[t+3]^n[3],p=4;for(var d=1;d>>24]^i[l>>>16&255]^s[c>>>8&255]^o[h&255]^n[p++],m=r[l>>>24]^i[c>>>16&255]^s[h>>>8&255]^o[f&255]^n[p++],g=r[c>>>24]^i[h>>>16&255]^s[f>>>8&255]^o[l&255]^n[p++],y=r[h>>>24]^i[f>>>16&255]^s[l>>>8&255]^o[c&255]^n[p++];f=v,l=m,c=g,h=y}var v=(u[f>>>24]<<24|u[l>>>16&255]<<16|u[c>>>8&255]<<8|u[h&255])^n[p++],m=(u[l>>>24]<<24|u[c>>>16&255]<<16|u[h>>>8&255]<<8|u[f&255])^n[p++],g=(u[c>>>24]<<24|u[h>>>16&255]<<16|u[f>>>8&255]<<8|u[l&255])^n[p++],y=(u[h>>>24]<<24|u[f>>>16&255]<<16|u[l>>>8&255]<<8|u[c&255])^n[p++];e[t]=v,e[t+1]=m,e[t+2]=g,e[t+3]=y},keySize:8});t.AES=r._createHelper(m)}(),e.AES})},{"./cipher-core":53,"./core":54,"./enc-base64":55,"./evpkdf":57,"./md5":62}],53:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,s=r.WordArray,o=r.BufferedBlockAlgorithm,u=n.enc,a=u.Utf8,f=u.Base64,l=n.algo,c=l.EvpKDF,h=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return typeof e=="string"?C:x}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()}),p=r.StreamCipher=h.extend({_doFinalize:function(){var e=this._process(!0);return e},blockSize:1}),d=n.mode={},v=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=d.CBC=function(){function n(e,n,r){var i=this._iv;if(i){var s=i;this._iv=t}else var s=this._prevBlock;for(var o=0;o>>2]&255;e.sigBytes-=t}},b=r.BlockCipher=h.extend({cfg:h.cfg.extend({mode:m,padding:y}),reset:function(){h.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else{var r=n.createDecryptor;this._minBufferSize=1}this._mode=r.call(n,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),w=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),E=n.format={},S=E.OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var r=s.create([1398893684,1701076831]).concat(n).concat(t);else var r=t;return r.toString(f)},parse:function(e){var t=f.parse(e),n=t.words;if(n[0]==1398893684&&n[1]==1701076831){var r=s.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return w.create({ciphertext:t,salt:r})}},x=r.SerializableCipher=i.extend({cfg:i.extend({format:S}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),s=i.finalize(t),o=i.cfg;return w.create({ciphertext:s,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=e.createDecryptor(n,r).finalize(t.ciphertext);return i},_parse:function(e,t){return typeof e=="string"?t.parse(e,this):e}}),T=n.kdf={},N=T.OpenSSL={execute:function(e,t,n,r){r||(r=s.random(8));var i=c.create({keySize:t+n}).compute(e,r),o=s.create(i.words.slice(t),n*4);return i.sigBytes=t*4,w.create({key:i,iv:o,salt:r})}},C=r.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:N}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=r.kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var s=x.encrypt.call(this,e,t,i.key,r);return s.mixIn(i),s},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);r.iv=i.iv;var s=x.decrypt.call(this,e,t,i.key,r);return s}})}()})},{"./core":54}],54:[function(e,t,n){(function(e,r){typeof n=="object"?t.exports=n=r():typeof define=="function"&&define.amd?define([],r):e.CryptoJS=r()})(this,function(){var e=e||function(e,t){var n={},r=n.lib={},i=r.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var n=new e;return t&&n.mixIn(t),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=r.WordArray=i.extend({init:function(e,n){e=this.words=e||[],n!=t?this.sigBytes=n:this.sigBytes=e.length*4},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;this.clamp();if(r%4)for(var s=0;s>>2]>>>24-s%4*8&255;t[r+s>>>2]|=o<<24-(r+s)%4*8}else for(var s=0;s>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){var n=[],r=function(t){var t=t,n=987654321,r=4294967295;return function(){n=36969*(n&65535)+(n>>16)&r,t=18e3*(t&65535)+(t>>16)&r;var i=(n<<16)+t&r;return i/=4294967296,i+=.5,i*(e.random()>.5?1:-1)}};for(var i=0,o;i>>2]>>>24-i%4*8&255;r.push((s>>>4).toString(16)),r.push((s&15).toString(16))}return r.join("")},parse:function(e){var t=e.length,n=[];for(var r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new s.init(n,t/2)}},a=o.Latin1={stringify:function(e){var t=e.words,n=e.sigBytes,r=[];for(var i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){var t=e.length,n=[];for(var r=0;r>>2]|=(e.charCodeAt(r)&255)<<24-r%4*8;return new s.init(n,t)}},f=o.Utf8={stringify:function(e){try{return decodeURIComponent(escape(a.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return a.parse(unescape(encodeURIComponent(e)))}},l=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){typeof e=="string"&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,u=o*4,a=i/u;t?a=e.ceil(a):a=e.max((a|0)-this._minBufferSize,0);var f=a*o,l=e.min(f*4,i);if(f){for(var c=0;c>>2]>>>24-s%4*8&255,u=t[s+1>>>2]>>>24-(s+1)%4*8&255,a=t[s+2>>>2]>>>24-(s+2)%4*8&255,f=o<<16|u<<8|a;for(var l=0;l<4&&s+l*.75>>6*(3-l)&63))}var c=r.charAt(64);if(c)while(i.length%4)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=n.charAt(64);if(i){var s=e.indexOf(i);s!=-1&&(t=s)}var o=[],u=0;for(var a=0;a>>6-a%4*2,c=f|l;o[u>>>2]|=c<<24-u%4*8,u++}return r.create(o,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64})},{"./core":54}],56:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(){function o(e){return e<<8&4278255360|e>>>8&16711935}var t=e,n=t.lib,r=n.WordArray,i=t.enc,s=i.Utf16=i.Utf16BE={stringify:function(e){var t=e.words,n=e.sigBytes,r=[];for(var i=0;i>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){var t=e.length,n=[];for(var i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return r.create(n,t*2)}};i.Utf16LE={stringify:function(e){var t=e.words,n=e.sigBytes,r=[];for(var i=0;i>>2]>>>16-i%4*8&65535);r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){var t=e.length,n=[];for(var i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return r.create(n,t*2)}}}(),e.enc.Utf16})},{"./core":54}],57:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./sha1"),e("./hmac")):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],i):i(r.CryptoJS)})(this,function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,s=t.algo,o=s.MD5,u=s.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){var n=this.cfg,r=n.hasher.create(),s=i.create(),o=s.words,u=n.keySize,a=n.iterations;while(o.lengthr&&(t=e.finalize(t)),t.clamp();var i=this._oKey=t.clone(),o=this._iKey=t.clone(),u=i.words,a=o.words;for(var f=0;f>>2]|=e[r]<<24-r%4*8;i.call(this,n,t)}else i.apply(this,arguments)};s.prototype=r}(),e.lib.WordArray})},{"./core":54}],62:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(t){function f(e,t,n,r,i,s,o){var u=e+(t&n|~t&r)+i+o;return(u<>>32-s)+t}function l(e,t,n,r,i,s,o){var u=e+(t&r|n&~r)+i+o;return(u<>>32-s)+t}function c(e,t,n,r,i,s,o){var u=e+(t^n^r)+i+o;return(u<>>32-s)+t}function h(e,t,n,r,i,s,o){var u=e+(n^(t|~r))+i+o;return(u<>>32-s)+t}var n=e,r=n.lib,i=r.WordArray,s=r.Hasher,o=n.algo,u=[];(function(){for(var e=0;e<64;e++)u[e]=t.abs(t.sin(e+1))*4294967296|0})();var a=o.MD5=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}var s=this._hash.words,o=e[t+0],a=e[t+1],p=e[t+2],d=e[t+3],v=e[t+4],m=e[t+5],g=e[t+6],y=e[t+7],b=e[t+8],w=e[t+9],E=e[t+10],S=e[t+11],x=e[t+12],N=e[t+13],C=e[t+14],k=e[t+15],L=s[0],A=s[1],O=s[2],M=s[3];L=f(L,A,O,M,o,7,u[0]),M=f(M,L,A,O,a,12,u[1]),O=f(O,M,L,A,p,17,u[2]),A=f(A,O,M,L,d,22,u[3]),L=f(L,A,O,M,v,7,u[4]),M=f(M,L,A,O,m,12,u[5]),O=f(O,M,L,A,g,17,u[6]),A=f(A,O,M,L,y,22,u[7]),L=f(L,A,O,M,b,7,u[8]),M=f(M,L,A,O,w,12,u[9]),O=f(O,M,L,A,E,17,u[10]),A=f(A,O,M,L,S,22,u[11]),L=f(L,A,O,M,x,7,u[12]),M=f(M,L,A,O,N,12,u[13]),O=f(O,M,L,A,C,17,u[14]),A=f(A,O,M,L,k,22,u[15]),L=l(L,A,O,M,a,5,u[16]),M=l(M,L,A,O,g,9,u[17]),O=l(O,M,L,A,S,14,u[18]),A=l(A,O,M,L,o,20,u[19]),L=l(L,A,O,M,m,5,u[20]),M=l(M,L,A,O,E,9,u[21]),O=l(O,M,L,A,k,14,u[22]),A=l(A,O,M,L,v,20,u[23]),L=l(L,A,O,M,w,5,u[24]),M=l(M,L,A,O,C,9,u[25]),O=l(O,M,L,A,d,14,u[26]),A=l(A,O,M,L,b,20,u[27]),L=l(L,A,O,M,N,5,u[28]),M=l(M,L,A,O,p,9,u[29]),O=l(O,M,L,A,y,14,u[30]),A=l(A,O,M,L,x,20,u[31]),L=c(L,A,O,M,m,4,u[32]),M=c(M,L,A,O,b,11,u[33]),O=c(O,M,L,A,S,16,u[34]),A=c(A,O,M,L,C,23,u[35]),L=c(L,A,O,M,a,4,u[36]),M=c(M,L,A,O,v,11,u[37]),O=c(O,M,L,A,y,16,u[38]),A=c(A,O,M,L,E,23,u[39]),L=c(L,A,O,M,N,4,u[40]),M=c(M,L,A,O,o,11,u[41]),O=c(O,M,L,A,d,16,u[42]),A=c(A,O,M,L,g,23,u[43]),L=c(L,A,O,M,w,4,u[44]),M=c(M,L,A,O,x,11,u[45]),O=c(O,M,L,A,k,16,u[46]),A=c(A,O,M,L,p,23,u[47]),L=h(L,A,O,M,o,6,u[48]),M=h(M,L,A,O,y,10,u[49]),O=h(O,M,L,A,C,15,u[50]),A=h(A,O,M,L,m,21,u[51]),L=h(L,A,O,M,x,6,u[52]),M=h(M,L,A,O,d,10 +,u[53]),O=h(O,M,L,A,E,15,u[54]),A=h(A,O,M,L,a,21,u[55]),L=h(L,A,O,M,b,6,u[56]),M=h(M,L,A,O,k,10,u[57]),O=h(O,M,L,A,g,15,u[58]),A=h(A,O,M,L,N,21,u[59]),L=h(L,A,O,M,v,6,u[60]),M=h(M,L,A,O,S,10,u[61]),O=h(O,M,L,A,p,15,u[62]),A=h(A,O,M,L,w,21,u[63]),s[0]=s[0]+L|0,s[1]=s[1]+A|0,s[2]=s[2]+O|0,s[3]=s[3]+M|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;n[i>>>5]|=128<<24-i%32;var s=t.floor(r/4294967296),o=r;n[(i+64>>>9<<4)+15]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,n[(i+64>>>9<<4)+14]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,e.sigBytes=(n.length+1)*4,this._process();var u=this._hash,a=u.words;for(var f=0;f<4;f++){var l=a[f];a[f]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360}return u},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});n.MD5=s._createHelper(a),n.HmacMD5=s._createHmacHelper(a)}(Math),e.MD5})},{"./core":54}],63:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return e.mode.CFB=function(){function n(e,t,n,r){var i=this._iv;if(i){var s=i.slice(0);this._iv=undefined}else var s=this._prevBlock;r.encryptBlock(s,0);for(var o=0;o>24&255)===255){var t=e>>16&255,n=e>>8&255,r=e&255;t===255?(t=0,n===255?(n=0,r===255?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}function r(e){return(e[0]=n(e[0]))===0&&(e[1]=n(e[1])),e}var t=e.lib.BlockCipherMode.extend(),i=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,s=this._iv,o=this._counter;s&&(o=this._counter=s.slice(0),this._iv=undefined),r(o);var u=o.slice(0);n.encryptBlock(u,0);for(var a=0;a>>2]|=i<<24-s%4*8,e.sigBytes+=i},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Ansix923})},{"./cipher-core":53,"./core":54}],69:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return e.pad.Iso10126={pad:function(t,n){var r=n*4,i=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Iso10126})},{"./cipher-core":53,"./core":54}],70:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})},{"./cipher-core":53,"./core":54}],71:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})},{"./cipher-core":53,"./core":54}],72:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=t*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;while(!(t[n>>>2]>>>24-n%4*8&255))n--;e.sigBytes=n+1}},e.pad.ZeroPadding})},{"./cipher-core":53,"./core":54}],73:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./sha1"),e("./hmac")):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],i):i(r.CryptoJS)})(this,function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,s=t.algo,o=s.SHA1,u=s.HMAC,a=s.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){var n=this.cfg,r=u.create(n.hasher,e),s=i.create(),o=i.create([1]),a=s.words,f=o.words,l=n.keySize,c=n.iterations;while(a.length>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16,a=((i*i>>>17)+i*s>>>15)+s*s,f=((r&4294901760)*r|0)+((r&65535)*r|0);u[n]=a^f}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}var t=e,n=t.lib,r=n.StreamCipher,i=t.algo,s=[],o=[],u=[],a=i.RabbitLegacy=r.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var i=0;i<4;i++)f.call(this);for(var i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var s=t.words,o=s[0],u=s[1],a=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,l=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,c=a>>>16|l&4294901760,h=l<<16|a&65535;r[0]^=a,r[1]^=c,r[2]^=l,r[3]^=h,r[4]^=a,r[5]^=c,r[6]^=l,r[7]^=h;for(var i=0;i<4;i++)f.call(this)}},_doProcessBlock:function(e,t){var n=this._X;f.call(this),s[0]=n[0]^n[5]>>>16^n[3]<<16,s[1]=n[2]^n[7]>>>16^n[5]<<16,s[2]=n[4]^n[1]>>>16^n[7]<<16,s[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)s[r]=(s[r]<<8|s[r]>>>24)&16711935|(s[r]<<24|s[r]>>>8)&4278255360,e[t+r]^=s[r]},blockSize:4,ivSize:2});t.RabbitLegacy=r._createHelper(a)}(),e.RabbitLegacy})},{"./cipher-core":53,"./core":54,"./enc-base64":55,"./evpkdf":57,"./md5":62}],75:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return function(){function f(){var e=this._X,t=this._C;for(var n=0;n<8;n++)o[n]=t[n];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16,a=((i*i>>>17)+i*s>>>15)+s*s,f=((r&4294901760)*r|0)+((r&65535)*r|0);u[n]=a^f}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}var t=e,n=t.lib,r=n.StreamCipher,i=t.algo,s=[],o=[],u=[],a=i.Rabbit=r.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv;for(var n=0;n<4;n++)e[n]=(e[n]<<8|e[n]>>>24)&16711935|(e[n]<<24|e[n]>>>8)&4278255360;var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var n=0;n<4;n++)f.call(this);for(var n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var s=t.words,o=s[0],u=s[1],a=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,l=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,c=a>>>16|l&4294901760,h=l<<16|a&65535;i[0]^=a,i[1]^=c,i[2]^=l,i[3]^=h,i[4]^=a,i[5]^=c,i[6]^=l,i[7]^=h;for(var n=0;n<4;n++)f.call(this)}},_doProcessBlock:function(e,t){var n=this._X;f.call(this),s[0]=n[0]^n[5]>>>16^n[3]<<16,s[1]=n[2]^n[7]>>>16^n[5]<<16,s[2]=n[4]^n[1]>>>16^n[7]<<16,s[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)s[r]=(s[r]<<8|s[r]>>>24)&16711935|(s[r]<<24|s[r]>>>8)&4278255360,e[t+r]^=s[r]},blockSize:4,ivSize:2});t.Rabbit=r._createHelper(a)}(),e.Rabbit})},{"./cipher-core":53,"./core":54,"./enc-base64":55,"./evpkdf":57,"./md5":62}],76:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return function(){function o(){var e=this._S,t=this._i,n=this._j,r=0;for(var i=0;i<4;i++){t=(t+1)%256,n=(n+e[t])%256;var s=e[t];e[t]=e[n],e[n]=s,r|=e[(e[t]+e[n])%256]<<24-i*8}return this._i=t,this._j=n,r}var t=e,n=t.lib,r=n.StreamCipher,i=t.algo,s=i.RC4=r.extend({_doReset:function(){var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[];for(var i=0;i<256;i++)r[i]=i;for(var i=0,s=0;i<256;i++){var o=i%n,u=t[o>>>2]>>>24-o%4*8&255;s=(s+r[i]+u)%256;var a=r[i];r[i]=r[s],r[s]=a}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});t.RC4=r._createHelper(s);var u=i.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});t.RC4Drop=r._createHelper(u)}(),e.RC4})},{"./cipher-core":53,"./core":54,"./enc-base64":55,"./evpkdf":57,"./md5":62}],77:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(t){function d(e,t,n){return e^t^n}function v(e,t,n){return e&t|~e&n}function m(e,t,n){return(e|~t)^n}function g(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function b(e,t){return e<>>32-t}var n=e,r=n.lib,i=r.WordArray,s=r.Hasher,o=n.algo,u=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),a=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),f=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),c=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=s.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}var s=this._hash.words,o=c.words,p=h.words,w=u.words,E=a.words,S=f.words,x=l.words,T,N,C,k,L,A,O,M,_,D;A=T=s[0],O=N=s[1],M=C=s[2],_=k=s[3],D=L=s[4];var P;for(var n=0;n<80;n+=1)P=T+e[t+w[n]]|0,n<16?P+=d(N,C,k)+o[0]:n<32?P+=v(N,C,k)+o[1]:n<48?P+=m(N,C,k)+o[2]:n<64?P+=g(N,C,k)+o[3]:P+=y(N,C,k)+o[4],P|=0,P=b(P,S[n]),P=P+L|0,T=L,L=k,k=b(C,10),C=N,N=P,P=A+e[t+E[n]]|0,n<16?P+=y(O,M,_)+p[0]:n<32?P+=g(O,M,_)+p[1]:n<48?P+=m(O,M,_)+p[2]:n<64?P+=v(O,M,_)+p[3]:P+=d(O,M,_)+p[4],P|=0,P=b(P,x[n]),P=P+D|0,A=D,D=_,_=b(M,10),M=O,O=P;P=s[1]+C+_|0,s[1]=s[2]+k+D|0,s[2]=s[3]+L+A|0,s[3]=s[4]+T+O|0,s[4]=s[0]+N+M|0,s[0]=P},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,e.sigBytes=(t.length+1)*4,this._process();var i=this._hash,s=i.words;for(var o=0;o<5;o++){var u=s[o];s[o]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360}return i},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});n.RIPEMD160=s._createHelper(p),n.HmacRIPEMD160=s._createHmacHelper(p)}(Math),e.RIPEMD160})},{"./core":54}],78:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,s=t.algo,o=[],u=s.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){var n=this._hash.words,r=n[0],i=n[1],s=n[2],u=n[3],a=n[4];for(var f=0;f<80;f++){if(f<16)o[f]=e[t+f]|0;else{var l=o[f-3]^o[f-8]^o[f-14]^o[f-16];o[f]=l<<1|l>>>31}var c=(r<<5|r>>>27)+a+o[f];f<20?c+=(i&s|~i&u)+1518500249:f<40?c+=(i^s^u)+1859775393:f<60?c+=(i&s|i&u|s&u)-1894007588:c+=(i^s^u)-899497514,a=u,u=s,s=i<<30|i>>>2,i=r,r=c}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+u|0,n[4]=n[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=Math.floor(n/4294967296),t[(r+64>>>9<<4)+15]=n,e.sigBytes=t.length*4,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(u),t.HmacSHA1=i._createHmacHelper(u)}(),e.SHA1})},{"./core":54}],79:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./sha256")):typeof define=="function"&&define.amd?define(["./core","./sha256"],i):i(r.CryptoJS)})(this,function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=t.algo,s=i.SHA256,o=i.SHA224=s.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=s._createHelper(o),t.HmacSHA224=s._createHmacHelper(o)}(),e.SHA224})},{"./core":54,"./sha256":80}],80:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,s=r.Hasher,o=n.algo,u=[],a=[];(function(){function e(e){var n=t.sqrt(e);for(var r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return(e-(e|0))*4294967296|0}var r=2,i=0;while(i<64)e(r)&&(i<8&&(u[i]=n(t.pow(r,.5))),a[i]=n(t.pow(r,1/3)),i++),r++})();var f=[],l=o.SHA256=s.extend({_doReset:function(){this._hash=new i.init(u.slice(0))},_doProcessBlock:function(e,t){var n=this._hash.words,r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],l=n[5],c=n[6],h=n[7];for(var p=0;p<64;p++){if(p<16)f[p]=e[t+p]|0;else{var d=f[p-15],v=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,m=f[p-2],g=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;f[p]=v+f[p-7]+g+f[p-16]}var y=u&l^~u&c,b=r&i^r&s^i&s,w=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),E=(u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25),S=h+E+y+a[p]+f[p],x=w+b;h=c,c=l,l=u,u=o+S|0,o=s,s=i,i=r,r=S+x|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+o|0,n[4]=n[4]+u|0,n[5]=n[5]+l|0,n[6]=n[6]+c|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;return n[i>>>5]|=128<<24-i%32,n[(i+64>>>9<<4)+14]=t.floor(r/4294967296),n[(i+64>>>9<<4)+15]=r,e.sigBytes=n.length*4,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=s._createHelper(l),n.HmacSHA256=s._createHmacHelper(l)}(Math),e.SHA256})},{"./core":54}],81:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./x64-core")):typeof define=="function"&&define.amd?define(["./core","./x64-core"],i):i(r.CryptoJS)})(this,function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,s=r.Hasher,o=n.x64,u=o.Word,a=n.algo,f=[],l=[],c=[];(function(){var e=1,t=0;for(var n=0;n<24;n++){f[e+5*t]=(n+1)*(n+2)/2%64;var r=t%5,i=(2*e+3*t)%5;e=r,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;var s=1;for(var o=0;o<24;o++){var a=0,h=0;for(var p=0;p<7;p++){if(s&1){var d=(1<>>24)&16711935|(s<<24|s>>>8)&4278255360,o=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360;var u=n[i];u.high^=o,u.low^=s}for(var a=0;a<24;a++){for(var p=0;p<5;p++){var d=0,v=0;for(var m=0;m<5;m++){var u=n[p+5*m];d^=u.high,v^=u.low}var g=h[p];g.high=d,g.low=v}for(var p=0;p<5;p++){var y=h[(p+4)%5],b=h[(p+1)%5],w=b.high,E=b.low,d=y.high^(w<<1|E>>>31),v=y.low^(E<<1|w>>>31);for(var m=0;m<5;m++){var u=n[p+5*m];u.high^=d,u.low^=v}}for(var S=1;S<25;S++){var u=n[S],x=u.high,N=u.low,C=f[S];if(C<32)var d=x<>>32-C,v=N<>>32-C;else var d=N<>>64-C,v=x<>>64-C;var k=h[l[S]];k.high=d,k.low=v}var L=h[0],A=n[0];L.high=A.high,L.low=A.low;for(var p=0;p<5;p++)for(var m=0;m<5;m++){var S=p+5*m,u=n[S],O=h[S],M=h[(p+1)%5+5*m],_=h[(p+2)%5+5*m];u.high=O.high^~M.high&_.high,u.low=O.low^~M.low&_.low}var u=n[0],D=c[a];u.high^=D.high,u.low^=D.low}},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,s=e.sigBytes*8,o=this.blockSize*32;n[s>>>5]|=1<<24-s%32,n[(t.ceil((s+1)/o)*o>>>5)-1]|=128,e.sigBytes=n.length*4,this._process();var u=this._state,a=this.cfg.outputLength/8,f=a/8,l=[];for(var c=0;c>>24)&16711935|(p<<24|p>>>8)&4278255360,d=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360,l.push(d),l.push(p)}return new i.init(l,a)},clone:function(){var e=s.clone.call(this),t=e._state=this._state.slice(0);for(var n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=s._createHelper(p),n.HmacSHA3=s._createHmacHelper(p)}(Math),e.SHA3})},{"./core":54,"./x64-core":85}],82:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./x64-core"),e("./sha512")):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],i):i(r.CryptoJS)})(this,function(e){return function(){var t=e,n=t.x64,r=n.Word,i=n.WordArray,s=t.algo,o=s.SHA512,u=s.SHA384=o.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=o._createHelper(u),t.HmacSHA384=o._createHmacHelper(u)}(),e.SHA384})},{"./core":54,"./sha512":83,"./x64-core":85}],83:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./x64-core")):typeof define=="function"&&define.amd?define(["./core","./x64-core"],i):i(r.CryptoJS)})(this,function(e){return function(){function a(){return s.create.apply(s,arguments)}var t=e,n=t.lib,r=n.Hasher,i=t.x64,s=i.Word,o=i.WordArray,u=t.algo,f=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],l=[];(function(){for(var e=0;e<80;e++)l[e]=a()})();var c=u.SHA512=r.extend({_doReset:function(){this._hash=new o.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(e,t){var n=this._hash.words,r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],a=n[5],c=n[6],h=n[7],p=r.high,d=r.low,v=i.high,m=i.low,g=s.high,y=s.low,b=o.high,w=o.low,E=u.high,S=u.low,x=a.high,T=a.low,N=c.high,C=c.low,k=h.high,L=h.low,A=p,O=d,M=v,_=m,D=g,P=y,H=b,B=w,j=E,F=S,I=x,q=T,R=N,U=C,z=k,X=L;for(var V=0;V<80;V++){var $=l[V];if(V<16)var J=$.high=e[t+V*2]|0,Q=$.low=e[t+V*2+1]|0;else{var G=l[V-15],Y=G.high,Z=G.low,et=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,tt=(Z>>>1|Y<<31)^(Z>>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c.low=C+U,c.high=N+R+(C>>>0>>0?1:0),L=h.low=L+X,h.high=k+z+(L>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;t[r>>>5]|=128<<24-r%32,t[(r+128>>>10<<5)+30]=Math.floor(n/4294967296),t[(r+128>>>10<<5)+31]=n,e.sigBytes=t.length*4,this._process();var i=this._hash.toX32();return i},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=r._createHelper(c),t.HmacSHA512=r._createHmacHelper(c)}(),e.SHA512})},{"./core":54,"./x64-core":85}],84:[function(e,t,n){(function(r,i,s){typeof n=="object"?t.exports=n=i(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(r.CryptoJS)})(this,function(e){return function(){function h(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<>>5]>>>31-i%32&1}var s=this._subKeys=[];for(var f=0;f<16;f++){var l=s[f]=[],c=a[f];for(var r=0;r<24;r++)l[r/6|0]|=n[(u[r]-1+c)%28]<<31-r%6,l[4+(r/6|0)]|=n[28+(u[r+24]-1+c)%28]<<31-r%6;l[0]=l[0]<<1|l[0]>>>31;for(var r=1;r<7;r++)l[r]=l[r]>>>(r-1)*4+3;l[7]=l[7]<<5|l[7]>>>27}var h=this._invSubKeys=[];for(var r=0;r<16;r++)h[r]=s[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],h.call(this,4,252645135),h.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),h.call(this,1,1431655765);for(var r=0;r<16;r++){var i=n[r],s=this._lBlock,o=this._rBlock,u=0;for(var a=0;a<8;a++)u|=f[a][((o^i[a])&l[a])>>>0];this._lBlock=o,this._rBlock=s^u}var c=this._lBlock;this._lBlock=this._rBlock,this._rBlock=c,h.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});t.DES=i._createHelper(c);var d=s.TripleDES=i.extend({_doReset:function(){var e=this._key,t=e.words;this._des1=c.createEncryptor(r.create(t.slice(0,2))),this._des2=c.createEncryptor(r.create(t.slice(2,4))),this._des3=c.createEncryptor(r.create(t.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(d)}(),e.TripleDES})},{"./cipher-core":53,"./core":54,"./enc-base64":55,"./evpkdf":57,"./md5":62}],85:[function(e,t,n){(function(r,i){typeof n=="object"?t.exports=n=i(e("./core")):typeof define=="function"&&define.amd?define(["./core"],i):i(r.CryptoJS)})(this,function(e){return function(t){var n=e,r=n.lib,i=r.Base,s=r.WordArray,o=n.x64={},u=o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),a=o.WordArray=i.extend({init:function(e,n){e=this.words=e||[],n!=t?this.sigBytes=n:this.sigBytes=e.length*8},toX32:function(){var e=this.words,t=e.length,n=[];for(var r=0;r1?arguments[1]:"utf8"):h(this,e)):arguments.length>1?new f(e,arguments[1]):new f(e)}function l(e,t){e=b(e,t<0?0:w(t)|0);if(!f.TYPED_ARRAY_SUPPORT)for(var n=0;n>>1;return n&&(e.parent=o),e}function w(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return e|0}function E(e,t){if(this instanceof E){var n=new f(e,t);return delete n.parent,n}return new E(e,t)}function S(e,t){typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;var r=!1;for(;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(r)return K(e).length;t=(""+t).toLowerCase(),r=!0}}function x(e,t,n){var r=!1;t|=0,n=n===undefined||n===Infinity?this.length:n|0,e||(e="utf8"),t<0&&(t=0),n>this.length&&(n=this.length);if(n<=t)return"";for(;;)switch(e){case"hex":return B(this,t,n);case"utf8":case"utf-8":return M(this,t,n);case"ascii":return P(this,t,n);case"binary":return H(this,t,n);case"base64":return O(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function T(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var s=t.length;if(s%2!==0)throw new Error("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o239?4:s>223?3:s>191?2:1;if(i+u<=n){var a,f,l,c;switch(u){case 1:s<128&&(o=s);break;case 2:a=e[i+1],(a&192)===128&&(c=(s&31)<<6|a&63,c>127&&(o=c));break;case 3:a=e[i+1],f=e[i+2],(a&192)===128&&(f&192)===128&&(c=(s&15)<<12|(a&63)<<6|f&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:a=e[i+1],f=e[i+2],l=e[i+3],(a&192)===128&&(f&192)===128&&(l&192)===128&&(c=(s&15)<<18|(a&63)<<12|(f&63)<<6|l&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),i+=u}return D(r)}function D(e){var t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);var n="",r=0;while(rr)n=r;var i="";for(var s=t;sn)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,n,r,i,s){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||te.length)throw new RangeError("index out of range")}function q(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(e.length-n,2);i>>(r?i:1-i)*8}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(e.length-n,4);i>>(r?i:3-i)*8&255}function U(e,t,n,r,i,s){if(t>i||te.length)throw new RangeError("index out of range");if(n<0)throw new RangeError("index out of range")}function z(e,t,n,r,s){return s||U(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),i.write(e,t,n,r,23,4),n+4}function W(e,t,n,r,s){return s||U(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),i.write(e,t,n,r,52,8),n+8}function V(e){e=$(e).replace(X,"");if(e.length<2)return"";while(e.length%4!==0)e+="=";return e}function $(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function J(e){return e<16?"0"+e.toString(16):e.toString(16)}function K(e,t){t=t||Infinity;var n,r=e.length,i=null,s=[];for(var o=0;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);i=null;if(n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,n&63|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}}return s}function Q(e){var t=[];for(var n=0;n>8,i=n%256,s.push(i),s.push(r)}return s}function Y(e){return r.toByteArray(V(e))}function Z(e,t,n,r){for(var i=0;i=t.length||i>=e.length)break;t[i+n]=e[i]}return i}var r=e("base64-js"),i=e("ieee754"),s=e("isarray");n.Buffer=f,n.SlowBuffer=E,n.INSPECT_MAX_BYTES=50,f.poolSize=8192;var o={};f.TYPED_ARRAY_SUPPORT=t.TYPED_ARRAY_SUPPORT!==undefined?t.TYPED_ARRAY_SUPPORT:u(),f.TYPED_ARRAY_SUPPORT?(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array):(f.prototype.length=undefined,f.prototype.parent=undefined),f.isBuffer=function(t){return t!=null&&!!t._isBuffer},f.compare=function(t,n){if(!f.isBuffer(t)||!f.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(t===n)return 0;var r=t.length,i=n.length,s=0,o=Math.min(r,i);while(s0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},f.prototype.compare=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:f.compare(this,t)},f.prototype.indexOf=function(t,n){function r(e,t,n){var r=-1;for(var i=0;n+i2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n>>=0;if(this.length===0)return-1;if(n>=this.length)return-1;n<0&&(n=Math.max(this.length+n,0));if(typeof t=="string")return t.length===0?-1:String.prototype.indexOf.call(this,t,n);if(f.isBuffer(t))return r(this,t,n);if(typeof t=="number")return f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"?Uint8Array.prototype.indexOf.call(this,t,n):r(this,[t],n);throw new TypeError("val must be string, number or Buffer")},f.prototype.write=function(t,n,r,i){if(n===undefined)i="utf8",r=this.length,n=0;else if(r===undefined&&typeof n=="string")i=n,r=this.length,n=0;else if(isFinite(n))n|=0,isFinite(r)?(r|=0,i===undefined&&(i="utf8")):(i=r,r=undefined);else{var s=i;i=n,n=r|0,r=s}var o=this.length-n;if(r===undefined||r>o)r=o;if(t.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("attempt to write outside buffer bounds");i||(i="utf8");var u=!1;for(;;)switch(i){case"hex":return T(this,t,n,r);case"utf8":case"utf-8":return N(this,t,n,r);case"ascii":return C(this,t,n,r);case"binary":return k(this,t,n,r);case"base64":return L(this,t,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,n,r);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;f.prototype.slice=function(t,n){var r=this.length;t=~~t,n=n===undefined?r:~~n,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n0&&(s*=256))i+=this[t+ --n]*s;return i},f.prototype.readUInt8=function(t,n){return n||F(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,n){return n||F(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,n){return n||F(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,n){return n||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},f.prototype.readUInt32BE=function(t,n){return n||F(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,n,r){t|=0,n|=0,r||F(t,n,this.length);var i=this[t],s=1,o=0;while(++o=s&&(i-=Math.pow(2,8*n)),i},f.prototype.readIntBE=function(t,n,r){t|=0,n|=0,r||F(t,n,this.length);var i=n,s=1,o=this[t+ --i];while(i>0&&(s*=256))o+=this[t+ --i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*n)),o},f.prototype.readInt8=function(t,n){return n||F(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},f.prototype.readInt16LE=function(t,n){n||F(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r},f.prototype.readInt16BE=function(t,n){n||F(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r},f.prototype.readInt32LE=function(t,n){return n||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,n){return n||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,n){return n||F(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,n){return n||F(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,n){return n||F(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,n){return n||F(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,n,r,i){t=+t,n|=0,r|=0,i||I(this,t,n,r,Math.pow(2,8*r),0);var s=1,o=0;this[n]=t&255;while(++o=0&&(o*=256))this[n+s]=t/o&255;return n+r},f.prototype.writeUInt8=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=t&255,n+1},f.prototype.writeUInt16LE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):q(this,t,n,!0),n+2},f.prototype.writeUInt16BE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):q(this,t,n,!1),n+2},f.prototype.writeUInt32LE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255):R(this,t,n,!0),n+4},f.prototype.writeUInt32BE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):R(this,t,n,!1),n+4},f.prototype.writeIntLE=function(t,n,r,i){t=+t,n|=0;if(!i){var s=Math.pow(2,8*r-1);I(this,t,n,r,s-1,-s)}var o=0,u=1,a=t<0?1:0;this[n]=t&255;while(++o>0)-a&255;return n+r},f.prototype.writeIntBE=function(t,n,r,i){t=+t,n|=0;if(!i){var s=Math.pow(2,8*r-1);I(this,t,n,r,s-1,-s)}var o=r-1,u=1,a=t<0?1:0;this[n+o]=t&255;while(--o>=0&&(u*=256))this[n+o]=(t/u>>0)-a&255;return n+r},f.prototype.writeInt8=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=t&255,n+1},f.prototype.writeInt16LE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):q(this,t,n,!0),n+2},f.prototype.writeInt16BE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):q(this,t,n,!1),n+2},f.prototype.writeInt32LE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):R(this,t,n,!0),n+4},f.prototype.writeInt32BE=function(t,n,r){return t=+t,n|=0,r||I(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):R(this,t,n,!1),n+4},f.prototype.writeFloatLE=function(t,n,r){return z(this,t,n,!0,r)},f.prototype.writeFloatBE=function(t,n,r){return z(this,t,n,!1,r)},f.prototype.writeDoubleLE=function(t,n,r){return W(this,t,n,!0,r)},f.prototype.writeDoubleBE=function(t,n,r){return W(this,t,n,!1,r)},f.prototype.copy=function(t,n,r,i){r||(r=0),!i&&i!==0&&(i=this.length),n>=t.length&&(n=t.length),n||(n=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-n=0;o--)t[o+n]=this[o+r];else if(s<1e3||!f.TYPED_ARRAY_SUPPORT)for(o=0;o=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof t=="number")for(i=n;i0)throw new Error("Invalid string. Length must be a multiple of 4");var a=e.length;o=e.charAt(a-2)==="="?2:e.charAt(a-1)==="="?1:0,u=new n(e.length*3/4-o),i=o>0?e.length-4:e.length;var f=0;for(t=0,r=0;t>16),c((s&65280)>>8),c(s&255);return o===2?(s=l(e.charAt(t))<<2|l(e.charAt(t+1))>>4,c(s&255)):o===1&&(s=l(e.charAt(t))<<10|l(e.charAt(t+1))<<4|l(e.charAt(t+2))>>2,c(s>>8&255),c(s&255)),u}function h(e){function u(e){return t.charAt(e)}function a(e){return u(e>>18&63)+u(e>>12&63)+u(e>>6&63)+u(e&63)}var n,r=e.length%3,i="",s,o;for(n=0,o=e.length-r;n>2),i+=u(s<<4&63),i+="==";break;case 2:s=(e[e.length-2]<<8)+e[e.length-1],i+=u(s>>10),i+=u(s>>4&63),i+=u(s<<2&63),i+="=";break;default:}return i}var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=typeof Uint8Array!="undefined"?Uint8Array:Array,r="+".charCodeAt(0),i="/".charCodeAt(0),s="0".charCodeAt(0),o="a".charCodeAt(0),u="A".charCodeAt(0),a="-".charCodeAt(0),f="_".charCodeAt(0);e.toByteArray=c,e.fromByteArray=h})(typeof n=="undefined"?this.base64js={}:n)},{}],90:[function(e,t,n){n.read=function(e,t,n,r,i){var s,o,u=i*8-r-1,a=(1<>1,l=-7,c=n?i-1:0,h=n?-1:1,p=e[t+c];c+=h,s=p&(1<<-l)-1,p>>=-l,l+=u;for(;l>0;s=s*256+e[t+c],c+=h,l-=8);o=s&(1<<-l)-1,s>>=-l,l+=r;for(;l>0;o=o*256+e[t+c],c+=h,l-=8);if(s===0)s=1-f;else{if(s===a)return o?NaN:(p?-1:1)*Infinity;o+=Math.pow(2,r),s-=f}return(p?-1:1)*o*Math.pow(2,s-r)},n.write=function(e,t,n,r,i,s){var o,u,a,f=s*8-i-1,l=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,d=r?1:-1,v=t<0||t===0&&1/t<0?1:0;t=Math.abs(t),isNaN(t)||t===Infinity?(u=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-o))<1&&(o--,a*=2),o+c>=1?t+=h/a:t+=h*Math.pow(2,1-c),t*a>=2&&(o++,a/=2),o+c>=l?(u=0,o=l):o+c>=1?(u=(t*a-1)*Math.pow(2,i),o+=c):(u=t*Math.pow(2,c-1)*Math.pow(2,i),o=0));for(;i>=8;e[n+p]=u&255,p+=d,u/=256,i-=8);o=o<0;e[n+p]=o&255,p+=d,o/=256,f-=8);e[n+p-d]|=v*128}},{}],91:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return r.call(e)=="[object Array]"}},{}],92:[function(e,t,n){"use strict";n.randomBytes=n.rng=n.pseudoRandomBytes=n.prng=e("randombytes"),n.createHash=n.Hash=e("create-hash"),n.createHmac=n.Hmac=e("create-hmac");var r=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(Object.keys(e("browserify-sign/algos")));n.getHashes=function(){return r};var i=e("pbkdf2");n.pbkdf2=i.pbkdf2,n.pbkdf2Sync=i.pbkdf2Sync;var s=e("browserify-cipher");["Cipher","createCipher","Cipheriv","createCipheriv","Decipher","createDecipher","Decipheriv","createDecipheriv","getCiphers","listCiphers"].forEach(function(e){n[e]=s[e]});var o=e("diffie-hellman");["DiffieHellmanGroup","createDiffieHellmanGroup","getDiffieHellman","createDiffieHellman","DiffieHellman"].forEach(function(e){n[e]=o[e]});var u=e("browserify-sign");["createSign","Sign","createVerify","Verify"].forEach(function(e){n[e]=u[e]}),n.createECDH=e("create-ecdh");var a=e("public-encrypt");["publicEncrypt","privateEncrypt","publicDecrypt","privateDecrypt"].forEach(function(e){n[e]=a[e]}),["createCredentials"].forEach(function(e){n[e]=function(){throw new Error(["sorry, "+e+" is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))}})},{"browserify-cipher":93,"browserify-sign":123,"browserify-sign/algos":122,"create-ecdh":190,"create-hash":216,"create-hmac":229,"diffie-hellman":230,pbkdf2:237,"public-encrypt":238,randombytes:283}],93:[function(e,t,n){function a(e,t){var n,i;e=e.toLowerCase();if(u[e])n=u[e].key,i=u[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");n=o[e].key*8,i=o[e].iv}var s=r(t,!1,n,i);return l(e,s.key,s.iv)}function f(e,t){var n,i;e=e.toLowerCase();if(u[e])n=u[e].key,i=u[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");n=o[e].key*8,i=o[e].iv}var s=r(t,!1,n,i);return c(e,s.key,s.iv)}function l(e,t,n){e=e.toLowerCase();if(u[e])return i.createCipheriv(e,t,n);if(o[e])return new s({key:t,iv:n,mode:e});throw new TypeError("invalid suite type")}function c(e,t,n){e=e.toLowerCase();if(u[e])return i.createDecipheriv(e,t,n);if(o[e])return new s({key:t,iv:n,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}function h(){return Object.keys(o).concat(i.getCiphers())}var r=e("evp_bytestokey"),i=e("browserify-aes/browser"),s=e("browserify-des"),o=e("browserify-des/modes"),u=e("browserify-aes/modes");n.createCipher=n.Cipher=a,n.createCipheriv=n.Cipheriv=l,n.createDecipher=n.Decipher=f,n.createDecipheriv=n.Decipheriv=c,n.listCiphers=n.getCiphers=h},{"browserify-aes/browser":96,"browserify-aes/modes":100,"browserify-des":111,"browserify-des/modes":112,evp_bytestokey:121}],94:[function(e,t,n){(function(e){function r(e){var n,r;return n=e>t||e<0?(r=Math.abs(e)%t,e<0?t-r:r):e,n}function i(e){for(var t=0;t>>8^n&255^99,this.SBOX[i]=n,this.INV_SBOX[n]=i,s=e[i],o=e[s],u=e[o],r=e[n]*257^n*16843008,this.SUB_MIX[0][i]=r<<24|r>>>8,this.SUB_MIX[1][i]=r<<16|r>>>16,this.SUB_MIX[2][i]=r<<8|r>>>24,this.SUB_MIX[3][i]=r,r=u*16843009^o*65537^s*257^i*16843008,this.INV_SUB_MIX[0][n]=r<<24|r>>>8,this.INV_SUB_MIX[1][n]=r<<16|r>>>16,this.INV_SUB_MIX[2][n]=r<<8|r>>>24,this.INV_SUB_MIX[3][n]=r,i===0?i=a=1:(i=s^e[e[e[u^s]]],a^=e[e[a]]);return!0};var o=new s;a.blockSize=16,a.prototype.blockSize=a.blockSize,a.keySize=32,a.prototype.keySize=a.keySize,a.prototype._doReset=function(){var e,t,n,r,i,s;n=this._key,t=n.length,this._nRounds=t+6,i=(this._nRounds+1)*4,this._keySchedule=[];for(r=0;r>>24,s=o.SBOX[s>>>24]<<24|o.SBOX[s>>>16&255]<<16|o.SBOX[s>>>8&255]<<8|o.SBOX[s&255],s^=o.RCON[r/t|0]<<24):t>6&&r%t===4?s=o.SBOX[s>>>24]<<24|o.SBOX[s>>>16&255]<<16|o.SBOX[s>>>8&255]<<8|o.SBOX[s&255]:void 0,this._keySchedule[r-t]^s);this._invKeySchedule=[];for(e=0;e>>24]]^o.INV_SUB_MIX[1][o.SBOX[s>>>16&255]]^o.INV_SUB_MIX[2][o.SBOX[s>>>8&255]]^o.INV_SUB_MIX[3][o.SBOX[s&255]];return!0},a.prototype.encryptBlock=function(t){t=u(new e(t));var n=this._doCryptBlock(t,this._keySchedule,o.SUB_MIX,o.SBOX),r=new e(16);return r.writeUInt32BE(n[0],0),r.writeUInt32BE(n[1],4),r.writeUInt32BE(n[2],8),r.writeUInt32BE(n[3],12),r},a.prototype.decryptBlock=function(t){t=u(new e(t));var n=[t[3],t[1]];t[1]=n[0],t[3]=n[1];var r=this._doCryptBlock(t,this._invKeySchedule,o.INV_SUB_MIX,o.INV_SBOX),i=new e(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},a.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},a.prototype._doCryptBlock=function(e,t,n,i){var s,o,u,a,f,l,c,h,p;o=e[0]^t[0],u=e[1]^t[1],a=e[2]^t[2],f=e[3]^t[3],s=4;for(var d=1;d>>24]^n[1][u>>>16&255]^n[2][a>>>8&255]^n[3][f&255]^t[s++],c=n[0][u>>>24]^n[1][a>>>16&255]^n[2][f>>>8&255]^n[3][o&255]^t[s++],h=n[0][a>>>24]^n[1][f>>>16&255]^n[2][o>>>8&255]^n[3][u&255]^t[s++],p=n[0][f>>>24]^n[1][o>>>16&255]^n[2][u>>>8&255]^n[3][a&255]^t[s++],o=l,u=c,a=h,f=p;return l=(i[o>>>24]<<24|i[u>>>16&255]<<16|i[a>>>8&255]<<8|i[f&255])^t[s++],c=(i[u>>>24]<<24|i[a>>>16&255]<<16|i[f>>>8&255]<<8|i[o&255])^t[s++],h=(i[a>>>24]<<24|i[f>>>16&255]<<16|i[o>>>8&255]<<8|i[u&255])^t[s++],p=(i[f>>>24]<<24|i[o>>>16&255]<<16|i[u>>>8&255]<<8|i[a&255])^t[s++],[r(l),r(c),r(h),r(p)]},n.AES=a}).call(this,e("buffer").Buffer)},{buffer:88}],95:[function(e,t,n){(function(n){function a(e,t,s,u){if(!(this instanceof a))return new a(e,t,s);i.call(this),this._finID=n.concat([s,new n([0,0,0,1])]),s=n.concat([s,new n([0,0,0,2])]),this._cipher=new r.AES(t),this._prev=new n(s.length),this._cache=new n(""),this._secCache=new n(""),this._decrypt=u,this._alen=0,this._len=0,s.copy(this._prev),this._mode=e;var f=new n(4);f.fill(0),this._ghash=new o(this._cipher.encryptBlock(f)),this._authTag=null,this._called=!1}function f(e,t){var n=0;e.length!==t.length&&n++;var r=Math.min(e.length,t.length),i=-1;while(++i16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache};var p={ECB:e("./modes/ecb"),CBC:e("./modes/cbc"),CFB:e("./modes/cfb"),CFB8:e("./modes/cfb8"),CFB1:e("./modes/cfb1"),OFB:e("./modes/ofb"),CTR:e("./modes/ctr"),GCM:e("./modes/ctr")};n.createDecipher=v,n.createDecipheriv=d}).call(this,e("buffer").Buffer)},{"./aes":94,"./authCipher":95,"./modes":100,"./modes/cbc":101,"./modes/cfb":102,"./modes/cfb1":103,"./modes/cfb8":104,"./modes/ctr":105,"./modes/ecb":106,"./modes/ofb":107,"./streamCipher":110,buffer:88,"cipher-base":109,evp_bytestokey:121,inherits:285}],98:[function(e,t,n){(function(t){function l(e,n,s){if(!(this instanceof l))return new l(e,n,s);i.call(this),this._cache=new c,this._cipher=new r.AES(n),this._prev=new t(s.length),s.copy(this._prev),this._mode=e,this._autopadding=!0}function c(){if(!(this instanceof c))return new c;this.cache=new t("")}function p(e,n,r){var i=o[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");typeof r=="string"&&(r=new t(r)),typeof n=="string"&&(n=new t(n));if(n.length!==i.key/8)throw new TypeError("invalid key length "+n.length);if(r.length!==i.iv)throw new TypeError("invalid iv length "+r.length);return i.type==="stream"?new a(h[i.mode],n,r):i.type==="auth"?new f(h[i.mode],n,r):new l(h[i.mode],n,r)}function d(e,t){var n=o[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var r=u(t,!1,n.key,n.iv);return p(e,r.key,r.iv)}var r=e("./aes"),i=e("cipher-base"),s=e("inherits"),o=e("./modes"),u=e("evp_bytestokey"),a=e("./streamCipher"),f=e("./authCipher");s(l,i),l.prototype._update=function(e){this._cache.add(e);var n,r,i=[];while(n=this._cache.get())r=this._mode.encrypt(this,n),i.push(r);return t.concat(i)},l.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(e.toString("hex")!=="10101010101010101010101010101010")throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(e){this._autopadding=!!e},c.prototype.add=function(e){this.cache=t.concat([this.cache,e])},c.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},c.prototype.flush=function(){var e=16-this.cache.length,n=new t(e),r=-1;while(++ro||e<0?(n=Math.abs(e)%o,e<0?o-n:n):e,t}function a(e,t){return[e[0]^t[0],e[1]^t[1],e[2]^t[2],e[3]^t[3]]}var n=new e(16);n.fill(0),t.exports=r,r.prototype.ghash=function(e){var t=-1;while(++t0;n--)e[n]=e[n]>>>1|(e[n-1]&1)<<31;e[0]=e[0]>>>1,o&&(e[0]=e[0]^225<<24)}this.state=s(t)},r.prototype.update=function(t){this.cache=e.concat([this.cache,t]);var n;while(this.cache.length>=16)n=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(n)},r.prototype.final=function(t,r){return this.cache.length&&this.ghash(e.concat([this.cache,n],16)),this.ghash(s([0,t,0,r])),this.state};var o=Math.pow(2,32)}).call(this,e("buffer").Buffer)},{buffer:88}],100:[function(e,t,n){n["aes-128-ecb"]={cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},n["aes-192-ecb"]={cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},n["aes-256-ecb"]={cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},n["aes-128-cbc"]={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},n["aes-192-cbc"]={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},n["aes-256-cbc"]={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},n.aes128=n["aes-128-cbc"],n.aes192=n["aes-192-cbc"],n.aes256=n["aes-256-cbc"],n["aes-128-cfb"]={cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},n["aes-192-cfb"]={cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},n["aes-256-cfb"]={cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},n["aes-128-cfb8"]={cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},n["aes-192-cfb8"]={cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},n["aes-256-cfb8"]={cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},n["aes-128-cfb1"]={cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},n["aes-192-cfb1"]={cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},n["aes-256-cfb1"]={cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},n["aes-128-ofb"]={cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},n["aes-192-ofb"]={cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},n["aes-256-ofb"]={cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},n["aes-128-ctr"]={cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},n["aes-192-ctr"]={cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},n["aes-256-ctr"]={cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},n["aes-128-gcm"]={cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},n["aes-192-gcm"]={cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},n["aes-256-gcm"]={cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},{}],101:[function(e,t,n){var r=e("buffer-xor");n.encrypt=function(e,t){var n=r(t,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},n.decrypt=function(e,t){var n=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return r(i,n)}},{"buffer-xor":108}],102:[function(e,t,n){(function(t){function i(e,n,i){var s=n.length,o=r(n,e._cache);return e._cache=e._cache.slice(s),e._prev=t.concat([e._prev,i?n:o]),o}var r=e("buffer-xor");n.encrypt=function(e,n,r){var s=new t(""),o;while(n.length){e._cache.length===0&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=new t(""));if(!(e._cache.length<=n.length)){s=t.concat([s,i(e,n,r)]);break}o=e._cache.length,s=t.concat([s,i(e,n.slice(0,o),r)]),n=n.slice(o)}return s}}).call(this,e("buffer").Buffer)},{buffer:88,"buffer-xor":108}],103:[function(e,t,n){(function(e){function t(e,t,n){var i,s=-1,o=8,u=0,a,f;while(++s>s%8,e._prev=r(e._prev,n?a:f);return u}function r(t,n){var r=t.length,i=-1,s=new e(t.length);t=e.concat([t,new e([n])]);while(++i>7;return s}n.encrypt=function(n,r,i){var s=r.length,o=new e(s),u=-1;while(++u0;i--)n+=this._buffer(t,n),r+=this._flushBuffer(s,r);return n+=this._buffer(t,n),s},i.prototype.final=function(t){var n;t&&(n=this.update(t));var r;return this.type==="encrypt"?r=this._finalEncrypt():r=this._finalDecrypt(),n?n.concat(r):r},i.prototype._pad=function(t,n){if(n===0)return!1;while(n>>1];i=o.r28shl(i,a),s=o.r28shl(s,a),o.pc2(i,s,t.keys,u)}},f.prototype._update=function(t,n,r,i){var s=this._desState,u=o.readUInt32BE(t,n),a=o.readUInt32BE(t,n+4);o.ip(u,a,s.tmp,0),u=s.tmp[0],a=s.tmp[1],this.type==="encrypt"?this._encrypt(s,u,a,s.tmp,0):this._decrypt(s,u,a,s.tmp,0),u=s.tmp[0],a=s.tmp[1],o.writeUInt32BE(r,u,i),o.writeUInt32BE(r,a,i+4)},f.prototype._pad=function(t,n){var r=t.length-n;for(var i=n;i>>0,u=d}o.rip(a,u,i,s)},f.prototype._decrypt=function(t,n,r,i,s){var u=r,a=n;for(var f=t.keys.length-2;f>=0;f-=2){var l=t.keys[f],c=t.keys[f+1];o.expand(u,t.tmp,0),l^=t.tmp[0],c^=t.tmp[1];var h=o.substitute(l,c),p=o.permute(h),d=u;u=(a^p)>>>0,a=d}o.rip(u,a,i,s)}},{"../des":114,inherits:285,"minimalistic-assert":120}],118:[function(e,t,n){"use strict";function a(e,t){r.equal(t.length,24,"Invalid key length");var n=t.slice(0,8),i=t.slice(8,16),s=t.slice(16,24);e==="encrypt"?this.ciphers=[u.create({type:"encrypt",key:n}),u.create({type:"decrypt",key:i}),u.create({type:"encrypt",key:s})]:this.ciphers=[u.create({type:"decrypt",key:s}),u.create({type:"encrypt",key:i}),u.create({type:"decrypt",key:n})]}function f(e){o.call(this,e);var t=new a(this.type,this.options.key);this._edeState=t}var r=e("minimalistic-assert"),i=e("inherits"),s=e("../des"),o=s.Cipher,u=s.DES;i(f,o),t.exports=f,f.create=function(t){return new f(t)},f.prototype._update=function(t,n,r,i){var s=this._edeState;s.ciphers[0]._update(t,n,r,i),s.ciphers[1]._update(r,i,r,i),s.ciphers[2]._update(r,i,r,i)},f.prototype._pad=u.prototype._pad,f.prototype._unpad=u.prototype._unpad},{"../des":114,inherits:285,"minimalistic-assert":120}],119:[function(e,t,n){"use strict";n.readUInt32BE=function(t,n){var r=t[0+n]<<24|t[1+n]<<16|t[2+n]<<8|t[3+n];return r>>>0},n.writeUInt32BE=function(t,n,r){t[0+r]=n>>>24,t[1+r]=n>>>16&255,t[2+r]=n>>>8&255,t[3+r]=n&255},n.ip=function(t,n,r,i){var s=0,o=0;for(var u=6;u>=0;u-=2){for(var a=0;a<=24;a+=8)s<<=1,s|=n>>>a+u&1;for(var a=0;a<=24;a+=8)s<<=1,s|=t>>>a+u&1}for(var u=6;u>=0;u-=2){for(var a=1;a<=25;a+=8)o<<=1,o|=n>>>a+u&1;for(var a=1;a<=25;a+=8)o<<=1,o|=t>>>a+u&1}r[i+0]=s>>>0,r[i+1]=o>>>0},n.rip=function(t,n,r,i){var s=0,o=0;for(var u=0;u<4;u++)for(var a=24;a>=0;a-=8)s<<=1,s|=n>>>a+u&1,s<<=1,s|=t>>>a+u&1;for(var u=4;u<8;u++)for(var a=24;a>=0;a-=8)o<<=1,o|=n>>>a+u&1,o<<=1,o|=t>>>a+u&1;r[i+0]=s>>>0,r[i+1]=o>>>0},n.pc1=function(t,n,r,i){var s=0,o=0;for(var u=7;u>=5;u--){for(var a=0;a<=24;a+=8)s<<=1,s|=n>>a+u&1;for(var a=0;a<=24;a+=8)s<<=1,s|=t>>a+u&1}for(var a=0;a<=24;a+=8)s<<=1,s|=n>>a+u&1;for(var u=1;u<=3;u++){for(var a=0;a<=24;a+=8)o<<=1,o|=n>>a+u&1;for(var a=0;a<=24;a+=8)o<<=1,o|=t>>a+u&1}for(var a=0;a<=24;a+=8)o<<=1,o|=t>>a+u&1;r[i+0]=s>>>0,r[i+1]=o>>>0},n.r28shl=function(t,n){return t<>>28-n};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];n.pc2=function(t,n,i,s){var o=0,u=0,a=r.length>>>1;for(var f=0;f>>r[f]&1;for(var f=a;f>>r[f]&1;i[s+0]=o>>>0,i[s+1]=u>>>0},n.expand=function(t,n,r){var i=0,s=0;i=(t&1)<<5|t>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=t>>>o&63;for(var o=11;o>=3;o-=4)s|=t>>>o&63,s<<=6;s|=(t&31)<<1|t>>>31,n[r+0]=i>>>0,n[r+1]=s>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];n.substitute=function(t,n){var r=0;for(var s=0;s<4;s++){var o=t>>>18-s*6&63,u=i[s*64+o];r<<=4,r|=u}for(var s=0;s<4;s++){var o=n>>>18-s*6&63,u=i[256+s*64+o];r<<=4,r|=u}return r>>>0};var s=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];n.permute=function(t){var n=0;for(var r=0;r>>s[r]&1;return n>>>0},n.padSplit=function(t,n,r){var i=t.toString(2);while(i.length0&&p.push(c),p.push(e),t&&p.push(t),c=r(n.concat(p)),p=[],h=0;if(i>0)for(;;){if(i===0)break;if(h===c.length)break;a[o++]=c[h],i--,h++}if(s>0&&h!==c.length)for(;;){if(s===0)break;if(h===c.length)break;f[u++]=c[h],s--,h++}if(i===0&&s===0)break}for(h=0;h=49&&o<=54?r|=o-49+10:o>=17&&o<=22?r|=o-17+10:r|=o&15}return r}function o(e,t,n,r){var i=0,s=Math.min(e.length,n);for(var o=t;o=49?i+=u-49+10:u>=17?i+=u-17+10:i+=u}return i}function l(e){var t=new Array(e.bitLength());for(var n=0;n>>i}return t}function c(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=e.words[0]|0,s=t.words[0]|0,o=i*s,u=o&67108863,a=o/67108864|0;n.words[0]=u;for(var f=1;f>>26,c=a&67108863,h=Math.min(f,t.length-1);for(var p=Math.max(0,f-e.length+1);p<=h;p++){var d=f-p|0;i=e.words[d]|0,s=t.words[p]|0,o=i*s+c,l+=o/67108864|0,c=o&67108863}n.words[f]=c|0,a=l|0}return a!==0?n.words[f]=a|0:n.length--,n.strip()}function p(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;var r=0,i=0;for(var s=0;s>>26)|0,i+=o>>>26,o&=67108863}n.words[s]=u,r=o,o=i}return r!==0?n.words[s]=r:n.length--,n.strip()}function d(e,t,n){var r=new v;return r.mulp(e,t,n)}function v(e,t){this.x=e,this.y=t}function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=(new i(1)).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if(typeof e=="string"){var t=i._prime(e);this.m=t.p,this.prime=t}else this.m=e,this.prime=null}function x(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=(new i(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)}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26,i.max=function(t,n){return t.cmp(n)>0?t:n},i.min=function(t,n){return t.cmp(n)<0?t:n},i.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),n(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var s=0;t[0]==="-"&&s++,r===16?this._parseHex(t,s):this._parseBase(t,r,s),t[0]==="-"&&(this.negative=1),this.strip();if(i!=="le")return;this._initArray(this.toArray(),r,i)},i.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3);if(i!=="le")return;this._initArray(this.toArray(),r,i)},i.prototype._initArray=function(t,r,i){n(typeof t.length=="number");if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var s=0;s=0;s-=3)u=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[o]|=u<>>26-a&67108863,a+=24,a>=26&&(a-=26,o++);else if(i==="le")for(s=0,o=0;s>>26-a&67108863,a+=24,a>=26&&(a-=26,o++);return this.strip()},i.prototype._parseHex=function(t,n){this.length=Math.ceil((t.length-n)/6),this.words=new Array(this.length);for(var r=0;r=n;r-=6)o=s(t,r,r+6),this.words[i]|=o<>>26-u&4194303,u+=24,u>=26&&(u-=26,i++);r+6!==n&&(o=s(t,n,r+6),this.words[i]|=o<>>26-u&4194303),this.strip()},i.prototype._parseBase=function(t,n,r){this.words=[0],this.length=1;for(var i=0,s=1;s<=67108863;s*=n)i++;i--,s=s/n|0;var u=t.length-r,a=u%i,f=Math.min(u,u-a)+r,l=0;for(var c=r;c1&&this.words[this.length-1]===0)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","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"],a=[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],f=[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];i.prototype.toString=function T(e,t){e=e||10,t=t|0||1;var r;if(e===16||e==="hex"){r="";var i=0,s=0;for(var o=0;o>>24-i&16777215,s!==0||o!==this.length-1?r=u[6-c.length]+c+r:r=c+r,i+=2,i>=26&&(i-=26,o--)}s!==0&&(r=s.toString(16)+r);while(r.length%t!==0)r="0"+r;return this.negative!==0&&(r="-"+r),r}if(e===(e|0)&&e>=2&&e<=36){var h=a[e],p=f[e];r="";var d=this.clone();d.negative=0;while(!d.isZero()){var v=d.modn(p).toString(e);d=d.idivn(p),d.isZero()?r=v+r:r=u[h-v.length]+v+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return this.negative!==0&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){return n(this.bitLength()<=53,"Number can only safely store up to 53 bits"),parseInt(this.toString(),10)},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(t,r){var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0"),this.strip();var o=t==="le",u=new Array(s),a,f,l=this.clone();if(!o){for(f=0;f=4096&&(r+=13,n>>>=13),n>=64&&(r+=7,n>>>=7),n>=8&&(r+=4,n>>>=4),n>=2&&(r+=2,n>>>=2),r+n},i.prototype._zeroBits=function(t){if(t===0)return 26;var n=t,r=0;return(n&8191)===0&&(r+=13,n>>>=13),(n&127)===0&&(r+=7,n>>>=7),(n&15)===0&&(r+=4,n>>>=4),(n&3)===0&&(r+=2,n>>>=2),(n&1)===0&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],n=this._countBits(t);return(this.length-1)*26+n},i.prototype.zeroBits=function(){if(this.isZero())return 0;var t=0;for(var n=0;nt.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var n;this.length>t.length?n=t:n=this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var n,r;this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;while(this.length0&&r--;for(var s=0;s0&&(this.words[s]=~this.words[s]&67108863>>26-i),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,r){n(typeof t=="number"&&t>=0);var i=t/26|0,s=t%26;while(this.length<=i)this.words[this.length++]=0;return r?this.words[i]=this.words[i]|1<t.length?(r=this,i=t):(r=t,i=this);var s=0;for(var o=0;o>>26;for(;s!==0&&o>>26;this.length=r.length;if(s!==0)this.words[this.length]=s,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var n=this.iadd(t);return t.negative=1,n._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(r===0)return this.negative=0,this.length=1,this.words[0]=0,this;var i,s;r>0?(i=this,s=t):(i=t,s=this);var o=0;for(var u=0;u>26,this.words[u]=n&67108863;for(;o!==0&&u>26,this.words[u]=n&67108863;if(o===0&&u>>13,d=i[1]|0,v=d&8191,m=d>>>13,g=i[2]|0,y=g&8191,b=g>>>13,w=i[3]|0,E=w&8191,S=w>>>13,x=i[4]|0,T=x&8191,N=x>>>13,C=i[5]|0,k=C&8191,L=C>>>13,A=i[6]|0,O=A&8191,M=A>>>13,_=i[7]|0,D=_&8191,P=_>>>13,H=i[8]|0,B=H&8191,j=H>>>13,F=i[9]|0,I=F&8191,q=F>>>13,R=s[0]|0,U=R&8191,z=R>>>13,W=s[1]|0,X=W&8191,V=W>>>13,$=s[2]|0,J=$&8191,K=$>>>13,Q=s[3]|0,G=Q&8191,Y=Q>>>13,Z=s[4]|0,et=Z&8191,tt=Z>>>13,nt=s[5]|0,rt=nt&8191,it=nt>>>13,st=s[6]|0,ot=st&8191,ut=st>>>13,at=s[7]|0,ft=at&8191,lt=at>>>13,ct=s[8]|0,ht=ct&8191,pt=ct>>>13,dt=s[9]|0,vt=dt&8191,mt=dt>>>13;r.length=19,a=Math.imul(h,U),f=Math.imul(h,z),f+=Math.imul(p,U),l=Math.imul(p,z);var gt=u+a+((f&8191)<<13);u=l+(f>>>13)+(gt>>>26),gt&=67108863,a=Math.imul(v,U),f=Math.imul(v,z),f+=Math.imul(m,U),l=Math.imul(m,z),a+=Math.imul(h,X),f+=Math.imul(h,V),f+=Math.imul(p,X),l+=Math.imul(p,V);var yt=u+a+((f&8191)<<13);u=l+(f>>>13)+(yt>>>26),yt&=67108863,a=Math.imul(y,U),f=Math.imul(y,z),f+=Math.imul(b,U),l=Math.imul(b,z),a+=Math.imul(v,X),f+=Math.imul(v,V),f+=Math.imul(m,X),l+=Math.imul(m,V),a+=Math.imul(h,J),f+=Math.imul(h,K),f+=Math.imul(p,J),l+=Math.imul(p,K);var bt=u+a+((f&8191)<<13);u=l+(f>>>13)+(bt>>>26),bt&=67108863,a=Math.imul(E,U),f=Math.imul(E,z),f+=Math.imul(S,U),l=Math.imul(S,z),a+=Math.imul(y,X),f+=Math.imul(y,V),f+=Math.imul(b,X),l+=Math.imul(b,V),a+=Math.imul(v,J),f+=Math.imul(v,K),f+=Math.imul(m,J),l+=Math.imul(m,K),a+=Math.imul(h,G),f+=Math.imul(h,Y),f+=Math.imul(p,G),l+=Math.imul(p,Y);var wt=u+a+((f&8191)<<13);u=l+(f>>>13)+(wt>>>26),wt&=67108863,a=Math.imul(T,U),f=Math.imul(T,z),f+=Math.imul(N,U),l=Math.imul(N,z),a+=Math.imul(E,X),f+=Math.imul(E,V),f+=Math.imul(S,X),l+=Math.imul(S,V),a+=Math.imul(y,J),f+=Math.imul(y,K),f+=Math.imul(b,J),l+=Math.imul(b,K),a+=Math.imul(v,G),f+=Math.imul(v,Y),f+=Math.imul(m,G),l+=Math.imul(m,Y),a+=Math.imul(h,et),f+=Math.imul(h,tt),f+=Math.imul(p,et),l+=Math.imul(p,tt);var Et=u+a+((f&8191)<<13);u=l+(f>>>13)+(Et>>>26),Et&=67108863,a=Math.imul(k,U),f=Math.imul(k,z),f+=Math.imul(L,U),l=Math.imul(L,z),a+=Math.imul(T,X),f+=Math.imul(T,V),f+=Math.imul(N,X),l+=Math.imul(N,V),a+=Math.imul(E,J),f+=Math.imul(E,K),f+=Math.imul(S,J),l+=Math.imul(S,K),a+=Math.imul(y,G),f+=Math.imul(y,Y),f+=Math.imul(b,G),l+=Math.imul(b,Y),a+=Math.imul(v,et),f+=Math.imul(v,tt),f+=Math.imul(m,et),l+=Math.imul(m,tt),a+=Math.imul(h,rt),f+=Math.imul(h,it),f+=Math.imul(p,rt),l+=Math.imul(p,it);var St=u+a+((f&8191)<<13);u=l+(f>>>13)+(St>>>26),St&=67108863,a=Math.imul(O,U),f=Math.imul(O,z),f+=Math.imul(M,U),l=Math.imul(M,z),a+=Math.imul(k,X),f+=Math.imul(k,V),f+=Math.imul(L,X),l+=Math.imul(L,V),a+=Math.imul(T,J),f+=Math.imul(T,K),f+=Math.imul(N,J),l+=Math.imul(N,K),a+=Math.imul(E,G),f+=Math.imul(E,Y),f+=Math.imul(S,G),l+=Math.imul(S,Y),a+=Math.imul(y,et),f+=Math.imul(y,tt),f+=Math.imul(b,et),l+=Math.imul(b,tt),a+=Math.imul(v,rt),f+=Math.imul(v,it),f+=Math.imul(m,rt),l+=Math.imul(m,it),a+=Math.imul(h,ot),f+=Math.imul(h,ut),f+=Math.imul(p,ot),l+=Math.imul(p,ut);var xt=u+a+((f&8191)<<13);u=l+(f>>>13)+(xt>>>26),xt&=67108863,a=Math.imul(D,U),f=Math.imul(D,z),f+=Math.imul(P,U),l=Math.imul(P,z),a+=Math.imul(O,X),f+=Math.imul(O,V),f+=Math.imul(M,X),l+=Math.imul(M,V),a+=Math.imul(k,J),f+=Math.imul(k,K),f+=Math.imul(L,J),l+=Math.imul(L,K),a+=Math.imul(T,G),f+=Math.imul(T,Y),f+=Math.imul(N,G),l+=Math.imul(N,Y),a+=Math.imul(E,et),f+=Math.imul(E,tt),f+=Math.imul(S,et),l+=Math.imul(S,tt),a+=Math.imul(y,rt),f+=Math.imul(y,it),f+=Math.imul(b,rt),l+=Math.imul(b,it),a+=Math.imul(v,ot),f+=Math.imul(v,ut),f+=Math.imul(m,ot),l+=Math.imul(m,ut),a+=Math.imul(h,ft),f+=Math.imul(h,lt),f+=Math.imul(p,ft),l+=Math.imul(p,lt);var Tt=u+a+((f&8191)<<13);u=l+(f>>>13)+(Tt>>>26),Tt&=67108863,a=Math.imul(B,U),f=Math.imul(B,z),f+=Math.imul(j,U),l=Math.imul(j,z),a+=Math.imul(D,X),f+=Math.imul(D,V),f+=Math.imul(P,X),l+=Math.imul(P,V),a+=Math.imul(O,J),f+=Math.imul(O,K),f+=Math.imul(M,J),l+=Math.imul(M,K),a+=Math.imul(k,G),f+=Math.imul(k,Y),f+=Math.imul(L,G),l+=Math.imul(L,Y),a+=Math.imul(T,et),f+=Math.imul(T,tt),f+=Math.imul(N,et),l+=Math.imul(N,tt),a+=Math.imul(E,rt),f+=Math.imul(E,it),f+=Math.imul(S,rt),l+=Math.imul(S,it),a+=Math.imul(y,ot),f+=Math.imul(y,ut),f+=Math.imul(b,ot),l+=Math.imul(b,ut),a+=Math.imul(v,ft),f+=Math.imul(v,lt),f+=Math.imul(m,ft),l+=Math.imul(m,lt),a+=Math.imul(h,ht),f+=Math.imul(h,pt),f+=Math.imul(p,ht),l+=Math.imul(p,pt);var Nt=u+a+((f&8191)<<13);u=l+(f>>>13)+(Nt>>>26),Nt&=67108863,a=Math.imul(I,U),f=Math.imul(I,z),f+=Math.imul(q,U),l=Math.imul(q,z),a+=Math.imul(B,X),f+=Math.imul(B,V),f+=Math.imul(j,X),l+=Math.imul(j,V),a+=Math.imul(D,J),f+=Math.imul(D,K),f+=Math.imul(P,J),l+=Math.imul(P,K),a+=Math.imul(O,G),f+=Math.imul(O,Y),f+=Math.imul(M,G),l+=Math.imul(M,Y),a+=Math.imul(k,et),f+=Math.imul(k,tt),f+=Math.imul(L,et),l+=Math.imul(L,tt),a+=Math.imul(T,rt),f+=Math.imul(T,it),f+=Math.imul(N,rt),l+=Math.imul(N,it),a+=Math.imul(E,ot),f+=Math.imul(E,ut),f+=Math.imul(S,ot),l+=Math.imul(S,ut),a+=Math.imul(y,ft),f+=Math.imul(y,lt),f+=Math.imul(b,ft),l+=Math.imul(b,lt),a+=Math.imul(v,ht),f+=Math.imul(v,pt),f+=Math.imul(m,ht),l+=Math.imul(m,pt),a+=Math.imul(h,vt),f+=Math.imul(h,mt),f+=Math.imul(p,vt),l+=Math.imul(p,mt);var Ct=u+a+((f&8191)<<13);u=l+(f>>>13)+(Ct>>>26),Ct&=67108863,a=Math.imul(I,X),f=Math.imul(I,V),f+=Math.imul(q,X),l=Math.imul(q,V),a+=Math.imul(B,J),f+=Math.imul(B,K),f+=Math.imul(j,J),l+=Math.imul(j,K),a+=Math.imul(D,G),f+=Math.imul(D,Y),f+=Math.imul(P,G),l+=Math.imul(P,Y),a+=Math.imul(O,et),f+=Math.imul(O,tt),f+=Math.imul(M,et),l+=Math.imul(M,tt),a+=Math.imul(k,rt),f+=Math.imul(k,it),f+=Math.imul(L,rt),l+=Math.imul(L,it),a+=Math.imul(T,ot),f+=Math.imul(T,ut),f+=Math.imul(N,ot),l+=Math.imul(N,ut),a+=Math.imul(E,ft),f+=Math.imul(E,lt),f+=Math.imul(S,ft),l+=Math.imul(S,lt),a+=Math.imul(y,ht),f+=Math.imul(y,pt),f+=Math.imul(b,ht),l+=Math.imul(b,pt),a+=Math.imul(v,vt),f+=Math.imul(v,mt),f+=Math.imul(m,vt),l+=Math.imul(m,mt);var kt=u+a+((f&8191)<<13);u=l+(f>>>13)+(kt>>>26),kt&=67108863,a=Math.imul(I,J),f=Math.imul(I,K),f+=Math.imul(q,J),l=Math.imul(q,K),a+=Math.imul(B,G),f+=Math.imul(B,Y),f+=Math.imul(j,G),l+=Math.imul(j,Y),a+=Math.imul(D,et),f+=Math.imul(D,tt),f+=Math.imul(P,et),l+=Math.imul(P,tt),a+=Math.imul(O,rt),f+=Math.imul(O,it),f+=Math.imul(M,rt),l+=Math.imul(M,it),a+=Math.imul(k,ot),f+=Math.imul(k,ut),f+=Math.imul(L,ot),l+=Math.imul(L,ut),a+=Math.imul(T,ft),f+=Math.imul(T,lt),f+=Math.imul(N,ft),l+=Math.imul(N,lt),a+=Math.imul(E,ht),f+=Math.imul(E,pt),f+=Math.imul(S,ht),l+=Math.imul(S,pt),a+=Math.imul(y,vt),f+=Math.imul(y,mt),f+=Math.imul(b,vt),l+=Math.imul(b,mt);var Lt=u+a+((f&8191)<<13);u=l+(f>>>13)+(Lt>>>26),Lt&=67108863,a=Math.imul(I,G),f=Math.imul(I,Y),f+=Math.imul(q,G),l=Math.imul(q,Y),a+=Math.imul(B,et),f+=Math.imul(B,tt),f+=Math.imul(j,et),l+=Math.imul(j,tt),a+=Math.imul(D,rt),f+=Math.imul(D,it),f+=Math.imul(P,rt),l+=Math.imul(P,it),a+=Math.imul(O,ot),f+=Math.imul(O,ut),f+=Math.imul(M,ot),l+=Math.imul(M,ut),a+=Math.imul(k,ft),f+=Math.imul(k,lt),f+=Math.imul(L,ft),l+=Math.imul(L,lt),a+=Math.imul(T,ht),f+=Math.imul(T,pt),f+=Math.imul(N,ht),l+=Math.imul(N,pt),a+=Math.imul(E,vt),f+=Math.imul(E,mt),f+=Math.imul(S,vt),l+=Math.imul(S,mt);var At=u+a+((f&8191)<<13);u=l+(f>>>13)+(At>>>26),At&=67108863,a=Math.imul(I,et),f=Math.imul(I,tt),f+=Math.imul(q,et),l=Math.imul(q,tt),a+=Math.imul(B,rt),f+=Math.imul(B,it),f+=Math.imul(j,rt),l+=Math.imul(j,it),a+=Math.imul(D,ot),f+=Math.imul(D,ut),f+=Math.imul(P,ot),l+=Math.imul(P,ut),a+=Math.imul(O,ft),f+=Math.imul(O,lt),f+=Math.imul(M,ft),l+=Math.imul(M,lt),a+=Math.imul(k,ht),f+=Math.imul(k,pt),f+=Math.imul(L,ht),l+=Math.imul(L,pt),a+=Math.imul(T,vt),f+=Math.imul(T,mt),f+=Math.imul(N,vt),l+=Math.imul(N,mt);var Ot=u+a+((f&8191)<<13);u=l+(f>>>13)+(Ot>>>26),Ot&=67108863,a=Math.imul(I,rt),f=Math.imul(I,it),f+=Math.imul(q,rt),l=Math.imul(q,it),a+=Math.imul(B,ot),f+=Math.imul(B,ut),f+=Math.imul(j,ot),l+=Math.imul(j,ut),a+=Math.imul(D,ft),f+=Math.imul(D,lt),f+=Math.imul(P,ft),l+=Math.imul(P,lt),a+=Math.imul(O,ht),f+=Math.imul(O,pt),f+=Math.imul(M,ht),l+=Math.imul(M,pt),a+=Math.imul(k,vt),f+=Math.imul(k,mt),f+=Math.imul(L,vt),l+=Math.imul(L,mt);var Mt=u+a+((f&8191)<<13);u=l+(f>>>13)+(Mt>>>26),Mt&=67108863,a=Math.imul(I,ot),f=Math.imul(I,ut),f+=Math.imul(q,ot),l=Math.imul(q,ut),a+=Math.imul(B,ft),f+=Math.imul(B,lt),f+=Math.imul(j,ft),l+=Math.imul(j,lt),a+=Math.imul(D,ht),f+=Math.imul(D,pt),f+=Math.imul(P,ht),l+=Math.imul(P,pt),a+=Math.imul(O,vt),f+=Math.imul(O,mt),f+=Math.imul(M,vt),l+=Math.imul(M,mt);var _t=u+a+((f&8191)<<13);u=l+(f>>>13)+(_t>>>26),_t&=67108863,a=Math.imul(I,ft),f=Math.imul(I,lt),f+=Math.imul(q,ft),l=Math.imul(q,lt),a+=Math.imul(B,ht),f+=Math.imul(B,pt),f+=Math.imul(j,ht),l+=Math.imul(j,pt),a+=Math.imul(D,vt),f+=Math.imul(D,mt),f+=Math.imul(P,vt),l+=Math.imul(P,mt);var Dt=u+a+((f&8191)<<13);u=l+(f>>>13)+(Dt>>>26),Dt&=67108863,a=Math.imul(I,ht),f=Math.imul(I,pt),f+=Math.imul(q,ht),l=Math.imul(q,pt),a+=Math.imul(B,vt),f+=Math.imul(B,mt),f+=Math.imul(j,vt),l+=Math.imul(j,mt);var Pt=u+a+((f&8191)<<13);u=l+(f>>>13)+(Pt>>>26),Pt&=67108863,a=Math.imul(I,vt),f=Math.imul(I,mt),f+=Math.imul(q,vt),l=Math.imul(q,mt);var Ht=u+a+((f&8191)<<13);return u=l+(f>>>13)+(Ht>>>26),Ht&=67108863,o[0]=gt,o[1]=yt,o[2]=bt,o[3]=wt,o[4]=Et,o[5]=St,o[6]=xt,o[7]=Tt,o[8]=Nt,o[9]=Ct,o[10]=kt,o[11]=Lt,o[12]=At,o[13]=Ot,o[14]=Mt,o[15]=_t,o[16]=Dt,o[17]=Pt,o[18]=Ht,u!==0&&(o[19]=u,r.length++),r};Math.imul||(h=c),i.prototype.mulTo=function(t,n){var r,i=this.length+t.length;return this.length===10&&t.length===10?r=h(this,t,n):i<63?r=c(this,t,n):i<1024?r=p(this,t,n):r=d(this,t,n),r},v.prototype.makeRBT=function(t){var n=new Array(t),r=i.prototype._countBits(t)-1;for(var s=0;s>=1;return i},v.prototype.permute=function(t,n,r,i,s,o){for(var u=0;u>>=1)s++;return 1<>>=13,i[2*u+1]=o&8191,o>>>=13;for(u=2*r;u>=26,r+=s/67108864|0,r+=o>>>26,this.words[i]=o&67108863}return r!==0&&(this.words[i]=r,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var n=l(t);if(n.length===0)return new i(1);var r=this;for(var s=0;s=0);var r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r,o;if(r!==0){var u=0;for(o=0;o>>26-r}u&&(this.words[o]=u,this.length++)}if(i!==0){for(o=this.length-1;o>=0;o--)this.words[o+i]=this.words[o];for(o=0;o=0);var s;r?s=(r-r%26)/26:s=0;var o=t%26,u=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<u){this.length-=u;for(l=0;l=0&&(c!==0||l>=s);l--){var h=this.words[l]|0;this.words[l]=c<<26-o|h>>>o,c=h&a}return f&&c!==0&&(f.words[f.length++]=c),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,r,i){return n(this.negative===0),this.iushrn(t,r,i)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,s=1<=0);var r=t%26,i=(t-r)/26;n(this.negative===0,"imaskn works only with positive numbers"),r!==0&&i++,this.length=Math.min(i,this.length);if(r!==0){var s=67108863^67108863>>>r<=67108864;n++)this.words[n]-=67108864,n===this.length-1?this.words[n+1]=1:this.words[n+1]++;return this.length=Math.max(this.length,n+1),this},i.prototype.isubn=function(t){n(typeof t=="number");if(t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;this.words[0]-=t;if(this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r>26)-(l/67108864|0),this.words[o+i]=a&67108863}for(;o>26,this.words[o+i]=a&67108863;if(f===0)return this.strip();n(f===-1),f=0;for(o=0;o>26,this.words[o]=a&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,n){var r=this.length-t.length,s=this.clone(),o=t,u=o.words[o.length-1]|0,a=this._countBits(u);r=26-a,r!==0&&(o=o.ushln(r),s.iushln(r),u=o.words[o.length-1]|0);var f=s.length-o.length,l;if(n!=="mod"){l=new i(null),l.length=f+1,l.words=new Array(l.length);for(var c=0;c=0;p--){var d=(s.words[o.length+p]|0)*67108864+(s.words[o.length+p-1]|0);d=Math.min(d/u|0,67108863),s._ishlnsubmul(o,d,p);while(s.negative!==0)d--,s.negative=0,s._ishlnsubmul(o,1,p),s.isZero()||(s.negative^=1);l&&(l.words[p]=d)}return l&&l.strip(),s.strip(),n!=="div"&&r!==0&&s.iushrn(r),{div:l||null,mod:s}},i.prototype.divmod=function(t,r,s){n(!t.isZero());var o,u,a;return this.negative!==0&&t.negative===0?(a=this.neg().divmod(t,r),r!=="mod"&&(o=a.div.neg()),r!=="div"&&(u=a.mod.neg(),s&&u.neg&&(u=u.add(t))),{div:o,mod:u}):this.negative===0&&t.negative!==0?(a=this.divmod(t.neg(),r),r!=="mod"&&(o=a.div.neg()),{div:o,mod:a.mod}):(this.negative&t.negative)!==0?(a=this.neg().divmod(t.neg(),r),r!=="div"&&(u=a.mod.neg(),s&&u.neg&&(u=u.isub(t))),{div:a.div,mod:u}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,r)},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var n=this.divmod(t);if(n.mod.isZero())return n.div;var r=n.div.negative!==0?n.mod.isub(t):n.mod,i=t.ushrn(1),s=t.andln(1),o=r.cmp(i);return o<0||s===1&&o===0?n.div:n.div.negative!==0?n.div.isubn(1):n.div.iaddn(1)},i.prototype.modn=function(t){n(t<=67108863);var r=(1<<26)%t,i=0;for(var s=this.length-1;s>=0;s--)i=(r*i+(this.words[s]|0))%t;return i},i.prototype.idivn=function(t){n(t<=67108863);var r=0;for(var i=this.length-1;i>=0;i--){var s=(this.words[i]|0)+r*67108864;this.words[i]=s/t|0,r=s%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(t.negative===0),n(!t.isZero());var r=this,s=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();var o=new i(1),u=new i(0),a=new i(0),f=new i(1),l=0;while(r.isEven()&&s.isEven())r.iushrn(1),s.iushrn(1),++l;var c=s.clone(),h=r.clone();while(!r.isZero()){for(var p=0,d=1;(r.words[0]&d)===0&&p<26;++p,d<<=1);if(p>0){r.iushrn(p);while(p-->0){if(o.isOdd()||u.isOdd())o.iadd(c),u.isub(h);o.iushrn(1),u.iushrn(1)}}for(var v=0,m=1;(s.words[0]&m)===0&&v<26;++v,m<<=1);if(v>0){s.iushrn(v);while(v-->0){if(a.isOdd()||f.isOdd())a.iadd(c),f.isub(h);a.iushrn(1),f.iushrn(1)}}r.cmp(s)>=0?(r.isub(s),o.isub(a),u.isub(f)):(s.isub(r),a.isub(o),f.isub(u))}return{a:a,b:f,gcd:s.iushln(l)}},i.prototype._invmp=function(t){n(t.negative===0),n(!t.isZero());var r=this,s=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();var o=new i(1),u=new i(0),a=s.clone();while(r.cmpn(1)>0&&s.cmpn(1)>0){for(var f=0,l=1;(r.words[0]&l)===0&&f<26;++f,l<<=1);if(f>0){r.iushrn(f);while(f-->0)o.isOdd()&&o.iadd(a),o.iushrn(1)}for(var c=0,h=1;(s.words[0]&h)===0&&c<26;++c,h<<=1);if(c>0){s.iushrn(c);while(c-->0)u.isOdd()&&u.iadd(a),u.iushrn(1)}r.cmp(s)>=0?(r.isub(s),o.isub(u)):(s.isub(r),u.isub(o))}var p;return r.cmpn(1)===0?p=o:p=u,p.cmpn(0)<0&&p.iadd(t),p},i.prototype.gcd=function(t){if(this.isZero())return t.clone();if(t.isZero())return this.clone();var n=this.clone(),r=t.clone();n.negative=0,r.negative=0;for(var i=0;n.isEven()&&r.isEven();i++)n.iushrn(1),r.iushrn(1);do{while(n.isEven())n.iushrn(1);while(r.isEven())r.iushrn(1);var s=n.cmp(r);if(s<0){var o=n;n=r,r=o}else if(s===0||r.cmpn(1)===0)break;n.isub(r)}while(!0);return r.iushln(i)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n(typeof t=="number");var r=t%26,i=(t-r)/26,s=1<>>26,a&=67108863,this.words[o]=a}return u!==0&&(this.words[o]=u,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var s=this.words[0]|0;i=s===t?0:st.length)return 1;if(this.length=0;r--){var i=this.words[r]|0,s=t.words[r]|0;if(i===s)continue;is&&(n=1);break}return n},i.red=function(t){return new S(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.ushl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};g.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var n=t,r;do this.split(n,this.tmp),n=this.imulK(n),n=n.iadd(this.tmp),r=n.bitLength();while(r>this.n);var i=r0?n.isub(this.p):n.strip(),n},g.prototype.split=function(t,n){t.iushrn(this.n,0,n)},g.prototype.imulK=function(t){return t.imul(this.k)},r(y,g),y.prototype.split=function(t,n){var r=4194303,i=Math.min(t.length,9);for(var s=0;s>>22,o=u}t.words[s-10]=o>>>22,t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;var n=0;for(var r=0;r>>=26,t.words[r]=s,n=i}return n!==0&&(t.words[t.length++]=n),t},i._prime=function N(e){if(m[e])return m[e];var N;if(e==="k256")N=new y;else if(e==="p224")N=new b;else if(e==="p192")N=new w;else{if(e!=="p25519")throw new Error("Unknown prime "+e);N=new E}return m[e]=N,N},S.prototype._verify1=function(t){n(t.negative===0,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,r){n((t.negative|r.negative)===0,"red works only with positives"),n(t.red&&t.red===r.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){var n=t.clone();return n.negative^=1,n.iadd(this.m)._forceRed +(this)},S.prototype.add=function(t,n){this._verify2(t,n);var r=t.add(n);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,n){this._verify2(t,n);var r=t.iadd(n);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,n){this._verify2(t,n);var r=t.sub(n);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,n){this._verify2(t,n);var r=t.isub(n);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,n){return this._verify1(t),this.imod(t.ushln(n))},S.prototype.imul=function(t,n){return this._verify2(t,n),this.imod(t.imul(n))},S.prototype.mul=function(t,n){return this._verify2(t,n),this.imod(t.mul(n))},S.prototype.isqr=function(t){return this.imul(t,t)},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);n(r%2===1);if(r===3){var s=this.m.add(new i(1)).iushrn(2);return this.pow(t,s)}var o=this.m.subn(1),u=0;while(!o.isZero()&&o.andln(1)===0)u++,o.iushrn(1);n(!o.isZero());var a=(new i(1)).toRed(this),f=a.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();c=(new i(2*c*c)).toRed(this);while(this.pow(c,l).cmp(f)!==0)c.redIAdd(f);var h=this.pow(c,o),p=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),v=u;while(d.cmp(a)!==0){var m=d;for(var g=0;m.cmp(a)!==0;g++)m=m.redSqr();n(g=0;o--){var c=n.words[o];for(var h=l-1;h>=0;h--){var p=c>>h&1;u!==s[0]&&(u=this.sqr(u));if(p===0&&a===0){f=0;continue}a<<=1,a|=p,f++;if(f!==r&&(o!==0||h!==0))continue;u=this.mul(u,s[a]),f=0,a=0}l=26}return u},S.prototype.convertTo=function(t){var n=t.umod(this.m);return n===t?n.clone():n},S.prototype.convertFrom=function(t){var n=t.clone();return n.red=null,n},i.mont=function(t){return new x(t)},r(x,S),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var n=this.imod(t.mul(this.rinv));return n.red=null,n},x.prototype.imul=function(t,n){if(t.isZero()||n.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(n),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=r.isub(i).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):s.cmpn(0)<0&&(o=s.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,n){if(t.isZero()||n.isZero())return(new i(0))._forceRed(this);var r=t.mul(n),s=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(s).iushrn(this.shift),u=o;return o.cmp(this.m)>=0?u=o.isub(this.m):o.cmpn(0)<0&&(u=o.iadd(this.m)),u._forceRed(this)},x.prototype.invm=function(t){var n=this.imod(t._invmp(this.m).mul(this.r2));return n._forceRed(this)}})(typeof t=="undefined"||t,this)},{}],126:[function(e,t,n){(function(n){function s(e){var t=u(e),n=t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed();return{blinder:n,unblinder:t.invm(e.modulus)}}function o(e,t){var i=s(t),o=t.modulus.byteLength(),u=r.mont(t.modulus),a=(new r(e)).mul(i.blinder).umod(t.modulus),f=a.toRed(r.mont(t.prime1)),l=a.toRed(r.mont(t.prime2)),c=t.coefficient,h=t.prime1,p=t.prime2,d=f.redPow(t.exponent1),v=l.redPow(t.exponent2);d=d.fromRed(),v=v.fromRed();var m=d.isub(v).imul(c).umod(h);return m.imul(p),v.iadd(m),new n(v.imul(i.unblinder).umod(t.modulus).toArray(!1,o))}function u(e){var t=e.modulus.byteLength(),n=new r(i(t));while(n.cmp(e.modulus)>=0||!n.umod(e.prime1)||!n.umod(e.prime2))n=new r(i(t));return n}var r=e("bn.js"),i=e("randombytes");t.exports=o,o.getr=u}).call(this,e("buffer").Buffer)},{"bn.js":125,buffer:88,randombytes:283}],127:[function(e,t,n){"use strict";var r=n;r.version=e("../package.json").version,r.utils=e("./elliptic/utils"),r.rand=e("brorand"),r.hmacDRBG=e("./elliptic/hmac-drbg"),r.curve=e("./elliptic/curve"),r.curves=e("./elliptic/curves"),r.ec=e("./elliptic/ec"),r.eddsa=e("./elliptic/eddsa")},{"../package.json":150,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/eddsa":137,"./elliptic/hmac-drbg":140,"./elliptic/utils":142,brorand:143}],128:[function(e,t,n){"use strict";function f(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=(new r(0)).toRed(this.red),this.one=(new r(1)).toRed(this.red),this.two=(new r(2)).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function l(e,t){this.curve=e,this.type=t,this.precomputed=null}var r=e("bn.js"),i=e("../../elliptic"),s=i.utils,o=s.getNAF,u=s.getJSF,a=s.assert;t.exports=f,f.prototype.point=function(){throw new Error("Not implemented")},f.prototype.validate=function(){throw new Error("Not implemented")},f.prototype._fixedNafMul=function(t,n){a(t.precomputed);var r=t._getDoubles(),i=o(n,1),s=(1<=f;n--)l=(l<<1)+i[n];u.push(l)}var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null);for(var p=s;p>0;p--){for(var f=0;f=0;l--){for(var n=0;l>=0&&u[l]===0;l--)n++;l>=0&&n++,f=f.dblp(n);if(l<0)break;var c=u[l];a(c!==0),t.type==="affine"?c>0?f=f.mixedAdd(s[c-1>>1]):f=f.mixedAdd(s[-c-1>>1].neg()):c>0?f=f.add(s[c-1>>1]):f=f.add(s[-c-1>>1].neg())}return t.type==="affine"?f.toP():f},f.prototype._wnafMulAdd=function(t,n,r,i){var s=this._wnafT1,a=this._wnafT2,f=this._wnafT3,l=0;for(var c=0;c=1;c-=2){var d=c-1,v=c;if(s[d]!==1||s[v]!==1){f[d]=o(r[d],s[d]),f[v]=o(r[v],s[v]),l=Math.max(f[d].length,l),l=Math.max(f[v].length,l);continue}var m=[n[d],null,null,n[v]];n[d].y.cmp(n[v].y)===0?(m[1]=n[d].add(n[v]),m[2]=n[d].toJ().mixedAdd(n[v].neg())):n[d].y.cmp(n[v].y.redNeg())===0?(m[1]=n[d].toJ().mixedAdd(n[v]),m[2]=n[d].add(n[v].neg())):(m[1]=n[d].toJ().mixedAdd(n[v]),m[2]=n[d].toJ().mixedAdd(n[v].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=u(r[d],r[v]);l=Math.max(y[0].length,l),f[d]=new Array(l),f[v]=new Array(l);for(var b=0;b=0;c--){var T=0;while(c>=0){var N=!0;for(var b=0;b=0&&T++,S=S.dblp(T);if(c<0)break;for(var b=0;b0?h=a[b][C-1>>1]:C<0&&(h=a[b][-C-1>>1].neg()),h.type==="affine"?S=S.mixedAdd(h):S=S.add(h)}}for(var c=0;c=Math.ceil((t.bitLength()+1)/n.step):!1},l.prototype._getDoubles=function(t,n){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var r=[this],i=this;for(var s=0;s":""},l.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&this.y.cmp(this.z)===0},l.prototype._extDbl=function(){var t=this.x.redSqr(),n=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),s=this.x.redAdd(this.y).redSqr().redISub(t).redISub(n),o=i.redAdd(n),u=o.redSub(r),a=i.redSub(n),f=s.redMul(u),l=o.redMul(a),c=s.redMul(a),h=u.redMul(o);return this.curve.point(f,l,h,c)},l.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),r=this.y.redSqr(),i,s,o;if(this.curve.twisted){var u=this.curve._mulA(n),a=u.redAdd(r);if(this.zOne)i=t.redSub(n).redSub(r).redMul(a.redSub(this.curve.two)),s=a.redMul(u.redSub(r)),o=a.redSqr().redSub(a).redSub(a);else{var f=this.z.redSqr(),l=a.redSub(f).redISub(f);i=t.redSub(n).redISub(r).redMul(l),s=a.redMul(u.redSub(r)),o=a.redMul(l)}}else{var u=n.redAdd(r),f=this.curve._mulC(this.c.redMul(this.z)).redSqr(),l=u.redSub(f).redSub(f);i=this.curve._mulC(t.redISub(u)).redMul(l),s=this.curve._mulC(u).redMul(n.redISub(r)),o=u.redMul(l)}return this.curve.point(i,s,o)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(t){var n=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),s=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(n),u=s.redSub(i),a=s.redAdd(i),f=r.redAdd(n),l=o.redMul(u),c=a.redMul(f),h=o.redMul(f),p=u.redMul(a);return this.curve.point(l,c,p,h)},l.prototype._projAdd=function(t){var n=this.z.redMul(t.z),r=n.redSqr(),i=this.x.redMul(t.x),s=this.y.redMul(t.y),o=this.curve.d.redMul(i).redMul(s),u=r.redSub(o),a=r.redAdd(o),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(i).redISub(s),l=n.redMul(u).redMul(f),c,h;return this.curve.twisted?(c=n.redMul(a).redMul(s.redSub(this.curve._mulA(i))),h=u.redMul(a)):(c=n.redMul(a).redMul(s.redSub(i)),h=this.curve._mulC(u).redMul(a)),this.curve.point(l,c,h)},l.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},l.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},l.prototype.mulAdd=function(t,n,r){return this.curve._wnafMulAdd(1,[this,n],[t,r],2)},l.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":125,inherits:285}],130:[function(e,t,n){"use strict";var r=n;r.base=e("./base"),r.short=e("./short"),r.mont=e("./mont"),r.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,n){"use strict";function f(e){o.call(this,"mont",e),this.a=(new i(e.a,16)).toRed(this.red),this.b=(new i(e.b,16)).toRed(this.red),this.i4=(new i(4)).toRed(this.red).redInvm(),this.two=(new i(2)).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function l(e,t,n){o.BasePoint.call(this,e,"projective"),t===null&&n===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var r=e("../curve"),i=e("bn.js"),s=e("inherits"),o=r.base,u=e("../../elliptic"),a=u.utils;s(f,o),t.exports=f,f.prototype.validate=function(t){var n=t.normalize().x,r=n.redSqr(),i=r.redMul(n).redAdd(r.redMul(this.a)).redAdd(n),s=i.redSqrt();return s.redSqr().cmp(i)===0},s(l,o.BasePoint),f.prototype.decodePoint=function(t,n){return this.point(a.toArray(t,n),1)},f.prototype.point=function(t,n){return new l(this,t,n)},f.prototype.pointFromJSON=function(t){return l.fromJSON(this,t)},l.prototype.precompute=function(){},l.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},l.fromJSON=function(t,n){return new l(t,n[0],n[1]||t.one)},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return this.z.cmpn(0)===0},l.prototype.dbl=function(){var t=this.x.redAdd(this.z),n=t.redSqr(),r=this.x.redSub(this.z),i=r.redSqr(),s=n.redSub(i),o=n.redMul(i),u=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(o,u)},l.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.diffAdd=function(t,n){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=t.x.redAdd(t.z),o=t.x.redSub(t.z),u=o.redMul(r),a=s.redMul(i),f=n.z.redMul(u.redAdd(a).redSqr()),l=n.x.redMul(u.redISub(a).redSqr());return this.curve.point(f,l)},l.prototype.mul=function(t){var n=t.clone(),r=this,i=this.curve.point(null,null),s=this;for(var o=[];n.cmpn(0)!==0;n.iushrn(1))o.push(n.andln(1));for(var u=o.length-1;u>=0;u--)o[u]===0?(r=r.diffAdd(i,s),i=i.dbl()):(i=r.diffAdd(i,s),r=r.dbl());return i},l.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.eq=function(t){return this.getX().cmp(t.getX())===0},l.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":127,"../curve":130,"bn.js":125,inherits:285}],132:[function(e,t,n){"use strict";function f(e){u.call(this,"short",e),this.a=(new s(e.a,16)).toRed(this.red),this.b=(new s(e.b,16)).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function l(e,t,n,r){u.BasePoint.call(this,e,"affine"),t===null&&n===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new s(t,16),this.y=new s(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(e,t,n,r){u.BasePoint.call(this,e,"jacobian"),t===null&&n===null&&r===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new s(0)):(this.x=new s(t,16),this.y=new s(n,16),this.z=new s(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var r=e("../curve"),i=e("../../elliptic"),s=e("bn.js"),o=e("inherits"),u=r.base,a=i.utils.assert;o(f,u),t.exports=f,f.prototype._getEndomorphism=function(t){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var n,r;if(t.beta)n=(new s(t.beta,16)).toRed(this.red);else{var i=this._getEndoRoots(this.p);n=i[0].cmp(i[1])<0?i[0]:i[1],n=n.toRed(this.red)}if(t.lambda)r=new s(t.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(n))===0?r=o[0]:(r=o[1],a(this.g.mul(r).x.cmp(this.g.x.redMul(n))===0))}var u;return t.basis?u=t.basis.map(function(e){return{a:new s(e.a,16),b:new s(e.b,16)}}):u=this._getEndoBasis(r),{beta:n,lambda:r,basis:u}},f.prototype._getEndoRoots=function(t){var n=t===this.p?this.red:s.mont(t),r=(new s(2)).toRed(n).redInvm(),i=r.redNeg(),o=(new s(3)).toRed(n).redNeg().redSqrt().redMul(r),u=i.redAdd(o).fromRed(),a=i.redSub(o).fromRed();return[u,a]},f.prototype._getEndoBasis=function(t){var n=this.n.ushrn(Math.floor(this.n.bitLength()/2)),r=t,i=this.n.clone(),o=new s(1),u=new s(0),a=new s(0),f=new s(1),l,c,h,p,d,v,m,g=0,y,b;while(r.cmpn(0)!==0){var w=i.div(r);y=i.sub(w.mul(r)),b=a.sub(w.mul(o));var E=f.sub(w.mul(u));if(!h&&y.cmp(n)<0)l=m.neg(),c=o,h=y.neg(),p=b;else if(h&&++g===2)break;m=y,i=r,r=y,a=o,o=b,f=u,u=E}d=y.neg(),v=b;var S=h.sqr().add(p.sqr()),x=d.sqr().add(v.sqr());return x.cmp(S)>=0&&(d=l,v=c),h.negative&&(h=h.neg(),p=p.neg()),d.negative&&(d=d.neg(),v=v.neg()),[{a:h,b:p},{a:d,b:v}]},f.prototype._endoSplit=function(t){var n=this.endo.basis,r=n[0],i=n[1],s=i.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),u=s.mul(r.a),a=o.mul(i.a),f=s.mul(r.b),l=o.mul(i.b),c=t.sub(u).sub(a),h=f.add(l).neg();return{k1:c,k2:h}},f.prototype.pointFromX=function(t,n){t=new s(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt(),o=i.fromRed().isOdd();if(n&&!o||!n&&o)i=i.redNeg();return this.point(t,i)},f.prototype.validate=function(t){if(t.inf)return!0;var n=t.x,r=t.y,i=this.a.redMul(n),s=n.redSqr().redMul(n).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(s).cmpn(0)===0},f.prototype._endoWnafMulAdd=function(t,n){var r=this._endoWnafT1,i=this._endoWnafT2;for(var s=0;s":""},l.prototype.isInfinity=function(){return this.inf},l.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var n=this.y.redSub(t.y);n.cmpn(0)!==0&&(n=n.redMul(this.x.redSub(t.x).redInvm()));var r=n.redSqr().redISub(this.x).redISub(t.x),i=n.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},l.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var n=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),s=r.redAdd(r).redIAdd(r).redIAdd(n).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,u)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(t){return t=new s(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},l.prototype.mulAdd=function(t,n,r){var i=[this,n],s=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},l.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},l.prototype.neg=function(t){if(this.inf)return this;var n=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};n.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return n},l.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t},o(c,u.BasePoint),f.prototype.jpoint=function(t,n,r){return new c(this,t,n,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),n=t.redSqr(),r=this.x.redMul(n),i=this.y.redMul(n).redMul(t);return this.curve.point(r,i)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var n=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(n),s=t.x.redMul(r),o=this.y.redMul(n.redMul(t.z)),u=t.y.redMul(r.redMul(this.z)),a=i.redSub(s),f=o.redSub(u);if(a.cmpn(0)===0)return f.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),c=l.redMul(a),h=i.redMul(l),p=f.redSqr().redIAdd(c).redISub(h).redISub(h),d=f.redMul(h.redISub(p)).redISub(o.redMul(c)),v=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(p,d,v)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var n=this.z.redSqr(),r=this.x,i=t.x.redMul(n),s=this.y,o=t.y.redMul(n).redMul(this.z),u=r.redSub(i),a=s.redSub(o);if(u.cmpn(0)===0)return a.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=u.redSqr(),l=f.redMul(u),c=r.redMul(f),h=a.redSqr().redIAdd(l).redISub(c).redISub(c),p=a.redMul(c.redISub(h)).redISub(s.redMul(l)),d=this.z.redMul(u);return this.curve.jpoint(h,p,d)},c.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var n=this;for(var r=0;r":""},c.prototype.isInfinity=function(){return this.z.cmpn(0)===0}},{"../../elliptic":127,"../curve":130,"bn.js":125,inherits:285}],133:[function(e,t,n){"use strict";function u(e){e.type==="short"?this.curve=new s.curve.short(e):e.type==="edwards"?this.curve=new s.curve.edwards(e):this.curve=new s.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new u(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}var r=n,i=e("hash.js"),s=e("../elliptic"),o=s.utils.assert;r.PresetCurve=u,a("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:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:i.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"]}),a("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:i.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),a("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:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var f;try{f=e("./precomputed/secp256k1")}catch(l){f=undefined}a("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:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})},{"../elliptic":127,"./precomputed/secp256k1":141,"hash.js":144}],134:[function(e,t,n){"use strict";function f(e){if(!(this instanceof f))return new f(e);typeof e=="string"&&(o(i.curves.hasOwnProperty(e),"Unknown curve "+e),e=i.curves[e]),e instanceof i.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var r=e("bn.js"),i=e("../../elliptic"),s=i.utils,o=s.assert,u=e("./key"),a=e("./signature");t.exports=f,f.prototype.keyPair=function(t){return new u(this,t)},f.prototype.keyFromPrivate=function(t,n){return u.fromPrivate(this,t,n)},f.prototype.keyFromPublic=function(t,n){return u.fromPublic(this,t,n)},f.prototype.genKeyPair=function(t){t||(t={});var n=new i.hmacDRBG({hash:this.hash,pers:t.pers,entropy:t.entropy||i.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),s=this.n.byteLength(),o=this.n.sub(new r(2));do{var u=new r(n.generate(s));if(u.cmp(o)>0)continue;return u.iaddn(1),this.keyFromPrivate(u)}while(!0)},f.prototype._truncateToN=function(t,n){var r=t.byteLength()*8-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!n&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,n,s,o){typeof s=="object"&&(o=s,s=null),o||(o={}),n=this.keyFromPrivate(n,s),t=this._truncateToN(new r(t,16));var u=this.n.byteLength(),f=n.getPrivate().toArray("be",u),l=t.toArray("be",u),c=new i.hmacDRBG({hash:this.hash,entropy:f,nonce:l}),h=this.n.sub(new r(1));for(var p=0;!0;p++){var d=o.k?o.k(p):new r(c.generate(this.n.byteLength()));d=this._truncateToN(d,!0);if(d.cmpn(1)<=0||d.cmp(h)>=0)continue;var v=this.g.mul(d);if(v.isInfinity())continue;var m=v.getX(),g=m.umod(this.n);if(g.cmpn(0)===0)continue;var y=d.invm(this.n).mul(g.mul(n.getPrivate()).iadd(t));y=y.umod(this.n);if(y.cmpn(0)===0)continue;var b=(v.getY().isOdd()?1:0)|(m.cmp(g)!==0?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),b^=1),new a({r:g,s:y,recoveryParam:b})}},f.prototype.verify=function(t,n,i,s){t=this._truncateToN(new r(t,16)),i=this.keyFromPublic(i,s),n=new a(n,"hex");var o=n.r,u=n.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var f=u.invm(this.n),l=f.mul(t).umod(this.n),c=f.mul(o).umod(this.n),h=this.g.mulAdd(l,i.getPublic(),c);return h.isInfinity()?!1:h.getX().umod(this.n).cmp(o)===0},f.prototype.recoverPubKey=function(e,t,n,i){o((3&n)===n,"The recovery param is more than two bits"),t=new a(t,i);var s=this.n,u=new r(e),f=t.r,l=t.s,c=n&1,h=n>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");h?f=this.curve.pointFromX(f.add(this.curve.n),c):f=this.curve.pointFromX(f,c);var p=s.sub(u),d=t.r.invm(s);return f.mul(l).add(this.g.mul(p)).mul(d)},f.prototype.getKeyRecoveryParam=function(e,t,n,r){t=new a(t,r);if(t.recoveryParam!==null)return t.recoveryParam;for(var i=0;i<4;i++){var s=this.recoverPubKey(e,t,i);if(s.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":127,"./key":135,"./signature":136,"bn.js":125}],135:[function(e,t,n){"use strict";function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var r=e("bn.js");t.exports=i,i.fromPublic=function(t,n,r){return n instanceof i?n:new i(t,{pub:n,pubEnc:r})},i.fromPrivate=function(t,n,r){return n instanceof i?n:new i(t,{priv:n,privEnc:r})},i.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},i.prototype.getPublic=function(t,n){return typeof t=="string"&&(n=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),n?this.pub.encode(n,t):this.pub},i.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(t,n){this.priv=new r(t,n||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(t,n){if(t.x||t.y){this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,n)},i.prototype.derive=function(t){return t.mul(this.priv).getX()},i.prototype.sign=function(t,n,r){return this.ec.sign(t,this,n,r)},i.prototype.verify=function(t,n){return this.ec.verify(t,n,this)},i.prototype.inspect=function(){return""}},{"bn.js":125}],136:[function(e,t,n){"use strict";function u(e,t){if(e instanceof u)return e;if(this._importDER(e,t))return;o(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),e.recoveryParam!==null?this.recoveryParam=e.recoveryParam:this.recoveryParam=null}function a(){this.place=0}function f(e,t){var n=e[t.place++];if(!(n&128))return n;var r=n&15,i=0;for(var s=0,o=t.place;s>>3);e.push(n|128);while(--n)e.push(t>>>(n<<3)&255);e.push(t)}var r=e("bn.js"),i=e("../../elliptic"),s=i.utils,o=s.assert;t.exports=u,u.prototype._importDER=function(t,n){t=s.toArray(t,n);var i=new a;if(t[i.place++]!==48)return!1;var o=f(t,i);if(o+i.place!==t.length)return!1;if(t[i.place++]!==2)return!1;var u=f(t,i),l=t.slice(i.place,u+i.place);i.place+=u;if(t[i.place++]!==2)return!1;var c=f(t,i);if(t.length!==c+i.place)return!1;var h=t.slice(i.place,c+i.place);return l[0]===0&&l[1]&128&&(l=l.slice(1)),h[0]===0&&h[1]&128&&(h=h.slice(1)),this.r=new r(l),this.s=new r(h),this.recoveryParam=null,!0},u.prototype.toDER=function(t){var n=this.r.toArray(),r=this.s.toArray();n[0]&128&&(n=[0].concat(n)),r[0]&128&&(r=[0].concat(r)),n=l(n),r=l(r);while(!r[0]&&!(r[1]&128))r=r.slice(1);var i=[2];c(i,n.length),i=i.concat(n),i.push(2),c(i,r.length);var o=i.concat(r),u=[48];return c(u,o.length),u=u.concat(o),s.encode(u,t)}},{"../../elliptic":127,"bn.js":125}],137:[function(e,t,n){"use strict";function l(e){o(e==="ed25519","only tested with ed25519 so far");if(!(this instanceof l))return new l(e);var e=i.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}var r=e("hash.js"),i=e("../../elliptic"),s=i.utils,o=s.assert,u=s.parseBytes,a=e("./key"),f=e("./signature");t.exports=l,l.prototype.sign=function(t,n){t=u(t);var r=this.keyFromSecret(n),i=this.hashInt(r.messagePrefix(),t),s=this.g.mul(i),o=this.encodePoint(s),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),f=i.add(a).umod(this.curve.n);return this.makeSignature({R:s,S:f,Rencoded:o})},l.prototype.verify=function(t,n,r){t=u(t),n=this.makeSignature(n);var i=this.keyFromPublic(r),s=this.hashInt(n.Rencoded(),i.pubBytes(),t),o=this.g.mul(n.S()),a=n.R().add(i.pub().mul(s));return a.eq(o)},l.prototype.hashInt=function(){var t=this.hash();for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var r=e("hash.js"),i=e("../elliptic"),s=i.utils,o=s.assert;t.exports=u,u.prototype._init=function(t,n,r){var i=t.concat(n).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this.reseed=1},u.prototype.generate=function(t,n,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");typeof n!="string"&&(i=r,r=n,n=null),r&&(r=s.toArray(r,i),this._update(r));var o=[];while(o.length>8,o=i&255;s?n.push(s,o):n.push(o)}else if(t==="hex"){e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e);for(var r=0;r=0){var s;if(i.isOdd()){var o=i.andln(r-1);o>(r>>1)-1?s=(r>>1)-o:s=o,i.isubn(s)}else s=0;n.push(s);var u=i.cmpn(0)!==0&&i.andln(r-1)===0?t+1:1;for(var a=1;a0||t.cmpn(-i)>0){var s=e.andln(3)+r&3,o=t.andln(3)+i&3;s===3&&(s=-1),o===3&&(o=-1);var u;if((s&1)===0)u=0;else{var a=e.andln(7)+r&7;a!==3&&a!==5||o!==2?u=s:u=-s}n[0].push(u);var f;if((o&1)===0)f=0;else{var a=t.andln(7)+i&7;a!==3&&a!==5||s!==2?f=o:f=-o}n[1].push(f),2*r===u+1&&(r=1-r),2*i===f+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return n}function l(e,t){var n=t.name,r="_"+n;e.prototype[n]=function(){return this[r]!==undefined?this[r]:this[r]=t.call(this)}}function c(e){return typeof e=="string"?r.toArray(e,"hex"):e}function h(e){return new i(e,"hex","le")}var r=n,i=e("bn.js");r.assert=function(t,n){if(!t)throw new Error(n||"Assertion failed")},r.toArray=s,r.zero2=o,r.toHex=u,r.encode=function(t,n){return n==="hex"?u(t):t},r.getNAF=a,r.getJSF=f,r.cachedProperty=l,r.parseBytes=c,r.intFromLE=h},{"bn.js":125}],143:[function(e,t,n){function i(e){this.rand=e}var r;t.exports=function(t){return r||(r=new i(null)),r.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)};if(typeof window=="object")window.crypto&&window.crypto.getRandomValues?i.prototype._rand=function(t){var n=new Uint8Array(t);return window.crypto.getRandomValues(n),n}:window.msCrypto&&window.msCrypto.getRandomValues?i.prototype._rand=function(t){var n=new Uint8Array(t);return window.msCrypto.getRandomValues(n),n}:i.prototype._rand=function(){throw new Error("Not implemented yet")};else try{var s=e("crypto");i.prototype._rand=function(t){return s.randomBytes(t)}}catch(o){i.prototype._rand=function(t){var n=new Uint8Array(t);for(var r=0;r=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),this.pending.length===0&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var s=0;s>>24&255,i[s++]=t>>>16&255,i[s++]=t>>>8&255,i[s++]=t&255}else{i[s++]=t&255,i[s++]=t>>>8&255,i[s++]=t>>>16&255,i[s++]=t>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0;for(var o=8;othis.blockSize&&(t=(new this.Hash).update(t).digest()),o(t.length<=this.blockSize);for(var n=t.length;n>>3}function j(e){return o(e,17)^o(e,19)^e>>>10}function F(e,t,n,r){if(e===0)return M(t,n,r);if(e===1||e===3)return D(t,n,r);if(e===2)return _(t,n,r)}function I(e,t,n,r,i,s){var o=e&n^~e&i;return o<0&&(o+=4294967296),o}function q(e,t,n,r,i,s){var o=t&r^~t&s;return o<0&&(o+=4294967296),o}function R(e,t,n,r,i,s){var o=e&n^e&i^n&i;return o<0&&(o+=4294967296),o}function U(e,t,n,r,i,s){var o=t&r^t&s^r&s;return o<0&&(o+=4294967296),o}function z(e,t){var n=c(e,t,28),r=c(t,e,2),i=c(t,e,7),s=n^r^i;return s<0&&(s+=4294967296),s}function W(e,t){var n=h(e,t,28),r=h(t,e,2),i=h(t,e,7),s=n^r^i;return s<0&&(s+=4294967296),s}function X(e,t){var n=c(e,t,14),r=c(e,t,18),i=c(t,e,9),s=n^r^i;return s<0&&(s+=4294967296),s}function V(e,t){var n=h(e,t,14),r=h(e,t,18),i=h(t,e,9),s=n^r^i;return s<0&&(s+=4294967296),s}function $(e,t){var n=c(e,t,1),r=c(e,t,8),i=p(e,t,7),s=n^r^i;return s<0&&(s+=4294967296),s}function J(e,t){var n=h(e,t,1),r=h(e,t,8),i=d(e,t,7),s=n^r^i;return s<0&&(s+=4294967296),s}function K(e,t){var n=c(e,t,19),r=c(t,e,29),i=p(e,t,6),s=n^r^i;return s<0&&(s+=4294967296),s}function Q(e,t){var n=h(e,t,19),r=h(t,e,29),i=d(e,t,6),s=n^r^i;return s<0&&(s+=4294967296),s}var r=e("../hash"),i=r.utils,s=i.assert,o=i.rotr32,u=i.rotl32,a=i.sum32,f=i.sum32_4,l=i.sum32_5,c=i.rotr64_hi,h=i.rotr64_lo,p=i.shr64_hi,d=i.shr64_lo,v=i.sum64,m=i.sum64_hi,g=i.sum64_lo,y=i.sum64_4_hi,b=i.sum64_4_lo,w=i.sum64_5_hi,E=i.sum64_5_lo,S=r.common.BlockHash,x=[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],T=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],N=[1518500249,1859775393,2400959708,3395469782];i.inherits(C,S),n.sha256=C,C.blockSize=512,C.outSize=256,C.hmacStrength=192,C.padLength=64,C.prototype._update=function(t,n){var r=this.W;for(var i=0;i<16;i++)r[i]=t[n+i];for(;i>8,o=i&255;s?n.push(s,o):n.push(o)}else if(t==="hex"){e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e);for(var r=0;r>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}function a(e,t){var n="";for(var r=0;r>>0}return s}function h(e,t){var n=new Array(e.length*4);for(var r=0,i=0;r>>24,n[i+1]=s>>>16&255,n[i+2]=s>>>8&255,n[i+3]=s&255):(n[i+3]=s>>>24,n[i+2]=s>>>16&255,n[i+1]=s>>>8&255,n[i]=s&255)}return n}function p(e,t){return e>>>t|e<<32-t}function d(e,t){return e<>>32-t}function v(e,t){return e+t>>>0}function m(e,t,n){return e+t+n>>>0}function g(e,t,n,r){return e+t+n+r>>>0}function y(e,t,n,r,i){return e+t+n+r+i>>>0}function b(e,t){if(!e)throw new Error(t||"Assertion failed")}function w(e,t,n,r){var i=e[t],s=e[t+1],o=r+s>>>0,u=(o>>0,e[t+1]=o}function E(e,t,n,r){var i=t+r>>>0,s=(i>>0}function S(e,t,n,r){var i=t+r;return i>>>0}function x(e,t,n,r,i,s,o,u){var a=0,f=t;f=f+r>>>0,a+=f>>0,a+=f>>0,a+=f>>0}function T(e,t,n,r,i,s,o,u){var a=t+r+s+u;return a>>>0}function N(e,t,n,r,i,s,o,u,a,f){var l=0,c=t;c=c+r>>>0,l+=c>>0,l+=c>>0,l+=c>>0,l+=c>>0}function C(e,t,n,r,i,s,o,u,a,f){var l=t+r+s+u+f;return l>>>0}function k(e,t,n){var r=t<<32-n|e>>>n;return r>>>0}function L(e,t,n){var r=e<<32-n|t>>>n;return r>>>0}function A(e,t,n){return e>>>n}function O(e,t,n){var r=e<<32-n|t>>>n;return r>>>0}var r=n,i=e("inherits");r.toArray=s,r.toHex=o,r.htonl=u,r.toHex32=a,r.zero2=f,r.zero8=l,r.join32=c,r.split32=h,r.rotr32=p,r.rotl32=d,r.sum32=v,r.sum32_3=m,r.sum32_4=g,r.sum32_5=y,r.assert=b,r.inherits=i,n.sum64=w,n.sum64_hi=E,n.sum64_lo=S,n.sum64_4_hi=x,n.sum64_4_lo=T,n.sum64_5_hi=N,n.sum64_5_lo=C,n.rotr64_hi=k,n.rotr64_lo=L,n.shr64_hi=A,n.shr64_lo=O},{inherits:285}],150:[function(e,t,n){t.exports={name:"elliptic",version:"6.1.0",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{test:"make lint && istanbul test _mocha --reporter=spec test/*-test.js",coveralls:"cat ./coverage/lcov.info | coveralls"},repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},keywords:["EC","Elliptic","curve","Cryptography"],author:{name:"Fedor Indutny",email:"fedor@indutny.com"},license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{browserify:"^3.44.2",coveralls:"^2.11.3",istanbul:"^0.3.17",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},dependencies:{"bn.js":"^4.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},gitHead:"b465fea90447f3b6c0b3f55e5fd6ecdedc1282f2",_id:"elliptic@6.1.0",_shasum:"68130e03823b4ce024955ad1be195e148099d654",_from:"elliptic@>=6.0.0 <7.0.0",_npmVersion:"3.3.12",_nodeVersion:"5.2.0",_npmUser:{name:"indutny",email:"fedor@indutny.com"},dist:{shasum:"68130e03823b4ce024955ad1be195e148099d654",tarball:"http://registry.npmjs.org/elliptic/-/elliptic-6.1.0.tgz"},maintainers:[{name:"indutny",email:"fedor@indutny.com"}],directories:{},_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.1.0.tgz"}},{}],151:[function(e,t,n){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],152:[function(e,t,n){var r=e("asn1.js"),i=r.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});n.RSAPrivateKey=i;var s=r.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});n.RSAPublicKey=s;var o=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(u),this.key("subjectPublicKey").bitstr())});n.PublicKey=o;var u=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),a=r.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(u),this.key("subjectPrivateKey").octstr())});n.PrivateKey=a;var f=r.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});n.EncryptedPrivateKey=f;var l=r.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});n.DSAPrivateKey=l,n.DSAparam=r.define("DSAparam",function(){this.int()});var c=r.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});n.ECPrivateKey=c;var h=r.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});n.signature=r.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"asn1.js":155}],153:[function(e,t,n){(function(n){var r=/Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m,i=/^-----BEGIN (.*) KEY-----\r?\n/m,s=/^-----BEGIN (.*) KEY-----\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n-----END \1 KEY-----$/m,o=e("evp_bytestokey"),u=e("browserify-aes");t.exports=function(e,t){var a=e.toString(),f=a.match(r),l;if(!f){var c=a.match(s);l=new n(c[2].replace(/\r?\n/g,""),"base64")}else{var h="aes"+f[1],p=new n(f[2],"hex"),d=new n(f[3].replace(/\r?\n/g,""),"base64"),v=o(t,p.slice(0,8),parseInt(f[1],10)).key,m=[],g=u.createDecipheriv(h,v,p);m.push(g.update(d)),m.push(g.final()),l=n.concat(m)}var y=a.match(i)[1]+" KEY";return{tag:y,data:l}}}).call(this,e("buffer").Buffer)},{"browserify-aes":172,buffer:88,evp_bytestokey:187}],154:[function(e,t,n){(function(n){function a(e){var t;typeof e=="object"&&!n.isBuffer(e)&&(t=e.passphrase,e=e.key),typeof e=="string"&&(e=new n(e));var i=s(e,t),o=i.tag,u=i.data,a,l;switch(o){case"PUBLIC KEY":l=r.PublicKey.decode(u,"der"),a=l.algorithm.algorithm.join(".");switch(a){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(l.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return l.subjectPrivateKey=l.subjectPublicKey,{type:"ec",data:l};case"1.2.840.10040.4.1":return l.algorithm.params.pub_key=r.DSAparam.decode(l.subjectPublicKey.data,"der"),{type:"dsa",data:l.algorithm.params};default:throw new Error("unknown key id "+a)}throw new Error("unknown key type "+o);case"ENCRYPTED PRIVATE KEY":u=r.EncryptedPrivateKey.decode(u,"der"),u=f(u,t);case"PRIVATE KEY":l=r.PrivateKey.decode(u,"der"),a=l.algorithm.algorithm.join(".");switch(a){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(l.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:l.algorithm.curve,privateKey:r.ECPrivateKey.decode(l.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return l.algorithm.params.priv_key=r.DSAparam.decode(l.subjectPrivateKey,"der"),{type:"dsa",params:l.algorithm.params};default:throw new Error("unknown key id "+a)}throw new Error("unknown key type "+o);case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(u,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(u,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(u,"der")};case"EC PRIVATE KEY":return u=r.ECPrivateKey.decode(u,"der"),{curve:u.parameters.value,privateKey:u.privateKey};default:throw new Error("unknown key type "+o)}}function f(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,s=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),a=i[e.algorithm.decrypt.cipher.algo.join(".")],f=e.algorithm.decrypt.cipher.iv,l=e.subjectPrivateKey,c=parseInt(a.split("-")[1],10)/8,h=u.pbkdf2Sync(t,r,s,c),p=o.createDecipheriv(a,h,f),d=[];return d.push(p.update(l)),d.push(p.final()),n.concat(d)}var r=e("./asn1"),i=e("./aesid.json"),s=e("./fixProc"),o=e("browserify-aes"),u=e("pbkdf2");t.exports=a,a.signature=r.signature}).call(this,e("buffer").Buffer)},{"./aesid.json":151,"./asn1":152,"./fixProc":153,"browserify-aes":172,buffer:88,pbkdf2:237}],155:[function( +e,t,n){var r=n;r.bignum=e("bn.js"),r.define=e("./asn1/api").define,r.base=e("./asn1/base"),r.constants=e("./asn1/constants"),r.decoders=e("./asn1/decoders"),r.encoders=e("./asn1/encoders")},{"./asn1/api":156,"./asn1/base":158,"./asn1/constants":162,"./asn1/decoders":164,"./asn1/encoders":167,"bn.js":125}],156:[function(e,t,n){function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}var r=e("../asn1"),i=e("inherits"),s=n;s.define=function(t,n){return new o(t,n)},o.prototype._createNamed=function(n){var r;try{r=e("vm").runInThisContext("(function "+this.name+"(entity) {\n"+" this._initNamed(entity);\n"+"})")}catch(s){r=function(e){this._initNamed(e)}}return i(r,n),r.prototype._initNamed=function(t){n.call(this,t)},new r(this)},o.prototype._getDecoder=function(t){return this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(r.decoders[t])),this.decoders[t]},o.prototype.decode=function(t,n,r){return this._getDecoder(n).decode(t,r)},o.prototype._getEncoder=function(t){return this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(r.encoders[t])),this.encoders[t]},o.prototype.encode=function(t,n,r){return this._getEncoder(n).encode(t,r)}},{"../asn1":155,inherits:285,vm:304}],157:[function(e,t,n){function o(e,t){i.call(this,t);if(!s.isBuffer(e)){this.error("Input not Buffer");return}this.base=e,this.offset=0,this.length=e.length}function u(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof u||(e=new u(e,t)),this.length+=e.length,e},this);else if(typeof e=="number"){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if(typeof e=="string")this.value=e,this.length=s.byteLength(e);else{if(!s.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}var r=e("inherits"),i=e("../base").Reporter,s=e("buffer").Buffer;r(o,i),n.DecoderBuffer=o,o.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},o.prototype.restore=function(t){var n=new o(this.base);return n.offset=t.offset,n.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),n},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},o.prototype.skip=function(t,n){if(this.offset+t<=this.length){var r=new o(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r}return this.error(n||"DecoderBuffer overrun")},o.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},n.EncoderBuffer=u,u.prototype.join=function(t,n){return t||(t=new s(this.length)),n||(n=0),this.length===0?t:(Array.isArray(this.value)?this.value.forEach(function(e){e.join(t,n),n+=e.length}):(typeof this.value=="number"?t[n]=this.value:typeof this.value=="string"?t.write(this.value,n):s.isBuffer(this.value)&&this.value.copy(t,n),n+=this.length),t)}},{"../base":158,buffer:88,inherits:285}],158:[function(e,t,n){var r=n;r.Reporter=e("./reporter").Reporter,r.DecoderBuffer=e("./buffer").DecoderBuffer,r.EncoderBuffer=e("./buffer").EncoderBuffer,r.Node=e("./node")},{"./buffer":157,"./node":159,"./reporter":160}],159:[function(e,t,n){function f(e,t){var n={};this._baseState=n,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n["default"]=null,n.explicit=null,n.implicit=null,n.parent||(n.children=[],this._wrap())}var r=e("../base").Reporter,i=e("../base").EncoderBuffer,s=e("minimalistic-assert"),o=["seq","seqof","set","setof","octstr","bitstr","objid","bool","gentime","utctime","null_","enum","int","ia5str","utf8str","bmpstr","numstr","printstr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any"].concat(o),a=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];t.exports=f;var l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit"];f.prototype.clone=function(){var t=this._baseState,n={};l.forEach(function(e){n[e]=t[e]});var r=new this.constructor(n.parent);return r._baseState=n,r},f.prototype._wrap=function(){var t=this._baseState;u.forEach(function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}},this)},f.prototype._init=function(t){var n=this._baseState;s(n.parent===null),t.call(this),n.children=n.children.filter(function(e){return e._baseState.parent===this},this),s.equal(n.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(t){var n=this._baseState,r=t.filter(function(e){return e instanceof this.constructor},this);t=t.filter(function(e){return!(e instanceof this.constructor)},this),r.length!==0&&(s(n.children===null),n.children=r,r.forEach(function(e){e._baseState.parent=this},this)),t.length!==0&&(s(n.args===null),n.args=t,n.reverseArgs=t.map(function(e){if(typeof e!="object"||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(n){n==(n|0)&&(n|=0);var r=e[n];t[r]=n}),t}))},a.forEach(function(e){f.prototype[e]=function(){var n=this._baseState;throw new Error(e+" not implemented for encoding: "+n.enc)}}),o.forEach(function(e){f.prototype[e]=function(){var n=this._baseState,r=Array.prototype.slice.call(arguments);return s(n.tag===null),n.tag=e,this._useArgs(r),this}}),f.prototype.use=function(t){var n=this._baseState;return s(n.use===null),n.use=t,this},f.prototype.optional=function(){var t=this._baseState;return t.optional=!0,this},f.prototype.def=function(t){var n=this._baseState;return s(n["default"]===null),n["default"]=t,n.optional=!0,this},f.prototype.explicit=function(t){var n=this._baseState;return s(n.explicit===null&&n.implicit===null),n.explicit=t,this},f.prototype.implicit=function(t){var n=this._baseState;return s(n.explicit===null&&n.implicit===null),n.implicit=t,this},f.prototype.obj=function(){var t=this._baseState,n=Array.prototype.slice.call(arguments);return t.obj=!0,n.length!==0&&this._useArgs(n),this},f.prototype.key=function(t){var n=this._baseState;return s(n.key===null),n.key=t,this},f.prototype.any=function(){var t=this._baseState;return t.any=!0,this},f.prototype.choice=function(t){var n=this._baseState;return s(n.choice===null),n.choice=t,this._useArgs(Object.keys(t).map(function(e){return t[e]})),this},f.prototype._decode=function(t){var n=this._baseState;if(n.parent===null)return t.wrapResult(n.children[0]._decode(t));var r=n["default"],i=!0,s;n.key!==null&&(s=t.enterKey(n.key));if(n.optional){var o=null;n.explicit!==null?o=n.explicit:n.implicit!==null?o=n.implicit:n.tag!==null&&(o=n.tag);if(o===null&&!n.any){var u=t.save();try{n.choice===null?this._decodeGeneric(n.tag,t):this._decodeChoice(t),i=!0}catch(a){i=!1}t.restore(u)}else{i=this._peekTag(t,o,n.any);if(t.isError(i))return i}}var f;n.obj&&i&&(f=t.enterObject());if(i){if(n.explicit!==null){var l=this._decodeTag(t,n.explicit);if(t.isError(l))return l;t=l}if(n.use===null&&n.choice===null){if(n.any)var u=t.save();var c=this._decodeTag(t,n.implicit!==null?n.implicit:n.tag,n.any);if(t.isError(c))return c;n.any?r=t.raw(u):t=c}n.any?r=r:n.choice===null?r=this._decodeGeneric(n.tag,t):r=this._decodeChoice(t);if(t.isError(r))return r;if(!n.any&&n.choice===null&&n.children!==null){var h=n.children.some(function(n){n._decode(t)});if(h)return err}}return n.obj&&i&&(r=t.leaveObject(f)),n.key!==null&&(r!==null||i===!0)&&t.leaveKey(s,n.key,r),r},f.prototype._decodeGeneric=function(t,n){var r=this._baseState;return t==="seq"||t==="set"?null:t==="seqof"||t==="setof"?this._decodeList(n,t,r.args[0]):t==="octstr"||t==="bitstr"?this._decodeStr(n,t):t==="ia5str"||t==="utf8str"||t==="bmpstr"?this._decodeStr(n,t):t==="numstr"||t==="printstr"?this._decodeStr(n,t):t==="objid"&&r.args?this._decodeObjid(n,r.args[0],r.args[1]):t==="objid"?this._decodeObjid(n,null,null):t==="gentime"||t==="utctime"?this._decodeTime(n,t):t==="null_"?this._decodeNull(n):t==="bool"?this._decodeBool(n):t==="int"||t==="enum"?this._decodeInt(n,r.args&&r.args[0]):r.use!==null?this._getUse(r.use,n._reporterState.obj)._decode(n):n.error("unknown tag: "+t)},f.prototype._getUse=function(t,n){var r=this._baseState;return r.useDecoder=this._use(t,n),s(r.useDecoder._baseState.parent===null),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},f.prototype._decodeChoice=function(t){var n=this._baseState,r=null,i=!1;return Object.keys(n.choice).some(function(e){var s=t.save(),o=n.choice[e];try{var u=o._decode(t);if(t.isError(u))return!1;r={type:e,value:u},i=!0}catch(a){return t.restore(s),!1}return!0},this),i?r:t.error("Choice not matched")},f.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},f.prototype._encode=function(t,n,r){var i=this._baseState;if(i["default"]!==null&&i["default"]===t)return;var s=this._encodeValue(t,n,r);if(s===undefined)return;if(this._skipDefault(s,n,r))return;return s},f.prototype._encodeValue=function(t,n,i){var s=this._baseState;if(s.parent===null)return s.children[0]._encode(t,n||new r);var o=null,u=!0;this.reporter=n;if(s.optional&&t===undefined){if(s["default"]===null)return;t=s["default"]}var a,f=null,l=!1;if(s.any)o=this._createEncoderBuffer(t);else if(s.choice)o=this._encodeChoice(t,n);else if(s.children)f=s.children.map(function(e){if(e._baseState.tag==="null_")return e._encode(null,n,t);if(e._baseState.key===null)return n.error("Child should have a key");var r=n.enterKey(e._baseState.key);if(typeof t!="object")return n.error("Child expected, but input is not object");var i=e._encode(t[e._baseState.key],n,t);return n.leaveKey(r),i},this).filter(function(e){return e}),f=this._createEncoderBuffer(f);else if(s.tag==="seqof"||s.tag==="setof"){if(!s.args||s.args.length!==1)return n.error("Too many args for : "+s.tag);if(!Array.isArray(t))return n.error("seqof/setof, but data is not Array");var c=this.clone();c._baseState.implicit=null,f=this._createEncoderBuffer(t.map(function(e){var r=this._baseState;return this._getUse(r.args[0],t)._encode(e,n)},c))}else s.use!==null?o=this._getUse(s.use,i)._encode(t,n):(f=this._encodePrimitive(s.tag,t),l=!0);var o;if(!s.any&&s.choice===null){var h=s.implicit!==null?s.implicit:s.tag,p=s.implicit===null?"universal":"context";h===null?s.use===null&&n.error("Tag could be ommited only for .use()"):s.use===null&&(o=this._encodeComposite(h,l,p,f))}return s.explicit!==null&&(o=this._encodeComposite(s.explicit,!1,"context",o)),o},f.prototype._encodeChoice=function(t,n){var r=this._baseState,i=r.choice[t.type];return i||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(t.value,n)},f.prototype._encodePrimitive=function(t,n){var r=this._baseState;if(t==="octstr"||t==="bitstr"||t==="ia5str")return this._encodeStr(n,t);if(t==="utf8str"||t==="bmpstr")return this._encodeStr(n,t);if(t==="numstr"||t==="printstr")return this._encodeStr(n,t);if(t==="objid"&&r.args)return this._encodeObjid(n,r.reverseArgs[0],r.args[1]);if(t==="objid")return this._encodeObjid(n,null,null);if(t==="gentime"||t==="utctime")return this._encodeTime(n,t);if(t==="null_")return this._encodeNull();if(t==="int"||t==="enum")return this._encodeInt(n,r.args&&r.reverseArgs[0]);if(t==="bool")return this._encodeBool(n);throw new Error("Unsupported tag: "+t)},f.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},f.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}},{"../base":158,"minimalistic-assert":169}],160:[function(e,t,n){function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function s(e,t){this.path=e,this.rethrow(t)}var r=e("inherits");n.Reporter=i,i.prototype.isError=function(t){return t instanceof s},i.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){var n=this._reporterState;n.obj=t.obj,n.path=n.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.leaveKey=function(t,n,r){var i=this._reporterState;i.path=i.path.slice(0,t-1),i.obj!==null&&(i.obj[n]=r)},i.prototype.enterObject=function(){var t=this._reporterState,n=t.obj;return t.obj={},n},i.prototype.leaveObject=function(t){var n=this._reporterState,r=n.obj;return n.obj=t,r},i.prototype.error=function(t){var n,r=this._reporterState,i=t instanceof s;i?n=t:n=new s(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),t.message||t,t.stack);if(!r.options.partial)throw n;return i||r.errors.push(n),n},i.prototype.wrapResult=function(t){var n=this._reporterState;return n.options.partial?{result:this.isError(t)?null:t,errors:n.errors}:t},r(s,Error),s.prototype.rethrow=function(t){return this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace(this,s),this}},{inherits:285}],161:[function(e,t,n){var r=e("../constants");n.tagClass={0:"universal",1:"application",2:"context",3:"private"},n.tagClassByName=r._reverse(n.tagClass),n.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},n.tagByName=r._reverse(n.tag)},{"../constants":162}],162:[function(e,t,n){var r=n;r._reverse=function(t){var n={};return Object.keys(t).forEach(function(e){(e|0)==e&&(e|=0);var r=t[e];n[r]=e}),n},r.der=e("./der")},{"./der":161}],163:[function(e,t,n){function a(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new f,this.tree._init(e.body)}function f(e){s.Node.call(this,"der",e)}function l(e,t){var n=e.readUInt8(t);if(e.isError(n))return n;var r=u.tagClass[n>>6],i=(n&32)===0;if((n&31)===31){var s=n;n=0;while((s&128)===128){s=e.readUInt8(t);if(e.isError(s))return s;n<<=7,n|=s&127}}else n&=31;var o=u.tag[n];return{cls:r,primitive:i,tag:n,tagStr:o}}function c(e,t,n){var r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&r===128)return null;if((r&128)===0)return r;var i=r&127;if(i>=4)return e.error("length octect is too long");r=0;for(var s=0;s=31?r.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=a.tagClassByName[n||"universal"]<<6,i)}var r=e("inherits"),i=e("buffer").Buffer,s=e("../../asn1"),o=s.base,u=s.bignum,a=s.constants.der;t.exports=f,f.prototype.encode=function(t,n){return this.tree._encode(t,n).join()},r(l,o.Node),l.prototype._encodeComposite=function(t,n,r,s){var o=h(t,n,r,this.reporter);if(s.length<128){var u=new i(2);return u[0]=o,u[1]=s.length,this._createEncoderBuffer([u,s])}var a=1;for(var f=s.length;f>=256;f>>=8)a++;var u=new i(2+a);u[0]=o,u[1]=128|a;for(var f=1+a,l=s.length;l>0;f--,l>>=8)u[f]=l&255;return this._createEncoderBuffer([u,s])},l.prototype._encodeStr=function(t,n){if(n==="octstr")return this._createEncoderBuffer(t);if(n==="bitstr")return this._createEncoderBuffer([t.unused|0,t.data]);if(n==="ia5str"||n==="utf8str")return this._createEncoderBuffer(t);if(n==="bmpstr"){var r=new i(t.length*2);for(var s=0;s=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,t[0]*40+t[1])}var o=0;for(var s=0;s=128;u>>=7)o++}var a=new i(o),f=a.length-1;for(var s=t.length-1;s>=0;s--){var u=t[s];a[f--]=u&127;while((u>>=7)>0)a[f--]=128|u&127}return this._createEncoderBuffer(a)},l.prototype._encodeTime=function(t,n){var r,i=new Date(t);return n==="gentime"?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):n==="utctime"?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+n+" time is not supported yet"),this._encodeStr(r,"octstr")},l.prototype._encodeNull=function(){return this._createEncoderBuffer("")},l.prototype._encodeInt=function(t,n){if(typeof t=="string"){if(!n)return this.reporter.error("String int or enum given, but no values map");if(!n.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=n[t]}if(typeof t!="number"&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&r[0]&128&&r.unshift(0),t=new i(r)}if(i.isBuffer(t)){var s=t.length;t.length===0&&s++;var o=new i(s);return t.copy(o),t.length===0&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);var s=1;for(var u=t;u>=256;u>>=8)s++;var o=new Array(s);for(var u=o.length-1;u>=0;u--)o[u]=t&255,t>>=8;return o[0]&128&&o.unshift(0),this._createEncoderBuffer(new i(o))},l.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},l.prototype._use=function(t,n){return typeof t=="function"&&(t=t(n)),t._getEncoder("der").tree},l.prototype._skipDefault=function(t,n,r){var i=this._baseState,s;if(i["default"]===null)return!1;var o=t.join();i.defaultBuffer===undefined&&(i.defaultBuffer=this._encodeValue(i["default"],n,r).join());if(o.length!==i.defaultBuffer.length)return!1;for(s=0;s0&&n.ishrn(r),n}function m(e,t){e=v(e,t),e=e.mod(t);var r=new n(e.toArray());if(r.length=t)throw new Error("invalid sig")}var r=e("./curves"),i=e("elliptic"),s=e("parse-asn1"),o=e("bn.js"),u=i.ec;t.exports=a}).call(this,e("buffer").Buffer)},{"./curves":124,"bn.js":125,buffer:88,elliptic:127,"parse-asn1":154}],190:[function(e,t,n){(function(n){function o(e){this.curveType=s[e],this.curveType||(this.curveType={name:e}),this.curve=new r.ec(this.curveType.name),this.keys=void 0}function u(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new n(e);if(r&&i.length>5]|=128<>>9<<4)+14]=t;var n=1732584193,r=-271733879,i=-1732584194,s=271733878;for(var c=0;c>16)+(t>>16)+(n>>16);return r<<16|n&65535}function c(e,t){return e<>>32-t}var r=e("./helpers");t.exports=function(t){return r.hash(t,i,16)}},{"./helpers":217}],219:[function(e,t,n){arguments[4][109][0].apply(n,arguments)},{buffer:88,dup:109,inherits:285,stream:302,string_decoder:303}],220:[function(e,t,n){(function(e){function a(e){var t=[];for(var n=0,r=0;n>>5]|=e[n]<<24-r%32;return t}function f(e){var t=[];for(var n=0;n>>5]>>>24-n%32&255);return t}function l(e,t,a){for(var f=0;f<16;f++){var l=a+f,g=t[l];t[l]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}var y,b,w,E,S,x,T,N,C,k;x=y=e[0],T=b=e[1],N=w=e[2],C=E=e[3],k=S=e[4];var L;for(f=0;f<80;f+=1)L=y+t[a+n[f]]|0,f<16?L+=c(b,w,E)+o[0]:f<32?L+=h(b,w,E)+o[1]:f<48?L+=p(b,w,E)+o[2]:f<64?L+=d(b,w,E)+o[3]:L+=v(b,w,E)+o[4],L|=0,L=m(L,i[f]),L=L+S|0,y=S,S=E,E=m(w,10),w=b,b=L,L=x+t[a+r[f]]|0,f<16?L+=v(T,N,C)+u[0]:f<32?L+=d(T,N,C)+u[1]:f<48?L+=p(T,N,C)+u[2]:f<64?L+=h(T,N,C)+u[3]:L+=c(T,N,C)+u[4],L|=0,L=m(L,s[f]),L=L+k|0,x=k,k=C,C=m(N,10),N=T,T=L;L=e[1]+w+C|0,e[1]=e[2]+E+k|0,e[2]=e[3]+S+x|0,e[3]=e[4]+y+T|0,e[4]=e[0]+b+N|0,e[0]=L}function c(e,t,n){return e^t^n}function h(e,t,n){return e&t|~e&n}function p(e,t,n){return(e|~t)^n}function d(e,t,n){return e&n|t&~n}function v(e,t,n){return e^(t|~n)}function m(e,t){return e<>>32-t}function g(t){var n=[1732584193,4023233417,2562383102,271733878,3285377520];typeof t=="string"&&(t=new e(t,"utf8"));var r=a(t),i=t.length*8,s=t.length*8;r[i>>>5]|=128<<24-i%32,r[(i+64>>>9<<4)+14]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360;for(var o=0;o>>24)&16711935|(u<<24|u>>>8)&4278255360}var c=f(n);return new e(c)}var n=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],r=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],i=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],s=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],o=[0,1518500249,1859775393,2400959708,2840853838],u=[1352829926,1548603684,1836072691,2053994217,0];t.exports=g}).call(this,e("buffer").Buffer)},{buffer:88}],221:[function(e,t,n){(function(e){function n(t,n){this._block=new e(t),this._finalSize=n,this._blockSize=t,this._len=0,this._s=0}n.prototype.update=function(t,n){typeof t=="string"&&(n=n||"utf8",t=new e(t,n));var r=this._len+=t.length,i=this._s||0,s=0,o=this._block;while(i=this._finalSize*8&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(t,this._blockSize-4);var n=this._update(this._block)||this._hash();return e?n.toString(e):n},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n}).call(this,e("buffer").Buffer)},{buffer:88}],222:[function(e,t,n){var n=t.exports=function(t){t=t.toLowerCase();var r=n[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};n.sha=e("./sha"),n.sha1=e("./sha1"),n.sha224=e("./sha224"),n.sha256=e("./sha256"),n.sha384=e("./sha384"),n.sha512=e("./sha512")},{"./sha":223,"./sha1":224,"./sha224":225,"./sha256":226,"./sha384":227,"./sha512":228}],223:[function(e,t,n){(function(n){function o(){this.init(),this._w=s,i.call(this,64,56)}function u(e,t){return e<>>32-t}var r=e("inherits"),i=e("./hash"),s=new Array(80);r(o,i),o.prototype.init=function(){return this._a=1732584193,this._b=-271733879,this._c=-1732584194,this._d=271733878,this._e=-1009589776,this},o.prototype._update=function(e){function l(){return t[a-3]^t[a-8]^t[a-14]^t[a-16]}function c(e,l){t[a]=e;var c=u(n,5)+l+o+e+f;o=s,s=i,i=u(r,30),r=n,n=c,a++}var t=this._w,n=this._a,r=this._b,i=this._c,s=this._d,o=this._e,a=0,f;f=1518500249;while(a<16)c(e.readInt32BE(a*4),r&i|~r&s);while(a<20)c(l(),r&i|~r&s);f=1859775393;while(a<40)c(l(),r^i^s);f=-1894007588;while(a<60)c(l(),r&i|r&s|i&s);f=-899497514;while(a<80)c(l(),r^i^s);this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0},o.prototype._hash=function(){var e=new n(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e},t.exports=o}).call(this,e("buffer").Buffer)},{"./hash":221,buffer:88,inherits:285}],224:[function(e,t,n){(function(n){function o(){this.init(),this._w=s,i.call(this,64,56)}function u(e,t){return e<>>32-t}var r=e("inherits"),i=e("./hash"),s=new Array(80);r(o,i),o.prototype.init=function(){return this._a=1732584193,this._b=-271733879,this._c=-1732584194,this._d=271733878,this._e=-1009589776,this},o.prototype._update=function(e){function l(){return u(t[a-3]^t[a-8]^t[a-14]^t[a-16],1)}function c(e,l){t[a]=e;var c=u(n,5)+l+o+e+f;o=s,s=i,i=u(r,30),r=n,n=c,a++}var t=this._w,n=this._a,r=this._b,i=this._c,s=this._d,o=this._e,a=0,f;f=1518500249;while(a<16)c(e.readInt32BE(a*4),r&i|~r&s);while(a<20)c(l(),r&i|~r&s);f=1859775393;while(a<40)c(l(),r^i^s);f=-1894007588;while(a<60)c(l(),r&i|r&s|i&s);f=-899497514;while(a<80)c(l(),r^i^s);this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0},o.prototype._hash=function(){var e=new n(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e},t.exports=o}).call(this,e("buffer").Buffer)},{"./hash":221,buffer:88,inherits:285}],225:[function(e,t,n){(function(n){function u(){this.init(),this._w=o,s.call(this,64,56)}var r=e("inherits"),i=e("./sha256"),s=e("./hash"),o=new Array(64);r(u,i),u.prototype.init=function(){return this._a=-1056596264,this._b=914150663,this._c=812702999,this._d=-150054599,this._e=-4191439,this._f=1750603025,this._g=1694076839,this._h=-1090891868,this},u.prototype._hash=function(){var e=new n(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=u}).call(this,e("buffer").Buffer)},{"./hash":221,"./sha256":226,buffer:88,inherits:285}],226:[function(e,t,n){(function(n){function u(){this.init(),this._w=o,i.call(this,64,56)}function a(e,t,n){return n^e&(t^n)}function f(e,t,n){return e&t|n&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function c(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function p(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var r=e("inherits"),i=e("./hash"),s=[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],o=new Array(64);r(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){function y(){return p(t[g-2])+t[g-7]+h(t[g-15])+t[g-16]}function b(e){t[g]=e;var h=m+c(u)+a(u,d,v)+s[g]+e,p=l(n)+f(n,r,i);m=v,v=d,d=u,u=o+h,o=i,i=r,r=n,n=h+p,g++}var t=this._w,n=this._a|0,r=this._b|0,i=this._c|0,o=this._d|0,u=this._e|0,d=this._f|0,v=this._g|0,m=this._h|0,g=0;while(g<16)b(e.readInt32BE(g*4));while(g<64)b(y());this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=u+this._e|0,this._f=d+this._f|0,this._g=v+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=new n(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=u}).call(this,e("buffer").Buffer)},{"./hash":221,buffer:88,inherits:285}],227:[function(e,t,n){(function(n){function u(){this.init(),this._w=o,s.call(this,128,112)}var r=e("inherits"),i=e("./sha512"),s=e("./hash"),o=new Array(160);r(u,i),u.prototype.init=function(){return this._a=-876896931,this._b=1654270250,this._c=-1856437926,this._d=355462360,this._e=1731405415,this._f=-1900787065,this._g=-619958771,this._h=1203062813,this._al=-1056596264,this._bl=914150663,this._cl=812702999,this._dl=-150054599,this._el=-4191439,this._fl=1750603025,this._gl=1694076839,this._hl=-1090891868,this},u.prototype._hash=function(){function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}var e=new n(48);return t(this._a,this._al,0),t(this._b,this._bl,8),t(this._c,this._cl,16),t(this._d,this._dl,24),t(this._e,this._el,32),t(this._f,this._fl,40),e},t.exports=u}).call(this,e("buffer").Buffer)},{"./hash":221,"./sha512":228,buffer:88,inherits:285}],228:[function(e,t,n){(function(n){function u(){this.init(),this._w=o,i.call(this,128,112)}function a(e,t,n){return n^e&(t^n)}function f(e,t,n){return e&t|n&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function c(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function d(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}var r=e("inherits"),i=e("./hash"),s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],o=new Array(160);r(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this._al=-205731576,this._bl=-2067093701,this._cl=-23791573,this._dl=1595750129,this._el=-1377402159,this._fl=725511199,this._gl=-79577749,this._hl=327033209,this},u.prototype._update=function(e){function M(){var e=t[L-30],n=t[L-30+1],r=h(e,n),i=p(n,e);e=t[L-4],n=t[L-4+1];var s=d(e,n),o=v(n,e),u=t[L-14],a=t[L-14+1],f=t[L-32],l=t[L-32+1];O=i+a,A=r+u+(O>>>0>>0?1:0),O+=o,A=A+s+(O>>>0>>0?1:0),O+=l,A=A+f+(O>>>0>>0?1:0)}function _(){t[L]=A,t[L+1]=O;var e=f(n,r,i),h=f(b,w,E),p=l(n,b),d=l(b,n),v=c(u,x),M=c(x,u),_=s[L],D=s[L+1],P=a(u,m,g),H=a(x,T,N),B=C+M,F=y+v+(B>>>0>>0?1:0);B+=H,F=F+P+(B>>>0>>0?1:0),B+=D,F=F+_+(B>>>0>>0?1:0),B+=O,F=F+A+(B>>>0>>0?1:0);var I=d+h,q=p+e+(I>>>0>>0?1:0);y=g,C=N,g=m,N=T,m=u,T=x,x=S+B|0,u=o+F+(x>>>0>>0?1:0)|0,o=i,S=E,i=r,E=w,r=n,w=b,b=B+I|0,n=F+q+(b>>>0>>0?1:0)|0,k++,L+=2}var t=this._w,n=this._a|0,r=this._b|0,i=this._c|0,o=this._d|0,u=this._e|0,m=this._f|0,g=this._g|0,y=this._h|0,b=this._al|0,w=this._bl|0,E=this._cl|0,S=this._dl|0,x=this._el|0,T=this._fl|0,N=this._gl|0,C=this._hl|0,k=0,L=0,A,O;while(k<16)A=e.readInt32BE(L*4),O=e.readInt32BE(L*4+4),_();while(k<80)M(),_();this._al=this._al+b|0,this._bl=this._bl+w|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+x|0,this._fl=this._fl+T|0,this._gl=this._gl+N|0,this._hl=this._hl+C|0,this._a=this._a+n+(this._al>>>0>>0?1:0)|0,this._b=this._b+r+(this._bl>>>0>>0?1:0)|0,this._c=this._c+i+(this._cl>>>0>>0?1:0)|0,this._d=this._d+o+(this._dl>>>0>>0?1:0)|0,this._e=this._e+u+(this._el>>>0>>0?1:0)|0,this._f=this._f+m+(this._fl>>>0>>0?1:0)|0,this._g=this._g+g+(this._gl>>>0>>0?1:0)|0,this._h=this._h+y+(this._hl>>>0>>0?1:0)|0},u.prototype._hash=function(){function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}var e=new n(64);return t(this._a,this._al,0),t(this._b,this._bl,8),t(this._c,this._cl,16),t(this._d,this._dl,24),t(this._e,this._el,32),t(this._f,this._fl,40),t(this._g,this._gl,48),t(this._h,this._hl,56),e},t.exports=u}).call(this,e("buffer").Buffer)},{"./hash":221,buffer:88,inherits:285}],229:[function(e,t,n){(function(n){"use strict";function u(e,t){s.call(this),e=e.toLowerCase(),typeof t=="string"&&(t=new n(t));var i=e==="sha512"||e==="sha384"?128:64;this._alg=e,this._key=t,t.length>i?t=r(e).update(t).digest():t.lengthe)n.ishrn(1);n.isEven()&&n.iadd(a),n.testn(1)||n.iadd(f);if(!t.cmp(f))while(n.mod(s).cmp(m))n.iadd(g);else if(!t.cmp(l))while(n.mod(p).cmp(d))n.iadd(g);o=n.shrn(1);if(E(o)&&E(n)&&S(o)&&S(n)&&u.test(o)&&u.test(n))return n}}var r=e("randombytes");t.exports=x,x.simpleSieve=E,x.fermatTest=S;var i=e("bn.js"),s=new i(24),o=e("miller-rabin"),u=new o,a=new i(1),f=new i(2),l=new i(5),c=new i(16),h=new i(8),p=new i(10),d=new i(3),v=new i(7),m=new i(11),g=new i(4),y=new i(12),b=null},{"bn.js":234,"miller-rabin":235,randombytes:283}],233:[function(e,t,n){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],234:[function(e,t,n){arguments[4][125][0].apply(n,arguments)},{dup:125}],235:[function(e,t,n){function s(e){this.rand=e||new i.Rand}var r=e("bn.js"),i=e("brorand");t.exports=s,s.create=function(t){return new s(t)},s.prototype._rand=function(t){var n=t.bitLength(),i=this.rand.generate(Math.ceil(n/8));i[0]|=3;var s=n&7;return s!==0&&(i[i.length-1]>>=7-s),new r(i)},s.prototype.test=function(t,n,i){var s=t.bitLength(),o=r.mont(t),u=(new r(1)).toRed(o);n||(n=Math.max(1,s/48|0));var a=t.subn +(1),f=a.subn(1);for(var l=0;!a.testn(l);l++);var c=t.shrn(l),h=a.toRed(o),p=!0;for(;n>0;n--){var d=this._rand(f);i&&i(d);var v=d.toRed(o).redPow(c);if(v.cmp(u)===0||v.cmp(h)===0)continue;for(var m=1;m0;n--){var h=this._rand(a),p=t.gcd(h);if(p.cmpn(1)!==0)return p;var d=h.toRed(s).redPow(l);if(d.cmp(o)===0||d.cmp(c)===0)continue;for(var v=1;vi)throw new TypeError("Bad key length");u=u||"sha1",t.isBuffer(e)||(e=new t(e,"binary")),t.isBuffer(n)||(n=new t(n,"binary"));var a,f=1,l=new t(o),c=new t(n.length+4);n.copy(c,0,0,n.length);var h,p;for(var d=1;d<=f;d++){c.writeUInt32BE(d,n.length);var v=r(u,e).update(c).digest();a||(a=v.length,p=new t(a),f=Math.ceil(o/a),h=o-(f-1)*a),v.copy(p,0,0,a);for(var m=1;m=t.length){s++;break}var o=t.slice(2,i-1),u=t.slice(i-1,i);(r.toString("hex")!=="0002"&&!n||r.toString("hex")!=="0001"&&n)&&s++,o.length<8&&s++;if(s)throw new Error("decryption error");return t.slice(i)}function h(e,t){e=new n(e),t=new n(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var s=-1;while(++sp||(new o(i)).cmp(h.modulus)>=0)throw new Error("decryption error");var d;s?d=f(new o(i),h):d=u(i,h);var v=new n(p-d.length);v.fill(0),d=n.concat([v,d],p);if(a===4)return l(h,d);if(a===1)return c(h,d,s);if(a===3)return d;throw new Error("unknown padding")}}).call(this,e("buffer").Buffer)},{"./mgf":239,"./withPublic":281,"./xor":282,"bn.js":240,"browserify-rsa":241,buffer:88,"create-hash":216,"parse-asn1":245}],280:[function(e,t,n){(function(n){function h(e,t){var r=e.modulus.byteLength(),f=t.length,l=s("sha1").update(new n("")).digest(),c=l.length,h=2*c;if(f>r-h-2)throw new Error("message too long");var p=new n(r-f-h-2);p.fill(0);var d=r-c-1,v=i(c),m=u(n.concat([l,p,new n([1]),t],d),o(v,d)),g=u(v,o(m,c));return new a(n.concat([new n([0]),g,m],r))}function p(e,t,r){var i=t.length,s=e.modulus.byteLength();if(i>s-11)throw new Error("message too long");var o;return r?(o=new n(s-i-3),o.fill(255)):o=d(s-i-3),new a(n.concat([new n([0,r?1:2]),o,new n([0]),t],s))}function d(e,t){var r=new n(e),s=0,o=i(e*2),u=0,a;while(s=0)throw new Error("data too long for modulus")}return i?l(u,o):f(u,o)}}).call(this,e("buffer").Buffer)},{"./mgf":239,"./withPublic":281,"./xor":282,"bn.js":240,"browserify-rsa":241,buffer:88,"create-hash":216,"parse-asn1":245,randombytes:283}],281:[function(e,t,n){(function(n){function i(e,t){return new n(e.toRed(r.mont(t.modulus)).redPow(new r(t.publicExponent)).fromRed().toArray())}var r=e("bn.js");t.exports=i}).call(this,e("buffer").Buffer)},{"bn.js":240,buffer:88}],282:[function(e,t,n){t.exports=function(t,n){var r=t.length,i=-1;while(++i65536)throw new Error("requested too many random bytes");var o=new n.Uint8Array(t);s.getRandomValues(o);var u=new r(o.buffer);return typeof i=="function"?e.nextTick(function(){i(null,u)}):u}var s=n.crypto||n.msCrypto;s&&s.getRandomValues?t.exports=o:t.exports=i}).call(this,e("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},e("buffer").Buffer)},{_process:288,buffer:88}],284:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||undefined}function i(e){return typeof e=="function"}function s(e){return typeof e=="number"}function o(e){return typeof e=="object"&&e!==null}function u(e){return e===void 0}t.exports=r,r.EventEmitter=r,r.prototype._events=undefined,r.prototype._maxListeners=undefined,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!s(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,s,a,f;this._events||(this._events={});if(e==="error")if(!this._events.error||o(this._events.error)&&!this._events.error.length)throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');n=this._events[e];if(u(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n)){s=Array.prototype.slice.call(arguments,1),f=n.slice(),r=f.length;for(a=0;a0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var n=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var n,r,s,u;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;n=this._events[e],s=n.length,r=-1;if(n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(u=s;u-->0;)if(n[u]===t||n[u].listener&&n[u].listener===t){r=u;break}if(r<0)return this;n.length===1?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}return this.removeAllListeners("removeListener"),this._events={},this}n=this._events[e];if(i(n))this.removeListener(e,n);else if(n)while(n.length)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return!this._events||!this._events[e]?t=[]:i(this._events[e])?t=[this._events[e]]:t=this._events[e].slice(),t},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],285:[function(e,t,n){typeof Object.create=="function"?t.exports=function(t,n){t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],286:[function(e,t,n){t.exports=function(e){return e!=null&&!!(e._isBuffer||e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))}},{}],287:[function(e,t,n){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],288:[function(e,t,n){function a(){s=!1,o.length?i=o.concat(i):u=-1,i.length&&f()}function f(){if(s)return;var e=setTimeout(a);s=!0;var t=i.length;while(t){o=i,i=[];while(++u1)for(var n=1;n0)if(t.ended&&!i){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&i){var o=new Error("stream.unshift() after end event");e.emit("error",o)}else t.decoder&&!i&&!r&&(n=t.decoder.write(n)),i||(t.reading=!1),t.flowing&&t.length===0&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&x(e)),N(e,t);else i||(t.reading=!1);return g(t)}function g(e){return!e.ended&&(e.needReadable||e.length=y?e=y:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function w(e,t){return t.length===0&&t.ended?0:t.objectMode?e===0?0:1:e===null||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=b(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function E(e,t){var n=null;return!s.isBuffer(t)&&typeof t!="string"&&t!==null&&t!==undefined&&!e.objectMode&&(n=new TypeError("Invalid non-string/buffer chunk")),n}function S(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,x(e)}function x(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?r(T,e):T(e))}function T(e){c("emit readable"),e.emit("readable"),M(e)}function N(e,t){t.readingMore||(t.readingMore=!0,r(C,e,t))}function C(e,t){var n=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=r)i?u=n.join(""):n.length===1?u=n[0]:u=s.concat(n,r),n.length=0;else if(e0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,r(P,t,e))}function P(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function H(e,t){for(var n=0,r=e.length;n0)t.emittedReadable=!1;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return c("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?D(this):x(this),null;e=w(e,t);if(e===0&&t.ended)return t.length===0&&D(this),null;var r=t.needReadable;c("need readable",r);if(t.length===0||t.length-e0?i=_(e,t):i=null,i===null&&(t.needReadable=!0,e=0),t.length-=e,t.length===0&&!t.ended&&(t.needReadable=!0),n!==e&&t.ended&&t.length===0&&D(this),i!==null&&this.emit("data",i),i},v.prototype._read=function(e){this.emit("error",new Error("not implemented"))},v.prototype.pipe=function(e,t){function l(e){c("onunpipe"),e===s&&v()}function h(){c("onend"),e.end()}function v(){c("cleanup"),e.removeListener("close",y),e.removeListener("finish",b),e.removeListener("drain",p),e.removeListener("error",g),e.removeListener("unpipe",l),s.removeListener("end",h),s.removeListener("end",v),s.removeListener("data",m),d=!0,o.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&p()}function m(t){c("ondata");var n=e.write(t);!1===n&&(o.pipesCount===1&&o.pipes[0]===e&&s.listenerCount("data")===1&&!d&&(c("false write response, pause",s._readableState.awaitDrain),s._readableState.awaitDrain++),s.pause())}function g(t){c("onerror",t),w(),e.removeListener("error",g),u(e,"error")===0&&e.emit("error",t)}function y(){e.removeListener("finish",b),w()}function b(){c("onfinish"),e.removeListener("close",y),w()}function w(){c("unpipe"),s.unpipe(e)}var s=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,c("pipe count=%d opts=%j",o.pipesCount,t);var a=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,f=a?h:v;o.endEmitted?r(f):s.once("end",f),e.on("unpipe",l);var p=k(s);e.on("drain",p);var d=!1;return s.on("data",m),!e._events||!e._events.error?e.on("error",g):i(e._events.error)?e._events.error.unshift(g):e._events.error=[g,e._events.error],e.once("close",y),e.once("finish",b),e.emit("pipe",s),o.flowing||(c("pipe resume"),s.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+t);this._writableState.defaultEncoding=t},h.prototype._write=function(e,t,n){n(new Error("not implemented"))},h.prototype._writev=null,h.prototype.end=function(e,t,n){var r=this._writableState;typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null),e!==null&&e!==undefined&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),!r.ending&&!r.finished&&k(this,r,n)}},{"./_stream_duplex":290,buffer:88,"core-util-is":295,events:284,inherits:285,"process-nextick-args":296,"util-deprecate":297}],295:[function(e,t,n){(function(e){function t(e){return Array.isArray?Array.isArray(e):m(e)==="[object Array]"}function r(e){return typeof e=="boolean"}function i(e){return e===null}function s(e){return e==null}function o(e){return typeof e=="number"}function u(e){return typeof e=="string"}function a(e){return typeof e=="symbol"}function f(e){return e===void 0}function l(e){return m(e)==="[object RegExp]"}function c(e){return typeof e=="object"&&e!==null}function h(e){return m(e)==="[object Date]"}function p(e){return m(e)==="[object Error]"||e instanceof Error}function d(e){return typeof e=="function"}function v(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e=="undefined"}function m(e){return Object.prototype.toString.call(e)}n.isArray=t,n.isBoolean=r,n.isNull=i,n.isNullOrUndefined=s,n.isNumber=o,n.isString=u,n.isSymbol=a,n.isUndefined=f,n.isRegExp=l,n.isObject=c,n.isDate=h,n.isError=p,n.isFunction=d,n.isPrimitive=v,n.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../../../insert-module-globals/node_modules/is-buffer/index.js")})},{"../../../../insert-module-globals/node_modules/is-buffer/index.js":286}],296:[function(e,t,n){(function(e){"use strict";function n(t){var n=new Array(arguments.length-1),r=0;while(r=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n;if(this.charReceived=55296&&r<=56319){this.charLength+=this.surrogateSize,t="";continue}this.charReceived=this.charLength=0;if(e.length===0)return t;break}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,r=t.charCodeAt(i);if(r>=55296&&r<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),e.copy(this.charBuffer,0,0,s),t.substring(0,i)}return t},o.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var n=e[e.length-t];if(t==1&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},o.prototype.end=function(e){var t="";e&&e.length&&(t=this.write(e));if(this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}},{buffer:88}],304:[function(require,module,exports){function Context(){}var indexOf=require("indexof"),Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in e)t.push(n);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n1)return i.encode.apply(this,arguments);throw new Error("multihash must be called with the encode or decode parameters.")};i.names={sha1:17,"sha2-256":18,"sha2-512":19,sha3:20,blake2b:64,blake2s:65},i.codes=r(i.names),i.defaultLengths={17:20,18:32,19:64,20:64,64:64,65:32},i.encode=function(t,r,s){if(!t||!r)throw new Error("multihash encode requires at least two args: hashfn, digest");r=i.coerceCode(r);if(!n.isBuffer(t))throw new Error("digest should be a Buffer");s||(s=t.length);if(s&&t.length!==s)throw new Error("digest length should be equal to specified length.");if(s>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return n.concat([new n([r,s]),t])},i.decode=function(t){var n=i.validate(t);if(n)throw n;var r={};return r.code=t[0],r.name=i.codes[r.code],r.length=t[1],r.digest=t.slice(2),r},i.validate=function(t){return n.isBuffer(t)?t.length<3?new Error("multihash too short. must be > 3 bytes."):t.length>129?new Error("multihash too long. must be < 129 bytes."):!i.isAppCode(t[0])&&!i.codes[t[0]]?new Error("multihash unknown function code: 0x"+t[0].toString(16)):t.slice(2).length!==t[1]?new Error("multihash length inconsistent: 0x"+t.toString("hex")):!1:new Error("multihash must be a Buffer")},i.coerceCode=function(t){var n=t;if(typeof t=="string"){if(!i.names[t])throw new Error("Unrecognized hash function named: "+t);n=i.names[t]}if(typeof n!="number")throw new Error("Hash function code should be a number. Got: "+n);if(!i.codes[n]&&!i.isAppCode(n))throw new Error("Unrecognized function code: "+n);return n},i.isAppCode=function(t){return t>0&&t<16}}).call(this,e("buffer").Buffer)},{buffer:88,"invert-hash":2}],web3:[function(e,t,n){var r=e("./lib/web3");typeof window!="undefined"&&typeof window.Web3=="undefined"&&(window.Web3=r),t.exports=r},{"./lib/web3":25}]},{},[]); \ No newline at end of file diff --git a/node_modules/etherid-js/package.json b/node_modules/etherid-js/package.json index 7bd9c32..e60dab8 100644 --- a/node_modules/etherid-js/package.json +++ b/node_modules/etherid-js/package.json @@ -1,6 +1,6 @@ { "name": "etherid-js", - "version": "1.1.1", + "version": "2.0.0", "description": "EtherId.org API", "main": "src/etherid.js", "directories": { @@ -25,10 +25,10 @@ "url": "https://github.com/lexansoft/etherid-js/issues" }, "homepage": "https://github.com/lexansoft/etherid-js#readme", - "readme": "# etherid-js\nJavascript API for EtherID\n\n\n## Installation\n\n### In Node.js through npm\n\n```bash\n$ npm install etherid-js\n```\n\n\n### In the Browser through browserify\n\nSame as in Node.js, you just have to [browserify](https://github.com/substack/js-browserify) the code before serving it. \n\n### In the Browser through ` @@ -126,6 +174,13 @@

List all the domains

+ +

Change Domain

+ +

+

+ + diff --git a/node_modules/multihashes/.npmignore b/node_modules/multihashes/.npmignore index cf70988..e04ff1a 100644 --- a/node_modules/multihashes/.npmignore +++ b/node_modules/multihashes/.npmignore @@ -1 +1,34 @@ -**/node_modules +**/node_modules/ +**/*.log +test/repo-tests* + +# Logs +logs +*.log + +coverage + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +build + +# Dependency directory +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git +node_modules + +test \ No newline at end of file diff --git a/node_modules/multihashes/.zuul.yml b/node_modules/multihashes/.zuul.yml deleted file mode 100644 index 96d9cfb..0000000 --- a/node_modules/multihashes/.zuul.yml +++ /dev/null @@ -1 +0,0 @@ -ui: tape diff --git a/node_modules/multihashes/README.md b/node_modules/multihashes/README.md index 656be12..79dc5d0 100644 --- a/node_modules/multihashes/README.md +++ b/node_modules/multihashes/README.md @@ -1,9 +1,15 @@ js-multihash ============ -[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) ![](https://img.shields.io/badge/coverage-%3F-yellow.svg?style=flat-square) [![Dependency Status](https://david-dm.org/jbenet/multihashes.svg?style=flat-square)](https://david-dm.org/jbenet/multihashes) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) +[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) +[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) +[![Coverage Status](https://coveralls.io/repos/github/jbenet/js-multihash/badge.svg?branch=master)](https://coveralls.io/github/jbenet/js-multihash?branch=master) +[![Travis CI](https://travis-ci.org/jbenet/js-multihash.svg?branch=master)](https://travis-ci.org/jbenet/js-multihash) +[![Circle CI](https://circleci.com/gh/jbenet/js-multihash.svg?style=svg)](https://circleci.com/gh/jbenet/js-multihash) +[![Dependency Status](https://david-dm.org/jbenet/multihashes.svg?style=flat-square)](https://david-dm.org/jbenet/js-multihash) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) -[multihash](//github.com/jbenet/multihash) implementation. +> [multihash](//github.com/jbenet/multihash) implementation. ## Installation @@ -13,20 +19,23 @@ js-multihash $ npm install --save multihashes # node the name of the module is multihashes ``` -```javascript +### Browser: Browserify, Webpack, other bundlers + +The code published to npm that gets loaded on require is in fact an ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust asset management process. + +```js var multihashes = require('multihashes') ``` -### In the Browser through browserify - -Same as in Node.js, you just have to [browserify](https://github.com/substack/js-browserify) the code before serving it. See the browserify repo for how to do that. ### In the Browser through ` + + ``` #### Gotchas @@ -50,6 +59,99 @@ You will need to use Node.js `Buffer` API compatible, if you are running inside digest: } ``` +## API + +### `decode(buf)` + +- `buf: Buffer` + +Decode a hash from the given multihash. + +Returns an object of the form, + +```js +{ + code: Number, + name: String, + length: Number, + digest: Buffer +} +``` + +### `encode(digest, hashfn[, length])` + +- `digest: Buffer` +- `hashfn: String|Number` +- `length: Number` (optional) + +Encode a hash digest along with the specified function code. + +> Note: the length is derived from the length of the digest itself. + +Returns a buffer. + +### `toHexString(multihash)` + +- `multihash: Buffer` + +Convert the given multihash to a hex encoded string. + +Returns a string. + +### `fromHexString(string)` + +- `string: String` + +Convert the given hex encoded string to a multihash (a `Buffer`). + +Returns a buffer. + +### `toB58String(multihash)` + +- `multihash: Buffer` + +Convert the given multihash to a base58 encoded string. + +Returns a string. + +### `fromB58String(string)` + +- `string: String` + +Convert the given base58 encoded string to a multihash (a `Buffer`). + +Returns a buffer. + +### `coerceCode(name)` + +- `name: String|Number` + +Converts a given hash function into the matching code. If passed a number it will return the number if it's a valid code. + +Returns a number. + +### `isAppCode(code)` + +- `code: Number` + +Checks wether a code is part of the app range. + +Returns a boolean. + +### `isValidCode(code)` + +- `code: Number` + +Checks whether a multihash code is valid. + +Returns a boolean. + +### `validate(multihash)` + +- `multihash: Buffer` + +Check if the given buffer is a valid multihash. Throws an error if it is not valid. + ## License MIT diff --git a/node_modules/multihashes/dist/multihashes.js b/node_modules/multihashes/dist/multihashes.js deleted file mode 100644 index 4b76506..0000000 --- a/node_modules/multihashes/dist/multihashes.js +++ /dev/null @@ -1,1939 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.multihashes = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - var len = b64.length - placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 - - // base64 is 4/3 + up to two characters of the original data - arr = new Arr(b64.length * 3 / 4 - placeHolders) - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? b64.length - 4 : b64.length - - var L = 0 - - function push (v) { - arr[L++] = v - } - - for (i = 0, j = 0; i < l; i += 4, j += 3) { - tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) - push((tmp & 0xFF0000) >> 16) - push((tmp & 0xFF00) >> 8) - push(tmp & 0xFF) - } - - if (placeHolders === 2) { - tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) - push(tmp & 0xFF) - } else if (placeHolders === 1) { - tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) - push((tmp >> 8) & 0xFF) - push(tmp & 0xFF) - } - - return arr - } - - function uint8ToBase64 (uint8) { - var i, - extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes - output = "", - temp, length - - function encode (num) { - return lookup.charAt(num) - } - - function tripletToBase64 (num) { - return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) - } - - // go through the array every three bytes, we'll deal with trailing stuff later - for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { - temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) - output += tripletToBase64(temp) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - switch (extraBytes) { - case 1: - temp = uint8[uint8.length - 1] - output += encode(temp >> 2) - output += encode((temp << 4) & 0x3F) - output += '==' - break - case 2: - temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) - output += encode(temp >> 10) - output += encode((temp >> 4) & 0x3F) - output += encode((temp << 2) & 0x3F) - output += '=' - break - } - - return output - } - - exports.toByteArray = b64ToByteArray - exports.fromByteArray = uint8ToBase64 -}(typeof exports === 'undefined' ? (this.base64js = {}) : exports)) - -},{}],2:[function(require,module,exports){ -(function (global){ -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -/* eslint-disable no-proto */ - -var base64 = require('base64-js') -var ieee754 = require('ieee754') -var isArray = require('is-array') - -exports.Buffer = Buffer -exports.SlowBuffer = SlowBuffer -exports.INSPECT_MAX_BYTES = 50 -Buffer.poolSize = 8192 // not used by this implementation - -var rootParent = {} - -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Use Object implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * Due to various browser bugs, sometimes the Object implementation will be used even - * when the browser supports typed arrays. - * - * Note: - * - * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. - * - * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property - * on objects. - * - * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. - * - * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of - * incorrect length in some situations. - - * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they - * get the Object implementation, which is slower but behaves correctly. - */ -Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined - ? global.TYPED_ARRAY_SUPPORT - : typedArraySupport() - -function typedArraySupport () { - function Bar () {} - try { - var arr = new Uint8Array(1) - arr.foo = function () { return 42 } - arr.constructor = Bar - return arr.foo() === 42 && // typed array instances can be augmented - arr.constructor === Bar && // constructor can be set - typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` - arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` - } catch (e) { - return false - } -} - -function kMaxLength () { - return Buffer.TYPED_ARRAY_SUPPORT - ? 0x7fffffff - : 0x3fffffff -} - -/** - * Class: Buffer - * ============= - * - * The Buffer constructor returns instances of `Uint8Array` that are augmented - * with function properties for all the node `Buffer` API functions. We use - * `Uint8Array` so that square bracket notation works as expected -- it returns - * a single octet. - * - * By augmenting the instances, we can avoid modifying the `Uint8Array` - * prototype. - */ -function Buffer (arg) { - if (!(this instanceof Buffer)) { - // Avoid going through an ArgumentsAdaptorTrampoline in the common case. - if (arguments.length > 1) return new Buffer(arg, arguments[1]) - return new Buffer(arg) - } - - this.length = 0 - this.parent = undefined - - // Common case. - if (typeof arg === 'number') { - return fromNumber(this, arg) - } - - // Slightly less common case. - if (typeof arg === 'string') { - return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8') - } - - // Unusual. - return fromObject(this, arg) -} - -function fromNumber (that, length) { - that = allocate(that, length < 0 ? 0 : checked(length) | 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) { - for (var i = 0; i < length; i++) { - that[i] = 0 - } - } - return that -} - -function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8' - - // Assumption: byteLength() return value is always < kMaxLength. - var length = byteLength(string, encoding) | 0 - that = allocate(that, length) - - that.write(string, encoding) - return that -} - -function fromObject (that, object) { - if (Buffer.isBuffer(object)) return fromBuffer(that, object) - - if (isArray(object)) return fromArray(that, object) - - if (object == null) { - throw new TypeError('must start with number, buffer, array or string') - } - - if (typeof ArrayBuffer !== 'undefined') { - if (object.buffer instanceof ArrayBuffer) { - return fromTypedArray(that, object) - } - if (object instanceof ArrayBuffer) { - return fromArrayBuffer(that, object) - } - } - - if (object.length) return fromArrayLike(that, object) - - return fromJsonObject(that, object) -} - -function fromBuffer (that, buffer) { - var length = checked(buffer.length) | 0 - that = allocate(that, length) - buffer.copy(that, 0, 0, length) - return that -} - -function fromArray (that, array) { - var length = checked(array.length) | 0 - that = allocate(that, length) - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 - } - return that -} - -// Duplicate of fromArray() to keep fromArray() monomorphic. -function fromTypedArray (that, array) { - var length = checked(array.length) | 0 - that = allocate(that, length) - // Truncating the elements is probably not what people expect from typed - // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior - // of the old Buffer constructor. - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 - } - return that -} - -function fromArrayBuffer (that, array) { - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - array.byteLength - that = Buffer._augment(new Uint8Array(array)) - } else { - // Fallback: Return an object instance of the Buffer class - that = fromTypedArray(that, new Uint8Array(array)) - } - return that -} - -function fromArrayLike (that, array) { - var length = checked(array.length) | 0 - that = allocate(that, length) - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 - } - return that -} - -// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object. -// Returns a zero-length buffer for inputs that don't conform to the spec. -function fromJsonObject (that, object) { - var array - var length = 0 - - if (object.type === 'Buffer' && isArray(object.data)) { - array = object.data - length = checked(array.length) | 0 - } - that = allocate(that, length) - - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 - } - return that -} - -if (Buffer.TYPED_ARRAY_SUPPORT) { - Buffer.prototype.__proto__ = Uint8Array.prototype - Buffer.__proto__ = Uint8Array -} - -function allocate (that, length) { - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = Buffer._augment(new Uint8Array(length)) - that.__proto__ = Buffer.prototype - } else { - // Fallback: Return an object instance of the Buffer class - that.length = length - that._isBuffer = true - } - - var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1 - if (fromPool) that.parent = rootParent - - return that -} - -function checked (length) { - // Note: cannot use `length < kMaxLength` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= kMaxLength()) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + kMaxLength().toString(16) + ' bytes') - } - return length | 0 -} - -function SlowBuffer (subject, encoding) { - if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding) - - var buf = new Buffer(subject, encoding) - delete buf.parent - return buf -} - -Buffer.isBuffer = function isBuffer (b) { - return !!(b != null && b._isBuffer) -} - -Buffer.compare = function compare (a, b) { - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError('Arguments must be Buffers') - } - - if (a === b) return 0 - - var x = a.length - var y = b.length - - var i = 0 - var len = Math.min(x, y) - while (i < len) { - if (a[i] !== b[i]) break - - ++i - } - - if (i !== len) { - x = a[i] - y = b[i] - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'binary': - case 'base64': - case 'raw': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } -} - -Buffer.concat = function concat (list, length) { - if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.') - - if (list.length === 0) { - return new Buffer(0) - } - - var i - if (length === undefined) { - length = 0 - for (i = 0; i < list.length; i++) { - length += list[i].length - } - } - - var buf = new Buffer(length) - var pos = 0 - for (i = 0; i < list.length; i++) { - var item = list[i] - item.copy(buf, pos) - pos += item.length - } - return buf -} - -function byteLength (string, encoding) { - if (typeof string !== 'string') string = '' + string - - var len = string.length - if (len === 0) return 0 - - // Use a for loop to avoid recursion - var loweredCase = false - for (;;) { - switch (encoding) { - case 'ascii': - case 'binary': - // Deprecated - case 'raw': - case 'raws': - return len - case 'utf8': - case 'utf-8': - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} -Buffer.byteLength = byteLength - -// pre-set for values that may exist in the future -Buffer.prototype.length = undefined -Buffer.prototype.parent = undefined - -function slowToString (encoding, start, end) { - var loweredCase = false - - start = start | 0 - end = end === undefined || end === Infinity ? this.length : end | 0 - - if (!encoding) encoding = 'utf8' - if (start < 0) start = 0 - if (end > this.length) end = this.length - if (end <= start) return '' - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'binary': - return binarySlice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase() - loweredCase = true - } - } -} - -Buffer.prototype.toString = function toString () { - var length = this.length | 0 - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -} - -Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 -} - -Buffer.prototype.inspect = function inspect () { - var str = '' - var max = exports.INSPECT_MAX_BYTES - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') - if (this.length > max) str += ' ... ' - } - return '' -} - -Buffer.prototype.compare = function compare (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return 0 - return Buffer.compare(this, b) -} - -Buffer.prototype.indexOf = function indexOf (val, byteOffset) { - if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff - else if (byteOffset < -0x80000000) byteOffset = -0x80000000 - byteOffset >>= 0 - - if (this.length === 0) return -1 - if (byteOffset >= this.length) return -1 - - // Negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0) - - if (typeof val === 'string') { - if (val.length === 0) return -1 // special case: looking for empty string always fails - return String.prototype.indexOf.call(this, val, byteOffset) - } - if (Buffer.isBuffer(val)) { - return arrayIndexOf(this, val, byteOffset) - } - if (typeof val === 'number') { - if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') { - return Uint8Array.prototype.indexOf.call(this, val, byteOffset) - } - return arrayIndexOf(this, [ val ], byteOffset) - } - - function arrayIndexOf (arr, val, byteOffset) { - var foundIndex = -1 - for (var i = 0; byteOffset + i < arr.length; i++) { - if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) { - if (foundIndex === -1) foundIndex = i - if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex - } else { - foundIndex = -1 - } - } - return -1 - } - - throw new TypeError('val must be string, number or Buffer') -} - -// `get` is deprecated -Buffer.prototype.get = function get (offset) { - console.log('.get() is deprecated. Access using array indexes instead.') - return this.readUInt8(offset) -} - -// `set` is deprecated -Buffer.prototype.set = function set (v, offset) { - console.log('.set() is deprecated. Access using array indexes instead.') - return this.writeUInt8(v, offset) -} - -function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0 - var remaining = buf.length - offset - if (!length) { - length = remaining - } else { - length = Number(length) - if (length > remaining) { - length = remaining - } - } - - // must be an even number of digits - var strLen = string.length - if (strLen % 2 !== 0) throw new Error('Invalid hex string') - - if (length > strLen / 2) { - length = strLen / 2 - } - for (var i = 0; i < length; i++) { - var parsed = parseInt(string.substr(i * 2, 2), 16) - if (isNaN(parsed)) throw new Error('Invalid hex string') - buf[offset + i] = parsed - } - return i -} - -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} - -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} - -function binaryWrite (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} - -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} - -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} - -Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8' - length = this.length - offset = 0 - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset - length = this.length - offset = 0 - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset | 0 - if (isFinite(length)) { - length = length | 0 - if (encoding === undefined) encoding = 'utf8' - } else { - encoding = length - length = undefined - } - // legacy write(string, encoding, offset, length) - remove in v0.13 - } else { - var swap = encoding - encoding = offset - offset = length | 0 - length = swap - } - - var remaining = this.length - offset - if (length === undefined || length > remaining) length = remaining - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8' - - var loweredCase = false - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - return asciiWrite(this, string, offset, length) - - case 'binary': - return binaryWrite(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} - -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } -} - -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } -} - -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end) - var res = [] - - var i = start - while (i < end) { - var firstByte = buf[i] - var codePoint = null - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 - - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte - } - break - case 2: - secondByte = buf[i + 1] - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint - } - } - break - case 3: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint - } - } - break - case 4: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - fourthByte = buf[i + 3] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD - bytesPerSequence = 1 - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000 - res.push(codePoint >>> 10 & 0x3FF | 0xD800) - codePoint = 0xDC00 | codePoint & 0x3FF - } - - res.push(codePoint) - i += bytesPerSequence - } - - return decodeCodePointsArray(res) -} - -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH = 0x1000 - -function decodeCodePointsArray (codePoints) { - var len = codePoints.length - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - var res = '' - var i = 0 - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ) - } - return res -} - -function asciiSlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; i++) { - ret += String.fromCharCode(buf[i] & 0x7F) - } - return ret -} - -function binarySlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; i++) { - ret += String.fromCharCode(buf[i]) - } - return ret -} - -function hexSlice (buf, start, end) { - var len = buf.length - - if (!start || start < 0) start = 0 - if (!end || end < 0 || end > len) end = len - - var out = '' - for (var i = start; i < end; i++) { - out += toHex(buf[i]) - } - return out -} - -function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end) - var res = '' - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) - } - return res -} - -Buffer.prototype.slice = function slice (start, end) { - var len = this.length - start = ~~start - end = end === undefined ? len : ~~end - - if (start < 0) { - start += len - if (start < 0) start = 0 - } else if (start > len) { - start = len - } - - if (end < 0) { - end += len - if (end < 0) end = 0 - } else if (end > len) { - end = len - } - - if (end < start) end = start - - var newBuf - if (Buffer.TYPED_ARRAY_SUPPORT) { - newBuf = Buffer._augment(this.subarray(start, end)) - } else { - var sliceLen = end - start - newBuf = new Buffer(sliceLen, undefined) - for (var i = 0; i < sliceLen; i++) { - newBuf[i] = this[i + start] - } - } - - if (newBuf.length) newBuf.parent = this.parent || this - - return newBuf -} - -/* - * Need to make sure that buffer isn't trying to write out of bounds. - */ -function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') -} - -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - - return val -} - -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - checkOffset(offset, byteLength, this.length) - } - - var val = this[offset + --byteLength] - var mul = 1 - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul - } - - return val -} - -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - return this[offset] -} - -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return this[offset] | (this[offset + 1] << 8) -} - -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return (this[offset] << 8) | this[offset + 1] -} - -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) -} - -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) -} - -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var i = byteLength - var mul = 1 - var val = this[offset + --i] - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -} - -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset] | (this[offset + 1] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset + 1] | (this[offset] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -} - -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) -} - -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, true, 23, 4) -} - -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, false, 23, 4) -} - -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, true, 52, 8) -} - -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, false, 52, 8) -} - -function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance') - if (value > max || value < min) throw new RangeError('value is out of bounds') - if (offset + ext > buf.length) throw new RangeError('index out of range') -} - -Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) - - var mul = 1 - var i = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) - - var i = byteLength - 1 - var mul = 1 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - this[offset] = (value & 0xff) - return offset + 1 -} - -function objectWriteUInt16 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) { - buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> - (littleEndian ? i : 1 - i) * 8 - } -} - -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) - } - return offset + 2 -} - -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) - } - return offset + 2 -} - -function objectWriteUInt32 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffffffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) { - buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff - } -} - -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset + 3] = (value >>> 24) - this[offset + 2] = (value >>> 16) - this[offset + 1] = (value >>> 8) - this[offset] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, true) - } - return offset + 4 -} - -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) - } - return offset + 4 -} - -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = 0 - var mul = 1 - var sub = value < 0 ? 1 : 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = byteLength - 1 - var mul = 1 - var sub = value < 0 ? 1 : 0 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - if (value < 0) value = 0xff + value + 1 - this[offset] = (value & 0xff) - return offset + 1 -} - -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) - } - return offset + 2 -} - -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) - } - return offset + 2 -} - -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - this[offset + 2] = (value >>> 16) - this[offset + 3] = (value >>> 24) - } else { - objectWriteUInt32(this, value, offset, true) - } - return offset + 4 -} - -Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (value < 0) value = 0xffffffff + value + 1 - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) - } - return offset + 4 -} - -function checkIEEE754 (buf, value, offset, ext, max, min) { - if (value > max || value < min) throw new RangeError('value is out of bounds') - if (offset + ext > buf.length) throw new RangeError('index out of range') - if (offset < 0) throw new RangeError('index out of range') -} - -function writeFloat (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) - } - ieee754.write(buf, value, offset, littleEndian, 23, 4) - return offset + 4 -} - -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) -} - -function writeDouble (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) - } - ieee754.write(buf, value, offset, littleEndian, 52, 8) - return offset + 8 -} - -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -} - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!start) start = 0 - if (!end && end !== 0) end = this.length - if (targetStart >= target.length) targetStart = target.length - if (!targetStart) targetStart = 0 - if (end > 0 && end < start) end = start - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start - } - - var len = end - start - var i - - if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (i = len - 1; i >= 0; i--) { - target[i + targetStart] = this[i + start] - } - } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { - // ascending copy from start - for (i = 0; i < len; i++) { - target[i + targetStart] = this[i + start] - } - } else { - target._set(this.subarray(start, start + len), targetStart) - } - - return len -} - -// fill(value, start=0, end=buffer.length) -Buffer.prototype.fill = function fill (value, start, end) { - if (!value) value = 0 - if (!start) start = 0 - if (!end) end = this.length - - if (end < start) throw new RangeError('end < start') - - // Fill 0 bytes; we're done - if (end === start) return - if (this.length === 0) return - - if (start < 0 || start >= this.length) throw new RangeError('start out of bounds') - if (end < 0 || end > this.length) throw new RangeError('end out of bounds') - - var i - if (typeof value === 'number') { - for (i = start; i < end; i++) { - this[i] = value - } - } else { - var bytes = utf8ToBytes(value.toString()) - var len = bytes.length - for (i = start; i < end; i++) { - this[i] = bytes[i % len] - } - } - - return this -} - -/** - * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. - * Added in Node 0.12. Only available in browsers that support ArrayBuffer. - */ -Buffer.prototype.toArrayBuffer = function toArrayBuffer () { - if (typeof Uint8Array !== 'undefined') { - if (Buffer.TYPED_ARRAY_SUPPORT) { - return (new Buffer(this)).buffer - } else { - var buf = new Uint8Array(this.length) - for (var i = 0, len = buf.length; i < len; i += 1) { - buf[i] = this[i] - } - return buf.buffer - } - } else { - throw new TypeError('Buffer.toArrayBuffer not supported in this browser') - } -} - -// HELPER FUNCTIONS -// ================ - -var BP = Buffer.prototype - -/** - * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods - */ -Buffer._augment = function _augment (arr) { - arr.constructor = Buffer - arr._isBuffer = true - - // save reference to original Uint8Array set method before overwriting - arr._set = arr.set - - // deprecated - arr.get = BP.get - arr.set = BP.set - - arr.write = BP.write - arr.toString = BP.toString - arr.toLocaleString = BP.toString - arr.toJSON = BP.toJSON - arr.equals = BP.equals - arr.compare = BP.compare - arr.indexOf = BP.indexOf - arr.copy = BP.copy - arr.slice = BP.slice - arr.readUIntLE = BP.readUIntLE - arr.readUIntBE = BP.readUIntBE - arr.readUInt8 = BP.readUInt8 - arr.readUInt16LE = BP.readUInt16LE - arr.readUInt16BE = BP.readUInt16BE - arr.readUInt32LE = BP.readUInt32LE - arr.readUInt32BE = BP.readUInt32BE - arr.readIntLE = BP.readIntLE - arr.readIntBE = BP.readIntBE - arr.readInt8 = BP.readInt8 - arr.readInt16LE = BP.readInt16LE - arr.readInt16BE = BP.readInt16BE - arr.readInt32LE = BP.readInt32LE - arr.readInt32BE = BP.readInt32BE - arr.readFloatLE = BP.readFloatLE - arr.readFloatBE = BP.readFloatBE - arr.readDoubleLE = BP.readDoubleLE - arr.readDoubleBE = BP.readDoubleBE - arr.writeUInt8 = BP.writeUInt8 - arr.writeUIntLE = BP.writeUIntLE - arr.writeUIntBE = BP.writeUIntBE - arr.writeUInt16LE = BP.writeUInt16LE - arr.writeUInt16BE = BP.writeUInt16BE - arr.writeUInt32LE = BP.writeUInt32LE - arr.writeUInt32BE = BP.writeUInt32BE - arr.writeIntLE = BP.writeIntLE - arr.writeIntBE = BP.writeIntBE - arr.writeInt8 = BP.writeInt8 - arr.writeInt16LE = BP.writeInt16LE - arr.writeInt16BE = BP.writeInt16BE - arr.writeInt32LE = BP.writeInt32LE - arr.writeInt32BE = BP.writeInt32BE - arr.writeFloatLE = BP.writeFloatLE - arr.writeFloatBE = BP.writeFloatBE - arr.writeDoubleLE = BP.writeDoubleLE - arr.writeDoubleBE = BP.writeDoubleBE - arr.fill = BP.fill - arr.inspect = BP.inspect - arr.toArrayBuffer = BP.toArrayBuffer - - return arr -} - -var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g - -function base64clean (str) { - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = stringtrim(str).replace(INVALID_BASE64_RE, '') - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '=' - } - return str -} - -function stringtrim (str) { - if (str.trim) return str.trim() - return str.replace(/^\s+|\s+$/g, '') -} - -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} - -function utf8ToBytes (string, units) { - units = units || Infinity - var codePoint - var length = string.length - var leadSurrogate = null - var bytes = [] - - for (var i = 0; i < length; i++) { - codePoint = string.charCodeAt(i) - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } - - // valid lead - leadSurrogate = codePoint - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - leadSurrogate = codePoint - continue - } - - // valid surrogate pair - codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000 - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - } - - leadSurrogate = null - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint) - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else { - throw new Error('Invalid code point') - } - } - - return bytes -} - -function asciiToBytes (str) { - var byteArray = [] - for (var i = 0; i < str.length; i++) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF) - } - return byteArray -} - -function utf16leToBytes (str, units) { - var c, hi, lo - var byteArray = [] - for (var i = 0; i < str.length; i++) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i) - hi = c >> 8 - lo = c % 256 - byteArray.push(lo) - byteArray.push(hi) - } - - return byteArray -} - -function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) -} - -function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; i++) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i] - } - return i -} - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"base64-js":1,"ieee754":3,"is-array":5}],3:[function(require,module,exports){ -exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m - var eLen = nBytes * 8 - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var nBits = -7 - var i = isLE ? (nBytes - 1) : 0 - var d = isLE ? -1 : 1 - var s = buffer[offset + i] - - i += d - - e = s & ((1 << (-nBits)) - 1) - s >>= (-nBits) - nBits += eLen - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1) - e >>= (-nBits) - nBits += mLen - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen) - e = e - eBias - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) -} - -exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c - var eLen = nBytes * 8 - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) - var i = isLE ? 0 : (nBytes - 1) - var d = isLE ? 1 : -1 - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 - - value = Math.abs(value) - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0 - e = eMax - } else { - e = Math.floor(Math.log(value) / Math.LN2) - if (value * (c = Math.pow(2, -e)) < 1) { - e-- - c *= 2 - } - if (e + eBias >= 1) { - value += rt / c - } else { - value += rt * Math.pow(2, 1 - eBias) - } - if (value * c >= 2) { - e++ - c /= 2 - } - - if (e + eBias >= eMax) { - m = 0 - e = eMax - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen) - e = e + eBias - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) - e = 0 - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m - eLen += mLen - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128 -} - -},{}],4:[function(require,module,exports){ -"use strict" - -function invert(hash) { - var result = {} - for(var i in hash) { - if(hash.hasOwnProperty(i)) { - result[hash[i]] = i - } - } - return result -} - -module.exports = invert -},{}],5:[function(require,module,exports){ - -/** - * isArray - */ - -var isArray = Array.isArray; - -/** - * toString - */ - -var str = Object.prototype.toString; - -/** - * Whether or not the given `val` - * is an array. - * - * example: - * - * isArray([]); - * // > true - * isArray(arguments); - * // > false - * isArray(''); - * // > false - * - * @param {mixed} val - * @return {bool} - */ - -module.exports = isArray || function (val) { - return !! val && '[object Array]' == str.call(val); -}; - -},{}],6:[function(require,module,exports){ -(function (Buffer){ -var invert = require('invert-hash') - -var mh = module.exports = function () { - if (arguments.length === 1) { - return mh.decode.apply(this, arguments) - } else if (arguments.length > 1) { - return mh.encode.apply(this, arguments) - } - - throw new Error('multihash must be called with the encode or decode parameters.') -} - -// the multihash tables - -mh.names = { - 'sha1': 0x11, - 'sha2-256': 0x12, - 'sha2-512': 0x13, - 'sha3': 0x14, - 'blake2b': 0x40, - 'blake2s': 0x41 -} - -mh.codes = invert(mh.names) - -mh.defaultLengths = { - 0x11: 20, - 0x12: 32, - 0x13: 64, - 0x14: 64, - 0x40: 64, - 0x41: 32 -} - -// encode(hashfn, [length,] digest) -mh.encode = function MultihashEncode (digest, hashfn, length) { - if (!digest || !hashfn) { - throw new Error('multihash encode requires at least two args: hashfn, digest') - } - - // ensure it's a hashfunction code. - hashfn = mh.coerceCode(hashfn) - - if (!(Buffer.isBuffer(digest))) { - throw new Error('digest should be a Buffer') - } - - if (!length) { - length = digest.length - } - - if (length && digest.length !== length) { - throw new Error('digest length should be equal to specified length.') - } - - if (length > 127) { - throw new Error('multihash does not yet support digest lengths greater than 127 bytes.') - } - - return Buffer.concat([new Buffer([hashfn, length]), digest]) -} - -// decode(mutlihash) -mh.decode = function MultihashDecode (multihash) { - var err = mh.validate(multihash) - if (err) { - throw err - } - - var output = {} - output.code = multihash[0] - output.name = mh.codes[output.code] - output.length = multihash[1] - output.digest = multihash.slice(2) - return output -} - -mh.validate = function validateMultihash (multihash) { - if (!(Buffer.isBuffer(multihash))) { - return new Error('multihash must be a Buffer') - } - - if (multihash.length < 3) { - return new Error('multihash too short. must be > 3 bytes.') - } - - if (multihash.length > 129) { - return new Error('multihash too long. must be < 129 bytes.') - } - - if (!mh.isAppCode(multihash[0]) && !mh.codes[multihash[0]]) { - return new Error('multihash unknown function code: 0x' + multihash[0].toString(16)) - } - - if (multihash.slice(2).length !== multihash[1]) { - return new Error('multihash length inconsistent: 0x' + multihash.toString('hex')) - } - - return false -} - -mh.coerceCode = function coerceCode (hashfn) { - var code = hashfn - if (typeof hashfn === 'string') { - if (!mh.names[hashfn]) { - throw new Error('Unrecognized hash function named: ' + hashfn) - } - code = mh.names[hashfn] - } - - if (typeof code !== 'number') { - throw new Error('Hash function code should be a number. Got: ' + code) - } - - if (!mh.codes[code] && !mh.isAppCode(code)) { - throw new Error('Unrecognized function code: ' + code) - } - - return code -} - -mh.isAppCode = function isAppCode (code) { - return code > 0 && code < 0x10 -} - -}).call(this,require("buffer").Buffer) -},{"buffer":2,"invert-hash":4}]},{},[6])(6) -}); \ No newline at end of file diff --git a/node_modules/multihashes/dist/multihashes.min.js b/node_modules/multihashes/dist/multihashes.min.js deleted file mode 100644 index 03df8ac..0000000 --- a/node_modules/multihashes/dist/multihashes.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(t){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=t()}else if(typeof define==="function"&&define.amd){define([],t)}else{var r;if(typeof window!=="undefined"){r=window}else if(typeof global!=="undefined"){r=global}else if(typeof self!=="undefined"){r=self}else{r=this}r.multihashes=t()}})(function(){var t,r,e;return function n(t,r,e){function i(f,a){if(!r[f]){if(!t[f]){var u=typeof require=="function"&&require;if(!a&&u)return u(f,!0);if(o)return o(f,!0);var s=new Error("Cannot find module '"+f+"'");throw s.code="MODULE_NOT_FOUND",s}var h=r[f]={exports:{}};t[f][0].call(h.exports,function(r){var e=t[f][1][r];return i(e?e:r)},h,h.exports,n,t,r,e)}return r[f].exports}var o=typeof require=="function"&&require;for(var f=0;f0){throw new Error("Invalid string. Length must be a multiple of 4")}var u=t.length;f="="===t.charAt(u-2)?2:"="===t.charAt(u-1)?1:0;a=new r(t.length*3/4-f);i=f>0?t.length-4:t.length;var s=0;function l(t){a[s++]=t}for(e=0,n=0;e>16);l((o&65280)>>8);l(o&255)}if(f===2){o=h(t.charAt(e))<<2|h(t.charAt(e+1))>>4;l(o&255)}else if(f===1){o=h(t.charAt(e))<<10|h(t.charAt(e+1))<<4|h(t.charAt(e+2))>>2;l(o>>8&255);l(o&255)}return a}function c(t){var r,e=t.length%3,i="",o,f;function a(t){return n.charAt(t)}function u(t){return a(t>>18&63)+a(t>>12&63)+a(t>>6&63)+a(t&63)}for(r=0,f=t.length-e;r>2);i+=a(o<<4&63);i+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1];i+=a(o>>10);i+=a(o>>4&63);i+=a(o<<2&63);i+="=";break}return i}t.toByteArray=l;t.fromByteArray=c})(typeof e==="undefined"?this.base64js={}:e)},{}],2:[function(t,r,e){(function(r){var n=t("base64-js");var i=t("ieee754");var o=t("is-array");e.Buffer=s;e.SlowBuffer=b;e.INSPECT_MAX_BYTES=50;s.poolSize=8192;var f={};s.TYPED_ARRAY_SUPPORT=r.TYPED_ARRAY_SUPPORT!==undefined?r.TYPED_ARRAY_SUPPORT:a();function a(){function t(){}try{var r=new Uint8Array(1);r.foo=function(){return 42};r.constructor=t;return r.foo()===42&&r.constructor===t&&typeof r.subarray==="function"&&r.subarray(1,1).byteLength===0}catch(e){return false}}function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t){if(!(this instanceof s)){if(arguments.length>1)return new s(t,arguments[1]);return new s(t)}this.length=0;this.parent=undefined;if(typeof t==="number"){return h(this,t)}if(typeof t==="string"){return l(this,t,arguments.length>1?arguments[1]:"utf8")}return c(this,t)}function h(t,r){t=E(t,r<0?0:A(r)|0);if(!s.TYPED_ARRAY_SUPPORT){for(var e=0;e>>1;if(e)t.parent=f;return t}function A(t){if(t>=u()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+u().toString(16)+" bytes")}return t|0}function b(t,r){if(!(this instanceof b))return new b(t,r);var e=new s(t,r);delete e.parent;return e}s.isBuffer=function rt(t){return!!(t!=null&&t._isBuffer)};s.compare=function et(t,r){if(!s.isBuffer(t)||!s.isBuffer(r)){throw new TypeError("Arguments must be Buffers")}if(t===r)return 0;var e=t.length;var n=r.length;var i=0;var o=Math.min(e,n);while(i>>1;case"base64":return $(t).length;default:if(n)return Q(t).length;r=(""+r).toLowerCase();n=true}}}s.byteLength=I;s.prototype.length=undefined;s.prototype.parent=undefined;function B(t,r,e){var n=false;r=r|0;e=e===undefined||e===Infinity?this.length:e|0;if(!t)t="utf8";if(r<0)r=0;if(e>this.length)e=this.length;if(e<=r)return"";while(true){switch(t){case"hex":return C(this,r,e);case"utf8":case"utf-8":return S(this,r,e);case"ascii":return O(this,r,e);case"binary":return x(this,r,e);case"base64":return T(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase();n=true}}}s.prototype.toString=function ot(){var t=this.length|0;if(t===0)return"";if(arguments.length===0)return S(this,0,t);return B.apply(this,arguments)};s.prototype.equals=function ft(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(this===t)return true;return s.compare(this,t)===0};s.prototype.inspect=function at(){var t="";var r=e.INSPECT_MAX_BYTES;if(this.length>0){t=this.toString("hex",0,r).match(/.{2}/g).join(" ");if(this.length>r)t+=" ... "}return""};s.prototype.compare=function ut(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(this===t)return 0;return s.compare(this,t)};s.prototype.indexOf=function st(t,r){if(r>2147483647)r=2147483647;else if(r<-2147483648)r=-2147483648;r>>=0;if(this.length===0)return-1;if(r>=this.length)return-1;if(r<0)r=Math.max(this.length+r,0);if(typeof t==="string"){if(t.length===0)return-1;return String.prototype.indexOf.call(this,t,r)}if(s.isBuffer(t)){return e(this,t,r)}if(typeof t==="number"){if(s.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,t,r)}return e(this,[t],r)}function e(t,r,e){var n=-1;for(var i=0;e+ii){n=i}}var o=r.length;if(o%2!==0)throw new Error("Invalid hex string");if(n>o/2){n=o/2}for(var f=0;fo)e=o;if(t.length>0&&(e<0||r<0)||r>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var f=false;for(;;){switch(n){case"hex":return m(this,t,r,e);case"utf8":case"utf-8":return U(this,t,r,e);case"ascii":return R(this,t,r,e);case"binary":return _(this,t,r,e);case"base64":return P(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r,e);default:if(f)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();f=true}}};s.prototype.toJSON=function pt(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,r,e){if(r===0&&e===t.length){return n.fromByteArray(t)}else{return n.fromByteArray(t.slice(r,e))}}function S(t,r,e){e=Math.min(t.length,e);var n=[];var i=r;while(i239?4:o>223?3:o>191?2:1;if(i+a<=e){var u,s,h,l;switch(a){case 1:if(o<128){f=o}break;case 2:u=t[i+1];if((u&192)===128){l=(o&31)<<6|u&63;if(l>127){f=l}}break;case 3:u=t[i+1];s=t[i+2];if((u&192)===128&&(s&192)===128){l=(o&15)<<12|(u&63)<<6|s&63;if(l>2047&&(l<55296||l>57343)){f=l}}break;case 4:u=t[i+1];s=t[i+2];h=t[i+3];if((u&192)===128&&(s&192)===128&&(h&192)===128){l=(o&15)<<18|(u&63)<<12|(s&63)<<6|h&63;if(l>65535&&l<1114112){f=l}}}}if(f===null){f=65533;a=1}else if(f>65535){f-=65536;n.push(f>>>10&1023|55296);f=56320|f&1023}n.push(f);i+=a}return D(n)}var Y=4096;function D(t){var r=t.length;if(r<=Y){return String.fromCharCode.apply(String,t)}var e="";var n=0;while(nn)e=n;var i="";for(var o=r;oe){t=e}if(r<0){r+=e;if(r<0)r=0}else if(r>e){r=e}if(re)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function dt(t,r,e){t=t|0;r=r|0;if(!e)N(t,r,this.length);var n=this[t];var i=1;var o=0;while(++o0&&(i*=256)){n+=this[t+--r]*i}return n};s.prototype.readUInt8=function yt(t,r){if(!r)N(t,1,this.length);return this[t]};s.prototype.readUInt16LE=function vt(t,r){if(!r)N(t,2,this.length);return this[t]|this[t+1]<<8};s.prototype.readUInt16BE=function Et(t,r){if(!r)N(t,2,this.length);return this[t]<<8|this[t+1]};s.prototype.readUInt32LE=function At(t,r){if(!r)N(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};s.prototype.readUInt32BE=function bt(t,r){if(!r)N(t,4,this.length);return this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};s.prototype.readIntLE=function It(t,r,e){t=t|0;r=r|0;if(!e)N(t,r,this.length);var n=this[t];var i=1;var o=0;while(++o=i)n-=Math.pow(2,8*r);return n};s.prototype.readIntBE=function Bt(t,r,e){t=t|0;r=r|0;if(!e)N(t,r,this.length);var n=r;var i=1;var o=this[t+--n];while(n>0&&(i*=256)){o+=this[t+--n]*i}i*=128;if(o>=i)o-=Math.pow(2,8*r);return o};s.prototype.readInt8=function mt(t,r){if(!r)N(t,1,this.length);if(!(this[t]&128))return this[t];return(255-this[t]+1)*-1};s.prototype.readInt16LE=function Ut(t,r){if(!r)N(t,2,this.length);var e=this[t]|this[t+1]<<8;return e&32768?e|4294901760:e};s.prototype.readInt16BE=function Rt(t,r){if(!r)N(t,2,this.length);var e=this[t+1]|this[t]<<8;return e&32768?e|4294901760:e};s.prototype.readInt32LE=function _t(t,r){if(!r)N(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};s.prototype.readInt32BE=function Pt(t,r){if(!r)N(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};s.prototype.readFloatLE=function Lt(t,r){if(!r)N(t,4,this.length);return i.read(this,t,true,23,4)};s.prototype.readFloatBE=function Tt(t,r){if(!r)N(t,4,this.length);return i.read(this,t,false,23,4)};s.prototype.readDoubleLE=function St(t,r){if(!r)N(t,8,this.length);return i.read(this,t,true,52,8)};s.prototype.readDoubleBE=function Yt(t,r){if(!r)N(t,8,this.length);return i.read(this,t,false,52,8)};function k(t,r,e,n,i,o){if(!s.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(r>i||rt.length)throw new RangeError("index out of range")}s.prototype.writeUIntLE=function Dt(t,r,e,n){t=+t;r=r|0;e=e|0;if(!n)k(this,t,r,e,Math.pow(2,8*e),0);var i=1;var o=0;this[r]=t&255;while(++o=0&&(o*=256)){this[r+i]=t/o&255}return r+e};s.prototype.writeUInt8=function xt(t,r,e){t=+t;r=r|0;if(!e)k(this,t,r,1,255,0);if(!s.TYPED_ARRAY_SUPPORT)t=Math.floor(t);this[r]=t&255;return r+1};function F(t,r,e,n){if(r<0)r=65535+r+1;for(var i=0,o=Math.min(t.length-e,2);i>>(n?i:1-i)*8}}s.prototype.writeUInt16LE=function Ct(t,r,e){t=+t;r=r|0;if(!e)k(this,t,r,2,65535,0);if(s.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{F(this,t,r,true)}return r+2};s.prototype.writeUInt16BE=function Mt(t,r,e){t=+t;r=r|0;if(!e)k(this,t,r,2,65535,0);if(s.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{F(this,t,r,false)}return r+2};function q(t,r,e,n){if(r<0)r=4294967295+r+1;for(var i=0,o=Math.min(t.length-e,4);i>>(n?i:3-i)*8&255}}s.prototype.writeUInt32LE=function Nt(t,r,e){t=+t;r=r|0;if(!e)k(this,t,r,4,4294967295,0);if(s.TYPED_ARRAY_SUPPORT){this[r+3]=t>>>24;this[r+2]=t>>>16;this[r+1]=t>>>8;this[r]=t&255}else{q(this,t,r,true)}return r+4};s.prototype.writeUInt32BE=function kt(t,r,e){t=+t;r=r|0;if(!e)k(this,t,r,4,4294967295,0);if(s.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{q(this,t,r,false)}return r+4};s.prototype.writeIntLE=function Ft(t,r,e,n){t=+t;r=r|0;if(!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0;var f=1;var a=t<0?1:0;this[r]=t&255;while(++o>0)-a&255}return r+e};s.prototype.writeIntBE=function qt(t,r,e,n){t=+t;r=r|0;if(!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1;var f=1;var a=t<0?1:0;this[r+o]=t&255;while(--o>=0&&(f*=256)){this[r+o]=(t/f>>0)-a&255}return r+e};s.prototype.writeInt8=function jt(t,r,e){t=+t;r=r|0;if(!e)k(this,t,r,1,127,-128);if(!s.TYPED_ARRAY_SUPPORT)t=Math.floor(t);if(t<0)t=255+t+1;this[r]=t&255;return r+1};s.prototype.writeInt16LE=function zt(t,r,e){t=+t;r=r|0;if(!e)k(this,t,r,2,32767,-32768);if(s.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{F(this,t,r,true)}return r+2};s.prototype.writeInt16BE=function Jt(t,r,e){t=+t;r=r|0;if(!e)k(this,t,r,2,32767,-32768);if(s.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{F(this,t,r,false)}return r+2};s.prototype.writeInt32LE=function Xt(t,r,e){t=+t;r=r|0;if(!e)k(this,t,r,4,2147483647,-2147483648);if(s.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8;this[r+2]=t>>>16;this[r+3]=t>>>24}else{q(this,t,r,true)}return r+4};s.prototype.writeInt32BE=function Gt(t,r,e){t=+t;r=r|0;if(!e)k(this,t,r,4,2147483647,-2147483648);if(t<0)t=4294967295+t+1;if(s.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{q(this,t,r,false)}return r+4};function j(t,r,e,n,i,o){if(r>i||rt.length)throw new RangeError("index out of range");if(e<0)throw new RangeError("index out of range")}function z(t,r,e,n,o){if(!o){j(t,r,e,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(t,r,e,n,23,4);return e+4}s.prototype.writeFloatLE=function Ht(t,r,e){return z(this,t,r,true,e)};s.prototype.writeFloatBE=function Zt(t,r,e){return z(this,t,r,false,e)};function J(t,r,e,n,o){if(!o){j(t,r,e,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(t,r,e,n,52,8);return e+8}s.prototype.writeDoubleLE=function Kt(t,r,e){return J(this,t,r,true,e)};s.prototype.writeDoubleBE=function Qt(t,r,e){return J(this,t,r,false,e)};s.prototype.copy=function Vt(t,r,e,n){if(!e)e=0;if(!n&&n!==0)n=this.length;if(r>=t.length)r=t.length;if(!r)r=0;if(n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(t.length-r=0;o--){t[o+r]=this[o+e]}}else if(i<1e3||!s.TYPED_ARRAY_SUPPORT){for(o=0;o=this.length)throw new RangeError("start out of bounds");if(e<0||e>this.length)throw new RangeError("end out of bounds");var n;if(typeof t==="number"){for(n=r;n55295&&e<57344){if(!i){if(e>56319){if((r-=3)>-1)o.push(239,191,189);continue}else if(f+1===n){if((r-=3)>-1)o.push(239,191,189);continue}i=e;continue}if(e<56320){if((r-=3)>-1)o.push(239,191,189);i=e;continue}e=i-55296<<10|e-56320|65536}else if(i){if((r-=3)>-1)o.push(239,191,189)}i=null;if(e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else{throw new Error("Invalid code point")}}return o}function V(t){var r=[];for(var e=0;e>8;i=e%256;o.push(i);o.push(n)}return o}function $(t){return n.toByteArray(H(t))}function tt(t,r,e,n){for(var i=0;i=r.length||i>=t.length)break;r[i+e]=t[i]}return i}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"base64-js":1,ieee754:3,"is-array":5}],3:[function(t,r,e){e.read=function(t,r,e,n,i){var o,f;var a=i*8-n-1;var u=(1<>1;var h=-7;var l=e?i-1:0;var c=e?-1:1;var p=t[r+l];l+=c;o=p&(1<<-h)-1;p>>=-h;h+=a;for(;h>0;o=o*256+t[r+l],l+=c,h-=8){}f=o&(1<<-h)-1;o>>=-h;h+=n;for(;h>0;f=f*256+t[r+l],l+=c,h-=8){}if(o===0){o=1-s}else if(o===u){return f?NaN:(p?-1:1)*Infinity}else{f=f+Math.pow(2,n);o=o-s}return(p?-1:1)*f*Math.pow(2,o-n)};e.write=function(t,r,e,n,i,o){var f,a,u;var s=o*8-i-1;var h=(1<>1;var c=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var p=n?0:o-1;var g=n?1:-1;var d=r<0||r===0&&1/r<0?1:0;r=Math.abs(r);if(isNaN(r)||r===Infinity){a=isNaN(r)?1:0;f=h}else{f=Math.floor(Math.log(r)/Math.LN2);if(r*(u=Math.pow(2,-f))<1){f--;u*=2}if(f+l>=1){r+=c/u}else{r+=c*Math.pow(2,1-l)}if(r*u>=2){f++;u/=2}if(f+l>=h){a=0;f=h}else if(f+l>=1){a=(r*u-1)*Math.pow(2,i);f=f+l}else{a=r*Math.pow(2,l-1)*Math.pow(2,i);f=0}}for(;i>=8;t[e+p]=a&255,p+=g,a/=256,i-=8){}f=f<0;t[e+p]=f&255,p+=g,f/=256,s-=8){}t[e+p-g]|=d*128}},{}],4:[function(t,r,e){"use strict";function n(t){var r={};for(var e in t){if(t.hasOwnProperty(e)){r[t[e]]=e}}return r}r.exports=n},{}],5:[function(t,r,e){var n=Array.isArray;var i=Object.prototype.toString;r.exports=n||function(t){return!!t&&"[object Array]"==i.call(t)}},{}],6:[function(t,r,e){(function(e){var n=t("invert-hash");var i=r.exports=function(){if(arguments.length===1){return i.decode.apply(this,arguments)}else if(arguments.length>1){return i.encode.apply(this,arguments)}throw new Error("multihash must be called with the encode or decode parameters.")};i.names={sha1:17,"sha2-256":18,"sha2-512":19,sha3:20,blake2b:64,blake2s:65};i.codes=n(i.names);i.defaultLengths={17:20,18:32,19:64,20:64,64:64,65:32};i.encode=function o(t,r,n){if(!t||!r){throw new Error("multihash encode requires at least two args: hashfn, digest")}r=i.coerceCode(r);if(!e.isBuffer(t)){throw new Error("digest should be a Buffer")}if(!n){n=t.length}if(n&&t.length!==n){throw new Error("digest length should be equal to specified length.")}if(n>127){throw new Error("multihash does not yet support digest lengths greater than 127 bytes.")}return e.concat([new e([r,n]),t])};i.decode=function f(t){var r=i.validate(t);if(r){throw r}var e={};e.code=t[0];e.name=i.codes[e.code];e.length=t[1];e.digest=t.slice(2);return e};i.validate=function a(t){if(!e.isBuffer(t)){return new Error("multihash must be a Buffer")}if(t.length<3){return new Error("multihash too short. must be > 3 bytes.")}if(t.length>129){return new Error("multihash too long. must be < 129 bytes.")}if(!i.isAppCode(t[0])&&!i.codes[t[0]]){return new Error("multihash unknown function code: 0x"+t[0].toString(16))}if(t.slice(2).length!==t[1]){return new Error("multihash length inconsistent: 0x"+t.toString("hex"))}return false};i.coerceCode=function u(t){var r=t;if(typeof t==="string"){if(!i.names[t]){throw new Error("Unrecognized hash function named: "+t)}r=i.names[t]}if(typeof r!=="number"){throw new Error("Hash function code should be a number. Got: "+r)}if(!i.codes[r]&&!i.isAppCode(r)){throw new Error("Unrecognized function code: "+r)}return r};i.isAppCode=function s(t){return t>0&&t<16}}).call(this,t("buffer").Buffer)},{buffer:2,"invert-hash":4}]},{},[6])(6)}); \ No newline at end of file diff --git a/node_modules/multihashes/package.json b/node_modules/multihashes/package.json index 7e25723..ca101cc 100644 --- a/node_modules/multihashes/package.json +++ b/node_modules/multihashes/package.json @@ -1,99 +1,108 @@ { - "_args": [ - [ - "multihashes", - "/Users/alexn/projects/etherid.org" - ] + "name": "multihashes", + "version": "0.2.2", + "description": "multihash implementation", + "main": "lib/index.js", + "jsnext:main": "src/index.js", + "scripts": { + "test:node": "aegir-test node", + "lint": "aegir-lint", + "test:browser": "aegir-test browser", + "build": "aegir-build", + "test": "aegir-test", + "release": "aegir-release", + "coverage": "aegir-coverage", + "coverage-publish": "aegir-coverage publish" + }, + "pre-commit": [ + "lint", + "test" ], - "_from": "multihashes@*", - "_id": "multihashes@0.2.0", - "_inCache": true, - "_installable": true, - "_location": "/multihashes", - "_nodeVersion": "0.12.7", - "_npmUser": { - "email": "juan@benet.ai", - "name": "jbenet" + "standard": { + "ignore": [ + "dist" + ] }, - "_npmVersion": "2.12.1", - "_phantomChildren": {}, - "_requested": { - "name": "multihashes", - "raw": "multihashes", - "rawSpec": "", - "scope": null, - "spec": "*", - "type": "range" + "repository": { + "type": "git", + "url": "git://github.com/jbenet/js-multihash.git" }, - "_requiredBy": [ - "#USER" + "keywords": [ + "multihash" ], - "_resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.2.0.tgz", - "_shasum": "c9af670a3c1b06362e03994c8b3a4395d18cb383", - "_shrinkwrap": null, - "_spec": "multihashes", - "_where": "/Users/alexn/projects/etherid.org", "author": { - "email": "juan@benet.ai", "name": "Juan Benet", + "email": "juan@benet.ai", "url": "http://juan.benet.ai/" }, + "license": "MIT", "bugs": { "url": "https://github.com/jbenet/js-multihash/issues" }, "dependencies": { - "buffer-equal": "0.0.1", - "invert-hash": "0.0.0" + "bs58": "^3.0.0" }, - "description": "multihash implementation", "devDependencies": { - "browserify": "^12.0.1", - "pre-commit": "^1.1.2", - "standard": "^5.3.1", - "tape": "~2.13.1", - "uglifyjs": "^2.4.10", - "zuul": "^3.7.2" - }, - "directories": {}, - "dist": { - "shasum": "c9af670a3c1b06362e03994c8b3a4395d18cb383", - "tarball": "http://registry.npmjs.org/multihashes/-/multihashes-0.2.0.tgz" + "aegir": "^3.0.1", + "buffer-equal": "1.0.0", + "chai": "^3.5.0", + "pre-commit": "^1.1.2" }, - "gitHead": "1852e5efaece7ce64aecd6cacf371df70cc67e16", - "homepage": "https://github.com/jbenet/js-multihash#readme", - "keywords": [ - "multihash" + "contributors": [ + { + "name": "David Dias", + "email": "daviddias.p@gmail.com" + }, + { + "name": "Fil", + "email": "fil@rezo.net" + }, + { + "name": "Juan Benet", + "email": "juan@benet.ai" + }, + { + "name": "William Cotton", + "email": "williamcotton@gmail.com" + }, + { + "name": "dignifiedquire", + "email": "dignifiedquire@gmail.com" + }, + { + "name": "nginnever", + "email": "ginneversource@gmail.com" + } ], - "license": "MIT", - "main": "src/index.js", + "gitHead": "cc80d887757c91ad19b24bd8eb61620696ee2f36", + "homepage": "https://github.com/jbenet/js-multihash#readme", + "_id": "multihashes@0.2.2", + "_shasum": "8ccf2e3ba3d041e1146728de0d8a4da9e8b18251", + "_from": "multihashes@0.2.2", + "_npmVersion": "3.8.7", + "_nodeVersion": "4.3.2", + "_npmUser": { + "name": "daviddias", + "email": "daviddias.p@gmail.com" + }, "maintainers": [ + { + "name": "daviddias", + "email": "daviddias.p@gmail.com" + }, { "name": "jbenet", "email": "juan@benet.ai" } ], - "name": "multihashes", - "optionalDependencies": {}, - "pre-commit": [ - "lint", - "test:node" - ], - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/jbenet/js-multihash.git" - }, - "scripts": { - "build": "browserify -s multihashes -e ./src/index.js | tee dist/multihashes.js | ./node_modules/.bin/uglifyjs -m > dist/multihashes.min.js", - "lint": "standard", - "test:browser": "zuul --browser-version $BROWSER_VERSION --browser-name $BROWSER_NAME -- tests/test.js", - "test:browser:q": "BROWSER_VERSION=46 BROWSER_NAME=chrome npm run test:browser", - "test:node": "node tests/test.js" + "dist": { + "shasum": "8ccf2e3ba3d041e1146728de0d8a4da9e8b18251", + "tarball": "https://registry.npmjs.org/multihashes/-/multihashes-0.2.2.tgz" }, - "standard": { - "ignore": [ - "dist" - ] + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/multihashes-0.2.2.tgz_1463382767557_0.3908476603683084" }, - "version": "0.2.0" + "directories": {}, + "_resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.2.2.tgz" } diff --git a/node_modules/multihashes/src/index.js b/node_modules/multihashes/src/index.js index d36bc90..ee91017 100644 --- a/node_modules/multihashes/src/index.js +++ b/node_modules/multihashes/src/index.js @@ -1,51 +1,67 @@ -var invert = require('invert-hash') +'use strict' -var mh = module.exports = function () { - if (arguments.length === 1) { - return mh.decode.apply(this, arguments) - } else if (arguments.length > 1) { - return mh.encode.apply(this, arguments) +const bs58 = require('bs58') + +const cs = require('./constants') + +exports.toHexString = function toHexString (m) { + if (!Buffer.isBuffer(m)) { + throw new Error('must be passed a buffer') } - throw new Error('multihash must be called with the encode or decode parameters.') + return m.toString('hex') } -// the multihash tables +exports.fromHexString = function fromHexString (s) { + return new Buffer(s, 'hex') +} + +exports.toB58String = function toB58String (m) { + if (!Buffer.isBuffer(m)) { + throw new Error('must be passed a buffer') + } -mh.names = { - 'sha1': 0x11, - 'sha2-256': 0x12, - 'sha2-512': 0x13, - 'sha3': 0x14, - 'blake2b': 0x40, - 'blake2s': 0x41 + return bs58.encode(m) } -mh.codes = invert(mh.names) +exports.fromB58String = function fromB58String (s) { + let encoded = s + if (Buffer.isBuffer(s)) { + encoded = s.toString() + } -mh.defaultLengths = { - 0x11: 20, - 0x12: 32, - 0x13: 64, - 0x14: 64, - 0x40: 64, - 0x41: 32 + return new Buffer(bs58.decode(encoded)) } -// encode(hashfn, [length,] digest) -mh.encode = function MultihashEncode (digest, hashfn, length) { - if (!digest || !hashfn) { - throw new Error('multihash encode requires at least two args: hashfn, digest') +// Decode a hash from the given Multihash. +exports.decode = function decode (buf) { + exports.validate(buf) + + const code = buf[0] + + return { + code: code, + name: cs.codes[code], + length: buf[1], + digest: buf.slice(2) + } +} + +// Encode a hash digest along with the specified function code. +// Note: the length is derived from the length of the digest itself. +exports.encode = function encode (digest, code, length) { + if (!digest || !code) { + throw new Error('multihash encode requires at least two args: digest, code') } // ensure it's a hashfunction code. - hashfn = mh.coerceCode(hashfn) + const hashfn = exports.coerceCode(code) if (!(Buffer.isBuffer(digest))) { throw new Error('digest should be a Buffer') } - if (!length) { + if (length == null) { length = digest.length } @@ -60,65 +76,66 @@ mh.encode = function MultihashEncode (digest, hashfn, length) { return Buffer.concat([new Buffer([hashfn, length]), digest]) } -// decode(mutlihash) -mh.decode = function MultihashDecode (multihash) { - var err = mh.validate(multihash) - if (err) { - throw err - } +// Converts a hashfn name into the matching code +exports.coerceCode = function coerceCode (name) { + let code = name - var output = {} - output.code = multihash[0] - output.name = mh.codes[output.code] - output.length = multihash[1] - output.digest = multihash.slice(2) - return output -} - -mh.validate = function validateMultihash (multihash) { - if (!(Buffer.isBuffer(multihash))) { - return new Error('multihash must be a Buffer') + if (typeof name === 'string') { + if (!cs.names[name]) { + throw new Error(`Unrecognized hash function named: ${name}`) + } + code = cs.names[name] } - if (multihash.length < 3) { - return new Error('multihash too short. must be > 3 bytes.') + if (typeof code !== 'number') { + throw new Error(`Hash function code should be a number. Got: ${code}`) } - if (multihash.length > 129) { - return new Error('multihash too long. must be < 129 bytes.') + if (!cs.codes[code] && !exports.isAppCode(code)) { + throw new Error(`Unrecognized function code: ${code}`) } - if (!mh.isAppCode(multihash[0]) && !mh.codes[multihash[0]]) { - return new Error('multihash unknown function code: 0x' + multihash[0].toString(16)) + return code +} + +// Checks wether a code is part of the app range +exports.isAppCode = function appCode (code) { + return code > 0 && code < 0x10 +} + +// Checks whether a multihash code is valid. +exports.isValidCode = function validCode (code) { + if (exports.isAppCode(code)) { + return true } - if (multihash.slice(2).length !== multihash[1]) { - return new Error('multihash length inconsistent: 0x' + multihash.toString('hex')) + if (cs.codes[code]) { + return true } return false } -mh.coerceCode = function coerceCode (hashfn) { - var code = hashfn - if (typeof hashfn === 'string') { - if (!mh.names[hashfn]) { - throw new Error('Unrecognized hash function named: ' + hashfn) - } - code = mh.names[hashfn] +exports.validate = function validate (multihash) { + if (!(Buffer.isBuffer(multihash))) { + throw new Error('multihash must be a Buffer') } - if (typeof code !== 'number') { - throw new Error('Hash function code should be a number. Got: ' + code) + if (multihash.length < 3) { + throw new Error('multihash too short. must be > 3 bytes.') } - if (!mh.codes[code] && !mh.isAppCode(code)) { - throw new Error('Unrecognized function code: ' + code) + if (multihash.length > 129) { + throw new Error('multihash too long. must be < 129 bytes.') } - return code -} + let code = multihash[0] -mh.isAppCode = function isAppCode (code) { - return code > 0 && code < 0x10 + if (!exports.isValidCode(code)) { + throw new Error(`multihash unknown function code: 0x${code.toString(16)}`) + } + + if (multihash.slice(2).length !== multihash[1]) { + throw new Error(`multihash length inconsistent: 0x${multihash.toString('hex')}`) + } } diff --git a/node_modules/multihashes/tests/test.js b/node_modules/multihashes/tests/test.js deleted file mode 100644 index 2362bf9..0000000 --- a/node_modules/multihashes/tests/test.js +++ /dev/null @@ -1,141 +0,0 @@ -var bufeq = require('buffer-equal') -var multihash = require('../src') -var invert = require('invert-hash') -var test = require('tape') - -var names = { - 'sha1': 0x11, - 'sha2-256': 0x12, - 'sha2-512': 0x13, - 'sha3': 0x14, - 'blake2b': 0x40, - 'blake2s': 0x41 -} - -var codes = invert(names) - -// maybe a silly test, but makes it so changing -// the table accidentally has to happen twice. -test('multihash table', function (t) { - for (var n in names) { - t.is(multihash.names[n], names[n], n + ' name') - t.is(multihash.codes[names[n]], n, n + ' code') - } - - t.is(ObjectLength(multihash.names), 6) - t.is(ObjectLength(multihash.codes), 6) - t.end() -}) - -test('isAppCode', function (t) { - t.is(multihash.isAppCode(0), false) - for (var n = 1; n < 0x10; n++) { - t.is(multihash.isAppCode(n), true) - } - for (var m = 0x10; m <= 0xff; m++) { - t.is(multihash.isAppCode(m), false) - } - t.end() -}) - -test('coerceCode', function (t) { - for (var n in names) { - var c = names[n] - t.is(multihash.coerceCode(n), c, n + ' coerced to ' + c) - t.is(multihash.coerceCode(c), c, n + ' coerced to ' + c) - } - t.end() -}) - -var testCases = [ - [ - ['0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'sha1'], - encodedBuffer(0x11, 20, '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33') - ], [ - ['0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 0x11], - encodedBuffer(0x11, 20, '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33') - ], [ - ['0beec7b8', 'sha1'], - encodedBuffer(0x11, 4, '0beec7b8') - ], [ - ['2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae', 'sha2-256'], - encodedBuffer(0x12, 32, '2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae') - ], [ - ['2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae', 0x12], - encodedBuffer(0x12, 32, '2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae') - ], [ - ['2c26b46b', 'sha2-256'], - encodedBuffer(0x12, 4, '2c26b46b') - ], [ - ['2c26b46b', 'blake2b'], - encodedBuffer(0x40, 4, '2c26b46b') - ] -] - -test('encode', function (t) { - for (var test in testCases) { - test = testCases[test] - var hex = test[0][0] - var args = [new Buffer(hex, 'hex')].concat(test[0].slice(1)) - var r = multihash.encode.apply(this, args) - - var m = 'test encoding ' + test[0][1] + ' ' + hex - t.ok(bufeq(r, test[1]), m) - } - t.end() -}) - -test('decode', function (t) { - for (var test in testCases) { - test = testCases[test] - - var buf = test[1] - var code = multihash.coerceCode(test[0][1]) - var name = codes[code] - var d1 = new Buffer(test[0][0], 'hex') - var length = d1.length - - var r = multihash.decode(buf) - var d2 = r.digest - - t.is(r.code, code, 'code is ' + code) - t.is(r.name, name, 'name is ' + name) - t.is(r.length, length, 'length must be ' + length) - t.ok(bufeq(d1, d2), 'digest decoding ' + test[0][0]) - } - t.end() -}) - -var badTestCases = [ - encodedBuffer(0x00, 32, '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'), - encodedBuffer(0x11, 21, '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'), - encodedBuffer(0x11, 20, '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a'), - encodedBuffer(0x11, 20, ''), - encodedBuffer(0x31, 20, '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'), - encodedBuffer(0x12, 32, '2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7') -] - -test('validate', function (t) { - for (var test in badTestCases) { - test = badTestCases[test] - console.log(multihash.validate(test)) - t.ok(multihash.validate(test)) - } - t.end() -}) - -function encodedBuffer (code, size, hex) { - return Buffer.concat([ - new Buffer([code, size]), - new Buffer(hex, 'hex')] - ) -} - -function ObjectLength (obj) { - var size = 0 - var key - for (key in obj) { - if (obj.hasOwnProperty(key)) size++ - } - return size -} diff --git a/node_modules/progressbar.js/CONTRIBUTING.md b/node_modules/progressbar.js/CONTRIBUTING.md deleted file mode 100644 index 4d1a1ec..0000000 --- a/node_modules/progressbar.js/CONTRIBUTING.md +++ /dev/null @@ -1,129 +0,0 @@ -# Contribution documentation - -Pull requests and contributions are warmly welcome. -Please follow existing code style and commit message conventions. Also remember to keep documentation -updated. - -**Pull requests:** You don't need to bump version numbers or modify anything related to releasing. That stuff is fully automated, just write the functionality. - -## Get started with development - -* [Install local environment](#install-environment). -* `cd local-dev` and serve folder to browser -* Open another terminal to project root and run `grunt watch`. - -Then you can edit `src/progressbar.js` and changes can be tested in browser. -Edit `local-dev/main.js` to your testing needs. - -Shorter way to do local development is running: ```npm run dev```. - -## General project stuff - -This package uses npm/node tools just in the developer environment. Grunt is used as a task runner -but there's no reason it couldn't be replaced with e.g. Makefile - -*ProgressBar.js* depends on tweening library called [shifty](https://github.com/jeremyckahn/shifty). -*Shifty* is bundled inside the scripts in [dist/](dist/) directory. -Dependency is bundled in to ease using the library. - -#### Versioning - -Versioning follows [Semantic Versioning 2.0.0](http://semver.org/). The release script makes sure -that for each release, there exists only one commit in history where version number in *bower.json* -matches the release's version. That commit is tagged as the release, for example `0.4.1`. Commits after that have -dev suffix(*0.4.1-dev*) in the version number to avoid any possible confusion. - -In other words, if you look into *bower.json*, you can tell if the code base is a released version or not. - - -## Install environment - -Install tools needed for development: - - npm install - npm install -g watchify - npm install -g browserify - -For testing: - - npm install -g mocha - npm install -g testem - - -## Test - -Tests are written with [Mocha](http://mochajs.org/) + [expect.js](https://github.com/LearnBoost/expect.js/). -Sometimes the tests fail even though they actually work on the browser. That might be cause of setTimeouts used -in tests. - -Quickly run tests: - - grunt test - -This will use testem to run tests with Chrome. Other options specified below. - -#### Testem - -[Testem](https://github.com/airportyh/testem) is used for running tests locally. It is fast and easy to use. -List of example commands: - -* `testem` Serves testing page so that you can connect any browser to it. -* `testem ci` Runs tests an all available/detected local browsers. -* `testem ci -R dot -l chrome` Runs tests with Chrome using dot reported. - -#### Karma - -[Karma](http://karma-runner.github.io/) is used for running tests to be executed in Sauce Labs. -Karma was used because integrating it to Sauce Labs is easier than with Testem. - -You must setup `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables. -See [karma-sauce-launcher project documentation](https://github.com/karma-runner/karma-sauce-launcher#username). Browsers used to test are specified in [karma.conf.js](karma.conf.js). - -You can run tests with all browsers: - - grunt karma - -Tests are run sequentially in batches of browsers to prevent timeouts in Sauce Labs. -You can also run single set of browsers to see test results faster: - - grunt karma:sauce0 - - -## Release - -**Before releasing, make sure there are no uncommitted files, -tests pass and jshint gives no errors.** - -Creating a new release of the package is simple: - -1. Commit and push all changes -2. Run local tests and linters with `npm test` -3. Make sure Sauce Labs tests pass -4. Run `grunt release`, which will create new tag and publish code to GitHub - - Bower detects your new version of git tag. - -5. Edit GitHub release notes - -By default, patch release is done. You can specify the version bump as a parameter: - - grunt release:major - -Valid version bump values: `major`, `minor`, `patch`. - - -## Decision log - -* Animate SVG paths with CSS3 transitions to make animations smooth. -* API must provide built-in shapes and a way to use totally custom SVG. -* Document manually. More overhead and risk of out dated information but easier to get started and contribute with pull requests. -* Animate paths with JS because IE does not support CSS transitions for SVG properties. This also allows -animation customizations and possible even using different easings per animation(in future). -* Expose ProgressBar so it can be used with basic module loaders or as a global. -* Bundle shifty inside the final distributable instead of requiring users to install both libs. If someone has already included shifty, then a custom build should be made. -* Ship distributables to Bower. Fully automate releasing. -* Ship distributables also to NPM to ease life of Browserify users. -* Delegate shifty dependency handling to NPM instead of keeping it in repository but still bundle it inside the final distributable. -* Automate tests so that testing is locally fast and CI runs tests with more browsers in Sauce Labs -* Because of introducing text attribute, the library must modify CSS also. Provide user an option to make CSS them selves. -* Keep **master** branch as a release branch so that new users can see the documentation for latest release instead of development version. -* Add some tasks to package.json aside with grunt tasks. I would want to move from Grunt to npm scripts totally but Sauce Labs tests are run with grunt. diff --git a/node_modules/progressbar.js/LICENSE b/node_modules/progressbar.js/LICENSE index 41ebeb1..a399391 100644 --- a/node_modules/progressbar.js/LICENSE +++ b/node_modules/progressbar.js/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Kimmo Brunfeldt +Copyright (c) 2015 Kimmo Brunfeldt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/progressbar.js/README.md b/node_modules/progressbar.js/README.md index f8f6f93..2256901 100644 --- a/node_modules/progressbar.js/README.md +++ b/node_modules/progressbar.js/README.md @@ -1,22 +1,23 @@ # ProgressBar.js -**Version: 0.9.0** ([*previous stable*](https://github.com/kimmobrunfeldt/progressbar.js/tree/0.8.1)) -
-![Demo animation](docs/animation.gif) +![Demo animation](docs/img/animation.gif)
Responsive and slick progress bars with animated SVG paths. -Use built-in shapes or [create your own paths](#pathpath-options). -[Customize](#custom-animations) the animations as you wish. +Use built-in shapes or [create your own paths](http://progressbarjs.readthedocs.org/en/latest/api/path). +[Customize](http://progressbarjs.readthedocs.org/en/latest/api/parameters#custom-animations) the animations as you wish. +Documentation is [hosted at readthedocs.org](http://progressbarjs.readthedocs.org/en/latest/). **Shortcuts** -* [How to install](#installing-options) +* [Get started](http://progressbarjs.readthedocs.org/en/latest/) * [Demo & Examples](https://kimmobrunfeldt.github.io/progressbar.js) * [**Try** in JSFiddle](http://jsfiddle.net/kimmobrunfeldt/8xa87k31/392/) -* [API documentation](#api) +* [API documentation](http://progressbarjs.readthedocs.org/en/latest/api/shape) +* [Migration between versions](http://progressbarjs.readthedocs.org/en/latest/#migrations) +* [react-progressbar.js](https://github.com/kimmobrunfeldt/react-progressbar.js) progress bars in React. **Build status** @@ -25,611 +26,10 @@ Use built-in shapes or [create your own paths](#pathpath-options). [![Sauce Test Status](https://saucelabs.com/browser-matrix/kimmobrunfeldt.svg)](https://saucelabs.com/u/kimmobrunfeldt) -# Get started - -*ProgressBar.js* is lightweight, MIT licensed and supports all major browsers including **IE9+**. -See complete examples in [examples](#examples) section. - -#### Installing options: - -* Using bower - - bower install progressbar.js - -* Using npm - - npm install progressbar.js - -* Including [*dist/progressbar.js*](dist/progressbar.js) or [dist/progressbar.min.js](dist/progressbar.min.js) from latest tag to your project. - -#### Loading module - -CommonJS - -```javascript -var ProgressBar = require('progressbar.js') -var line = new ProgressBar.Line('#container'); -``` - -AMD - -```javascript -require.config({ - paths: {"progressbar": "../bower_components/progressbar.js/dist/progressbar"} -}); - -define(['progressbar'], function(ProgressBar) { - var line = new ProgressBar.Line('#container'); -}); -``` - -Global variable - -```javascript -// If you aren't using any module loader, progressbar.js exposes -// global variable: window.ProgressBar -var line = new ProgressBar.Line('#container'); -``` - -Files in `dist/` folder are UMD modules built with Browserify's `--standalone` switch. Read more about [standalone Browserify builds](http://www.forbeslindesay.co.uk/post/46324645400/standalone-browserify-builds). - - -# How it works - -Progress bars are just regular SVG paths. -Read [Jake Archibald's blog post](http://jakearchibald.com/2013/animated-line-drawing-svg/) to see how the path drawing works under the hood. - -*ProgressBar.js* uses [shifty](https://jeremyckahn.github.io/shifty/) tweening library to animate path drawing. -So in other words, animation is done with JavaScript using [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame). -Animating with JS gives more control over the animation and is supported across major browsers. For example IE [does not support](https://connect.microsoft.com/IE/feedbackdetail/view/920928/ie-11-css-transition-property-not-working-for-svg-elements) -animating SVG properties with CSS transitions. - - -# API - -**NOTE:** Line, Circle and SemiCircle all point to the same -documentation which is named Shape. You almost certainly should -replace it(Shape) with Line, Circle or SemiCircle. - -**Example:** if documentation states `Shape.animate()`, replace it with -`Circle.animate()`, simple. Shape is the base object for all -progress bars and currently undocumented internal module. - -[**ProgressBar**](#api) - -* [Line(container, [*options*])](#shapecontainer-options) - * [*svg*](#shapesvg) - * [*path*](#shapepath) - * [*trail*](#shapetrail) - * [*text*](#shapetext) - * [animate(progress, [*options*], [*cb*])](#shapeanimateprogress-options-cb) - * [set(progress)](#shapesetprogress) - * [stop()](#shapestop) - * [value()](#shapevalue) - * [setText(text)](#shapesettexttext) - * [destroy()](#shapedestroy) - - -* [Circle(container, [*options*])](#shapecontainer-options) - * [*svg*](#shapesvg) - * [*path*](#shapepath) - * [*trail*](#shapetrail) - * [*text*](#shapetext) - * [animate(progress, [*options*], [*cb*])](#shapeanimateprogress-options-cb) - * [set(progress)](#shapesetprogress) - * [stop()](#shapestop) - * [value()](#shapevalue) - * [setText(text)](#shapesettexttext) - * [destroy()](#shapedestroy) - - -* [SemiCircle(container, [*options*])](#shapecontainer-options) - * [*svg*](#shapesvg) - * [*path*](#shapepath) - * [*trail*](#shapetrail) - * [*text*](#shapetext) - * [animate(progress, [*options*], [*cb*])](#shapeanimateprogress-options-cb) - * [set(progress)](#shapesetprogress) - * [stop()](#shapestop) - * [value()](#shapevalue) - * [setText(text)](#shapesettexttext) - * [destroy()](#shapedestroy) - - -* [Path(path, [*options*])](#pathpath-options) - * [*path*](#pathpath) - * [animate(progress, [*options*], [*cb*])](#pathanimateprogress-options-cb) - * [set(progress)](#pathsetprogress) - * [stop()](#pathstop) - * [value()](#pathvalue) - -Functions use node-style callback convention. Callback function is always the last given parameter. - -Shapes have different SVG canvas sizes: - -Shape | Canvas size ------------|------------------------ -Circle | `100x100` -SemiCircle | `100x50` -Line | `100x{opts.strokeWidth}` - -All shapes are fitted exactly to their canvases. - -**Important:** make sure that your container has same aspect ratio -as the SVG canvas. For example: if you are using SemiCircle, -set e.g. - -```css -#container { - width: 300px; - height: 150px; -} -``` - -## Shape(container, [*options*]) - -Line, Circle or SemiCircle shaped progress bar. Appends SVG to container. - -**Example** - -```javascript -var progressBar = new ProgressBar.Circle('#container', { - strokeWidth: 2 -}); -``` - -With Line shape, you can control the width of the line by specifying e.g. `height: 5px` -with CSS. - -**Parameters** - -* `container` Element where SVG is added. Query string or element. - - For example `"#container"` or `document.getElementById("#container")` - -* `options` Options for path drawing. - - ```javascript - { - // Stroke color. - // Default: "#555" - color: "#3a3a3a", - - // Width of the stroke. - // Unit is percentage of SVG canvas' size. - // Default: 1.0 - strokeWidth: 2.1, - - // If trail options are not defined, trail won't be drawn - - // Color for lighter trail stroke - // underneath the actual progress path. - // Default: '#eee' - trailColor: "#f4f4f4", - - // Width of the trail stroke. Trail is always centered relative to - // actual progress path. - // Default: same as strokeWidth - trailWidth: 0.8, - - // Inline CSS styles for the created SVG element - // Set null to disable all default styles. - // You can disable individual defaults by setting them to `null`. - svgStyle: { - display: 'block', - - // Important: make sure that your container has same - // aspect ratio as the SVG canvas. See SVG canvas sizes above. - width: '100%' - }, - - // Text options. Text element is a

element appended to container - // You can add CSS rules for the text element with the className - // NOTE: When text is set, 'position: relative' will be set to the - // container for centering. You can also prevent all default inline - // styles with 'text.style: null' - // Default: null - text: { - // Initial value for text. - // Default: null - value: 'Text', - - // Class name for text element. - // Default: 'progressbar-text' - className: 'progressbar__label', - - // Inline CSS styles for the text element. - // If you want to modify all CSS your self, set null to disable - // all default styles. - // You can disable individual defaults by setting them to `null`. - // If the style option contains values, container is automatically - // set to position: relative. - // Default: object speficied below - style: { - // Text color. - // Default: same as stroke color (options.color) - color: '#f00', - position: 'absolute', - left: '50%', - top: '50%', - padding: 0, - margin: 0, - // You can specify styles which will be browser prefixed - transform: { - prefix: true, - value: 'translate(-50%, -50%)' - } - }, - - // Only effective if the shape is SemiCircle. - // If true, baseline for text is aligned with bottom of - // the SVG canvas. If false, bottom line of SVG canvas - // is in the center of text. - // Default: true - alignToBottom: true - }, - - // Fill color for the shape. If null, no fill. - // Default: null - fill: "rgba(0, 0, 0, 0.5)", - - // Duration for animation in milliseconds - // Default: 800 - duration: 1200, - - // Easing for animation. See #easing section. - // Default: "linear" - easing: "easeOut", - - // See #custom-animations section - // Built-in shape passes reference to itself and a custom attachment - // object to step function - from: { color: '#eee' }, - to: { color: '#000' }, - step: function(state, circle, attachment) { - circle.path.setAttribute('stroke', state.color); - } - } - ``` - -## Shape.svg - -Reference to [SVG](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg) element where progress bar is drawn. - -## Shape.path - -Reference to [SVG path](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/path) which presents the actual progress bar. - -## Shape.trail - -Reference to [SVG path](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/path) which presents the trail of the progress bar. -Returns `null` if trail is not defined. - -## Shape.text - -Reference to [p element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p) which presents the text label for progress bar. -Returns `null` if text is not defined. - -## Shape.animate(progress, [*options*], [*cb*]) - -Animates drawing of a shape. - -**Example** - -```javascript -progressBar.animate(0.3, { - duration: 800 -}, function() { - console.log('Animation has finished'); -}); -``` - -**Parameters** - -* `progress` progress from 0 to 1. -* `options` Animation options. These options override the defaults given in initialization. - - ```javascript - { - // Duration for animation in milliseconds - // Default: 800 - duration: 1200, - - // Easing for animation. See #easing section. - // Default: "linear" - easing: "easeInOut", - - // See #custom-animations section - // Built-in shape passes reference to itself and a custom attachment - // object to step function - from: { color: '#eee' }, - to: { color: '#000' }, - step: function(state, circle, attachment) { - circle.path.setAttribute('stroke', state.color); - } - } - ``` - -* `cb` Callback function which is called after animation ends. - -## Shape.set(progress) - -Sets progress instantly without animation. Clears all animations -for path. - -## Shape.stop() - -Stops animation to its current position. - -## Shape.value() - -Returns current shown progress from 0 to 1. This value changes when animation is running. - -## Shape.setText(text) - -Sets text to given a string. If you need to dynamically modify the text element, -see [.text](#shapetext) attribute. - -## Shape.destroy() - -Removes SVG element from container and removes all references to DOM elements. Destroying is irreversible. - -
-
- -## Path(path, [*options*]) - -Custom shaped progress bar. You can create arbitrary shaped progress bars by -passing a SVG path created with e.g. Adobe Illustrator. It's on caller's responsibility to append SVG to DOM. - -**Example** - -Assuming there was SVG object with heart shaped path in HTML - -```html - - - - -``` - -Initialization would be this easy - -```javascript -var svgPath = document.getElementById("heart-path"); -var path = new ProgressBar.Path(svgPath, { - duration: 300 -}); -``` - -**Working with embedded SVG** - -If the SVG was not inline in the HTML but instead in, say, an `` tag, we'd have to take extra steps to wait until it has loaded and then access it differently since it's in a separate DOM tree. Given e.g.: - -```html -No SVG support :( -``` - -we could do - -```javascript -var heart = document.getElementById('heart'); -heart.addEventListener('load', function () { -var path = new ProgressBar.Path(heartObject.contentDocument.querySelector('#heart-path'), { - duration: 300 -}); -``` - -**Parameters** - -* `path` [SVG Path](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) object. For example `$('svg > path:first-child')[0]`. -* `options` Animation options. - - ```javascript - { - // Duration for animation in milliseconds - // Default: 800 - duration: 1200, - - // Easing for animation. See #easing section. - // Default: "linear" - easing: "easeIn", - - // Attachment which can be any object - // you need to modify within the step function. - // Passed as a parameter to step function. - // Default: undefined - attachment: document.querySelector('#container > svg'), - - // See #custom-animations section - from: { color: '#eee' }, - to: { color: '#000' }, - step: function(state, path, attachment) { - // Do any modifications to attachment and/or path attributes - } - } - ``` - -## Path.path - -Reference to [SVG path](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/path) which presents the actual progress bar. - -## Path.animate(progress, [*options*], [*cb*]) - -Animates drawing of path. - -**Example** - -```javascript -path.animate(0.3, { - duration: 800 -}, function() { - console.log('Animation has finished'); -}); -``` - -**Parameters** - -* `progress` progress from 0 to 1. -* `options` Animation options. These options override the defaults given in initialization. - - ```javascript - { - // Duration for animation in milliseconds - // Default: 800 - duration: 1200, - - // Easing for animation. See #easing section. - // Default: "linear" - easing: "easeOut", - - // Attachment which can be any object - // you need to modify within the step function. - // Passed as a parameter to step function. - // Default: undefined - attachment: document.querySelector('#container > svg'), - - // See #custom-animations section - from: { color: '#eee' }, - to: { color: '#000' }, - step: function(state, path, attachment) { - // Do any modifications to attachment and/or path attributes - } - } - ``` - -* `cb` Callback function which is called after transition ends. - -## Path.set(progress) - -Set progress instantly without animation. Clears all transitions -for path. - -## Path.stop() - -Stops animation to its current position. - -## Path.value() - -Returns current shown progress from 0 to 1. This value changes when animation is running. - -
-
- -# Parameters in detail - -## Easing - -Easing functions [provided with *shifty* are supported](https://github.com/jeremyckahn/shifty/blob/master/src/shifty.formulas.js). - -A few basic easing options: - -* `"linear"` -* `"easeIn"` -* `"easeOut"` -* `"easeInOut"` - -# Custom animations - -See [example in demo page](https://kimmobrunfeldt.github.io/progressbar.js#example-custom-animation). - -Customizing animations is possible with the help of `from`, `to` and `step` parameters. -Tweening engine changes defined values over time and calls step function for each animation's frame. - -* `from` Object containing values which should be tweened. - These values represent the starting values of the animation. Default: `{}`. - - For example - - ```javascript - { - // Start from thin gray line - width: 0.1, - color: "#eee" - } - ``` - - Thanks to shifty, you can tween values in formats like `translateX(45px)`, `rgb(0,255,0)` and `#fff`. - See all supported string formats from [shifty's documentation](http://jeremyckahn.github.io/shifty/dist/doc/modules/Tweenable.token.html) - - Easing defined as option for animation applies to all of the specified values. - -* `to` Object containing values which should be tweened. These represent the final values after animation is done. Default: `{}`. - - For example - - ```javascript - { - // Finish to thick black line - width: 1, - color: "#000" - } - ``` - - *Signature must match `from`* - -* `step` Function called for each animation step. Tweened values, a reference to the path or shape, and an attachment are passed as parameters. Attachment can be reference to any object you need to modify within step function. Default: `function() {}`. - - **This function is called multiple times per second. - To make sure animations run smoothly, keep it minimal.** - - For example - - ```javascript - function(state, shape, attachment) { - shape.path.setAttribute('stroke-width', state.width); - shape.path.setAttribute('stroke', state.color); - attachment.text.innerHTML = shape.value()*100; - } - ``` - -**Note:** There's a big difference between passing the `from` and `to` parameters in initialization -of progress bar compared to passing in `.animate()` call. Here's example code and illustrations to explain the difference: - -**Pass in initialization** - -```javascript -var bar = new ProgressBar.Line('#container', { - from: { color: '#000 '}, - to: { color: '#888 '}, - step: function(state, bar, attachment) { - bar.path.setAttribute('stroke', state.color); - } -}); -``` - -![](docs/animate-init.png) - - -**Pass in `.animate()` call** - -```javascript -var bar = new ProgressBar.Line('#container', { - step: function(state, bar, attachment) { - bar.path.setAttribute('stroke', state.color); - } -}); - -var opts = { - from: { color: '#000 '}, - to: { color: '#888 '} -}; -bar.animate(0.5, opts); -``` - -![](docs/animate-call.png) - - -## Examples - -* [**Minimal**](http://kimmobrunfeldt.github.io/progressbar.js/examples/minimal/) [*see code*](https://github.com/kimmobrunfeldt/progressbar.js/tree/gh-pages/examples/minimal) -* [**File upload**](http://kimmobrunfeldt.github.io/progressbar.js/examples/upload/) [*see code*](https://github.com/kimmobrunfeldt/progressbar.js/tree/gh-pages/examples/upload) -* [**Telegram**](http://kimmobrunfeldt.github.io/progressbar.js/examples/telegram/) [*see code*](https://github.com/kimmobrunfeldt/progressbar.js/tree/gh-pages/examples/telegram) -* [**Password strength**](http://kimmobrunfeldt.github.io/progressbar.js/examples/password-strength/) [*see code*](https://github.com/kimmobrunfeldt/progressbar.js/tree/gh-pages/examples/password-strength) - # Contributing -See [documentation for contributors](CONTRIBUTING.md). +See [documentation for contributors](http://progressbarjs.readthedocs.org/en/latest/contributing/). + # Thanks diff --git a/node_modules/progressbar.js/dist/progressbar.js b/node_modules/progressbar.js/dist/progressbar.js index e3de2c5..c0a8dae 100644 --- a/node_modules/progressbar.js/dist/progressbar.js +++ b/node_modules/progressbar.js/dist/progressbar.js @@ -1,13 +1,13 @@ -// ProgressBar.js 0.9.0 +// ProgressBar.js 1.0.1 // https://kimmobrunfeldt.github.io/progressbar.js // License: MIT (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ProgressBar = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o} fromTweenParams * @param {Object|string|Function} easing * @return {Object.} + * @private */ function composeEasingObject (fromTweenParams, easing) { var composedEasing = {}; @@ -550,9 +561,10 @@ var Tweenable = (function () { } }; - /*! + /** * Filters are used for transforming the properties of a tween at various * points in a Tweenable's life cycle. See the README for more info on this. + * @private */ Tweenable.prototype.filter = {}; @@ -810,7 +822,7 @@ var Tweenable = (function () { }()); // jshint maxlen:100 -/*! +/** * The Bezier magic in this file is adapted/copied almost wholesale from * [Scripty2](https://github.com/madrobby/scripty2/blob/master/src/effects/transitions/cubic-bezier.js), * which was adapted from Apple code (which probably came from @@ -818,7 +830,7 @@ var Tweenable = (function () { * Special thanks to Apple and Thomas Fuchs for much of this code. */ -/*! +/** * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -917,7 +929,7 @@ var Tweenable = (function () { ay = 1.0 - cy - by; return solve(t, solveEpsilon(duration)); } - /*! + /** * getCubicBezierTransition(x1, y1, x2, y2) -> Function * * Generates a transition easing function that is compatible @@ -932,6 +944,7 @@ var Tweenable = (function () { * @param {number} x2 * @param {number} y2 * @return {function} + * @private */ function getCubicBezierTransition (x1, y1, x2, y2) { return function (pos) { @@ -1206,11 +1219,12 @@ var Tweenable = (function () { ;(function (Tweenable) { - /*! + /** * @typedef {{ * formatString: string * chunkNames: Array. * }} + * @private */ var formatManifest; @@ -1229,11 +1243,12 @@ var Tweenable = (function () { // HELPERS - /*! + /** * @param {Array.number} rawValues * @param {string} prefix * * @return {Array.} + * @private */ function getFormatChunksFrom (rawValues, prefix) { var accumulator = []; @@ -1248,10 +1263,11 @@ var Tweenable = (function () { return accumulator; } - /*! + /** * @param {string} formattedString * * @return {string} + * @private */ function getFormatStringFrom (formattedString) { var chunks = formattedString.match(R_FORMAT_CHUNKS); @@ -1277,12 +1293,13 @@ var Tweenable = (function () { return chunks.join(VALUE_PLACEHOLDER); } - /*! + /** * Convert all hex color values within a string to an rgb string. * * @param {Object} stateObject * * @return {Object} The modified obj + * @private */ function sanitizeObjectForHexProps (stateObject) { Tweenable.each(stateObject, function (prop) { @@ -1294,19 +1311,21 @@ var Tweenable = (function () { }); } - /*! + /** * @param {string} str * * @return {string} + * @private */ function sanitizeHexChunksToRGB (str) { return filterStringChunks(R_HEX, str, convertHexToRGB); } - /*! + /** * @param {string} hexString * * @return {string} + * @private */ function convertHexToRGB (hexString) { var rgbArr = hexToRGBArray(hexString); @@ -1314,7 +1333,7 @@ var Tweenable = (function () { } var hexToRGBArray_returnArray = []; - /*! + /** * Convert a hexadecimal string to an array with three items, one each for * the red, blue, and green decimal values. * @@ -1322,6 +1341,7 @@ var Tweenable = (function () { * * @returns {Array.} The converted Array of RGB values if `hex` is a * valid string, or an Array of three 0's. + * @private */ function hexToRGBArray (hex) { @@ -1341,18 +1361,19 @@ var Tweenable = (function () { return hexToRGBArray_returnArray; } - /*! + /** * Convert a base-16 number to base-10. * * @param {Number|String} hex The value to convert * * @returns {Number} The base-10 equivalent of `hex`. + * @private */ function hexToDec (hex) { return parseInt(hex, 16); } - /*! + /** * Runs a filter operation on all chunks of a string that match a RegExp * * @param {RegExp} pattern @@ -1360,6 +1381,7 @@ var Tweenable = (function () { * @param {function(string)} filter * * @return {string} + * @private */ function filterStringChunks (pattern, unfilteredString, filter) { var pattenMatches = unfilteredString.match(pattern); @@ -1379,21 +1401,23 @@ var Tweenable = (function () { return filteredString; } - /*! + /** * Check for floating point values within rgb strings and rounds them. * * @param {string} formattedString * * @return {string} + * @private */ function sanitizeRGBChunks (formattedString) { return filterStringChunks(R_RGB, formattedString, sanitizeRGBChunk); } - /*! + /** * @param {string} rgbChunk * * @return {string} + * @private */ function sanitizeRGBChunk (rgbChunk) { var numbers = rgbChunk.match(R_UNFORMATTED_VALUES); @@ -1409,11 +1433,12 @@ var Tweenable = (function () { return sanitizedString; } - /*! + /** * @param {Object} stateObject * * @return {Object} An Object of formatManifests that correspond to * the string properties of stateObject + * @private */ function getFormatManifests (stateObject) { var manifestAccumulator = {}; @@ -1434,9 +1459,10 @@ var Tweenable = (function () { return manifestAccumulator; } - /*! + /** * @param {Object} stateObject * @param {Object} formatManifests + * @private */ function expandFormattedProperties (stateObject, formatManifests) { Tweenable.each(formatManifests, function (prop) { @@ -1452,9 +1478,10 @@ var Tweenable = (function () { }); } - /*! + /** * @param {Object} stateObject * @param {Object} formatManifests + * @private */ function collapseFormattedProperties (stateObject, formatManifests) { Tweenable.each(formatManifests, function (prop) { @@ -1469,11 +1496,12 @@ var Tweenable = (function () { }); } - /*! + /** * @param {Object} stateObject * @param {Array.} chunkNames * * @return {Object} The extracted value chunks. + * @private */ function extractPropertyChunks (stateObject, chunkNames) { var extractedValues = {}; @@ -1489,11 +1517,12 @@ var Tweenable = (function () { } var getValuesList_accumulator = []; - /*! + /** * @param {Object} stateObject * @param {Array.} chunkNames * * @return {Array.} + * @private */ function getValuesList (stateObject, chunkNames) { getValuesList_accumulator.length = 0; @@ -1506,11 +1535,12 @@ var Tweenable = (function () { return getValuesList_accumulator; } - /*! + /** * @param {string} formatString * @param {Array.} rawValues * * @return {string} + * @private */ function getFormattedValues (formatString, rawValues) { var formattedValueString = formatString; @@ -1524,21 +1554,23 @@ var Tweenable = (function () { return formattedValueString; } - /*! + /** * Note: It's the duty of the caller to convert the Array elements of the * return value into numbers. This is a performance optimization. * * @param {string} formattedString * * @return {Array.|null} + * @private */ function getValuesFrom (formattedString) { return formattedString.match(R_UNFORMATTED_VALUES); } - /*! + /** * @param {Object} easingObject * @param {Object} tokenData + * @private */ function expandEasingObject (easingObject, tokenData) { Tweenable.each(tokenData, function (prop) { @@ -1567,9 +1599,10 @@ var Tweenable = (function () { }); } - /*! + /** * @param {Object} easingObject * @param {Object} tokenData + * @private */ function collapseEasingObject (easingObject, tokenData) { Tweenable.each(tokenData, function (prop) { @@ -1636,6 +1669,8 @@ var Circle = function Circle(container, options) { ' a {radius},{radius} 0 1 1 0,{2radius}' + ' a {radius},{radius} 0 1 1 0,-{2radius}'; + this.containerAspectRatio = 1; + Shape.apply(this, arguments); }; @@ -1725,6 +1760,11 @@ var EASING_ALIASES = { }; var Path = function Path(path, opts) { + // Throw a better error if not initialized with `new` keyword + if (!(this instanceof Path)) { + throw new Error('Constructor was called without new keyword'); + } + // Default parameters for animation opts = utils.extend({ duration: 800, @@ -1867,7 +1907,6 @@ Path.prototype._calculateTo = function _calculateTo(progress, easing) { Path.prototype._stopTween = function _stopTween() { if (this._tweenable !== null) { this._tweenable.stop(); - this._tweenable.dispose(); this._tweenable = null; } }; @@ -1896,6 +1935,8 @@ var SemiCircle = function SemiCircle(container, options) { 'M 50,50 m -{radius},0' + ' a {radius},{radius} 0 1 1 {2radius},0'; + this.containerAspectRatio = 2; + Shape.apply(this, arguments); }; @@ -1906,20 +1947,20 @@ SemiCircle.prototype._initializeSvg = function _initializeSvg(svg, opts) { svg.setAttribute('viewBox', '0 0 100 50'); }; -SemiCircle.prototype._initializeTextElement = function _initializeTextElement( +SemiCircle.prototype._initializeTextContainer = function _initializeTextContainer( opts, container, - element + textContainer ) { if (opts.text.style) { // Reset top style - element.style.top = 'auto'; + textContainer.style.top = 'auto'; + textContainer.style.bottom = '0'; - element.style.bottom = '0'; if (opts.text.alignToBottom) { - utils.setStyle(element, 'transform', 'translate(-50%, 0)'); + utils.setStyle(textContainer, 'transform', 'translate(-50%, 0)'); } else { - utils.setStyle(element, 'transform', 'translate(-50%, 50%)'); + utils.setStyle(textContainer, 'transform', 'translate(-50%, 50%)'); } } }; @@ -1975,16 +2016,27 @@ var Shape = function Shape(container, opts) { value: 'translate(-50%, -50%)' } }, + autoStyleContainer: true, alignToBottom: true, - value: '', + value: null, className: 'progressbar-text' }, svgStyle: { display: 'block', width: '100%' - } + }, + warnings: false }, opts, true); // Use recursive extend + // If user specifies e.g. svgStyle or text style, the whole object + // should replace the defaults to make working with styles easier + if (utils.isObject(opts) && opts.svgStyle !== undefined) { + this._opts.svgStyle = opts.svgStyle; + } + if (utils.isObject(opts) && utils.isObject(opts.text) && opts.text.style !== undefined) { + this._opts.text.style = opts.text.style; + } + var svgView = this._createSvgView(this._opts); var element; @@ -2000,28 +2052,29 @@ var Shape = function Shape(container, opts) { this._container = element; this._container.appendChild(svgView.svg); + if (this._opts.warnings) { + this._warnContainerAspectRatio(this._container); + } if (this._opts.svgStyle) { utils.setStyles(svgView.svg, this._opts.svgStyle); } - this.text = null; - if (this._opts.text.value) { - this.text = this._createTextElement(this._opts, this._container); - this._container.appendChild(this.text); - } - // Expose public attributes before Path initialization this.svg = svgView.svg; this.path = svgView.path; this.trail = svgView.trail; - // this.text is also a public attribute + this.text = null; var newOpts = utils.extend({ attachment: undefined, shape: this }, this._opts); this._progressPath = new Path(svgView.path, newOpts); + + if (utils.isObject(this._opts.text) && this._opts.text.value !== null) { + this.setText(this._opts.text.value); + } }; Shape.prototype.animate = function animate(progress, opts, cb) { @@ -2083,20 +2136,24 @@ Shape.prototype.value = function value() { return this._progressPath.value(); }; -Shape.prototype.setText = function setText(text) { +Shape.prototype.setText = function setText(newText) { if (this._progressPath === null) { throw new Error(DESTROYED_ERROR); } if (this.text === null) { // Create new text node - this.text = this._createTextElement(this._opts, this._container); + this.text = this._createTextContainer(this._opts, this._container); this._container.appendChild(this.text); } - // Remove previous text node and add new - this.text.removeChild(this.text.firstChild); - this.text.appendChild(document.createTextNode(text)); + // Remove previous text and add new + if (utils.isObject(newText)) { + utils.removeChildren(this.text); + this.text.appendChild(newText); + } else { + this.text.innerHTML = newText; + } }; Shape.prototype._createSvgView = function _createSvgView(opts) { @@ -2170,30 +2227,29 @@ Shape.prototype._createPathElement = function _createPathElement(pathString, opt return path; }; -Shape.prototype._createTextElement = function _createTextElement(opts, container) { - var element = document.createElement('p'); - element.appendChild(document.createTextNode(opts.text.value)); +Shape.prototype._createTextContainer = function _createTextContainer(opts, container) { + var textContainer = document.createElement('div'); + textContainer.className = opts.text.className; var textStyle = opts.text.style; if (textStyle) { - container.style.position = 'relative'; - - utils.setStyles(element, textStyle); + if (opts.text.autoStyleContainer) { + container.style.position = 'relative'; + } + utils.setStyles(textContainer, textStyle); // Default text color to progress bar's color if (!textStyle.color) { - element.style.color = opts.color; + textContainer.style.color = opts.color; } } - element.className = opts.text.className; - - this._initializeTextElement(opts, container, element); - return element; + this._initializeTextContainer(opts, container, textContainer); + return textContainer; }; // Give custom shapes possibility to modify text element -Shape.prototype._initializeTextElement = function _initializeTextElement(opts, container, element) { +Shape.prototype._initializeTextContainer = function(opts, container, element) { // By default, no-op // Custom shapes should respect API options, such as text.style }; @@ -2206,12 +2262,40 @@ Shape.prototype._trailString = function _trailString(opts) { throw new Error('Override this function for each progress bar'); }; +Shape.prototype._warnContainerAspectRatio = function _warnContainerAspectRatio(container) { + if (!this.containerAspectRatio) { + return; + } + + var computedStyle = window.getComputedStyle(container, null); + var width = parseFloat(computedStyle.getPropertyValue('width'), 10); + var height = parseFloat(computedStyle.getPropertyValue('height'), 10); + if (!utils.floatEquals(this.containerAspectRatio, width / height)) { + console.warn( + 'Incorrect aspect ratio of container', + '#' + container.id, + 'detected:', + computedStyle.getPropertyValue('width') + '(width)', + '/', + computedStyle.getPropertyValue('height') + '(height)', + '=', + width / height + ); + + console.warn( + 'Aspect ratio of should be', + this.containerAspectRatio + ); + } +}; + module.exports = Shape; },{"./path":5,"./utils":8}],8:[function(require,module,exports){ // Utility functions var PREFIXES = 'Webkit Moz O ms'.split(' '); +var FLOAT_COMPARISON_EPSILON = 0.001; // Copy all attributes from source object to destination object. // destination object is mutated. @@ -2257,12 +2341,14 @@ function render(template, vars) { } function setStyle(element, style, value) { + var elStyle = element.style; // cache for performance + for (var i = 0; i < PREFIXES.length; ++i) { var prefix = PREFIXES[i]; - element.style[prefix + capitalize(style)] = value; + elStyle[prefix + capitalize(style)] = value; } - element.style[style] = value; + elStyle[style] = value; } function setStyles(element, styles) { @@ -2319,6 +2405,17 @@ function forEachObject(object, callback) { } } +function floatEquals(a, b) { + return Math.abs(a - b) < FLOAT_COMPARISON_EPSILON; +} + +// https://coderwall.com/p/nygghw/don-t-use-innerhtml-to-empty-dom-elements +function removeChildren(el) { + while (el.firstChild) { + el.removeChild(el.firstChild); + } +} + module.exports = { extend: extend, render: render, @@ -2328,7 +2425,9 @@ module.exports = { isString: isString, isFunction: isFunction, isObject: isObject, - forEachObject: forEachObject + forEachObject: forEachObject, + floatEquals: floatEquals, + removeChildren: removeChildren }; },{}]},{},[4])(4) diff --git a/node_modules/progressbar.js/dist/progressbar.min.js b/node_modules/progressbar.js/dist/progressbar.min.js index 5ff68bb..52547c2 100644 --- a/node_modules/progressbar.js/dist/progressbar.min.js +++ b/node_modules/progressbar.js/dist/progressbar.min.js @@ -1,6 +1,6 @@ -// ProgressBar.js 0.9.0 +// ProgressBar.js 1.0.1 // https://kimmobrunfeldt.github.io/progressbar.js // License: MIT -!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.ProgressBar=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[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:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ga?0:(a-f)/e;for(h in b)b.hasOwnProperty(h)&&(i=g[h],k="function"==typeof i?i:o[i],b[h]=j(c[h],d[h],k,l));return b}function j(a,b,c,d){return a+(b-a)*c(d)}function k(a,b){var c=n.prototype.filter,d=a._filterArgs;f(c,function(e){"undefined"!=typeof c[e][b]&&c[e][b].apply(a,d)})}function l(a,b,c,d,e,f,g,h,j,l,m){v=b+c+d,w=Math.min(m||u(),v),x=w>=v,y=d-(v-w),a.isPlaying()&&!x?(a._scheduleId=l(a._timeoutHandler,s),k(a,"beforeTween"),b+c>w?i(1,e,f,g,1,1,h):i(w,e,f,g,d,b+c,h),k(a,"afterTween"),j(e,a._attachment,y)):a.isPlaying()&&x&&(j(g,a._attachment,y),a.stop(!0))}function m(a,b){var c={},d=typeof b;return"string"===d||"function"===d?f(a,function(a){c[a]=b}):f(a,function(a){c[a]||(c[a]=b[a]||q)}),c}function n(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=p,"undefined"!=typeof b&&this.setConfig(b)}var o,p,q="linear",r=500,s=1e3/60,t=Date.now?Date.now:function(){return+new Date},u="undefined"!=typeof SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:t;p="undefined"!=typeof window?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||window.mozCancelRequestAnimationFrame&&window.mozRequestAnimationFrame||setTimeout:setTimeout;var v,w,x,y;return n.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._timestamp=u(),this._start(this.get(),this._attachment),this.resume())},n.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._attachment=a.attachment,this._pausedAtTime=null,this._scheduleId=null,this._delay=a.delay||0,this._start=a.start||e,this._step=a.step||e,this._finish=a.finish||e,this._duration=a.duration||r,this._currentState=g({},a.from)||this.get(),this._originalState=this.get(),this._targetState=g({},a.to)||this.get();var b=this;this._timeoutHandler=function(){l(b,b._timestamp,b._delay,b._duration,b._currentState,b._originalState,b._targetState,b._easing,b._step,b._scheduleFunction)};var c=this._currentState,d=this._targetState;return h(d,c),this._easing=m(c,a.easing||q),this._filterArgs=[c,this._originalState,d,this._easing],k(this,"tweenCreated"),this},n.prototype.get=function(){return g({},this._currentState)},n.prototype.set=function(a){this._currentState=a},n.prototype.pause=function(){return this._pausedAtTime=u(),this._isPaused=!0,this},n.prototype.resume=function(){return this._isPaused&&(this._timestamp+=u()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0,this._timeoutHandler(),this},n.prototype.seek=function(a){a=Math.max(a,0);var b=u();return this._timestamp+a===0?this:(this._timestamp=b-a,this.isPlaying()||(this._isTweening=!0,this._isPaused=!1,l(this,this._timestamp,this._delay,this._duration,this._currentState,this._originalState,this._targetState,this._easing,this._step,this._scheduleFunction,b),this.pause()),this)},n.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=e,(b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.oCancelAnimationFrame||b.msCancelAnimationFrame||b.mozCancelRequestAnimationFrame||b.clearTimeout)(this._scheduleId),a&&(k(this,"beforeTween"),i(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),k(this,"afterTween"),k(this,"afterTweenEnd"),this._finish.call(this,this._currentState,this._attachment)),this},n.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},n.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},n.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},n.prototype.filter={},n.prototype.formula={linear:function(a){return a}},o=n.prototype.formula,g(n,{now:u,each:f,tweenProps:i,tweenProp:j,applyFilter:k,shallowCopy:g,defaults:h,composeEasingObject:m}),"function"==typeof SHIFTY_DEBUG_NOW&&(b.timeoutHandler=l),"object"==typeof d?c.exports=n:"function"==typeof a&&a.amd?a(function(){return n}):"undefined"==typeof b.Tweenable&&(b.Tweenable=n),n}();!function(){e.shallowCopy(e.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*(a*a*(((b*=1.525)+1)*a-b)):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin((6*a-1)*(2*Math.PI)/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*(a*a*(((b*=1.525)+1)*a-b)):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}e.setBezierFunction=function(a,c,d,f,g){var h=b(c,d,f,g);return h.displayName=a,h.x1=c,h.y1=d,h.x2=f,h.y2=g,e.prototype.formula[a]=h},e.unsetBezierFunction=function(a){delete e.prototype.formula[a]}}(),function(){function a(a,b,c,d,f,g){return e.tweenProps(d,b,a,c,1,g,f)}var b=new e;b._filterArgs=[],e.interpolate=function(c,d,f,g,h){var i=e.shallowCopy({},c),j=h||0,k=e.composeEasingObject(c,g||"linear");b.set({});var l=b._filterArgs;l.length=0,l[0]=i,l[1]=c,l[2]=d,l[3]=k,e.applyFilter(b,"tweenCreated"),e.applyFilter(b,"beforeTween");var m=a(c,i,d,f,k,j);return e.applyFilter(b,"afterTween"),m}}(),function(a){function b(a,b){var c,d=[],e=a.length;for(c=0;e>c;c++)d.push("_"+b+"_"+c);return d}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),B[0]=h(a.substr(0,2)),B[1]=h(a.substr(2,2)),B[2]=h(a.substr(4,2)),B}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){C.length=0;for(var c=b.length,d=0;c>d;d++)C.push(a[b[d]]);return C}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){var d,e=c[a],f=e.chunkNames,g=f.length,h=b[a];if("string"==typeof h){var i=h.split(" "),j=i[i.length-1];for(d=0;g>d;d++)b[f[d]]=i[d]||j}else for(d=0;g>d;d++)b[f[d]]=h;delete b[a]})}function t(b,c){a.each(c,function(a){var d=c[a],e=d.chunkNames,f=e.length,g=b[e[0]],h=typeof g;if("string"===h){for(var i="",j=0;f>j;j++)i+=" "+b[e[j]],delete b[e[j]];b[a]=i.substr(1)}else b[a]=g})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[];a.prototype.filter.token={tweenCreated:function(a,b,c,e){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(e)}).call(null)},{}],2:[function(a,b,c){var d=a("./shape"),e=a("./utils"),f=function(a,b){this._pathTemplate="M 50,50 m 0,-{radius} a {radius},{radius} 0 1 1 0,{2radius} a {radius},{radius} 0 1 1 0,-{2radius}",d.apply(this,arguments)};f.prototype=new d,f.prototype.constructor=f,f.prototype._pathString=function(a){var b=a.strokeWidth;a.trailWidth&&a.trailWidth>a.strokeWidth&&(b=a.trailWidth);var c=50-b/2;return e.render(this._pathTemplate,{radius:c,"2radius":2*c})},f.prototype._trailString=function(a){return this._pathString(a)},b.exports=f},{"./shape":7,"./utils":8}],3:[function(a,b,c){var d=a("./shape"),e=a("./utils"),f=function(a,b){this._pathTemplate="M 0,{center} L 100,{center}",d.apply(this,arguments)};f.prototype=new d,f.prototype.constructor=f,f.prototype._initializeSvg=function(a,b){a.setAttribute("viewBox","0 0 100 "+b.strokeWidth),a.setAttribute("preserveAspectRatio","none")},f.prototype._pathString=function(a){return e.render(this._pathTemplate,{center:a.strokeWidth/2})},f.prototype._trailString=function(a){return this._pathString(a)},b.exports=f},{"./shape":7,"./utils":8}],4:[function(a,b,c){b.exports={Line:a("./line"),Circle:a("./circle"),SemiCircle:a("./semicircle"),Path:a("./path"),Shape:a("./shape"),utils:a("./utils")}},{"./circle":2,"./line":3,"./path":5,"./semicircle":6,"./shape":7,"./utils":8}],5:[function(a,b,c){var d=a("shifty"),e=a("./utils"),f={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},g=function(a,b){b=e.extend({duration:800,easing:"linear",from:{},to:{},step:function(){}},b);var c;c=e.isString(a)?document.querySelector(a):a,this.path=c,this._opts=b,this._tweenable=null;var d=this.path.getTotalLength();this.path.style.strokeDasharray=d+" "+d,this.set(0)};g.prototype.value=function(){var a=this._getComputedDashOffset(),b=this.path.getTotalLength(),c=1-a/b;return parseFloat(c.toFixed(6),10)},g.prototype.set=function(a){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(a);var b=this._opts.step;if(e.isFunction(b)){var c=this._easing(this._opts.easing),d=this._calculateTo(a,c),f=this._opts.shape||this;b(d,f,this._opts.attachment)}},g.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},g.prototype.animate=function(a,b,c){b=b||{},e.isFunction(b)&&(c=b,b={});var f=e.extend({},b),g=e.extend({},this._opts);b=e.extend(g,b);var h=this._easing(b.easing),i=this._resolveFromAndTo(a,h,f);this.stop(),this.path.getBoundingClientRect();var j=this._getComputedDashOffset(),k=this._progressToOffset(a),l=this;this._tweenable=new d,this._tweenable.tween({from:e.extend({offset:j},i.from),to:e.extend({offset:k},i.to),duration:b.duration,easing:h,step:function(a){l.path.style.strokeDashoffset=a.offset;var c=b.shape||l;b.step(a,c,b.attachment)},finish:function(a){e.isFunction(c)&&c()}})},g.prototype._getComputedDashOffset=function(){var a=window.getComputedStyle(this.path,null);return parseFloat(a.getPropertyValue("stroke-dashoffset"),10)},g.prototype._progressToOffset=function(a){var b=this.path.getTotalLength();return b-a*b},g.prototype._resolveFromAndTo=function(a,b,c){return c.from&&c.to?{from:c.from,to:c.to}:{from:this._calculateFrom(b),to:this._calculateTo(a,b)}},g.prototype._calculateFrom=function(a){return d.interpolate(this._opts.from,this._opts.to,this.value(),a)},g.prototype._calculateTo=function(a,b){return d.interpolate(this._opts.from,this._opts.to,a,b)},g.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(),this._tweenable.dispose(),this._tweenable=null)},g.prototype._easing=function(a){return f.hasOwnProperty(a)?f[a]:a},b.exports=g},{"./utils":8,shifty:1}],6:[function(a,b,c){var d=a("./shape"),e=a("./circle"),f=a("./utils"),g=function(a,b){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",d.apply(this,arguments)};g.prototype=new d,g.prototype.constructor=g,g.prototype._initializeSvg=function(a,b){a.setAttribute("viewBox","0 0 100 50")},g.prototype._initializeTextElement=function(a,b,c){a.text.style&&(c.style.top="auto",c.style.bottom="0",a.text.alignToBottom?f.setStyle(c,"transform","translate(-50%, 0)"):f.setStyle(c,"transform","translate(-50%, 50%)"))},g.prototype._pathString=e.prototype._pathString,g.prototype._trailString=e.prototype._trailString,b.exports=g},{"./circle":2,"./shape":7,"./utils":8}],7:[function(a,b,c){var d=a("./path"),e=a("./utils"),f="Object is destroyed",g=function h(a,b){if(!(this instanceof h))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=e.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},alignToBottom:!0,value:"",className:"progressbar-text"},svgStyle:{display:"block",width:"100%"}},b,!0);var c,f=this._createSvgView(this._opts);if(c=e.isString(a)?document.querySelector(a):a,!c)throw new Error("Container does not exist: "+a);this._container=c,this._container.appendChild(f.svg),this._opts.svgStyle&&e.setStyles(f.svg,this._opts.svgStyle),this.text=null,this._opts.text.value&&(this.text=this._createTextElement(this._opts,this._container),this._container.appendChild(this.text)),this.svg=f.svg,this.path=f.path,this.trail=f.trail;var g=e.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new d(f.path,g)}};g.prototype.animate=function(a,b,c){if(null===this._progressPath)throw new Error(f);this._progressPath.animate(a,b,c)},g.prototype.stop=function(){if(null===this._progressPath)throw new Error(f);void 0!==this._progressPath&&this._progressPath.stop()},g.prototype.destroy=function(){if(null===this._progressPath)throw new Error(f);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},g.prototype.set=function(a){if(null===this._progressPath)throw new Error(f);this._progressPath.set(a)},g.prototype.value=function(){if(null===this._progressPath)throw new Error(f);return void 0===this._progressPath?0:this._progressPath.value()},g.prototype.setText=function(a){if(null===this._progressPath)throw new Error(f);null===this.text&&(this.text=this._createTextElement(this._opts,this._container),this._container.appendChild(this.text)),this.text.removeChild(this.text.firstChild),this.text.appendChild(document.createTextNode(a))},g.prototype._createSvgView=function(a){var b=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(b,a);var c=null;(a.trailColor||a.trailWidth)&&(c=this._createTrail(a),b.appendChild(c));var d=this._createPath(a);return b.appendChild(d),{svg:b,path:d,trail:c}},g.prototype._initializeSvg=function(a,b){a.setAttribute("viewBox","0 0 100 100")},g.prototype._createPath=function(a){var b=this._pathString(a);return this._createPathElement(b,a)},g.prototype._createTrail=function(a){var b=this._trailString(a),c=e.extend({},a);return c.trailColor||(c.trailColor="#eee"),c.trailWidth||(c.trailWidth=c.strokeWidth),c.color=c.trailColor,c.strokeWidth=c.trailWidth,c.fill=null,this._createPathElement(b,c)},g.prototype._createPathElement=function(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg","path");return c.setAttribute("d",a),c.setAttribute("stroke",b.color),c.setAttribute("stroke-width",b.strokeWidth),b.fill?c.setAttribute("fill",b.fill):c.setAttribute("fill-opacity","0"),c},g.prototype._createTextElement=function(a,b){var c=document.createElement("p");c.appendChild(document.createTextNode(a.text.value));var d=a.text.style;return d&&(b.style.position="relative",e.setStyles(c,d),d.color||(c.style.color=a.color)),c.className=a.text.className,this._initializeTextElement(a,b,c),c},g.prototype._initializeTextElement=function(a,b,c){},g.prototype._pathString=function(a){throw new Error("Override this function for each progress bar")},g.prototype._trailString=function(a){throw new Error("Override this function for each progress bar")},b.exports=g},{"./path":5,"./utils":8}],8:[function(a,b,c){function d(a,b,c){a=a||{},b=b||{},c=c||!1;for(var e in b)if(b.hasOwnProperty(e)){var f=a[e],g=b[e];c&&l(f)&&l(g)?a[e]=d(f,g,c):a[e]=g}return a}function e(a,b){var c=a;for(var d in b)if(b.hasOwnProperty(d)){var e=b[d],f="\\{"+d+"\\}",g=new RegExp(f,"g");c=c.replace(g,e)}return c}function f(a,b,c){for(var d=0;da?0:(a-f)/e;for(h in b)b.hasOwnProperty(h)&&(i=g[h],k="function"==typeof i?i:o[i],b[h]=j(c[h],d[h],k,l));return b}function j(a,b,c,d){return a+(b-a)*c(d)}function k(a,b){var c=n.prototype.filter,d=a._filterArgs;f(c,function(e){"undefined"!=typeof c[e][b]&&c[e][b].apply(a,d)})}function l(a,b,c,d,e,f,g,h,j,l,m){v=b+c+d,w=Math.min(m||u(),v),x=w>=v,y=d-(v-w),a.isPlaying()&&(x?(j(g,a._attachment,y),a.stop(!0)):(a._scheduleId=l(a._timeoutHandler,s),k(a,"beforeTween"),b+c>w?i(1,e,f,g,1,1,h):i(w,e,f,g,d,b+c,h),k(a,"afterTween"),j(e,a._attachment,y)))}function m(a,b){var c={},d=typeof b;return"string"===d||"function"===d?f(a,function(a){c[a]=b}):f(a,function(a){c[a]||(c[a]=b[a]||q)}),c}function n(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=p,"undefined"!=typeof b&&this.setConfig(b)}var o,p,q="linear",r=500,s=1e3/60,t=Date.now?Date.now:function(){return+new Date},u="undefined"!=typeof SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:t;p="undefined"!=typeof window?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||window.mozCancelRequestAnimationFrame&&window.mozRequestAnimationFrame||setTimeout:setTimeout;var v,w,x,y;return n.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._timestamp=u(),this._start(this.get(),this._attachment),this.resume())},n.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._attachment=a.attachment,this._pausedAtTime=null,this._scheduleId=null,this._delay=a.delay||0,this._start=a.start||e,this._step=a.step||e,this._finish=a.finish||e,this._duration=a.duration||r,this._currentState=g({},a.from)||this.get(),this._originalState=this.get(),this._targetState=g({},a.to)||this.get();var b=this;this._timeoutHandler=function(){l(b,b._timestamp,b._delay,b._duration,b._currentState,b._originalState,b._targetState,b._easing,b._step,b._scheduleFunction)};var c=this._currentState,d=this._targetState;return h(d,c),this._easing=m(c,a.easing||q),this._filterArgs=[c,this._originalState,d,this._easing],k(this,"tweenCreated"),this},n.prototype.get=function(){return g({},this._currentState)},n.prototype.set=function(a){this._currentState=a},n.prototype.pause=function(){return this._pausedAtTime=u(),this._isPaused=!0,this},n.prototype.resume=function(){return this._isPaused&&(this._timestamp+=u()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0,this._timeoutHandler(),this},n.prototype.seek=function(a){a=Math.max(a,0);var b=u();return this._timestamp+a===0?this:(this._timestamp=b-a,this.isPlaying()||(this._isTweening=!0,this._isPaused=!1,l(this,this._timestamp,this._delay,this._duration,this._currentState,this._originalState,this._targetState,this._easing,this._step,this._scheduleFunction,b),this.pause()),this)},n.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=e,(b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.oCancelAnimationFrame||b.msCancelAnimationFrame||b.mozCancelRequestAnimationFrame||b.clearTimeout)(this._scheduleId),a&&(k(this,"beforeTween"),i(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),k(this,"afterTween"),k(this,"afterTweenEnd"),this._finish.call(this,this._currentState,this._attachment)),this},n.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},n.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},n.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},n.prototype.filter={},n.prototype.formula={linear:function(a){return a}},o=n.prototype.formula,g(n,{now:u,each:f,tweenProps:i,tweenProp:j,applyFilter:k,shallowCopy:g,defaults:h,composeEasingObject:m}),"function"==typeof SHIFTY_DEBUG_NOW&&(b.timeoutHandler=l),"object"==typeof d?c.exports=n:"function"==typeof a&&a.amd?a(function(){return n}):"undefined"==typeof b.Tweenable&&(b.Tweenable=n),n}();!function(){e.shallowCopy(e.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*(a*a*(((b*=1.525)+1)*a-b)):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin((6*a-1)*(2*Math.PI)/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*(a*a*(((b*=1.525)+1)*a-b)):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}e.setBezierFunction=function(a,c,d,f,g){var h=b(c,d,f,g);return h.displayName=a,h.x1=c,h.y1=d,h.x2=f,h.y2=g,e.prototype.formula[a]=h},e.unsetBezierFunction=function(a){delete e.prototype.formula[a]}}(),function(){function a(a,b,c,d,f,g){return e.tweenProps(d,b,a,c,1,g,f)}var b=new e;b._filterArgs=[],e.interpolate=function(c,d,f,g,h){var i=e.shallowCopy({},c),j=h||0,k=e.composeEasingObject(c,g||"linear");b.set({});var l=b._filterArgs;l.length=0,l[0]=i,l[1]=c,l[2]=d,l[3]=k,e.applyFilter(b,"tweenCreated"),e.applyFilter(b,"beforeTween");var m=a(c,i,d,f,k,j);return e.applyFilter(b,"afterTween"),m}}(),function(a){function b(a,b){var c,d=[],e=a.length;for(c=0;e>c;c++)d.push("_"+b+"_"+c);return d}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),B[0]=h(a.substr(0,2)),B[1]=h(a.substr(2,2)),B[2]=h(a.substr(4,2)),B}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){C.length=0;for(var c=b.length,d=0;c>d;d++)C.push(a[b[d]]);return C}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){var d,e=c[a],f=e.chunkNames,g=f.length,h=b[a];if("string"==typeof h){var i=h.split(" "),j=i[i.length-1];for(d=0;g>d;d++)b[f[d]]=i[d]||j}else for(d=0;g>d;d++)b[f[d]]=h;delete b[a]})}function t(b,c){a.each(c,function(a){var d=c[a],e=d.chunkNames,f=e.length,g=b[e[0]],h=typeof g;if("string"===h){for(var i="",j=0;f>j;j++)i+=" "+b[e[j]],delete b[e[j]];b[a]=i.substr(1)}else b[a]=g})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[];a.prototype.filter.token={tweenCreated:function(a,b,c,e){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(e)}).call(null)},{}],2:[function(a,b,c){var d=a("./shape"),e=a("./utils"),f=function(a,b){this._pathTemplate="M 50,50 m 0,-{radius} a {radius},{radius} 0 1 1 0,{2radius} a {radius},{radius} 0 1 1 0,-{2radius}",this.containerAspectRatio=1,d.apply(this,arguments)};f.prototype=new d,f.prototype.constructor=f,f.prototype._pathString=function(a){var b=a.strokeWidth;a.trailWidth&&a.trailWidth>a.strokeWidth&&(b=a.trailWidth);var c=50-b/2;return e.render(this._pathTemplate,{radius:c,"2radius":2*c})},f.prototype._trailString=function(a){return this._pathString(a)},b.exports=f},{"./shape":7,"./utils":8}],3:[function(a,b,c){var d=a("./shape"),e=a("./utils"),f=function(a,b){this._pathTemplate="M 0,{center} L 100,{center}",d.apply(this,arguments)};f.prototype=new d,f.prototype.constructor=f,f.prototype._initializeSvg=function(a,b){a.setAttribute("viewBox","0 0 100 "+b.strokeWidth),a.setAttribute("preserveAspectRatio","none")},f.prototype._pathString=function(a){return e.render(this._pathTemplate,{center:a.strokeWidth/2})},f.prototype._trailString=function(a){return this._pathString(a)},b.exports=f},{"./shape":7,"./utils":8}],4:[function(a,b,c){b.exports={Line:a("./line"),Circle:a("./circle"),SemiCircle:a("./semicircle"),Path:a("./path"),Shape:a("./shape"),utils:a("./utils")}},{"./circle":2,"./line":3,"./path":5,"./semicircle":6,"./shape":7,"./utils":8}],5:[function(a,b,c){var d=a("shifty"),e=a("./utils"),f={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},g=function h(a,b){if(!(this instanceof h))throw new Error("Constructor was called without new keyword");b=e.extend({duration:800,easing:"linear",from:{},to:{},step:function(){}},b);var c;c=e.isString(a)?document.querySelector(a):a,this.path=c,this._opts=b,this._tweenable=null;var d=this.path.getTotalLength();this.path.style.strokeDasharray=d+" "+d,this.set(0)};g.prototype.value=function(){var a=this._getComputedDashOffset(),b=this.path.getTotalLength(),c=1-a/b;return parseFloat(c.toFixed(6),10)},g.prototype.set=function(a){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(a);var b=this._opts.step;if(e.isFunction(b)){var c=this._easing(this._opts.easing),d=this._calculateTo(a,c),f=this._opts.shape||this;b(d,f,this._opts.attachment)}},g.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},g.prototype.animate=function(a,b,c){b=b||{},e.isFunction(b)&&(c=b,b={});var f=e.extend({},b),g=e.extend({},this._opts);b=e.extend(g,b);var h=this._easing(b.easing),i=this._resolveFromAndTo(a,h,f);this.stop(),this.path.getBoundingClientRect();var j=this._getComputedDashOffset(),k=this._progressToOffset(a),l=this;this._tweenable=new d,this._tweenable.tween({from:e.extend({offset:j},i.from),to:e.extend({offset:k},i.to),duration:b.duration,easing:h,step:function(a){l.path.style.strokeDashoffset=a.offset;var c=b.shape||l;b.step(a,c,b.attachment)},finish:function(a){e.isFunction(c)&&c()}})},g.prototype._getComputedDashOffset=function(){var a=window.getComputedStyle(this.path,null);return parseFloat(a.getPropertyValue("stroke-dashoffset"),10)},g.prototype._progressToOffset=function(a){var b=this.path.getTotalLength();return b-a*b},g.prototype._resolveFromAndTo=function(a,b,c){return c.from&&c.to?{from:c.from,to:c.to}:{from:this._calculateFrom(b),to:this._calculateTo(a,b)}},g.prototype._calculateFrom=function(a){return d.interpolate(this._opts.from,this._opts.to,this.value(),a)},g.prototype._calculateTo=function(a,b){return d.interpolate(this._opts.from,this._opts.to,a,b)},g.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(),this._tweenable=null)},g.prototype._easing=function(a){return f.hasOwnProperty(a)?f[a]:a},b.exports=g},{"./utils":8,shifty:1}],6:[function(a,b,c){var d=a("./shape"),e=a("./circle"),f=a("./utils"),g=function(a,b){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,d.apply(this,arguments)};g.prototype=new d,g.prototype.constructor=g,g.prototype._initializeSvg=function(a,b){a.setAttribute("viewBox","0 0 100 50")},g.prototype._initializeTextContainer=function(a,b,c){a.text.style&&(c.style.top="auto",c.style.bottom="0",a.text.alignToBottom?f.setStyle(c,"transform","translate(-50%, 0)"):f.setStyle(c,"transform","translate(-50%, 50%)"))},g.prototype._pathString=e.prototype._pathString,g.prototype._trailString=e.prototype._trailString,b.exports=g},{"./circle":2,"./shape":7,"./utils":8}],7:[function(a,b,c){var d=a("./path"),e=a("./utils"),f="Object is destroyed",g=function h(a,b){if(!(this instanceof h))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=e.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},b,!0),e.isObject(b)&&void 0!==b.svgStyle&&(this._opts.svgStyle=b.svgStyle),e.isObject(b)&&e.isObject(b.text)&&void 0!==b.text.style&&(this._opts.text.style=b.text.style);var c,f=this._createSvgView(this._opts);if(c=e.isString(a)?document.querySelector(a):a,!c)throw new Error("Container does not exist: "+a);this._container=c,this._container.appendChild(f.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&e.setStyles(f.svg,this._opts.svgStyle),this.svg=f.svg,this.path=f.path,this.trail=f.trail,this.text=null;var g=e.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new d(f.path,g),e.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};g.prototype.animate=function(a,b,c){if(null===this._progressPath)throw new Error(f);this._progressPath.animate(a,b,c)},g.prototype.stop=function(){if(null===this._progressPath)throw new Error(f);void 0!==this._progressPath&&this._progressPath.stop()},g.prototype.destroy=function(){if(null===this._progressPath)throw new Error(f);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},g.prototype.set=function(a){if(null===this._progressPath)throw new Error(f);this._progressPath.set(a)},g.prototype.value=function(){if(null===this._progressPath)throw new Error(f);return void 0===this._progressPath?0:this._progressPath.value()},g.prototype.setText=function(a){if(null===this._progressPath)throw new Error(f);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),e.isObject(a)?(e.removeChildren(this.text),this.text.appendChild(a)):this.text.innerHTML=a},g.prototype._createSvgView=function(a){var b=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(b,a);var c=null;(a.trailColor||a.trailWidth)&&(c=this._createTrail(a),b.appendChild(c));var d=this._createPath(a);return b.appendChild(d),{svg:b,path:d,trail:c}},g.prototype._initializeSvg=function(a,b){a.setAttribute("viewBox","0 0 100 100")},g.prototype._createPath=function(a){var b=this._pathString(a);return this._createPathElement(b,a)},g.prototype._createTrail=function(a){var b=this._trailString(a),c=e.extend({},a);return c.trailColor||(c.trailColor="#eee"),c.trailWidth||(c.trailWidth=c.strokeWidth),c.color=c.trailColor,c.strokeWidth=c.trailWidth,c.fill=null,this._createPathElement(b,c)},g.prototype._createPathElement=function(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg","path");return c.setAttribute("d",a),c.setAttribute("stroke",b.color),c.setAttribute("stroke-width",b.strokeWidth),b.fill?c.setAttribute("fill",b.fill):c.setAttribute("fill-opacity","0"),c},g.prototype._createTextContainer=function(a,b){var c=document.createElement("div");c.className=a.text.className;var d=a.text.style;return d&&(a.text.autoStyleContainer&&(b.style.position="relative"),e.setStyles(c,d),d.color||(c.style.color=a.color)),this._initializeTextContainer(a,b,c),c},g.prototype._initializeTextContainer=function(a,b,c){},g.prototype._pathString=function(a){throw new Error("Override this function for each progress bar")},g.prototype._trailString=function(a){throw new Error("Override this function for each progress bar")},g.prototype._warnContainerAspectRatio=function(a){if(this.containerAspectRatio){var b=window.getComputedStyle(a,null),c=parseFloat(b.getPropertyValue("width"),10),d=parseFloat(b.getPropertyValue("height"),10);e.floatEquals(this.containerAspectRatio,c/d)||(console.warn("Incorrect aspect ratio of container","#"+a.id,"detected:",b.getPropertyValue("width")+"(width)","/",b.getPropertyValue("height")+"(height)","=",c/d),console.warn("Aspect ratio of should be",this.containerAspectRatio))}},b.exports=g},{"./path":5,"./utils":8}],8:[function(a,b,c){function d(a,b,c){a=a||{},b=b||{},c=c||!1;for(var e in b)if(b.hasOwnProperty(e)){var f=a[e],g=b[e];c&&l(f)&&l(g)?a[e]=d(f,g,c):a[e]=g}return a}function e(a,b){var c=a;for(var d in b)if(b.hasOwnProperty(d)){var e=b[d],f="\\{"+d+"\\}",g=new RegExp(f,"g");c=c.replace(g,e)}return c}function f(a,b,c){for(var d=a.style,e=0;e