From 8e7917285f637f7b42fa76632bee42cc58670bb1 Mon Sep 17 00:00:00 2001 From: Vladimir Grichina Date: Tue, 21 Jan 2020 19:14:15 -0800 Subject: [PATCH] build dist/ --- dist/nearlib.js | 251 ++++++++++++++++++++++++++++++-------------- dist/nearlib.min.js | 8 +- 2 files changed, 174 insertions(+), 85 deletions(-) diff --git a/dist/nearlib.js b/dist/nearlib.js index 5eaee98d85..8675770582 100644 --- a/dist/nearlib.js +++ b/dist/nearlib.js @@ -38,16 +38,7 @@ class Account { return this._ready || (this._ready = Promise.resolve(this.fetchState())); } async fetchState() { - this._accessKey = null; this._state = await this.connection.provider.query(`account/${this.accountId}`, ''); - const publicKey = await this.connection.signer.getPublicKey(this.accountId, this.connection.networkId); - if (!publicKey) { - return; - } - this._accessKey = await this.connection.provider.query(`access_key/${this.accountId}/${publicKey.toString()}`, ''); - if (!this._accessKey) { - throw new Error(`Failed to fetch access key for '${this.accountId}' with public key ${publicKey.toString()}`); - } } async state() { await this.ready; @@ -75,11 +66,13 @@ class Account { } async signAndSendTransaction(receiverId, actions) { await this.ready; - if (!this._accessKey) { - throw new providers_1.TypedError(`Can not sign transactions, no matching key pair found in Signer.`, 'KeyNotFound'); + // TODO: Find matching access key based on transaction + const accessKey = await this.findAccessKey(); + if (!accessKey) { + throw new providers_1.TypedError(`Can not sign transactions for account ${this.accountId}, no matching key pair found in Signer.`, 'KeyNotFound'); } const status = await this.connection.provider.status(); - const [txHash, signedTx] = await transaction_1.signTransaction(receiverId, ++this._accessKey.nonce, actions, serialize_1.base_decode(status.sync_info.latest_block_hash), this.connection.signer, this.accountId, this.connection.networkId); + const [txHash, signedTx] = await transaction_1.signTransaction(receiverId, ++accessKey.nonce, actions, serialize_1.base_decode(status.sync_info.latest_block_hash), this.connection.signer, this.accountId, this.connection.networkId); let result; try { result = await this.connection.provider.sendTransaction(signedTx); @@ -107,6 +100,14 @@ class Account { // TODO: deal with timeout on node side. return result; } + async findAccessKey() { + const publicKey = await this.connection.signer.getPublicKey(this.accountId, this.connection.networkId); + if (!publicKey) { + return null; + } + // TODO: Cache keys and handle nonce errors automatically + return await this.connection.provider.query(`access_key/${this.accountId}/${publicKey.toString()}`, ''); + } async createAndDeployContract(contractId, publicKey, data, amount) { const accessKey = transaction_1.fullAccessKey(); await this.signAndSendTransaction(contractId, [transaction_1.createAccount(), transaction_1.transfer(amount), transaction_1.addKey(key_pair_1.PublicKey.from(publicKey), accessKey), transaction_1.deployContract(data)]); @@ -3192,7 +3193,7 @@ function fromByteArray (uint8) { number = -number; } if (number < 0x4000000) { - this.words = [ number & 0x3ffffff ]; + this.words = [number & 0x3ffffff]; this.length = 1; } else if (number < 0x10000000000000) { this.words = [ @@ -3220,7 +3221,7 @@ function fromByteArray (uint8) { // Perhaps a Uint8Array assert(typeof number.length === 'number'); if (number.length <= 0) { - this.words = [ 0 ]; + this.words = [0]; this.length = 1; return this; } @@ -3350,7 +3351,7 @@ function fromByteArray (uint8) { BN.prototype._parseBase = function _parseBase (number, base, start) { // Initialize as zero - this.words = [ 0 ]; + this.words = [0]; this.length = 1; // Find length of limb in base @@ -3403,11 +3404,15 @@ function fromByteArray (uint8) { dest.red = this.red; }; + function move (dest, src) { + dest.words = src.words; + dest.length = src.length; + dest.negative = src.negative; + dest.red = src.red; + } + BN.prototype._move = function _move (dest) { - dest.words = this.words; - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; + move(dest, this); }; BN.prototype.clone = function clone () { @@ -3439,9 +3444,17 @@ function fromByteArray (uint8) { return this; }; - BN.prototype.inspect = function inspect () { + // Check Symbol.for because not everywhere where Symbol defined + // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility + if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') { + BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect; + } else { + BN.prototype.inspect = inspect; + } + + function inspect () { return (this.red ? ''; - }; + } /* @@ -3616,51 +3629,97 @@ function fromByteArray (uint8) { return this.toArrayLike(Array, endian, length); }; + var allocate = function allocate (ArrayType, size) { + if (ArrayType.allocUnsafe) { + return ArrayType.allocUnsafe(size); + } + return new ArrayType(size); + }; + BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { + this._strip(); + var byteLength = this.byteLength(); var reqLength = length || Math.max(1, byteLength); assert(byteLength <= reqLength, 'byte array longer than desired length'); assert(reqLength > 0, 'Requested array length <= 0'); - this._strip(); - var littleEndian = endian === 'le'; var res = allocate(ArrayType, reqLength); + var postfix = endian === 'le' ? 'LE' : 'BE'; + this['_toArrayLike' + postfix](res, byteLength); + return res; + }; + + BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) { + var position = 0; + var carry = 0; - var b, i; - var q = this.clone(); - if (!littleEndian) { - // Assume big-endian - for (i = 0; i < reqLength - byteLength; i++) { - res[i] = 0; + for (var i = 0, shift = 0; i < this.length; i++) { + var word = (this.words[i] << shift) | carry; + + res[position++] = word & 0xff; + if (position < res.length) { + res[position++] = (word >> 8) & 0xff; + } + if (position < res.length) { + res[position++] = (word >> 16) & 0xff; } - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); + if (shift === 6) { + if (position < res.length) { + res[position++] = (word >> 24) & 0xff; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + + if (position < res.length) { + res[position++] = carry; - res[reqLength - i - 1] = b; + while (position < res.length) { + res[position++] = 0; } - } else { - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); + } + }; - res[i] = b; + BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) { + var position = res.length - 1; + var carry = 0; + + for (var i = 0, shift = 0; i < this.length; i++) { + var word = (this.words[i] << shift) | carry; + + res[position--] = word & 0xff; + if (position >= 0) { + res[position--] = (word >> 8) & 0xff; + } + if (position >= 0) { + res[position--] = (word >> 16) & 0xff; } - for (; i < reqLength; i++) { - res[i] = 0; + if (shift === 6) { + if (position >= 0) { + res[position--] = (word >> 24) & 0xff; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; } } - return res; - }; + if (position >= 0) { + res[position--] = carry; - var allocate = function allocate (ArrayType, size) { - if (ArrayType.allocUnsafe) { - return ArrayType.allocUnsafe(size); + while (position >= 0) { + res[position--] = 0; + } } - return new ArrayType(size); }; if (Math.clz32) { @@ -3733,7 +3792,7 @@ function fromByteArray (uint8) { var off = (bit / 26) | 0; var wbit = bit % 26; - w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; + w[bit] = (num.words[off] >>> wbit) & 0x01; } return w; @@ -4755,8 +4814,10 @@ function fromByteArray (uint8) { } function jumboMulTo (self, num, out) { - var fftm = new FFTM(); - return fftm.mulp(self, num, out); + // Temporary disable, see https://github.com/indutny/bn.js/issues/211 + // var fftm = new FFTM(); + // return fftm.mulp(self, num, out); + return bigMulTo(self, num, out); } BN.prototype.mulTo = function mulTo (num, out) { @@ -5236,7 +5297,7 @@ function fromByteArray (uint8) { // Possible sign change if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) < num) { + if (this.length === 1 && (this.words[0] | 0) <= num) { this.words[0] = num - (this.words[0] | 0); this.negative = 0; return this; @@ -5553,7 +5614,7 @@ function fromByteArray (uint8) { var cmp = mod.cmp(half); // Round down - if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; + if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div; // Round up return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); @@ -6263,7 +6324,7 @@ function fromByteArray (uint8) { Red.prototype.imod = function imod (a) { if (this.prime) return this.prime.ireduce(a)._forceRed(this); - a.umod(this.m)._forceRed(this)._move(a); + move(a, a.umod(this.m)._forceRed(this)); return a; }; @@ -10328,14 +10389,27 @@ if (typeof Object.create === 'function') { * avoid the need to parse the same template twice. */ function Writer () { - this.cache = {}; + this.templateCache = { + _cache: {}, + set: function set (key, value) { + this._cache[key] = value; + }, + get: function get (key) { + return this._cache[key]; + }, + clear: function clear () { + this._cache = {}; + } + }; } /** * Clears all cached templates in this writer. */ Writer.prototype.clearCache = function clearCache () { - this.cache = {}; + if (typeof this.templateCache !== 'undefined') { + this.templateCache.clear(); + } }; /** @@ -10344,13 +10418,15 @@ if (typeof Object.create === 'function') { * that is generated from the parse. */ Writer.prototype.parse = function parse (template, tags) { - var cache = this.cache; + var cache = this.templateCache; var cacheKey = template + ':' + (tags || mustache.tags).join(':'); - var tokens = cache[cacheKey]; - - if (tokens == null) - tokens = cache[cacheKey] = parseTemplate(template, tags); + var isCacheEnabled = typeof cache !== 'undefined'; + var tokens = isCacheEnabled ? cache.get(cacheKey) : undefined; + if (tokens == undefined) { + tokens = parseTemplate(template, tags); + isCacheEnabled && cache.set(cacheKey, tokens); + } return tokens; }; @@ -10493,16 +10569,29 @@ if (typeof Object.create === 'function') { var mustache = { name: 'mustache.js', - version: '3.2.1', + version: '4.0.0', tags: [ '{{', '}}' ], clearCache: undefined, escape: undefined, parse: undefined, render: undefined, - to_html: undefined, Scanner: undefined, Context: undefined, - Writer: undefined + Writer: undefined, + /** + * Allows a user to override the default caching strategy, by providing an + * object with set, get and clear methods. This can also be used to disable + * the cache by setting it to the literal `undefined`. + */ + set templateCache (cache) { + defaultWriter.templateCache = cache; + }, + /** + * Gets the default or overridden caching object from the default writer. + */ + get templateCache () { + return defaultWriter.templateCache; + } }; // All high-level mustache.* functions use this writer. @@ -10540,20 +10629,6 @@ if (typeof Object.create === 'function') { return defaultWriter.render(template, view, partials, tags); }; - // This is here for backwards compatibility with 0.4.x., - /*eslint-disable */ // eslint wants camel cased function name - mustache.to_html = function to_html (template, view, partials, send) { - /*eslint-enable*/ - - var result = mustache.render(template, view, partials); - - if (isFunction(send)) { - send(result); - } else { - return result; - } - }; - // Export the escaping function so that the user may override it. // See https://github.com/janl/mustache.js/issues/244 mustache.escape = escapeHtml; @@ -13888,12 +13963,11 @@ function unpackneg(r, p) { } function crypto_sign_open(m, sm, n, pk) { - var i, mlen; + var i; var t = new Uint8Array(32), h = new Uint8Array(64); var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; - mlen = -1; if (n < 64) return -1; if (unpackneg(q, pk)) return -1; @@ -13915,8 +13989,7 @@ function crypto_sign_open(m, sm, n, pk) { } for (i = 0; i < n; i++) m[i] = sm[i + 64]; - mlen = n; - return mlen; + return n; } var crypto_secretbox_KEYBYTES = 32, @@ -13977,7 +14050,23 @@ nacl.lowlevel = { crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES, crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES, crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES, - crypto_hash_BYTES: crypto_hash_BYTES + crypto_hash_BYTES: crypto_hash_BYTES, + + gf: gf, + D: D, + L: L, + pack25519: pack25519, + unpack25519: unpack25519, + M: M, + A: A, + S: S, + Z: Z, + pow2523: pow2523, + add: add, + set25519: set25519, + modL: modL, + scalarmult: scalarmult, + scalarbase: scalarbase, }; /* High-level API */ diff --git a/dist/nearlib.min.js b/dist/nearlib.min.js index ccb188bc55..ab90a94d11 100644 --- a/dist/nearlib.min.js +++ b/dist/nearlib.min.js @@ -5,7 +5,7 @@ require("error-polyfill"),window.nearlib=require("./lib/index"),window.Buffer=Bu }).call(this,require("buffer").Buffer) },{"./lib/index":8,"buffer":39,"error-polyfill":47}],2:[function(require,module,exports){ (function (Buffer){ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const transaction_1=require("./transaction"),providers_1=require("./providers"),serialize_1=require("./utils/serialize"),key_pair_1=require("./utils/key_pair"),errors_1=require("./utils/errors"),rpc_errors_1=require("./utils/rpc_errors"),DEFAULT_FUNC_CALL_AMOUNT=2e12,TX_STATUS_RETRY_NUMBER=10,TX_STATUS_RETRY_WAIT=500,TX_STATUS_RETRY_WAIT_BACKOFF=1.5;function sleep(t){return new Promise(e=>setTimeout(e,t))}class Account{constructor(t,e){this.connection=t,this.accountId=e}get ready(){return this._ready||(this._ready=Promise.resolve(this.fetchState()))}async fetchState(){this._accessKey=null,this._state=await this.connection.provider.query(`account/${this.accountId}`,"");const t=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);if(t&&(this._accessKey=await this.connection.provider.query(`access_key/${this.accountId}/${t.toString()}`,""),!this._accessKey))throw new Error(`Failed to fetch access key for '${this.accountId}' with public key ${t.toString()}`)}async state(){return await this.ready,this._state}printLogs(t,e){for(const n of e)console.log(`[${t}]: ${n}`)}async retryTxResult(t,e){let n,s=TX_STATUS_RETRY_WAIT;for(let r=0;rt.concat(e.outcome.logs),[]);if(this.printLogs(r.transaction.receiverId,i),"object"==typeof a.status&&"object"==typeof a.status.Failure)throw a.status.Failure.error_message&&a.status.Failure.error_type?new providers_1.TypedError(`Transaction ${a.transaction_outcome.id} failed. ${a.status.Failure.error_message}`,a.status.Failure.error_type):rpc_errors_1.parseRpcError(a.status.Failure);return a}async createAndDeployContract(t,e,n,s){const r=transaction_1.fullAccessKey();return await this.signAndSendTransaction(t,[transaction_1.createAccount(),transaction_1.transfer(s),transaction_1.addKey(key_pair_1.PublicKey.from(e),r),transaction_1.deployContract(n)]),new Account(this.connection,t)}async sendMoney(t,e){return this.signAndSendTransaction(t,[transaction_1.transfer(e)])}async createAccount(t,e,n){const s=transaction_1.fullAccessKey();return this.signAndSendTransaction(t,[transaction_1.createAccount(),transaction_1.transfer(n),transaction_1.addKey(key_pair_1.PublicKey.from(e),s)])}async deleteAccount(t){return this.signAndSendTransaction(this.accountId,[transaction_1.deleteAccount(t)])}async deployContract(t){return this.signAndSendTransaction(this.accountId,[transaction_1.deployContract(t)])}async functionCall(t,e,n,s,r){return n=n||{},this.validateArgs(n),this.signAndSendTransaction(t,[transaction_1.functionCall(e,Buffer.from(JSON.stringify(n)),s||DEFAULT_FUNC_CALL_AMOUNT,r)])}async addKey(t,e,n,s){let r;return r=null==e||""===e?transaction_1.fullAccessKey():transaction_1.functionCallAccessKey(e,n?[n]:[],s),this.signAndSendTransaction(this.accountId,[transaction_1.addKey(key_pair_1.PublicKey.from(t),r)])}async deleteKey(t){return this.signAndSendTransaction(this.accountId,[transaction_1.deleteKey(key_pair_1.PublicKey.from(t))])}async stake(t,e){return this.signAndSendTransaction(this.accountId,[transaction_1.stake(e,key_pair_1.PublicKey.from(t))])}validateArgs(t){if(Array.isArray(t)||"object"!=typeof t)throw new errors_1.PositionalArgsError}async viewFunction(t,e,n){n=n||{},this.validateArgs(n);const s=await this.connection.provider.query(`call/${t}/${e}`,serialize_1.base_encode(JSON.stringify(n)));return s.logs&&this.printLogs(t,s.logs),s.result&&s.result.length>0&&JSON.parse(Buffer.from(s.result).toString())}async getAccessKeys(){const t=await this.connection.provider.query(`access_key/${this.accountId}`,"");return Array.isArray(t)?t:t.keys}async getAccountDetails(){const t=await this.getAccessKeys(),e={authorizedApps:[],transactions:[]};return t.map(t=>{if(void 0!==t.access_key.permission.FunctionCall){const n=t.access_key.permission.FunctionCall;e.authorizedApps.push({contractId:n.receiver_id,amount:n.allowance,publicKey:t.public_key})}}),e}}exports.Account=Account; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const transaction_1=require("./transaction"),providers_1=require("./providers"),serialize_1=require("./utils/serialize"),key_pair_1=require("./utils/key_pair"),errors_1=require("./utils/errors"),rpc_errors_1=require("./utils/rpc_errors"),DEFAULT_FUNC_CALL_AMOUNT=2e12,TX_STATUS_RETRY_NUMBER=10,TX_STATUS_RETRY_WAIT=500,TX_STATUS_RETRY_WAIT_BACKOFF=1.5;function sleep(t){return new Promise(e=>setTimeout(e,t))}class Account{constructor(t,e){this.connection=t,this.accountId=e}get ready(){return this._ready||(this._ready=Promise.resolve(this.fetchState()))}async fetchState(){this._state=await this.connection.provider.query(`account/${this.accountId}`,"")}async state(){return await this.ready,this._state}printLogs(t,e){for(const n of e)console.log(`[${t}]: ${n}`)}async retryTxResult(t,e){let n,r=TX_STATUS_RETRY_WAIT;for(let s=0;st.concat(e.outcome.logs),[]);if(this.printLogs(a.transaction.receiverId,c),"object"==typeof i.status&&"object"==typeof i.status.Failure)throw i.status.Failure.error_message&&i.status.Failure.error_type?new providers_1.TypedError(`Transaction ${i.transaction_outcome.id} failed. ${i.status.Failure.error_message}`,i.status.Failure.error_type):rpc_errors_1.parseRpcError(i.status.Failure);return i}async findAccessKey(){const t=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);return t?await this.connection.provider.query(`access_key/${this.accountId}/${t.toString()}`,""):null}async createAndDeployContract(t,e,n,r){const s=transaction_1.fullAccessKey();return await this.signAndSendTransaction(t,[transaction_1.createAccount(),transaction_1.transfer(r),transaction_1.addKey(key_pair_1.PublicKey.from(e),s),transaction_1.deployContract(n)]),new Account(this.connection,t)}async sendMoney(t,e){return this.signAndSendTransaction(t,[transaction_1.transfer(e)])}async createAccount(t,e,n){const r=transaction_1.fullAccessKey();return this.signAndSendTransaction(t,[transaction_1.createAccount(),transaction_1.transfer(n),transaction_1.addKey(key_pair_1.PublicKey.from(e),r)])}async deleteAccount(t){return this.signAndSendTransaction(this.accountId,[transaction_1.deleteAccount(t)])}async deployContract(t){return this.signAndSendTransaction(this.accountId,[transaction_1.deployContract(t)])}async functionCall(t,e,n,r,s){return n=n||{},this.validateArgs(n),this.signAndSendTransaction(t,[transaction_1.functionCall(e,Buffer.from(JSON.stringify(n)),r||DEFAULT_FUNC_CALL_AMOUNT,s)])}async addKey(t,e,n,r){let s;return s=null==e||""===e?transaction_1.fullAccessKey():transaction_1.functionCallAccessKey(e,n?[n]:[],r),this.signAndSendTransaction(this.accountId,[transaction_1.addKey(key_pair_1.PublicKey.from(t),s)])}async deleteKey(t){return this.signAndSendTransaction(this.accountId,[transaction_1.deleteKey(key_pair_1.PublicKey.from(t))])}async stake(t,e){return this.signAndSendTransaction(this.accountId,[transaction_1.stake(e,key_pair_1.PublicKey.from(t))])}validateArgs(t){if(Array.isArray(t)||"object"!=typeof t)throw new errors_1.PositionalArgsError}async viewFunction(t,e,n){n=n||{},this.validateArgs(n);const r=await this.connection.provider.query(`call/${t}/${e}`,serialize_1.base_encode(JSON.stringify(n)));return r.logs&&this.printLogs(t,r.logs),r.result&&r.result.length>0&&JSON.parse(Buffer.from(r.result).toString())}async getAccessKeys(){const t=await this.connection.provider.query(`access_key/${this.accountId}`,"");return Array.isArray(t)?t:t.keys}async getAccountDetails(){const t=await this.getAccessKeys(),e={authorizedApps:[],transactions:[]};return t.map(t=>{if(void 0!==t.access_key.permission.FunctionCall){const n=t.access_key.permission.FunctionCall;e.authorizedApps.push({contractId:n.receiver_id,amount:n.allowance,publicKey:t.public_key})}}),e}}exports.Account=Account; }).call(this,require("buffer").Buffer) },{"./providers":16,"./transaction":21,"./utils/errors":23,"./utils/key_pair":26,"./utils/rpc_errors":28,"./utils/serialize":29,"buffer":39}],3:[function(require,module,exports){ @@ -709,7 +709,7 @@ module.exports={ "use strict";exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var e=o.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function byteLength(o){var r=getLens(o),e=r[0],t=r[1];return 3*(e+t)/4-t}function _byteLength(o,r,e){return 3*(r+e)/4-e}function toByteArray(o){var r,e,t=getLens(o),n=t[0],u=t[1],p=new Arr(_byteLength(o,n,u)),a=0,h=u>0?n-4:n;for(e=0;e>16&255,p[a++]=r>>8&255,p[a++]=255&r;return 2===u&&(r=revLookup[o.charCodeAt(e)]<<2|revLookup[o.charCodeAt(e+1)]>>4,p[a++]=255&r),1===u&&(r=revLookup[o.charCodeAt(e)]<<10|revLookup[o.charCodeAt(e+1)]<<4|revLookup[o.charCodeAt(e+2)]>>2,p[a++]=r>>8&255,p[a++]=255&r),p}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]}function encodeChunk(o,r,e){for(var t,n=[],u=r;up?p:u+16383));return 1===t?(r=o[e-1],n.push(lookup[r>>2]+lookup[r<<4&63]+"==")):2===t&&(r=(o[e-2]<<8)+o[e-1],n.push(lookup[r>>10]+lookup[r>>4&63]+lookup[r<<2&63]+"=")),n.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63; },{}],34:[function(require,module,exports){ -!function(t,i){"use strict";function r(t,i){if(!t)throw new Error(i||"Assertion failed")}function n(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function h(t,i,r){if(h.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var e;"object"==typeof t?t.exports=h:i.BN=h,h.BN=h,h.wordSize=26;try{e=require("buffer").Buffer}catch(t){}function o(t,i,n){for(var h=0,e=Math.min(t.length,n),o=0,s=i;s=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:a,o|=u}return r(!(240&o),"Invalid character in "+t),h}function s(t,i,n,h){for(var e=0,o=0,s=Math.min(t.length,n),u=i;u=49?a-49+10:a>=17?a-17+10:a,r(a>=0&&o0?t:i},h.min=function(t,i){return t.cmp(i)<0?t:i},h.prototype._init=function(t,i,n){if("number"==typeof t)return this._initNumber(t,i,n);if("object"==typeof t)return this._initArray(t,i,n);"hex"===i&&(i=16),r(i===(0|i)&&i>=2&&i<=36);var h=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&h++,16===i?this._parseHex(t,h):this._parseBase(t,i,h),"-"===t[0]&&(this.negative=1),this._strip(),"le"===n&&this._initArray(this.toArray(),i,n)},h.prototype._initNumber=function(t,i,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),i,n)},h.prototype._initArray=function(t,i,n){if(r("number"==typeof t.length),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 h=0;h=0;h-=3)o=t[h]|t[h-1]<<8|t[h-2]<<16,this.words[e]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);else if("le"===n)for(h=0,e=0;h>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);return this._strip()},h.prototype._parseHex=function(t,i){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r=i;r-=6)h=o(t,r,r+6),this.words[n]|=h<>>26-e&4194303,(e+=24)>=26&&(e-=26,n++);r+6!==i&&(h=o(t,i,r+6),this.words[n]|=h<>>26-e&4194303),this._strip()},h.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var n=0,h=1;h<=67108863;h*=i)n++;n--,h=h/i|0;for(var e=t.length-r,o=e%n,u=Math.min(e,e-o)+r,a=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},h.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},h.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],l=[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];h.prototype.toString=function(t,i){var n;if(i=0|i||1,16===(t=t||10)||"hex"===t){n="";for(var h=0,e=0,o=0;o>>24-h&16777215)||o!==this.length-1?u[6-m.length]+m+n:m+n,(h+=2)>=26&&(h-=26,o--)}for(0!==e&&(n=e.toString(16)+n);n.length%i!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var f=a[t],d=l[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var M=p.modrn(d).toString(t);n=(p=p.idivn(d)).isZero()?M+n:u[f-M.length]+M+n}for(this.isZero()&&(n="0"+n);n.length%i!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},h.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},h.prototype.toJSON=function(){return this.toString(16,2)},e&&(h.prototype.toBuffer=function(t,i){return this.toArrayLike(e,t,i)}),h.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)},h.prototype.toArrayLike=function(t,i,n){var h=this.byteLength(),e=n||Math.max(1,h);r(h<=e,"byte array longer than desired length"),r(e>0,"Requested array length <= 0"),this._strip();var o,s,u="le"===i,a=m(t,e),l=this.clone();if(u){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),a[s]=o;for(;s>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(o=(h=0|t.words[p])*(e=0|i.words[d])+m)/67108864|0,m=67108863&o}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r._strip()}Math.clz32?h.prototype._countBits=function(t){return 32-Math.clz32(t)}:h.prototype._countBits=function(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},h.prototype._zeroBits=function(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},h.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;it.length?this.clone().ior(t):t.clone().ior(this)},h.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},h.prototype.iuand=function(t){var i;i=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},h.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},h.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},h.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},h.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),n=t%26;this._expand(i),n>0&&i--;for(var h=0;h0&&(this.words[h]=~this.words[h]&67108863>>26-n),this._strip()},h.prototype.notn=function(t){return this.clone().inotn(t)},h.prototype.setn=function(t,i){r("number"==typeof t&&t>=0);var n=t/26|0,h=t%26;return this._expand(n+1),this.words[n]=i?this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var h=0,e=0;e>>26;for(;0!==h&&e>>26;if(this.length=r.length,0!==h)this.words[this.length]=h,this.length++;else if(r!==this)for(;et.length?this.clone().iadd(t):t.clone().iadd(this)},h.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,h=this.cmp(t);if(0===h)return this.negative=0,this.length=1,this.words[0]=0,this;h>0?(r=this,n=t):(r=t,n=this);for(var e=0,o=0;o>26,this.words[o]=67108863&i;for(;0!==e&&o>26,this.words[o]=67108863&i;if(0===e&&o>>13,d=0|o[1],p=8191&d,M=d>>>13,v=0|o[2],g=8191&v,c=v>>>13,w=0|o[3],y=8191&w,b=w>>>13,_=0|o[4],k=8191&_,A=_>>>13,x=0|o[5],S=8191&x,Z=x>>>13,q=0|o[6],R=8191&q,B=q>>>13,N=0|o[7],L=8191&N,I=N>>>13,z=0|o[8],T=8191&z,E=z>>>13,O=0|o[9],j=8191&O,K=O>>>13,P=0|s[0],F=8191&P,U=P>>>13,C=0|s[1],D=8191&C,H=C>>>13,J=0|s[2],G=8191&J,Q=J>>>13,V=0|s[3],W=8191&V,X=V>>>13,Y=0|s[4],$=8191&Y,tt=Y>>>13,it=0|s[5],rt=8191&it,nt=it>>>13,ht=0|s[6],et=8191&ht,ot=ht>>>13,st=0|s[7],ut=8191&st,at=st>>>13,lt=0|s[8],mt=8191<,ft=lt>>>13,dt=0|s[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(n=Math.imul(m,F))|0)+((8191&(h=(h=Math.imul(m,U))+Math.imul(f,F)|0))<<13)|0;a=((e=Math.imul(f,U))+(h>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),h=(h=Math.imul(p,U))+Math.imul(M,F)|0,e=Math.imul(M,U);var gt=(a+(n=n+Math.imul(m,D)|0)|0)+((8191&(h=(h=h+Math.imul(m,H)|0)+Math.imul(f,D)|0))<<13)|0;a=((e=e+Math.imul(f,H)|0)+(h>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),h=(h=Math.imul(g,U))+Math.imul(c,F)|0,e=Math.imul(c,U),n=n+Math.imul(p,D)|0,h=(h=h+Math.imul(p,H)|0)+Math.imul(M,D)|0,e=e+Math.imul(M,H)|0;var ct=(a+(n=n+Math.imul(m,G)|0)|0)+((8191&(h=(h=h+Math.imul(m,Q)|0)+Math.imul(f,G)|0))<<13)|0;a=((e=e+Math.imul(f,Q)|0)+(h>>>13)|0)+(ct>>>26)|0,ct&=67108863,n=Math.imul(y,F),h=(h=Math.imul(y,U))+Math.imul(b,F)|0,e=Math.imul(b,U),n=n+Math.imul(g,D)|0,h=(h=h+Math.imul(g,H)|0)+Math.imul(c,D)|0,e=e+Math.imul(c,H)|0,n=n+Math.imul(p,G)|0,h=(h=h+Math.imul(p,Q)|0)+Math.imul(M,G)|0,e=e+Math.imul(M,Q)|0;var wt=(a+(n=n+Math.imul(m,W)|0)|0)+((8191&(h=(h=h+Math.imul(m,X)|0)+Math.imul(f,W)|0))<<13)|0;a=((e=e+Math.imul(f,X)|0)+(h>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),h=(h=Math.imul(k,U))+Math.imul(A,F)|0,e=Math.imul(A,U),n=n+Math.imul(y,D)|0,h=(h=h+Math.imul(y,H)|0)+Math.imul(b,D)|0,e=e+Math.imul(b,H)|0,n=n+Math.imul(g,G)|0,h=(h=h+Math.imul(g,Q)|0)+Math.imul(c,G)|0,e=e+Math.imul(c,Q)|0,n=n+Math.imul(p,W)|0,h=(h=h+Math.imul(p,X)|0)+Math.imul(M,W)|0,e=e+Math.imul(M,X)|0;var yt=(a+(n=n+Math.imul(m,$)|0)|0)+((8191&(h=(h=h+Math.imul(m,tt)|0)+Math.imul(f,$)|0))<<13)|0;a=((e=e+Math.imul(f,tt)|0)+(h>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(S,F),h=(h=Math.imul(S,U))+Math.imul(Z,F)|0,e=Math.imul(Z,U),n=n+Math.imul(k,D)|0,h=(h=h+Math.imul(k,H)|0)+Math.imul(A,D)|0,e=e+Math.imul(A,H)|0,n=n+Math.imul(y,G)|0,h=(h=h+Math.imul(y,Q)|0)+Math.imul(b,G)|0,e=e+Math.imul(b,Q)|0,n=n+Math.imul(g,W)|0,h=(h=h+Math.imul(g,X)|0)+Math.imul(c,W)|0,e=e+Math.imul(c,X)|0,n=n+Math.imul(p,$)|0,h=(h=h+Math.imul(p,tt)|0)+Math.imul(M,$)|0,e=e+Math.imul(M,tt)|0;var bt=(a+(n=n+Math.imul(m,rt)|0)|0)+((8191&(h=(h=h+Math.imul(m,nt)|0)+Math.imul(f,rt)|0))<<13)|0;a=((e=e+Math.imul(f,nt)|0)+(h>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(R,F),h=(h=Math.imul(R,U))+Math.imul(B,F)|0,e=Math.imul(B,U),n=n+Math.imul(S,D)|0,h=(h=h+Math.imul(S,H)|0)+Math.imul(Z,D)|0,e=e+Math.imul(Z,H)|0,n=n+Math.imul(k,G)|0,h=(h=h+Math.imul(k,Q)|0)+Math.imul(A,G)|0,e=e+Math.imul(A,Q)|0,n=n+Math.imul(y,W)|0,h=(h=h+Math.imul(y,X)|0)+Math.imul(b,W)|0,e=e+Math.imul(b,X)|0,n=n+Math.imul(g,$)|0,h=(h=h+Math.imul(g,tt)|0)+Math.imul(c,$)|0,e=e+Math.imul(c,tt)|0,n=n+Math.imul(p,rt)|0,h=(h=h+Math.imul(p,nt)|0)+Math.imul(M,rt)|0,e=e+Math.imul(M,nt)|0;var _t=(a+(n=n+Math.imul(m,et)|0)|0)+((8191&(h=(h=h+Math.imul(m,ot)|0)+Math.imul(f,et)|0))<<13)|0;a=((e=e+Math.imul(f,ot)|0)+(h>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,F),h=(h=Math.imul(L,U))+Math.imul(I,F)|0,e=Math.imul(I,U),n=n+Math.imul(R,D)|0,h=(h=h+Math.imul(R,H)|0)+Math.imul(B,D)|0,e=e+Math.imul(B,H)|0,n=n+Math.imul(S,G)|0,h=(h=h+Math.imul(S,Q)|0)+Math.imul(Z,G)|0,e=e+Math.imul(Z,Q)|0,n=n+Math.imul(k,W)|0,h=(h=h+Math.imul(k,X)|0)+Math.imul(A,W)|0,e=e+Math.imul(A,X)|0,n=n+Math.imul(y,$)|0,h=(h=h+Math.imul(y,tt)|0)+Math.imul(b,$)|0,e=e+Math.imul(b,tt)|0,n=n+Math.imul(g,rt)|0,h=(h=h+Math.imul(g,nt)|0)+Math.imul(c,rt)|0,e=e+Math.imul(c,nt)|0,n=n+Math.imul(p,et)|0,h=(h=h+Math.imul(p,ot)|0)+Math.imul(M,et)|0,e=e+Math.imul(M,ot)|0;var kt=(a+(n=n+Math.imul(m,ut)|0)|0)+((8191&(h=(h=h+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((e=e+Math.imul(f,at)|0)+(h>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(T,F),h=(h=Math.imul(T,U))+Math.imul(E,F)|0,e=Math.imul(E,U),n=n+Math.imul(L,D)|0,h=(h=h+Math.imul(L,H)|0)+Math.imul(I,D)|0,e=e+Math.imul(I,H)|0,n=n+Math.imul(R,G)|0,h=(h=h+Math.imul(R,Q)|0)+Math.imul(B,G)|0,e=e+Math.imul(B,Q)|0,n=n+Math.imul(S,W)|0,h=(h=h+Math.imul(S,X)|0)+Math.imul(Z,W)|0,e=e+Math.imul(Z,X)|0,n=n+Math.imul(k,$)|0,h=(h=h+Math.imul(k,tt)|0)+Math.imul(A,$)|0,e=e+Math.imul(A,tt)|0,n=n+Math.imul(y,rt)|0,h=(h=h+Math.imul(y,nt)|0)+Math.imul(b,rt)|0,e=e+Math.imul(b,nt)|0,n=n+Math.imul(g,et)|0,h=(h=h+Math.imul(g,ot)|0)+Math.imul(c,et)|0,e=e+Math.imul(c,ot)|0,n=n+Math.imul(p,ut)|0,h=(h=h+Math.imul(p,at)|0)+Math.imul(M,ut)|0,e=e+Math.imul(M,at)|0;var At=(a+(n=n+Math.imul(m,mt)|0)|0)+((8191&(h=(h=h+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((e=e+Math.imul(f,ft)|0)+(h>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,F),h=(h=Math.imul(j,U))+Math.imul(K,F)|0,e=Math.imul(K,U),n=n+Math.imul(T,D)|0,h=(h=h+Math.imul(T,H)|0)+Math.imul(E,D)|0,e=e+Math.imul(E,H)|0,n=n+Math.imul(L,G)|0,h=(h=h+Math.imul(L,Q)|0)+Math.imul(I,G)|0,e=e+Math.imul(I,Q)|0,n=n+Math.imul(R,W)|0,h=(h=h+Math.imul(R,X)|0)+Math.imul(B,W)|0,e=e+Math.imul(B,X)|0,n=n+Math.imul(S,$)|0,h=(h=h+Math.imul(S,tt)|0)+Math.imul(Z,$)|0,e=e+Math.imul(Z,tt)|0,n=n+Math.imul(k,rt)|0,h=(h=h+Math.imul(k,nt)|0)+Math.imul(A,rt)|0,e=e+Math.imul(A,nt)|0,n=n+Math.imul(y,et)|0,h=(h=h+Math.imul(y,ot)|0)+Math.imul(b,et)|0,e=e+Math.imul(b,ot)|0,n=n+Math.imul(g,ut)|0,h=(h=h+Math.imul(g,at)|0)+Math.imul(c,ut)|0,e=e+Math.imul(c,at)|0,n=n+Math.imul(p,mt)|0,h=(h=h+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,e=e+Math.imul(M,ft)|0;var xt=(a+(n=n+Math.imul(m,pt)|0)|0)+((8191&(h=(h=h+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((e=e+Math.imul(f,Mt)|0)+(h>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(j,D),h=(h=Math.imul(j,H))+Math.imul(K,D)|0,e=Math.imul(K,H),n=n+Math.imul(T,G)|0,h=(h=h+Math.imul(T,Q)|0)+Math.imul(E,G)|0,e=e+Math.imul(E,Q)|0,n=n+Math.imul(L,W)|0,h=(h=h+Math.imul(L,X)|0)+Math.imul(I,W)|0,e=e+Math.imul(I,X)|0,n=n+Math.imul(R,$)|0,h=(h=h+Math.imul(R,tt)|0)+Math.imul(B,$)|0,e=e+Math.imul(B,tt)|0,n=n+Math.imul(S,rt)|0,h=(h=h+Math.imul(S,nt)|0)+Math.imul(Z,rt)|0,e=e+Math.imul(Z,nt)|0,n=n+Math.imul(k,et)|0,h=(h=h+Math.imul(k,ot)|0)+Math.imul(A,et)|0,e=e+Math.imul(A,ot)|0,n=n+Math.imul(y,ut)|0,h=(h=h+Math.imul(y,at)|0)+Math.imul(b,ut)|0,e=e+Math.imul(b,at)|0,n=n+Math.imul(g,mt)|0,h=(h=h+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,e=e+Math.imul(c,ft)|0;var St=(a+(n=n+Math.imul(p,pt)|0)|0)+((8191&(h=(h=h+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;a=((e=e+Math.imul(M,Mt)|0)+(h>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,G),h=(h=Math.imul(j,Q))+Math.imul(K,G)|0,e=Math.imul(K,Q),n=n+Math.imul(T,W)|0,h=(h=h+Math.imul(T,X)|0)+Math.imul(E,W)|0,e=e+Math.imul(E,X)|0,n=n+Math.imul(L,$)|0,h=(h=h+Math.imul(L,tt)|0)+Math.imul(I,$)|0,e=e+Math.imul(I,tt)|0,n=n+Math.imul(R,rt)|0,h=(h=h+Math.imul(R,nt)|0)+Math.imul(B,rt)|0,e=e+Math.imul(B,nt)|0,n=n+Math.imul(S,et)|0,h=(h=h+Math.imul(S,ot)|0)+Math.imul(Z,et)|0,e=e+Math.imul(Z,ot)|0,n=n+Math.imul(k,ut)|0,h=(h=h+Math.imul(k,at)|0)+Math.imul(A,ut)|0,e=e+Math.imul(A,at)|0,n=n+Math.imul(y,mt)|0,h=(h=h+Math.imul(y,ft)|0)+Math.imul(b,mt)|0,e=e+Math.imul(b,ft)|0;var Zt=(a+(n=n+Math.imul(g,pt)|0)|0)+((8191&(h=(h=h+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;a=((e=e+Math.imul(c,Mt)|0)+(h>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,n=Math.imul(j,W),h=(h=Math.imul(j,X))+Math.imul(K,W)|0,e=Math.imul(K,X),n=n+Math.imul(T,$)|0,h=(h=h+Math.imul(T,tt)|0)+Math.imul(E,$)|0,e=e+Math.imul(E,tt)|0,n=n+Math.imul(L,rt)|0,h=(h=h+Math.imul(L,nt)|0)+Math.imul(I,rt)|0,e=e+Math.imul(I,nt)|0,n=n+Math.imul(R,et)|0,h=(h=h+Math.imul(R,ot)|0)+Math.imul(B,et)|0,e=e+Math.imul(B,ot)|0,n=n+Math.imul(S,ut)|0,h=(h=h+Math.imul(S,at)|0)+Math.imul(Z,ut)|0,e=e+Math.imul(Z,at)|0,n=n+Math.imul(k,mt)|0,h=(h=h+Math.imul(k,ft)|0)+Math.imul(A,mt)|0,e=e+Math.imul(A,ft)|0;var qt=(a+(n=n+Math.imul(y,pt)|0)|0)+((8191&(h=(h=h+Math.imul(y,Mt)|0)+Math.imul(b,pt)|0))<<13)|0;a=((e=e+Math.imul(b,Mt)|0)+(h>>>13)|0)+(qt>>>26)|0,qt&=67108863,n=Math.imul(j,$),h=(h=Math.imul(j,tt))+Math.imul(K,$)|0,e=Math.imul(K,tt),n=n+Math.imul(T,rt)|0,h=(h=h+Math.imul(T,nt)|0)+Math.imul(E,rt)|0,e=e+Math.imul(E,nt)|0,n=n+Math.imul(L,et)|0,h=(h=h+Math.imul(L,ot)|0)+Math.imul(I,et)|0,e=e+Math.imul(I,ot)|0,n=n+Math.imul(R,ut)|0,h=(h=h+Math.imul(R,at)|0)+Math.imul(B,ut)|0,e=e+Math.imul(B,at)|0,n=n+Math.imul(S,mt)|0,h=(h=h+Math.imul(S,ft)|0)+Math.imul(Z,mt)|0,e=e+Math.imul(Z,ft)|0;var Rt=(a+(n=n+Math.imul(k,pt)|0)|0)+((8191&(h=(h=h+Math.imul(k,Mt)|0)+Math.imul(A,pt)|0))<<13)|0;a=((e=e+Math.imul(A,Mt)|0)+(h>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(j,rt),h=(h=Math.imul(j,nt))+Math.imul(K,rt)|0,e=Math.imul(K,nt),n=n+Math.imul(T,et)|0,h=(h=h+Math.imul(T,ot)|0)+Math.imul(E,et)|0,e=e+Math.imul(E,ot)|0,n=n+Math.imul(L,ut)|0,h=(h=h+Math.imul(L,at)|0)+Math.imul(I,ut)|0,e=e+Math.imul(I,at)|0,n=n+Math.imul(R,mt)|0,h=(h=h+Math.imul(R,ft)|0)+Math.imul(B,mt)|0,e=e+Math.imul(B,ft)|0;var Bt=(a+(n=n+Math.imul(S,pt)|0)|0)+((8191&(h=(h=h+Math.imul(S,Mt)|0)+Math.imul(Z,pt)|0))<<13)|0;a=((e=e+Math.imul(Z,Mt)|0)+(h>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(j,et),h=(h=Math.imul(j,ot))+Math.imul(K,et)|0,e=Math.imul(K,ot),n=n+Math.imul(T,ut)|0,h=(h=h+Math.imul(T,at)|0)+Math.imul(E,ut)|0,e=e+Math.imul(E,at)|0,n=n+Math.imul(L,mt)|0,h=(h=h+Math.imul(L,ft)|0)+Math.imul(I,mt)|0,e=e+Math.imul(I,ft)|0;var Nt=(a+(n=n+Math.imul(R,pt)|0)|0)+((8191&(h=(h=h+Math.imul(R,Mt)|0)+Math.imul(B,pt)|0))<<13)|0;a=((e=e+Math.imul(B,Mt)|0)+(h>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(j,ut),h=(h=Math.imul(j,at))+Math.imul(K,ut)|0,e=Math.imul(K,at),n=n+Math.imul(T,mt)|0,h=(h=h+Math.imul(T,ft)|0)+Math.imul(E,mt)|0,e=e+Math.imul(E,ft)|0;var Lt=(a+(n=n+Math.imul(L,pt)|0)|0)+((8191&(h=(h=h+Math.imul(L,Mt)|0)+Math.imul(I,pt)|0))<<13)|0;a=((e=e+Math.imul(I,Mt)|0)+(h>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(j,mt),h=(h=Math.imul(j,ft))+Math.imul(K,mt)|0,e=Math.imul(K,ft);var It=(a+(n=n+Math.imul(T,pt)|0)|0)+((8191&(h=(h=h+Math.imul(T,Mt)|0)+Math.imul(E,pt)|0))<<13)|0;a=((e=e+Math.imul(E,Mt)|0)+(h>>>13)|0)+(It>>>26)|0,It&=67108863;var zt=(a+(n=Math.imul(j,pt))|0)+((8191&(h=(h=Math.imul(j,Mt))+Math.imul(K,pt)|0))<<13)|0;return a=((e=Math.imul(K,Mt))+(h>>>13)|0)+(zt>>>26)|0,zt&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=_t,u[7]=kt,u[8]=At,u[9]=xt,u[10]=St,u[11]=Zt,u[12]=qt,u[13]=Rt,u[14]=Bt,u[15]=Nt,u[16]=Lt,u[17]=It,u[18]=zt,0!==a&&(u[19]=a,r.length++),r};function p(t,i,r){return(new M).mulp(t,i,r)}function M(t,i){this.x=t,this.y=i}Math.imul||(d=f),h.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,i):r<63?f(this,t,i):r<1024?function(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var n=0,h=0,e=0;e>>26)|0)>>>26,o&=67108863}r.words[e]=s,n=o,o=h}return 0!==n?r.words[e]=n:r.length--,r._strip()}(this,t,i):p(this,t,i)},M.prototype.makeRBT=function(t){for(var i=new Array(t),r=h.prototype._countBits(t)-1,n=0;n>=1;return n},M.prototype.permute=function(t,i,r,n,h,e){for(var o=0;o>>=1)h++;return 1<>>=13,n[2*o+1]=8191&e,e>>>=13;for(o=2*i;o>=26,n+=e/67108864|0,n+=o>>>26,this.words[h]=67108863&o}return 0!==n&&(this.words[h]=n,this.length++),i?this.ineg():this},h.prototype.muln=function(t){return this.clone().imuln(t)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(t){var i=function(t){for(var i=new Array(t.bitLength()),r=0;r>>h}return i}(t);if(0===i.length)return new h(1);for(var r=this,n=0;n=0);var i,n=t%26,h=(t-n)/26,e=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(i=0;i>>26-n}o&&(this.words[i]=o,this.length++)}if(0!==h){for(i=this.length-1;i>=0;i--)this.words[i+h]=this.words[i];for(i=0;i=0),h=i?(i-i%26)/26:0;var e=t%26,o=Math.min((t-e)/26,this.length),s=67108863^67108863>>>e<o)for(this.length-=o,a=0;a=0&&(0!==l||a>=h);a--){var m=0|this.words[a];this.words[a]=l<<26-e|m>>>e,l=m&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},h.prototype.ishrn=function(t,i,n){return r(0===this.negative),this.iushrn(t,i,n)},h.prototype.shln=function(t){return this.clone().ishln(t)},h.prototype.ushln=function(t){return this.clone().iushln(t)},h.prototype.shrn=function(t){return this.clone().ishrn(t)},h.prototype.ushrn=function(t){return this.clone().iushrn(t)},h.prototype.testn=function(t){r("number"==typeof t&&t>=0);var i=t%26,n=(t-i)/26,h=1<=0);var i=t%26,n=(t-i)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==i&&n++,this.length=Math.min(n,this.length),0!==i){var h=67108863^67108863>>>i<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},h.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(u/67108864|0),this.words[h+n]=67108863&e}for(;h>26,this.words[h+n]=67108863&e;if(0===s)return this._strip();for(r(-1===s),s=0,h=0;h>26,this.words[h]=67108863&e;return this.negative=1,this._strip()},h.prototype._wordDiv=function(t,i){var r=(this.length,t.length),n=this.clone(),e=t,o=0|e.words[e.length-1];0!==(r=26-this._countBits(o))&&(e=e.ushln(r),n.iushln(r),o=0|e.words[e.length-1]);var s,u=n.length-e.length;if("mod"!==i){(s=new h(null)).length=u+1,s.words=new Array(s.length);for(var a=0;a=0;m--){var f=67108864*(0|n.words[e.length+m])+(0|n.words[e.length+m-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(e,f,m);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(e,1,m),n.isZero()||(n.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),n._strip(),"div"!==i&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},h.prototype.divmod=function(t,i,n){return r(!t.isZero()),this.isZero()?{div:new h(0),mod:new h(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,i),"mod"!==i&&(e=s.div.neg()),"div"!==i&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(t)),{div:e,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),i),"mod"!==i&&(e=s.div.neg()),{div:e,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),i),"div"!==i&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new h(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new h(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new h(this.modrn(t.words[0]))}:this._wordDiv(t,i);var e,o,s},h.prototype.div=function(t){return this.divmod(t,"div",!1).div},h.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},h.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},h.prototype.divRound=function(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,n=t.ushrn(1),h=t.andln(1),e=r.cmp(n);return e<0||1===h&&0===e?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},h.prototype.modrn=function(t){var i=t<0;i&&(t=-t),r(t<=67108863);for(var n=(1<<26)%t,h=0,e=this.length-1;e>=0;e--)h=(n*h+(0|this.words[e]))%t;return i?-h:h},h.prototype.modn=function(t){return this.modrn(t)},h.prototype.idivn=function(t){var i=t<0;i&&(t=-t),r(t<=67108863);for(var n=0,h=this.length-1;h>=0;h--){var e=(0|this.words[h])+67108864*n;this.words[h]=e/t|0,n=e%t}return this._strip(),i?this.ineg():this},h.prototype.divn=function(t){return this.clone().idivn(t)},h.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var i=this,n=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e=new h(1),o=new h(0),s=new h(0),u=new h(1),a=0;i.isEven()&&n.isEven();)i.iushrn(1),n.iushrn(1),++a;for(var l=n.clone(),m=i.clone();!i.isZero();){for(var f=0,d=1;0==(i.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-- >0;)(e.isOdd()||o.isOdd())&&(e.iadd(l),o.isub(m)),e.iushrn(1),o.iushrn(1);for(var p=0,M=1;0==(n.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(m)),s.iushrn(1),u.iushrn(1);i.cmp(n)>=0?(i.isub(n),e.isub(s),o.isub(u)):(n.isub(i),s.isub(e),u.isub(o))}return{a:s,b:u,gcd:n.iushln(a)}},h.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var i=this,n=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e,o=new h(1),s=new h(0),u=n.clone();i.cmpn(1)>0&&n.cmpn(1)>0;){for(var a=0,l=1;0==(i.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(i.iushrn(a);a-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var m=0,f=1;0==(n.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(n.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);i.cmp(n)>=0?(i.isub(n),o.isub(s)):(n.isub(i),s.isub(o))}return(e=0===i.cmpn(1)?o:s).cmpn(0)<0&&e.iadd(t),e},h.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var n=0;i.isEven()&&r.isEven();n++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var h=i.cmp(r);if(h<0){var e=i;i=r,r=e}else if(0===h||0===r.cmpn(1))break;i.isub(r)}return r.iushln(n)},h.prototype.invm=function(t){return this.egcd(t).a.umod(t)},h.prototype.isEven=function(){return 0==(1&this.words[0])},h.prototype.isOdd=function(){return 1==(1&this.words[0])},h.prototype.andln=function(t){return this.words[0]&t},h.prototype.bincn=function(t){r("number"==typeof t);var i=t%26,n=(t-i)/26,h=1<>>26,s&=67108863,this.words[o]=s}return 0!==e&&(this.words[o]=e,this.length++),this},h.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},h.prototype.cmpn=function(t){var i,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)i=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var h=0|this.words[0];i=h===t?0:ht.length)return 1;if(this.length=0;r--){var n=0|this.words[r],h=0|t.words[r];if(n!==h){nh&&(i=1);break}}return i},h.prototype.gtn=function(t){return 1===this.cmpn(t)},h.prototype.gt=function(t){return 1===this.cmp(t)},h.prototype.gten=function(t){return this.cmpn(t)>=0},h.prototype.gte=function(t){return this.cmp(t)>=0},h.prototype.ltn=function(t){return-1===this.cmpn(t)},h.prototype.lt=function(t){return-1===this.cmp(t)},h.prototype.lten=function(t){return this.cmpn(t)<=0},h.prototype.lte=function(t){return this.cmp(t)<=0},h.prototype.eqn=function(t){return 0===this.cmpn(t)},h.prototype.eq=function(t){return 0===this.cmp(t)},h.red=function(t){return new _(t)},h.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},h.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(t){return this.red=t,this},h.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},h.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},h.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},h.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},h.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},h.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},h.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},h.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},h.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,i){this.name=t,this.p=new h(i,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function c(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var i=h._prime(t);this.m=i.p,this.prime=i}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new h(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)}g.prototype._tmp=function(){var t=new h(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var n=i0?r.isub(this.p):r._strip(),r},g.prototype.split=function(t,i){t.iushrn(this.n,0,i)},g.prototype.imulK=function(t){return t.imul(this.k)},n(c,g),c.prototype.split=function(t,i){for(var r=Math.min(t.length,9),n=0;n>>22,h=e}h>>>=22,t.words[n-10]=h,0===h&&t.length>10?t.length-=10:t.length-=9},c.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r>>=26,t.words[r]=h,i=n}return 0!==i&&(t.words[t.length++]=i),t},h._prime=function(t){if(v[t])return v[t];var i;if("k256"===t)i=new c;else if("p224"===t)i=new w;else if("p192"===t)i=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new b}return v[t]=i,i},_.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,i){r(0==(t.negative|i.negative),"red works only with positives"),r(t.red&&t.red===i.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(t.umod(this.m)._forceRed(this)._move(t),t)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},_.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},_.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(r(i%2==1),3===i){var n=this.m.add(new h(1)).iushrn(2);return this.pow(t,n)}for(var e=this.m.subn(1),o=0;!e.isZero()&&0===e.andln(1);)o++,e.iushrn(1);r(!e.isZero());var s=new h(1).toRed(this),u=s.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new h(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var m=this.pow(l,e),f=this.pow(t,e.addn(1).iushrn(1)),d=this.pow(t,e),p=o;0!==d.cmp(s);){for(var M=d,v=0;0!==M.cmp(s);v++)M=M.redSqr();r(v=0;n--){for(var a=i.words[n],l=u-1;l>=0;l--){var m=a>>l&1;e!==r[0]&&(e=this.sqr(e)),0!==m||0!==o?(o<<=1,o|=m,(4===++s||0===n&&0===l)&&(e=this.mul(e,r[o]),s=0,o=0)):s=0}u=26}return e},_.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},_.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},h.mont=function(t){return new k(t)},n(k,_),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},k.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=r.isub(n).iushrn(this.shift),e=h;return h.cmp(this.m)>=0?e=h.isub(this.m):h.cmpn(0)<0&&(e=h.iadd(this.m)),e._forceRed(this)},k.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new h(0)._forceRed(this);var r=t.mul(i),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=r.isub(n).iushrn(this.shift),o=e;return e.cmp(this.m)>=0?o=e.isub(this.m):e.cmpn(0)<0&&(o=e.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof module||module,this); +!function(t,i){"use strict";function r(t,i){if(!t)throw new Error(i||"Assertion failed")}function n(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function h(t,i,r){if(h.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var e;"object"==typeof t?t.exports=h:i.BN=h,h.BN=h,h.wordSize=26;try{e=require("buffer").Buffer}catch(t){}function o(t,i,n){for(var h=0,e=Math.min(t.length,n),o=0,s=i;s=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:a,o|=u}return r(!(240&o),"Invalid character in "+t),h}function s(t,i,n,h){for(var e=0,o=0,s=Math.min(t.length,n),u=i;u=49?a-49+10:a>=17?a-17+10:a,r(a>=0&&o"}h.isBN=function(t){return t instanceof h||null!==t&&"object"==typeof t&&t.constructor.wordSize===h.wordSize&&Array.isArray(t.words)},h.max=function(t,i){return t.cmp(i)>0?t:i},h.min=function(t,i){return t.cmp(i)<0?t:i},h.prototype._init=function(t,i,n){if("number"==typeof t)return this._initNumber(t,i,n);if("object"==typeof t)return this._initArray(t,i,n);"hex"===i&&(i=16),r(i===(0|i)&&i>=2&&i<=36);var h=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&h++,16===i?this._parseHex(t,h):this._parseBase(t,i,h),"-"===t[0]&&(this.negative=1),this._strip(),"le"===n&&this._initArray(this.toArray(),i,n)},h.prototype._initNumber=function(t,i,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),i,n)},h.prototype._initArray=function(t,i,n){if(r("number"==typeof t.length),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 h=0;h=0;h-=3)o=t[h]|t[h-1]<<8|t[h-2]<<16,this.words[e]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);else if("le"===n)for(h=0,e=0;h>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);return this._strip()},h.prototype._parseHex=function(t,i){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r=i;r-=6)h=o(t,r,r+6),this.words[n]|=h<>>26-e&4194303,(e+=24)>=26&&(e-=26,n++);r+6!==i&&(h=o(t,i,r+6),this.words[n]|=h<>>26-e&4194303),this._strip()},h.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var n=0,h=1;h<=67108863;h*=i)n++;n--,h=h/i|0;for(var e=t.length-r,o=e%n,u=Math.min(e,e-o)+r,a=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},h.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for?h.prototype[Symbol.for("nodejs.util.inspect.custom")]=a:h.prototype.inspect=a;var l=["","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"],m=[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];h.prototype.toString=function(t,i){var n;if(i=0|i||1,16===(t=t||10)||"hex"===t){n="";for(var h=0,e=0,o=0;o>>24-h&16777215)||o!==this.length-1?l[6-u.length]+u+n:u+n,(h+=2)>=26&&(h-=26,o--)}for(0!==e&&(n=e.toString(16)+n);n.length%i!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var a=m[t],d=f[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var M=p.modrn(d).toString(t);n=(p=p.idivn(d)).isZero()?M+n:l[a-M.length]+M+n}for(this.isZero()&&(n="0"+n);n.length%i!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},h.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},h.prototype.toJSON=function(){return this.toString(16,2)},e&&(h.prototype.toBuffer=function(t,i){return this.toArrayLike(e,t,i)}),h.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)};function d(t,i,r){r.negative=i.negative^t.negative;var n=t.length+i.length|0;r.length=n,n=n-1|0;var h=0|t.words[0],e=0|i.words[0],o=h*e,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var a=1;a>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(o=(h=0|t.words[p])*(e=0|i.words[d])+m)/67108864|0,m=67108863&o}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r._strip()}h.prototype.toArrayLike=function(t,i,n){this._strip();var h=this.byteLength(),e=n||Math.max(1,h);r(h<=e,"byte array longer than desired length"),r(e>0,"Requested array length <= 0");var o=function(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)}(t,e);return this["_toArrayLike"+("le"===i?"LE":"BE")](o,h),o},h.prototype._toArrayLikeLE=function(t,i){for(var r=0,n=0,h=0,e=0;h>8&255),r>16&255),6===e?(r>24&255),n=0,e=0):(n=o>>>24,e+=2)}if(r=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===e?(r>=0&&(t[r--]=o>>24&255),n=0,e=0):(n=o>>>24,e+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?h.prototype._countBits=function(t){return 32-Math.clz32(t)}:h.prototype._countBits=function(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},h.prototype._zeroBits=function(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},h.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;it.length?this.clone().ior(t):t.clone().ior(this)},h.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},h.prototype.iuand=function(t){var i;i=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},h.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},h.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},h.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},h.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),n=t%26;this._expand(i),n>0&&i--;for(var h=0;h0&&(this.words[h]=~this.words[h]&67108863>>26-n),this._strip()},h.prototype.notn=function(t){return this.clone().inotn(t)},h.prototype.setn=function(t,i){r("number"==typeof t&&t>=0);var n=t/26|0,h=t%26;return this._expand(n+1),this.words[n]=i?this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var h=0,e=0;e>>26;for(;0!==h&&e>>26;if(this.length=r.length,0!==h)this.words[this.length]=h,this.length++;else if(r!==this)for(;et.length?this.clone().iadd(t):t.clone().iadd(this)},h.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,h=this.cmp(t);if(0===h)return this.negative=0,this.length=1,this.words[0]=0,this;h>0?(r=this,n=t):(r=t,n=this);for(var e=0,o=0;o>26,this.words[o]=67108863&i;for(;0!==e&&o>26,this.words[o]=67108863&i;if(0===e&&o>>13,d=0|o[1],p=8191&d,M=d>>>13,v=0|o[2],g=8191&v,c=v>>>13,w=0|o[3],y=8191&w,b=w>>>13,_=0|o[4],k=8191&_,A=_>>>13,S=0|o[5],x=8191&S,q=S>>>13,B=0|o[6],R=8191&B,Z=B>>>13,L=0|o[7],N=8191&L,I=L>>>13,E=0|o[8],z=8191&E,T=E>>>13,O=0|o[9],j=8191&O,K=O>>>13,P=0|s[0],F=8191&P,U=P>>>13,C=0|s[1],D=8191&C,H=C>>>13,J=0|s[2],G=8191&J,Q=J>>>13,V=0|s[3],W=8191&V,X=V>>>13,Y=0|s[4],$=8191&Y,tt=Y>>>13,it=0|s[5],rt=8191&it,nt=it>>>13,ht=0|s[6],et=8191&ht,ot=ht>>>13,st=0|s[7],ut=8191&st,at=st>>>13,lt=0|s[8],mt=8191<,ft=lt>>>13,dt=0|s[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(n=Math.imul(m,F))|0)+((8191&(h=(h=Math.imul(m,U))+Math.imul(f,F)|0))<<13)|0;a=((e=Math.imul(f,U))+(h>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),h=(h=Math.imul(p,U))+Math.imul(M,F)|0,e=Math.imul(M,U);var gt=(a+(n=n+Math.imul(m,D)|0)|0)+((8191&(h=(h=h+Math.imul(m,H)|0)+Math.imul(f,D)|0))<<13)|0;a=((e=e+Math.imul(f,H)|0)+(h>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),h=(h=Math.imul(g,U))+Math.imul(c,F)|0,e=Math.imul(c,U),n=n+Math.imul(p,D)|0,h=(h=h+Math.imul(p,H)|0)+Math.imul(M,D)|0,e=e+Math.imul(M,H)|0;var ct=(a+(n=n+Math.imul(m,G)|0)|0)+((8191&(h=(h=h+Math.imul(m,Q)|0)+Math.imul(f,G)|0))<<13)|0;a=((e=e+Math.imul(f,Q)|0)+(h>>>13)|0)+(ct>>>26)|0,ct&=67108863,n=Math.imul(y,F),h=(h=Math.imul(y,U))+Math.imul(b,F)|0,e=Math.imul(b,U),n=n+Math.imul(g,D)|0,h=(h=h+Math.imul(g,H)|0)+Math.imul(c,D)|0,e=e+Math.imul(c,H)|0,n=n+Math.imul(p,G)|0,h=(h=h+Math.imul(p,Q)|0)+Math.imul(M,G)|0,e=e+Math.imul(M,Q)|0;var wt=(a+(n=n+Math.imul(m,W)|0)|0)+((8191&(h=(h=h+Math.imul(m,X)|0)+Math.imul(f,W)|0))<<13)|0;a=((e=e+Math.imul(f,X)|0)+(h>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),h=(h=Math.imul(k,U))+Math.imul(A,F)|0,e=Math.imul(A,U),n=n+Math.imul(y,D)|0,h=(h=h+Math.imul(y,H)|0)+Math.imul(b,D)|0,e=e+Math.imul(b,H)|0,n=n+Math.imul(g,G)|0,h=(h=h+Math.imul(g,Q)|0)+Math.imul(c,G)|0,e=e+Math.imul(c,Q)|0,n=n+Math.imul(p,W)|0,h=(h=h+Math.imul(p,X)|0)+Math.imul(M,W)|0,e=e+Math.imul(M,X)|0;var yt=(a+(n=n+Math.imul(m,$)|0)|0)+((8191&(h=(h=h+Math.imul(m,tt)|0)+Math.imul(f,$)|0))<<13)|0;a=((e=e+Math.imul(f,tt)|0)+(h>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,F),h=(h=Math.imul(x,U))+Math.imul(q,F)|0,e=Math.imul(q,U),n=n+Math.imul(k,D)|0,h=(h=h+Math.imul(k,H)|0)+Math.imul(A,D)|0,e=e+Math.imul(A,H)|0,n=n+Math.imul(y,G)|0,h=(h=h+Math.imul(y,Q)|0)+Math.imul(b,G)|0,e=e+Math.imul(b,Q)|0,n=n+Math.imul(g,W)|0,h=(h=h+Math.imul(g,X)|0)+Math.imul(c,W)|0,e=e+Math.imul(c,X)|0,n=n+Math.imul(p,$)|0,h=(h=h+Math.imul(p,tt)|0)+Math.imul(M,$)|0,e=e+Math.imul(M,tt)|0;var bt=(a+(n=n+Math.imul(m,rt)|0)|0)+((8191&(h=(h=h+Math.imul(m,nt)|0)+Math.imul(f,rt)|0))<<13)|0;a=((e=e+Math.imul(f,nt)|0)+(h>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(R,F),h=(h=Math.imul(R,U))+Math.imul(Z,F)|0,e=Math.imul(Z,U),n=n+Math.imul(x,D)|0,h=(h=h+Math.imul(x,H)|0)+Math.imul(q,D)|0,e=e+Math.imul(q,H)|0,n=n+Math.imul(k,G)|0,h=(h=h+Math.imul(k,Q)|0)+Math.imul(A,G)|0,e=e+Math.imul(A,Q)|0,n=n+Math.imul(y,W)|0,h=(h=h+Math.imul(y,X)|0)+Math.imul(b,W)|0,e=e+Math.imul(b,X)|0,n=n+Math.imul(g,$)|0,h=(h=h+Math.imul(g,tt)|0)+Math.imul(c,$)|0,e=e+Math.imul(c,tt)|0,n=n+Math.imul(p,rt)|0,h=(h=h+Math.imul(p,nt)|0)+Math.imul(M,rt)|0,e=e+Math.imul(M,nt)|0;var _t=(a+(n=n+Math.imul(m,et)|0)|0)+((8191&(h=(h=h+Math.imul(m,ot)|0)+Math.imul(f,et)|0))<<13)|0;a=((e=e+Math.imul(f,ot)|0)+(h>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(N,F),h=(h=Math.imul(N,U))+Math.imul(I,F)|0,e=Math.imul(I,U),n=n+Math.imul(R,D)|0,h=(h=h+Math.imul(R,H)|0)+Math.imul(Z,D)|0,e=e+Math.imul(Z,H)|0,n=n+Math.imul(x,G)|0,h=(h=h+Math.imul(x,Q)|0)+Math.imul(q,G)|0,e=e+Math.imul(q,Q)|0,n=n+Math.imul(k,W)|0,h=(h=h+Math.imul(k,X)|0)+Math.imul(A,W)|0,e=e+Math.imul(A,X)|0,n=n+Math.imul(y,$)|0,h=(h=h+Math.imul(y,tt)|0)+Math.imul(b,$)|0,e=e+Math.imul(b,tt)|0,n=n+Math.imul(g,rt)|0,h=(h=h+Math.imul(g,nt)|0)+Math.imul(c,rt)|0,e=e+Math.imul(c,nt)|0,n=n+Math.imul(p,et)|0,h=(h=h+Math.imul(p,ot)|0)+Math.imul(M,et)|0,e=e+Math.imul(M,ot)|0;var kt=(a+(n=n+Math.imul(m,ut)|0)|0)+((8191&(h=(h=h+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((e=e+Math.imul(f,at)|0)+(h>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,F),h=(h=Math.imul(z,U))+Math.imul(T,F)|0,e=Math.imul(T,U),n=n+Math.imul(N,D)|0,h=(h=h+Math.imul(N,H)|0)+Math.imul(I,D)|0,e=e+Math.imul(I,H)|0,n=n+Math.imul(R,G)|0,h=(h=h+Math.imul(R,Q)|0)+Math.imul(Z,G)|0,e=e+Math.imul(Z,Q)|0,n=n+Math.imul(x,W)|0,h=(h=h+Math.imul(x,X)|0)+Math.imul(q,W)|0,e=e+Math.imul(q,X)|0,n=n+Math.imul(k,$)|0,h=(h=h+Math.imul(k,tt)|0)+Math.imul(A,$)|0,e=e+Math.imul(A,tt)|0,n=n+Math.imul(y,rt)|0,h=(h=h+Math.imul(y,nt)|0)+Math.imul(b,rt)|0,e=e+Math.imul(b,nt)|0,n=n+Math.imul(g,et)|0,h=(h=h+Math.imul(g,ot)|0)+Math.imul(c,et)|0,e=e+Math.imul(c,ot)|0,n=n+Math.imul(p,ut)|0,h=(h=h+Math.imul(p,at)|0)+Math.imul(M,ut)|0,e=e+Math.imul(M,at)|0;var At=(a+(n=n+Math.imul(m,mt)|0)|0)+((8191&(h=(h=h+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((e=e+Math.imul(f,ft)|0)+(h>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,F),h=(h=Math.imul(j,U))+Math.imul(K,F)|0,e=Math.imul(K,U),n=n+Math.imul(z,D)|0,h=(h=h+Math.imul(z,H)|0)+Math.imul(T,D)|0,e=e+Math.imul(T,H)|0,n=n+Math.imul(N,G)|0,h=(h=h+Math.imul(N,Q)|0)+Math.imul(I,G)|0,e=e+Math.imul(I,Q)|0,n=n+Math.imul(R,W)|0,h=(h=h+Math.imul(R,X)|0)+Math.imul(Z,W)|0,e=e+Math.imul(Z,X)|0,n=n+Math.imul(x,$)|0,h=(h=h+Math.imul(x,tt)|0)+Math.imul(q,$)|0,e=e+Math.imul(q,tt)|0,n=n+Math.imul(k,rt)|0,h=(h=h+Math.imul(k,nt)|0)+Math.imul(A,rt)|0,e=e+Math.imul(A,nt)|0,n=n+Math.imul(y,et)|0,h=(h=h+Math.imul(y,ot)|0)+Math.imul(b,et)|0,e=e+Math.imul(b,ot)|0,n=n+Math.imul(g,ut)|0,h=(h=h+Math.imul(g,at)|0)+Math.imul(c,ut)|0,e=e+Math.imul(c,at)|0,n=n+Math.imul(p,mt)|0,h=(h=h+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,e=e+Math.imul(M,ft)|0;var St=(a+(n=n+Math.imul(m,pt)|0)|0)+((8191&(h=(h=h+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((e=e+Math.imul(f,Mt)|0)+(h>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,D),h=(h=Math.imul(j,H))+Math.imul(K,D)|0,e=Math.imul(K,H),n=n+Math.imul(z,G)|0,h=(h=h+Math.imul(z,Q)|0)+Math.imul(T,G)|0,e=e+Math.imul(T,Q)|0,n=n+Math.imul(N,W)|0,h=(h=h+Math.imul(N,X)|0)+Math.imul(I,W)|0,e=e+Math.imul(I,X)|0,n=n+Math.imul(R,$)|0,h=(h=h+Math.imul(R,tt)|0)+Math.imul(Z,$)|0,e=e+Math.imul(Z,tt)|0,n=n+Math.imul(x,rt)|0,h=(h=h+Math.imul(x,nt)|0)+Math.imul(q,rt)|0,e=e+Math.imul(q,nt)|0,n=n+Math.imul(k,et)|0,h=(h=h+Math.imul(k,ot)|0)+Math.imul(A,et)|0,e=e+Math.imul(A,ot)|0,n=n+Math.imul(y,ut)|0,h=(h=h+Math.imul(y,at)|0)+Math.imul(b,ut)|0,e=e+Math.imul(b,at)|0,n=n+Math.imul(g,mt)|0,h=(h=h+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,e=e+Math.imul(c,ft)|0;var xt=(a+(n=n+Math.imul(p,pt)|0)|0)+((8191&(h=(h=h+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;a=((e=e+Math.imul(M,Mt)|0)+(h>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(j,G),h=(h=Math.imul(j,Q))+Math.imul(K,G)|0,e=Math.imul(K,Q),n=n+Math.imul(z,W)|0,h=(h=h+Math.imul(z,X)|0)+Math.imul(T,W)|0,e=e+Math.imul(T,X)|0,n=n+Math.imul(N,$)|0,h=(h=h+Math.imul(N,tt)|0)+Math.imul(I,$)|0,e=e+Math.imul(I,tt)|0,n=n+Math.imul(R,rt)|0,h=(h=h+Math.imul(R,nt)|0)+Math.imul(Z,rt)|0,e=e+Math.imul(Z,nt)|0,n=n+Math.imul(x,et)|0,h=(h=h+Math.imul(x,ot)|0)+Math.imul(q,et)|0,e=e+Math.imul(q,ot)|0,n=n+Math.imul(k,ut)|0,h=(h=h+Math.imul(k,at)|0)+Math.imul(A,ut)|0,e=e+Math.imul(A,at)|0,n=n+Math.imul(y,mt)|0,h=(h=h+Math.imul(y,ft)|0)+Math.imul(b,mt)|0,e=e+Math.imul(b,ft)|0;var qt=(a+(n=n+Math.imul(g,pt)|0)|0)+((8191&(h=(h=h+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;a=((e=e+Math.imul(c,Mt)|0)+(h>>>13)|0)+(qt>>>26)|0,qt&=67108863,n=Math.imul(j,W),h=(h=Math.imul(j,X))+Math.imul(K,W)|0,e=Math.imul(K,X),n=n+Math.imul(z,$)|0,h=(h=h+Math.imul(z,tt)|0)+Math.imul(T,$)|0,e=e+Math.imul(T,tt)|0,n=n+Math.imul(N,rt)|0,h=(h=h+Math.imul(N,nt)|0)+Math.imul(I,rt)|0,e=e+Math.imul(I,nt)|0,n=n+Math.imul(R,et)|0,h=(h=h+Math.imul(R,ot)|0)+Math.imul(Z,et)|0,e=e+Math.imul(Z,ot)|0,n=n+Math.imul(x,ut)|0,h=(h=h+Math.imul(x,at)|0)+Math.imul(q,ut)|0,e=e+Math.imul(q,at)|0,n=n+Math.imul(k,mt)|0,h=(h=h+Math.imul(k,ft)|0)+Math.imul(A,mt)|0,e=e+Math.imul(A,ft)|0;var Bt=(a+(n=n+Math.imul(y,pt)|0)|0)+((8191&(h=(h=h+Math.imul(y,Mt)|0)+Math.imul(b,pt)|0))<<13)|0;a=((e=e+Math.imul(b,Mt)|0)+(h>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(j,$),h=(h=Math.imul(j,tt))+Math.imul(K,$)|0,e=Math.imul(K,tt),n=n+Math.imul(z,rt)|0,h=(h=h+Math.imul(z,nt)|0)+Math.imul(T,rt)|0,e=e+Math.imul(T,nt)|0,n=n+Math.imul(N,et)|0,h=(h=h+Math.imul(N,ot)|0)+Math.imul(I,et)|0,e=e+Math.imul(I,ot)|0,n=n+Math.imul(R,ut)|0,h=(h=h+Math.imul(R,at)|0)+Math.imul(Z,ut)|0,e=e+Math.imul(Z,at)|0,n=n+Math.imul(x,mt)|0,h=(h=h+Math.imul(x,ft)|0)+Math.imul(q,mt)|0,e=e+Math.imul(q,ft)|0;var Rt=(a+(n=n+Math.imul(k,pt)|0)|0)+((8191&(h=(h=h+Math.imul(k,Mt)|0)+Math.imul(A,pt)|0))<<13)|0;a=((e=e+Math.imul(A,Mt)|0)+(h>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(j,rt),h=(h=Math.imul(j,nt))+Math.imul(K,rt)|0,e=Math.imul(K,nt),n=n+Math.imul(z,et)|0,h=(h=h+Math.imul(z,ot)|0)+Math.imul(T,et)|0,e=e+Math.imul(T,ot)|0,n=n+Math.imul(N,ut)|0,h=(h=h+Math.imul(N,at)|0)+Math.imul(I,ut)|0,e=e+Math.imul(I,at)|0,n=n+Math.imul(R,mt)|0,h=(h=h+Math.imul(R,ft)|0)+Math.imul(Z,mt)|0,e=e+Math.imul(Z,ft)|0;var Zt=(a+(n=n+Math.imul(x,pt)|0)|0)+((8191&(h=(h=h+Math.imul(x,Mt)|0)+Math.imul(q,pt)|0))<<13)|0;a=((e=e+Math.imul(q,Mt)|0)+(h>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,n=Math.imul(j,et),h=(h=Math.imul(j,ot))+Math.imul(K,et)|0,e=Math.imul(K,ot),n=n+Math.imul(z,ut)|0,h=(h=h+Math.imul(z,at)|0)+Math.imul(T,ut)|0,e=e+Math.imul(T,at)|0,n=n+Math.imul(N,mt)|0,h=(h=h+Math.imul(N,ft)|0)+Math.imul(I,mt)|0,e=e+Math.imul(I,ft)|0;var Lt=(a+(n=n+Math.imul(R,pt)|0)|0)+((8191&(h=(h=h+Math.imul(R,Mt)|0)+Math.imul(Z,pt)|0))<<13)|0;a=((e=e+Math.imul(Z,Mt)|0)+(h>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(j,ut),h=(h=Math.imul(j,at))+Math.imul(K,ut)|0,e=Math.imul(K,at),n=n+Math.imul(z,mt)|0,h=(h=h+Math.imul(z,ft)|0)+Math.imul(T,mt)|0,e=e+Math.imul(T,ft)|0;var Nt=(a+(n=n+Math.imul(N,pt)|0)|0)+((8191&(h=(h=h+Math.imul(N,Mt)|0)+Math.imul(I,pt)|0))<<13)|0;a=((e=e+Math.imul(I,Mt)|0)+(h>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(j,mt),h=(h=Math.imul(j,ft))+Math.imul(K,mt)|0,e=Math.imul(K,ft);var It=(a+(n=n+Math.imul(z,pt)|0)|0)+((8191&(h=(h=h+Math.imul(z,Mt)|0)+Math.imul(T,pt)|0))<<13)|0;a=((e=e+Math.imul(T,Mt)|0)+(h>>>13)|0)+(It>>>26)|0,It&=67108863;var Et=(a+(n=Math.imul(j,pt))|0)+((8191&(h=(h=Math.imul(j,Mt))+Math.imul(K,pt)|0))<<13)|0;return a=((e=Math.imul(K,Mt))+(h>>>13)|0)+(Et>>>26)|0,Et&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=_t,u[7]=kt,u[8]=At,u[9]=St,u[10]=xt,u[11]=qt,u[12]=Bt,u[13]=Rt,u[14]=Zt,u[15]=Lt,u[16]=Nt,u[17]=It,u[18]=Et,0!==a&&(u[19]=a,r.length++),r};function M(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var n=0,h=0,e=0;e>>26)|0)>>>26,o&=67108863}r.words[e]=s,n=o,o=h}return 0!==n?r.words[e]=n:r.length--,r._strip()}function v(t,i,r){return M(t,i,r)}function g(t,i){this.x=t,this.y=i}Math.imul||(p=d),h.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,i):r<63?d(this,t,i):r<1024?M(this,t,i):v(this,t,i)},g.prototype.makeRBT=function(t){for(var i=new Array(t),r=h.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,i,r,n,h,e){for(var o=0;o>>=1)h++;return 1<>>=13,n[2*o+1]=8191&e,e>>>=13;for(o=2*i;o>=26,n+=e/67108864|0,n+=o>>>26,this.words[h]=67108863&o}return 0!==n&&(this.words[h]=n,this.length++),i?this.ineg():this},h.prototype.muln=function(t){return this.clone().imuln(t)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(t){var i=function(t){for(var i=new Array(t.bitLength()),r=0;r>>h&1}return i}(t);if(0===i.length)return new h(1);for(var r=this,n=0;n=0);var i,n=t%26,h=(t-n)/26,e=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(i=0;i>>26-n}o&&(this.words[i]=o,this.length++)}if(0!==h){for(i=this.length-1;i>=0;i--)this.words[i+h]=this.words[i];for(i=0;i=0),h=i?(i-i%26)/26:0;var e=t%26,o=Math.min((t-e)/26,this.length),s=67108863^67108863>>>e<o)for(this.length-=o,a=0;a=0&&(0!==l||a>=h);a--){var m=0|this.words[a];this.words[a]=l<<26-e|m>>>e,l=m&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},h.prototype.ishrn=function(t,i,n){return r(0===this.negative),this.iushrn(t,i,n)},h.prototype.shln=function(t){return this.clone().ishln(t)},h.prototype.ushln=function(t){return this.clone().iushln(t)},h.prototype.shrn=function(t){return this.clone().ishrn(t)},h.prototype.ushrn=function(t){return this.clone().iushrn(t)},h.prototype.testn=function(t){r("number"==typeof t&&t>=0);var i=t%26,n=(t-i)/26,h=1<=0);var i=t%26,n=(t-i)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==i&&n++,this.length=Math.min(n,this.length),0!==i){var h=67108863^67108863>>>i<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},h.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(u/67108864|0),this.words[h+n]=67108863&e}for(;h>26,this.words[h+n]=67108863&e;if(0===s)return this._strip();for(r(-1===s),s=0,h=0;h>26,this.words[h]=67108863&e;return this.negative=1,this._strip()},h.prototype._wordDiv=function(t,i){var r=(this.length,t.length),n=this.clone(),e=t,o=0|e.words[e.length-1];0!==(r=26-this._countBits(o))&&(e=e.ushln(r),n.iushln(r),o=0|e.words[e.length-1]);var s,u=n.length-e.length;if("mod"!==i){(s=new h(null)).length=u+1,s.words=new Array(s.length);for(var a=0;a=0;m--){var f=67108864*(0|n.words[e.length+m])+(0|n.words[e.length+m-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(e,f,m);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(e,1,m),n.isZero()||(n.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),n._strip(),"div"!==i&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},h.prototype.divmod=function(t,i,n){return r(!t.isZero()),this.isZero()?{div:new h(0),mod:new h(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,i),"mod"!==i&&(e=s.div.neg()),"div"!==i&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(t)),{div:e,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),i),"mod"!==i&&(e=s.div.neg()),{div:e,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),i),"div"!==i&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new h(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new h(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new h(this.modrn(t.words[0]))}:this._wordDiv(t,i);var e,o,s},h.prototype.div=function(t){return this.divmod(t,"div",!1).div},h.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},h.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},h.prototype.divRound=function(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,n=t.ushrn(1),h=t.andln(1),e=r.cmp(n);return e<0||1===h&&0===e?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},h.prototype.modrn=function(t){var i=t<0;i&&(t=-t),r(t<=67108863);for(var n=(1<<26)%t,h=0,e=this.length-1;e>=0;e--)h=(n*h+(0|this.words[e]))%t;return i?-h:h},h.prototype.modn=function(t){return this.modrn(t)},h.prototype.idivn=function(t){var i=t<0;i&&(t=-t),r(t<=67108863);for(var n=0,h=this.length-1;h>=0;h--){var e=(0|this.words[h])+67108864*n;this.words[h]=e/t|0,n=e%t}return this._strip(),i?this.ineg():this},h.prototype.divn=function(t){return this.clone().idivn(t)},h.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var i=this,n=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e=new h(1),o=new h(0),s=new h(0),u=new h(1),a=0;i.isEven()&&n.isEven();)i.iushrn(1),n.iushrn(1),++a;for(var l=n.clone(),m=i.clone();!i.isZero();){for(var f=0,d=1;0==(i.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-- >0;)(e.isOdd()||o.isOdd())&&(e.iadd(l),o.isub(m)),e.iushrn(1),o.iushrn(1);for(var p=0,M=1;0==(n.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(m)),s.iushrn(1),u.iushrn(1);i.cmp(n)>=0?(i.isub(n),e.isub(s),o.isub(u)):(n.isub(i),s.isub(e),u.isub(o))}return{a:s,b:u,gcd:n.iushln(a)}},h.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var i=this,n=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e,o=new h(1),s=new h(0),u=n.clone();i.cmpn(1)>0&&n.cmpn(1)>0;){for(var a=0,l=1;0==(i.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(i.iushrn(a);a-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var m=0,f=1;0==(n.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(n.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);i.cmp(n)>=0?(i.isub(n),o.isub(s)):(n.isub(i),s.isub(o))}return(e=0===i.cmpn(1)?o:s).cmpn(0)<0&&e.iadd(t),e},h.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var n=0;i.isEven()&&r.isEven();n++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var h=i.cmp(r);if(h<0){var e=i;i=r,r=e}else if(0===h||0===r.cmpn(1))break;i.isub(r)}return r.iushln(n)},h.prototype.invm=function(t){return this.egcd(t).a.umod(t)},h.prototype.isEven=function(){return 0==(1&this.words[0])},h.prototype.isOdd=function(){return 1==(1&this.words[0])},h.prototype.andln=function(t){return this.words[0]&t},h.prototype.bincn=function(t){r("number"==typeof t);var i=t%26,n=(t-i)/26,h=1<>>26,s&=67108863,this.words[o]=s}return 0!==e&&(this.words[o]=e,this.length++),this},h.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},h.prototype.cmpn=function(t){var i,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)i=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var h=0|this.words[0];i=h===t?0:ht.length)return 1;if(this.length=0;r--){var n=0|this.words[r],h=0|t.words[r];if(n!==h){nh&&(i=1);break}}return i},h.prototype.gtn=function(t){return 1===this.cmpn(t)},h.prototype.gt=function(t){return 1===this.cmp(t)},h.prototype.gten=function(t){return this.cmpn(t)>=0},h.prototype.gte=function(t){return this.cmp(t)>=0},h.prototype.ltn=function(t){return-1===this.cmpn(t)},h.prototype.lt=function(t){return-1===this.cmp(t)},h.prototype.lten=function(t){return this.cmpn(t)<=0},h.prototype.lte=function(t){return this.cmp(t)<=0},h.prototype.eqn=function(t){return 0===this.cmpn(t)},h.prototype.eq=function(t){return 0===this.cmp(t)},h.red=function(t){return new A(t)},h.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},h.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(t){return this.red=t,this},h.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},h.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},h.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},h.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},h.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},h.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},h.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},h.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},h.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var c={k256:null,p224:null,p192:null,p25519:null};function w(t,i){this.name=t,this.p=new h(i,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var i=h._prime(t);this.m=i.p,this.prime=i}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new h(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)}w.prototype._tmp=function(){var t=new h(null);return t.words=new Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var n=i0?r.isub(this.p):r._strip(),r},w.prototype.split=function(t,i){t.iushrn(this.n,0,i)},w.prototype.imulK=function(t){return t.imul(this.k)},n(y,w),y.prototype.split=function(t,i){for(var r=Math.min(t.length,9),n=0;n>>22,h=e}h>>>=22,t.words[n-10]=h,0===h&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r>>=26,t.words[r]=h,i=n}return 0!==i&&(t.words[t.length++]=i),t},h._prime=function(t){if(c[t])return c[t];var i;if("k256"===t)i=new y;else if("p224"===t)i=new b;else if("p192"===t)i=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new k}return c[t]=i,i},A.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,i){r(0==(t.negative|i.negative),"red works only with positives"),r(t.red&&t.red===i.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},A.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},A.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(r(i%2==1),3===i){var n=this.m.add(new h(1)).iushrn(2);return this.pow(t,n)}for(var e=this.m.subn(1),o=0;!e.isZero()&&0===e.andln(1);)o++,e.iushrn(1);r(!e.isZero());var s=new h(1).toRed(this),u=s.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new h(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var m=this.pow(l,e),f=this.pow(t,e.addn(1).iushrn(1)),d=this.pow(t,e),p=o;0!==d.cmp(s);){for(var M=d,v=0;0!==M.cmp(s);v++)M=M.redSqr();r(v=0;n--){for(var a=i.words[n],l=u-1;l>=0;l--){var m=a>>l&1;e!==r[0]&&(e=this.sqr(e)),0!==m||0!==o?(o<<=1,o|=m,(4===++s||0===n&&0===l)&&(e=this.mul(e,r[o]),s=0,o=0)):s=0}u=26}return e},A.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},A.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},h.mont=function(t){return new S(t)},n(S,A),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},S.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=r.isub(n).iushrn(this.shift),e=h;return h.cmp(this.m)>=0?e=h.isub(this.m):h.cmpn(0)<0&&(e=h.iadd(this.m)),e._forceRed(this)},S.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new h(0)._forceRed(this);var r=t.mul(i),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=r.isub(n).iushrn(this.shift),o=e;return e.cmp(this.m)>=0?o=e.isub(this.m):e.cmpn(0)<0&&(o=e.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof module||module,this); },{"buffer":35}],35:[function(require,module,exports){ @@ -797,7 +797,7 @@ exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<>1,i=-7,N=t?h- }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"_process":67}],62:[function(require,module,exports){ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Mustache=t()}(this,function(){"use strict";var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function n(e){return"function"==typeof e}function r(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(e,t){return null!=e&&"object"==typeof e&&t in e}var o=RegExp.prototype.test;var s=/\S/;function a(e){return!function(e,t){return o.call(e,t)}(s,e)}var u={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};var c=/\s*/,p=/\s+/,l=/\s*=/,h=/\s*\}/,f=/#|\^|\/|>|\{|&|=|!/;function d(e){this.string=e,this.tail=e,this.pos=0}function v(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function g(){this.cache={}}d.prototype.eos=function(){return""===this.tail},d.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},d.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},v.prototype.push=function(e){return new v(e,this)},v.prototype.lookup=function(e){var t,r,o,s=this.cache;if(s.hasOwnProperty(e))t=s[e];else{for(var a,u,c,p=this,l=!1;p;){if(e.indexOf(".")>0)for(a=p.view,u=e.split("."),c=0;null!=a&&c0?i[i.length-1][4]:n;break;default:r.push(t)}return n}(function(e){for(var t,n,r=[],i=0,o=e.length;i"===s?a=this.renderPartial(o,t,n,i):"&"===s?a=this.unescapedValue(o,t):"name"===s?a=this.escapedValue(o,t):"text"===s&&(a=this.rawValue(o)),void 0!==a&&(u+=a);return u},g.prototype.renderSection=function(e,r,i,o){var s=this,a="",u=r.lookup(e[1]);if(u){if(t(u))for(var c=0,p=u.length;c0||!n)&&(i[o]=r+i[o]);return i.join("\n")},g.prototype.renderPartial=function(e,t,r,i){if(r){var o=n(r)?r(e[1]):r[e[1]];if(null!=o){var s=e[6],a=e[5],u=e[4],c=o;return 0==a&&u&&(c=this.indentPartial(o,u,s)),this.renderTokens(this.parse(c,i),t,r,c)}}},g.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},g.prototype.escapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return y.escape(n)},g.prototype.rawValue=function(e){return e[1]};var y={name:"mustache.js",version:"3.2.1",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,to_html:void 0,Scanner:void 0,Context:void 0,Writer:void 0},w=new g;return y.clearCache=function(){return w.clearCache()},y.parse=function(e,t){return w.parse(e,t)},y.render=function(e,n,r,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(t(o=e)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)');var o;return w.render(e,n,r,i)},y.to_html=function(e,t,r,i){var o=y.render(e,t,r);if(!n(i))return o;i(o)},y.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return u[e]})},y.Scanner=d,y.Context=v,y.Writer=g,y}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Mustache=t()}(this,function(){"use strict";var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function n(e){return"function"==typeof e}function r(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(e,t){return null!=e&&"object"==typeof e&&t in e}var o=RegExp.prototype.test;var a=/\S/;function s(e){return!function(e,t){return o.call(e,t)}(a,e)}var c={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};var u=/\s*/,p=/\s+/,l=/\s*=/,h=/\s*\}/,f=/#|\^|\/|>|\{|&|=|!/;function d(e){this.string=e,this.tail=e,this.pos=0}function v(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function g(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}d.prototype.eos=function(){return""===this.tail},d.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},d.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},v.prototype.push=function(e){return new v(e,this)},v.prototype.lookup=function(e){var t,r,o,a=this.cache;if(a.hasOwnProperty(e))t=a[e];else{for(var s,c,u,p=this,l=!1;p;){if(e.indexOf(".")>0)for(s=p.view,c=e.split("."),u=0;null!=s&&u0?i[i.length-1][4]:n;break;default:r.push(t)}return n}(function(e){for(var t,n,r=[],i=0,o=e.length;i"===a?s=this.renderPartial(o,t,n,i):"&"===a?s=this.unescapedValue(o,t):"name"===a?s=this.escapedValue(o,t):"text"===a&&(s=this.rawValue(o)),void 0!==s&&(c+=s);return c},g.prototype.renderSection=function(e,r,i,o){var a=this,s="",c=r.lookup(e[1]);if(c){if(t(c))for(var u=0,p=c.length;u0||!n)&&(i[o]=r+i[o]);return i.join("\n")},g.prototype.renderPartial=function(e,t,r,i){if(r){var o=n(r)?r(e[1]):r[e[1]];if(null!=o){var a=e[6],s=e[5],c=e[4],u=o;return 0==s&&c&&(u=this.indentPartial(o,c,a)),this.renderTokens(this.parse(u,i),t,r,u)}}},g.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},g.prototype.escapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return y.escape(n)},g.prototype.rawValue=function(e){return e[1]};var y={name:"mustache.js",version:"4.0.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){w.templateCache=e},get templateCache(){return w.templateCache}},w=new g;return y.clearCache=function(){return w.clearCache()},y.parse=function(e,t){return w.parse(e,t)},y.render=function(e,n,r,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(t(o=e)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)');var o;return w.render(e,n,r,i)},y.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return c[e]})},y.Scanner=d,y.Context=v,y.Writer=g,y}); },{}],63:[function(require,module,exports){ require("capability/es5"),module.exports=require("./lib"); @@ -987,7 +987,7 @@ exports=module.exports=require("./lib/_stream_readable.js"),exports.Stream=expor function toIdentifier(e){return e.split(" ").map(function(e){return e.slice(0,1).toUpperCase()+e.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}module.exports=toIdentifier; },{}],97:[function(require,module,exports){ -!function(r){"use strict";var t=function(r){var t,n=new Float64Array(16);if(r)for(t=0;t>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function v(r,t,n,e,o){var i,h=0;for(i=0;i>>8)-1}function w(r,t,n,e){return v(r,t,n,e,16)}function p(r,t,n,e){return v(r,t,n,e,32)}function b(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,v=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,w=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,U=i,d=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,Y=v,k=w,T=p,L=b,z=g,R=_,P=A,N=0;N<20;N+=2)U^=(o=(L^=(o=(K^=(o=(M^=(o=U+L|0)<<7|o>>>25)+U|0)<<9|o>>>23)+M|0)<<13|o>>>19)+K|0)<<18|o>>>14,m^=(o=(d^=(o=(z^=(o=(Y^=(o=m+d|0)<<7|o>>>25)+m|0)<<9|o>>>23)+Y|0)<<13|o>>>19)+z|0)<<18|o>>>14,k^=(o=(B^=(o=(E^=(o=(R^=(o=k+B|0)<<7|o>>>25)+k|0)<<9|o>>>23)+R|0)<<13|o>>>19)+E|0)<<18|o>>>14,P^=(o=(T^=(o=(S^=(o=(x^=(o=P+T|0)<<7|o>>>25)+P|0)<<9|o>>>23)+x|0)<<13|o>>>19)+S|0)<<18|o>>>14,U^=(o=(x^=(o=(E^=(o=(d^=(o=U+x|0)<<7|o>>>25)+U|0)<<9|o>>>23)+d|0)<<13|o>>>19)+E|0)<<18|o>>>14,m^=(o=(M^=(o=(S^=(o=(B^=(o=m+M|0)<<7|o>>>25)+m|0)<<9|o>>>23)+B|0)<<13|o>>>19)+S|0)<<18|o>>>14,k^=(o=(Y^=(o=(K^=(o=(T^=(o=k+Y|0)<<7|o>>>25)+k|0)<<9|o>>>23)+T|0)<<13|o>>>19)+K|0)<<18|o>>>14,P^=(o=(R^=(o=(z^=(o=(L^=(o=P+R|0)<<7|o>>>25)+P|0)<<9|o>>>23)+L|0)<<13|o>>>19)+z|0)<<18|o>>>14;U=U+i|0,d=d+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,K=K+l|0,Y=Y+v|0,k=k+w|0,T=T+p|0,L=L+b|0,z=z+g|0,R=R+_|0,P=P+A|0,r[0]=U>>>0&255,r[1]=U>>>8&255,r[2]=U>>>16&255,r[3]=U>>>24&255,r[4]=d>>>0&255,r[5]=d>>>8&255,r[6]=d>>>16&255,r[7]=d>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=K>>>0&255,r[33]=K>>>8&255,r[34]=K>>>16&255,r[35]=K>>>24&255,r[36]=Y>>>0&255,r[37]=Y>>>8&255,r[38]=Y>>>16&255,r[39]=Y>>>24&255,r[40]=k>>>0&255,r[41]=k>>>8&255,r[42]=k>>>16&255,r[43]=k>>>24&255,r[44]=T>>>0&255,r[45]=T>>>8&255,r[46]=T>>>16&255,r[47]=T>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=z>>>0&255,r[53]=z>>>8&255,r[54]=z>>>16&255,r[55]=z>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=P>>>0&255,r[61]=P>>>8&255,r[62]=P>>>16&255,r[63]=P>>>24&255}(r,t,n,e)}function g(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,v=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,w=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,U=0;U<20;U+=2)i^=(o=(b^=(o=(l^=(o=(s^=(o=i+b|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+l|0)<<18|o>>>14,u^=(o=(h^=(o=(g^=(o=(v^=(o=u+h|0)<<7|o>>>25)+u|0)<<9|o>>>23)+v|0)<<13|o>>>19)+g|0)<<18|o>>>14,w^=(o=(c^=(o=(a^=(o=(_^=(o=w+c|0)<<7|o>>>25)+w|0)<<9|o>>>23)+_|0)<<13|o>>>19)+a|0)<<18|o>>>14,A^=(o=(p^=(o=(y^=(o=(f^=(o=A+p|0)<<7|o>>>25)+A|0)<<9|o>>>23)+f|0)<<13|o>>>19)+y|0)<<18|o>>>14,i^=(o=(f^=(o=(a^=(o=(h^=(o=i+f|0)<<7|o>>>25)+i|0)<<9|o>>>23)+h|0)<<13|o>>>19)+a|0)<<18|o>>>14,u^=(o=(s^=(o=(y^=(o=(c^=(o=u+s|0)<<7|o>>>25)+u|0)<<9|o>>>23)+c|0)<<13|o>>>19)+y|0)<<18|o>>>14,w^=(o=(v^=(o=(l^=(o=(p^=(o=w+v|0)<<7|o>>>25)+w|0)<<9|o>>>23)+p|0)<<13|o>>>19)+l|0)<<18|o>>>14,A^=(o=(_^=(o=(g^=(o=(b^=(o=A+_|0)<<7|o>>>25)+A|0)<<9|o>>>23)+b|0)<<13|o>>>19)+g|0)<<18|o>>>14;r[0]=i>>>0&255,r[1]=i>>>8&255,r[2]=i>>>16&255,r[3]=i>>>24&255,r[4]=u>>>0&255,r[5]=u>>>8&255,r[6]=u>>>16&255,r[7]=u>>>24&255,r[8]=w>>>0&255,r[9]=w>>>8&255,r[10]=w>>>16&255,r[11]=w>>>24&255,r[12]=A>>>0&255,r[13]=A>>>8&255,r[14]=A>>>16&255,r[15]=A>>>24&255,r[16]=c>>>0&255,r[17]=c>>>8&255,r[18]=c>>>16&255,r[19]=c>>>24&255,r[20]=y>>>0&255,r[21]=y>>>8&255,r[22]=y>>>16&255,r[23]=y>>>24&255,r[24]=l>>>0&255,r[25]=l>>>8&255,r[26]=l>>>16&255,r[27]=l>>>24&255,r[28]=v>>>0&255,r[29]=v>>>8&255,r[30]=v>>>16&255,r[31]=v>>>24&255}(r,t,n,e)}var _=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function A(r,t,n,e,o,i,h){var a,f,s=new Uint8Array(16),u=new Uint8Array(64);for(f=0;f<16;f++)s[f]=0;for(f=0;f<8;f++)s[f]=i[f];for(;o>=64;){for(b(u,s,h,_),f=0;f<64;f++)r[t+f]=n[e+f]^u[f];for(a=1,f=8;f<16;f++)a=a+(255&s[f])|0,s[f]=255&a,a>>>=8;o-=64,t+=64,e+=64}if(o>0)for(b(u,s,h,_),f=0;f=64;){for(b(f,a,o,_),h=0;h<64;h++)r[t+h]=f[h];for(i=1,h=8;h<16;h++)i=i+(255&a[h])|0,a[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(b(f,a,o,_),h=0;h>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};function M(r,t,n,e,o,i){var h=new x(i);return h.update(n,e,o),h.finish(r,t),0}function m(r,t,n,e,o,i){var h=new Uint8Array(16);return M(h,0,n,e,o,i),w(r,t,h,0)}function B(r,t,n,e,o){var i;if(n<32)return-1;for(E(r,0,t,0,n,e,o),M(r,16,r,32,n-32,r),i=0;i<16;i++)r[i]=0;return 0}function S(r,t,n,e,o){var i,h=new Uint8Array(32);if(n<32)return-1;if(d(h,0,32,e,o),0!==m(t,16,t,32,n-32,h))return-1;for(E(r,0,t,0,n,e,o),i=0;i<32;i++)r[i]=0;return 0}function K(r,t){var n;for(n=0;n<16;n++)r[n]=0|t[n]}function Y(r){var t,n,e=1;for(t=0;t<16;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function k(r,t,n){for(var e,o=~(n-1),i=0;i<16;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function T(r,n){var e,o,i,h=t(),a=t();for(e=0;e<16;e++)a[e]=n[e];for(Y(a),Y(a),Y(a),o=0;o<2;o++){for(h[0]=a[0]-65517,e=1;e<15;e++)h[e]=a[e]-65535-(h[e-1]>>16&1),h[e-1]&=65535;h[15]=a[15]-32767-(h[14]>>16&1),i=h[15]>>16&1,h[14]&=65535,k(a,h,1-i)}for(e=0;e<16;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function L(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return T(n,r),T(e,t),p(n,0,e,0)}function z(r){var t=new Uint8Array(32);return T(t,r),1&t[0]}function R(r,t){var n;for(n=0;n<16;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function P(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]+n[e]}function N(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]-n[e]}function O(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,v=0,w=0,p=0,b=0,g=0,_=0,A=0,U=0,d=0,E=0,x=0,M=0,m=0,B=0,S=0,K=0,Y=0,k=0,T=0,L=0,z=0,R=0,P=n[0],N=n[1],O=n[2],C=n[3],F=n[4],I=n[5],G=n[6],Z=n[7],q=n[8],V=n[9],X=n[10],D=n[11],j=n[12],H=n[13],J=n[14],Q=n[15];i+=(e=t[0])*P,h+=e*N,a+=e*O,f+=e*C,s+=e*F,u+=e*I,c+=e*G,y+=e*Z,l+=e*q,v+=e*V,w+=e*X,p+=e*D,b+=e*j,g+=e*H,_+=e*J,A+=e*Q,h+=(e=t[1])*P,a+=e*N,f+=e*O,s+=e*C,u+=e*F,c+=e*I,y+=e*G,l+=e*Z,v+=e*q,w+=e*V,p+=e*X,b+=e*D,g+=e*j,_+=e*H,A+=e*J,U+=e*Q,a+=(e=t[2])*P,f+=e*N,s+=e*O,u+=e*C,c+=e*F,y+=e*I,l+=e*G,v+=e*Z,w+=e*q,p+=e*V,b+=e*X,g+=e*D,_+=e*j,A+=e*H,U+=e*J,d+=e*Q,f+=(e=t[3])*P,s+=e*N,u+=e*O,c+=e*C,y+=e*F,l+=e*I,v+=e*G,w+=e*Z,p+=e*q,b+=e*V,g+=e*X,_+=e*D,A+=e*j,U+=e*H,d+=e*J,E+=e*Q,s+=(e=t[4])*P,u+=e*N,c+=e*O,y+=e*C,l+=e*F,v+=e*I,w+=e*G,p+=e*Z,b+=e*q,g+=e*V,_+=e*X,A+=e*D,U+=e*j,d+=e*H,E+=e*J,x+=e*Q,u+=(e=t[5])*P,c+=e*N,y+=e*O,l+=e*C,v+=e*F,w+=e*I,p+=e*G,b+=e*Z,g+=e*q,_+=e*V,A+=e*X,U+=e*D,d+=e*j,E+=e*H,x+=e*J,M+=e*Q,c+=(e=t[6])*P,y+=e*N,l+=e*O,v+=e*C,w+=e*F,p+=e*I,b+=e*G,g+=e*Z,_+=e*q,A+=e*V,U+=e*X,d+=e*D,E+=e*j,x+=e*H,M+=e*J,m+=e*Q,y+=(e=t[7])*P,l+=e*N,v+=e*O,w+=e*C,p+=e*F,b+=e*I,g+=e*G,_+=e*Z,A+=e*q,U+=e*V,d+=e*X,E+=e*D,x+=e*j,M+=e*H,m+=e*J,B+=e*Q,l+=(e=t[8])*P,v+=e*N,w+=e*O,p+=e*C,b+=e*F,g+=e*I,_+=e*G,A+=e*Z,U+=e*q,d+=e*V,E+=e*X,x+=e*D,M+=e*j,m+=e*H,B+=e*J,S+=e*Q,v+=(e=t[9])*P,w+=e*N,p+=e*O,b+=e*C,g+=e*F,_+=e*I,A+=e*G,U+=e*Z,d+=e*q,E+=e*V,x+=e*X,M+=e*D,m+=e*j,B+=e*H,S+=e*J,K+=e*Q,w+=(e=t[10])*P,p+=e*N,b+=e*O,g+=e*C,_+=e*F,A+=e*I,U+=e*G,d+=e*Z,E+=e*q,x+=e*V,M+=e*X,m+=e*D,B+=e*j,S+=e*H,K+=e*J,Y+=e*Q,p+=(e=t[11])*P,b+=e*N,g+=e*O,_+=e*C,A+=e*F,U+=e*I,d+=e*G,E+=e*Z,x+=e*q,M+=e*V,m+=e*X,B+=e*D,S+=e*j,K+=e*H,Y+=e*J,k+=e*Q,b+=(e=t[12])*P,g+=e*N,_+=e*O,A+=e*C,U+=e*F,d+=e*I,E+=e*G,x+=e*Z,M+=e*q,m+=e*V,B+=e*X,S+=e*D,K+=e*j,Y+=e*H,k+=e*J,T+=e*Q,g+=(e=t[13])*P,_+=e*N,A+=e*O,U+=e*C,d+=e*F,E+=e*I,x+=e*G,M+=e*Z,m+=e*q,B+=e*V,S+=e*X,K+=e*D,Y+=e*j,k+=e*H,T+=e*J,L+=e*Q,_+=(e=t[14])*P,A+=e*N,U+=e*O,d+=e*C,E+=e*F,x+=e*I,M+=e*G,m+=e*Z,B+=e*q,S+=e*V,K+=e*X,Y+=e*D,k+=e*j,T+=e*H,L+=e*J,z+=e*Q,A+=(e=t[15])*P,h+=38*(d+=e*O),a+=38*(E+=e*C),f+=38*(x+=e*F),s+=38*(M+=e*I),u+=38*(m+=e*G),c+=38*(B+=e*Z),y+=38*(S+=e*q),l+=38*(K+=e*V),v+=38*(Y+=e*X),w+=38*(k+=e*D),p+=38*(T+=e*j),b+=38*(L+=e*H),g+=38*(z+=e*J),_+=38*(R+=e*Q),i=(e=(i+=38*(U+=e*N))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),i=(e=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=v,r[10]=w,r[11]=p,r[12]=b,r[13]=g,r[14]=_,r[15]=A}function C(r,t){O(r,t,t)}function F(r,n){var e,o=t();for(e=0;e<16;e++)o[e]=n[e];for(e=253;e>=0;e--)C(o,o),2!==e&&4!==e&&O(o,o,n);for(e=0;e<16;e++)r[e]=o[e]}function I(r,n,e){var o,i,h=new Uint8Array(32),f=new Float64Array(80),s=t(),u=t(),c=t(),y=t(),l=t(),v=t();for(i=0;i<31;i++)h[i]=n[i];for(h[31]=127&n[31]|64,h[0]&=248,R(f,e),i=0;i<16;i++)u[i]=f[i],y[i]=s[i]=c[i]=0;for(s[0]=y[0]=1,i=254;i>=0;--i)k(s,u,o=h[i>>>3]>>>(7&i)&1),k(c,y,o),P(l,s,c),N(s,s,c),P(c,u,y),N(u,u,y),C(y,l),C(v,s),O(s,c,s),O(c,u,l),P(l,s,c),N(s,s,c),C(u,s),N(c,y,v),O(s,c,a),P(s,s,y),O(c,c,s),O(s,y,v),O(y,u,f),C(u,l),k(s,u,o),k(c,y,o);for(i=0;i<16;i++)f[i+16]=s[i],f[i+32]=c[i],f[i+48]=u[i],f[i+64]=y[i];var w=f.subarray(32),p=f.subarray(16);return F(w,w),O(p,p,w),T(r,p),0}function G(r,t){return I(r,t,o)}function Z(r,t){return n(t,32),G(r,t)}function q(r,t,n){var o=new Uint8Array(32);return I(o,n,t),g(r,e,o,_)}x.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,v,w,p,b,g,_,A,U,d=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],K=this.h[6],Y=this.h[7],k=this.h[8],T=this.h[9],L=this.r[0],z=this.r[1],R=this.r[2],P=this.r[3],N=this.r[4],O=this.r[5],C=this.r[6],F=this.r[7],I=this.r[8],G=this.r[9];n>=16;)y=c=0,y+=(E+=8191&(e=255&r[t+0]|(255&r[t+1])<<8))*L,y+=(x+=8191&(e>>>13|(o=255&r[t+2]|(255&r[t+3])<<8)<<3))*(5*G),y+=(M+=8191&(o>>>10|(i=255&r[t+4]|(255&r[t+5])<<8)<<6))*(5*I),y+=(m+=8191&(i>>>7|(h=255&r[t+6]|(255&r[t+7])<<8)<<9))*(5*F),c=(y+=(B+=8191&(h>>>4|(a=255&r[t+8]|(255&r[t+9])<<8)<<12))*(5*C))>>>13,y&=8191,y+=(S+=a>>>1&8191)*(5*O),y+=(K+=8191&(a>>>14|(f=255&r[t+10]|(255&r[t+11])<<8)<<2))*(5*N),y+=(Y+=8191&(f>>>11|(s=255&r[t+12]|(255&r[t+13])<<8)<<5))*(5*P),y+=(k+=8191&(s>>>8|(u=255&r[t+14]|(255&r[t+15])<<8)<<8))*(5*R),l=c+=(y+=(T+=u>>>5|d)*(5*z))>>>13,l+=E*z,l+=x*L,l+=M*(5*G),l+=m*(5*I),c=(l+=B*(5*F))>>>13,l&=8191,l+=S*(5*C),l+=K*(5*O),l+=Y*(5*N),l+=k*(5*P),c+=(l+=T*(5*R))>>>13,l&=8191,v=c,v+=E*R,v+=x*z,v+=M*L,v+=m*(5*G),c=(v+=B*(5*I))>>>13,v&=8191,v+=S*(5*F),v+=K*(5*C),v+=Y*(5*O),v+=k*(5*N),w=c+=(v+=T*(5*P))>>>13,w+=E*P,w+=x*R,w+=M*z,w+=m*L,c=(w+=B*(5*G))>>>13,w&=8191,w+=S*(5*I),w+=K*(5*F),w+=Y*(5*C),w+=k*(5*O),p=c+=(w+=T*(5*N))>>>13,p+=E*N,p+=x*P,p+=M*R,p+=m*z,c=(p+=B*L)>>>13,p&=8191,p+=S*(5*G),p+=K*(5*I),p+=Y*(5*F),p+=k*(5*C),b=c+=(p+=T*(5*O))>>>13,b+=E*O,b+=x*N,b+=M*P,b+=m*R,c=(b+=B*z)>>>13,b&=8191,b+=S*L,b+=K*(5*G),b+=Y*(5*I),b+=k*(5*F),g=c+=(b+=T*(5*C))>>>13,g+=E*C,g+=x*O,g+=M*N,g+=m*P,c=(g+=B*R)>>>13,g&=8191,g+=S*z,g+=K*L,g+=Y*(5*G),g+=k*(5*I),_=c+=(g+=T*(5*F))>>>13,_+=E*F,_+=x*C,_+=M*O,_+=m*N,c=(_+=B*P)>>>13,_&=8191,_+=S*R,_+=K*z,_+=Y*L,_+=k*(5*G),A=c+=(_+=T*(5*I))>>>13,A+=E*I,A+=x*F,A+=M*C,A+=m*O,c=(A+=B*N)>>>13,A&=8191,A+=S*P,A+=K*R,A+=Y*z,A+=k*L,U=c+=(A+=T*(5*G))>>>13,U+=E*G,U+=x*I,U+=M*F,U+=m*C,c=(U+=B*O)>>>13,U&=8191,U+=S*N,U+=K*P,U+=Y*R,U+=k*z,E=y=8191&(c=(c=((c+=(U+=T*L)>>>13)<<2)+c|0)+(y&=8191)|0),x=l+=c>>>=13,M=v&=8191,m=w&=8191,B=p&=8191,S=b&=8191,K=g&=8191,Y=_&=8191,k=A&=8191,T=U&=8191,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=K,this.h[7]=Y,this.h[8]=k,this.h[9]=T},x.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;i<10;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(1^n)-1,i=0;i<10;i++)h[i]&=e;for(e=~e,i=0;i<10;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},x.prototype.update=function(r,t,n){var e,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),e=0;e=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;e=128;){for(d=0;d<16;d++)E=8*d+H,Y[d]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],k[d]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(d=0;d<80;d++)if(o=T,i=L,h=z,a=R,f=P,s=N,u=O,C,y=F,l=I,v=G,w=Z,p=q,b=V,g=X,j,m=65535&(M=j),B=M>>>16,S=65535&(x=C),K=x>>>16,m+=65535&(M=(q>>>14|P<<18)^(q>>>18|P<<14)^(P>>>9|q<<23)),B+=M>>>16,S+=65535&(x=(P>>>14|q<<18)^(P>>>18|q<<14)^(q>>>9|P<<23)),K+=x>>>16,m+=65535&(M=q&V^~q&X),B+=M>>>16,S+=65535&(x=P&N^~P&O),K+=x>>>16,x=D[2*d],m+=65535&(M=D[2*d+1]),B+=M>>>16,S+=65535&x,K+=x>>>16,x=Y[d%16],B+=(M=k[d%16])>>>16,S+=65535&x,K+=x>>>16,S+=(B+=(m+=65535&M)>>>16)>>>16,m=65535&(M=U=65535&m|B<<16),B=M>>>16,S=65535&(x=A=65535&S|(K+=S>>>16)<<16),K=x>>>16,m+=65535&(M=(F>>>28|T<<4)^(T>>>2|F<<30)^(T>>>7|F<<25)),B+=M>>>16,S+=65535&(x=(T>>>28|F<<4)^(F>>>2|T<<30)^(F>>>7|T<<25)),K+=x>>>16,B+=(M=F&I^F&G^I&G)>>>16,S+=65535&(x=T&L^T&z^L&z),K+=x>>>16,c=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(K+=S>>>16)<<16,_=65535&m|B<<16,m=65535&(M=w),B=M>>>16,S=65535&(x=a),K=x>>>16,B+=(M=U)>>>16,S+=65535&(x=A),K+=x>>>16,L=o,z=i,R=h,P=a=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(K+=S>>>16)<<16,N=f,O=s,C=u,T=c,I=y,G=l,Z=v,q=w=65535&m|B<<16,V=p,X=b,j=g,F=_,d%16==15)for(E=0;E<16;E++)x=Y[E],m=65535&(M=k[E]),B=M>>>16,S=65535&x,K=x>>>16,x=Y[(E+9)%16],m+=65535&(M=k[(E+9)%16]),B+=M>>>16,S+=65535&x,K+=x>>>16,A=Y[(E+1)%16],m+=65535&(M=((U=k[(E+1)%16])>>>1|A<<31)^(U>>>8|A<<24)^(U>>>7|A<<25)),B+=M>>>16,S+=65535&(x=(A>>>1|U<<31)^(A>>>8|U<<24)^A>>>7),K+=x>>>16,A=Y[(E+14)%16],B+=(M=((U=k[(E+14)%16])>>>19|A<<13)^(A>>>29|U<<3)^(U>>>6|A<<26))>>>16,S+=65535&(x=(A>>>19|U<<13)^(U>>>29|A<<3)^A>>>6),K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,Y[E]=65535&S|K<<16,k[E]=65535&m|B<<16;m=65535&(M=F),B=M>>>16,S=65535&(x=T),K=x>>>16,x=r[0],B+=(M=t[0])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[0]=T=65535&S|K<<16,t[0]=F=65535&m|B<<16,m=65535&(M=I),B=M>>>16,S=65535&(x=L),K=x>>>16,x=r[1],B+=(M=t[1])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[1]=L=65535&S|K<<16,t[1]=I=65535&m|B<<16,m=65535&(M=G),B=M>>>16,S=65535&(x=z),K=x>>>16,x=r[2],B+=(M=t[2])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[2]=z=65535&S|K<<16,t[2]=G=65535&m|B<<16,m=65535&(M=Z),B=M>>>16,S=65535&(x=R),K=x>>>16,x=r[3],B+=(M=t[3])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[3]=R=65535&S|K<<16,t[3]=Z=65535&m|B<<16,m=65535&(M=q),B=M>>>16,S=65535&(x=P),K=x>>>16,x=r[4],B+=(M=t[4])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[4]=P=65535&S|K<<16,t[4]=q=65535&m|B<<16,m=65535&(M=V),B=M>>>16,S=65535&(x=N),K=x>>>16,x=r[5],B+=(M=t[5])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[5]=N=65535&S|K<<16,t[5]=V=65535&m|B<<16,m=65535&(M=X),B=M>>>16,S=65535&(x=O),K=x>>>16,x=r[6],B+=(M=t[6])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[6]=O=65535&S|K<<16,t[6]=X=65535&m|B<<16,m=65535&(M=j),B=M>>>16,S=65535&(x=C),K=x>>>16,x=r[7],B+=(M=t[7])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[7]=C=65535&S|K<<16,t[7]=j=65535&m|B<<16,H+=128,e-=128}return e}function H(r,t,n){var e,o=new Int32Array(8),i=new Int32Array(8),h=new Uint8Array(256),a=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,j(o,i,t,n),n%=128,e=0;e=0;--o)Q(r,t,e=n[o/8|0]>>(7&o)&1),J(t,r),J(r,r),Q(r,t,e)}function rr(r,n){var e=[t(),t(),t(),t()];K(e[0],u),K(e[1],c),K(e[2],h),O(e[3],u,c),$(r,e,n)}function tr(r,e,o){var i,h=new Uint8Array(64),a=[t(),t(),t(),t()];for(o||n(e,32),H(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64,rr(a,h),W(r,a),i=0;i<32;i++)e[i+32]=r[i];return 0}var nr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function er(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;o>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>4)*nr[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*nr[o];for(e=0;e<32;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function or(r){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=r[t];for(t=0;t<64;t++)r[t]=0;er(r,n)}function ir(r,n,e,o){var i,h,a=new Uint8Array(64),f=new Uint8Array(64),s=new Uint8Array(64),u=new Float64Array(64),c=[t(),t(),t(),t()];H(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(i=0;i=0;e--)C(o,o),1!==e&&O(o,o,n);for(e=0;e<16;e++)r[e]=o[e]}(e,e),O(e,e,a),O(e,e,s),O(e,e,s),O(r[0],e,s),C(o,r[0]),O(o,o,s),L(o,a)&&O(r[0],r[0],y),C(o,r[0]),O(o,o,s),L(o,a)?-1:(z(r[0])===n[31]>>7&&N(r[0],i,r[0]),O(r[3],r[0],r[1]),0)}function ar(r,n,e,o){var i,h=new Uint8Array(32),a=new Uint8Array(64),f=[t(),t(),t(),t()],s=[t(),t(),t(),t()];if(-1,e<64)return-1;if(hr(s,o))return-1;for(i=0;i=0},r.sign.keyPair=function(){var r=new Uint8Array(32),t=new Uint8Array(64);return tr(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(vr(r),64!==r.length)throw new Error("bad secret key size");for(var t=new Uint8Array(32),n=0;n>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function w(r,t,n,e,o){var i,h=0;for(i=0;i>>8)-1}function v(r,t,n,e){return w(r,t,n,e,16)}function p(r,t,n,e){return w(r,t,n,e,32)}function b(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,v=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,A=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,U=i,d=h,E=a,x=f,M=s,m=u,B=c,S=y,k=l,K=w,Y=v,L=p,T=b,z=g,R=A,P=_,N=0;N<20;N+=2)U^=(o=(T^=(o=(k^=(o=(M^=(o=U+T|0)<<7|o>>>25)+U|0)<<9|o>>>23)+M|0)<<13|o>>>19)+k|0)<<18|o>>>14,m^=(o=(d^=(o=(z^=(o=(K^=(o=m+d|0)<<7|o>>>25)+m|0)<<9|o>>>23)+K|0)<<13|o>>>19)+z|0)<<18|o>>>14,Y^=(o=(B^=(o=(E^=(o=(R^=(o=Y+B|0)<<7|o>>>25)+Y|0)<<9|o>>>23)+R|0)<<13|o>>>19)+E|0)<<18|o>>>14,P^=(o=(L^=(o=(S^=(o=(x^=(o=P+L|0)<<7|o>>>25)+P|0)<<9|o>>>23)+x|0)<<13|o>>>19)+S|0)<<18|o>>>14,U^=(o=(x^=(o=(E^=(o=(d^=(o=U+x|0)<<7|o>>>25)+U|0)<<9|o>>>23)+d|0)<<13|o>>>19)+E|0)<<18|o>>>14,m^=(o=(M^=(o=(S^=(o=(B^=(o=m+M|0)<<7|o>>>25)+m|0)<<9|o>>>23)+B|0)<<13|o>>>19)+S|0)<<18|o>>>14,Y^=(o=(K^=(o=(k^=(o=(L^=(o=Y+K|0)<<7|o>>>25)+Y|0)<<9|o>>>23)+L|0)<<13|o>>>19)+k|0)<<18|o>>>14,P^=(o=(R^=(o=(z^=(o=(T^=(o=P+R|0)<<7|o>>>25)+P|0)<<9|o>>>23)+T|0)<<13|o>>>19)+z|0)<<18|o>>>14;U=U+i|0,d=d+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,k=k+l|0,K=K+w|0,Y=Y+v|0,L=L+p|0,T=T+b|0,z=z+g|0,R=R+A|0,P=P+_|0,r[0]=U>>>0&255,r[1]=U>>>8&255,r[2]=U>>>16&255,r[3]=U>>>24&255,r[4]=d>>>0&255,r[5]=d>>>8&255,r[6]=d>>>16&255,r[7]=d>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=k>>>0&255,r[33]=k>>>8&255,r[34]=k>>>16&255,r[35]=k>>>24&255,r[36]=K>>>0&255,r[37]=K>>>8&255,r[38]=K>>>16&255,r[39]=K>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=L>>>0&255,r[45]=L>>>8&255,r[46]=L>>>16&255,r[47]=L>>>24&255,r[48]=T>>>0&255,r[49]=T>>>8&255,r[50]=T>>>16&255,r[51]=T>>>24&255,r[52]=z>>>0&255,r[53]=z>>>8&255,r[54]=z>>>16&255,r[55]=z>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=P>>>0&255,r[61]=P>>>8&255,r[62]=P>>>16&255,r[63]=P>>>24&255}(r,t,n,e)}function g(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,v=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,A=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,U=0;U<20;U+=2)i^=(o=(b^=(o=(l^=(o=(s^=(o=i+b|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+l|0)<<18|o>>>14,u^=(o=(h^=(o=(g^=(o=(w^=(o=u+h|0)<<7|o>>>25)+u|0)<<9|o>>>23)+w|0)<<13|o>>>19)+g|0)<<18|o>>>14,v^=(o=(c^=(o=(a^=(o=(A^=(o=v+c|0)<<7|o>>>25)+v|0)<<9|o>>>23)+A|0)<<13|o>>>19)+a|0)<<18|o>>>14,_^=(o=(p^=(o=(y^=(o=(f^=(o=_+p|0)<<7|o>>>25)+_|0)<<9|o>>>23)+f|0)<<13|o>>>19)+y|0)<<18|o>>>14,i^=(o=(f^=(o=(a^=(o=(h^=(o=i+f|0)<<7|o>>>25)+i|0)<<9|o>>>23)+h|0)<<13|o>>>19)+a|0)<<18|o>>>14,u^=(o=(s^=(o=(y^=(o=(c^=(o=u+s|0)<<7|o>>>25)+u|0)<<9|o>>>23)+c|0)<<13|o>>>19)+y|0)<<18|o>>>14,v^=(o=(w^=(o=(l^=(o=(p^=(o=v+w|0)<<7|o>>>25)+v|0)<<9|o>>>23)+p|0)<<13|o>>>19)+l|0)<<18|o>>>14,_^=(o=(A^=(o=(g^=(o=(b^=(o=_+A|0)<<7|o>>>25)+_|0)<<9|o>>>23)+b|0)<<13|o>>>19)+g|0)<<18|o>>>14;r[0]=i>>>0&255,r[1]=i>>>8&255,r[2]=i>>>16&255,r[3]=i>>>24&255,r[4]=u>>>0&255,r[5]=u>>>8&255,r[6]=u>>>16&255,r[7]=u>>>24&255,r[8]=v>>>0&255,r[9]=v>>>8&255,r[10]=v>>>16&255,r[11]=v>>>24&255,r[12]=_>>>0&255,r[13]=_>>>8&255,r[14]=_>>>16&255,r[15]=_>>>24&255,r[16]=c>>>0&255,r[17]=c>>>8&255,r[18]=c>>>16&255,r[19]=c>>>24&255,r[20]=y>>>0&255,r[21]=y>>>8&255,r[22]=y>>>16&255,r[23]=y>>>24&255,r[24]=l>>>0&255,r[25]=l>>>8&255,r[26]=l>>>16&255,r[27]=l>>>24&255,r[28]=w>>>0&255,r[29]=w>>>8&255,r[30]=w>>>16&255,r[31]=w>>>24&255}(r,t,n,e)}var A=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(r,t,n,e,o,i,h){var a,f,s=new Uint8Array(16),u=new Uint8Array(64);for(f=0;f<16;f++)s[f]=0;for(f=0;f<8;f++)s[f]=i[f];for(;o>=64;){for(b(u,s,h,A),f=0;f<64;f++)r[t+f]=n[e+f]^u[f];for(a=1,f=8;f<16;f++)a=a+(255&s[f])|0,s[f]=255&a,a>>>=8;o-=64,t+=64,e+=64}if(o>0)for(b(u,s,h,A),f=0;f=64;){for(b(f,a,o,A),h=0;h<64;h++)r[t+h]=f[h];for(i=1,h=8;h<16;h++)i=i+(255&a[h])|0,a[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(b(f,a,o,A),h=0;h>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};function M(r,t,n,e,o,i){var h=new x(i);return h.update(n,e,o),h.finish(r,t),0}function m(r,t,n,e,o,i){var h=new Uint8Array(16);return M(h,0,n,e,o,i),v(r,t,h,0)}function B(r,t,n,e,o){var i;if(n<32)return-1;for(E(r,0,t,0,n,e,o),M(r,16,r,32,n-32,r),i=0;i<16;i++)r[i]=0;return 0}function S(r,t,n,e,o){var i,h=new Uint8Array(32);if(n<32)return-1;if(d(h,0,32,e,o),0!==m(t,16,t,32,n-32,h))return-1;for(E(r,0,t,0,n,e,o),i=0;i<32;i++)r[i]=0;return 0}function k(r,t){var n;for(n=0;n<16;n++)r[n]=0|t[n]}function K(r){var t,n,e=1;for(t=0;t<16;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function Y(r,t,n){for(var e,o=~(n-1),i=0;i<16;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function L(r,n){var e,o,i,h=t(),a=t();for(e=0;e<16;e++)a[e]=n[e];for(K(a),K(a),K(a),o=0;o<2;o++){for(h[0]=a[0]-65517,e=1;e<15;e++)h[e]=a[e]-65535-(h[e-1]>>16&1),h[e-1]&=65535;h[15]=a[15]-32767-(h[14]>>16&1),i=h[15]>>16&1,h[14]&=65535,Y(a,h,1-i)}for(e=0;e<16;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function T(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return L(n,r),L(e,t),p(n,0,e,0)}function z(r){var t=new Uint8Array(32);return L(t,r),1&t[0]}function R(r,t){var n;for(n=0;n<16;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function P(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]+n[e]}function N(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]-n[e]}function O(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,w=0,v=0,p=0,b=0,g=0,A=0,_=0,U=0,d=0,E=0,x=0,M=0,m=0,B=0,S=0,k=0,K=0,Y=0,L=0,T=0,z=0,R=0,P=n[0],N=n[1],O=n[2],C=n[3],F=n[4],I=n[5],Z=n[6],G=n[7],q=n[8],D=n[9],V=n[10],X=n[11],j=n[12],H=n[13],J=n[14],Q=n[15];i+=(e=t[0])*P,h+=e*N,a+=e*O,f+=e*C,s+=e*F,u+=e*I,c+=e*Z,y+=e*G,l+=e*q,w+=e*D,v+=e*V,p+=e*X,b+=e*j,g+=e*H,A+=e*J,_+=e*Q,h+=(e=t[1])*P,a+=e*N,f+=e*O,s+=e*C,u+=e*F,c+=e*I,y+=e*Z,l+=e*G,w+=e*q,v+=e*D,p+=e*V,b+=e*X,g+=e*j,A+=e*H,_+=e*J,U+=e*Q,a+=(e=t[2])*P,f+=e*N,s+=e*O,u+=e*C,c+=e*F,y+=e*I,l+=e*Z,w+=e*G,v+=e*q,p+=e*D,b+=e*V,g+=e*X,A+=e*j,_+=e*H,U+=e*J,d+=e*Q,f+=(e=t[3])*P,s+=e*N,u+=e*O,c+=e*C,y+=e*F,l+=e*I,w+=e*Z,v+=e*G,p+=e*q,b+=e*D,g+=e*V,A+=e*X,_+=e*j,U+=e*H,d+=e*J,E+=e*Q,s+=(e=t[4])*P,u+=e*N,c+=e*O,y+=e*C,l+=e*F,w+=e*I,v+=e*Z,p+=e*G,b+=e*q,g+=e*D,A+=e*V,_+=e*X,U+=e*j,d+=e*H,E+=e*J,x+=e*Q,u+=(e=t[5])*P,c+=e*N,y+=e*O,l+=e*C,w+=e*F,v+=e*I,p+=e*Z,b+=e*G,g+=e*q,A+=e*D,_+=e*V,U+=e*X,d+=e*j,E+=e*H,x+=e*J,M+=e*Q,c+=(e=t[6])*P,y+=e*N,l+=e*O,w+=e*C,v+=e*F,p+=e*I,b+=e*Z,g+=e*G,A+=e*q,_+=e*D,U+=e*V,d+=e*X,E+=e*j,x+=e*H,M+=e*J,m+=e*Q,y+=(e=t[7])*P,l+=e*N,w+=e*O,v+=e*C,p+=e*F,b+=e*I,g+=e*Z,A+=e*G,_+=e*q,U+=e*D,d+=e*V,E+=e*X,x+=e*j,M+=e*H,m+=e*J,B+=e*Q,l+=(e=t[8])*P,w+=e*N,v+=e*O,p+=e*C,b+=e*F,g+=e*I,A+=e*Z,_+=e*G,U+=e*q,d+=e*D,E+=e*V,x+=e*X,M+=e*j,m+=e*H,B+=e*J,S+=e*Q,w+=(e=t[9])*P,v+=e*N,p+=e*O,b+=e*C,g+=e*F,A+=e*I,_+=e*Z,U+=e*G,d+=e*q,E+=e*D,x+=e*V,M+=e*X,m+=e*j,B+=e*H,S+=e*J,k+=e*Q,v+=(e=t[10])*P,p+=e*N,b+=e*O,g+=e*C,A+=e*F,_+=e*I,U+=e*Z,d+=e*G,E+=e*q,x+=e*D,M+=e*V,m+=e*X,B+=e*j,S+=e*H,k+=e*J,K+=e*Q,p+=(e=t[11])*P,b+=e*N,g+=e*O,A+=e*C,_+=e*F,U+=e*I,d+=e*Z,E+=e*G,x+=e*q,M+=e*D,m+=e*V,B+=e*X,S+=e*j,k+=e*H,K+=e*J,Y+=e*Q,b+=(e=t[12])*P,g+=e*N,A+=e*O,_+=e*C,U+=e*F,d+=e*I,E+=e*Z,x+=e*G,M+=e*q,m+=e*D,B+=e*V,S+=e*X,k+=e*j,K+=e*H,Y+=e*J,L+=e*Q,g+=(e=t[13])*P,A+=e*N,_+=e*O,U+=e*C,d+=e*F,E+=e*I,x+=e*Z,M+=e*G,m+=e*q,B+=e*D,S+=e*V,k+=e*X,K+=e*j,Y+=e*H,L+=e*J,T+=e*Q,A+=(e=t[14])*P,_+=e*N,U+=e*O,d+=e*C,E+=e*F,x+=e*I,M+=e*Z,m+=e*G,B+=e*q,S+=e*D,k+=e*V,K+=e*X,Y+=e*j,L+=e*H,T+=e*J,z+=e*Q,_+=(e=t[15])*P,h+=38*(d+=e*O),a+=38*(E+=e*C),f+=38*(x+=e*F),s+=38*(M+=e*I),u+=38*(m+=e*Z),c+=38*(B+=e*G),y+=38*(S+=e*q),l+=38*(k+=e*D),w+=38*(K+=e*V),v+=38*(Y+=e*X),p+=38*(L+=e*j),b+=38*(T+=e*H),g+=38*(z+=e*J),A+=38*(R+=e*Q),i=(e=(i+=38*(U+=e*N))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),i=(e=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=w,r[10]=v,r[11]=p,r[12]=b,r[13]=g,r[14]=A,r[15]=_}function C(r,t){O(r,t,t)}function F(r,n){var e,o=t();for(e=0;e<16;e++)o[e]=n[e];for(e=253;e>=0;e--)C(o,o),2!==e&&4!==e&&O(o,o,n);for(e=0;e<16;e++)r[e]=o[e]}function I(r,n){var e,o=t();for(e=0;e<16;e++)o[e]=n[e];for(e=250;e>=0;e--)C(o,o),1!==e&&O(o,o,n);for(e=0;e<16;e++)r[e]=o[e]}function Z(r,n,e){var o,i,h=new Uint8Array(32),f=new Float64Array(80),s=t(),u=t(),c=t(),y=t(),l=t(),w=t();for(i=0;i<31;i++)h[i]=n[i];for(h[31]=127&n[31]|64,h[0]&=248,R(f,e),i=0;i<16;i++)u[i]=f[i],y[i]=s[i]=c[i]=0;for(s[0]=y[0]=1,i=254;i>=0;--i)Y(s,u,o=h[i>>>3]>>>(7&i)&1),Y(c,y,o),P(l,s,c),N(s,s,c),P(c,u,y),N(u,u,y),C(y,l),C(w,s),O(s,c,s),O(c,u,l),P(l,s,c),N(s,s,c),C(u,s),N(c,y,w),O(s,c,a),P(s,s,y),O(c,c,s),O(s,y,w),O(y,u,f),C(u,l),Y(s,u,o),Y(c,y,o);for(i=0;i<16;i++)f[i+16]=s[i],f[i+32]=c[i],f[i+48]=u[i],f[i+64]=y[i];var v=f.subarray(32),p=f.subarray(16);return F(v,v),O(p,p,v),L(r,p),0}function G(r,t){return Z(r,t,o)}function q(r,t){return n(t,32),G(r,t)}function D(r,t,n){var o=new Uint8Array(32);return Z(o,n,t),g(r,e,o,A)}x.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,w,v,p,b,g,A,_,U,d=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],k=this.h[6],K=this.h[7],Y=this.h[8],L=this.h[9],T=this.r[0],z=this.r[1],R=this.r[2],P=this.r[3],N=this.r[4],O=this.r[5],C=this.r[6],F=this.r[7],I=this.r[8],Z=this.r[9];n>=16;)y=c=0,y+=(E+=8191&(e=255&r[t+0]|(255&r[t+1])<<8))*T,y+=(x+=8191&(e>>>13|(o=255&r[t+2]|(255&r[t+3])<<8)<<3))*(5*Z),y+=(M+=8191&(o>>>10|(i=255&r[t+4]|(255&r[t+5])<<8)<<6))*(5*I),y+=(m+=8191&(i>>>7|(h=255&r[t+6]|(255&r[t+7])<<8)<<9))*(5*F),c=(y+=(B+=8191&(h>>>4|(a=255&r[t+8]|(255&r[t+9])<<8)<<12))*(5*C))>>>13,y&=8191,y+=(S+=a>>>1&8191)*(5*O),y+=(k+=8191&(a>>>14|(f=255&r[t+10]|(255&r[t+11])<<8)<<2))*(5*N),y+=(K+=8191&(f>>>11|(s=255&r[t+12]|(255&r[t+13])<<8)<<5))*(5*P),y+=(Y+=8191&(s>>>8|(u=255&r[t+14]|(255&r[t+15])<<8)<<8))*(5*R),l=c+=(y+=(L+=u>>>5|d)*(5*z))>>>13,l+=E*z,l+=x*T,l+=M*(5*Z),l+=m*(5*I),c=(l+=B*(5*F))>>>13,l&=8191,l+=S*(5*C),l+=k*(5*O),l+=K*(5*N),l+=Y*(5*P),c+=(l+=L*(5*R))>>>13,l&=8191,w=c,w+=E*R,w+=x*z,w+=M*T,w+=m*(5*Z),c=(w+=B*(5*I))>>>13,w&=8191,w+=S*(5*F),w+=k*(5*C),w+=K*(5*O),w+=Y*(5*N),v=c+=(w+=L*(5*P))>>>13,v+=E*P,v+=x*R,v+=M*z,v+=m*T,c=(v+=B*(5*Z))>>>13,v&=8191,v+=S*(5*I),v+=k*(5*F),v+=K*(5*C),v+=Y*(5*O),p=c+=(v+=L*(5*N))>>>13,p+=E*N,p+=x*P,p+=M*R,p+=m*z,c=(p+=B*T)>>>13,p&=8191,p+=S*(5*Z),p+=k*(5*I),p+=K*(5*F),p+=Y*(5*C),b=c+=(p+=L*(5*O))>>>13,b+=E*O,b+=x*N,b+=M*P,b+=m*R,c=(b+=B*z)>>>13,b&=8191,b+=S*T,b+=k*(5*Z),b+=K*(5*I),b+=Y*(5*F),g=c+=(b+=L*(5*C))>>>13,g+=E*C,g+=x*O,g+=M*N,g+=m*P,c=(g+=B*R)>>>13,g&=8191,g+=S*z,g+=k*T,g+=K*(5*Z),g+=Y*(5*I),A=c+=(g+=L*(5*F))>>>13,A+=E*F,A+=x*C,A+=M*O,A+=m*N,c=(A+=B*P)>>>13,A&=8191,A+=S*R,A+=k*z,A+=K*T,A+=Y*(5*Z),_=c+=(A+=L*(5*I))>>>13,_+=E*I,_+=x*F,_+=M*C,_+=m*O,c=(_+=B*N)>>>13,_&=8191,_+=S*P,_+=k*R,_+=K*z,_+=Y*T,U=c+=(_+=L*(5*Z))>>>13,U+=E*Z,U+=x*I,U+=M*F,U+=m*C,c=(U+=B*O)>>>13,U&=8191,U+=S*N,U+=k*P,U+=K*R,U+=Y*z,E=y=8191&(c=(c=((c+=(U+=L*T)>>>13)<<2)+c|0)+(y&=8191)|0),x=l+=c>>>=13,M=w&=8191,m=v&=8191,B=p&=8191,S=b&=8191,k=g&=8191,K=A&=8191,Y=_&=8191,L=U&=8191,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=k,this.h[7]=K,this.h[8]=Y,this.h[9]=L},x.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;i<10;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(1^n)-1,i=0;i<10;i++)h[i]&=e;for(e=~e,i=0;i<10;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},x.prototype.update=function(r,t,n){var e,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),e=0;e=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;e=128;){for(d=0;d<16;d++)E=8*d+H,K[d]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[d]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(d=0;d<80;d++)if(o=L,i=T,h=z,a=R,f=P,s=N,u=O,C,y=F,l=I,w=Z,v=G,p=q,b=D,g=V,X,m=65535&(M=X),B=M>>>16,S=65535&(x=C),k=x>>>16,m+=65535&(M=(q>>>14|P<<18)^(q>>>18|P<<14)^(P>>>9|q<<23)),B+=M>>>16,S+=65535&(x=(P>>>14|q<<18)^(P>>>18|q<<14)^(q>>>9|P<<23)),k+=x>>>16,m+=65535&(M=q&D^~q&V),B+=M>>>16,S+=65535&(x=P&N^~P&O),k+=x>>>16,x=j[2*d],m+=65535&(M=j[2*d+1]),B+=M>>>16,S+=65535&x,k+=x>>>16,x=K[d%16],B+=(M=Y[d%16])>>>16,S+=65535&x,k+=x>>>16,S+=(B+=(m+=65535&M)>>>16)>>>16,m=65535&(M=U=65535&m|B<<16),B=M>>>16,S=65535&(x=_=65535&S|(k+=S>>>16)<<16),k=x>>>16,m+=65535&(M=(F>>>28|L<<4)^(L>>>2|F<<30)^(L>>>7|F<<25)),B+=M>>>16,S+=65535&(x=(L>>>28|F<<4)^(F>>>2|L<<30)^(F>>>7|L<<25)),k+=x>>>16,B+=(M=F&I^F&Z^I&Z)>>>16,S+=65535&(x=L&T^L&z^T&z),k+=x>>>16,c=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(k+=S>>>16)<<16,A=65535&m|B<<16,m=65535&(M=v),B=M>>>16,S=65535&(x=a),k=x>>>16,B+=(M=U)>>>16,S+=65535&(x=_),k+=x>>>16,T=o,z=i,R=h,P=a=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(k+=S>>>16)<<16,N=f,O=s,C=u,L=c,I=y,Z=l,G=w,q=v=65535&m|B<<16,D=p,V=b,X=g,F=A,d%16==15)for(E=0;E<16;E++)x=K[E],m=65535&(M=Y[E]),B=M>>>16,S=65535&x,k=x>>>16,x=K[(E+9)%16],m+=65535&(M=Y[(E+9)%16]),B+=M>>>16,S+=65535&x,k+=x>>>16,_=K[(E+1)%16],m+=65535&(M=((U=Y[(E+1)%16])>>>1|_<<31)^(U>>>8|_<<24)^(U>>>7|_<<25)),B+=M>>>16,S+=65535&(x=(_>>>1|U<<31)^(_>>>8|U<<24)^_>>>7),k+=x>>>16,_=K[(E+14)%16],B+=(M=((U=Y[(E+14)%16])>>>19|_<<13)^(_>>>29|U<<3)^(U>>>6|_<<26))>>>16,S+=65535&(x=(_>>>19|U<<13)^(U>>>29|_<<3)^_>>>6),k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,K[E]=65535&S|k<<16,Y[E]=65535&m|B<<16;m=65535&(M=F),B=M>>>16,S=65535&(x=L),k=x>>>16,x=r[0],B+=(M=t[0])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[0]=L=65535&S|k<<16,t[0]=F=65535&m|B<<16,m=65535&(M=I),B=M>>>16,S=65535&(x=T),k=x>>>16,x=r[1],B+=(M=t[1])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[1]=T=65535&S|k<<16,t[1]=I=65535&m|B<<16,m=65535&(M=Z),B=M>>>16,S=65535&(x=z),k=x>>>16,x=r[2],B+=(M=t[2])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[2]=z=65535&S|k<<16,t[2]=Z=65535&m|B<<16,m=65535&(M=G),B=M>>>16,S=65535&(x=R),k=x>>>16,x=r[3],B+=(M=t[3])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[3]=R=65535&S|k<<16,t[3]=G=65535&m|B<<16,m=65535&(M=q),B=M>>>16,S=65535&(x=P),k=x>>>16,x=r[4],B+=(M=t[4])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[4]=P=65535&S|k<<16,t[4]=q=65535&m|B<<16,m=65535&(M=D),B=M>>>16,S=65535&(x=N),k=x>>>16,x=r[5],B+=(M=t[5])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[5]=N=65535&S|k<<16,t[5]=D=65535&m|B<<16,m=65535&(M=V),B=M>>>16,S=65535&(x=O),k=x>>>16,x=r[6],B+=(M=t[6])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[6]=O=65535&S|k<<16,t[6]=V=65535&m|B<<16,m=65535&(M=X),B=M>>>16,S=65535&(x=C),k=x>>>16,x=r[7],B+=(M=t[7])>>>16,S+=65535&x,k+=x>>>16,k+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[7]=C=65535&S|k<<16,t[7]=X=65535&m|B<<16,H+=128,e-=128}return e}function J(r,t,n){var e,o=new Int32Array(8),i=new Int32Array(8),h=new Uint8Array(256),a=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,H(o,i,t,n),n%=128,e=0;e=0;--o)W(r,t,e=n[o/8|0]>>(7&o)&1),Q(t,r),Q(r,r),W(r,t,e)}function tr(r,n){var e=[t(),t(),t(),t()];k(e[0],u),k(e[1],c),k(e[2],h),O(e[3],u,c),rr(r,e,n)}function nr(r,e,o){var i,h=new Uint8Array(64),a=[t(),t(),t(),t()];for(o||n(e,32),J(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64,tr(a,h),$(r,a),i=0;i<32;i++)e[i+32]=r[i];return 0}var er=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function or(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;o>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>4)*er[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*er[o];for(e=0;e<32;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function ir(r){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=r[t];for(t=0;t<64;t++)r[t]=0;or(r,n)}function hr(r,n,e,o){var i,h,a=new Uint8Array(64),f=new Uint8Array(64),s=new Uint8Array(64),u=new Float64Array(64),c=[t(),t(),t(),t()];J(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(i=0;i>7&&N(r[0],i,r[0]),O(r[3],r[0],r[1]),0)}(l,o))return-1;for(a=0;a=0},r.sign.keyPair=function(){var r=new Uint8Array(32),t=new Uint8Array(64);return nr(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(wr(r),64!==r.length)throw new Error("bad secret key size");for(var t=new Uint8Array(32),n=0;n