bitcore-lib-zcash/bitcore-lib.min.js

19 lines
594 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

require=function t(e,r,n){function i(o,a){if(!r[o]){if(!e[o]){var f="function"==typeof require&&require;if(!a&&f)return f(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};e[o][0].call(c.exports,function(t){var r=e[o][1][t];return i(r?r:t)},c,c.exports,t,e,r,n)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){(function(r){"use strict";function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);if(i.isArray(t)&&i.isNumber(e))return n.createMultisig(t,e,r);if(t instanceof n)return t;if(s.checkArgument(t,"First argument is required, please include address data.","guide/address.html"),e&&!f.get(e))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==n.PayToPublicKeyHash&&r!==n.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var o=this._classifyArguments(t,e,r);return o.network=o.network||f.get(e)||f.defaultNetwork,o.type=o.type||r||n.PayToPublicKeyHash,c.defineImmutable(this,{hashBuffer:o.hashBuffer,network:o.network,type:o.type}),this}var i=t("lodash"),s=t("./util/preconditions"),o=t("./errors"),a=t("./encoding/base58check"),f=t("./networks"),u=t("./crypto/hash"),c=t("./util/js"),h=t("./publickey");n.prototype._classifyArguments=function(t,e,s){if((t instanceof r||t instanceof Uint8Array)&&20===t.length)return n._transformHash(t);if((t instanceof r||t instanceof Uint8Array)&&21===t.length)return n._transformBuffer(t,e,s);if(t instanceof h)return n._transformPublicKey(t);if(t instanceof d)return n._transformScript(t,e);if("string"==typeof t)return n._transformString(t,e,s);if(i.isObject(t))return n._transformObject(t);throw new TypeError("First argument is an unrecognized data format.")},n.PayToPublicKeyHash="pubkeyhash",n.PayToScriptHash="scripthash",n._transformHash=function(t){var e={};if(!(t instanceof r||t instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==t.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return e.hashBuffer=t,e},n._transformObject=function(t){return s.checkArgument(t.hash||t.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),s.checkArgument(t.type,"Must provide a `type` property"),{hashBuffer:t.hash?new r(t.hash,"hex"):t.hashBuffer,network:f.get(t.network)||f.defaultNetwork,type:t.type}},n._classifyFromVersion=function(t){var e={},r=f.get(t[0],"pubkeyhash"),i=f.get(t[0],"scripthash");return r?(e.network=r,e.type=n.PayToPublicKeyHash):i&&(e.network=i,e.type=n.PayToScriptHash),e},n._transformBuffer=function(t,e,i){var s={};if(!(t instanceof r||t instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==t.length)throw new TypeError("Address buffers must be exactly 21 bytes.");e=f.get(e);var o=n._classifyFromVersion(t);if(!o.network||e&&e!==o.network)throw new TypeError("Address has mismatched network type.");if(!o.type||i&&i!==o.type)throw new TypeError("Address has mismatched type.");return s.hashBuffer=t.slice(1),s.network=o.network,s.type=o.type,s},n._transformPublicKey=function(t){var e={};if(!(t instanceof h))throw new TypeError("Address must be an instance of PublicKey.");return e.hashBuffer=u.sha256ripemd160(t.toBuffer()),e.type=n.PayToPublicKeyHash,e},n._transformScript=function(t,e){s.checkArgument(t instanceof d,"script must be a Script instance");var r=t.getAddressInfo(e);if(!r)throw new o.Script.CantDeriveAddress(t);return r},n.createMultisig=function(t,e,r){return r=r||t[0].network||f.defaultNetwork,n.payingTo(d.buildMultisigOut(t,e),r)},n._transformString=function(t,e,r){if("string"!=typeof t)throw new TypeError("data parameter supplied is not a string.");t=t.trim();var i=a.decode(t),s=n._transformBuffer(i,e,r);return s},n.fromPublicKey=function(t,e){var r=n._transformPublicKey(t);return e=e||f.defaultNetwork,new n(r.hashBuffer,e,r.type)},n.fromPublicKeyHash=function(t,e){var r=n._transformHash(t);return new n(r.hashBuffer,e,n.PayToPublicKeyHash)},n.fromScriptHash=function(t,e){s.checkArgument(t,"hash parameter is required");var r=n._transformHash(t);return new n(r.hashBuffer,e,n.PayToScriptHash)},n.payingTo=function(t,e){return s.checkArgument(t,"script is required"),s.checkArgument(t instanceof d,"script must be instance of Script"),n.fromScriptHash(u.sha256ripemd160(t.toBuffer()),e)},n.fromScript=function(t,e){s.checkArgument(t instanceof d,"script must be a Script instance");var r=n._transformScript(t,e);return new n(r.hashBuffer,e,r.type)},n.fromBuffer=function(t,e,r){var i=n._transformBuffer(t,e,r);return new n(i.hashBuffer,i.network,i.type)},n.fromString=function(t,e,r){var i=n._transformString(t,e,r);return new n(i.hashBuffer,i.network,i.type)},n.fromObject=function(t){s.checkState(c.isHexa(t.hash),'Unexpected hash property, "'+t.hash+'", expected to be hex.');var e=new r(t.hash,"hex");return new n(e,t.network,t.type)},n.getValidationError=function(t,e,r){var i;try{new n(t,e,r)}catch(s){i=s}return i},n.isValid=function(t,e,r){return!n.getValidationError(t,e,r)},n.prototype.isPayToPublicKeyHash=function(){return this.type===n.PayToPublicKeyHash},n.prototype.isPayToScriptHash=function(){return this.type===n.PayToScriptHash},n.prototype.toBuffer=function(){var t=new r([this.network[this.type]]),e=r.concat([t,this.hashBuffer]);return e},n.prototype.toObject=n.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},n.prototype.toString=function(){return a.encode(this.toBuffer())},n.prototype.inspect=function(){return"<Address: "+this.toString()+", type: "+this.type+", network: "+this.network+">"},e.exports=n;var d=t("./script")}).call(this,t("buffer").Buffer)},{"./crypto/hash":8,"./encoding/base58check":13,"./errors":17,"./networks":22,"./publickey":25,"./script":26,"./util/js":44,"./util/preconditions":45,buffer:48,lodash:297}],2:[function(t,e,r){(function(r){"use strict";function n(t){return this instanceof n?(i.extend(this,n._from(t)),this):new n(t)}var i=t("lodash"),s=t("./blockheader"),o=t("../crypto/bn"),a=t("../util/buffer"),f=t("../encoding/bufferreader"),u=t("../encoding/bufferwriter"),c=t("../crypto/hash"),h=t("../transaction"),d=t("../util/preconditions");n.MAX_BLOCK_SIZE=1e6,n._from=function(t){var e={};if(a.isBuffer(t))e=n._fromBufferReader(f(t));else{if(!i.isObject(t))throw new TypeError("Unrecognized argument for Block");e=n._fromObject(t)}return e},n._fromObject=function(t){var e=[];t.transactions.forEach(function(t){t instanceof h?e.push(t):e.push(h().fromObject(t))});var r={header:s.fromObject(t.header),transactions:e};return r},n.fromObject=function(t){var e=n._fromObject(t);return new n(e)},n._fromBufferReader=function(t){var e={};d.checkState(!t.finished(),"No block data received"),e.header=s.fromBufferReader(t);var r=t.readVarintNum();e.transactions=[];for(var n=0;r>n;n++)e.transactions.push(h().fromBufferReader(t));return e},n.fromBufferReader=function(t){d.checkArgument(t,"br is required");var e=n._fromBufferReader(t);return new n(e)},n.fromBuffer=function(t){return n.fromBufferReader(new f(t))},n.fromString=function(t){var e=new r(t,"hex");return n.fromBuffer(e)},n.fromRawBlock=function(t){a.isBuffer(t)||(t=new r(t,"binary"));var e=f(t);e.pos=n.Values.START_OF_BLOCK;var i=n._fromBufferReader(e);return new n(i)},n.prototype.toObject=n.prototype.toJSON=function(){var t=[];return this.transactions.forEach(function(e){t.push(e.toObject())}),{header:this.header.toObject(),transactions:t}},n.prototype.toBuffer=function(){return this.toBufferWriter().concat()},n.prototype.toString=function(){return this.toBuffer().toString("hex")},n.prototype.toBufferWriter=function(t){t||(t=new u),t.write(this.header.toBuffer()),t.writeVarintNum(this.transactions.length);for(var e=0;e<this.transactions.length;e++)this.transactions[e].toBufferWriter(t);return t},n.prototype.getTransactionHashes=function(){var t=[];if(0===this.transactions.length)return[n.Values.NULL_HASH];for(var e=0;e<this.transactions.length;e++)t.push(this.transactions[e]._getHash());return t},n.prototype.getMerkleTree=function(){for(var t=this.getTransactionHashes(),e=0,n=this.transactions.length;n>1;n=Math.floor((n+1)/2)){for(var i=0;n>i;i+=2){var s=Math.min(i+1,n-1),o=r.concat([t[e+i],t[e+s]]);t.push(c.sha256sha256(o))}e+=n}return t},n.prototype.getMerkleRoot=function(){var t=this.getMerkleTree();return t[t.length-1]},n.prototype.validMerkleRoot=function(){var t=new o(this.header.merkleRoot.toString("hex"),"hex"),e=new o(this.getMerkleRoot().toString("hex"),"hex");return 0!==t.cmp(e)?!1:!0},n.prototype._getHash=function(){return this.header._getHash()};var p={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:i.noop};Object.defineProperty(n.prototype,"id",p),Object.defineProperty(n.prototype,"hash",p),n.prototype.inspect=function(){return"<Block "+this.id+">"},n.Values={START_OF_BLOCK:8,NULL_HASH:new r("0000000000000000000000000000000000000000000000000000000000000000","hex")},e.exports=n}).call(this,t("buffer").Buffer)},{"../crypto/bn":6,"../crypto/hash":8,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../transaction":29,"../util/buffer":43,"../util/preconditions":45,"./blockheader":3,buffer:48,lodash:297}],3:[function(t,e,r){(function(r){"use strict";var n=t("lodash"),i=t("../crypto/bn"),s=t("../util/buffer"),o=t("../encoding/bufferreader"),a=t("../encoding/bufferwriter"),f=t("../crypto/hash"),u=(t("../util/js"),t("../util/preconditions")),c=486604799,h=function p(t){if(!(this instanceof p))return new p(t);var e=p._from(t);return this.version=e.version,this.prevHash=e.prevHash,this.merkleRoot=e.merkleRoot,this.time=e.time,this.timestamp=e.time,this.bits=e.bits,this.nonce=e.nonce,e.hash&&u.checkState(this.hash===e.hash,"Argument object hash property does not match block hash."),this};h._from=function(t){var e={};if(s.isBuffer(t))e=h._fromBufferReader(o(t));else{if(!n.isObject(t))throw new TypeError("Unrecognized argument for BlockHeader");e=h._fromObject(t)}return e},h._fromObject=function(t){u.checkArgument(t,"data is required");var e=t.prevHash,i=t.merkleRoot;n.isString(t.prevHash)&&(e=s.reverse(new r(t.prevHash,"hex"))),n.isString(t.merkleRoot)&&(i=s.reverse(new r(t.merkleRoot,"hex")));var o={hash:t.hash,version:t.version,prevHash:e,merkleRoot:i,time:t.time,timestamp:t.time,bits:t.bits,nonce:t.nonce};return o},h.fromObject=function(t){var e=h._fromObject(t);return new h(e)},h.fromRawBlock=function(t){s.isBuffer(t)||(t=new r(t,"binary"));var e=o(t);e.pos=h.Constants.START_OF_HEADER;var n=h._fromBufferReader(e);return new h(n)},h.fromBuffer=function(t){var e=h._fromBufferReader(o(t));return new h(e)},h.fromString=function(t){var e=new r(t,"hex");return h.fromBuffer(e)},h._fromBufferReader=function(t){var e={};return e.version=t.readUInt32LE(),e.prevHash=t.read(32),e.merkleRoot=t.read(32),e.time=t.readUInt32LE(),e.bits=t.readUInt32LE(),e.nonce=t.readUInt32LE(),e},h.fromBufferReader=function(t){var e=h._fromBufferReader(t);return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:s.reverse(this.prevHash).toString("hex"),merkleRoot:s.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},h.prototype.toBuffer=function(){return this.toBufferWriter().concat()},h.prototype.toString=function(){return this.toBuffer().toString("hex")},h.prototype.toBufferWriter=function(t){return t||(t=new a),t.writeUInt32LE(this.version),t.write(this.prevHash),t.write(this.merkleRoot),t.writeUInt32LE(this.time),t.writeUInt32LE(this.bits),t.writeUInt32LE(this.nonce),t},h.prototype.getTargetDifficulty=function(t){t=t||this.bits;for(var e=new i(16777215&t),r=8*((t>>>24)-3);r-- >0;)e=e.mul(new i(2));return e},h.prototype.getDifficulty=function(){var t=this.getTargetDifficulty(c).mul(new i(Math.pow(10,8))),e=this.getTargetDifficulty(),r=t.div(e).toString(10),n=r.length-8;return r=r.slice(0,n)+"."+r.slice(n),parseFloat(r)},h.prototype._getHash=function(){var t=this.toBuffer();return f.sha256sha256(t)};var d={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=o(this._getHash()).readReverse().toString("hex")),this._id},set:n.noop};Object.defineProperty(h.prototype,"id",d),Object.defineProperty(h.prototype,"hash",d),h.prototype.validTimestamp=function(){var t=Math.round((new Date).getTime()/1e3);return this.time>t+h.Constants.MAX_TIME_OFFSET?!1:!0},h.prototype.validProofOfWork=function(){var t=new i(this.id,"hex"),e=this.getTargetDifficulty();return t.cmp(e)>0?!1:!0},h.prototype.inspect=function(){return"<BlockHeader "+this.id+">"},h.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new i("10000000000000000000000000000000000000000000000000000000000000000","hex")},e.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":6,"../crypto/hash":8,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../util/buffer":43,"../util/js":44,"../util/preconditions":45,buffer:48,lodash:297}],4:[function(t,e,r){e.exports=t("./block"),e.exports.BlockHeader=t("./blockheader"),e.exports.MerkleBlock=t("./merkleblock")},{"./block":2,"./blockheader":3,"./merkleblock":5}],5:[function(t,e,r){(function(r){"use strict";function n(t){if(!(this instanceof n))return new n(t);var e={};if(o.isBuffer(t))e=n._fromBufferReader(a(t));else{if(!i.isObject(t))throw new TypeError("Unrecognized argument for MerkleBlock");var r;r=t.header instanceof s?t.header:s.fromObject(t.header),e={header:r,numTransactions:t.numTransactions,hashes:t.hashes,flags:t.flags}}return i.extend(this,e),this._flagBitsUsed=0,this._hashesUsed=0,this}var i=t("lodash"),s=t("./blockheader"),o=t("../util/buffer"),a=t("../encoding/bufferreader"),f=t("../encoding/bufferwriter"),u=t("../crypto/hash"),c=(t("../util/js"),t("../transaction")),h=t("../util/preconditions");n.fromBuffer=function(t){return n.fromBufferReader(a(t))},n.fromBufferReader=function(t){return new n(n._fromBufferReader(t))},n.prototype.toBuffer=function(){return this.toBufferWriter().concat()},n.prototype.toBufferWriter=function(t){t||(t=new f),t.write(this.header.toBuffer()),t.writeUInt32LE(this.numTransactions),t.writeVarintNum(this.hashes.length);for(var e=0;e<this.hashes.length;e++)t.write(new r(this.hashes[e],"hex"));for(t.writeVarintNum(this.flags.length),e=0;e<this.flags.length;e++)t.writeUInt8(this.flags[e]);return t},n.prototype.toObject=n.prototype.toJSON=function(){return{header:this.header.toObject(),numTransactions:this.numTransactions,hashes:this.hashes,flags:this.flags}},n.prototype.validMerkleTree=function(){if(h.checkState(i.isArray(this.flags),"MerkleBlock flags is not an array"),h.checkState(i.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)return!1;if(8*this.flags.length<this.hashes.length)return!1;var t=this._calcTreeHeight(),e={hashesUsed:0,flagBitsUsed:0},r=this._traverseMerkleTree(t,0,e);return e.hashesUsed!==this.hashes.length?!1:o.equals(r,this.header.merkleRoot)},n.prototype._traverseMerkleTree=function(t,e,n){if(n=n||{},n.txs=n.txs||[],n.flagBitsUsed=n.flagBitsUsed||0,n.hashesUsed=n.hashesUsed||0,n.flagBitsUsed>8*this.flags.length)return null;var i=this.flags[n.flagBitsUsed>>3]>>>(7&n.flagBitsUsed++)&1;if(0!==t&&i){var s=this._traverseMerkleTree(t-1,2*e,n),o=s;return 2*e+1<this._calcTreeWidth(t-1)&&(o=this._traverseMerkleTree(t-1,2*e+1,n)),u.sha256sha256(new r.concat([s,o]))}if(n.hashesUsed>=this.hashes.length)return null;var a=this.hashes[n.hashesUsed++];return 0===t&&i&&n.txs.push(a),new r(a,"hex")},n.prototype._calcTreeWidth=function(t){return this.numTransactions+(1<<t)-1>>t},n.prototype._calcTreeHeight=function(){for(var t=0;this._calcTreeWidth(t)>1;)t++;return t},n.prototype.hasTransaction=function(t){h.checkArgument(!i.isUndefined(t),"tx cannot be undefined"),h.checkArgument(t instanceof c||"string"==typeof t,'Invalid tx given, tx must be a "string" or "Transaction"');var e=t;t instanceof c&&(e=o.reverse(new r(t.id,"hex")).toString("hex"));var n=[],s=this._calcTreeHeight();return this._traverseMerkleTree(s,0,{txs:n}),-1!==n.indexOf(e)},n._fromBufferReader=function(t){h.checkState(!t.finished(),"No merkleblock data received");var e={};e.header=s.fromBufferReader(t),e.numTransactions=t.readUInt32LE();var r=t.readVarintNum();e.hashes=[];for(var n=0;r>n;n++)e.hashes.push(t.read(32).toString("hex"));var i=t.readVarintNum();for(e.flags=[],n=0;i>n;n++)e.flags.push(t.readUInt8());return e},n.fromObject=function(t){return new n(t)},e.exports=n}).call(this,t("buffer").Buffer)},{"../crypto/hash":8,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../transaction":29,"../util/buffer":43,"../util/js":44,"../util/preconditions":45,"./blockheader":3,buffer:48,lodash:297}],6:[function(t,e,r){(function(r){"use strict";var n=t("bn.js"),i=t("../util/preconditions"),s=t("lodash"),o=function(t){for(var e=new r(t.length),n=0;n<t.length;n++)e[n]=t[t.length-1-n];return e};n.Zero=new n(0),n.One=new n(1),n.Minus1=new n(-1),n.fromNumber=function(t){return i.checkArgument(s.isNumber(t)),new n(t)},n.fromString=function(t,e){return i.checkArgument(s.isString(t)),new n(t,e)},n.fromBuffer=function(t,e){"undefined"!=typeof e&&"little"===e.endian&&(t=o(t));var r=t.toString("hex"),i=new n(r,16);return i},n.fromSM=function(t,e){var i;if(0===t.length)return n.fromBuffer(new r([0]));var s="big";return e&&(s=e.endian),"little"===s&&(t=o(t)),128&t[0]?(t[0]=127&t[0],i=n.fromBuffer(t),i.neg().copy(i)):i=n.fromBuffer(t),i},n.prototype.toNumber=function(){return parseInt(this.toString(10),10)},n.prototype.toBuffer=function(t){var e,i;if(t&&t.size){i=this.toString(16,2);var s=i.length/2;e=new r(i,"hex"),s===t.size?e=e:s>t.size?e=n.trim(e,s):s<t.size&&(e=n.pad(e,s,t.size))}else i=this.toString(16,2),e=new r(i,"hex");return"undefined"!=typeof t&&"little"===t.endian&&(e=o(e)),e},n.prototype.toSMBigEndian=function(){var t;return-1===this.cmp(n.Zero)?(t=this.neg().toBuffer(),128&t[0]?t=r.concat([new r([128]),t]):t[0]=128|t[0]):(t=this.toBuffer(),128&t[0]&&(t=r.concat([new r([0]),t]))),1===t.length&0===t[0]&&(t=new r([])),t},n.prototype.toSM=function(t){var e=t?t.endian:"big",r=this.toSMBigEndian();return"little"===e&&(r=o(r)),r},n.fromScriptNumBuffer=function(t,e,r){var s=r||4;if(i.checkArgument(t.length<=s,new Error("script number overflow")),e&&t.length>0&&0===(127&t[t.length-1])&&(t.length<=1||0===(128&t[t.length-2])))throw new Error("non-minimally encoded script number");return n.fromSM(t,{endian:"little"})},n.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})},n.prototype.gt=function(t){return this.cmp(t)>0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.lt=function(t){return this.cmp(t)<0},n.trim=function(t,e){return t.slice(e-t.length,t.length)},n.pad=function(t,e,n){for(var i=new r(n),s=0;s<t.length;s++)i[i.length-1-s]=t[t.length-1-s];for(s=0;n-e>s;s++)i[s]=0;return i},e.exports=n}).call(this,t("buffer").Buffer)},{"../util/preconditions":45,"bn.js":272,buffer:48,lodash:297}],7:[function(t,e,r){(function(r){"use strict";var n=t("./bn"),i=t("./point"),s=t("./signature"),o=t("../publickey"),a=t("./random"),f=t("./hash"),u=t("../util/buffer"),c=t("lodash"),h=t("../util/preconditions"),d=function p(t){return this instanceof p?void(t&&this.set(t)):new p(t)};d.prototype.set=function(t){return this.hashbuf=t.hashbuf||this.hashbuf,this.endian=t.endian||this.endian,this.privkey=t.privkey||this.privkey,this.pubkey=t.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),this.sig=t.sig||this.sig,this.k=t.k||this.k,this.verified=t.verified||this.verified,this},d.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()},d.prototype.calci=function(){for(var t=0;4>t;t++){this.sig.i=t;var e;try{e=this.toPublicKey()}catch(r){console.error(r);continue}if(e.point.eq(this.pubkey.point))return this.sig.compressed=this.pubkey.compressed,this}throw this.sig.i=void 0,new Error("Unable to find valid recovery factor")},d.fromString=function(t){var e=JSON.parse(t);return new d(e)},d.prototype.randomK=function(){var t,e=i.getN();do t=n.fromBuffer(a.getRandomBuffer(32));while(!t.lt(e)||!t.gt(n.Zero));return this.k=t,this},d.prototype.deterministicK=function(t){c.isUndefined(t)&&(t=0);var e=new r(32);e.fill(1);var s=new r(32);s.fill(0);var o=this.privkey.bn.toBuffer({size:32});s=f.sha256hmac(r.concat([e,new r([0]),o,this.hashbuf]),s),e=f.sha256hmac(e,s),s=f.sha256hmac(r.concat([e,new r([1]),o,this.hashbuf]),s),e=f.sha256hmac(e,s),e=f.sha256hmac(e,s);for(var a=n.fromBuffer(e),u=i.getN(),h=0;t>h||!a.lt(u)||!a.gt(n.Zero);h++)s=f.sha256hmac(r.concat([e,new r([0])]),s),e=f.sha256hmac(e,s),e=f.sha256hmac(e,s),a=n.fromBuffer(e);return this.k=a,this},d.prototype.toPublicKey=function(){var t=this.sig.i;h.checkArgument(0===t||1===t||2===t||3===t,new Error("i must be equal to 0, 1, 2, or 3"));var e=n.fromBuffer(this.hashbuf),r=this.sig.r,s=this.sig.s,a=1&t,f=t>>1,u=i.getN(),c=i.getG(),d=f?r.add(u):r,p=i.fromX(a,d),l=p.mul(u);if(!l.isInfinity())throw new Error("nR is not a valid curve point");var b=e.neg().mod(u),g=r.invm(u),m=p.mul(s).add(c.mul(b)).mul(g),y=o.fromPoint(m,this.sig.compressed);return y},d.prototype.sigError=function(){if(!u.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var t=this.sig.r,e=this.sig.s;if(!(t.gt(n.Zero)&&t.lt(i.getN())&&e.gt(n.Zero)&&e.lt(i.getN())))return"r and s not in range";var r=n.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),s=i.getN(),o=e.invm(s),a=o.mul(r).mod(s),f=o.mul(t).mod(s),c=i.getG().mulAdd(a,this.pubkey.point,f);return c.isInfinity()?"p is infinity":0!==c.getX().mod(s).cmp(t)?"Invalid signature":!1},d.toLowS=function(t){return t.gt(n.fromBuffer(new r("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(t=i.getN().sub(t)),t},d.prototype._findSignature=function(t,e){var r,s,o,a,f=i.getN(),u=i.getG(),c=0;do(!this.k||c>0)&&this.deterministicK(c),c++,r=this.k,s=u.mul(r),o=s.x.mod(f),a=r.invm(f).mul(e.add(t.mul(o))).mod(f);while(o.cmp(n.Zero)<=0||a.cmp(n.Zero)<=0);return a=d.toLowS(a),{s:a,r:o}},d.prototype.sign=function(){var t=this.hashbuf,e=this.privkey,r=e.bn;h.checkState(t&&e&&r,new Error("invalid parameters")),h.checkState(u.isBuffer(t)&&32===t.length,new Error("hashbuf must be a 32 byte buffer"));var i=n.fromBuffer(t,this.endian?{endian:this.endian}:void 0),o=this._findSignature(r,i);return o.compressed=this.pubkey.compressed,this.sig=new s(o),this},d.prototype.signRandomK=function(){return this.randomK(),this.sign()},d.prototype.toString=function(){var t={};return this.hashbuf&&(t.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(t.privkey=this.privkey.toString()),this.pubkey&&(t.pubkey=this.pubkey.toString()),this.sig&&(t.sig=this.sig.toString()),this.k&&(t.k=this.k.toString()),JSON.stringify(t)},d.prototype.verify=function(){return this.sigError()?this.verified=!1:this.verified=!0,this},d.sign=function(t,e,r){return d().set({hashbuf:t,endian:r,privkey:e}).sign().sig},d.verify=function(t,e,r,n){return d().set({hashbuf:t,endian:n,sig:e,pubkey:r}).verify().verified},e.exports=d}).call(this,t("buffer").Buffer)},{"../publickey":25,"../util/buffer":43,"../util/preconditions":45,"./bn":6,"./hash":8,"./point":9,"./random":10,"./signature":11,buffer:48,lodash:297}],8:[function(t,e,r){(function(r){"use strict";var n=t("sha512"),i=t("crypto"),s=t("../util/buffer"),o=t("../util/preconditions"),a=e.exports;a.sha1=function(t){return o.checkArgument(s.isBuffer(t)),i.createHash("sha1").update(t).digest()},a.sha1.blocksize=512,a.sha256=function(t){return o.checkArgument(s.isBuffer(t)),i.createHash("sha256").update(t).digest()},a.sha256.blocksize=512,a.sha256sha256=function(t){return o.checkArgument(s.isBuffer(t)),a.sha256(a.sha256(t))},a.ripemd160=function(t){return o.checkArgument(s.isBuffer(t)),i.createHash("ripemd160").update(t).digest()},a.sha256ripemd160=function(t){return o.checkArgument(s.isBuffer(t)),a.ripemd160(a.sha256(t))},a.sha512=function(t){o.checkArgument(s.isBuffer(t));var e=n(t);return new r(e)},a.sha512.blocksize=1024,a.hmac=function(t,e,n){o.checkArgument(s.isBuffer(e)),o.checkArgument(s.isBuffer(n)),o.checkArgument(t.blocksize);var i=t.blocksize/8;if(n.length>i)n=t(n);else if(i>n){var a=new r(i);a.fill(0),n.copy(a),n=a}var f=new r(i);f.fill(92);var u=new r(i);u.fill(54);for(var c=new r(i),h=new r(i),d=0;i>d;d++)c[d]=f[d]^n[d],h[d]=u[d]^n[d];return t(r.concat([c,t(r.concat([h,e]))]))},a.sha256hmac=function(t,e){return a.hmac(a.sha256,t,e)},a.sha512hmac=function(t,e){return a.hmac(a.sha512,t,e)}}).call(this,t("buffer").Buffer)},{"../util/buffer":43,"../util/preconditions":45,buffer:48,crypto:52,sha512:300}],9:[function(t,e,r){(function(r){"use strict";var n=t("./bn"),i=t("../util/buffer"),s=t("elliptic").curves.secp256k1,o=s.curve.point.bind(s.curve),a=s.curve.pointFromX.bind(s.curve),f=function(t,e,r){var n=o(t,e,r);return n.validate(),n};f.prototype=Object.getPrototypeOf(s.curve.point()),f.fromX=function(t,e){var r=a(t,e);return r.validate(),r},f.getG=function(){return s.curve.g},f.getN=function(){return new n(s.curve.n.toArray())},f.prototype._getX=f.prototype.getX,f.prototype.getX=function(){return new n(this._getX().toArray())},f.prototype._getY=f.prototype.getY,f.prototype.getY=function(){return new n(this._getY().toArray())},f.prototype.validate=function(){if(this.isInfinity())throw new Error("Point cannot be equal to Infinity");if(0===this.getX().cmp(n.Zero)||0===this.getY().cmp(n.Zero))throw new Error("Invalid x,y value for curve, cannot equal 0.");var t=a(this.getY().isOdd(),this.getX());if(0!==t.y.cmp(this.y))throw new Error("Invalid y value for curve.");var e=this.getX().gt(n.Minus1)&&this.getX().lt(f.getN()),r=this.getY().gt(n.Minus1)&&this.getY().lt(f.getN());if(!e||!r)throw new Error("Point does not lie on the curve");if(!this.mul(f.getN()).isInfinity())throw new Error("Point times N must be infinity");return this},f.pointToCompressed=function(t){var e,n=t.getX().toBuffer({size:32}),s=t.getY().toBuffer({size:32}),o=s[s.length-1]%2;return e=new r(o?[3]:[2]),i.concat([e,n])},e.exports=f}).call(this,t("buffer").Buffer)},{"../util/buffer":43,"./bn":6,buffer:48,elliptic:275}],10:[function(t,e,r){(function(r,n){"use strict";function i(){}i.getRandomBuffer=function(t){return r.browser?i.getRandomBufferBrowser(t):i.getRandomBufferNode(t)},i.getRandomBufferNode=function(e){var r=t("crypto");return r.randomBytes(e)},i.getRandomBufferBrowser=function(t){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");if(window.crypto&&window.crypto.getRandomValues)var e=window.crypto;else{if(!window.msCrypto||!window.msCrypto.getRandomValues)throw new Error("window.crypto.getRandomValues not available");var e=window.msCrypto}var r=new Uint8Array(t);e.getRandomValues(r);var i=new n(r);return i},i.getPseudoRandomBuffer=function(t){for(var e,r=4294967296,i=new n(t),s=0;t>=s;s++){var o=Math.floor(s/4),a=s-4*o;0===a?(e=Math.random()*r,i[s]=255&e):i[s]=255&(e>>>=8)}return i},e.exports=i}).call(this,t("_process"),t("buffer").Buffer)},{_process:247,buffer:48,crypto:52}],11:[function(t,e,r){(function(r){"use strict";var n=t("./bn"),i=t("lodash"),s=t("../util/preconditions"),o=t("../util/buffer"),a=t("../util/js"),f=function u(t,e){if(!(this instanceof u))return new u(t,e);if(t instanceof n)this.set({r:t,s:e});else if(t){var r=t;this.set(r)}};f.prototype.set=function(t){return this.r=t.r||this.r||void 0,this.s=t.s||this.s||void 0,this.i="undefined"!=typeof t.i?t.i:this.i,this.compressed="undefined"!=typeof t.compressed?t.compressed:this.compressed,this.nhashtype=t.nhashtype||this.nhashtype||void 0,this},f.fromCompact=function(t){s.checkArgument(o.isBuffer(t),"Argument is expected to be a Buffer");var e=new f,r=!0,i=t.slice(0,1)[0]-27-4;0>i&&(r=!1,i+=4);var a=t.slice(1,33),u=t.slice(33,65);return s.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),s.checkArgument(32===a.length,new Error("r must be 32 bytes")),s.checkArgument(32===u.length,new Error("s must be 32 bytes")),e.compressed=r,e.i=i,e.r=n.fromBuffer(a),e.s=n.fromBuffer(u),e},f.fromDER=f.fromBuffer=function(t,e){var r=f.parseDER(t,e),n=new f;return n.r=r.r,n.s=r.s,n},f.fromTxFormat=function(t){var e=t.readUInt8(t.length-1),r=t.slice(0,t.length-1),n=new f.fromDER(r,!1);return n.nhashtype=e,n},f.fromString=function(t){var e=new r(t,"hex");return f.fromDER(e)},f.parseDER=function(t,e){s.checkArgument(o.isBuffer(t),new Error("DER formatted signature should be a buffer")),i.isUndefined(e)&&(e=!0);var r=t[0];s.checkArgument(48===r,new Error("Header byte should be 0x30"));var a=t[1],f=t.slice(2).length;s.checkArgument(!e||a===f,new Error("Length byte should length of what follows")),a=f>a?a:f;var u=t[2];s.checkArgument(2===u,new Error("Integer byte for r should be 0x02"));var c=t[3],h=t.slice(4,4+c),d=n.fromBuffer(h),p=0===t[4]?!0:!1;s.checkArgument(c===h.length,new Error("Length of r incorrect"));var l=t[4+c+0];s.checkArgument(2===l,new Error("Integer byte for s should be 0x02"));var b=t[4+c+1],g=t.slice(4+c+2,4+c+2+b),m=n.fromBuffer(g),y=0===t[4+c+2+2]?!0:!1;s.checkArgument(b===g.length,new Error("Length of s incorrect"));var v=4+c+2+b;s.checkArgument(a===v-2,new Error("Length of signature incorrect"));var _={header:r,length:a,rheader:u,rlength:c,rneg:p,rbuf:h,r:d,sheader:l,slength:b,sneg:y,sbuf:g,s:m};return _},f.prototype.toCompact=function(t,e){if(t="number"==typeof t?t:this.i,e="boolean"==typeof e?e:this.compressed,0!==t&&1!==t&&2!==t&&3!==t)throw new Error("i must be equal to 0, 1, 2, or 3");var n=t+27+4;e===!1&&(n-=4);var i=new r([n]),s=this.r.toBuffer({size:32}),o=this.s.toBuffer({size:32});return r.concat([i,s,o])},f.prototype.toBuffer=f.prototype.toDER=function(){var t=this.r.toBuffer(),e=this.s.toBuffer(),n=128&t[0]?!0:!1,i=128&e[0]?!0:!1,s=n?r.concat([new r([0]),t]):t,o=i?r.concat([new r([0]),e]):e,a=s.length,f=o.length,u=2+a+2+f,c=2,h=2,d=48,p=r.concat([new r([d,u,c,a]),s,new r([h,f]),o]);return p},f.prototype.toString=function(){var t=this.toDER();return t.toString("hex")},f.isTxDER=function(t){if(t.length<9)return!1;if(t.length>73)return!1;if(48!==t[0])return!1;if(t[1]!==t.length-3)return!1;var e=t[3];if(5+e>=t.length)return!1;var r=t[5+e];if(e+r+7!==t.length)return!1;var n=t.slice(4);if(2!==t[2])return!1;if(0===e)return!1;if(128&n[0])return!1;if(e>1&&0===n[0]&&!(128&n[1]))return!1;var i=t.slice(6+e);return 2!==t[6+e-2]?!1:0===r?!1:128&i[0]?!1:r>1&&0===i[0]&&!(128&i[1])?!1:!0},f.prototype.hasLowS=function(){return this.s.lt(new n(1))||this.s.gt(new n("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))?!1:!0},f.prototype.hasDefinedHashtype=function(){if(!a.isNaturalNumber(this.nhashtype))return!1;var t=this.nhashtype&~f.SIGHASH_ANYONECANPAY;return t<f.SIGHASH_ALL||t>f.SIGHASH_SINGLE?!1:!0},f.prototype.toTxFormat=function(){var t=this.toDER(),e=new r(1);return e.writeUInt8(this.nhashtype,0),r.concat([t,e])},f.SIGHASH_ALL=1,f.SIGHASH_NONE=2,f.SIGHASH_SINGLE=3,f.SIGHASH_ANYONECANPAY=128,e.exports=f}).call(this,t("buffer").Buffer)},{"../util/buffer":43,"../util/js":44,"../util/preconditions":45,"./bn":6,buffer:48,lodash:297}],12:[function(t,e,r){(function(r){"use strict";var n=t("lodash"),i=t("bs58"),s=t("buffer"),o="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),a=function f(t){if(!(this instanceof f))return new f(t);if(r.isBuffer(t)){var e=t;this.fromBuffer(e)}else if("string"==typeof t){var n=t;this.fromString(n)}else t&&this.set(t)};a.validCharacters=function(t){return s.Buffer.isBuffer(t)&&(t=t.toString()),n.all(n.map(t,function(t){return n.contains(o,t)}))},a.prototype.set=function(t){return this.buf=t.buf||this.buf||void 0,this},a.encode=function(t){if(!s.Buffer.isBuffer(t))throw new Error("Input should be a buffer");return i.encode(t)},a.decode=function(t){if("string"!=typeof t)throw new Error("Input should be a string");return new r(i.decode(t))},a.prototype.fromBuffer=function(t){
return this.buf=t,this},a.prototype.fromString=function(t){var e=a.decode(t);return this.buf=e,this},a.prototype.toBuffer=function(){return this.buf},a.prototype.toString=function(){return a.encode(this.buf)},e.exports=a}).call(this,t("buffer").Buffer)},{bs58:273,buffer:48,lodash:297}],13:[function(t,e,r){(function(r){"use strict";var n=t("lodash"),i=t("./base58"),s=t("buffer"),o=t("../crypto/hash").sha256sha256,a=function f(t){if(!(this instanceof f))return new f(t);if(r.isBuffer(t)){var e=t;this.fromBuffer(e)}else if("string"==typeof t){var n=t;this.fromString(n)}else t&&this.set(t)};a.prototype.set=function(t){return this.buf=t.buf||this.buf||void 0,this},a.validChecksum=function(t,e){return n.isString(t)&&(t=new s.Buffer(i.decode(t))),n.isString(e)&&(e=new s.Buffer(i.decode(e))),e||(e=t.slice(-4),t=t.slice(0,-4)),a.checksum(t).toString("hex")===e.toString("hex")},a.decode=function(t){if("string"!=typeof t)throw new Error("Input must be a string");var e=new r(i.decode(t));if(e.length<4)throw new Error("Input string too short");var n=e.slice(0,-4),s=e.slice(-4),a=o(n),f=a.slice(0,4);if(s.toString("hex")!==f.toString("hex"))throw new Error("Checksum mismatch");return n},a.checksum=function(t){return o(t).slice(0,4)},a.encode=function(t){if(!r.isBuffer(t))throw new Error("Input must be a buffer");var e=new r(t.length+4),n=a.checksum(t);return t.copy(e),n.copy(e,t.length),i.encode(e)},a.prototype.fromBuffer=function(t){return this.buf=t,this},a.prototype.fromString=function(t){var e=a.decode(t);return this.buf=e,this},a.prototype.toBuffer=function(){return this.buf},a.prototype.toString=function(){return a.encode(this.buf)},e.exports=a}).call(this,t("buffer").Buffer)},{"../crypto/hash":8,"./base58":12,buffer:48,lodash:297}],14:[function(t,e,r){(function(r){"use strict";var n=t("lodash"),i=t("../util/preconditions"),s=t("../util/buffer"),o=t("../crypto/bn"),a=function f(t){if(!(this instanceof f))return new f(t);if(!n.isUndefined(t))if(r.isBuffer(t))this.set({buf:t});else if(n.isString(t))this.set({buf:new r(t,"hex")});else{if(!n.isObject(t))throw new TypeError("Unrecognized argument for BufferReader");var e=t;this.set(e)}};a.prototype.set=function(t){return this.buf=t.buf||this.buf||void 0,this.pos=t.pos||this.pos||0,this},a.prototype.eof=function(){return this.pos>=this.buf.length},a.prototype.finished=a.prototype.eof,a.prototype.read=function(t){i.checkArgument(!n.isUndefined(t),"Must specify a length");var e=this.buf.slice(this.pos,this.pos+t);return this.pos=this.pos+t,e},a.prototype.readAll=function(){var t=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,t},a.prototype.readUInt8=function(){var t=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,t},a.prototype.readUInt16BE=function(){var t=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,t},a.prototype.readUInt16LE=function(){var t=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,t},a.prototype.readUInt32BE=function(){var t=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,t},a.prototype.readUInt32LE=function(){var t=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,t},a.prototype.readUInt64BEBN=function(){var t=this.buf.slice(this.pos,this.pos+8),e=o.fromBuffer(t);return this.pos=this.pos+8,e},a.prototype.readUInt64LEBN=function(){var t,e=this.buf.readUInt32LE(this.pos),r=this.buf.readUInt32LE(this.pos+4),n=4294967296*r+e;if(9007199254740991>=n)t=new o(n);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);t=new o(i,10,"le")}return this.pos=this.pos+8,t},a.prototype.readVarintNum=function(){var t=this.readUInt8();switch(t){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var e=this.readUInt64LEBN(),r=e.toNumber();if(r<=Math.pow(2,53))return r;throw new Error("number too large to retain precision - use readVarintBN");default:return t}},a.prototype.readVarLengthBuffer=function(){var t=this.readVarintNum(),e=this.read(t);return i.checkState(e.length===t,"Invalid length while reading varlength buffer. Expected to read: "+t+" and read "+e.length),e},a.prototype.readVarintBuf=function(){var t=this.buf.readUInt8(this.pos);switch(t){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},a.prototype.readVarintBN=function(){var t=this.readUInt8();switch(t){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(t)}},a.prototype.reverse=function(){for(var t=new r(this.buf.length),e=0;e<t.length;e++)t[e]=this.buf[this.buf.length-1-e];return this.buf=t,this},a.prototype.readReverse=function(t){n.isUndefined(t)&&(t=this.buf.length);var e=this.buf.slice(this.pos,this.pos+t);return this.pos=this.pos+t,s.reverse(e)},e.exports=a}).call(this,t("buffer").Buffer)},{"../crypto/bn":6,"../util/buffer":43,"../util/preconditions":45,buffer:48,lodash:297}],15:[function(t,e,r){(function(r){"use strict";var n=t("../util/buffer"),i=t("assert"),s=function o(t){return this instanceof o?void(t?this.set(t):this.bufs=[]):new o(t)};s.prototype.set=function(t){return this.bufs=t.bufs||this.bufs||[],this},s.prototype.toBuffer=function(){return this.concat()},s.prototype.concat=function(){return r.concat(this.bufs)},s.prototype.write=function(t){return i(n.isBuffer(t)),this.bufs.push(t),this},s.prototype.writeReverse=function(t){return i(n.isBuffer(t)),this.bufs.push(n.reverse(t)),this},s.prototype.writeUInt8=function(t){var e=new r(1);return e.writeUInt8(t,0),this.write(e),this},s.prototype.writeUInt16BE=function(t){var e=new r(2);return e.writeUInt16BE(t,0),this.write(e),this},s.prototype.writeUInt16LE=function(t){var e=new r(2);return e.writeUInt16LE(t,0),this.write(e),this},s.prototype.writeUInt32BE=function(t){var e=new r(4);return e.writeUInt32BE(t,0),this.write(e),this},s.prototype.writeInt32LE=function(t){var e=new r(4);return e.writeInt32LE(t,0),this.write(e),this},s.prototype.writeUInt32LE=function(t){var e=new r(4);return e.writeUInt32LE(t,0),this.write(e),this},s.prototype.writeUInt64BEBN=function(t){var e=t.toBuffer({size:8});return this.write(e),this},s.prototype.writeUInt64LEBN=function(t){var e=t.toBuffer({size:8});return this.writeReverse(e),this},s.prototype.writeVarintNum=function(t){var e=s.varintBufNum(t);return this.write(e),this},s.prototype.writeVarintBN=function(t){var e=s.varintBufBN(t);return this.write(e),this},s.varintBufNum=function(t){var e=void 0;return 253>t?(e=new r(1),e.writeUInt8(t,0)):65536>t?(e=new r(3),e.writeUInt8(253,0),e.writeUInt16LE(t,1)):4294967296>t?(e=new r(5),e.writeUInt8(254,0),e.writeUInt32LE(t,1)):(e=new r(9),e.writeUInt8(255,0),e.writeInt32LE(-1&t,1),e.writeUInt32LE(Math.floor(t/4294967296),5)),e},s.varintBufBN=function(t){var e=void 0,n=t.toNumber();if(253>n)e=new r(1),e.writeUInt8(n,0);else if(65536>n)e=new r(3),e.writeUInt8(253,0),e.writeUInt16LE(n,1);else if(4294967296>n)e=new r(5),e.writeUInt8(254,0),e.writeUInt32LE(n,1);else{var i=new s;i.writeUInt8(255),i.writeUInt64LEBN(t);var e=i.concat()}return e},e.exports=s}).call(this,t("buffer").Buffer)},{"../util/buffer":43,assert:46,buffer:48}],16:[function(t,e,r){(function(r){"use strict";var n=t("./bufferwriter"),i=t("./bufferreader"),s=t("../crypto/bn"),o=function a(t){if(!(this instanceof a))return new a(t);if(r.isBuffer(t))this.buf=t;else if("number"==typeof t){var e=t;this.fromNumber(e)}else if(t instanceof s){var n=t;this.fromBN(n)}else if(t){var i=t;this.set(i)}};o.prototype.set=function(t){return this.buf=t.buf||this.buf,this},o.prototype.fromString=function(t){return this.set({buf:new r(t,"hex")}),this},o.prototype.toString=function(){return this.buf.toString("hex")},o.prototype.fromBuffer=function(t){return this.buf=t,this},o.prototype.fromBufferReader=function(t){return this.buf=t.readVarintBuf(),this},o.prototype.fromBN=function(t){return this.buf=n().writeVarintBN(t).concat(),this},o.prototype.fromNumber=function(t){return this.buf=n().writeVarintNum(t).concat(),this},o.prototype.toBuffer=function(){return this.buf},o.prototype.toBN=function(){return i(this.buf).readVarintBN()},o.prototype.toNumber=function(){return i(this.buf).readVarintNum()},e.exports=o}).call(this,t("buffer").Buffer)},{"../crypto/bn":6,"./bufferreader":14,"./bufferwriter":15,buffer:48}],17:[function(t,e,r){"use strict";function n(t,e){return t.replace("{0}",e[0]).replace("{1}",e[1]).replace("{2}",e[2])}var i=t("lodash"),s=function(t,e){var r=function(){if(i.isString(e.message))this.message=n(e.message,arguments);else{if(!i.isFunction(e.message))throw new Error("Invalid error definition for "+e.name);this.message=e.message.apply(null,arguments)}this.stack=this.message+"\n"+(new Error).stack};return r.prototype=Object.create(t.prototype),r.prototype.name=t.prototype.name+e.name,t[e.name]=r,e.errors&&o(r,e.errors),r},o=function(t,e){i.each(e,function(e){s(t,e)})},a=function(t,e){return o(t,e),t},f={};f.Error=function(){this.message="Internal error",this.stack=this.message+"\n"+(new Error).stack},f.Error.prototype=Object.create(Error.prototype),f.Error.prototype.name="bitcore.Error";var u=t("./spec");a(f.Error,u),e.exports=f.Error,e.exports.extend=function(t){return s(f.Error,t)}},{"./spec":18,lodash:297}],18:[function(t,e,r){"use strict";var n="http://bitcore.io/";e.exports=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: "+n+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}]},{}],19:[function(t,e,r){"use strict";e.exports={_cache:{},_count:0,_eraseIndex:0,_usedList:{},_usedIndex:{},_CACHE_SIZE:5e3,get:function(t,e,r){r=!!r;var n=t+"/"+e+"/"+r;return this._cache[n]?(this._cacheHit(n),this._cache[n]):void 0},set:function(t,e,r,n){r=!!r;var i=t+"/"+e+"/"+r;this._cache[i]=n,this._cacheHit(i)},_cacheHit:function(t){this._usedIndex[t]&&delete this._usedList[this._usedIndex[t]],this._usedList[this._count]=t,this._usedIndex[t]=this._count,this._count++,this._cacheRemove()},_cacheRemove:function(){for(;this._eraseIndex<this._count-this._CACHE_SIZE;){if(this._usedList[this._eraseIndex]){var t=this._usedList[this._eraseIndex];delete this._usedIndex[t],delete this._cache[t]}delete this._usedList[this._eraseIndex],this._eraseIndex++}}}},{}],20:[function(t,e,r){(function(r){"use strict";function n(t){if(t instanceof n)return t;if(!(this instanceof n))return new n(t);if(!t)return this._generateRandomly();if(d.get(t))return this._generateRandomly(t);if(o.isString(t)||v.isBuffer(t))if(n.isValidSerialized(t))this._buildFromSerialized(t);else if(_.isValidJSON(t))this._buildFromJSON(t);else{if(!v.isBuffer(t)||!n.isValidSerialized(t.toString()))throw n.getSerializedError(t);this._buildFromSerialized(t.toString())}else{if(!o.isObject(t))throw new y.UnrecognizedArgument(t);this._buildFromObject(t)}}var i=t("assert"),s=t("buffer"),o=t("lodash"),a=t("./util/preconditions"),f=t("./crypto/bn"),u=t("./encoding/base58"),c=t("./encoding/base58check"),h=t("./crypto/hash"),d=t("./networks"),p=t("./hdkeycache"),l=t("./crypto/point"),b=t("./privatekey"),g=t("./crypto/random"),m=t("./errors"),y=m.HDPrivateKey,v=t("./util/buffer"),_=t("./util/js"),w=128,S=1/8,I=512;n.isValidPath=function(t,e){if(o.isString(t)){var r=n._getDerivationIndexes(t);return null!==r&&o.all(r,n.isValidPath)}return o.isNumber(t)?(t<n.Hardened&&e===!0&&(t+=n.Hardened),t>=0&&t<n.MaxIndex):!1},n._getDerivationIndexes=function(t){var e=t.split("/");if(o.contains(n.RootElementAlias,t))return[];if(!o.contains(n.RootElementAlias,e[0]))return null;var r=e.slice(1).map(function(t){var e="'"===t.slice(-1);if(e&&(t=t.slice(0,-1)),!t||"-"===t[0])return NaN;var r=+t;return e&&(r+=n.Hardened),r});return o.any(r,isNaN)?null:r},n.prototype.derive=function(t,e){if(o.isNumber(t))return this._deriveWithNumber(t,e);if(o.isString(t))return this._deriveFromString(t);throw new y.InvalidDerivationArgument(t)},n.prototype._deriveWithNumber=function(t,e){if(!n.isValidPath(t,e))throw new y.InvalidPath(t);e=t>=n.Hardened?!0:e,t<n.Hardened&&e===!0&&(t+=n.Hardened);var r=p.get(this.xprivkey,t,e);if(r)return r;var i,o=v.integerAsBuffer(t);i=e?v.concat([new s.Buffer([0]),this.privateKey.toBuffer(),o]):v.concat([this.publicKey.toBuffer(),o]);var a=h.sha512hmac(i,this._buffers.chainCode),u=f.fromBuffer(a.slice(0,32),{size:32}),c=a.slice(32,64),d=u.add(this.privateKey.toBigNumber()).mod(l.getN()).toBuffer({size:32}),b=new n({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:t,chainCode:c,privateKey:d});return p.set(this.xprivkey,t,e,b),b},n.prototype._deriveFromString=function(t){if(!n.isValidPath(t))throw new y.InvalidPath(t);var e=n._getDerivationIndexes(t),r=e.reduce(function(t,e){return t._deriveWithNumber(e)},this);return r},n.isValidSerialized=function(t,e){return!n.getSerializedError(t,e)},n.getSerializedError=function(t,e){if(!o.isString(t)&&!v.isBuffer(t))return new y.UnrecognizedArgument("Expected string or buffer");if(!u.validCharacters(t))return new m.InvalidB58Char("(unknown)",t);try{t=c.decode(t)}catch(r){return new m.InvalidB58Checksum(t)}if(t.length!==n.DataLength)return new y.InvalidLength(t);if(!o.isUndefined(e)){var i=n._validateNetwork(t,e);if(i)return i}return null},n._validateNetwork=function(t,e){var r=d.get(e);if(!r)return new m.InvalidNetworkArgument(e);var n=t.slice(0,4);return v.integerFromBuffer(n)!==r.xprivkey?new m.InvalidNetwork(n):null},n.fromString=function(t){return a.checkArgument(o.isString(t),"No valid string was provided"),new n(t)},n.fromObject=function(t){return a.checkArgument(o.isObject(t),"No valid argument was provided"),new n(t)},n.prototype._buildFromJSON=function(t){return this._buildFromObject(JSON.parse(t))},n.prototype._buildFromObject=function(t){var e={version:t.network?v.integerAsBuffer(d.get(t.network).xprivkey):t.version,depth:o.isNumber(t.depth)?v.integerAsSingleByteBuffer(t.depth):t.depth,parentFingerPrint:o.isNumber(t.parentFingerPrint)?v.integerAsBuffer(t.parentFingerPrint):t.parentFingerPrint,childIndex:o.isNumber(t.childIndex)?v.integerAsBuffer(t.childIndex):t.childIndex,chainCode:o.isString(t.chainCode)?v.hexToBuffer(t.chainCode):t.chainCode,privateKey:o.isString(t.privateKey)&&_.isHexa(t.privateKey)?v.hexToBuffer(t.privateKey):t.privateKey,checksum:t.checksum?t.checksum.length?t.checksum:v.integerAsBuffer(t.checksum):void 0};return this._buildFromBuffers(e)},n.prototype._buildFromSerialized=function(t){var e=c.decode(t),r={version:e.slice(n.VersionStart,n.VersionEnd),depth:e.slice(n.DepthStart,n.DepthEnd),parentFingerPrint:e.slice(n.ParentFingerPrintStart,n.ParentFingerPrintEnd),childIndex:e.slice(n.ChildIndexStart,n.ChildIndexEnd),chainCode:e.slice(n.ChainCodeStart,n.ChainCodeEnd),privateKey:e.slice(n.PrivateKeyStart,n.PrivateKeyEnd),checksum:e.slice(n.ChecksumStart,n.ChecksumEnd),xprivkey:t};return this._buildFromBuffers(r)},n.prototype._generateRandomly=function(t){return n.fromSeed(g.getRandomBuffer(64),t)},n.fromSeed=function(t,e){if(_.isHexaString(t)&&(t=v.hexToBuffer(t)),!r.isBuffer(t))throw new y.InvalidEntropyArgument(t);if(t.length<w*S)throw new y.InvalidEntropyArgument.NotEnoughEntropy(t);if(t.length>I*S)throw new y.InvalidEntropyArgument.TooMuchEntropy(t);var i=h.sha512hmac(t,new s.Buffer("Bitcoin seed"));return new n({network:d.get(e)||d.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:i.slice(0,32),chainCode:i.slice(32,64)})},n.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var e=t("./hdpublickey");this._hdPublicKey=new e(this)}},n.prototype._buildFromBuffers=function(t){n._validateBufferArguments(t),_.defineImmutable(this,{_buffers:t});var e=[t.version,t.depth,t.parentFingerPrint,t.childIndex,t.chainCode,v.emptyBuffer(1),t.privateKey],i=s.Buffer.concat(e);if(t.checksum&&t.checksum.length){if(t.checksum.toString()!==c.checksum(i).toString())throw new m.InvalidB58Checksum(i)}else t.checksum=c.checksum(i);var o,a=d.get(v.integerFromBuffer(t.version));o=c.encode(s.Buffer.concat(e)),t.xprivkey=new r(o);var u=new b(f.fromBuffer(t.privateKey),a),p=u.toPublicKey(),l=n.ParentFingerPrintSize,g=h.sha256ripemd160(p.toBuffer()).slice(0,l);return _.defineImmutable(this,{xprivkey:o,network:a,depth:v.integerFromSingleByteBuffer(t.depth),privateKey:u,publicKey:p,fingerPrint:g}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this},n._validateBufferArguments=function(t){var e=function(e,r){var n=t[e];i(v.isBuffer(n),e+" argument is not a buffer"),i(n.length===r,e+" has not the expected size: found "+n.length+", expected "+r)};e("version",n.VersionSize),e("depth",n.DepthSize),e("parentFingerPrint",n.ParentFingerPrintSize),e("childIndex",n.ChildIndexSize),e("chainCode",n.ChainCodeSize),e("privateKey",n.PrivateKeySize),t.checksum&&t.checksum.length&&e("checksum",n.CheckSumSize)},n.prototype.toString=function(){return this.xprivkey},n.prototype.inspect=function(){return"<HDPrivateKey: "+this.xprivkey+">"},n.prototype.toObject=n.prototype.toJSON=function(){return{network:d.get(v.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:v.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:v.integerFromBuffer(this.fingerPrint),parentFingerPrint:v.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:v.integerFromBuffer(this._buffers.childIndex),chainCode:v.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:v.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},n.fromBuffer=function(t){return new n(t.toString())},n.prototype.toBuffer=function(){return v.copy(this._buffers.xprivkey)},n.DefaultDepth=0,n.DefaultFingerprint=0,n.DefaultChildIndex=0,n.Hardened=2147483648,n.MaxIndex=2*n.Hardened,n.RootElementAlias=["m","M","m'","M'"],n.VersionSize=4,n.DepthSize=1,n.ParentFingerPrintSize=4,n.ChildIndexSize=4,n.ChainCodeSize=32,n.PrivateKeySize=32,n.CheckSumSize=4,n.DataLength=78,n.SerializedByteSize=82,n.VersionStart=0,n.VersionEnd=n.VersionStart+n.VersionSize,n.DepthStart=n.VersionEnd,n.DepthEnd=n.DepthStart+n.DepthSize,n.ParentFingerPrintStart=n.DepthEnd,n.ParentFingerPrintEnd=n.ParentFingerPrintStart+n.ParentFingerPrintSize,n.ChildIndexStart=n.ParentFingerPrintEnd,n.ChildIndexEnd=n.ChildIndexStart+n.ChildIndexSize,n.ChainCodeStart=n.ChildIndexEnd,n.ChainCodeEnd=n.ChainCodeStart+n.ChainCodeSize,n.PrivateKeyStart=n.ChainCodeEnd+1,n.PrivateKeyEnd=n.PrivateKeyStart+n.PrivateKeySize,n.ChecksumStart=n.PrivateKeyEnd,n.ChecksumEnd=n.ChecksumStart+n.CheckSumSize,i(n.ChecksumEnd===n.SerializedByteSize),e.exports=n}).call(this,t("buffer").Buffer)},{"./crypto/bn":6,"./crypto/hash":8,"./crypto/point":9,"./crypto/random":10,"./encoding/base58":12,"./encoding/base58check":13,"./errors":17,"./hdkeycache":19,"./hdpublickey":21,"./networks":22,"./privatekey":24,"./util/buffer":43,"./util/js":44,"./util/preconditions":45,assert:46,buffer:48,lodash:297}],21:[function(t,e,r){(function(r){"use strict";function n(t){if(t instanceof n)return t;if(!(this instanceof n))return new n(t);if(t){if(i.isString(t)||_.isBuffer(t)){var e=n.getSerializedError(t);if(e){if(_.isBuffer(t)&&!n.getSerializedError(t.toString()))return this._buildFromSerialized(t.toString());if(e instanceof m.ArgumentIsPrivateExtended)return new c(t).hdPublicKey;throw e}return this._buildFromSerialized(t)}if(i.isObject(t))return t instanceof c?this._buildFromPrivate(t):this._buildFromObject(t);throw new m.UnrecognizedArgument(t)}throw new m.MustSupplyArgument}var i=t("lodash"),s=t("./util/preconditions"),o=t("./crypto/bn"),a=t("./encoding/base58"),f=t("./encoding/base58check"),u=t("./crypto/hash"),c=t("./hdprivatekey"),h=t("./hdkeycache"),d=t("./networks"),p=t("./crypto/point"),l=t("./publickey"),b=t("./errors"),g=b,m=b.HDPublicKey,y=t("assert"),v=t("./util/js"),_=t("./util/buffer");n.isValidPath=function(t){if(i.isString(t)){var e=c._getDerivationIndexes(t);return null!==e&&i.all(e,n.isValidPath)}return i.isNumber(t)?t>=0&&t<n.Hardened:!1},n.prototype.derive=function(t,e){if(i.isNumber(t))return this._deriveWithNumber(t,e);if(i.isString(t))return this._deriveFromString(t);throw new m.InvalidDerivationArgument(t)},n.prototype._deriveWithNumber=function(t,e){if(t>=n.Hardened||e)throw new m.InvalidIndexCantDeriveHardened;if(0>t)throw new m.InvalidPath(t);var r=h.get(this.xpubkey,t,!1);if(r)return r;var i=_.integerAsBuffer(t),s=_.concat([this.publicKey.toBuffer(),i]),a=u.sha512hmac(s,this._buffers.chainCode),f=o.fromBuffer(a.slice(0,32),{size:32}),c=a.slice(32,64),d=l.fromPoint(p.getG().mul(f).add(this.publicKey.point)),b=new n({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:t,chainCode:c,publicKey:d});return h.set(this.xpubkey,t,!1,b),b},n.prototype._deriveFromString=function(t){if(i.contains(t,"'"))throw new m.InvalidIndexCantDeriveHardened;if(!n.isValidPath(t))throw new m.InvalidPath(t);var e=c._getDerivationIndexes(t),r=e.reduce(function(t,e){return t._deriveWithNumber(e)},this);return r},n.isValidSerialized=function(t,e){return i.isNull(n.getSerializedError(t,e))},n.getSerializedError=function(t,e){if(!i.isString(t)&&!_.isBuffer(t))return new m.UnrecognizedArgument("expected buffer or string");if(!a.validCharacters(t))return new g.InvalidB58Char("(unknown)",t);try{t=f.decode(t)}catch(r){return new g.InvalidB58Checksum(t)}if(t.length!==n.DataSize)return new m.InvalidLength(t);if(!i.isUndefined(e)){var s=n._validateNetwork(t,e);if(s)return s}var o=_.integerFromBuffer(t.slice(0,4));return o===d.livenet.xprivkey||o===d.testnet.xprivkey?new m.ArgumentIsPrivateExtended:null},n._validateNetwork=function(t,e){var r=d.get(e);if(!r)return new g.InvalidNetworkArgument(e);var i=t.slice(n.VersionStart,n.VersionEnd);return _.integerFromBuffer(i)!==r.xpubkey?new g.InvalidNetwork(i):null},n.prototype._buildFromPrivate=function(t){var e=i.clone(t._buffers),r=p.getG().mul(o.fromBuffer(e.privateKey));return e.publicKey=p.pointToCompressed(r),e.version=_.integerAsBuffer(d.get(_.integerFromBuffer(e.version)).xpubkey),e.privateKey=void 0,e.checksum=void 0,e.xprivkey=void 0,this._buildFromBuffers(e)},n.prototype._buildFromObject=function(t){var e={version:t.network?_.integerAsBuffer(d.get(t.network).xpubkey):t.version,depth:i.isNumber(t.depth)?_.integerAsSingleByteBuffer(t.depth):t.depth,parentFingerPrint:i.isNumber(t.parentFingerPrint)?_.integerAsBuffer(t.parentFingerPrint):t.parentFingerPrint,childIndex:i.isNumber(t.childIndex)?_.integerAsBuffer(t.childIndex):t.childIndex,chainCode:i.isString(t.chainCode)?_.hexToBuffer(t.chainCode):t.chainCode,publicKey:i.isString(t.publicKey)?_.hexToBuffer(t.publicKey):_.isBuffer(t.publicKey)?t.publicKey:t.publicKey.toBuffer(),checksum:i.isNumber(t.checksum)?_.integerAsBuffer(t.checksum):t.checksum};return this._buildFromBuffers(e)},n.prototype._buildFromSerialized=function(t){var e=f.decode(t),r={version:e.slice(n.VersionStart,n.VersionEnd),depth:e.slice(n.DepthStart,n.DepthEnd),parentFingerPrint:e.slice(n.ParentFingerPrintStart,n.ParentFingerPrintEnd),childIndex:e.slice(n.ChildIndexStart,n.ChildIndexEnd),chainCode:e.slice(n.ChainCodeStart,n.ChainCodeEnd),publicKey:e.slice(n.PublicKeyStart,n.PublicKeyEnd),checksum:e.slice(n.ChecksumStart,n.ChecksumEnd),xpubkey:t};return this._buildFromBuffers(r)},n.prototype._buildFromBuffers=function(t){n._validateBufferArguments(t),v.defineImmutable(this,{_buffers:t});var e=[t.version,t.depth,t.parentFingerPrint,t.childIndex,t.chainCode,t.publicKey],i=_.concat(e),s=f.checksum(i);if(t.checksum&&t.checksum.length){if(t.checksum.toString("hex")!==s.toString("hex"))throw new g.InvalidB58Checksum(i,s)}else t.checksum=s;var o,a=d.get(_.integerFromBuffer(t.version));o=f.encode(_.concat(e)),t.xpubkey=new r(o);var c=new l(t.publicKey,{network:a}),h=n.ParentFingerPrintSize,p=u.sha256ripemd160(c.toBuffer()).slice(0,h);return v.defineImmutable(this,{xpubkey:o,network:a,depth:_.integerFromSingleByteBuffer(t.depth),publicKey:c,fingerPrint:p}),this},n._validateBufferArguments=function(t){var e=function(e,r){var n=t[e];y(_.isBuffer(n),e+" argument is not a buffer, it's "+typeof n),y(n.length===r,e+" has not the expected size: found "+n.length+", expected "+r)};e("version",n.VersionSize),e("depth",n.DepthSize),e("parentFingerPrint",n.ParentFingerPrintSize),e("childIndex",n.ChildIndexSize),e("chainCode",n.ChainCodeSize),e("publicKey",n.PublicKeySize),t.checksum&&t.checksum.length&&e("checksum",n.CheckSumSize)},n.fromString=function(t){return s.checkArgument(i.isString(t),"No valid string was provided"),new n(t)},n.fromObject=function(t){return s.checkArgument(i.isObject(t),"No valid argument was provided"),new n(t)},n.prototype.toString=function(){return this.xpubkey},n.prototype.inspect=function(){return"<HDPublicKey: "+this.xpubkey+">"},n.prototype.toObject=n.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},n.fromBuffer=function(t){return new n(t)},n.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},n.Hardened=2147483648,n.RootElementAlias=["m","M"],n.VersionSize=4,n.DepthSize=1,n.ParentFingerPrintSize=4,n.ChildIndexSize=4,n.ChainCodeSize=32,n.PublicKeySize=33,n.CheckSumSize=4,n.DataSize=78,n.SerializedByteSize=82,n.VersionStart=0,n.VersionEnd=n.VersionStart+n.VersionSize,n.DepthStart=n.VersionEnd,n.DepthEnd=n.DepthStart+n.DepthSize,n.ParentFingerPrintStart=n.DepthEnd,n.ParentFingerPrintEnd=n.ParentFingerPrintStart+n.ParentFingerPrintSize,n.ChildIndexStart=n.ParentFingerPrintEnd,n.ChildIndexEnd=n.ChildIndexStart+n.ChildIndexSize,n.ChainCodeStart=n.ChildIndexEnd,n.ChainCodeEnd=n.ChainCodeStart+n.ChainCodeSize,n.PublicKeyStart=n.ChainCodeEnd,n.PublicKeyEnd=n.PublicKeyStart+n.PublicKeySize,n.ChecksumStart=n.PublicKeyEnd,n.ChecksumEnd=n.ChecksumStart+n.CheckSumSize,y(n.PublicKeyEnd===n.DataSize),y(n.ChecksumEnd===n.SerializedByteSize),e.exports=n}).call(this,t("buffer").Buffer)},{"./crypto/bn":6,"./crypto/hash":8,"./crypto/point":9,"./encoding/base58":12,"./encoding/base58check":13,"./errors":17,"./hdkeycache":19,"./hdprivatekey":20,"./networks":22,"./publickey":25,"./util/buffer":43,"./util/js":44,"./util/preconditions":45,assert:46,buffer:48,lodash:297}],22:[function(t,e,r){"use strict";function n(){}function i(t,e){if(~d.indexOf(t))return t;{if(!e)return p[t];u.isArray(e)||(e=[e]);var r=function(e){return d[n][e]===t};for(var n in d)if(u.any(e,r))return d[n]}}function s(t){var e=new n;return h.defineImmutable(e,{name:t.name,alias:t.alias,pubkeyhash:t.pubkeyhash,privatekey:t.privatekey,scripthash:t.scripthash,xpubkey:t.xpubkey,xprivkey:t.xprivkey}),t.networkMagic&&h.defineImmutable(e,{networkMagic:c.integerAsBuffer(t.networkMagic)}),t.port&&h.defineImmutable(e,{port:t.port}),t.dnsSeeds&&h.defineImmutable(e,{dnsSeeds:t.dnsSeeds}),u.each(e,function(t){u.isUndefined(t)||u.isObject(t)||(p[t]=e)}),d.push(e),e}function o(t){for(var e=0;e<d.length;e++)d[e]===t&&d.splice(e,1);for(var r in p)p[r]===t&&delete p[r]}function a(){b.regtestEnabled=!0}function f(){b.regtestEnabled=!1}var u=t("lodash"),c=t("./util/buffer"),h=t("./util/js"),d=[],p={};n.prototype.toString=function(){return this.name},s({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]
});var l=i("livenet");s({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var b=i("testnet"),g={PORT:18333,NETWORK_MAGIC:c.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var m in g)u.isObject(g[m])||(p[g[m]]=b);var y={PORT:18444,NETWORK_MAGIC:c.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var m in y)u.isObject(y[m])||(p[y[m]]=b);Object.defineProperty(b,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?y.PORT:g.PORT}}),Object.defineProperty(b,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?y.NETWORK_MAGIC:g.NETWORK_MAGIC}}),Object.defineProperty(b,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?y.DNS_SEEDS:g.DNS_SEEDS}}),e.exports={add:s,remove:o,defaultNetwork:l,livenet:l,mainnet:l,testnet:b,get:i,enableRegtest:a,disableRegtest:f}},{"./util/buffer":43,"./util/js":44,lodash:297}],23:[function(t,e,r){(function(r){"use strict";function n(t){if(!(this instanceof n))return new n(t);var e;if(i.isNumber(t))e=t;else{if(!i.isString(t))throw new TypeError('Unrecognized num type: "'+typeof t+'" for Opcode');e=n.map[t]}return a.defineImmutable(this,{num:e}),this}var i=t("lodash"),s=t("./util/preconditions"),o=t("./util/buffer"),a=t("./util/js");n.fromBuffer=function(t){return s.checkArgument(o.isBuffer(t)),new n(Number("0x"+t.toString("hex")))},n.fromNumber=function(t){return s.checkArgument(i.isNumber(t)),new n(t)},n.fromString=function(t){s.checkArgument(i.isString(t));var e=n.map[t];if("undefined"==typeof e)throw new TypeError("Invalid opcodestr");return new n(e)},n.prototype.toHex=function(){return this.num.toString(16)},n.prototype.toBuffer=function(){return new r(this.toHex(),"hex")},n.prototype.toNumber=function(){return this.num},n.prototype.toString=function(){var t=n.reverseMap[this.num];if("undefined"==typeof t)throw new Error("Opcode does not have a string representation");return t},n.smallInt=function(t){return s.checkArgument(i.isNumber(t),"Invalid Argument: n should be number"),s.checkArgument(t>=0&&16>=t,"Invalid Argument: n must be between 0 and 16"),0===t?n("OP_0"):new n(n.map.OP_1+t-1)},n.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},n.reverseMap=[];for(var f in n.map)n.reverseMap[n.map[f]]=f;i.extend(n,n.map),n.isSmallIntOp=function(t){return t instanceof n&&(t=t.toNumber()),t===n.map.OP_0||t>=n.map.OP_1&&t<=n.map.OP_16},n.prototype.inspect=function(){return"<Opcode: "+this.toString()+", hex: "+this.toHex()+", decimal: "+this.num+">"},e.exports=n}).call(this,t("buffer").Buffer)},{"./util/buffer":43,"./util/js":44,"./util/preconditions":45,buffer:48,lodash:297}],24:[function(t,e,r){(function(r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);if(t instanceof n)return t;var r=this._classifyArguments(t,e);if(!r.bn||0===r.bn.cmp(new a(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(c.getN()))throw new TypeError("Number must be less than N");if("undefined"==typeof r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return f.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}var i=t("lodash"),s=t("./address"),o=t("./encoding/base58check"),a=t("./crypto/bn"),f=t("./util/js"),u=t("./networks"),c=t("./crypto/point"),h=t("./publickey"),d=t("./crypto/random"),p=t("./util/preconditions");n.prototype._classifyArguments=function(t,e){var s={compressed:!0,network:e?u.get(e):u.defaultNetwork};if(i.isUndefined(t)||i.isNull(t))s.bn=n._getRandomBN();else if(t instanceof a)s.bn=t;else if(t instanceof r||t instanceof Uint8Array)s=n._transformBuffer(t,e);else if(t.bn&&t.network)s=n._transformObject(t);else if(!e&&u.get(t))s.bn=n._getRandomBN(),s.network=u.get(t);else{if("string"!=typeof t)throw new TypeError("First argument is an unrecognized data type.");f.isHexa(t)?s.bn=new a(new r(t,"hex")):s=n._transformWIF(t,e)}return s},n._getRandomBN=function(){var t,e;do{var r=d.getRandomBuffer(32);e=a.fromBuffer(r),t=e.lt(c.getN())}while(!t);return e},n._transformBuffer=function(t,e){var r={};if(32===t.length)return n._transformBNBuffer(t,e);if(r.network=u.get(t[0],"privatekey"),!r.network)throw new Error("Invalid network");if(e&&r.network!==u.get(e))throw new TypeError("Private key network mismatch");if(34===t.length&&1===t[33])r.compressed=!0;else{if(33!==t.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=a.fromBuffer(t.slice(1,33)),r},n._transformBNBuffer=function(t,e){var r={};return r.network=u.get(e)||u.defaultNetwork,r.bn=a.fromBuffer(t),r.compressed=!1,r},n._transformWIF=function(t,e){return n._transformBuffer(o.decode(t),e)},n.fromBuffer=function(t,e){return new n(t,e)},n._transformObject=function(t){var e=new a(t.bn,"hex"),r=u.get(t.network);return{bn:e,network:r,compressed:t.compressed}},n.fromString=n.fromWIF=function(t){return p.checkArgument(i.isString(t),"First argument is expected to be a string."),new n(t)},n.fromObject=function(t){return p.checkArgument(i.isObject(t),"First argument is expected to be an object."),new n(t)},n.fromRandom=function(t){var e=n._getRandomBN();return new n(e,t)},n.getValidationError=function(t,e){var r;try{new n(t,e)}catch(i){r=i}return r},n.isValid=function(t,e){return t?!n.getValidationError(t,e):!1},n.prototype.toString=function(){return this.toBuffer().toString("hex")},n.prototype.toWIF=function(){var t,e=this.network,n=this.compressed;return t=n?r.concat([new r([e.privatekey]),this.bn.toBuffer({size:32}),new r([1])]):r.concat([new r([e.privatekey]),this.bn.toBuffer({size:32})]),o.encode(t)},n.prototype.toBigNumber=function(){return this.bn},n.prototype.toBuffer=function(){return this.bn.toBuffer()},n.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=h.fromPrivateKey(this)),this._pubkey},n.prototype.toAddress=function(t){var e=this.toPublicKey();return s.fromPublicKey(e,t||this.network)},n.prototype.toObject=n.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},n.prototype.inspect=function(){var t=this.compressed?"":", uncompressed";return"<PrivateKey: "+this.toString()+", network: "+this.network+t+">"},e.exports=n}).call(this,t("buffer").Buffer)},{"./address":1,"./crypto/bn":6,"./crypto/point":9,"./crypto/random":10,"./encoding/base58check":13,"./networks":22,"./publickey":25,"./util/js":44,"./util/preconditions":45,buffer:48,lodash:297}],25:[function(t,e,r){(function(r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);if(c.checkArgument(t,"First argument is required, please include public key data."),t instanceof n)return t;e=e||{};var r=this._classifyArgs(t,e);return r.point.validate(),a.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||f.defaultNetwork}),this}var i=t("./crypto/bn"),s=t("./crypto/point"),o=t("./crypto/hash"),a=t("./util/js"),f=t("./networks"),u=t("lodash"),c=t("./util/preconditions");n.prototype._classifyArgs=function(t,e){var i={compressed:u.isUndefined(e.compressed)||e.compressed};if(t instanceof s)i.point=t;else if(t.x&&t.y)i=n._transformObject(t);else if("string"==typeof t)i=n._transformDER(new r(t,"hex"));else if(n._isBuffer(t))i=n._transformDER(t);else{if(!n._isPrivateKey(t))throw new TypeError("First argument is an unrecognized data format.");i=n._transformPrivateKey(t)}return i.network||(i.network=u.isUndefined(e.network)?void 0:f.get(e.network)),i},n._isPrivateKey=function(e){var r=t("./privatekey");return e instanceof r},n._isBuffer=function(t){return t instanceof r||t instanceof Uint8Array},n._transformPrivateKey=function(t){c.checkArgument(n._isPrivateKey(t),"Must be an instance of PrivateKey");var e={};return e.point=s.getG().mul(t.bn),e.compressed=t.compressed,e.network=t.network,e},n._transformDER=function(t,e){c.checkArgument(n._isBuffer(t),"Must be a hex buffer of DER encoded public key");var r={};e=u.isUndefined(e)?!0:e;var o,a,f,h;if(4!==t[0]&&(e||6!==t[0]&&7!==t[0]))if(3===t[0])f=t.slice(1),o=new i(f),r=n._transformX(!0,o),r.compressed=!0;else{if(2!==t[0])throw new TypeError("Invalid DER format public key");f=t.slice(1),o=new i(f),r=n._transformX(!1,o),r.compressed=!0}else{if(f=t.slice(1,33),h=t.slice(33,65),32!==f.length||32!==h.length||65!==t.length)throw new TypeError("Length of x and y must be 32 bytes");o=new i(f),a=new i(h),r.point=new s(o,a),r.compressed=!1}return r},n._transformX=function(t,e){c.checkArgument("boolean"==typeof t,"Must specify whether y is odd or not (true or false)");var r={};return r.point=s.fromX(t,e),r},n._transformObject=function(t){var e=new i(t.x,"hex"),r=new i(t.y,"hex"),o=new s(e,r);return new n(o,{compressed:t.compressed})},n.fromPrivateKey=function(t){c.checkArgument(n._isPrivateKey(t),"Must be an instance of PrivateKey");var e=n._transformPrivateKey(t);return new n(e.point,{compressed:e.compressed,network:e.network})},n.fromDER=n.fromBuffer=function(t,e){c.checkArgument(n._isBuffer(t),"Must be a hex buffer of DER encoded public key");var r=n._transformDER(t,e);return new n(r.point,{compressed:r.compressed})},n.fromPoint=function(t,e){return c.checkArgument(t instanceof s,"First argument must be an instance of Point."),new n(t,{compressed:e})},n.fromString=function(t,e){var i=new r(t,e||"hex"),s=n._transformDER(i);return new n(s.point,{compressed:s.compressed})},n.fromX=function(t,e){var r=n._transformX(t,e);return new n(r.point,{compressed:r.compressed})},n.getValidationError=function(t){var e;try{new n(t)}catch(r){e=r}return e},n.isValid=function(t){return!n.getValidationError(t)},n.prototype.toObject=n.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},n.prototype.toBuffer=n.prototype.toDER=function(){var t,e=this.point.getX(),n=this.point.getY(),i=e.toBuffer({size:32}),s=n.toBuffer({size:32});if(this.compressed){var o=s[s.length-1]%2;return t=new r(o?[3]:[2]),r.concat([t,i])}return t=new r([4]),r.concat([t,i,s])},n.prototype._getID=function(){return o.sha256ripemd160(this.toBuffer())},n.prototype.toAddress=function(e){var r=t("./address");return r.fromPublicKey(this,e||this.network)},n.prototype.toString=function(){return this.toDER().toString("hex")},n.prototype.inspect=function(){return"<PublicKey: "+this.toString()+(this.compressed?"":", uncompressed")+">"},e.exports=n}).call(this,t("buffer").Buffer)},{"./address":1,"./crypto/bn":6,"./crypto/hash":8,"./crypto/point":9,"./networks":22,"./privatekey":24,"./util/js":44,"./util/preconditions":45,buffer:48,lodash:297}],26:[function(t,e,r){e.exports=t("./script"),e.exports.Interpreter=t("./interpreter")},{"./interpreter":27,"./script":28}],27:[function(t,e,r){(function(r){"use strict";var n=t("lodash"),i=t("./script"),s=t("../opcode"),o=t("../crypto/bn"),a=t("../crypto/hash"),f=t("../crypto/signature"),u=t("../publickey"),c=function h(t){return this instanceof h?void(t?(this.initialize(),this.set(t)):this.initialize()):new h(t)};c.prototype.verify=function(e,r,s,o,a){var f=t("../transaction");n.isUndefined(s)&&(s=new f),n.isUndefined(o)&&(o=0),n.isUndefined(a)&&(a=0),this.set({script:e,tx:s,nin:o,flags:a});var u;if(0!==(a&c.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;a&c.SCRIPT_VERIFY_P2SH&&(u=this.stack.slice());var h=this.stack;if(this.initialize(),this.set({script:r,stack:h,tx:s,nin:o,flags:a}),!this.evaluate())return!1;if(0===this.stack.length)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var d=this.stack[this.stack.length-1];if(!c.castToBool(d))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(a&c.SCRIPT_VERIFY_P2SH&&r.isScriptHashOut()){if(!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(0===u.length)throw new Error("internal error - stack copy empty");var p=u[u.length-1],l=i.fromBuffer(p);return u.pop(),this.initialize(),this.set({script:l,stack:u,tx:s,nin:o,flags:a}),this.evaluate()?0===u.length?(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1):c.castToBool(u[u.length-1])?!0:(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1):!1}return!0},e.exports=c,c.prototype.initialize=function(t){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},c.prototype.set=function(t){this.script=t.script||this.script,this.tx=t.tx||this.tx,this.nin="undefined"!=typeof t.nin?t.nin:this.nin,this.stack=t.stack||this.stack,this.altstack=t.altack||this.altstack,this.pc="undefined"!=typeof t.pc?t.pc:this.pc,this.pbegincodehash="undefined"!=typeof t.pbegincodehash?t.pbegincodehash:this.pbegincodehash,this.nOpCount="undefined"!=typeof t.nOpCount?t.nOpCount:this.nOpCount,this.vfExec=t.vfExec||this.vfExec,this.errstr=t.errstr||this.errstr,this.flags="undefined"!=typeof t.flags?t.flags:this.flags},c["true"]=new r([1]),c["false"]=new r([]),c.MAX_SCRIPT_ELEMENT_SIZE=520,c.LOCKTIME_THRESHOLD=5e8,c.LOCKTIME_THRESHOLD_BN=new o(c.LOCKTIME_THRESHOLD),c.SCRIPT_VERIFY_NONE=0,c.SCRIPT_VERIFY_P2SH=1,c.SCRIPT_VERIFY_STRICTENC=2,c.SCRIPT_VERIFY_DERSIG=4,c.SCRIPT_VERIFY_LOW_S=8,c.SCRIPT_VERIFY_NULLDUMMY=16,c.SCRIPT_VERIFY_SIGPUSHONLY=32,c.SCRIPT_VERIFY_MINIMALDATA=64,c.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,c.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,c.castToBool=function(t){for(var e=0;e<t.length;e++)if(0!==t[e])return e===t.length-1&&128===t[e]?!1:!0;return!1},c.prototype.checkSignatureEncoding=function(t){var e;if(0!==(this.flags&(c.SCRIPT_VERIFY_DERSIG|c.SCRIPT_VERIFY_LOW_S|c.SCRIPT_VERIFY_STRICTENC))&&!f.isTxDER(t))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if(0!==(this.flags&c.SCRIPT_VERIFY_LOW_S)){if(e=f.fromTxFormat(t),!e.hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if(0!==(this.flags&c.SCRIPT_VERIFY_STRICTENC)&&(e=f.fromTxFormat(t),!e.hasDefinedHashtype()))return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;return!0},c.prototype.checkPubkeyEncoding=function(t){return 0===(this.flags&c.SCRIPT_VERIFY_STRICTENC)||u.isValid(t)?!0:(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1)},c.prototype.evaluate=function(){if(this.script.toBuffer().length>1e4)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){var t=this.step();if(!t)return!1}if(this.stack.length+this.altstack.length>1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(e){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+e,!1}return this.vfExec.length>0?(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1):!0},c.prototype.checkLockTime=function(t){return this.tx.nLockTime<c.LOCKTIME_THRESHOLD&&t.lt(c.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=c.LOCKTIME_THRESHOLD&&t.gte(c.LOCKTIME_THRESHOLD_BN)?t.gt(new o(this.tx.nLockTime))?!1:this.tx.inputs[this.nin].isFinal()?!0:!1:!1},c.prototype.step=function(){var t,e,r,h,d,p,l,b,g,m,y,v,_,w,S,I,k,E=0!==(this.flags&c.SCRIPT_VERIFY_MINIMALDATA),A=-1===this.vfExec.indexOf(!1),x=this.script.chunks[this.pc];this.pc++;var P=x.opcodenum;if(n.isUndefined(P))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(x.buf&&x.buf.length>c.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(P>s.OP_16&&++this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(P===s.OP_CAT||P===s.OP_SUBSTR||P===s.OP_LEFT||P===s.OP_RIGHT||P===s.OP_INVERT||P===s.OP_AND||P===s.OP_OR||P===s.OP_XOR||P===s.OP_2MUL||P===s.OP_2DIV||P===s.OP_MUL||P===s.OP_DIV||P===s.OP_MOD||P===s.OP_LSHIFT||P===s.OP_RSHIFT)return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(A&&P>=0&&P<=s.OP_PUSHDATA4){if(E&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(x.buf){if(x.len!==x.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(x.buf)}else this.stack.push(c["false"])}else if(A||s.OP_IF<=P&&P<=s.OP_ENDIF)switch(P){case s.OP_1NEGATE:case s.OP_1:case s.OP_2:case s.OP_3:case s.OP_4:case s.OP_5:case s.OP_6:case s.OP_7:case s.OP_8:case s.OP_9:case s.OP_10:case s.OP_11:case s.OP_12:case s.OP_13:case s.OP_14:case s.OP_15:case s.OP_16:d=P-(s.OP_1-1),t=new o(d).toScriptNumBuffer(),this.stack.push(t);break;case s.OP_NOP:break;case s.OP_NOP2:case s.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&c.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&c.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var O=o.fromScriptNumBuffer(this.stack[this.stack.length-1],E,5);if(O.lt(new o(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(O))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case s.OP_NOP1:case s.OP_NOP3:case s.OP_NOP4:case s.OP_NOP5:case s.OP_NOP6:case s.OP_NOP7:case s.OP_NOP8:case s.OP_NOP9:case s.OP_NOP10:if(this.flags&c.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case s.OP_IF:case s.OP_NOTIF:if(I=!1,A){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;t=this.stack.pop(),I=c.castToBool(t),P===s.OP_NOTIF&&(I=!I)}this.vfExec.push(I);break;case s.OP_ELSE:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case s.OP_ENDIF:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop();break;case s.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(t=this.stack[this.stack.length-1],I=c.castToBool(t),!I)return this.errstr="SCRIPT_ERR_VERIFY",!1;this.stack.pop();break;case s.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case s.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop());break;case s.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop());break;case s.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case s.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;e=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(e),this.stack.push(r);break;case s.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;e=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var B=this.stack[this.stack.length-1];this.stack.push(e),this.stack.push(r),this.stack.push(B);break;case s.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;e=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(e),this.stack.push(r);break;case s.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=this.stack.splice(this.stack.length-6,2),this.stack.push(h[0]),this.stack.push(h[1]);break;case s.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=this.stack.splice(this.stack.length-4,2),this.stack.push(h[0]),this.stack.push(h[1]);break;case s.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;t=this.stack[this.stack.length-1],I=c.castToBool(t),I&&this.stack.push(t);break;case s.OP_DEPTH:t=new o(this.stack.length).toScriptNumBuffer(),this.stack.push(t);break;case s.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case s.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-1]);break;case s.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case s.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-2]);break;case s.OP_PICK:case s.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(t=this.stack[this.stack.length-1],b=o.fromScriptNumBuffer(t,E),d=b.toNumber(),this.stack.pop(),0>d||d>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;t=this.stack[this.stack.length-d-1],P===s.OP_ROLL&&this.stack.splice(this.stack.length-d-1,1),this.stack.push(t);break;case s.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;p=this.stack[this.stack.length-3],l=this.stack[this.stack.length-2];var M=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=l,this.stack[this.stack.length-2]=M,this.stack[this.stack.length-1]=p;break;case s.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;p=this.stack[this.stack.length-2],l=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=l,this.stack[this.stack.length-1]=p;break;case s.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case s.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;b=new o(this.stack[this.stack.length-1].length),this.stack.push(b.toScriptNumBuffer());break;case s.OP_EQUAL:case s.OP_EQUALVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;e=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var R=e.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(R?c["true"]:c["false"]),P===s.OP_EQUALVERIFY){if(!R)return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1;this.stack.pop()}break;case s.OP_1ADD:case s.OP_1SUB:case s.OP_NEGATE:case s.OP_ABS:case s.OP_NOT:case s.OP_0NOTEQUAL:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(t=this.stack[this.stack.length-1],b=o.fromScriptNumBuffer(t,E),P){case s.OP_1ADD:b=b.add(o.One);break;case s.OP_1SUB:b=b.sub(o.One);break;case s.OP_NEGATE:b=b.neg();break;case s.OP_ABS:b.cmp(o.Zero)<0&&(b=b.neg());break;case s.OP_NOT:b=new o((0===b.cmp(o.Zero))+0);break;case s.OP_0NOTEQUAL:b=new o((0!==b.cmp(o.Zero))+0)}this.stack.pop(),this.stack.push(b.toScriptNumBuffer());break;case s.OP_ADD:case s.OP_SUB:case s.OP_BOOLAND:case s.OP_BOOLOR:case s.OP_NUMEQUAL:case s.OP_NUMEQUALVERIFY:case s.OP_NUMNOTEQUAL:case s.OP_LESSTHAN:case s.OP_GREATERTHAN:case s.OP_LESSTHANOREQUAL:case s.OP_GREATERTHANOREQUAL:case s.OP_MIN:case s.OP_MAX:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(g=o.fromScriptNumBuffer(this.stack[this.stack.length-2],E),m=o.fromScriptNumBuffer(this.stack[this.stack.length-1],E),b=new o(0),P){case s.OP_ADD:b=g.add(m);break;case s.OP_SUB:b=g.sub(m);break;case s.OP_BOOLAND:b=new o((0!==g.cmp(o.Zero)&&0!==m.cmp(o.Zero))+0);break;case s.OP_BOOLOR:b=new o((0!==g.cmp(o.Zero)||0!==m.cmp(o.Zero))+0);break;case s.OP_NUMEQUAL:b=new o((0===g.cmp(m))+0);break;case s.OP_NUMEQUALVERIFY:b=new o((0===g.cmp(m))+0);break;case s.OP_NUMNOTEQUAL:b=new o((0!==g.cmp(m))+0);break;case s.OP_LESSTHAN:b=new o((g.cmp(m)<0)+0);break;case s.OP_GREATERTHAN:b=new o((g.cmp(m)>0)+0);break;case s.OP_LESSTHANOREQUAL:b=new o((g.cmp(m)<=0)+0);break;case s.OP_GREATERTHANOREQUAL:b=new o((g.cmp(m)>=0)+0);break;case s.OP_MIN:b=g.cmp(m)<0?g:m;break;case s.OP_MAX:b=g.cmp(m)>0?g:m}if(this.stack.pop(),this.stack.pop(),this.stack.push(b.toScriptNumBuffer()),P===s.OP_NUMEQUALVERIFY){if(!c.castToBool(this.stack[this.stack.length-1]))return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;this.stack.pop()}break;case s.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;g=o.fromScriptNumBuffer(this.stack[this.stack.length-3],E),m=o.fromScriptNumBuffer(this.stack[this.stack.length-2],E);var T=o.fromScriptNumBuffer(this.stack[this.stack.length-1],E);I=m.cmp(g)<=0&&g.cmp(T)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(I?c["true"]:c["false"]);break;case s.OP_RIPEMD160:case s.OP_SHA1:case s.OP_SHA256:case s.OP_HASH160:case s.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;t=this.stack[this.stack.length-1];var C;P===s.OP_RIPEMD160?C=a.ripemd160(t):P===s.OP_SHA1?C=a.sha1(t):P===s.OP_SHA256?C=a.sha256(t):P===s.OP_HASH160?C=a.sha256ripemd160(t):P===s.OP_HASH256&&(C=a.sha256sha256(t)),this.stack.pop(),this.stack.push(C);break;case s.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case s.OP_CHECKSIG:case s.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;y=this.stack[this.stack.length-2],v=this.stack[this.stack.length-1],_=(new i).set({chunks:this.script.chunks.slice(this.pbegincodehash)});var N=(new i).add(y);if(_.findAndDelete(N),!this.checkSignatureEncoding(y)||!this.checkPubkeyEncoding(v))return!1;try{w=f.fromTxFormat(y),S=u.fromBuffer(v,!1),k=this.tx.verifySignature(w,S,this.nin,_)}catch(j){k=!1}if(this.stack.pop(),this.stack.pop(),this.stack.push(k?c["true"]:c["false"]),P===s.OP_CHECKSIGVERIFY){if(!k)return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;this.stack.pop()}break;case s.OP_CHECKMULTISIG:case s.OP_CHECKMULTISIGVERIFY:var U=1;if(this.stack.length<U)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var L=o.fromScriptNumBuffer(this.stack[this.stack.length-U],E).toNumber();if(0>L||L>20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=L,this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var D=++U;if(U+=L,this.stack.length<U)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var z=o.fromScriptNumBuffer(this.stack[this.stack.length-U],E).toNumber();if(0>z||z>L)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var F=++U;if(U+=z,this.stack.length<U)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;_=(new i).set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var K=0;z>K;K++)y=this.stack[this.stack.length-F-K],_.findAndDelete((new i).add(y));for(k=!0;k&&z>0;){if(y=this.stack[this.stack.length-F],v=this.stack[this.stack.length-D],!this.checkSignatureEncoding(y)||!this.checkPubkeyEncoding(v))return!1;var H;try{w=f.fromTxFormat(y),S=u.fromBuffer(v,!1),H=this.tx.verifySignature(w,S,this.nin,_)}catch(j){H=!1}H&&(F++,z--),D++,L--,z>L&&(k=!1)}for(;U-- >1;)this.stack.pop();if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&c.SCRIPT_VERIFY_NULLDUMMY&&this.stack[this.stack.length-1].length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(k?c["true"]:c["false"]),P===s.OP_CHECKMULTISIGVERIFY){if(!k)return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;this.stack.pop()}break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}}).call(this,t("buffer").Buffer)},{"../crypto/bn":6,"../crypto/hash":8,"../crypto/signature":11,"../opcode":23,"../publickey":25,"../transaction":29,"./script":28,buffer:48,lodash:297}],28:[function(t,e,r){(function(r){"use strict";var n=t("../address"),i=t("../encoding/bufferreader"),s=t("../encoding/bufferwriter"),o=t("../crypto/hash"),a=t("../opcode"),f=t("../publickey"),u=t("../crypto/signature"),c=t("../networks"),h=t("../util/preconditions"),d=t("lodash"),p=t("../errors"),l=t("buffer"),b=t("../util/buffer"),g=t("../util/js"),m=function y(t){return this instanceof y?(this.chunks=[],b.isBuffer(t)?y.fromBuffer(t):t instanceof n?y.fromAddress(t):t instanceof y?y.fromBuffer(t.toBuffer()):"string"==typeof t?y.fromString(t):void("undefined"!=typeof t&&this.set(t))):new y(t)};m.prototype.set=function(t){return this.chunks=t.chunks||this.chunks,this},m.fromBuffer=function(t){var e=new m;e.chunks=[];for(var r=new i(t);!r.finished();)try{var n,s,o=r.readUInt8();o>0&&o<a.OP_PUSHDATA1?(n=o,e.chunks.push({buf:r.read(n),len:n,opcodenum:o})):o===a.OP_PUSHDATA1?(n=r.readUInt8(),s=r.read(n),e.chunks.push({buf:s,len:n,opcodenum:o})):o===a.OP_PUSHDATA2?(n=r.readUInt16LE(),s=r.read(n),e.chunks.push({buf:s,len:n,opcodenum:o})):o===a.OP_PUSHDATA4?(n=r.readUInt32LE(),s=r.read(n),e.chunks.push({buf:s,len:n,opcodenum:o})):e.chunks.push({opcodenum:o})}catch(f){if(f instanceof RangeError)throw new p.Script.InvalidBuffer(t.toString("hex"));throw f}return e},m.prototype.toBuffer=function(){for(var t=new s,e=0;e<this.chunks.length;e++){var r=this.chunks[e],n=r.opcodenum;t.writeUInt8(r.opcodenum),r.buf&&(n<a.OP_PUSHDATA1?t.write(r.buf):n===a.OP_PUSHDATA1?(t.writeUInt8(r.len),t.write(r.buf)):n===a.OP_PUSHDATA2?(t.writeUInt16LE(r.len),t.write(r.buf)):n===a.OP_PUSHDATA4&&(t.writeUInt32LE(r.len),t.write(r.buf)))}return t.concat()},m.fromASM=function(t){var e=new m;e.chunks=[];for(var n=t.split(" "),i=0;i<n.length;){var s=n[i],o=a(s),f=o.toNumber();if(d.isUndefined(f)){var u=new r(n[i],"hex");e.chunks.push({buf:u,len:u.length,opcodenum:u.length}),i+=1}else f===a.OP_PUSHDATA1||f===a.OP_PUSHDATA2||f===a.OP_PUSHDATA4?(e.chunks.push({buf:new r(n[i+2],"hex"),len:parseInt(n[i+1]),opcodenum:f}),i+=3):(e.chunks.push({opcodenum:f}),i+=1)}return e},m.fromHex=function(t){return new m(new l.Buffer(t,"hex"))},m.fromString=function(t){if(g.isHexa(t)||0===t.length)return new m(new l.Buffer(t,"hex"));var e=new m;e.chunks=[];for(var n=t.split(" "),i=0;i<n.length;){var s=n[i],o=a(s),f=o.toNumber();if(d.isUndefined(f)){if(f=parseInt(s),!(f>0&&f<a.OP_PUSHDATA1))throw new Error("Invalid script: "+JSON.stringify(t));e.chunks.push({buf:new r(n[i+1].slice(2),"hex"),len:f,opcodenum:f}),i+=2}else if(f===a.OP_PUSHDATA1||f===a.OP_PUSHDATA2||f===a.OP_PUSHDATA4){if("0x"!==n[i+2].slice(0,2))throw new Error("Pushdata data must start with 0x");e.chunks.push({buf:new r(n[i+2].slice(2),"hex"),len:parseInt(n[i+1]),opcodenum:f}),i+=3}else e.chunks.push({opcodenum:f}),i+=1}return e},m.prototype._chunkToString=function(t,e){var r=t.opcodenum,n="asm"===e,i="";if(t.buf)(r===a.OP_PUSHDATA1||r===a.OP_PUSHDATA2||r===a.OP_PUSHDATA4)&&(i=i+" "+a(r).toString()),t.len>0&&(i=n?i+" "+t.buf.toString("hex"):i+" "+t.len+" 0x"+t.buf.toString("hex"));else if("undefined"!=typeof a.reverseMap[r])i=i+" "+a(r).toString();else{
var s=r.toString(16);s.length%2!==0&&(s="0"+s),i=n?i+" "+s:i+" 0x"+s}return i},m.prototype.toASM=function(){for(var t="",e=0;e<this.chunks.length;e++){var r=this.chunks[e];t+=this._chunkToString(r,"asm")}return t.substr(1)},m.prototype.toString=function(){for(var t="",e=0;e<this.chunks.length;e++){var r=this.chunks[e];t+=this._chunkToString(r)}return t.substr(1)},m.prototype.toHex=function(){return this.toBuffer().toString("hex")},m.prototype.inspect=function(){return"<Script: "+this.toString()+">"},m.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==a.OP_DUP||this.chunks[1].opcodenum!==a.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==a.OP_EQUALVERIFY||this.chunks[4].opcodenum!==a.OP_CHECKSIG)},m.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var t=this.chunks[0].buf,e=this.chunks[1].buf;if(t&&t.length&&48===t[0]&&e&&e.length){var r=e[0];if((4===r||6===r||7===r)&&65===e.length)return!0;if((3===r||2===r)&&33===e.length)return!0}}return!1},m.prototype.getPublicKey=function(){return h.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},m.prototype.getPublicKeyHash=function(){return h.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},m.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===a.OP_CHECKSIG){var t=this.chunks[0].buf,e=t[0],r=!1;if(4!==e&&6!==e&&7!==e||65!==t.length?3!==e&&2!==e||33!==t.length||(r=!0):r=!0,r)return f.isValid(t)}return!1},m.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var t=this.chunks[0].buf;if(t&&t.length&&48===t[0])return!0}return!1},m.prototype.isScriptHashOut=function(){var t=this.toBuffer();return 23===t.length&&t[0]===a.OP_HASH160&&20===t[1]&&t[t.length-1]===a.OP_EQUAL},m.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var t=this.chunks[this.chunks.length-1],e=t.buf;if(!e)return!1;var r;try{r=m.fromBuffer(e)}catch(n){if(n instanceof p.Script.InvalidBuffer)return!1;throw n}var i=r.classify();return i!==m.types.UNKNOWN},m.prototype.isMultisigOut=function(){return this.chunks.length>3&&a.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(t){return t.buf&&b.isBuffer(t.buf)})&&a.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===a.OP_CHECKMULTISIG},m.prototype.isMultisigIn=function(){return this.chunks.length>=2&&0===this.chunks[0].opcodenum&&this.chunks.slice(1,this.chunks.length).every(function(t){return t.buf&&b.isBuffer(t.buf)&&u.isTxDER(t.buf)})},m.prototype.isDataOut=function(){return this.chunks.length>=1&&this.chunks[0].opcodenum===a.OP_RETURN&&(1===this.chunks.length||2===this.chunks.length&&this.chunks[1].buf&&this.chunks[1].buf.length<=m.OP_RETURN_STANDARD_SIZE&&this.chunks[1].length===this.chunks.len)},m.prototype.getData=function(){if(this.isDataOut()||this.isScriptHashOut())return new r(d.isUndefined(this.chunks[1])?0:this.chunks[1].buf);if(this.isPublicKeyHashOut())return new r(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")},m.prototype.isPushOnly=function(){return d.every(this.chunks,function(t){return t.opcodenum<=a.OP_16})},m.types={},m.types.UNKNOWN="Unknown",m.types.PUBKEY_OUT="Pay to public key",m.types.PUBKEY_IN="Spend from public key",m.types.PUBKEYHASH_OUT="Pay to public key hash",m.types.PUBKEYHASH_IN="Spend from public key hash",m.types.SCRIPTHASH_OUT="Pay to script hash",m.types.SCRIPTHASH_IN="Spend from script hash",m.types.MULTISIG_OUT="Pay to multisig",m.types.MULTISIG_IN="Spend from multisig",m.types.DATA_OUT="Data push",m.OP_RETURN_STANDARD_SIZE=80,m.identifiers={},m.identifiers.PUBKEY_OUT=m.prototype.isPublicKeyOut,m.identifiers.PUBKEY_IN=m.prototype.isPublicKeyIn,m.identifiers.PUBKEYHASH_OUT=m.prototype.isPublicKeyHashOut,m.identifiers.PUBKEYHASH_IN=m.prototype.isPublicKeyHashIn,m.identifiers.MULTISIG_OUT=m.prototype.isMultisigOut,m.identifiers.MULTISIG_IN=m.prototype.isMultisigIn,m.identifiers.SCRIPTHASH_OUT=m.prototype.isScriptHashOut,m.identifiers.SCRIPTHASH_IN=m.prototype.isScriptHashIn,m.identifiers.DATA_OUT=m.prototype.isDataOut,m.prototype.classify=function(){for(var t in m.identifiers)if(m.identifiers[t].bind(this)())return m.types[t];return m.types.UNKNOWN},m.prototype.isStandard=function(){return this.classify()!==m.types.UNKNOWN},m.prototype.prepend=function(t){return this._addByType(t,!0),this},m.prototype.equals=function(t){if(h.checkState(t instanceof m,"Must provide another script"),this.chunks.length!==t.chunks.length)return!1;var e;for(e=0;e<this.chunks.length;e++){if(b.isBuffer(this.chunks[e].buf)&&!b.isBuffer(t.chunks[e].buf))return!1;if(b.isBuffer(this.chunks[e].buf)&&!b.equals(this.chunks[e].buf,t.chunks[e].buf))return!1;if(this.chunks[e].opcodenum!==t.chunks[e].opcodenum)return!1}return!0},m.prototype.add=function(t){return this._addByType(t,!1),this},m.prototype._addByType=function(t,e){if("string"==typeof t)this._addOpcode(t,e);else if("number"==typeof t)this._addOpcode(t,e);else if(t instanceof a)this._addOpcode(t,e);else if(b.isBuffer(t))this._addBuffer(t,e);else if(t instanceof m)this.chunks=this.chunks.concat(t.chunks);else{if("object"!=typeof t)throw new Error("Invalid script chunk");this._insertAtPosition(t,e)}},m.prototype._insertAtPosition=function(t,e){e?this.chunks.unshift(t):this.chunks.push(t)},m.prototype._addOpcode=function(t,e){var r;return r="number"==typeof t?t:t instanceof a?t.toNumber():a(t).toNumber(),this._insertAtPosition({opcodenum:r},e),this},m.prototype._addBuffer=function(t,e){var r,n=t.length;if(n>=0&&n<a.OP_PUSHDATA1)r=n;else if(n<Math.pow(2,8))r=a.OP_PUSHDATA1;else if(n<Math.pow(2,16))r=a.OP_PUSHDATA2;else{if(!(n<Math.pow(2,32)))throw new Error("You can't push that much data");r=a.OP_PUSHDATA4}return this._insertAtPosition({buf:t,len:n,opcodenum:r},e),this},m.prototype.removeCodeseparators=function(){for(var t=[],e=0;e<this.chunks.length;e++)this.chunks[e].opcodenum!==a.OP_CODESEPARATOR&&t.push(this.chunks[e]);return this.chunks=t,this},m.buildMultisigOut=function(t,e,r){h.checkArgument(e<=t.length,"Number of required signatures must be less than or equal to the number of public keys"),r=r||{};var n=new m;n.add(a.smallInt(e)),t=d.map(t,f);var i=t;r.noSorting||(i=d.sortBy(t,function(t){return t.toString("hex")}));for(var s=0;s<i.length;s++){var o=i[s];n.add(o.toBuffer())}return n.add(a.smallInt(t.length)),n.add(a.OP_CHECKMULTISIG),n},m.buildMultisigIn=function(t,e,r,n){h.checkArgument(d.isArray(t)),h.checkArgument(d.isNumber(e)),h.checkArgument(d.isArray(r)),n=n||{};var i=new m;return i.add(a.OP_0),d.each(r,function(t){h.checkArgument(b.isBuffer(t),"Signatures must be an array of Buffers"),i.add(t)}),i},m.buildP2SHMultisigIn=function(t,e,r,n){h.checkArgument(d.isArray(t)),h.checkArgument(d.isNumber(e)),h.checkArgument(d.isArray(r)),n=n||{};var i=new m;return i.add(a.OP_0),d.each(r,function(t){h.checkArgument(b.isBuffer(t),"Signatures must be an array of Buffers"),i.add(t)}),i.add((n.cachedMultisig||m.buildMultisigOut(t,e,n)).toBuffer()),i},m.buildPublicKeyHashOut=function(t){h.checkArgument(!d.isUndefined(t)),h.checkArgument(t instanceof f||t instanceof n||d.isString(t)),t instanceof f?t=t.toAddress():d.isString(t)&&(t=new n(t));var e=new m;return e.add(a.OP_DUP).add(a.OP_HASH160).add(t.hashBuffer).add(a.OP_EQUALVERIFY).add(a.OP_CHECKSIG),e._network=t.network,e},m.buildPublicKeyOut=function(t){h.checkArgument(t instanceof f);var e=new m;return e.add(t.toBuffer()).add(a.OP_CHECKSIG),e},m.buildDataOut=function(t,e){h.checkArgument(d.isUndefined(t)||d.isString(t)||b.isBuffer(t)),d.isString(t)&&(t=new r(t,e));var n=new m;return n.add(a.OP_RETURN),d.isUndefined(t)||n.add(t),n},m.buildScriptHashOut=function(t){h.checkArgument(t instanceof m||t instanceof n&&t.isPayToScriptHash());var e=new m;return e.add(a.OP_HASH160).add(t instanceof n?t.hashBuffer:o.sha256ripemd160(t.toBuffer())).add(a.OP_EQUAL),e._network=t._network||t.network,e},m.buildPublicKeyIn=function(t,e){h.checkArgument(t instanceof u||b.isBuffer(t)),h.checkArgument(d.isUndefined(e)||d.isNumber(e)),t instanceof u&&(t=t.toBuffer());var r=new m;return r.add(b.concat([t,b.integerAsSingleByteBuffer(e||u.SIGHASH_ALL)])),r},m.buildPublicKeyHashIn=function(t,e,r){h.checkArgument(e instanceof u||b.isBuffer(e)),h.checkArgument(d.isUndefined(r)||d.isNumber(r)),e instanceof u&&(e=e.toBuffer());var n=(new m).add(b.concat([e,b.integerAsSingleByteBuffer(r||u.SIGHASH_ALL)])).add(new f(t).toBuffer());return n},m.empty=function(){return new m},m.prototype.toScriptHashOut=function(){return m.buildScriptHashOut(this)},m.fromAddress=function(t){if(t=n(t),t.isPayToScriptHash())return m.buildScriptHashOut(t);if(t.isPayToPublicKeyHash())return m.buildPublicKeyHashOut(t);throw new p.Script.UnrecognizedAddress(t)},m.prototype.getAddressInfo=function(t){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var e=this._getOutputAddressInfo();return e?e:this._getInputAddressInfo()},m.prototype._getOutputAddressInfo=function(){var t={};if(this.isScriptHashOut())t.hashBuffer=this.getData(),t.type=n.PayToScriptHash;else{if(!this.isPublicKeyHashOut())return!1;t.hashBuffer=this.getData(),t.type=n.PayToPublicKeyHash}return t},m.prototype._getInputAddressInfo=function(){var t={};if(this.isPublicKeyHashIn())t.hashBuffer=o.sha256ripemd160(this.chunks[1].buf),t.type=n.PayToPublicKeyHash;else{if(!this.isScriptHashIn())return!1;t.hashBuffer=o.sha256ripemd160(this.chunks[this.chunks.length-1].buf),t.type=n.PayToScriptHash}return t},m.prototype.toAddress=function(t){var e=this.getAddressInfo();return e?(e.network=c.get(t)||this._network||c.defaultNetwork,new n(e)):!1},m.prototype.findAndDelete=function(t){for(var e=t.toBuffer(),r=e.toString("hex"),n=0;n<this.chunks.length;n++){var i=m({chunks:[this.chunks[n]]}),s=i.toBuffer(),o=s.toString("hex");r===o&&this.chunks.splice(n,1)}return this},m.prototype.checkMinimalPush=function(t){var e=this.chunks[t],r=e.buf,n=e.opcodenum;return r?0===r.length?n===a.OP_0:1===r.length&&r[0]>=1&&r[0]<=16?n===a.OP_1+(r[0]-1):1===r.length&&129===r[0]?n===a.OP_1NEGATE:r.length<=75?n===r.length:r.length<=255?n===a.OP_PUSHDATA1:r.length<=65535?n===a.OP_PUSHDATA2:!0:!0},m.prototype._decodeOP_N=function(t){if(t===a.OP_0)return 0;if(t>=a.OP_1&&t<=a.OP_16)return t-(a.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(t))},m.prototype.getSignatureOperationsCount=function(t){t=d.isUndefined(t)?!0:t;var e=this,r=0,n=a.OP_INVALIDOPCODE;return d.each(e.chunks,function(i){var s=i.opcodenum;s==a.OP_CHECKSIG||s==a.OP_CHECKSIGVERIFY?r++:(s==a.OP_CHECKMULTISIG||s==a.OP_CHECKMULTISIGVERIFY)&&(r+=t&&n>=a.OP_1&&n<=a.OP_16?e._decodeOP_N(n):20),n=s}),r},e.exports=m}).call(this,t("buffer").Buffer)},{"../address":1,"../crypto/hash":8,"../crypto/signature":11,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../errors":17,"../networks":22,"../opcode":23,"../publickey":25,"../util/buffer":43,"../util/js":44,"../util/preconditions":45,buffer:48,lodash:297}],29:[function(t,e,r){e.exports=t("./transaction"),e.exports.Input=t("./input"),e.exports.Output=t("./output"),e.exports.UnspentOutput=t("./unspentoutput"),e.exports.Signature=t("./signature"),e.exports.Sighash=t("./sighash")},{"./input":30,"./output":36,"./sighash":37,"./signature":38,"./transaction":39,"./unspentoutput":40}],30:[function(t,e,r){e.exports=t("./input"),e.exports.PublicKey=t("./publickey"),e.exports.PublicKeyHash=t("./publickeyhash"),e.exports.MultiSig=t("./multisig.js"),e.exports.MultiSigScriptHash=t("./multisigscripthash.js")},{"./input":31,"./multisig.js":32,"./multisigscripthash.js":33,"./publickey":34,"./publickeyhash":35}],31:[function(t,e,r){"use strict";function n(t){return this instanceof n?t?this._fromObject(t):void 0:new n(t)}var i=t("lodash"),s=t("../../util/preconditions"),o=t("../../errors"),a=t("../../encoding/bufferwriter"),f=t("buffer"),u=t("../../util/buffer"),c=t("../../util/js"),h=t("../../script"),d=t("../sighash"),p=t("../output"),l=4294967295,b=0;n.DEFAULT_SEQNUMBER=l,n.DEFAULT_LOCKTIME_SEQNUMBER=b,Object.defineProperty(n.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new h(this._scriptBuffer),this._script._isInput=!0),this._script)}}),n.fromObject=function(t){s.checkArgument(i.isObject(t));var e=new n;return e._fromObject(t)},n.prototype._fromObject=function(t){var e;if(e=i.isString(t.prevTxId)&&c.isHexa(t.prevTxId)?new f.Buffer(t.prevTxId,"hex"):t.prevTxId,this.output=t.output?t.output instanceof p?t.output:new p(t.output):void 0,this.prevTxId=e||t.txidbuf,this.outputIndex=i.isUndefined(t.outputIndex)?t.txoutnum:t.outputIndex,this.sequenceNumber=i.isUndefined(t.sequenceNumber)?i.isUndefined(t.seqnum)?l:t.seqnum:t.sequenceNumber,i.isUndefined(t.script)&&i.isUndefined(t.scriptBuffer))throw new o.Transaction.Input.MissingScript;return this.setScript(t.scriptBuffer||t.script),this},n.prototype.toObject=n.prototype.toJSON=function(){var t={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(t.scriptString=this.script.toString()),this.output&&(t.output=this.output.toObject()),t},n.fromBufferReader=function(t){var e=new n;return e.prevTxId=t.readReverse(32),e.outputIndex=t.readUInt32LE(),e._scriptBuffer=t.readVarLengthBuffer(),e.sequenceNumber=t.readUInt32LE(),e},n.prototype.toBufferWriter=function(t){t||(t=new a),t.writeReverse(this.prevTxId),t.writeUInt32LE(this.outputIndex);var e=this._scriptBuffer;return t.writeVarintNum(e.length),t.write(e),t.writeUInt32LE(this.sequenceNumber),t},n.prototype.setScript=function(t){if(this._script=null,t instanceof h)this._script=t,this._script._isInput=!0,this._scriptBuffer=t.toBuffer();else if(c.isHexa(t))this._scriptBuffer=new f.Buffer(t,"hex");else if(i.isString(t))this._script=new h(t),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!u.isBuffer(t))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new f.Buffer(t)}return this},n.prototype.getSignatures=function(){throw new o.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},n.prototype.isFullySigned=function(){throw new o.AbstractMethodInvoked("Input#isFullySigned")},n.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},n.prototype.addSignature=function(){throw new o.AbstractMethodInvoked("Input#addSignature")},n.prototype.clearSignatures=function(){throw new o.AbstractMethodInvoked("Input#clearSignatures")},n.prototype.isValidSignature=function(t,e){return e.signature.nhashtype=e.sigtype,d.verify(t,e.signature,e.publicKey,e.inputIndex,this.output.script)},n.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},n.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},e.exports=n},{"../../encoding/bufferwriter":15,"../../errors":17,"../../script":26,"../../util/buffer":43,"../../util/js":44,"../../util/preconditions":45,"../output":36,"../sighash":37,buffer:48,lodash:297}],32:[function(t,e,r){"use strict";function n(t,e,r,n){o.apply(this,arguments);var s=this;e=e||t.publicKeys,r=r||t.threshold,n=n||t.signatures,this.publicKeys=i.sortBy(e,function(t){return t.toString("hex")}),f.checkState(u.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},i.each(this.publicKeys,function(t,e){s.publicKeyIndex[t.toString()]=e}),this.threshold=r,this.signatures=n?this._deserializeSignatures(n):new Array(this.publicKeys.length)}var i=t("lodash"),s=t("inherits"),o=(t("../transaction"),t("./input")),a=t("../output"),f=t("../../util/preconditions"),u=t("../../script"),c=t("../../crypto/signature"),h=t("../sighash"),d=(t("../../publickey"),t("../../util/buffer")),p=t("../signature");s(n,o),n.prototype.toObject=function(){var t=o.prototype.toObject.apply(this,arguments);return t.threshold=this.threshold,t.publicKeys=i.map(this.publicKeys,function(t){return t.toString()}),t.signatures=this._serializeSignatures(),t},n.prototype._deserializeSignatures=function(t){return i.map(t,function(t){return t?new p(t):void 0})},n.prototype._serializeSignatures=function(){return i.map(this.signatures,function(t){return t?t.toObject():void 0})},n.prototype.getSignatures=function(t,e,r,n){f.checkState(this.output instanceof a),n=n||c.SIGHASH_ALL;var s=this,o=[];return i.each(this.publicKeys,function(i){i.toString()===e.publicKey.toString()&&o.push(new p({publicKey:e.publicKey,prevTxId:s.prevTxId,outputIndex:s.outputIndex,inputIndex:r,signature:h.sign(t,e,n,r,s.output.script),sigtype:n}))}),o},n.prototype.addSignature=function(t,e){return f.checkState(!this.isFullySigned(),"All needed signatures have already been added"),f.checkArgument(!i.isUndefined(this.publicKeyIndex[e.publicKey.toString()]),"Signature has no matching public key"),f.checkState(this.isValidSignature(t,e)),this.signatures[this.publicKeyIndex[e.publicKey.toString()]]=e,this._updateScript(),this},n.prototype._updateScript=function(){return this.setScript(u.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},n.prototype._createSignatures=function(){return i.map(i.filter(this.signatures,function(t){return!i.isUndefined(t)}),function(t){return d.concat([t.signature.toDER(),d.integerAsSingleByteBuffer(t.sigtype)])})},n.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},n.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},n.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},n.prototype.countSignatures=function(){return i.reduce(this.signatures,function(t,e){return t+!!e},0)},n.prototype.publicKeysWithoutSignature=function(){var t=this;return i.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},n.prototype.isValidSignature=function(t,e){return e.signature.nhashtype=e.sigtype,h.verify(t,e.signature,e.publicKey,e.inputIndex,this.output.script)},n.normalizeSignatures=function(t,e,r,n,i){return i.map(function(i){var s=null;return n=n.filter(function(n){if(s)return!0;var o=new p({signature:c.fromTxFormat(n),publicKey:i,prevTxId:e.prevTxId,outputIndex:e.outputIndex,inputIndex:r,sigtype:c.SIGHASH_ALL});o.signature.nhashtype=o.sigtype;var a=h.verify(t,o.signature,o.publicKey,o.inputIndex,e.output.script);return a?(s=o,!1):!0}),s?s:null})},n.OPCODES_SIZE=1,n.SIGNATURE_SIZE=73,n.prototype._estimateSize=function(){return n.OPCODES_SIZE+this.threshold*n.SIGNATURE_SIZE},e.exports=n},{"../../crypto/signature":11,"../../publickey":25,"../../script":26,"../../util/buffer":43,"../../util/preconditions":45,"../output":36,"../sighash":37,"../signature":38,"../transaction":39,"./input":31,inherits:296,lodash:297}],33:[function(t,e,r){"use strict";function n(t,e,r,n){o.apply(this,arguments);var s=this;e=e||t.publicKeys,r=r||t.threshold,n=n||t.signatures,this.publicKeys=i.sortBy(e,function(t){return t.toString("hex")}),this.redeemScript=u.buildMultisigOut(this.publicKeys,r),f.checkState(u.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},i.each(this.publicKeys,function(t,e){s.publicKeyIndex[t.toString()]=e}),this.threshold=r,this.signatures=n?this._deserializeSignatures(n):new Array(this.publicKeys.length)}var i=t("lodash"),s=t("inherits"),o=t("./input"),a=t("../output"),f=t("../../util/preconditions"),u=t("../../script"),c=t("../../crypto/signature"),h=t("../sighash"),d=(t("../../publickey"),t("../../util/buffer")),p=t("../signature");s(n,o),n.prototype.toObject=function(){var t=o.prototype.toObject.apply(this,arguments);return t.threshold=this.threshold,t.publicKeys=i.map(this.publicKeys,function(t){return t.toString()}),t.signatures=this._serializeSignatures(),t},n.prototype._deserializeSignatures=function(t){return i.map(t,function(t){return t?new p(t):void 0})},n.prototype._serializeSignatures=function(){return i.map(this.signatures,function(t){return t?t.toObject():void 0})},n.prototype.getSignatures=function(t,e,r,n){f.checkState(this.output instanceof a),n=n||c.SIGHASH_ALL;var s=this,o=[];return i.each(this.publicKeys,function(i){i.toString()===e.publicKey.toString()&&o.push(new p({publicKey:e.publicKey,prevTxId:s.prevTxId,outputIndex:s.outputIndex,inputIndex:r,signature:h.sign(t,e,n,r,s.redeemScript),sigtype:n}))}),o},n.prototype.addSignature=function(t,e){return f.checkState(!this.isFullySigned(),"All needed signatures have already been added"),f.checkArgument(!i.isUndefined(this.publicKeyIndex[e.publicKey.toString()]),"Signature has no matching public key"),f.checkState(this.isValidSignature(t,e)),this.signatures[this.publicKeyIndex[e.publicKey.toString()]]=e,this._updateScript(),this},n.prototype._updateScript=function(){return this.setScript(u.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},n.prototype._createSignatures=function(){return i.map(i.filter(this.signatures,function(t){return!i.isUndefined(t)}),function(t){return d.concat([t.signature.toDER(),d.integerAsSingleByteBuffer(t.sigtype)])})},n.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},n.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},n.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},n.prototype.countSignatures=function(){return i.reduce(this.signatures,function(t,e){return t+!!e},0)},n.prototype.publicKeysWithoutSignature=function(){var t=this;return i.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},n.prototype.isValidSignature=function(t,e){return e.signature.nhashtype=e.sigtype,h.verify(t,e.signature,e.publicKey,e.inputIndex,this.redeemScript)},n.OPCODES_SIZE=7,n.SIGNATURE_SIZE=74,n.PUBKEY_SIZE=34,n.prototype._estimateSize=function(){return n.OPCODES_SIZE+this.threshold*n.SIGNATURE_SIZE+this.publicKeys.length*n.PUBKEY_SIZE},e.exports=n},{"../../crypto/signature":11,"../../publickey":25,"../../script":26,"../../util/buffer":43,"../../util/preconditions":45,"../output":36,"../sighash":37,"../signature":38,"./input":31,inherits:296,lodash:297}],34:[function(t,e,r){"use strict";function n(){o.apply(this,arguments)}var i=t("inherits"),s=t("../../util/preconditions"),o=(t("../../util/buffer"),t("./input")),a=t("../output"),f=t("../sighash"),u=t("../../script"),c=t("../../crypto/signature"),h=t("../signature");i(n,o),n.prototype.getSignatures=function(t,e,r,n){s.checkState(this.output instanceof a),n=n||c.SIGHASH_ALL;var i=e.toPublicKey();return i.toString()===this.output.script.getPublicKey().toString("hex")?[new h({publicKey:i,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:f.sign(t,e,n,r,this.output.script),sigtype:n})]:[]},n.prototype.addSignature=function(t,e){return s.checkState(this.isValidSignature(t,e),"Signature is invalid"),this.setScript(u.buildPublicKeyIn(e.signature.toDER(),e.sigtype)),this},n.prototype.clearSignatures=function(){return this.setScript(u.empty()),this},n.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},n.SCRIPT_MAX_SIZE=73,n.prototype._estimateSize=function(){return n.SCRIPT_MAX_SIZE},e.exports=n},{"../../crypto/signature":11,"../../script":26,"../../util/buffer":43,"../../util/preconditions":45,"../output":36,"../sighash":37,"../signature":38,"./input":31,inherits:296}],35:[function(t,e,r){"use strict";function n(){f.apply(this,arguments)}var i=t("inherits"),s=t("../../util/preconditions"),o=t("../../util/buffer"),a=t("../../crypto/hash"),f=t("./input"),u=t("../output"),c=t("../sighash"),h=t("../../script"),d=t("../../crypto/signature"),p=t("../signature");i(n,f),n.prototype.getSignatures=function(t,e,r,n,i){return s.checkState(this.output instanceof u),i=i||a.sha256ripemd160(e.publicKey.toBuffer()),n=n||d.SIGHASH_ALL,o.equals(i,this.output.script.getPublicKeyHash())?[new p({publicKey:e.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:c.sign(t,e,n,r,this.output.script),sigtype:n})]:[]},n.prototype.addSignature=function(t,e){return s.checkState(this.isValidSignature(t,e),"Signature is invalid"),this.setScript(h.buildPublicKeyHashIn(e.publicKey,e.signature.toDER(),e.sigtype)),this},n.prototype.clearSignatures=function(){return this.setScript(h.empty()),this},n.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},n.SCRIPT_MAX_SIZE=107,n.prototype._estimateSize=function(){return n.SCRIPT_MAX_SIZE},e.exports=n},{"../../crypto/hash":8,"../../crypto/signature":11,"../../script":26,"../../util/buffer":43,"../../util/preconditions":45,"../output":36,"../sighash":37,"../signature":38,"./input":31,inherits:296}],36:[function(t,e,r){"use strict";function n(t){if(!(this instanceof n))return new n(t);if(!i.isObject(t))throw new TypeError("Unrecognized argument for Output");if(this.satoshis=t.satoshis,a.isBuffer(t.script))this._scriptBuffer=t.script;else{var e;e=i.isString(t.script)&&f.isHexa(t.script)?new o.Buffer(t.script,"hex"):t.script,this.setScript(e)}}var i=t("lodash"),s=t("../crypto/bn"),o=t("buffer"),a=t("../util/buffer"),f=t("../util/js"),u=t("../encoding/bufferwriter"),c=t("../script"),h=t("../util/preconditions"),d=t("../errors"),p=9007199254740991;Object.defineProperty(n.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script?this._script:(this.setScriptFromBuffer(this._scriptBuffer),this._script)}}),Object.defineProperty(n.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(t){t instanceof s?(this._satoshisBN=t,this._satoshis=t.toNumber()):i.isString(t)?(this._satoshis=parseInt(t),this._satoshisBN=s.fromNumber(this._satoshis)):(h.checkArgument(f.isNaturalNumber(t),"Output satoshis is not a natural number"),this._satoshisBN=s.fromNumber(t),this._satoshis=t),h.checkState(f.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),n.prototype.invalidSatoshis=function(){return this._satoshis>p?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0?"transaction txout negative":!1},n.prototype.toObject=n.prototype.toJSON=function(){var t={satoshis:this.satoshis};return t.script=this._scriptBuffer.toString("hex"),t},n.fromObject=function(t){return new n(t)},n.prototype.setScriptFromBuffer=function(t){this._scriptBuffer=t;try{this._script=c.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(e){if(!(e instanceof d.Script.InvalidBuffer))throw e;this._script=null}},n.prototype.setScript=function(t){if(t instanceof c)this._scriptBuffer=t.toBuffer(),this._script=t,this._script._isOutput=!0;else if(i.isString(t))this._script=c.fromString(t),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else{if(!a.isBuffer(t))throw new TypeError("Invalid argument type: script");this.setScriptFromBuffer(t)}return this},n.prototype.inspect=function(){var t;return t=this.script?this.script.inspect():this._scriptBuffer.toString("hex"),"<Output ("+this.satoshis+" sats) "+t+">"},n.fromBufferReader=function(t){var e={};e.satoshis=t.readUInt64LEBN();var r=t.readVarintNum();return 0!==r?e.script=t.read(r):e.script=new o.Buffer([]),new n(e)},n.prototype.toBufferWriter=function(t){t||(t=new u),t.writeUInt64LEBN(this._satoshisBN);var e=this._scriptBuffer;return t.writeVarintNum(e.length),t.write(e),t},e.exports=n},{"../crypto/bn":6,"../encoding/bufferwriter":15,"../errors":17,"../script":26,"../util/buffer":43,"../util/js":44,"../util/preconditions":45,buffer:48,lodash:297}],37:[function(t,e,r){(function(r){"use strict";function n(t,e,r,n,i){var s=y(t,r,n,i),o=p.sign(s,e,"little").set({nhashtype:r});return o}function i(t,e,r,n,i){l.checkArgument(!b.isUndefined(t)),l.checkArgument(!b.isUndefined(e)&&!b.isUndefined(e.nhashtype));var s=y(t,e.nhashtype,n,i);return p.verify(s,e,r,"little")}var s=t("buffer"),o=t("../crypto/signature"),a=t("../script"),f=t("./output"),u=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),h=t("../crypto/bn"),d=t("../crypto/hash"),p=t("../crypto/ecdsa"),l=t("../util/preconditions"),b=t("lodash"),g="0000000000000000000000000000000000000000000000000000000000000001",m="ffffffffffffffff",y=function(e,n,i,p){var l,b=t("./transaction"),y=t("./input"),v=b.shallowCopy(e);for(p=new a(p),p.removeCodeseparators(),l=0;l<v.inputs.length;l++)v.inputs[l]=new y(v.inputs[l]).setScript(a.empty());if(v.inputs[i]=new y(v.inputs[i]).setScript(p),(31&n)===o.SIGHASH_NONE||(31&n)===o.SIGHASH_SINGLE)for(l=0;l<v.inputs.length;l++)l!==i&&(v.inputs[l].sequenceNumber=0);if((31&n)===o.SIGHASH_NONE)v.outputs=[];else if((31&n)===o.SIGHASH_SINGLE){if(i>=v.outputs.length)return new r(g,"hex");for(v.outputs.length=i+1,l=0;i>l;l++)v.outputs[l]=new f({satoshis:h.fromBuffer(new s.Buffer(m,"hex")),script:a.empty()})}n&o.SIGHASH_ANYONECANPAY&&(v.inputs=[v.inputs[i]]);var _=(new c).write(v.toBuffer()).writeInt32LE(n).toBuffer(),w=d.sha256sha256(_);return w=new u(w).readReverse()};e.exports={sighash:y,sign:n,verify:i}}).call(this,t("buffer").Buffer)},{"../crypto/bn":6,"../crypto/ecdsa":7,"../crypto/hash":8,"../crypto/signature":11,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../script":26,"../util/preconditions":45,"./input":30,"./output":36,"./transaction":39,buffer:48,lodash:297}],38:[function(t,e,r){(function(r){"use strict";function n(t){if(!(this instanceof n))return new n(t);if(t instanceof n)return t;if(i.isObject(t))return this._fromObject(t);throw new c.InvalidArgument("TransactionSignatures must be instantiated from an object")}var i=t("lodash"),s=t("../util/preconditions"),o=t("inherits"),a=t("../util/buffer"),f=t("../util/js"),u=t("../publickey"),c=t("../errors"),h=t("../crypto/signature");o(n,h),n.prototype._fromObject=function(t){return this._checkObjectArgs(t),this.publicKey=new u(t.publicKey),this.prevTxId=a.isBuffer(t.prevTxId)?t.prevTxId:new r(t.prevTxId,"hex"),this.outputIndex=t.outputIndex,this.inputIndex=t.inputIndex,this.signature=t.signature instanceof h?t.signature:a.isBuffer(t.signature)?h.fromBuffer(t.signature):h.fromString(t.signature),this.sigtype=t.sigtype,this},n.prototype._checkObjectArgs=function(t){s.checkArgument(u(t.publicKey),"publicKey"),s.checkArgument(!i.isUndefined(t.inputIndex),"inputIndex"),s.checkArgument(!i.isUndefined(t.outputIndex),"outputIndex"),s.checkState(i.isNumber(t.inputIndex),"inputIndex must be a number"),s.checkState(i.isNumber(t.outputIndex),"outputIndex must be a number"),s.checkArgument(t.signature,"signature"),s.checkArgument(t.prevTxId,"prevTxId"),s.checkState(t.signature instanceof h||a.isBuffer(t.signature)||f.isHexa(t.signature),"signature must be a buffer or hexa value"),s.checkState(a.isBuffer(t.prevTxId)||f.isHexa(t.prevTxId),"prevTxId must be a buffer or hexa value"),s.checkArgument(t.sigtype,"sigtype"),s.checkState(i.isNumber(t.sigtype),"sigtype must be a number")},n.prototype.toObject=n.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}},n.fromObject=function(t){return s.checkArgument(t),new n(t)},e.exports=n}).call(this,t("buffer").Buffer)},{"../crypto/signature":11,"../errors":17,
"../publickey":25,"../util/buffer":43,"../util/js":44,"../util/preconditions":45,buffer:48,inherits:296,lodash:297}],39:[function(t,e,r){(function(r){"use strict";function n(t){if(!(this instanceof n))return new n(t);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,t){if(t instanceof n)return n.shallowCopy(t);if(c.isHexa(t))this.fromString(t);else if(u.isBuffer(t))this.fromBuffer(t);else{if(!i.isObject(t))throw new f.InvalidArgument("Must provide an object or string to deserialize a transaction");this.fromObject(t)}}else this._newTransaction()}var i=t("lodash"),s=t("../util/preconditions"),o=t("buffer"),a=r.compare||t("buffer-compare"),f=t("../errors"),u=t("../util/buffer"),c=t("../util/js"),h=t("../encoding/bufferreader"),d=t("../encoding/bufferwriter"),p=t("../crypto/hash"),l=t("../crypto/signature"),b=t("./sighash"),g=t("../address"),m=t("./unspentoutput"),y=t("./input"),v=y.PublicKeyHash,_=y.PublicKey,w=y.MultiSigScriptHash,S=y.MultiSig,I=t("./output"),k=t("../script"),E=t("../privatekey"),A=t("../crypto/bn"),x=1,P=0,O=1e6;n.DUST_AMOUNT=546,n.FEE_SECURITY_MARGIN=15,n.MAX_MONEY=21e14,n.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8,n.NLOCKTIME_MAX_VALUE=4294967295,n.FEE_PER_KB=1e4,n.CHANGE_OUTPUT_MAX_SIZE=62,n.MAXIMUM_EXTRA_SIZE=26,n.shallowCopy=function(t){var e=new n(t.toBuffer());return e};var B={configurable:!1,enumerable:!0,get:function(){return new h(this._getHash()).readReverse().toString("hex")}};Object.defineProperty(n.prototype,"hash",B),Object.defineProperty(n.prototype,"id",B);var M={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(n.prototype,"inputAmount",M),M.get=function(){return this._getOutputAmount()},Object.defineProperty(n.prototype,"outputAmount",M),n.prototype._getHash=function(){return p.sha256sha256(this.toBuffer())},n.prototype.serialize=function(t){return!0===t||t&&t.disableAll?this.uncheckedSerialize():this.checkedSerialize(t)},n.prototype.uncheckedSerialize=n.prototype.toString=function(){return this.toBuffer().toString("hex")},n.prototype.checkedSerialize=function(t){var e=this.getSerializationError(t);if(e)throw e.message+=" Use Transaction#uncheckedSerialize if you want to skip security checks. See http://bitcore.io/guide/transaction.html#Serialization for more info.",e;return this.uncheckedSerialize()},n.prototype.invalidSatoshis=function(){for(var t=!1,e=0;e<this.outputs.length;e++)this.outputs[e].invalidSatoshis()&&(t=!0);return t},n.prototype.getSerializationError=function(t){if(t=t||{},this.invalidSatoshis())return new f.Transaction.InvalidSatoshis;var e,r=this._getUnspentValue();return 0>r?t.disableMoreOutputThanInput||(e=new f.Transaction.InvalidOutputAmountSum):e=this._hasFeeError(t,r),e||this._hasDustOutputs(t)||this._isMissingSignatures(t)},n.prototype._hasFeeError=function(t,e){if(!i.isUndefined(this._fee)&&this._fee!==e)return new f.Transaction.FeeError.Different("Unspent value is "+e+" but specified fee is "+this._fee);if(!t.disableLargeFees){var r=Math.floor(n.FEE_SECURITY_MARGIN*this._estimateFee());if(e>r)return this._missingChange()?new f.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new f.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+e)}if(!t.disableSmallFees){var s=Math.ceil(this._estimateFee()/n.FEE_SECURITY_MARGIN);if(s>e)return new f.Transaction.FeeError.TooSmall("expected more than "+s+" but got "+e)}},n.prototype._missingChange=function(){return!this._changeScript},n.prototype._hasDustOutputs=function(t){if(!t.disableDustOutputs){var e,r;for(e in this.outputs)if(r=this.outputs[e],r.satoshis<n.DUST_AMOUNT&&!r.script.isDataOut())return new f.Transaction.DustOutputs}},n.prototype._isMissingSignatures=function(t){return t.disableIsFullySigned?void 0:this.isFullySigned()?void 0:new f.Transaction.MissingSignatures},n.prototype.inspect=function(){return"<Transaction: "+this.uncheckedSerialize()+">"},n.prototype.toBuffer=function(){var t=new d;return this.toBufferWriter(t).toBuffer()},n.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),i.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),i.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},n.prototype.fromBuffer=function(t){var e=new h(t);return this.fromBufferReader(e)},n.prototype.fromBufferReader=function(t){s.checkArgument(!t.finished(),"No transaction data received");var e,r,n;for(this.version=t.readUInt32LE(),r=t.readVarintNum(),e=0;r>e;e++){var i=y.fromBufferReader(t);this.inputs.push(i)}for(n=t.readVarintNum(),e=0;n>e;e++)this.outputs.push(I.fromBufferReader(t));return this.nLockTime=t.readUInt32LE(),this},n.prototype.toObject=n.prototype.toJSON=function(){var t=[];this.inputs.forEach(function(e){t.push(e.toObject())});var e=[];this.outputs.forEach(function(t){e.push(t.toObject())});var r={hash:this.hash,version:this.version,inputs:t,outputs:e,nLockTime:this.nLockTime};return this._changeScript&&(r.changeScript=this._changeScript.toString()),i.isUndefined(this._changeIndex)||(r.changeIndex=this._changeIndex),i.isUndefined(this._fee)||(r.fee=this._fee),r},n.prototype.fromObject=function(t){s.checkArgument(i.isObject(t)||t instanceof n);var e,r=this;return e=t instanceof n?e.toObject():t,i.each(e.inputs,function(t){if(!t.output||!t.output.script)return void r.uncheckedAddInput(new y(t));var e,n=new k(t.output.script);if(n.isPublicKeyHashOut())e=new y.PublicKeyHash(t);else if(n.isScriptHashOut()&&t.publicKeys&&t.threshold)e=new y.MultiSigScriptHash(t,t.publicKeys,t.threshold,t.signatures);else{if(!n.isPublicKeyOut())throw new f.Transaction.Input.UnsupportedScript(t.output.script);e=new y.PublicKey(t)}r.addInput(e)}),i.each(e.outputs,function(t){r.addOutput(new I(t))}),e.changeIndex&&(this._changeIndex=e.changeIndex),e.changeScript&&(this._changeScript=new k(e.changeScript)),e.fee&&(this._fee=e.fee),this.nLockTime=e.nLockTime,this.version=e.version,this._checkConsistency(t),this},n.prototype._checkConsistency=function(t){i.isUndefined(this._changeIndex)||(s.checkState(this._changeScript),s.checkState(this.outputs[this._changeIndex]),s.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString())),t&&t.hash&&s.checkState(t.hash===this.hash,"Hash in object does not match transaction hash")},n.prototype.lockUntilDate=function(t){if(s.checkArgument(t),i.isNumber(t)&&t<n.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new f.Transaction.LockTimeTooEarly;i.isDate(t)&&(t=t.getTime()/1e3);for(var e=0;e<this.inputs.length;e++)this.inputs[e].sequenceNumber===y.DEFAULT_SEQNUMBER&&(this.inputs[e].sequenceNumber=y.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=t,this},n.prototype.lockUntilBlockHeight=function(t){if(s.checkArgument(i.isNumber(t)),t>=n.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new f.Transaction.BlockHeightTooHigh;if(0>t)throw new f.Transaction.NLockTimeOutOfRange;for(var e=0;e<this.inputs.length;e++)this.inputs[e].sequenceNumber===y.DEFAULT_SEQNUMBER&&(this.inputs[e].sequenceNumber=y.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=t,this},n.prototype.getLockTime=function(){return this.nLockTime?this.nLockTime<n.NLOCKTIME_BLOCKHEIGHT_LIMIT?this.nLockTime:new Date(1e3*this.nLockTime):null},n.prototype.fromString=function(t){this.fromBuffer(new o.Buffer(t,"hex"))},n.prototype._newTransaction=function(){this.version=x,this.nLockTime=P},n.prototype.from=function(t,e,r){if(i.isArray(t)){var n=this;return i.each(t,function(t){n.from(t,e,r)}),this}var s=i.any(this.inputs,function(e){return e.prevTxId.toString("hex")===t.txId&&e.outputIndex===t.outputIndex});if(!s)return e&&r?this._fromMultisigUtxo(t,e,r):this._fromNonP2SH(t),this},n.prototype._fromNonP2SH=function(t){var e;t=new m(t),e=t.script.isPublicKeyHashOut()?v:t.script.isPublicKeyOut()?_:y,this.addInput(new e({output:new I({script:t.script,satoshis:t.satoshis}),prevTxId:t.txId,outputIndex:t.outputIndex,script:k.empty()}))},n.prototype._fromMultisigUtxo=function(t,e,r){s.checkArgument(r<=e.length,"Number of required signatures must be greater than the number of public keys");var n;if(t=new m(t),t.script.isMultisigOut())n=S;else{if(!t.script.isScriptHashOut())throw new Error("@TODO");n=w}this.addInput(new n({output:new I({script:t.script,satoshis:t.satoshis}),prevTxId:t.txId,outputIndex:t.outputIndex,script:k.empty()},e,r))},n.prototype.addInput=function(t,e,r){if(s.checkArgumentType(t,y,"input"),!t.output&&(i.isUndefined(e)||i.isUndefined(r)))throw new f.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return t.output||!e||i.isUndefined(r)||(e=e instanceof k?e:new k(e),s.checkArgumentType(r,"number","satoshis"),t.output=new I({script:e,satoshis:r})),this.uncheckedAddInput(t)},n.prototype.uncheckedAddInput=function(t){return s.checkArgumentType(t,y,"input"),this.inputs.push(t),this._inputAmount=void 0,this._updateChangeOutput(),this},n.prototype.hasAllUtxoInfo=function(){return i.all(this.inputs.map(function(t){return!!t.output}))},n.prototype.fee=function(t){return s.checkArgument(i.isNumber(t),"amount must be a number"),this._fee=t,this._updateChangeOutput(),this},n.prototype.feePerKb=function(t){return s.checkArgument(i.isNumber(t),"amount must be a number"),this._feePerKb=t,this._updateChangeOutput(),this},n.prototype.change=function(t){return s.checkArgument(t,"address is required"),this._changeScript=k.fromAddress(t),this._updateChangeOutput(),this},n.prototype.getChangeOutput=function(){return i.isUndefined(this._changeIndex)?null:this.outputs[this._changeIndex]},n.prototype.to=function(t,e){if(i.isArray(t)){var r=this;return i.each(t,function(t){r.to(t.address,t.satoshis)}),this}return s.checkArgument(c.isNaturalNumber(e),"Amount is expected to be a positive integer"),this.addOutput(new I({script:k(new g(t)),satoshis:e})),this},n.prototype.addData=function(t){return this.addOutput(new I({script:k.buildDataOut(t),satoshis:0})),this},n.prototype.addOutput=function(t){return s.checkArgumentType(t,I,"output"),this._addOutput(t),this._updateChangeOutput(),this},n.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this},n.prototype._addOutput=function(t){this.outputs.push(t),this._outputAmount=void 0},n.prototype._getOutputAmount=function(){if(i.isUndefined(this._outputAmount)){var t=this;this._outputAmount=0,i.each(this.outputs,function(e){t._outputAmount+=e.satoshis})}return this._outputAmount},n.prototype._getInputAmount=function(){if(i.isUndefined(this._inputAmount)){var t=this;this._inputAmount=0,i.each(this.inputs,function(e){if(i.isUndefined(e.output))throw new f.Transaction.Input.MissingPreviousOutput;t._inputAmount+=e.output.satoshis})}return this._inputAmount},n.prototype._updateChangeOutput=function(){if(this._changeScript){this._clearSignatures(),i.isUndefined(this._changeIndex)||this._removeOutput(this._changeIndex);var t=this._getUnspentValue(),e=this.getFee(),r=t-e;r>0?(this._changeIndex=this.outputs.length,this._addOutput(new I({script:this._changeScript,satoshis:r}))):this._changeIndex=void 0}},n.prototype.getFee=function(){return this.isCoinbase()?0:i.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee},n.prototype._estimateFee=function(){var t=this._estimateSize(),e=this._getUnspentValue();return n._estimateFee(t,e,this._feePerKb)},n.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()},n.prototype._clearSignatures=function(){i.each(this.inputs,function(t){t.clearSignatures()})},n._estimateFee=function(t,e,r){var i=Math.ceil(t/1e3)*(r||n.FEE_PER_KB);return e>i&&(t+=n.CHANGE_OUTPUT_MAX_SIZE),Math.ceil(t/1e3)*(r||n.FEE_PER_KB)},n.prototype._estimateSize=function(){var t=n.MAXIMUM_EXTRA_SIZE;return i.each(this.inputs,function(e){t+=e._estimateSize()}),i.each(this.outputs,function(e){t+=e.script.toBuffer().length+9}),t},n.prototype._removeOutput=function(t){var e=this.outputs[t];this.outputs=i.without(this.outputs,e),this._outputAmount=void 0},n.prototype.removeOutput=function(t){this._removeOutput(t),this._updateChangeOutput()},n.prototype.sort=function(){return this.sortInputs(function(t){var e=Array.prototype.concat.apply([],t);return e.sort(function(t,e){return a(t.prevTxId,e.prevTxId)||t.outputIndex-e.outputIndex}),e}),this.sortOutputs(function(t){var e=Array.prototype.concat.apply([],t);return e.sort(function(t,e){return t.satoshis-e.satoshis||a(t.script.toBuffer(),e.script.toBuffer())}),e}),this},n.prototype.shuffleOutputs=function(){return this.sortOutputs(i.shuffle)},n.prototype.sortOutputs=function(t){var e=t(this.outputs);return this._newOutputOrder(e)},n.prototype.sortInputs=function(t){return this.inputs=t(this.inputs),this._clearSignatures(),this},n.prototype._newOutputOrder=function(t){var e=this.outputs.length!==t.length||0!==i.difference(this.outputs,t).length;if(e)throw new f.Transaction.InvalidSorting;if(!i.isUndefined(this._changeIndex)){var r=this.outputs[this._changeIndex];this._changeIndex=i.findIndex(t,r)}return this.outputs=t,this},n.prototype.removeInput=function(t,e){var r;if(r=!e&&i.isNumber(t)?t:i.findIndex(this.inputs,function(r){return r.prevTxId.toString("hex")===t&&r.outputIndex===e}),0>r||r>=this.inputs.length)throw new f.Transaction.InvalidIndex(r,this.inputs.length);var n=this.inputs[r];this.inputs=i.without(this.inputs,n),this._inputAmount=void 0,this._updateChangeOutput()},n.prototype.sign=function(t,e){s.checkState(this.hasAllUtxoInfo());var r=this;return i.isArray(t)?(i.each(t,function(t){r.sign(t,e)}),this):(i.each(this.getSignatures(t,e),function(t){r.applySignature(t)}),this)},n.prototype.getSignatures=function(t,e){t=new E(t),e=e||l.SIGHASH_ALL;var r=this,n=[],s=p.sha256ripemd160(t.publicKey.toBuffer());return i.each(this.inputs,function(o,a){i.each(o.getSignatures(r,t,a,e,s),function(t){n.push(t)})}),n},n.prototype.applySignature=function(t){return this.inputs[t.inputIndex].addSignature(this,t),this},n.prototype.isFullySigned=function(){return i.each(this.inputs,function(t){if(t.isFullySigned===y.prototype.isFullySigned)throw new f.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),i.all(i.map(this.inputs,function(t){return t.isFullySigned()}))},n.prototype.isValidSignature=function(t){var e=this;if(this.inputs[t.inputIndex].isValidSignature===y.prototype.isValidSignature)throw new f.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[t.inputIndex].isValidSignature(e,t)},n.prototype.verifySignature=function(t,e,r,n){return b.verify(this,t,e,r,n)},n.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var t=new A(0),e=0;e<this.outputs.length;e++){var r=this.outputs[e];if(r.invalidSatoshis())return"transaction txout "+e+" satoshis is invalid";if(r._satoshisBN.gt(new A(n.MAX_MONEY,10)))return"transaction txout "+e+" greater than MAX_MONEY";if(t=t.add(r._satoshisBN),t.gt(new A(n.MAX_MONEY)))return"transaction txout "+e+" total output greater than MAX_MONEY"}if(this.toBuffer().length>O)return"transaction over the maximum block size";var s={};for(e=0;e<this.inputs.length;e++){var o=this.inputs[e],a=o.prevTxId+":"+o.outputIndex;if(!i.isUndefined(s[a]))return"transaction input "+e+" duplicate input";s[a]=!0}var f=this.isCoinbase();if(f){var u=this.inputs[0]._scriptBuffer;if(u.length<2||u.length>100)return"coinbase transaction script size invalid"}else for(e=0;e<this.inputs.length;e++)if(this.inputs[e].isNull())return"transaction input "+e+" has null input";return!0},n.prototype.isCoinbase=function(){return 1===this.inputs.length&&this.inputs[0].isNull()},e.exports=n}).call(this,t("buffer").Buffer)},{"../address":1,"../crypto/bn":6,"../crypto/hash":8,"../crypto/signature":11,"../encoding/bufferreader":14,"../encoding/bufferwriter":15,"../errors":17,"../privatekey":24,"../script":26,"../util/buffer":43,"../util/js":44,"../util/preconditions":45,"./input":30,"./output":36,"./sighash":37,"./unspentoutput":40,buffer:48,"buffer-compare":274,lodash:297}],40:[function(t,e,r){"use strict";function n(t){if(!(this instanceof n))return new n(t);s.checkArgument(i.isObject(t),"Must provide an object from where to extract data");var e=t.address?new f(t.address):void 0,r=t.txid?t.txid:t.txId;if(!r||!o.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",t);var c=i.isUndefined(t.vout)?t.outputIndex:t.vout;if(!i.isNumber(c))throw new Error("Invalid outputIndex, received "+c);s.checkArgument(!i.isUndefined(t.scriptPubKey)||!i.isUndefined(t.script),"Must provide the scriptPubKey for that output!");var h=new a(t.scriptPubKey||t.script);s.checkArgument(!i.isUndefined(t.amount)||!i.isUndefined(t.satoshis),"Must provide an amount for the output");var d=i.isUndefined(t.amount)?t.satoshis:new u.fromBTC(t.amount).toSatoshis();s.checkArgument(i.isNumber(d),"Amount must be a number"),o.defineImmutable(this,{address:e,txId:r,outputIndex:c,script:h,satoshis:d})}var i=t("lodash"),s=t("../util/preconditions"),o=t("../util/js"),a=t("../script"),f=t("../address"),u=t("../unit");n.prototype.inspect=function(){return"<UnspentOutput: "+this.txId+":"+this.outputIndex+", satoshis: "+this.satoshis+", address: "+this.address+">"},n.prototype.toString=function(){return this.txId+":"+this.outputIndex},n.fromObject=function(t){return new n(t)},n.prototype.toObject=n.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:u.fromSatoshis(this.satoshis).toBTC()}},e.exports=n},{"../address":1,"../script":26,"../unit":41,"../util/js":44,"../util/preconditions":45,lodash:297}],41:[function(t,e,r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);if(i.isNumber(e)){if(0>=e)throw new s.Unit.InvalidRate(e);t/=e,e=n.BTC}this._value=this._from(t,e);var r=this,o=function(t){Object.defineProperty(r,t,{get:function(){return r.to(t)},enumerable:!0})};Object.keys(a).forEach(o)}var i=t("lodash"),s=t("./errors"),o=t("./util/preconditions"),a={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};Object.keys(a).forEach(function(t){n[t]=t}),n.fromObject=function(t){return o.checkArgument(i.isObject(t),"Argument is expected to be an object"),new n(t.amount,t.code)},n.fromBTC=function(t){return new n(t,n.BTC)},n.fromMillis=n.fromMilis=function(t){return new n(t,n.mBTC)},n.fromMicros=n.fromBits=function(t){return new n(t,n.bits)},n.fromSatoshis=function(t){return new n(t,n.satoshis)},n.fromFiat=function(t,e){return new n(t,e)},n.prototype._from=function(t,e){if(!a[e])throw new s.Unit.UnknownCode(e);return parseInt((t*a[e][0]).toFixed())},n.prototype.to=function(t){if(i.isNumber(t)){if(0>=t)throw new s.Unit.InvalidRate(t);return parseFloat((this.BTC*t).toFixed(2))}if(!a[t])throw new s.Unit.UnknownCode(t);var e=this._value/a[t][0];return parseFloat(e.toFixed(a[t][1]))},n.prototype.toBTC=function(){return this.to(n.BTC)},n.prototype.toMillis=n.prototype.toMilis=function(){return this.to(n.mBTC)},n.prototype.toMicros=n.prototype.toBits=function(){return this.to(n.bits)},n.prototype.toSatoshis=function(){return this.to(n.satoshis)},n.prototype.atRate=function(t){return this.to(t)},n.prototype.toString=function(){return this.satoshis+" satoshis"},n.prototype.toObject=n.prototype.toJSON=function(){return{amount:this.BTC,code:n.BTC}},n.prototype.inspect=function(){return"<Unit: "+this.toString()+">"},e.exports=n},{"./errors":17,"./util/preconditions":45,lodash:297}],42:[function(t,e,r){"use strict";var n=t("lodash"),i=t("url"),s=t("./address"),o=t("./unit"),a=function(t,e){if(!(this instanceof a))return new a(t,e);if(this.extras={},this.knownParams=e||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var r=a.parse(t);r.amount&&(r.amount=this._parseAmount(r.amount)),this._fromObject(r)}else{if("object"!=typeof t)throw new TypeError("Unrecognized data format.");this._fromObject(t)}};a.fromString=function(t){if("string"!=typeof t)throw new TypeError("Expected a string");return new a(t)},a.fromObject=function(t){return new a(t)},a.isValid=function(t,e){try{new a(t,e)}catch(r){return!1}return!0},a.parse=function(t){var e=i.parse(t,!0);if("bitcoin:"!==e.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(t);return e.query.address=r&&r[1]||void 0,e.query},a.Members=["address","amount","message","label","r"],a.prototype._fromObject=function(t){if(!s.isValid(t.address))throw new TypeError("Invalid bitcoin address");this.address=new s(t.address),this.network=this.address.network,this.amount=t.amount;for(var e in t)if("address"!==e&&"amount"!==e){if(/^req-/.exec(e)&&-1===this.knownParams.indexOf(e))throw Error("Unknown required argument "+e);var r=a.Members.indexOf(e)>-1?this:this.extras;r[e]=t[e]}},a.prototype._parseAmount=function(t){if(t=Number(t),isNaN(t))throw new TypeError("Invalid amount");return o.fromBTC(t).toSatoshis()},a.prototype.toObject=a.prototype.toJSON=function(){for(var t={},e=0;e<a.Members.length;e++){var r=a.Members[e];this.hasOwnProperty(r)&&"undefined"!=typeof this[r]&&(t[r]=this[r].toString())}return n.extend(t,this.extras),t},a.prototype.toString=function(){var t={};return this.amount&&(t.amount=o.fromSatoshis(this.amount).toBTC()),this.message&&(t.message=this.message),this.label&&(t.label=this.label),this.r&&(t.r=this.r),n.extend(t,this.extras),i.format({protocol:"bitcoin:",host:this.address,query:t})},a.prototype.inspect=function(){return"<URI: "+this.toString()+">"},e.exports=a},{"./address":1,"./unit":41,lodash:297,url:267}],43:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t.length!==e.length)return!1;for(var r=t.length,n=0;r>n;n++)if(t[n]!==e[n])return!1;return!0}var i=t("buffer"),s=t("assert"),o=t("./js"),a=t("./preconditions");e.exports={fill:function(t,e){a.checkArgumentType(t,"Buffer","buffer"),a.checkArgumentType(e,"number","value");for(var r=t.length,n=0;r>n;n++)t[n]=e;return t},copy:function(t){var e=new r(t.length);return t.copy(e),e},isBuffer:function(t){return i.Buffer.isBuffer(t)||t instanceof Uint8Array},emptyBuffer:function(t){a.checkArgumentType(t,"number","bytes");for(var e=new i.Buffer(t),r=0;t>r;r++)e.write("\x00",r);return e},concat:i.Buffer.concat,equals:n,equal:n,integerAsSingleByteBuffer:function(t){return a.checkArgumentType(t,"number","integer"),new i.Buffer([255&t])},integerAsBuffer:function(t){a.checkArgumentType(t,"number","integer");var e=[];return e.push(t>>24&255),e.push(t>>16&255),e.push(t>>8&255),e.push(255&t),new r(e)},integerFromBuffer:function(t){return a.checkArgumentType(t,"Buffer","buffer"),t[0]<<24|t[1]<<16|t[2]<<8|t[3]},integerFromSingleByteBuffer:function(t){return a.checkArgumentType(t,"Buffer","buffer"),t[0]},bufferToHex:function(t){return a.checkArgumentType(t,"Buffer","buffer"),t.toString("hex")},reverse:function(t){for(var e=new i.Buffer(t.length),r=0;r<t.length;r++)e[r]=t[t.length-r-1];return e},hexToBuffer:function(t){return s(o.isHexa(t)),new i.Buffer(t,"hex")}},e.exports.NULL_HASH=e.exports.fill(new r(32),0),e.exports.EMPTY_BUFFER=new r(0)}).call(this,t("buffer").Buffer)},{"./js":44,"./preconditions":45,assert:46,buffer:48}],44:[function(t,e,r){"use strict";var n=t("lodash"),i=function(t){return n.isString(t)?/^[0-9a-fA-F]+$/.test(t):!1};e.exports={isValidJSON:function(t){var e;if(!n.isString(t))return!1;try{e=JSON.parse(t)}catch(r){return!1}return"object"==typeof e?!0:!1},isHexa:i,isHexaString:i,cloneArray:function(t){return[].concat(t)},defineImmutable:function(t,e){return Object.keys(e).forEach(function(r){Object.defineProperty(t,r,{configurable:!1,enumerable:!0,value:e[r]})}),t},isNaturalNumber:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&t>=0}}},{lodash:297}],45:[function(t,e,r){"use strict";var n=t("../errors"),i=t("lodash");e.exports={checkState:function(t,e){if(!t)throw new n.InvalidState(e)},checkArgument:function(t,e,r,i){if(!t)throw new n.InvalidArgument(e,r,i)},checkArgumentType:function(e,r,s){if(s=s||"(unknown name)",i.isString(r)){if("Buffer"===r){var o=t("./buffer");if(!o.isBuffer(e))throw new n.InvalidArgumentType(e,r,s)}else if(typeof e!==r)throw new n.InvalidArgumentType(e,r,s)}else if(!(e instanceof r))throw new n.InvalidArgumentType(e,r.name,s)}}},{"../errors":17,"./buffer":43,lodash:297}],46:[function(t,e,r){function n(t,e){return p.isUndefined(e)?""+e:p.isNumber(e)&&!isFinite(e)?e.toString():p.isFunction(e)||p.isRegExp(e)?e.toString():e}function i(t,e){return p.isString(t)?t.length<e?t:t.slice(0,e):t}function s(t){return i(JSON.stringify(t.actual,n),128)+" "+t.operator+" "+i(JSON.stringify(t.expected,n),128)}function o(t,e,r,n,i){throw new g.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function a(t,e){t||o(t,!0,e,"==",g.ok)}function f(t,e){if(t===e)return!0;if(p.isBuffer(t)&&p.isBuffer(e)){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}return p.isDate(t)&&p.isDate(e)?t.getTime()===e.getTime():p.isRegExp(t)&&p.isRegExp(e)?t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase:p.isObject(t)||p.isObject(e)?c(t,e):t==e}function u(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function c(t,e){if(p.isNullOrUndefined(t)||p.isNullOrUndefined(e))return!1;if(t.prototype!==e.prototype)return!1;if(p.isPrimitive(t)||p.isPrimitive(e))return t===e;var r=u(t),n=u(e);if(r&&!n||!r&&n)return!1;if(r)return t=l.call(t),e=l.call(e),f(t,e);var i,s,o=m(t),a=m(e);if(o.length!=a.length)return!1;for(o.sort(),a.sort(),s=o.length-1;s>=0;s--)if(o[s]!=a[s])return!1;for(s=o.length-1;s>=0;s--)if(i=o[s],!f(t[i],e[i]))return!1;return!0}function h(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function d(t,e,r,n){var i;p.isString(r)&&(n=r,r=null);try{e()}catch(s){i=s}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&o(i,r,"Missing expected exception"+n),!t&&h(i,r)&&o(i,r,"Got unwanted exception"+n),t&&i&&r&&!h(i,r)||!t&&i)throw i}var p=t("util/"),l=Array.prototype.slice,b=Object.prototype.hasOwnProperty,g=e.exports=a;g.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=s(this),this.generatedMessage=!0);var e=t.stackStartFunction||o;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=e.name,a=n.indexOf("\n"+i);if(a>=0){var f=n.indexOf("\n",a+1);n=n.substring(f+1)}this.stack=n}}},p.inherits(g.AssertionError,Error),g.fail=o,g.ok=a,g.equal=function(t,e,r){t!=e&&o(t,e,r,"==",g.equal)},g.notEqual=function(t,e,r){t==e&&o(t,e,r,"!=",g.notEqual)},g.deepEqual=function(t,e,r){f(t,e)||o(t,e,r,"deepEqual",g.deepEqual)},g.notDeepEqual=function(t,e,r){f(t,e)&&o(t,e,r,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(t,e,r){t!==e&&o(t,e,r,"===",g.strictEqual)},g.notStrictEqual=function(t,e,r){t===e&&o(t,e,r,"!==",g.notStrictEqual)},g["throws"]=function(t,e,r){d.apply(this,[!0].concat(l.call(arguments)))},g.doesNotThrow=function(t,e){d.apply(this,[!1].concat(l.call(arguments)))},g.ifError=function(t){if(t)throw t};var m=Object.keys||function(t){var e=[];for(var r in t)b.call(t,r)&&e.push(r);return e}},{"util/":269}],47:[function(t,e,r){},{}],48:[function(t,e,r){(function(e){"use strict";function n(){function t(){}try{var e=new Uint8Array(1);return e.foo=function(){return 42},e.constructor=t,42===e.foo()&&e.constructor===t&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(r){return!1}}function i(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t){return this instanceof s?(s.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof t?o(this,t):"string"==typeof t?a(this,t,arguments.length>1?arguments[1]:"utf8"):f(this,t)):arguments.length>1?new s(t,arguments[1]):new s(t)}function o(t,e){if(t=b(t,0>e?0:0|g(e)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;e>r;r++)t[r]=0;return t}function a(t,e,r){("string"!=typeof r||""===r)&&(r="utf8");var n=0|y(e,r);return t=b(t,n),t.write(e,r),t}function f(t,e){if(s.isBuffer(e))return u(t,e);if(J(e))return c(t,e);if(null==e)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(e.buffer instanceof ArrayBuffer)return h(t,e);if(e instanceof ArrayBuffer)return d(t,e)}return e.length?p(t,e):l(t,e)}function u(t,e){var r=0|g(e.length);return t=b(t,r),e.copy(t,0,0,r),t}function c(t,e){var r=0|g(e.length);t=b(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function h(t,e){var r=0|g(e.length);t=b(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function d(t,e){return s.TYPED_ARRAY_SUPPORT?(e.byteLength,t=s._augment(new Uint8Array(e))):t=h(t,new Uint8Array(e)),t}function p(t,e){var r=0|g(e.length);t=b(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function l(t,e){var r,n=0;"Buffer"===e.type&&J(e.data)&&(r=e.data,n=0|g(r.length)),t=b(t,n);for(var i=0;n>i;i+=1)t[i]=255&r[i];return t}function b(t,e){s.TYPED_ARRAY_SUPPORT?(t=s._augment(new Uint8Array(e)),t.__proto__=s.prototype):(t.length=e,t._isBuffer=!0);var r=0!==e&&e<=s.poolSize>>>1;return r&&(t.parent=Z),t}function g(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function m(t,e){if(!(this instanceof m))return new m(t,e);var r=new s(t,e);return delete r.parent,r}function y(t,e){"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return H(t).length;e=(""+e).toLowerCase(),n=!0}}function v(t,e,r){var n=!1;if(e=0|e,r=void 0===r||r===1/0?this.length:0|r,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return O(this,e,r);case"binary":return B(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var s=e.length;if(s%2!==0)throw new Error("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;n>o;o++){var a=parseInt(e.substr(2*o,2),16);if(isNaN(a))throw new Error("Invalid hex string");t[r+o]=a}return o}function w(t,e,r,n){return G(H(e,t.length-r),t,r,n)}function S(t,e,r,n){return G(q(e),t,r,n)}function I(t,e,r,n){return S(t,e,r,n)}function k(t,e,r,n){return G(Y(e),t,r,n)}function E(t,e,r,n){return G(V(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?W.fromByteArray(t):W.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;r>i;){var s=t[i],o=null,a=s>239?4:s>223?3:s>191?2:1;if(r>=i+a){var f,u,c,h;switch(a){case 1:128>s&&(o=s);break;case 2:f=t[i+1],128===(192&f)&&(h=(31&s)<<6|63&f,h>127&&(o=h));break;case 3:f=t[i+1],u=t[i+2],128===(192&f)&&128===(192&u)&&(h=(15&s)<<12|(63&f)<<6|63&u,h>2047&&(55296>h||h>57343)&&(o=h));break;case 4:f=t[i+1],u=t[i+2],c=t[i+3],128===(192&f)&&128===(192&u)&&128===(192&c)&&(h=(15&s)<<18|(63&f)<<12|(63&u)<<6|63&c,h>65535&&1114112>h&&(o=h))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),
o=56320|1023&o),n.push(o),i+=a}return P(n)}function P(t){var e=t.length;if(Q>=e)return String.fromCharCode.apply(String,t);for(var r="",n=0;e>n;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Q));return r}function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function M(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",s=e;r>s;s++)i+=K(t[s]);return i}function R(t,e,r){for(var n=t.slice(e,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function T(t,e,r){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>i||o>e)throw new RangeError("value is out of bounds");if(r+n>t.length)throw new RangeError("index out of range")}function N(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,s=Math.min(t.length-r,2);s>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function j(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,s=Math.min(t.length-r,4);s>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function U(t,e,r,n,i,s){if(e>i||s>e)throw new RangeError("value is out of bounds");if(r+n>t.length)throw new RangeError("index out of range");if(0>r)throw new RangeError("index out of range")}function L(t,e,r,n,i){return i||U(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||U(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(t,e,r,n,52,8),r+8}function z(t){if(t=F(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function K(t){return 16>t?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var r,n=t.length,i=null,s=[],o=0;n>o;o++){if(r=t.charCodeAt(o),r>55295&&57344>r){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(56320>r){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,128>r){if((e-=1)<0)break;s.push(r)}else if(2048>r){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(65536>r){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function q(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e}function V(t,e){for(var r,n,i,s=[],o=0;o<t.length&&!((e-=2)<0);o++)r=t.charCodeAt(o),n=r>>8,i=r%256,s.push(i),s.push(n);return s}function Y(t){return W.toByteArray(z(t))}function G(t,e,r,n){for(var i=0;n>i&&!(i+r>=e.length||i>=t.length);i++)e[i+r]=t[i];return i}var W=t("base64-js"),X=t("ieee754"),J=t("isarray");r.Buffer=s,r.SlowBuffer=m,r.INSPECT_MAX_BYTES=50,s.poolSize=8192;var Z={};s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),s.TYPED_ARRAY_SUPPORT?(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array):(s.prototype.length=void 0,s.prototype.parent=void 0),s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);o>i&&t[i]===e[i];)++i;return i!==o&&(r=t[i],n=e[i]),n>r?-1:r>n?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!J(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new s(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;r++)e+=t[r].length;var n=new s(e),i=0;for(r=0;r<t.length;r++){var o=t[r];o.copy(n,i),i+=o.length}return n},s.byteLength=y,s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):v.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:s.compare(this,t)},s.prototype.indexOf=function(t,e){function r(t,e,r){for(var n=-1,i=0;r+i<t.length;i++)if(t[r+i]===e[-1===n?0:i-n]){if(-1===n&&(n=i),i-n+1===e.length)return r+n}else n=-1;return-1}if(e>2147483647?e=2147483647:-2147483648>e&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(0>e&&(e=Math.max(this.length+e,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,e);if(s.isBuffer(t))return r(this,t,e);if("number"==typeof t)return s.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):r(this,[t],e);throw new TypeError("val must be string, number or Buffer")},s.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},s.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0);else{var i=n;n=e,e=0|r,r=i}var s=this.length-e;if((void 0===r||r>s)&&(r=s),t.length>0&&(0>r||0>e)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return S(this,t,e,r);case"binary":return I(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),t>e&&(e=t);var n;if(s.TYPED_ARRAY_SUPPORT)n=s._augment(this.subarray(t,e));else{var i=e-t;n=new s(i,void 0);for(var o=0;i>o;o++)n[o]=this[o+t]}return n.length&&(n.parent=this.parent||this),n},s.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||T(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return n},s.prototype.readUIntBE=function(t,e,r){t=0|t,e=0|e,r||T(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||T(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||T(t,e,this.length);for(var n=e,i=1,s=this[t+--n];n>0&&(i*=256);)s+=this[t+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},s.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),X.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),X.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),X.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),X.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||C(this,t,e,r,Math.pow(2,8*r),0);var i=1,s=0;for(this[e]=255&t;++s<r&&(i*=256);)this[e+s]=t/i&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||C(this,t,e,r,Math.pow(2,8*r),0);var i=r-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||C(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var s=0,o=1,a=0>t?1:0;for(this[e]=255&t;++s<r&&(o*=256);)this[e+s]=(t/o>>0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var s=r-1,o=1,a=0>t?1:0;for(this[e+s]=255&t;--s>=0&&(o*=256);)this[e+s]=(t/o>>0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||C(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||C(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||C(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&r>n&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&e>r&&n>e)for(i=o-1;i>=0;i--)t[i+e]=this[i+r];else if(1e3>o||!s.TYPED_ARRAY_SUPPORT)for(i=0;o>i;i++)t[i+e]=this[i+r];else t._set(this.subarray(r,r+o),e);return o},s.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new RangeError("end < start");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new RangeError("start out of bounds");if(0>r||r>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=H(t.toString()),s=i.length;for(n=e;r>n;n++)this[n]=i[n%s]}return this}},s.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(s.TYPED_ARRAY_SUPPORT)return new s(this).buffer;for(var t=new Uint8Array(this.length),e=0,r=t.length;r>e;e+=1)t[e]=this[e];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var $=s.prototype;s._augment=function(t){return t.constructor=s,t._isBuffer=!0,t._set=t.set,t.get=$.get,t.set=$.set,t.write=$.write,t.toString=$.toString,t.toLocaleString=$.toString,t.toJSON=$.toJSON,t.equals=$.equals,t.compare=$.compare,t.indexOf=$.indexOf,t.copy=$.copy,t.slice=$.slice,t.readUIntLE=$.readUIntLE,t.readUIntBE=$.readUIntBE,t.readUInt8=$.readUInt8,t.readUInt16LE=$.readUInt16LE,t.readUInt16BE=$.readUInt16BE,t.readUInt32LE=$.readUInt32LE,t.readUInt32BE=$.readUInt32BE,t.readIntLE=$.readIntLE,t.readIntBE=$.readIntBE,t.readInt8=$.readInt8,t.readInt16LE=$.readInt16LE,t.readInt16BE=$.readInt16BE,t.readInt32LE=$.readInt32LE,t.readInt32BE=$.readInt32BE,t.readFloatLE=$.readFloatLE,t.readFloatBE=$.readFloatBE,t.readDoubleLE=$.readDoubleLE,t.readDoubleBE=$.readDoubleBE,t.writeUInt8=$.writeUInt8,t.writeUIntLE=$.writeUIntLE,t.writeUIntBE=$.writeUIntBE,t.writeUInt16LE=$.writeUInt16LE,t.writeUInt16BE=$.writeUInt16BE,t.writeUInt32LE=$.writeUInt32LE,t.writeUInt32BE=$.writeUInt32BE,t.writeIntLE=$.writeIntLE,t.writeIntBE=$.writeIntBE,t.writeInt8=$.writeInt8,t.writeInt16LE=$.writeInt16LE,t.writeInt16BE=$.writeInt16BE,t.writeInt32LE=$.writeInt32LE,t.writeInt32BE=$.writeInt32BE,t.writeFloatLE=$.writeFloatLE,t.writeFloatBE=$.writeFloatBE,t.writeDoubleLE=$.writeDoubleLE,t.writeDoubleBE=$.writeDoubleBE,t.fill=$.fill,t.inspect=$.inspect,t.toArrayBuffer=$.toArrayBuffer,t};var tt=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":49,ieee754:50,isarray:51}],49:[function(t,e,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===o||e===h?62:e===a||e===d?63:f>e?-1:f+10>e?e-f+26+26:c+26>e?e-c:u+26>e?e-u+26:void 0}function r(t){function r(t){u[h++]=t}var n,i,o,a,f,u;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=t.length;f="="===t.charAt(c-2)?2:"="===t.charAt(c-1)?1:0,u=new s(3*t.length/4-f),o=f>0?t.length-4:t.length;var h=0;for(n=0,i=0;o>n;n+=4,i+=3)a=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&a)>>16),r((65280&a)>>8),r(255&a);return 2===f?(a=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&a)):1===f&&(a=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(a>>8&255),r(255&a)),u}function i(t){function e(t){return n.charAt(t)}function r(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,s,o,a=t.length%3,f="";for(i=0,o=t.length-a;o>i;i+=3)s=(t[i]<<16)+(t[i+1]<<8)+t[i+2],f+=r(s);switch(a){case 1:s=t[t.length-1],f+=e(s>>2),f+=e(s<<4&63),f+="==";break;case 2:s=(t[t.length-2]<<8)+t[t.length-1],f+=e(s>>10),f+=e(s>>4&63),f+=e(s<<2&63),f+="="}return f}var s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="+".charCodeAt(0),a="/".charCodeAt(0),f="0".charCodeAt(0),u="a".charCodeAt(0),c="A".charCodeAt(0),h="-".charCodeAt(0),d="_".charCodeAt(0);t.toByteArray=r,t.fromByteArray=i}("undefined"==typeof r?this.base64js={}:r)},{}],50:[function(t,e,r){r.read=function(t,e,r,n,i){var s,o,a=8*i-n-1,f=(1<<a)-1,u=f>>1,c=-7,h=r?i-1:0,d=r?-1:1,p=t[e+h];for(h+=d,s=p&(1<<-c)-1,p>>=-c,c+=a;c>0;s=256*s+t[e+h],h+=d,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=d,c-=8);if(0===s)s=1-u;else{if(s===f)return o?NaN:(p?-1:1)*(1/0);o+=Math.pow(2,n),s-=u}return(p?-1:1)*o*Math.pow(2,s-n)},r.write=function(t,e,r,n,i,s){var o,a,f,u=8*s-i-1,c=(1<<u)-1,h=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,l=n?1:-1,b=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),e+=o+h>=1?d/f:d*Math.pow(2,1-h),e*f>=2&&(o++,f/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(e*f-1)*Math.pow(2,i),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&a,p+=l,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;t[r+p]=255&o,p+=l,o/=256,u-=8);t[r+p-l]|=128*b}},{}],51:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],52:[function(t,e,r){"use strict";r.randomBytes=r.rng=r.pseudoRandomBytes=r.prng=t("randombytes"),r.createHash=r.Hash=t("create-hash"),r.createHmac=r.Hmac=t("create-hmac");var n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(Object.keys(t("browserify-sign/algos")));r.getHashes=function(){return n};var i=t("pbkdf2");r.pbkdf2=i.pbkdf2,r.pbkdf2Sync=i.pbkdf2Sync;var s=t("browserify-cipher");["Cipher","createCipher","Cipheriv","createCipheriv","Decipher","createDecipher","Decipheriv","createDecipheriv","getCiphers","listCiphers"].forEach(function(t){r[t]=s[t]});var o=t("diffie-hellman");["DiffieHellmanGroup","createDiffieHellmanGroup","getDiffieHellman","createDiffieHellman","DiffieHellman"].forEach(function(t){r[t]=o[t]});var a=t("browserify-sign");["createSign","Sign","createVerify","Verify"].forEach(function(t){r[t]=a[t]}),r.createECDH=t("create-ecdh");var f=t("public-encrypt");["publicEncrypt","privateEncrypt","publicDecrypt","privateDecrypt"].forEach(function(t){r[t]=f[t]}),["createCredentials"].forEach(function(t){r[t]=function(){throw new Error(["sorry, "+t+" is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))}})},{"browserify-cipher":53,"browserify-sign":83,"browserify-sign/algos":82,"create-ecdh":150,"create-hash":176,"create-hmac":189,"diffie-hellman":190,pbkdf2:197,"public-encrypt":198,randombytes:243}],53:[function(t,e,r){function n(t,e){var r,n;if(t=t.toLowerCase(),d[t])r=d[t].key,n=d[t].iv;else{if(!h[t])throw new TypeError("invalid suite type");r=8*h[t].key,n=h[t].iv}var i=f(e,!1,r,n);return s(t,i.key,i.iv)}function i(t,e){var r,n;if(t=t.toLowerCase(),d[t])r=d[t].key,n=d[t].iv;else{if(!h[t])throw new TypeError("invalid suite type");r=8*h[t].key,n=h[t].iv}var i=f(e,!1,r,n);return o(t,i.key,i.iv)}function s(t,e,r){if(t=t.toLowerCase(),d[t])return u.createCipheriv(t,e,r);if(h[t])return new c({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function o(t,e,r){if(t=t.toLowerCase(),d[t])return u.createDecipheriv(t,e,r);if(h[t])return new c({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}function a(){return Object.keys(h).concat(u.getCiphers())}var f=t("evp_bytestokey"),u=t("browserify-aes/browser"),c=t("browserify-des"),h=t("browserify-des/modes"),d=t("browserify-aes/modes");r.createCipher=r.Cipher=n,r.createCipheriv=r.Cipheriv=s,r.createDecipher=r.Decipher=i,r.createDecipheriv=r.Decipheriv=o,r.listCiphers=r.getCiphers=a},{"browserify-aes/browser":56,"browserify-aes/modes":60,"browserify-des":71,"browserify-des/modes":72,evp_bytestokey:81}],54:[function(t,e,r){(function(t){function e(t){var e,r;return e=t>a||0>t?(r=Math.abs(t)%a,0>t?a-r:r):t}function n(t){for(var e=0;e<t.length;t++)t[e]=0;return!1}function i(){this.SBOX=[],this.INV_SBOX=[],this.SUB_MIX=[[],[],[],[]],this.INV_SUB_MIX=[[],[],[],[]],this.init(),this.RCON=[0,1,2,4,8,16,32,64,128,27,54]}function s(t){for(var e=t.length/4,r=new Array(e),n=-1;++n<e;)r[n]=t.readUInt32BE(4*n);return r}function o(t){this._key=s(t),this._doReset()}var a=Math.pow(2,32);i.prototype.init=function(){var t,e,r,n,i,s,o,a,f,u;for(t=function(){var t,r;for(r=[],e=t=0;256>t;e=++t)128>e?r.push(e<<1):r.push(e<<1^283);return r}(),i=0,f=0,e=u=0;256>u;e=++u)r=f^f<<1^f<<2^f<<3^f<<4,r=r>>>8^255&r^99,this.SBOX[i]=r,this.INV_SBOX[r]=i,s=t[i],o=t[s],a=t[o],n=257*t[r]^16843008*r,this.SUB_MIX[0][i]=n<<24|n>>>8,this.SUB_MIX[1][i]=n<<16|n>>>16,this.SUB_MIX[2][i]=n<<8|n>>>24,this.SUB_MIX[3][i]=n,n=16843009*a^65537*o^257*s^16843008*i,this.INV_SUB_MIX[0][r]=n<<24|n>>>8,this.INV_SUB_MIX[1][r]=n<<16|n>>>16,this.INV_SUB_MIX[2][r]=n<<8|n>>>24,this.INV_SUB_MIX[3][r]=n,0===i?i=f=1:(i=s^t[t[t[a^s]]],f^=t[t[f]]);return!0};var f=new i;o.blockSize=16,o.prototype.blockSize=o.blockSize,o.keySize=32,o.prototype.keySize=o.keySize,o.prototype._doReset=function(){var t,e,r,n,i,s;for(r=this._key,e=r.length,this._nRounds=e+6,i=4*(this._nRounds+1),this._keySchedule=[],n=0;i>n;n++)this._keySchedule[n]=e>n?r[n]:(s=this._keySchedule[n-1],n%e===0?(s=s<<8|s>>>24,s=f.SBOX[s>>>24]<<24|f.SBOX[s>>>16&255]<<16|f.SBOX[s>>>8&255]<<8|f.SBOX[255&s],s^=f.RCON[n/e|0]<<24):e>6&&n%e===4?s=f.SBOX[s>>>24]<<24|f.SBOX[s>>>16&255]<<16|f.SBOX[s>>>8&255]<<8|f.SBOX[255&s]:void 0,this._keySchedule[n-e]^s);for(this._invKeySchedule=[],t=0;i>t;t++)n=i-t,s=this._keySchedule[n-(t%4?0:4)],this._invKeySchedule[t]=4>t||4>=n?s:f.INV_SUB_MIX[0][f.SBOX[s>>>24]]^f.INV_SUB_MIX[1][f.SBOX[s>>>16&255]]^f.INV_SUB_MIX[2][f.SBOX[s>>>8&255]]^f.INV_SUB_MIX[3][f.SBOX[255&s]];return!0},o.prototype.encryptBlock=function(e){e=s(new t(e));var r=this._doCryptBlock(e,this._keySchedule,f.SUB_MIX,f.SBOX),n=new t(16);return n.writeUInt32BE(r[0],0),n.writeUInt32BE(r[1],4),n.writeUInt32BE(r[2],8),n.writeUInt32BE(r[3],12),n},o.prototype.decryptBlock=function(e){e=s(new t(e));var r=[e[3],e[1]];e[1]=r[0],e[3]=r[1];var n=this._doCryptBlock(e,this._invKeySchedule,f.INV_SUB_MIX,f.INV_SBOX),i=new t(16);return i.writeUInt32BE(n[0],0),i.writeUInt32BE(n[3],4),i.writeUInt32BE(n[2],8),i.writeUInt32BE(n[1],12),i},o.prototype.scrub=function(){n(this._keySchedule),n(this._invKeySchedule),n(this._key)},o.prototype._doCryptBlock=function(t,r,n,i){var s,o,a,f,u,c,h,d,p;o=t[0]^r[0],a=t[1]^r[1],f=t[2]^r[2],u=t[3]^r[3],s=4;for(var l=1;l<this._nRounds;l++)c=n[0][o>>>24]^n[1][a>>>16&255]^n[2][f>>>8&255]^n[3][255&u]^r[s++],h=n[0][a>>>24]^n[1][f>>>16&255]^n[2][u>>>8&255]^n[3][255&o]^r[s++],d=n[0][f>>>24]^n[1][u>>>16&255]^n[2][o>>>8&255]^n[3][255&a]^r[s++],p=n[0][u>>>24]^n[1][o>>>16&255]^n[2][a>>>8&255]^n[3][255&f]^r[s++],o=c,a=h,f=d,u=p;return c=(i[o>>>24]<<24|i[a>>>16&255]<<16|i[f>>>8&255]<<8|i[255&u])^r[s++],h=(i[a>>>24]<<24|i[f>>>16&255]<<16|i[u>>>8&255]<<8|i[255&o])^r[s++],d=(i[f>>>24]<<24|i[u>>>16&255]<<16|i[o>>>8&255]<<8|i[255&a])^r[s++],p=(i[u>>>24]<<24|i[o>>>16&255]<<16|i[a>>>8&255]<<8|i[255&f])^r[s++],[e(c),e(h),e(d),e(p)]},r.AES=o}).call(this,t("buffer").Buffer)},{buffer:48}],55:[function(t,e,r){(function(r){function n(t,e,i,a){if(!(this instanceof n))return new n(t,e,i);o.call(this),this._finID=r.concat([i,new r([0,0,0,1])]),i=r.concat([i,new r([0,0,0,2])]),this._cipher=new s.AES(e),this._prev=new r(i.length),this._cache=new r(""),this._secCache=new r(""),this._decrypt=a,this._alen=0,this._len=0,i.copy(this._prev),this._mode=t;var u=new r(4);u.fill(0),this._ghash=new f(this._cipher.encryptBlock(u)),this._authTag=null,this._called=!1}function i(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=-1;++i<n;)r+=t[i]^e[i];return r}var s=t("./aes"),o=t("cipher-base"),a=t("inherits"),f=t("./ghash"),u=t("buffer-xor");a(n,o),e.exports=n,n.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;16>e&&(e=new r(e),e.fill(0),this._ghash.update(e))}this._called=!0;var n=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(n),this._len+=t.length,n},n.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash["final"](8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt){if(i(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data")}else this._authTag=t;this._cipher.scrub()},n.prototype.getAuthTag=function(){if(!this._decrypt&&r.isBuffer(this._authTag))return this._authTag;throw new Error("Attempting to get auth tag in unsupported state")},n.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},n.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length}}).call(this,t("buffer").Buffer)},{"./aes":54,"./ghash":59,buffer:48,"buffer-xor":68,"cipher-base":69,inherits:296}],56:[function(t,e,r){function n(){return Object.keys(o)}var i=t("./encrypter");r.createCipher=r.Cipher=i.createCipher,r.createCipheriv=r.Cipheriv=i.createCipheriv;var s=t("./decrypter");r.createDecipher=r.Decipher=s.createDecipher,r.createDecipheriv=r.Decipheriv=s.createDecipheriv;var o=t("./modes");r.listCiphers=r.getCiphers=n},{"./decrypter":57,"./encrypter":58,"./modes":60}],57:[function(t,e,r){(function(e){function n(t,r,s){return this instanceof n?(u.call(this),this._cache=new i,this._last=void 0,this._cipher=new f.AES(r),this._prev=new e(s.length),s.copy(this._prev),this._mode=t,void(this._autopadding=!0)):new n(t,r,s)}function i(){return this instanceof i?void(this.cache=new e("")):new i}function s(t){for(var e=t[15],r=-1;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");return 16!==e?t.slice(0,16-e):void 0}function o(t,r,i){var s=h[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof i&&(i=new e(i)),"string"==typeof r&&(r=new e(r)),r.length!==s.key/8)throw new TypeError("invalid key length "+r.length);if(i.length!==s.iv)throw new TypeError("invalid iv length "+i.length);return"stream"===s.type?new d(b[s.mode],r,i,!0):"auth"===s.type?new p(b[s.mode],r,i,!0):new n(b[s.mode],r,i)}function a(t,e){var r=h[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=l(e,!1,r.key,r.iv);return o(t,n.key,n.iv)}var f=t("./aes"),u=t("cipher-base"),c=t("inherits"),h=t("./modes"),d=t("./streamCipher"),p=t("./authCipher"),l=t("evp_bytestokey");c(n,u),n.prototype._update=function(t){this._cache.add(t);for(var r,n,i=[];r=this._cache.get(this._autopadding);)n=this._mode.decrypt(this,r),i.push(n);return e.concat(i)},n.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return s(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},n.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},i.prototype.add=function(t){this.cache=e.concat([this.cache,t])},i.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},i.prototype.flush=function(){return this.cache.length?this.cache:void 0};var b={ECB:t("./modes/ecb"),CBC:t("./modes/cbc"),CFB:t("./modes/cfb"),CFB8:t("./modes/cfb8"),CFB1:t("./modes/cfb1"),OFB:t("./modes/ofb"),CTR:t("./modes/ctr"),GCM:t("./modes/ctr")};r.createDecipher=a,r.createDecipheriv=o}).call(this,t("buffer").Buffer)},{"./aes":54,"./authCipher":55,"./modes":60,"./modes/cbc":61,"./modes/cfb":62,"./modes/cfb1":63,"./modes/cfb8":64,"./modes/ctr":65,"./modes/ecb":66,"./modes/ofb":67,"./streamCipher":70,buffer:48,"cipher-base":69,evp_bytestokey:81,inherits:296}],58:[function(t,e,r){(function(e){function n(t,r,s){return this instanceof n?(f.call(this),this._cache=new i,this._cipher=new a.AES(r),this._prev=new e(s.length),s.copy(this._prev),this._mode=t,void(this._autopadding=!0)):new n(t,r,s)}function i(){return this instanceof i?void(this.cache=new e("")):new i}function s(t,r,i){var s=c[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof i&&(i=new e(i)),"string"==typeof r&&(r=new e(r)),r.length!==s.key/8)throw new TypeError("invalid key length "+r.length);if(i.length!==s.iv)throw new TypeError("invalid iv length "+i.length);return"stream"===s.type?new d(l[s.mode],r,i):"auth"===s.type?new p(l[s.mode],r,i):new n(l[s.mode],r,i)}function o(t,e){var r=c[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=h(e,!1,r.key,r.iv);return s(t,n.key,n.iv)}var a=t("./aes"),f=t("cipher-base"),u=t("inherits"),c=t("./modes"),h=t("evp_bytestokey"),d=t("./streamCipher"),p=t("./authCipher");u(n,f),n.prototype._update=function(t){this._cache.add(t);for(var r,n,i=[];r=this._cache.get();)n=this._mode.encrypt(this,r),i.push(n);return e.concat(i)},n.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if("10101010101010101010101010101010"!==t.toString("hex"))throw this._cipher.scrub(),new Error("data not multiple of block length")},n.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},i.prototype.add=function(t){this.cache=e.concat([this.cache,t])},i.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},i.prototype.flush=function(){for(var t=16-this.cache.length,r=new e(t),n=-1;++n<t;)r.writeUInt8(t,n);var i=e.concat([this.cache,r]);return i};var l={ECB:t("./modes/ecb"),CBC:t("./modes/cbc"),CFB:t("./modes/cfb"),CFB8:t("./modes/cfb8"),CFB1:t("./modes/cfb1"),OFB:t("./modes/ofb"),CTR:t("./modes/ctr"),GCM:t("./modes/ctr")};r.createCipheriv=s,r.createCipher=o}).call(this,t("buffer").Buffer)},{"./aes":54,"./authCipher":55,"./modes":60,"./modes/cbc":61,"./modes/cfb":62,"./modes/cfb1":63,"./modes/cfb8":64,"./modes/ctr":65,"./modes/ecb":66,"./modes/ofb":67,"./streamCipher":70,buffer:48,"cipher-base":69,evp_bytestokey:81,inherits:296}],59:[function(t,e,r){(function(t){function r(e){this.h=e,this.state=new t(16),this.state.fill(0),this.cache=new t("")}function n(t){return[t.readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)]}function i(e){e=e.map(s);var r=new t(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r}function s(t){var e,r;return e=t>f||0>t?(r=Math.abs(t)%f,0>t?f-r:r):t}function o(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]}var a=new t(16);a.fill(0),e.exports=r,r.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},r.prototype._multiply=function(){for(var t,e,r,s=n(this.h),a=[0,0,0,0],f=-1;++f<128;){for(e=0!==(this.state[~~(f/8)]&1<<7-f%8),e&&(a=o(a,s)),r=0!==(1&s[3]),t=3;t>0;t--)s[t]=s[t]>>>1|(1&s[t-1])<<31;s[0]=s[0]>>>1,r&&(s[0]=s[0]^225<<24)}this.state=i(a)},r.prototype.update=function(e){this.cache=t.concat([this.cache,e]);for(var r;this.cache.length>=16;)r=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(r)},r.prototype["final"]=function(e,r){return this.cache.length&&this.ghash(t.concat([this.cache,a],16)),this.ghash(i([0,e,0,r])),this.state};var f=Math.pow(2,32)}).call(this,t("buffer").Buffer)},{buffer:48}],60:[function(t,e,r){r["aes-128-ecb"]={cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},r["aes-192-ecb"]={cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},r["aes-256-ecb"]={cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},r["aes-128-cbc"]={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},r["aes-192-cbc"]={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},r["aes-256-cbc"]={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},r.aes128=r["aes-128-cbc"],r.aes192=r["aes-192-cbc"],r.aes256=r["aes-256-cbc"],r["aes-128-cfb"]={cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},r["aes-192-cfb"]={cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},r["aes-256-cfb"]={cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},
r["aes-128-cfb8"]={cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},r["aes-192-cfb8"]={cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},r["aes-256-cfb8"]={cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},r["aes-128-cfb1"]={cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},r["aes-192-cfb1"]={cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},r["aes-256-cfb1"]={cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},r["aes-128-ofb"]={cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},r["aes-192-ofb"]={cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},r["aes-256-ofb"]={cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},r["aes-128-ctr"]={cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},r["aes-192-ctr"]={cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},r["aes-256-ctr"]={cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},r["aes-128-gcm"]={cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},r["aes-192-gcm"]={cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},r["aes-256-gcm"]={cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},{}],61:[function(t,e,r){var n=t("buffer-xor");r.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},r.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},{"buffer-xor":68}],62:[function(t,e,r){(function(e){function n(t,r,n){var s=r.length,o=i(r,t._cache);return t._cache=t._cache.slice(s),t._prev=e.concat([t._prev,n?r:o]),o}var i=t("buffer-xor");r.encrypt=function(t,r,i){for(var s,o=new e("");r.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=new e("")),!(t._cache.length<=r.length)){o=e.concat([o,n(t,r,i)]);break}s=t._cache.length,o=e.concat([o,n(t,r.slice(0,s),i)]),r=r.slice(s)}return o}}).call(this,t("buffer").Buffer)},{buffer:48,"buffer-xor":68}],63:[function(t,e,r){(function(t){function e(t,e,r){for(var i,s,o,a=-1,f=8,u=0;++a<f;)i=t._cipher.encryptBlock(t._prev),s=e&1<<7-a?128:0,o=i[0]^s,u+=(128&o)>>a%8,t._prev=n(t._prev,r?s:o);return u}function n(e,r){var n=e.length,i=-1,s=new t(e.length);for(e=t.concat([e,new t([r])]);++i<n;)s[i]=e[i]<<1|e[i+1]>>7;return s}r.encrypt=function(r,n,i){for(var s=n.length,o=new t(s),a=-1;++a<s;)o[a]=e(r,n[a],i);return o}}).call(this,t("buffer").Buffer)},{buffer:48}],64:[function(t,e,r){(function(t){function e(e,r,n){var i=e._cipher.encryptBlock(e._prev),s=i[0]^r;return e._prev=t.concat([e._prev.slice(1),new t([n?r:s])]),s}r.encrypt=function(r,n,i){for(var s=n.length,o=new t(s),a=-1;++a<s;)o[a]=e(r,n[a],i);return o}}).call(this,t("buffer").Buffer)},{buffer:48}],65:[function(t,e,r){(function(e){function n(t){for(var e,r=t.length;r--;){if(e=t.readUInt8(r),255!==e){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}function i(t){var e=t._cipher.encryptBlock(t._prev);return n(t._prev),e}var s=t("buffer-xor");r.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var n=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),s(r,n)}}).call(this,t("buffer").Buffer)},{buffer:48,"buffer-xor":68}],66:[function(t,e,r){r.encrypt=function(t,e){return t._cipher.encryptBlock(e)},r.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},{}],67:[function(t,e,r){(function(e){function n(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}var i=t("buffer-xor");r.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,n(t)]);var s=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),i(r,s)}}).call(this,t("buffer").Buffer)},{buffer:48,"buffer-xor":68}],68:[function(t,e,r){(function(t){e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),s=0;n>s;++s)i[s]=e[s]^r[s];return i}}).call(this,t("buffer").Buffer)},{buffer:48}],69:[function(t,e,r){(function(r){function n(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this["final"]=this._finalOrDigest,this._decoder=null,this._encoding=null}var i=t("stream").Transform,s=t("inherits"),o=t("string_decoder").StringDecoder;e.exports=n,s(n,i),n.prototype.update=function(t,e,n){"string"==typeof t&&(t=new r(t,e));var i=this._update(t);return this.hashMode?this:(n&&(i=this._toString(i,n)),i)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{r(n)}},n.prototype._flush=function(t){var e;try{this.push(this._final())}catch(r){e=r}finally{t(e)}},n.prototype._finalOrDigest=function(t){var e=this._final()||new r("");return t&&(e=this._toString(e,t,!0)),e},n.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n}}).call(this,t("buffer").Buffer)},{buffer:48,inherits:296,stream:265,string_decoder:266}],70:[function(t,e,r){(function(r){function n(t,e,o,a){return this instanceof n?(s.call(this),this._cipher=new i.AES(e),this._prev=new r(o.length),this._cache=new r(""),this._secCache=new r(""),this._decrypt=a,o.copy(this._prev),void(this._mode=t)):new n(t,e,o)}var i=t("./aes"),s=t("cipher-base"),o=t("inherits");o(n,s),e.exports=n,n.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},n.prototype._final=function(){this._cipher.scrub()}}).call(this,t("buffer").Buffer)},{"./aes":54,buffer:48,"cipher-base":69,inherits:296}],71:[function(t,e,r){(function(r){function n(t){i.call(this);var e,n=t.mode.toLowerCase(),s=a[n];e=t.decrypt?"decrypt":"encrypt";var o=t.key;("des-ede"===n||"des-ede-cbc"===n)&&(o=r.concat([o,o.slice(0,8)]));var f=t.iv;this._des=s.create({key:o,iv:f,type:e})}var i=t("cipher-base"),s=t("des.js"),o=t("inherits"),a={"des-ede3-cbc":s.CBC.instantiate(s.EDE),"des-ede3":s.EDE,"des-ede-cbc":s.CBC.instantiate(s.EDE),"des-ede":s.EDE,"des-cbc":s.CBC.instantiate(s.DES),"des-ecb":s.DES};a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],e.exports=n,o(n,i),n.prototype._update=function(t){return new r(this._des.update(t))},n.prototype._final=function(){return new r(this._des["final"]())}}).call(this,t("buffer").Buffer)},{buffer:48,"cipher-base":73,"des.js":74,inherits:296}],72:[function(t,e,r){r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}},{}],73:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{buffer:48,dup:69,inherits:296,stream:265,string_decoder:266}],74:[function(t,e,r){"use strict";r.utils=t("./des/utils"),r.Cipher=t("./des/cipher"),r.DES=t("./des/des"),r.CBC=t("./des/cbc"),r.EDE=t("./des/ede")},{"./des/cbc":75,"./des/cipher":76,"./des/des":77,"./des/ede":78,"./des/utils":79}],75:[function(t,e,r){"use strict";function n(t){s.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}function i(t){function e(e){t.call(this,e),this._cbcInit()}o(e,t);for(var r=Object.keys(a),n=0;n<r.length;n++){var i=r[n];e.prototype[i]=a[i]}return e.create=function(t){return new e(t)},e}var s=t("minimalistic-assert"),o=t("inherits"),a={};r.instantiate=i,a._cbcInit=function(){var t=new n(this.options.iv);this._cbcState=t},a._update=function(t,e,r,n){var i=this._cbcState,s=this.constructor.super_.prototype,o=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)o[a]^=t[e+a];s._update.call(this,o,0,r,n);for(var a=0;a<this.blockSize;a++)o[a]=r[n+a]}else{s._update.call(this,t,e,r,n);for(var a=0;a<this.blockSize;a++)r[n+a]^=o[a];for(var a=0;a<this.blockSize;a++)o[a]=t[e+a]}}},{inherits:296,"minimalistic-assert":80}],76:[function(t,e,r){"use strict";function n(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}var i=t("minimalistic-assert");e.exports=n,n.prototype._init=function(){},n.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},n.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;r>n;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},n.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},n.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var s=t.length-(t.length-e)%this.blockSize;s>e;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},n.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},n.prototype["final"]=function(t){var e;t&&(e=this.update(t));var r;return r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},n.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},n.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},n.prototype._unpad=function(t){return t},n.prototype._finalDecrypt=function(){i.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},{"minimalistic-assert":80}],77:[function(t,e,r){"use strict";function n(){this.tmp=new Array(2),this.keys=null}function i(t){u.call(this,t);var e=new n;this._desState=e,this.deriveKeys(e,t.key)}var s=t("minimalistic-assert"),o=t("inherits"),a=t("../des"),f=a.utils,u=a.Cipher;o(i,u),e.exports=i,i.create=function(t){return new i(t)};var c=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];i.prototype.deriveKeys=function(t,e){t.keys=new Array(32),s.equal(e.length,this.blockSize,"Invalid key length");var r=f.readUInt32BE(e,0),n=f.readUInt32BE(e,4);f.pc1(r,n,t.tmp,0),r=t.tmp[0],n=t.tmp[1];for(var i=0;i<t.keys.length;i+=2){var o=c[i>>>1];r=f.r28shl(r,o),n=f.r28shl(n,o),f.pc2(r,n,t.keys,i)}},i.prototype._update=function(t,e,r,n){var i=this._desState,s=f.readUInt32BE(t,e),o=f.readUInt32BE(t,e+4);f.ip(s,o,i.tmp,0),s=i.tmp[0],o=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,o,i.tmp,0):this._decrypt(i,s,o,i.tmp,0),s=i.tmp[0],o=i.tmp[1],f.writeUInt32BE(r,s,n),f.writeUInt32BE(r,o,n+4)},i.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},i.prototype._unpad=function(t){for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)s.equal(t[r],e);return t.slice(0,t.length-e)},i.prototype._encrypt=function(t,e,r,n,i){for(var s=e,o=r,a=0;a<t.keys.length;a+=2){var u=t.keys[a],c=t.keys[a+1];f.expand(o,t.tmp,0),u^=t.tmp[0],c^=t.tmp[1];var h=f.substitute(u,c),d=f.permute(h),p=o;o=(s^d)>>>0,s=p}f.rip(o,s,n,i)},i.prototype._decrypt=function(t,e,r,n,i){for(var s=r,o=e,a=t.keys.length-2;a>=0;a-=2){var u=t.keys[a],c=t.keys[a+1];f.expand(s,t.tmp,0),u^=t.tmp[0],c^=t.tmp[1];var h=f.substitute(u,c),d=f.permute(h),p=s;s=(o^d)>>>0,o=p}f.rip(s,o,n,i)}},{"../des":74,inherits:296,"minimalistic-assert":80}],78:[function(t,e,r){"use strict";function n(t,e){s.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),n=e.slice(8,16),i=e.slice(16,24);"encrypt"===t?this.ciphers=[u.create({type:"encrypt",key:r}),u.create({type:"decrypt",key:n}),u.create({type:"encrypt",key:i})]:this.ciphers=[u.create({type:"decrypt",key:i}),u.create({type:"encrypt",key:n}),u.create({type:"decrypt",key:r})]}function i(t){f.call(this,t);var e=new n(this.type,this.options.key);this._edeState=e}var s=t("minimalistic-assert"),o=t("inherits"),a=t("../des"),f=a.Cipher,u=a.DES;o(i,f),e.exports=i,i.create=function(t){return new i(t)},i.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},i.prototype._pad=u.prototype._pad,i.prototype._unpad=u.prototype._unpad},{"../des":74,inherits:296,"minimalistic-assert":80}],79:[function(t,e,r){"use strict";r.readUInt32BE=function(t,e){var r=t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e];return r>>>0},r.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},r.ip=function(t,e,r,n){for(var i=0,s=0,o=6;o>=0;o-=2){for(var a=0;24>=a;a+=8)i<<=1,i|=e>>>a+o&1;for(var a=0;24>=a;a+=8)i<<=1,i|=t>>>a+o&1}for(var o=6;o>=0;o-=2){for(var a=1;25>=a;a+=8)s<<=1,s|=e>>>a+o&1;for(var a=1;25>=a;a+=8)s<<=1,s|=t>>>a+o&1}r[n+0]=i>>>0,r[n+1]=s>>>0},r.rip=function(t,e,r,n){for(var i=0,s=0,o=0;4>o;o++)for(var a=24;a>=0;a-=8)i<<=1,i|=e>>>a+o&1,i<<=1,i|=t>>>a+o&1;for(var o=4;8>o;o++)for(var a=24;a>=0;a-=8)s<<=1,s|=e>>>a+o&1,s<<=1,s|=t>>>a+o&1;r[n+0]=i>>>0,r[n+1]=s>>>0},r.pc1=function(t,e,r,n){for(var i=0,s=0,o=7;o>=5;o--){for(var a=0;24>=a;a+=8)i<<=1,i|=e>>a+o&1;for(var a=0;24>=a;a+=8)i<<=1,i|=t>>a+o&1}for(var a=0;24>=a;a+=8)i<<=1,i|=e>>a+o&1;for(var o=1;3>=o;o++){for(var a=0;24>=a;a+=8)s<<=1,s|=e>>a+o&1;for(var a=0;24>=a;a+=8)s<<=1,s|=t>>a+o&1}for(var a=0;24>=a;a+=8)s<<=1,s|=t>>a+o&1;r[n+0]=i>>>0,r[n+1]=s>>>0},r.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(t,e,r,i){for(var s=0,o=0,a=n.length>>>1,f=0;a>f;f++)s<<=1,s|=t>>>n[f]&1;for(var f=a;f<n.length;f++)o<<=1,o|=e>>>n[f]&1;r[i+0]=s>>>0,r[i+1]=o>>>0},r.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var s=23;s>=15;s-=4)n<<=6,n|=t>>>s&63;for(var s=11;s>=3;s-=4)i|=t>>>s&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(t,e){for(var r=0,n=0;4>n;n++){var s=t>>>18-6*n&63,o=i[64*n+s];r<<=4,r|=o}for(var n=0;4>n;n++){var s=e>>>18-6*n&63,o=i[256+64*n+s];r<<=4,r|=o}return r>>>0};var s=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(t){for(var e=0,r=0;r<s.length;r++)e<<=1,e|=t>>>s[r]&1;return e>>>0},r.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],s=0;e>s;s+=r)i.push(n.slice(s,s+r));return i.join(" ")}},{}],80:[function(t,e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}e.exports=n,n.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},{}],81:[function(t,e,r){(function(r){function n(t,e,n,s){r.isBuffer(t)||(t=new r(t,"binary")),e&&!r.isBuffer(e)&&(e=new r(e,"binary")),n/=8,s=s||0;for(var o,a,f=0,u=0,c=new r(n),h=new r(s),d=0,p=[];;){if(d++>0&&p.push(o),p.push(t),e&&p.push(e),o=i(r.concat(p)),p=[],a=0,n>0)for(;;){if(0===n)break;if(a===o.length)break;c[f++]=o[a],n--,a++}if(s>0&&a!==o.length)for(;;){if(0===s)break;if(a===o.length)break;h[u++]=o[a],s--,a++}if(0===n&&0===s)break}for(a=0;a<o.length;a++)o[a]=0;return{key:c,iv:h}}var i=t("create-hash/md5");e.exports=n}).call(this,t("buffer").Buffer)},{buffer:48,"create-hash/md5":178}],82:[function(t,e,r){(function(t){"use strict";r["RSA-SHA224"]=r.sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:new t("302d300d06096086480165030402040500041c","hex")},r["RSA-SHA256"]=r.sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:new t("3031300d060960864801650304020105000420","hex")},r["RSA-SHA384"]=r.sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:new t("3041300d060960864801650304020205000430","hex")},r["RSA-SHA512"]=r.sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:new t("3051300d060960864801650304020305000440","hex")},r["RSA-SHA1"]={sign:"rsa",hash:"sha1",id:new t("3021300906052b0e03021a05000414","hex")},r["ecdsa-with-SHA1"]={sign:"ecdsa",hash:"sha1",id:new t("","hex")},r.DSA=r["DSA-SHA1"]=r["DSA-SHA"]={sign:"dsa",hash:"sha1",id:new t("","hex")},r["DSA-SHA224"]=r["DSA-WITH-SHA224"]={sign:"dsa",hash:"sha224",id:new t("","hex")},r["DSA-SHA256"]=r["DSA-WITH-SHA256"]={sign:"dsa",hash:"sha256",id:new t("","hex")},r["DSA-SHA384"]=r["DSA-WITH-SHA384"]={sign:"dsa",hash:"sha384",id:new t("","hex")},r["DSA-SHA512"]=r["DSA-WITH-SHA512"]={sign:"dsa",hash:"sha512",id:new t("","hex")},r["DSA-RIPEMD160"]={sign:"dsa",hash:"rmd160",id:new t("","hex")},r["RSA-RIPEMD160"]=r.ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:new t("3021300906052b2403020105000414","hex")},r["RSA-MD5"]=r.md5WithRSAEncryption={sign:"rsa",hash:"md5",id:new t("3020300c06082a864886f70d020505000410","hex")}}).call(this,t("buffer").Buffer)},{buffer:48}],83:[function(t,e,r){(function(r){function n(t){h.Writable.call(this);var e=p[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=f(e.hash),this._tag=e.id,this._signType=e.sign}function i(t){h.Writable.call(this);var e=p[t];if(!e)throw new Error("Unknown message digest");this._hash=f(e.hash),this._tag=e.id,this._signType=e.sign}function s(t){return new n(t)}function o(t){return new i(t)}var a=t("./algos"),f=t("create-hash"),u=t("inherits"),c=t("./sign"),h=t("stream"),d=t("./verify"),p={};Object.keys(a).forEach(function(t){p[t]=p[t.toLowerCase()]=a[t]}),u(n,h.Writable),n.prototype._write=function(t,e,r){this._hash.update(t),r()},n.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},n.prototype.sign=function(t,e){this.end();var n=this._hash.digest(),i=c(r.concat([this._tag,n]),t,this._hashType,this._signType);return e?i.toString(e):i},u(i,h.Writable),i.prototype._write=function(t,e,r){this._hash.update(t),r()},i.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},i.prototype.verify=function(t,e,n){"string"==typeof e&&(e=new r(e,n)),this.end();var i=this._hash.digest();return d(e,r.concat([this._tag,i]),t,this._signType)},e.exports={Sign:s,Verify:o,createSign:s,createVerify:o}}).call(this,t("buffer").Buffer)},{"./algos":82,"./sign":148,"./verify":149,buffer:48,"create-hash":176,inherits:296,stream:265}],84:[function(t,e,r){"use strict";r["1.3.132.0.10"]="secp256k1",r["1.3.132.0.33"]="p224",r["1.2.840.10045.3.1.1"]="p192",r["1.2.840.10045.3.1.7"]="p256",r["1.3.132.0.34"]="p384",r["1.3.132.0.35"]="p521"},{}],85:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.negative=0,this.words=null,this.length=0,this.red=null,void(null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))))}function o(t,e,r){for(var n=0,i=Math.min(t.length,r),s=e;i>s;s++){var o=t.charCodeAt(s)-48;n<<=4,n|=o>=49&&54>=o?o-49+10:o>=17&&22>=o?o-17+10:15&o}return n}function a(t,e,r,n){for(var i=0,s=Math.min(t.length,r),o=e;s>o;o++){var a=t.charCodeAt(o)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}function f(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}function u(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],s=0|e.words[0],o=i*s,a=67108863&o,f=o/67108864|0;r.words[0]=a;for(var u=1;n>u;u++){for(var c=f>>>26,h=67108863&f,d=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);d>=p;p++){var l=u-p|0;i=0|t.words[l],s=0|e.words[p],o=i*s+h,c+=o/67108864|0,h=67108863&o}r.words[u]=0|h,f=0|c}return 0!==f?r.words[u]=0|f:r.length--,r.strip()}function c(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,s=0;s<r.length-1;s++){var o=i;i=0;for(var a=67108863&n,f=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);f>=u;u++){var c=s-u,h=0|t.words[c],d=0|e.words[u],p=h*d,l=67108863&p;o=o+(p/67108864|0)|0,l=l+a|0,a=67108863&l,o=o+(l>>>26)|0,i+=o>>>26,o&=67108863}r.words[s]=a,n=o,o=i}return 0!==n?r.words[s]=n:r.length--,r.strip()}function h(t,e,r){var n=new d;return n.mulp(t,e,r)}function d(t,e){this.x=t,this.y=e}function p(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){p.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){p.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){p.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){p.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function v(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof e?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var _;try{_=t("buffer").Buffer}catch(w){}s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&36>=e),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initNumber=function(t,e,r){0>t&&(this.negative=1,t=-t),67108864>t?(this.words=[67108863&t],this.length=1):4503599627370496>t?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(9007199254740992>t),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var s,o,a=0;if("be"===r)for(i=t.length-1,s=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,a+=24,a>=26&&(a-=26,s++);else if("le"===r)for(i=0,s=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,a+=24,a>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,s=0;for(r=t.length-6,n=0;r>=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<<s&67108863,this.words[n+1]|=i>>>26-s&4194303,s+=24,s>=26&&(s-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<<s&67108863,this.words[n+1]|=i>>>26-s&4194303),this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;67108863>=i;i*=e)n++;n--,i=i/e|0;for(var s=t.length-r,o=s%n,f=Math.min(s,s-o)+r,u=0,c=r;f>c;c+=n)u=a(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var h=1;for(u=a(t,c,t.length,e),c=0;o>c;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var S=["","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"],I=[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],k=[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];s.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,s=0,o=0;o<this.length;o++){var a=this.words[o],f=(16777215&(a<<i|s)).toString(16);s=a>>>24-i&16777215,r=0!==s||o!==this.length-1?S[6-f.length]+f+r:f+r,i+=2,i>=26&&(i-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&36>=t){var u=I[t],c=k[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var d=h.modn(c).toString(t);h=h.idivn(c),r=h.isZero()?d+r:S[u-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t,e=this.bitLength();return 26>=e?t=this.words[0]:52>=e?t=67108864*this.words[1]+this.words[0]:53===e?t=4503599627370496+67108864*this.words[1]+this.words[0]:n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return n("undefined"!=typeof _),new _(this.toArray(t,e))},s.prototype.toArray=function(t,e){var r=this.byteLength(),i=e||Math.max(1,r);n(i>=r,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var s,o,a="le"===t,f=new Array(i),u=this.clone();if(a){for(o=0;!u.isZero();o++)s=u.andln(255),u.iushrn(8),f[o]=s;for(;i>o;o++)f[o]=0}else{for(o=0;i-r>o;o++)f[o]=0;for(o=0;!u.isZero();o++)s=u.andln(255),u.iushrn(8),f[i-o-1]=s}return f},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){n("number"==typeof t&&t>=0);for(var e=0|Math.ceil(t/26),r=t%26;this.length<e;)this.words[this.length++]=0;r>0&&e--;for(var i=0;e>i;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);for(var r=t/26|0,i=t%26;this.length<=r;)this.words[this.length++]=0;return e?this.words[r]=this.words[r]|1<<i:this.words[r]=this.words[r]&~(1<<i),this.strip()},s.prototype.iadd=function(t){var e;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();var r,n;this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,s=0;s<n.length;s++)e=(0|r.words[s])+(0|n.words[s])+i,this.words[s]=67108863&e,i=e>>>26;for(;0!==i&&s<r.length;s++)e=(0|r.words[s])+i,this.words[s]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var s=0,o=0;o<i.length;o++)e=(0|n.words[o])-(0|i.words[o])+s,
s=e>>26,this.words[o]=67108863&e;for(;0!==s&&o<n.length;o++)e=(0|n.words[o])+s,s=e>>26,this.words[o]=67108863&e;if(0===s&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var E=function(t,e,r){var n,i,s,o=t.words,a=e.words,f=r.words,u=0,c=0|o[0],h=8191&c,d=c>>>13,p=0|o[1],l=8191&p,b=p>>>13,g=0|o[2],m=8191&g,y=g>>>13,v=0|o[3],_=8191&v,w=v>>>13,S=0|o[4],I=8191&S,k=S>>>13,E=0|o[5],A=8191&E,x=E>>>13,P=0|o[6],O=8191&P,B=P>>>13,M=0|o[7],R=8191&M,T=M>>>13,C=0|o[8],N=8191&C,j=C>>>13,U=0|o[9],L=8191&U,D=U>>>13,z=0|a[0],F=8191&z,K=z>>>13,H=0|a[1],q=8191&H,V=H>>>13,Y=0|a[2],G=8191&Y,W=Y>>>13,X=0|a[3],J=8191&X,Z=X>>>13,Q=0|a[4],$=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],st=8191&it,ot=it>>>13,at=0|a[7],ft=8191&at,ut=at>>>13,ct=0|a[8],ht=8191&ct,dt=ct>>>13,pt=0|a[9],lt=8191&pt,bt=pt>>>13;r.negative=t.negative^e.negative,r.length=19,n=Math.imul(h,F),i=Math.imul(h,K),i+=Math.imul(d,F),s=Math.imul(d,K);var gt=u+n+((8191&i)<<13);u=s+(i>>>13)+(gt>>>26),gt&=67108863,n=Math.imul(l,F),i=Math.imul(l,K),i+=Math.imul(b,F),s=Math.imul(b,K),n+=Math.imul(h,q),i+=Math.imul(h,V),i+=Math.imul(d,q),s+=Math.imul(d,V);var mt=u+n+((8191&i)<<13);u=s+(i>>>13)+(mt>>>26),mt&=67108863,n=Math.imul(m,F),i=Math.imul(m,K),i+=Math.imul(y,F),s=Math.imul(y,K),n+=Math.imul(l,q),i+=Math.imul(l,V),i+=Math.imul(b,q),s+=Math.imul(b,V),n+=Math.imul(h,G),i+=Math.imul(h,W),i+=Math.imul(d,G),s+=Math.imul(d,W);var yt=u+n+((8191&i)<<13);u=s+(i>>>13)+(yt>>>26),yt&=67108863,n=Math.imul(_,F),i=Math.imul(_,K),i+=Math.imul(w,F),s=Math.imul(w,K),n+=Math.imul(m,q),i+=Math.imul(m,V),i+=Math.imul(y,q),s+=Math.imul(y,V),n+=Math.imul(l,G),i+=Math.imul(l,W),i+=Math.imul(b,G),s+=Math.imul(b,W),n+=Math.imul(h,J),i+=Math.imul(h,Z),i+=Math.imul(d,J),s+=Math.imul(d,Z);var vt=u+n+((8191&i)<<13);u=s+(i>>>13)+(vt>>>26),vt&=67108863,n=Math.imul(I,F),i=Math.imul(I,K),i+=Math.imul(k,F),s=Math.imul(k,K),n+=Math.imul(_,q),i+=Math.imul(_,V),i+=Math.imul(w,q),s+=Math.imul(w,V),n+=Math.imul(m,G),i+=Math.imul(m,W),i+=Math.imul(y,G),s+=Math.imul(y,W),n+=Math.imul(l,J),i+=Math.imul(l,Z),i+=Math.imul(b,J),s+=Math.imul(b,Z),n+=Math.imul(h,$),i+=Math.imul(h,tt),i+=Math.imul(d,$),s+=Math.imul(d,tt);var _t=u+n+((8191&i)<<13);u=s+(i>>>13)+(_t>>>26),_t&=67108863,n=Math.imul(A,F),i=Math.imul(A,K),i+=Math.imul(x,F),s=Math.imul(x,K),n+=Math.imul(I,q),i+=Math.imul(I,V),i+=Math.imul(k,q),s+=Math.imul(k,V),n+=Math.imul(_,G),i+=Math.imul(_,W),i+=Math.imul(w,G),s+=Math.imul(w,W),n+=Math.imul(m,J),i+=Math.imul(m,Z),i+=Math.imul(y,J),s+=Math.imul(y,Z),n+=Math.imul(l,$),i+=Math.imul(l,tt),i+=Math.imul(b,$),s+=Math.imul(b,tt),n+=Math.imul(h,rt),i+=Math.imul(h,nt),i+=Math.imul(d,rt),s+=Math.imul(d,nt);var wt=u+n+((8191&i)<<13);u=s+(i>>>13)+(wt>>>26),wt&=67108863,n=Math.imul(O,F),i=Math.imul(O,K),i+=Math.imul(B,F),s=Math.imul(B,K),n+=Math.imul(A,q),i+=Math.imul(A,V),i+=Math.imul(x,q),s+=Math.imul(x,V),n+=Math.imul(I,G),i+=Math.imul(I,W),i+=Math.imul(k,G),s+=Math.imul(k,W),n+=Math.imul(_,J),i+=Math.imul(_,Z),i+=Math.imul(w,J),s+=Math.imul(w,Z),n+=Math.imul(m,$),i+=Math.imul(m,tt),i+=Math.imul(y,$),s+=Math.imul(y,tt),n+=Math.imul(l,rt),i+=Math.imul(l,nt),i+=Math.imul(b,rt),s+=Math.imul(b,nt),n+=Math.imul(h,st),i+=Math.imul(h,ot),i+=Math.imul(d,st),s+=Math.imul(d,ot);var St=u+n+((8191&i)<<13);u=s+(i>>>13)+(St>>>26),St&=67108863,n=Math.imul(R,F),i=Math.imul(R,K),i+=Math.imul(T,F),s=Math.imul(T,K),n+=Math.imul(O,q),i+=Math.imul(O,V),i+=Math.imul(B,q),s+=Math.imul(B,V),n+=Math.imul(A,G),i+=Math.imul(A,W),i+=Math.imul(x,G),s+=Math.imul(x,W),n+=Math.imul(I,J),i+=Math.imul(I,Z),i+=Math.imul(k,J),s+=Math.imul(k,Z),n+=Math.imul(_,$),i+=Math.imul(_,tt),i+=Math.imul(w,$),s+=Math.imul(w,tt),n+=Math.imul(m,rt),i+=Math.imul(m,nt),i+=Math.imul(y,rt),s+=Math.imul(y,nt),n+=Math.imul(l,st),i+=Math.imul(l,ot),i+=Math.imul(b,st),s+=Math.imul(b,ot),n+=Math.imul(h,ft),i+=Math.imul(h,ut),i+=Math.imul(d,ft),s+=Math.imul(d,ut);var It=u+n+((8191&i)<<13);u=s+(i>>>13)+(It>>>26),It&=67108863,n=Math.imul(N,F),i=Math.imul(N,K),i+=Math.imul(j,F),s=Math.imul(j,K),n+=Math.imul(R,q),i+=Math.imul(R,V),i+=Math.imul(T,q),s+=Math.imul(T,V),n+=Math.imul(O,G),i+=Math.imul(O,W),i+=Math.imul(B,G),s+=Math.imul(B,W),n+=Math.imul(A,J),i+=Math.imul(A,Z),i+=Math.imul(x,J),s+=Math.imul(x,Z),n+=Math.imul(I,$),i+=Math.imul(I,tt),i+=Math.imul(k,$),s+=Math.imul(k,tt),n+=Math.imul(_,rt),i+=Math.imul(_,nt),i+=Math.imul(w,rt),s+=Math.imul(w,nt),n+=Math.imul(m,st),i+=Math.imul(m,ot),i+=Math.imul(y,st),s+=Math.imul(y,ot),n+=Math.imul(l,ft),i+=Math.imul(l,ut),i+=Math.imul(b,ft),s+=Math.imul(b,ut),n+=Math.imul(h,ht),i+=Math.imul(h,dt),i+=Math.imul(d,ht),s+=Math.imul(d,dt);var kt=u+n+((8191&i)<<13);u=s+(i>>>13)+(kt>>>26),kt&=67108863,n=Math.imul(L,F),i=Math.imul(L,K),i+=Math.imul(D,F),s=Math.imul(D,K),n+=Math.imul(N,q),i+=Math.imul(N,V),i+=Math.imul(j,q),s+=Math.imul(j,V),n+=Math.imul(R,G),i+=Math.imul(R,W),i+=Math.imul(T,G),s+=Math.imul(T,W),n+=Math.imul(O,J),i+=Math.imul(O,Z),i+=Math.imul(B,J),s+=Math.imul(B,Z),n+=Math.imul(A,$),i+=Math.imul(A,tt),i+=Math.imul(x,$),s+=Math.imul(x,tt),n+=Math.imul(I,rt),i+=Math.imul(I,nt),i+=Math.imul(k,rt),s+=Math.imul(k,nt),n+=Math.imul(_,st),i+=Math.imul(_,ot),i+=Math.imul(w,st),s+=Math.imul(w,ot),n+=Math.imul(m,ft),i+=Math.imul(m,ut),i+=Math.imul(y,ft),s+=Math.imul(y,ut),n+=Math.imul(l,ht),i+=Math.imul(l,dt),i+=Math.imul(b,ht),s+=Math.imul(b,dt),n+=Math.imul(h,lt),i+=Math.imul(h,bt),i+=Math.imul(d,lt),s+=Math.imul(d,bt);var Et=u+n+((8191&i)<<13);u=s+(i>>>13)+(Et>>>26),Et&=67108863,n=Math.imul(L,q),i=Math.imul(L,V),i+=Math.imul(D,q),s=Math.imul(D,V),n+=Math.imul(N,G),i+=Math.imul(N,W),i+=Math.imul(j,G),s+=Math.imul(j,W),n+=Math.imul(R,J),i+=Math.imul(R,Z),i+=Math.imul(T,J),s+=Math.imul(T,Z),n+=Math.imul(O,$),i+=Math.imul(O,tt),i+=Math.imul(B,$),s+=Math.imul(B,tt),n+=Math.imul(A,rt),i+=Math.imul(A,nt),i+=Math.imul(x,rt),s+=Math.imul(x,nt),n+=Math.imul(I,st),i+=Math.imul(I,ot),i+=Math.imul(k,st),s+=Math.imul(k,ot),n+=Math.imul(_,ft),i+=Math.imul(_,ut),i+=Math.imul(w,ft),s+=Math.imul(w,ut),n+=Math.imul(m,ht),i+=Math.imul(m,dt),i+=Math.imul(y,ht),s+=Math.imul(y,dt),n+=Math.imul(l,lt),i+=Math.imul(l,bt),i+=Math.imul(b,lt),s+=Math.imul(b,bt);var At=u+n+((8191&i)<<13);u=s+(i>>>13)+(At>>>26),At&=67108863,n=Math.imul(L,G),i=Math.imul(L,W),i+=Math.imul(D,G),s=Math.imul(D,W),n+=Math.imul(N,J),i+=Math.imul(N,Z),i+=Math.imul(j,J),s+=Math.imul(j,Z),n+=Math.imul(R,$),i+=Math.imul(R,tt),i+=Math.imul(T,$),s+=Math.imul(T,tt),n+=Math.imul(O,rt),i+=Math.imul(O,nt),i+=Math.imul(B,rt),s+=Math.imul(B,nt),n+=Math.imul(A,st),i+=Math.imul(A,ot),i+=Math.imul(x,st),s+=Math.imul(x,ot),n+=Math.imul(I,ft),i+=Math.imul(I,ut),i+=Math.imul(k,ft),s+=Math.imul(k,ut),n+=Math.imul(_,ht),i+=Math.imul(_,dt),i+=Math.imul(w,ht),s+=Math.imul(w,dt),n+=Math.imul(m,lt),i+=Math.imul(m,bt),i+=Math.imul(y,lt),s+=Math.imul(y,bt);var xt=u+n+((8191&i)<<13);u=s+(i>>>13)+(xt>>>26),xt&=67108863,n=Math.imul(L,J),i=Math.imul(L,Z),i+=Math.imul(D,J),s=Math.imul(D,Z),n+=Math.imul(N,$),i+=Math.imul(N,tt),i+=Math.imul(j,$),s+=Math.imul(j,tt),n+=Math.imul(R,rt),i+=Math.imul(R,nt),i+=Math.imul(T,rt),s+=Math.imul(T,nt),n+=Math.imul(O,st),i+=Math.imul(O,ot),i+=Math.imul(B,st),s+=Math.imul(B,ot),n+=Math.imul(A,ft),i+=Math.imul(A,ut),i+=Math.imul(x,ft),s+=Math.imul(x,ut),n+=Math.imul(I,ht),i+=Math.imul(I,dt),i+=Math.imul(k,ht),s+=Math.imul(k,dt),n+=Math.imul(_,lt),i+=Math.imul(_,bt),i+=Math.imul(w,lt),s+=Math.imul(w,bt);var Pt=u+n+((8191&i)<<13);u=s+(i>>>13)+(Pt>>>26),Pt&=67108863,n=Math.imul(L,$),i=Math.imul(L,tt),i+=Math.imul(D,$),s=Math.imul(D,tt),n+=Math.imul(N,rt),i+=Math.imul(N,nt),i+=Math.imul(j,rt),s+=Math.imul(j,nt),n+=Math.imul(R,st),i+=Math.imul(R,ot),i+=Math.imul(T,st),s+=Math.imul(T,ot),n+=Math.imul(O,ft),i+=Math.imul(O,ut),i+=Math.imul(B,ft),s+=Math.imul(B,ut),n+=Math.imul(A,ht),i+=Math.imul(A,dt),i+=Math.imul(x,ht),s+=Math.imul(x,dt),n+=Math.imul(I,lt),i+=Math.imul(I,bt),i+=Math.imul(k,lt),s+=Math.imul(k,bt);var Ot=u+n+((8191&i)<<13);u=s+(i>>>13)+(Ot>>>26),Ot&=67108863,n=Math.imul(L,rt),i=Math.imul(L,nt),i+=Math.imul(D,rt),s=Math.imul(D,nt),n+=Math.imul(N,st),i+=Math.imul(N,ot),i+=Math.imul(j,st),s+=Math.imul(j,ot),n+=Math.imul(R,ft),i+=Math.imul(R,ut),i+=Math.imul(T,ft),s+=Math.imul(T,ut),n+=Math.imul(O,ht),i+=Math.imul(O,dt),i+=Math.imul(B,ht),s+=Math.imul(B,dt),n+=Math.imul(A,lt),i+=Math.imul(A,bt),i+=Math.imul(x,lt),s+=Math.imul(x,bt);var Bt=u+n+((8191&i)<<13);u=s+(i>>>13)+(Bt>>>26),Bt&=67108863,n=Math.imul(L,st),i=Math.imul(L,ot),i+=Math.imul(D,st),s=Math.imul(D,ot),n+=Math.imul(N,ft),i+=Math.imul(N,ut),i+=Math.imul(j,ft),s+=Math.imul(j,ut),n+=Math.imul(R,ht),i+=Math.imul(R,dt),i+=Math.imul(T,ht),s+=Math.imul(T,dt),n+=Math.imul(O,lt),i+=Math.imul(O,bt),i+=Math.imul(B,lt),s+=Math.imul(B,bt);var Mt=u+n+((8191&i)<<13);u=s+(i>>>13)+(Mt>>>26),Mt&=67108863,n=Math.imul(L,ft),i=Math.imul(L,ut),i+=Math.imul(D,ft),s=Math.imul(D,ut),n+=Math.imul(N,ht),i+=Math.imul(N,dt),i+=Math.imul(j,ht),s+=Math.imul(j,dt),n+=Math.imul(R,lt),i+=Math.imul(R,bt),i+=Math.imul(T,lt),s+=Math.imul(T,bt);var Rt=u+n+((8191&i)<<13);u=s+(i>>>13)+(Rt>>>26),Rt&=67108863,n=Math.imul(L,ht),i=Math.imul(L,dt),i+=Math.imul(D,ht),s=Math.imul(D,dt),n+=Math.imul(N,lt),i+=Math.imul(N,bt),i+=Math.imul(j,lt),s+=Math.imul(j,bt);var Tt=u+n+((8191&i)<<13);u=s+(i>>>13)+(Tt>>>26),Tt&=67108863,n=Math.imul(L,lt),i=Math.imul(L,bt),i+=Math.imul(D,lt),s=Math.imul(D,bt);var Ct=u+n+((8191&i)<<13);return u=s+(i>>>13)+(Ct>>>26),Ct&=67108863,f[0]=gt,f[1]=mt,f[2]=yt,f[3]=vt,f[4]=_t,f[5]=wt,f[6]=St,f[7]=It,f[8]=kt,f[9]=Et,f[10]=At,f[11]=xt,f[12]=Pt,f[13]=Ot,f[14]=Bt,f[15]=Mt,f[16]=Rt,f[17]=Tt,f[18]=Ct,0!==u&&(f[19]=u,r.length++),r};Math.imul||(E=u),s.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?E(this,t,e):63>n?u(this,t,e):1024>n?c(this,t,e):h(this,t,e)},d.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;t>n;n++)e[n]=this.revBin(n,r,t);return e},d.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;e>i;i++)n|=(1&t)<<e-i-1,t>>=1;return n},d.prototype.permute=function(t,e,r,n,i,s){for(var o=0;s>o;o++)n[o]=e[t[o]],i[o]=r[t[o]]},d.prototype.transform=function(t,e,r,n,i,s){this.permute(s,t,e,r,n,i);for(var o=1;i>o;o<<=1)for(var a=o<<1,f=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),c=0;i>c;c+=a)for(var h=f,d=u,p=0;o>p;p++){var l=r[c+p],b=n[c+p],g=r[c+p+o],m=n[c+p+o],y=h*g-d*m;m=h*m+d*g,g=y,r[c+p]=l+g,n[c+p]=b+m,r[c+p+o]=l-g,n[c+p+o]=b-m,p!==a&&(y=f*h-u*d,d=f*d+u*h,h=y)}},d.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},d.prototype.conjugate=function(t,e,r){if(!(1>=r))for(var n=0;r/2>n;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},d.prototype.normalize13b=function(t,e){for(var r=0,n=0;e/2>n;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=67108864>i?0:i/67108864|0}return t},d.prototype.convert13b=function(t,e,r,i){for(var s=0,o=0;e>o;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;i>o;++o)r[o]=0;n(0===s),n(0===(-8192&s))},d.prototype.stub=function(t){for(var e=new Array(t),r=0;t>r;r++)e[r]=0;return e},d.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),s=this.stub(n),o=new Array(n),a=new Array(n),f=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,s,a,f,n,i),this.transform(u,s,c,h,n,i);for(var p=0;n>p;p++){var l=a[p]*c[p]-f[p]*h[p];f[p]=a[p]*h[p]+f[p]*c[p],a[p]=l}return this.conjugate(a,f,n),this.transform(a,f,d,s,n,i),this.conjugate(d,s,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),h(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){n("number"==typeof t);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,s=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=s>>>26,this.words[r]=67108863&s}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=f(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,f=(0|this.words[e])-a<<r;this.words[e]=f|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;i>e;e++)this.words[e]=0;this.length+=i}return this.strip()},s.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){n("number"==typeof t&&t>=0);var i;i=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,f=r;if(i-=o,i=Math.max(0,i),f){for(var u=0;o>u;u++)f.words[u]=this.words[u];f.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-s|h>>>s,c=h&a}return f&&0!==c&&(f.words[f.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return!1;var s=this.words[r];return!!(s&i)},s.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return n("number"==typeof t),0>t?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(n("number"==typeof t),0>t)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 e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var i,s=t.length+r;if(this.words.length<s){var o=new Array(s);for(i=0;i<this.length;i++)o[i]=this.words[i];this.words=o}else i=this.length;for(this.length=Math.max(this.length,s);i<this.length;i++)this.words[i]=0;var a,f=0;for(i=0;i<t.length;i++){a=(0|this.words[i+r])+f;var u=(0|t.words[i])*e;a-=67108863&u,f=(a>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)a=(0|this.words[i+r])+f,f=a>>26,this.words[i+r]=67108863&a;if(0===f)return this.strip();for(n(-1===f),f=0,i=0;i<this.length;i++)a=-(0|this.words[i])+f,f=a>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),i=t,o=0|i.words[i.length-1],a=this._countBits(o);r=26-a,0!==r&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var f,u=n.length-i.length;if("mod"!==e){f=new s(null),f.length=u+1,f.words=new Array(f.length);for(var c=0;c<f.length;c++)f.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,f&&(f.words[u]=1));for(var d=u-1;d>=0;d--){var p=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(i,p,d);0!==n.negative;)p--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);f&&(f.words[d]=p)}return f&&f.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:f||null,mod:n}},s.prototype.divmod=function(t,e,r){n(!t.isZero());var i,o,a;return 0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e)},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),s=r.cmp(n);return 0>s||1===i&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){n(67108863>=t);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},s.prototype.idivn=function(t){n(67108863>=t);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new s(1),o=new s(0),a=new s(0),f=new s(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,p=1;0===(e.words[0]&p)&&26>d;++d,p<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var l=0,b=1;0===(r.words[0]&b)&&26>l;++l,b<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(c),f.isub(h)),a.iushrn(1),f.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),o.isub(f)):(r.isub(e),a.isub(i),f.isub(o))}return{a:a,b:f,gcd:r.iushln(u)}},s.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new s(1),o=new s(0),a=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0===(e.words[0]&u)&&26>f;++f,u<<=1);if(f>0)for(e.iushrn(f);f-- >0;)i.isOdd()&&i.iadd(a),i.iushrn(1);for(var c=0,h=1;0===(r.words[0]&h)&&26>c;++c,h<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var d;return d=0===e.cmpn(1)?i:o,d.cmpn(0)<0&&d.iadd(t),d},s.prototype.gcd=function(t){if(this.isZero())return t.clone();if(t.isZero())return this.clone();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(0>i){var s=e;e=r,r=s}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0===(1&this.words[0])},s.prototype.isOdd=function(){return 1===(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r){for(var s=this.length;r+1>s;s++)this.words[s]=0;return this.words[r]|=i,this.length=r+1,this}var o=i;for(s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];a+=o,o=a>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e=0>t;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(67108863>=t,"Number is too big");var i=0|this.words[0];r=i===t?0:t>i?-1:1}return 0!==this.negative&&(r=-r),r},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){i>n?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new y(t)},s.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.ushl(this,t)},s.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var A={k256:null,p224:null,p192:null,p25519:null};p.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},p.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength();while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},p.prototype.split=function(t,e){t.iushrn(this.n,0,e)},p.prototype.imulK=function(t){return t.imul(this.k)},i(l,p),l.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;n>i;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&r,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(o&r)<<4|s>>>22,s=o}t.words[i-10]=s>>>22,t.length-=9},l.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,p),i(g,p),i(m,p),m.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function x(t){if(A[t])return A[t];var x;if("k256"===t)x=new l;else if("p224"===t)x=new b;else if("p192"===t)x=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);x=new m}return A[t]=x,x},y.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},y.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},y.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},y.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},y.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},y.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},y.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var a=new s(1).toRed(this),f=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);0!==this.pow(c,u).cmp(f);)c.redIAdd(f);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),l=o;0!==p.cmp(a);){for(var b=p,g=0;0!==b.cmp(a);g++)b=b.redSqr();n(l>g);var m=this.pow(h,new s(1).iushln(l-g-1));d=d.redMul(m),h=m.redSqr(),p=p.redMul(h),l=g}return d},y.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},y.prototype.pow=function(t,e){if(e.isZero())return new s(1);if(0===e.cmpn(1))return t.clone();var r=4,n=new Array(1<<r);n[0]=new s(1).toRed(this),n[1]=t;for(var i=2;i<n.length;i++)n[i]=this.mul(n[i-1],t);var o=n[0],a=0,f=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var c=e.words[i],h=u-1;h>=0;h--){var d=c>>h&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,f++,(f===r||0===i&&0===h)&&(o=this.mul(o,n[a]),f=0,a=0)):f=0}u=26}return o},y.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},y.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new v(t)},i(v,y),v.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},v.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},v.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},v.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},v.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}("undefined"==typeof e||e,this)},{buffer:47}],86:[function(t,e,r){(function(r){function n(t){var e=s(t),r=e.toRed(o.mont(t.modulus)).redPow(new o(t.publicExponent)).fromRed();return{blinder:r,unblinder:e.invm(t.modulus)}}function i(t,e){var i=n(e),s=e.modulus.byteLength(),a=(o.mont(e.modulus),new o(t).mul(i.blinder).umod(e.modulus)),f=a.toRed(o.mont(e.prime1)),u=a.toRed(o.mont(e.prime2)),c=e.coefficient,h=e.prime1,d=e.prime2,p=f.redPow(e.exponent1),l=u.redPow(e.exponent2);p=p.fromRed(),l=l.fromRed();var b=p.isub(l).imul(c).umod(h);return b.imul(d),l.iadd(b),new r(l.imul(i.unblinder).umod(e.modulus).toArray(!1,s))}function s(t){for(var e=t.modulus.byteLength(),r=new o(a(e));r.cmp(t.modulus)>=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new o(a(e));return r}var o=t("bn.js"),a=t("randombytes");e.exports=i,i.getr=s}).call(this,t("buffer").Buffer)},{"bn.js":85,buffer:48,randombytes:243}],87:[function(t,e,r){"use strict";var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.hmacDRBG=t("./elliptic/hmac-drbg"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":110,"./elliptic/curve":90,"./elliptic/curves":93,"./elliptic/ec":94,"./elliptic/eddsa":97,"./elliptic/hmac-drbg":100,"./elliptic/utils":102,brorand:103}],88:[function(t,e,r){"use strict";function n(t,e){this.type=t,this.p=new s(e.p,16),this.red=e.prime?s.red(e.prime):s.mont(this.p),this.zero=new s(0).toRed(this.red),this.one=new s(1).toRed(this.red),this.two=new s(2).toRed(this.red),this.n=e.n&&new s(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function i(t,e){this.curve=t,this.type=e,this.precomputed=null}var s=t("bn.js"),o=t("../../elliptic"),a=o.utils,f=a.getNAF,u=a.getJSF,c=a.assert;e.exports=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(t,e){c(t.precomputed);var r=t._getDoubles(),n=f(e,1),i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;for(var s=[],o=0;o<n.length;o+=r.step){for(var a=0,e=o+r.step-1;e>=o;e--)a=(a<<1)+n[e];s.push(a)}for(var u=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(var o=0;o<s.length;o++){var a=s[o];a===d?h=h.mixedAdd(r.points[o]):a===-d&&(h=h.mixedAdd(r.points[o].neg()))}u=u.add(h)}return u.toP()},n.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=f(e,r),o=this.jpoint(null,null,null),a=s.length-1;a>=0;a--){for(var e=0;a>=0&&0===s[a];a--)e++;
if(a>=0&&e++,o=o.dblp(e),0>a)break;var u=s[a];c(0!==u),o="affine"===t.type?u>0?o.mixedAdd(i[u-1>>1]):o.mixedAdd(i[-u-1>>1].neg()):u>0?o.add(i[u-1>>1]):o.add(i[-u-1>>1].neg())}return"affine"===t.type?o.toP():o},n.prototype._wnafMulAdd=function(t,e,r,n){for(var i=this._wnafT1,s=this._wnafT2,o=this._wnafT3,a=0,c=0;n>c;c++){var h=e[c],d=h._getNAFPoints(t);i[c]=d.wnd,s[c]=d.points}for(var c=n-1;c>=1;c-=2){var p=c-1,l=c;if(1===i[p]&&1===i[l]){var b=[e[p],null,null,e[l]];0===e[p].y.cmp(e[l].y)?(b[1]=e[p].add(e[l]),b[2]=e[p].toJ().mixedAdd(e[l].neg())):0===e[p].y.cmp(e[l].y.redNeg())?(b[1]=e[p].toJ().mixedAdd(e[l]),b[2]=e[p].add(e[l].neg())):(b[1]=e[p].toJ().mixedAdd(e[l]),b[2]=e[p].toJ().mixedAdd(e[l].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],m=u(r[p],r[l]);a=Math.max(m[0].length,a),o[p]=new Array(a),o[l]=new Array(a);for(var y=0;a>y;y++){var v=0|m[0][y],_=0|m[1][y];o[p][y]=g[3*(v+1)+(_+1)],o[l][y]=0,s[p]=b}}else o[p]=f(r[p],i[p]),o[l]=f(r[l],i[l]),a=Math.max(o[p].length,a),a=Math.max(o[l].length,a)}for(var w=this.jpoint(null,null,null),S=this._wnafT4,c=a;c>=0;c--){for(var I=0;c>=0;){for(var k=!0,y=0;n>y;y++)S[y]=0|o[y][c],0!==S[y]&&(k=!1);if(!k)break;I++,c--}if(c>=0&&I++,w=w.dblp(I),0>c)break;for(var y=0;n>y;y++){var h,E=S[y];0!==E&&(E>0?h=s[y][E-1>>1]:0>E&&(h=s[y][-E-1>>1].neg()),w="affine"===h.type?w.mixedAdd(h):w.add(h))}}for(var c=0;n>c;c++)s[c]=null;return w.toP()},n.BasePoint=i,i.prototype.eq=function(){throw new Error("Not implemented")},i.prototype.validate=function(){return this.curve.validate(this)},n.prototype.decodePoint=function(t,e){t=a.toArray(t,e);var r=this.p.byteLength();if(4===t[0]&&t.length-1===2*r)return this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},i.prototype.encodeCompressed=function(t){return this.encode(t,!0)},i.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},i.prototype.encode=function(t,e){return a.encode(this._encode(e),t)},i.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},i.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((t.bitLength()+1)/e.step):!1},i.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;e>i;i+=t){for(var s=0;t>s;s++)n=n.dbl();r.push(n)}return{step:t,points:r}},i.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;r>i;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},i.prototype._getBeta=function(){return null},i.prototype.dblp=function(t){for(var e=this,r=0;t>r;r++)e=e.dbl();return e}},{"../../elliptic":87,"bn.js":85}],89:[function(t,e,r){"use strict";function n(t){this.twisted=1!==(0|t.a),this.mOneA=this.twisted&&-1===(0|t.a),this.extended=this.mOneA,u.call(this,"edwards",t),this.a=new a(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new a(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new a(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|t.c)}function i(t,e,r,n,i){u.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new a(e,16),this.y=new a(r,16),this.z=n?new a(n,16):this.curve.one,this.t=i&&new a(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var s=t("../curve"),o=t("../../elliptic"),a=t("bn.js"),f=t("inherits"),u=s.base,c=o.utils.assert;f(n,u),e.exports=n,n.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},n.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},n.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},n.prototype.pointFromX=function(t,e){t=new a(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(i.redInvm()),o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var f=o.fromRed().isOdd();return(e&&!f||!e&&f)&&(o=o.redNeg()),this.point(t,o)},n.prototype.pointFromY=function(t,e){t=new a(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.one),i=r.redMul(this.d).redAdd(this.one),s=n.redMul(i.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return o.isOdd()!==e&&(o=o.redNeg()),this.point(o,t)},n.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},f(i,u.BasePoint),n.prototype.pointFromJSON=function(t){return i.fromJSON(this,t)},n.prototype.point=function(t,e,r,n){return new i(this,t,e,r,n)},i.fromJSON=function(t,e){return new i(t,e[0],e[1],e[2])},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},i.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),s=n.redAdd(e),o=s.redSub(r),a=n.redSub(e),f=i.redMul(o),u=s.redMul(a),c=i.redMul(a),h=o.redMul(s);return this.curve.point(f,u,h,c)},i.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var o=this.curve._mulA(i),a=o.redAdd(s);if(this.zOne)t=n.redSub(i).redSub(s).redMul(a.redSub(this.curve.two)),e=a.redMul(o.redSub(s)),r=a.redSqr().redSub(a).redSub(a);else{var f=this.z.redSqr(),u=a.redSub(f).redISub(f);t=n.redSub(i).redISub(s).redMul(u),e=a.redMul(o.redSub(s)),r=a.redMul(u)}}else{var o=i.redAdd(s),f=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=o.redSub(f).redSub(f);t=this.curve._mulC(n.redISub(o)).redMul(u),e=this.curve._mulC(o).redMul(i.redISub(s)),r=o.redMul(u)}return this.curve.point(t,e,r)},i.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},i.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),s=r.redSub(e),o=i.redSub(n),a=i.redAdd(n),f=r.redAdd(e),u=s.redMul(o),c=a.redMul(f),h=s.redMul(f),d=o.redMul(a);return this.curve.point(u,c,d,h)},i.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),s=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(s).redMul(o),f=i.redSub(a),u=i.redAdd(a),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(o),h=n.redMul(f).redMul(c);return this.curve.twisted?(e=n.redMul(u).redMul(o.redSub(this.curve._mulA(s))),r=f.redMul(u)):(e=n.redMul(u).redMul(o.redSub(s)),r=this.curve._mulC(f).redMul(u)),this.curve.point(h,e,r)},i.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},i.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},i.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2)},i.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},i.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},i.prototype.getY=function(){return this.normalize(),this.y.fromRed()},i.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},i.prototype.toP=i.prototype.normalize,i.prototype.mixedAdd=i.prototype.add},{"../../elliptic":87,"../curve":90,"bn.js":85,inherits:296}],90:[function(t,e,r){"use strict";var n=r;n.base=t("./base"),n["short"]=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":88,"./edwards":89,"./mont":91,"./short":92}],91:[function(t,e,r){"use strict";function n(t){f.call(this,"mont",t),this.a=new o(t.a,16).toRed(this.red),this.b=new o(t.b,16).toRed(this.red),this.i4=new o(4).toRed(this.red).redInvm(),this.two=new o(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(t,e,r){f.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new o(e,16),this.z=new o(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var s=t("../curve"),o=t("bn.js"),a=t("inherits"),f=s.base,u=t("../../elliptic"),c=u.utils;a(n,f),e.exports=n,n.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e),i=n.redSqrt();return 0===i.redSqr().cmp(n)},a(i,f.BasePoint),n.prototype.decodePoint=function(t,e){return this.point(c.toArray(t,e),1)},n.prototype.point=function(t,e){return new i(this,t,e)},n.prototype.pointFromJSON=function(t){return i.fromJSON(this,t)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(t,e){return new i(t,e[0],e[1]||t.one)},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var t=this.x.redAdd(this.z),e=t.redSqr(),r=this.x.redSub(this.z),n=r.redSqr(),i=e.redSub(n),s=e.redMul(n),o=i.redMul(n.redAdd(this.curve.a24.redMul(i)));return this.curve.point(s,o)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),s=t.x.redSub(t.z),o=s.redMul(r),a=i.redMul(n),f=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(f,u)},i.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=this,s=[];0!==e.cmpn(0);e.iushrn(1))s.push(e.andln(1));for(var o=s.length-1;o>=0;o--)0===s[o]?(r=r.diffAdd(n,i),n=n.dbl()):(n=r.diffAdd(n,i),r=r.dbl());return n},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":87,"../curve":90,"bn.js":85,inherits:296}],92:[function(t,e,r){"use strict";function n(t){c.call(this,"short",t),this.a=new f(t.a,16).toRed(this.red),this.b=new f(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function i(t,e,r,n){c.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new f(e,16),this.y=new f(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function s(t,e,r,n){c.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new f(0)):(this.x=new f(e,16),this.y=new f(r,16),this.z=new f(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var o=t("../curve"),a=t("../../elliptic"),f=t("bn.js"),u=t("inherits"),c=o.base,h=a.utils.assert;u(n,c),e.exports=n,n.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new f(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=n[0].cmp(n[1])<0?n[0]:n[1],e=e.toRed(this.red)}if(t.lambda)r=new f(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],h(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}var s;return s=t.basis?t.basis.map(function(t){return{a:new f(t.a,16),b:new f(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:s}}},n.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:f.mont(t),r=new f(2).toRed(e).redInvm(),n=r.redNeg(),i=new f(3).toRed(e).redNeg().redSqrt().redMul(r),s=n.redAdd(i).fromRed(),o=n.redSub(i).fromRed();return[s,o]},n.prototype._getEndoBasis=function(t){for(var e,r,n,i,s,o,a,u,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,p=this.n.clone(),l=new f(1),b=new f(0),g=new f(0),m=new f(1),y=0;0!==d.cmpn(0);){var v=p.div(d);u=p.sub(v.mul(d)),c=g.sub(v.mul(l));var _=m.sub(v.mul(b));if(!n&&u.cmp(h)<0)e=a.neg(),r=l,n=u.neg(),i=c;else if(n&&2===++y)break;a=u,p=d,d=u,g=l,l=c,m=b,b=_}s=u.neg(),o=c;var w=n.sqr().add(i.sqr()),S=s.sqr().add(o.sqr());return S.cmp(w)>=0&&(s=e,o=r),n.negative&&(n=n.neg(),i=i.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:i},{a:s,b:o}]},n.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=i.mul(r.a),a=s.mul(n.a),f=i.mul(r.b),u=s.mul(n.b),c=t.sub(o).sub(a),h=f.add(u).neg();return{k1:c,k2:h}},n.prototype.pointFromX=function(t,e){t=new f(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},n.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},n.prototype._endoWnafMulAdd=function(t,e){for(var r=this._endoWnafT1,n=this._endoWnafT2,i=0;i<t.length;i++){var s=this._endoSplit(e[i]),o=t[i],a=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),a=a.neg(!0)),r[2*i]=o,r[2*i+1]=a,n[2*i]=s.k1,n[2*i+1]=s.k2}for(var f=this._wnafMulAdd(1,r,n,2*i),u=0;2*i>u;u++)r[u]=null,n[u]=null;return f},u(i,c.BasePoint),n.prototype.point=function(t,e,r){return new i(this,t,e,r)},n.prototype.pointFromJSON=function(t,e){return i.fromJSON(this,t,e)},i.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},i.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},i.fromJSON=function(t,e,r){function n(e){return t.point(e[0],e[1],r)}"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;var s=e[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(n))}},i},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return this.inf},i.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},i.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),s=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},i.prototype.getX=function(){return this.x.fromRed()},i.prototype.getY=function(){return this.y.fromRed()},i.prototype.mul=function(t){return t=new f(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},i.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},i.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},i.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},i.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t},u(s,c.BasePoint),n.prototype.jpoint=function(t,e,r){return new s(this,t,e,r)},s.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},s.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},s.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),f=s.redSub(o);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),h=n.redMul(u),d=f.redSqr().redIAdd(c).redISub(h).redISub(h),p=f.redMul(h.redISub(d)).redISub(s.redMul(c)),l=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,p,l)},s.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(n),a=i.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),u=f.redMul(o),c=r.redMul(f),h=a.redSqr().redIAdd(u).redISub(c).redISub(c),d=a.redMul(c.redISub(h)).redISub(i.redMul(u)),p=this.z.redMul(o);return this.curve.jpoint(h,d,p)},s.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;t>r;r++)e=e.dbl();return e}for(var n=this.curve.a,i=this.curve.tinv,s=this.x,o=this.y,a=this.z,f=a.redSqr().redSqr(),u=o.redAdd(o),r=0;t>r;r++){var c=s.redSqr(),h=u.redSqr(),d=h.redSqr(),p=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(f)),l=s.redMul(h),b=p.redSqr().redISub(l.redAdd(l)),g=l.redISub(b),m=p.redMul(g);m=m.redIAdd(m).redISub(d);var y=u.redMul(a);t>r+1&&(f=f.redMul(d)),s=b,a=y,u=m}return this.curve.jpoint(s,u.redMul(i),a)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},s.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),s=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(s);o=o.redIAdd(o);var a=n.redAdd(n).redIAdd(n),f=a.redSqr().redISub(o).redISub(o),u=s.redIAdd(s);u=u.redIAdd(u),u=u.redIAdd(u),t=f,e=a.redMul(o.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),p=this.x.redAdd(h).redSqr().redISub(c).redISub(d);p=p.redIAdd(p);var l=c.redAdd(c).redIAdd(c),b=l.redSqr(),g=d.redIAdd(d);g=g.redIAdd(g),g=g.redIAdd(g),t=b.redISub(p).redISub(p),e=l.redMul(p.redISub(t)).redISub(g),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(t,e,r)},s.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),s=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(s);o=o.redIAdd(o);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),f=a.redSqr().redISub(o).redISub(o);t=f;var u=s.redIAdd(s);u=u.redIAdd(u),u=u.redIAdd(u),e=a.redMul(o.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),p=this.x.redSub(c).redMul(this.x.redAdd(c));p=p.redAdd(p).redIAdd(p);var l=d.redIAdd(d);l=l.redIAdd(l);var b=l.redAdd(l);t=p.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var g=h.redSqr();g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g),e=p.redMul(l.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},s.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),s=e.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(i)),f=e.redAdd(e);f=f.redIAdd(f);var u=f.redMul(o),c=a.redSqr().redISub(u.redAdd(u)),h=u.redISub(c),d=o.redSqr();d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var p=a.redMul(h).redISub(d),l=r.redAdd(r).redMul(n);return this.curve.jpoint(c,p,l)},s.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),s=i.redSqr(),o=this.x.redAdd(e).redSqr().redISub(t).redISub(n);o=o.redIAdd(o),o=o.redAdd(o).redIAdd(o),o=o.redISub(s);var a=o.redSqr(),f=n.redIAdd(n);f=f.redIAdd(f),f=f.redIAdd(f),f=f.redIAdd(f);var u=i.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(f),c=e.redMul(u);c=c.redIAdd(c),c=c.redIAdd(c);var h=this.x.redMul(a).redISub(c);h=h.redIAdd(h),h=h.redIAdd(h);var d=this.y.redMul(u.redMul(f.redISub(u)).redISub(o.redMul(a)));d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var p=this.z.redAdd(o).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,d,p)},s.prototype.mul=function(t,e){return t=new f(t,e),this.curve._wnafMul(this,t)},s.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},s.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":87,"../curve":90,"bn.js":85,inherits:296}],93:[function(t,e,r){"use strict";function n(t){"short"===t.type?this.curve=new a.curve["short"](t):"edwards"===t.type?this.curve=new a.curve.edwards(t):this.curve=new a.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function i(t,e){Object.defineProperty(s,t,{configurable:!0,enumerable:!0,get:function(){var r=new n(e);return Object.defineProperty(s,t,{configurable:!0,enumerable:!0,value:r}),r}})}var s=r,o=t("hash.js"),a=t("../elliptic"),f=a.utils.assert;s.PresetCurve=n,i("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),i("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),i("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),i("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),i("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),i("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),i("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var u;try{u=t("./precomputed/secp256k1")}catch(c){u=void 0}i("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",u]})},{"../elliptic":87,"./precomputed/secp256k1":101,"hash.js":104}],94:[function(t,e,r){"use strict";function n(t){return this instanceof n?("string"==typeof t&&(a(s.curves.hasOwnProperty(t),"Unknown curve "+t),t=s.curves[t]),t instanceof s.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),void(this.hash=t.hash||t.curve.hash)):new n(t)}var i=t("bn.js"),s=t("../../elliptic"),o=s.utils,a=o.assert,f=t("./key"),u=t("./signature");e.exports=n,n.prototype.keyPair=function(t){return new f(this,t)},n.prototype.keyFromPrivate=function(t,e){return f.fromPrivate(this,t,e)},n.prototype.keyFromPublic=function(t,e){return f.fromPublic(this,t,e)},n.prototype.genKeyPair=function(t){t||(t={});for(var e=new s.hmacDRBG({hash:this.hash,pers:t.pers,entropy:t.entropy||s.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var o=new i(e.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},n.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},n.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var o=this.n.byteLength(),a=e.getPrivate().toArray("be",o),f=t.toArray("be",o),c=new s.hmacDRBG({hash:this.hash,entropy:a,nonce:f,pers:n.pers,persEnc:n.persEnc}),h=this.n.sub(new i(1)),d=0;!0;d++){var p=n.k?n.k(d):new i(c.generate(this.n.byteLength()));if(p=this._truncateToN(p,!0),!(p.cmpn(1)<=0||p.cmp(h)>=0)){var l=this.g.mul(p);if(!l.isInfinity()){var b=l.getX(),g=b.umod(this.n);if(0!==g.cmpn(0)){var m=p.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(m=m.umod(this.n),0!==m.cmpn(0)){var y=(l.getY().isOdd()?1:0)|(0!==b.cmp(g)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),y^=1),new u({r:g,s:m,recoveryParam:y})}}}}}},n.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n),e=new u(e,"hex");var s=e.r,o=e.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),f=a.mul(t).umod(this.n),c=a.mul(s).umod(this.n),h=this.g.mulAdd(f,r.getPublic(),c);return h.isInfinity()?!1:0===h.getX().umod(this.n).cmp(s)},n.prototype.recoverPubKey=function(t,e,r,n){a((3&r)===r,"The recovery param is more than two bits"),e=new u(e,n);var s=this.n,o=new i(t),f=e.r,c=e.s,h=1&r,d=r>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");f=d?this.curve.pointFromX(f.add(this.curve.n),h):this.curve.pointFromX(f,h);var p=s.sub(o),l=e.r.invm(s);return f.mul(c).add(this.g.mul(p)).mul(l)},n.prototype.getKeyRecoveryParam=function(t,e,r,n){
if(e=new u(e,n),null!==e.recoveryParam)return e.recoveryParam;for(var i=0;4>i;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch(t){continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":87,"./key":95,"./signature":96,"bn.js":85}],95:[function(t,e,r){"use strict";function n(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var i=t("bn.js");e.exports=n,n.fromPublic=function(t,e,r){return e instanceof n?e:new n(t,{pub:e,pubEnc:r})},n.fromPrivate=function(t,e,r){return e instanceof n?e:new n(t,{priv:e,privEnc:r})},n.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},n.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},n.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},n.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},n.prototype._importPublic=function(t,e){return t.x||t.y?void(this.pub=this.ec.curve.point(t.x,t.y)):void(this.pub=this.ec.curve.decodePoint(t,e))},n.prototype.derive=function(t){return t.mul(this.priv).getX()},n.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},n.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},n.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"bn.js":85}],96:[function(t,e,r){"use strict";function n(t,e){return t instanceof n?t:void(this._importDER(t,e)||(h(t.r&&t.s,"Signature without r or s"),this.r=new f(t.r,16),this.s=new f(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam))}function i(){this.place=0}function s(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,s=0,o=e.place;n>s;s++,o++)i<<=8,i|=t[o];return e.place=o,i}function o(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&r>e;)e++;return 0===e?t:t.slice(e)}function a(t,e){if(128>e)return void t.push(e);var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}var f=t("bn.js"),u=t("../../elliptic"),c=u.utils,h=c.assert;e.exports=n,n.prototype._importDER=function(t,e){t=c.toArray(t,e);var r=new i;if(48!==t[r.place++])return!1;var n=s(t,r);if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=s(t,r),a=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=s(t,r);if(t.length!==u+r.place)return!1;var h=t.slice(r.place,u+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===h[0]&&128&h[1]&&(h=h.slice(1)),this.r=new f(a),this.s=new f(h),this.recoveryParam=null,!0},n.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=o(e),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];a(n,e.length),n=n.concat(e),n.push(2),a(n,r.length);var i=n.concat(r),s=[48];return a(s,i.length),s=s.concat(i),c.encode(s,t)}},{"../../elliptic":87,"bn.js":85}],97:[function(t,e,r){"use strict";function n(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof n))return new n(t);var t=s.curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}var i=t("hash.js"),s=t("../../elliptic"),o=s.utils,a=o.assert,f=o.parseBytes,u=t("./key"),c=t("./signature");e.exports=n,n.prototype.sign=function(t,e){t=f(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),s=this.encodePoint(i),o=this.hashInt(s,r.pubBytes(),t).mul(r.priv()),a=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:a,Rencoded:s})},n.prototype.verify=function(t,e,r){t=f(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),s=this.g.mul(e.S()),o=e.R().add(n.pub().mul(i));return o.eq(s)},n.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},n.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},n.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},n.prototype.makeSignature=function(t){return t instanceof c?t:new c(this,t)},n.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},n.prototype.decodePoint=function(t){t=o.parseBytes(t);var e=t.length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!==(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},n.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},n.prototype.decodeInt=function(t){return o.intFromLE(t)},n.prototype.isPoint=function(t){return t instanceof this.pointClass}},{"../../elliptic":87,"./key":98,"./signature":99,"hash.js":104}],98:[function(t,e,r){"use strict";function n(t,e){this.eddsa=t,this._secret=a(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=a(e.pub)}var i=t("../../elliptic"),s=i.utils,o=s.assert,a=s.parseBytes,f=s.cachedProperty;n.fromPublic=function(t,e){return e instanceof n?e:new n(t,{pub:e})},n.fromSecret=function(t,e){return e instanceof n?e:new n(t,{secret:e})},n.prototype.secret=function(){return this._secret},f(n,function(){return this.eddsa.encodePoint(this.pub())}),f(n,function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),f(n,function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),f(n,function(){return this.eddsa.decodeInt(this.privBytes())}),f(n,function(){return this.eddsa.hash().update(this.secret()).digest()}),f(n,function(){return this.hash().slice(this.eddsa.encodingLength)}),n.prototype.sign=function(t){return o(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},n.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},n.prototype.getSecret=function(t){return o(this._secret,"KeyPair is public only"),s.encode(this.secret(),t)},n.prototype.getPublic=function(t){return s.encode(this.pubBytes(),t)},e.exports=n},{"../../elliptic":87}],99:[function(t,e,r){"use strict";function n(t,e){this.eddsa=t,"object"!=typeof e&&(e=u(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),a(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}var i=t("bn.js"),s=t("../../elliptic"),o=s.utils,a=o.assert,f=o.cachedProperty,u=o.parseBytes;f(n,function(){return this.eddsa.decodeInt(this.Sencoded())}),f(n,function(){return this.eddsa.decodePoint(this.Rencoded())}),f(n,function(){return this.eddsa.encodePoint(this.R())}),f(n,function(){return this.eddsa.encodeInt(this.S())}),n.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},n.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},e.exports=n},{"../../elliptic":87,"bn.js":85}],100:[function(t,e,r){"use strict";function n(t){if(!(this instanceof n))return new n(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=o.toArray(t.entropy,t.entropyEnc),r=o.toArray(t.nonce,t.nonceEnc),i=o.toArray(t.pers,t.persEnc);a(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var i=t("hash.js"),s=t("../elliptic"),o=s.utils,a=o.assert;e.exports=n,n.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this.reseed=1,this.reseedInterval=281474976710656},n.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},n.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},n.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=o.toBuffer(t,e),r=o.toBuffer(r,n),a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this.reseed=1},n.prototype.generate=function(t,e,r,n){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=o.toArray(r,n),this._update(r));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var s=i.slice(0,t);return this._update(r),this.reseed++,o.encode(s,e)}},{"../elliptic":87,"hash.js":104}],101:[function(t,e,r){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]
}}},{}],102:[function(t,e,r){"use strict";function n(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if(e){if("hex"===e){t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),s=i>>8,o=255&i;s?r.push(s,o):r.push(o)}return r}function i(t){return 1===t.length?"0"+t:t}function s(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}function o(t,e){for(var r=[],n=1<<e+1,i=t.clone();i.cmpn(1)>=0;){var s;if(i.isOdd()){var o=i.andln(n-1);s=o>(n>>1)-1?(n>>1)-o:o,i.isubn(s)}else s=0;r.push(s);for(var a=0!==i.cmpn(0)&&0===i.andln(n-1)?e+1:1,f=1;a>f;f++)r.push(0);i.iushrn(a)}return r}function a(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var s=t.andln(3)+n&3,o=e.andln(3)+i&3;3===s&&(s=-1),3===o&&(o=-1);var a;if(0===(1&s))a=0;else{var f=t.andln(7)+n&7;a=3!==f&&5!==f||2!==o?s:-s}r[0].push(a);var u;if(0===(1&o))u=0;else{var f=e.andln(7)+i&7;u=3!==f&&5!==f||2!==s?o:-o}r[1].push(u),2*n===a+1&&(n=1-n),2*i===u+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r}function f(t,e){var r=e.name,n="_"+r;t.prototype[r]=function(){return void 0!==this[n]?this[n]:this[n]=e.call(this)}}function u(t){return"string"==typeof t?h.toArray(t,"hex"):t}function c(t){return new d(t,"hex","le")}var h=r,d=t("bn.js");h.assert=function(t,e){if(!t)throw new Error(e||"Assertion failed")},h.toArray=n,h.zero2=i,h.toHex=s,h.encode=function(t,e){return"hex"===e?s(t):t},h.getNAF=o,h.getJSF=a,h.cachedProperty=f,h.parseBytes=u,h.intFromLE=c},{"bn.js":85}],103:[function(t,e,r){function n(t){this.rand=t}var i;if(e.exports=function(t){return i||(i=new n(null)),i.generate(t)},e.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},"object"==typeof window)window.crypto&&window.crypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return window.crypto.getRandomValues(e),e}:window.msCrypto&&window.msCrypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return window.msCrypto.getRandomValues(e),e}:n.prototype._rand=function(){throw new Error("Not implemented yet")};else try{var s=t("crypto");n.prototype._rand=function(t){return s.randomBytes(t)}}catch(o){n.prototype._rand=function(t){for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e}}},{}],104:[function(t,e,r){var n=r;n.utils=t("./hash/utils"),n.common=t("./hash/common"),n.sha=t("./hash/sha"),n.ripemd=t("./hash/ripemd"),n.hmac=t("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":105,"./hash/hmac":106,"./hash/ripemd":107,"./hash/sha":108,"./hash/utils":109}],105:[function(t,e,r){function n(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var i=t("../hash"),s=i.utils,o=s.assert;r.BlockHash=n,n.prototype.update=function(t,e){if(t=s.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=s.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},n.prototype.digest=function(t){return this.update(this._pad()),o(null===this.pending),this._digest(t)},n.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;r>i;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else{n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0;for(var s=8;s<this.padLength;s++)n[i++]=0}return n}},{"../hash":104}],106:[function(t,e,r){function n(t,e,r){return this instanceof n?(this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,void this._init(s.toArray(e,r))):new n(t,e,r)}var i=t("../hash"),s=i.utils,o=s.assert;e.exports=n,n.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),o(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(var e=0;e<t.length;e++)t[e]^=54;this.inner=(new this.Hash).update(t);for(var e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},n.prototype.update=function(t,e){return this.inner.update(t,e),this},n.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"../hash":104}],107:[function(t,e,r){function n(){return this instanceof n?(p.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.endian="little")):new n}function i(t,e,r,n){return 15>=t?e^r^n:31>=t?e&r|~e&n:47>=t?(e|~r)^n:63>=t?e&n|r&~n:e^(r|~n)}function s(t){return 15>=t?0:31>=t?1518500249:47>=t?1859775393:63>=t?2400959708:2840853838}function o(t){return 15>=t?1352829926:31>=t?1548603684:47>=t?1836072691:63>=t?2053994217:0}var a=t("../hash"),f=a.utils,u=f.rotl32,c=f.sum32,h=f.sum32_3,d=f.sum32_4,p=a.common.BlockHash;f.inherits(n,p),r.ripemd160=n,n.blockSize=512,n.outSize=160,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],a=this.h[2],f=this.h[3],p=this.h[4],y=r,v=n,_=a,w=f,S=p,I=0;80>I;I++){var k=c(u(d(r,i(I,n,a,f),t[l[I]+e],s(I)),g[I]),p);r=p,p=f,f=u(a,10),a=n,n=k,k=c(u(d(y,i(79-I,v,_,w),t[b[I]+e],o(I)),m[I]),S),y=S,S=w,w=u(_,10),_=v,v=k}k=h(this.h[1],a,w),this.h[1]=h(this.h[2],f,S),this.h[2]=h(this.h[3],p,y),this.h[3]=h(this.h[4],r,v),this.h[4]=h(this.h[0],n,_),this.h[0]=k},n.prototype._digest=function(t){return"hex"===t?f.toHex32(this.h,"little"):f.split32(this.h,"little")};var l=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"../hash":104}],108:[function(t,e,r){function n(){return this instanceof n?(G.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=W,void(this.W=new Array(64))):new n}function i(){return this instanceof i?(n.call(this),void(this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])):new i}function s(){return this instanceof s?(G.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=X,void(this.W=new Array(160))):new s}function o(){return this instanceof o?(s.call(this),void(this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428])):new o}function a(){return this instanceof a?(G.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.W=new Array(80))):new a}function f(t,e,r){return t&e^~t&r}function u(t,e,r){return t&e^t&r^e&r}function c(t,e,r){return t^e^r}function h(t){return M(t,2)^M(t,13)^M(t,22)}function d(t){return M(t,6)^M(t,11)^M(t,25)}function p(t){return M(t,7)^M(t,18)^t>>>3}function l(t){return M(t,17)^M(t,19)^t>>>10}function b(t,e,r,n){return 0===t?f(e,r,n):1===t||3===t?c(e,r,n):2===t?u(e,r,n):void 0}function g(t,e,r,n,i,s){var o=t&r^~t&i;return 0>o&&(o+=4294967296),o}function m(t,e,r,n,i,s){var o=e&n^~e&s;return 0>o&&(o+=4294967296),o}function y(t,e,r,n,i,s){var o=t&r^t&i^r&i;return 0>o&&(o+=4294967296),o}function v(t,e,r,n,i,s){var o=e&n^e&s^n&s;return 0>o&&(o+=4294967296),o}function _(t,e){var r=j(t,e,28),n=j(e,t,2),i=j(e,t,7),s=r^n^i;return 0>s&&(s+=4294967296),s}function w(t,e){var r=U(t,e,28),n=U(e,t,2),i=U(e,t,7),s=r^n^i;return 0>s&&(s+=4294967296),s}function S(t,e){var r=j(t,e,14),n=j(t,e,18),i=j(e,t,9),s=r^n^i;return 0>s&&(s+=4294967296),s}function I(t,e){var r=U(t,e,14),n=U(t,e,18),i=U(e,t,9),s=r^n^i;return 0>s&&(s+=4294967296),s}function k(t,e){var r=j(t,e,1),n=j(t,e,8),i=L(t,e,7),s=r^n^i;return 0>s&&(s+=4294967296),s}function E(t,e){var r=U(t,e,1),n=U(t,e,8),i=D(t,e,7),s=r^n^i;return 0>s&&(s+=4294967296),s}function A(t,e){var r=j(t,e,19),n=j(e,t,29),i=L(t,e,6),s=r^n^i;return 0>s&&(s+=4294967296),s}function x(t,e){var r=U(t,e,19),n=U(e,t,29),i=D(t,e,6),s=r^n^i;return 0>s&&(s+=4294967296),s}var P=t("../hash"),O=P.utils,B=O.assert,M=O.rotr32,R=O.rotl32,T=O.sum32,C=O.sum32_4,N=O.sum32_5,j=O.rotr64_hi,U=O.rotr64_lo,L=O.shr64_hi,D=O.shr64_lo,z=O.sum64,F=O.sum64_hi,K=O.sum64_lo,H=O.sum64_4_hi,q=O.sum64_4_lo,V=O.sum64_5_hi,Y=O.sum64_5_lo,G=P.common.BlockHash,W=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],X=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],J=[1518500249,1859775393,2400959708,3395469782];O.inherits(n,G),r.sha256=n,n.blockSize=512,n.outSize=256,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(t,e){for(var r=this.W,n=0;16>n;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=C(l(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],s=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4],b=this.h[5],g=this.h[6],m=this.h[7];B(this.k.length===r.length);for(var n=0;n<r.length;n++){var y=N(m,d(c),f(c,b,g),this.k[n],r[n]),v=T(h(i),u(i,s,o));m=g,g=b,b=c,c=T(a,y),a=o,o=s,s=i,i=T(y,v)}this.h[0]=T(this.h[0],i),this.h[1]=T(this.h[1],s),this.h[2]=T(this.h[2],o),this.h[3]=T(this.h[3],a),this.h[4]=T(this.h[4],c),this.h[5]=T(this.h[5],b),this.h[6]=T(this.h[6],g),this.h[7]=T(this.h[7],m)},n.prototype._digest=function(t){return"hex"===t?O.toHex32(this.h,"big"):O.split32(this.h,"big")},O.inherits(i,n),r.sha224=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(t){return"hex"===t?O.toHex32(this.h.slice(0,7),"big"):O.split32(this.h.slice(0,7),"big")},O.inherits(s,G),r.sha512=s,s.blockSize=1024,s.outSize=512,s.hmacStrength=192,s.padLength=128,s.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;32>n;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=A(r[n-4],r[n-3]),s=x(r[n-4],r[n-3]),o=r[n-14],a=r[n-13],f=k(r[n-30],r[n-29]),u=E(r[n-30],r[n-29]),c=r[n-32],h=r[n-31];r[n]=H(i,s,o,a,f,u,c,h),r[n+1]=q(i,s,o,a,f,u,c,h)}},s.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],o=this.h[3],a=this.h[4],f=this.h[5],u=this.h[6],c=this.h[7],h=this.h[8],d=this.h[9],p=this.h[10],l=this.h[11],b=this.h[12],k=this.h[13],E=this.h[14],A=this.h[15];B(this.k.length===r.length);for(var x=0;x<r.length;x+=2){var P=E,O=A,M=S(h,d),R=I(h,d),T=g(h,d,p,l,b,k),C=m(h,d,p,l,b,k),N=this.k[x],j=this.k[x+1],U=r[x],L=r[x+1],D=V(P,O,M,R,T,C,N,j,U,L),H=Y(P,O,M,R,T,C,N,j,U,L),P=_(n,i),O=w(n,i),M=y(n,i,s,o,a,f),R=v(n,i,s,o,a,f),q=F(P,O,M,R),G=K(P,O,M,R);E=b,A=k,b=p,k=l,p=h,l=d,h=F(u,c,D,H),d=K(c,c,D,H),u=a,c=f,a=s,f=o,s=n,o=i,n=F(D,H,q,G),i=K(D,H,q,G)}z(this.h,0,n,i),z(this.h,2,s,o),z(this.h,4,a,f),z(this.h,6,u,c),z(this.h,8,h,d),z(this.h,10,p,l),z(this.h,12,b,k),z(this.h,14,E,A)},s.prototype._digest=function(t){return"hex"===t?O.toHex32(this.h,"big"):O.split32(this.h,"big")},O.inherits(o,s),r.sha384=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?O.toHex32(this.h.slice(0,12),"big"):O.split32(this.h.slice(0,12),"big")},O.inherits(a,G),r.sha1=a,a.blockSize=512,a.outSize=160,a.hmacStrength=80,a.padLength=64,a.prototype._update=function(t,e){for(var r=this.W,n=0;16>n;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=R(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);for(var i=this.h[0],s=this.h[1],o=this.h[2],a=this.h[3],f=this.h[4],n=0;n<r.length;n++){var u=~~(n/20),c=N(R(i,5),b(u,s,o,a),f,r[n],J[u]);f=a,a=o,o=R(s,30),s=i,i=c}this.h[0]=T(this.h[0],i),this.h[1]=T(this.h[1],s),this.h[2]=T(this.h[2],o),this.h[3]=T(this.h[3],a),this.h[4]=T(this.h[4],f)},a.prototype._digest=function(t){return"hex"===t?O.toHex32(this.h,"big"):O.split32(this.h,"big")}},{"../hash":104}],109:[function(t,e,r){function n(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e){t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),s=i>>8,o=255&i;s?r.push(s,o):r.push(o)}else for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}function i(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e}function s(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24;return e>>>0}function o(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=f(i.toString(16))}return r}function a(t){return 1===t.length?"0"+t:t}function f(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}function u(t,e,r,n){var i=r-e;m(i%4===0);for(var s=new Array(i/4),o=0,a=e;o<s.length;o++,a+=4){var f;f="big"===n?t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],s[o]=f>>>0}return s}function c(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var s=t[n];"big"===e?(r[i]=s>>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=255&s):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=255&s)}return r}function h(t,e){return t>>>e|t<<32-e}function d(t,e){return t<<e|t>>>32-e}function p(t,e){return t+e>>>0}function l(t,e,r){return t+e+r>>>0}function b(t,e,r,n){return t+e+r+n>>>0}function g(t,e,r,n,i){return t+e+r+n+i>>>0}function m(t,e){if(!t)throw new Error(e||"Assertion failed")}function y(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(n>o?1:0)+r+i;t[e]=a>>>0,t[e+1]=o}function v(t,e,r,n){var i=e+n>>>0,s=(e>i?1:0)+t+r;return s>>>0}function _(t,e,r,n){var i=e+n;return i>>>0}function w(t,e,r,n,i,s,o,a){var f=0,u=e;u=u+n>>>0,f+=e>u?1:0,u=u+s>>>0,f+=s>u?1:0,u=u+a>>>0,f+=a>u?1:0;var c=t+r+i+o+f;return c>>>0}function S(t,e,r,n,i,s,o,a){var f=e+n+s+a;return f>>>0}function I(t,e,r,n,i,s,o,a,f,u){var c=0,h=e;h=h+n>>>0,c+=e>h?1:0,h=h+s>>>0,c+=s>h?1:0,h=h+a>>>0,c+=a>h?1:0,h=h+u>>>0,c+=u>h?1:0;var d=t+r+i+o+f+c;return d>>>0}function k(t,e,r,n,i,s,o,a,f,u){var c=e+n+s+a+u;return c>>>0}function E(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}function A(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}function x(t,e,r){return t>>>r}function P(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}var O=r,B=t("inherits");O.toArray=n,O.toHex=i,O.htonl=s,O.toHex32=o,O.zero2=a,O.zero8=f,O.join32=u,O.split32=c,O.rotr32=h,O.rotl32=d,O.sum32=p,O.sum32_3=l,O.sum32_4=b,O.sum32_5=g,O.assert=m,O.inherits=B,r.sum64=y,r.sum64_hi=v,r.sum64_lo=_,r.sum64_4_hi=w,r.sum64_4_lo=S,r.sum64_5_hi=I,r.sum64_5_lo=k,r.rotr64_hi=E,r.rotr64_lo=A,r.shr64_hi=x,r.shr64_lo=P},{inherits:296}],110:[function(t,e,r){e.exports={name:"elliptic",version:"6.2.2",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{test:"make lint && istanbul test _mocha --reporter=spec test/*-test.js",coveralls:"cat ./coverage/lcov.info | coveralls"},repository:{type:"git",url:"git+ssh://[email protected]/indutny/elliptic.git"},keywords:["EC","Elliptic","curve","Cryptography"],author:{name:"Fedor Indutny",email:"[email protected]"},license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{browserify:"^3.44.2",coveralls:"^2.11.3",istanbul:"^0.3.17",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},dependencies:{"bn.js":"^4.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},gitHead:"628eb61186a7f1c81247cf991d808dc9ead83645",_id:"[email protected]",_shasum:"806bfa651a5aa4996a1e79c92b573761ea7d7574",_from:"elliptic@>=6.0.0 <7.0.0",_npmVersion:"3.3.12",_nodeVersion:"5.4.1",_npmUser:{name:"indutny",email:"[email protected]"},dist:{shasum:"806bfa651a5aa4996a1e79c92b573761ea7d7574",tarball:"http://registry.npmjs.org/elliptic/-/elliptic-6.2.2.tgz"},maintainers:[{name:"indutny",email:"[email protected]"}],directories:{},_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.2.2.tgz",readme:"ERROR: No README data found!"}},{}],111:[function(t,e,r){e.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],112:[function(t,e,r){var n=t("asn1.js"),i=n.define("RSAPrivateKey",function(){this.seq().obj(this.key("version")["int"](),this.key("modulus")["int"](),this.key("publicExponent")["int"](),this.key("privateExponent")["int"](),this.key("prime1")["int"](),this.key("prime2")["int"](),this.key("exponent1")["int"](),this.key("exponent2")["int"](),this.key("coefficient")["int"]())});r.RSAPrivateKey=i;var s=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus")["int"](),this.key("publicExponent")["int"]())});r.RSAPublicKey=s;var o=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var a=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p")["int"](),this.key("q")["int"](),this.key("g")["int"]()).optional())}),f=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version")["int"](),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())});r.PrivateKey=f;var u=n.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters")["int"]())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var c=n.define("DSAPrivateKey",function(){this.seq().obj(this.key("version")["int"](),this.key("p")["int"](),this.key("q")["int"](),this.key("g")["int"](),this.key("pub_key")["int"](),this.key("priv_key")["int"]())});r.DSAPrivateKey=c,r.DSAparam=n.define("DSAparam",function(){this["int"]()});var h=n.define("ECPrivateKey",function(){this.seq().obj(this.key("version")["int"](),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(d),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=h;var d=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=n.define("signature",function(){this.seq().obj(this.key("r")["int"](),this.key("s")["int"]())})},{"asn1.js":115}],113:[function(t,e,r){(function(r){var n=/Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m,i=/^-----BEGIN (.*) KEY-----\r?\n/m,s=/^-----BEGIN (.*) KEY-----\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n-----END \1 KEY-----$/m,o=t("evp_bytestokey"),a=t("browserify-aes");e.exports=function(t,e){var f,u=t.toString(),c=u.match(n);if(c){var h="aes"+c[1],d=new r(c[2],"hex"),p=new r(c[3].replace(/\r?\n/g,""),"base64"),l=o(e,d.slice(0,8),parseInt(c[1],10)).key,b=[],g=a.createDecipheriv(h,l,d);b.push(g.update(p)),b.push(g["final"]()),f=r.concat(b)}else{var m=u.match(s);f=new r(m[2].replace(/\r?\n/g,""),"base64")}var y=u.match(i)[1]+" KEY";return{tag:y,data:f}}}).call(this,t("buffer").Buffer)},{"browserify-aes":132,buffer:48,evp_bytestokey:147}],114:[function(t,e,r){(function(r){function n(t){var e;"object"!=typeof t||r.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=new r(t));var n,o,f=a(t,e),u=f.tag,c=f.data;switch(u){case"PUBLIC KEY":switch(o=s.PublicKey.decode(c,"der"),n=o.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPublicKey.decode(o.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return o.subjectPrivateKey=o.subjectPublicKey,{type:"ec",data:o};case"1.2.840.10040.4.1":return o.algorithm.params.pub_key=s.DSAparam.decode(o.subjectPublicKey.data,"der"),{type:"dsa",data:o.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+u);case"ENCRYPTED PRIVATE KEY":c=s.EncryptedPrivateKey.decode(c,"der"),c=i(c,e);case"PRIVATE KEY":switch(o=s.PrivateKey.decode(c,"der"),n=o.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPrivateKey.decode(o.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:o.algorithm.curve,privateKey:s.ECPrivateKey.decode(o.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return o.algorithm.params.priv_key=s.DSAparam.decode(o.subjectPrivateKey,"der"),{type:"dsa",params:o.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+u);case"RSA PUBLIC KEY":return s.RSAPublicKey.decode(c,"der");case"RSA PRIVATE KEY":return s.RSAPrivateKey.decode(c,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:s.DSAPrivateKey.decode(c,"der")};case"EC PRIVATE KEY":return c=s.ECPrivateKey.decode(c,"der"),{curve:c.parameters.value,privateKey:c.privateKey};default:throw new Error("unknown key type "+u)}}function i(t,e){var n=t.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),s=o[t.algorithm.decrypt.cipher.algo.join(".")],a=t.algorithm.decrypt.cipher.iv,c=t.subjectPrivateKey,h=parseInt(s.split("-")[1],10)/8,d=u.pbkdf2Sync(e,n,i,h),p=f.createDecipheriv(s,d,a),l=[];return l.push(p.update(c)),l.push(p["final"]()),r.concat(l)}var s=t("./asn1"),o=t("./aesid.json"),a=t("./fixProc"),f=t("browserify-aes"),u=t("pbkdf2");e.exports=n,n.signature=s.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":111,"./asn1":112,"./fixProc":113,"browserify-aes":132,buffer:48,pbkdf2:197}],115:[function(t,e,r){var n=r;n.bignum=t("bn.js"),n.define=t("./asn1/api").define,n.base=t("./asn1/base"),n.constants=t("./asn1/constants"),n.decoders=t("./asn1/decoders"),n.encoders=t("./asn1/encoders")},{"./asn1/api":116,"./asn1/base":118,"./asn1/constants":122,"./asn1/decoders":124,"./asn1/encoders":127,"bn.js":85}],116:[function(t,e,r){function n(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}var i=t("../asn1"),s=t("inherits"),o=r;o.define=function(t,e){return new n(t,e)},n.prototype._createNamed=function(e){var r;try{r=t("vm").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(n){r=function(t){this._initNamed(t)}}return s(r,e),r.prototype._initNamed=function(t){e.call(this,t)},new r(this)},n.prototype._getDecoder=function(t){return this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i.decoders[t])),this.decoders[t]},n.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},n.prototype._getEncoder=function(t){return this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(i.encoders[t])),this.encoders[t]},n.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},{"../asn1":115,inherits:296,vm:270}],117:[function(t,e,r){function n(t,e){return o.call(this,e),a.isBuffer(t)?(this.base=t,this.offset=0,void(this.length=t.length)):void this.error("Input not Buffer")}function i(t,e){if(Array.isArray(t))this.length=0,this.value=t.map(function(t){return t instanceof i||(t=new i(t,e)),this.length+=t.length,t},this);else if("number"==typeof t){if(!(t>=0&&255>=t))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=a.byteLength(t);else{if(!a.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}var s=t("inherits"),o=t("../base").Reporter,a=t("buffer").Buffer;s(n,o),r.DecoderBuffer=n,n.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},n.prototype.restore=function(t){var e=new n(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,o.prototype.restore.call(this,t.reporter),e},n.prototype.isEmpty=function(){return this.offset===this.length},n.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},n.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var r=new n(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},n.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},r.EncoderBuffer=i,i.prototype.join=function(t,e){return t||(t=new a(this.length)),e||(e=0),0===this.length?t:(Array.isArray(this.value)?this.value.forEach(function(r){r.join(t,e),e+=r.length}):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):a.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length),t)}},{"../base":118,buffer:48,inherits:296}],118:[function(t,e,r){var n=r;n.Reporter=t("./reporter").Reporter,n.DecoderBuffer=t("./buffer").DecoderBuffer,n.EncoderBuffer=t("./buffer").EncoderBuffer,n.Node=t("./node")},{"./buffer":117,"./node":119,"./reporter":120}],119:[function(t,e,r){function n(t,e){var r={};this._baseState=r,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r["default"]=null,r.explicit=null,r.implicit=null,r.parent||(r.children=[],this._wrap())}var i=t("../base").Reporter,s=t("../base").EncoderBuffer,o=t("minimalistic-assert"),a=["seq","seqof","set","setof","octstr","bitstr","objid","bool","gentime","utctime","null_","enum","int","ia5str","utf8str","bmpstr","numstr","printstr"],f=["key","obj","use","optional","explicit","implicit","def","choice","any"].concat(a),u=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];e.exports=n;var c=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit"];n.prototype.clone=function(){var t=this._baseState,e={};c.forEach(function(r){e[r]=t[r]});var r=new this.constructor(e.parent);return r._baseState=e,r},n.prototype._wrap=function(){var t=this._baseState;f.forEach(function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}},this)},n.prototype._init=function(t){var e=this._baseState;o(null===e.parent),t.call(this),e.children=e.children.filter(function(t){return t._baseState.parent===this},this),o.equal(e.children.length,1,"Root node can have only one child")},n.prototype._useArgs=function(t){var e=this._baseState,r=t.filter(function(t){return t instanceof this.constructor},this);t=t.filter(function(t){return!(t instanceof this.constructor)},this),0!==r.length&&(o(null===e.children),e.children=r,r.forEach(function(t){t._baseState.parent=this},this)),0!==t.length&&(o(null===e.args),e.args=t,e.reverseArgs=t.map(function(t){if("object"!=typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach(function(r){r==(0|r)&&(r|=0);var n=t[r];e[n]=r}),e}))},u.forEach(function(t){n.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}}),a.forEach(function(t){n.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return o(null===e.tag),e.tag=t,this._useArgs(r),this}}),n.prototype.use=function(t){var e=this._baseState;return o(null===e.use),e.use=t,this},n.prototype.optional=function(){var t=this._baseState;return t.optional=!0,this},n.prototype.def=function(t){var e=this._baseState;return o(null===e["default"]),e["default"]=t,e.optional=!0,this},n.prototype.explicit=function(t){var e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.explicit=t,this},n.prototype.implicit=function(t){var e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.implicit=t,this},n.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},n.prototype.key=function(t){var e=this._baseState;return o(null===e.key),e.key=t,this},n.prototype.any=function(){var t=this._baseState;return t.any=!0,this},n.prototype.choice=function(t){var e=this._baseState;return o(null===e.choice),
e.choice=t,this._useArgs(Object.keys(t).map(function(e){return t[e]})),this},n.prototype._decode=function(t){var e=this._baseState;if(null===e.parent)return t.wrapResult(e.children[0]._decode(t));var r,n=e["default"],i=!0;if(null!==e.key&&(r=t.enterKey(e.key)),e.optional){var s=null;if(null!==e.explicit?s=e.explicit:null!==e.implicit?s=e.implicit:null!==e.tag&&(s=e.tag),null!==s||e.any){if(i=this._peekTag(t,s,e.any),t.isError(i))return i}else{var o=t.save();try{null===e.choice?this._decodeGeneric(e.tag,t):this._decodeChoice(t),i=!0}catch(a){i=!1}t.restore(o)}}var f;if(e.obj&&i&&(f=t.enterObject()),i){if(null!==e.explicit){var u=this._decodeTag(t,e.explicit);if(t.isError(u))return u;t=u}if(null===e.use&&null===e.choice){if(e.any)var o=t.save();var c=this._decodeTag(t,null!==e.implicit?e.implicit:e.tag,e.any);if(t.isError(c))return c;e.any?n=t.raw(o):t=c}if(n=e.any?n:null===e.choice?this._decodeGeneric(e.tag,t):this._decodeChoice(t),t.isError(n))return n;if(!e.any&&null===e.choice&&null!==e.children){var h=e.children.some(function(e){e._decode(t)});if(h)return err}}return e.obj&&i&&(n=t.leaveObject(f)),null===e.key||null===n&&i!==!0||t.leaveKey(r,e.key,n),n},n.prototype._decodeGeneric=function(t,e){var r=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,r.args[0]):"octstr"===t||"bitstr"===t?this._decodeStr(e,t):"ia5str"===t||"utf8str"===t||"bmpstr"===t?this._decodeStr(e,t):"numstr"===t||"printstr"===t?this._decodeStr(e,t):"objid"===t&&r.args?this._decodeObjid(e,r.args[0],r.args[1]):"objid"===t?this._decodeObjid(e,null,null):"gentime"===t||"utctime"===t?this._decodeTime(e,t):"null_"===t?this._decodeNull(e):"bool"===t?this._decodeBool(e):"int"===t||"enum"===t?this._decodeInt(e,r.args&&r.args[0]):null!==r.use?this._getUse(r.use,e._reporterState.obj)._decode(e):e.error("unknown tag: "+t)},n.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),o(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},n.prototype._decodeChoice=function(t){var e=this._baseState,r=null,n=!1;return Object.keys(e.choice).some(function(i){var s=t.save(),o=e.choice[i];try{var a=o._decode(t);if(t.isError(a))return!1;r={type:i,value:a},n=!0}catch(f){return t.restore(s),!1}return!0},this),n?r:t.error("Choice not matched")},n.prototype._createEncoderBuffer=function(t){return new s(t,this.reporter)},n.prototype._encode=function(t,e,r){var n=this._baseState;if(null===n["default"]||n["default"]!==t){var i=this._encodeValue(t,e,r);if(void 0!==i&&!this._skipDefault(i,e,r))return i}},n.prototype._encodeValue=function(t,e,r){var n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,e||new i);var s=null;if(this.reporter=e,n.optional&&void 0===t){if(null===n["default"])return;t=n["default"]}var o=null,a=!1;if(n.any)s=this._createEncoderBuffer(t);else if(n.choice)s=this._encodeChoice(t,e);else if(n.children)o=n.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var n=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");var i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i},this).filter(function(t){return t}),o=this._createEncoderBuffer(o);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return e.error("Too many args for : "+n.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var f=this.clone();f._baseState.implicit=null,o=this._createEncoderBuffer(t.map(function(r){var n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)},f))}else null!==n.use?s=this._getUse(n.use,r)._encode(t,e):(o=this._encodePrimitive(n.tag,t),a=!0);var s;if(!n.any&&null===n.choice){var u=null!==n.implicit?n.implicit:n.tag,c=null===n.implicit?"universal":"context";null===u?null===n.use&&e.error("Tag could be ommited only for .use()"):null===n.use&&(s=this._encodeComposite(u,a,c,o))}return null!==n.explicit&&(s=this._encodeComposite(n.explicit,!1,"context",s)),s},n.prototype._encodeChoice=function(t,e){var r=this._baseState,n=r.choice[t.type];return n||o(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},n.prototype._encodePrimitive=function(t,e){var r=this._baseState;if("octstr"===t||"bitstr"===t||"ia5str"===t)return this._encodeStr(e,t);if("utf8str"===t||"bmpstr"===t)return this._encodeStr(e,t);if("numstr"===t||"printstr"===t)return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);throw new Error("Unsupported tag: "+t)},n.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},n.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}},{"../base":118,"minimalistic-assert":129}],120:[function(t,e,r){function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function i(t,e){this.path=t,this.rethrow(e)}var s=t("inherits");r.Reporter=n,n.prototype.isError=function(t){return t instanceof i},n.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},n.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},n.prototype.enterKey=function(t){return this._reporterState.path.push(t)},n.prototype.leaveKey=function(t,e,r){var n=this._reporterState;n.path=n.path.slice(0,t-1),null!==n.obj&&(n.obj[e]=r)},n.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},n.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},n.prototype.error=function(t){var e,r=this._reporterState,n=t instanceof i;if(e=n?t:new i(r.path.map(function(t){return"["+JSON.stringify(t)+"]"}).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},n.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},s(i,Error),i.prototype.rethrow=function(t){return this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace(this,i),this}},{inherits:296}],121:[function(t,e,r){var n=t("../constants");r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=n._reverse(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=n._reverse(r.tag)},{"../constants":122}],122:[function(t,e,r){var n=r;n._reverse=function(t){var e={};return Object.keys(t).forEach(function(r){(0|r)==r&&(r=0|r);var n=t[r];e[n]=r}),e},n.der=t("./der")},{"./der":121}],123:[function(t,e,r){function n(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new i,this.tree._init(t.body)}function i(t){u.Node.call(this,"der",t)}function s(t,e){var r=t.readUInt8(e);if(t.isError(r))return r;var n=h.tagClass[r>>6],i=0===(32&r);if(31===(31&r)){var s=r;for(r=0;128===(128&s);){if(s=t.readUInt8(e),t.isError(s))return s;r<<=7,r|=127&s}}else r&=31;var o=h.tag[r];return{cls:n,primitive:i,tag:r,tagStr:o}}function o(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0===(128&n))return n;var i=127&n;if(i>=4)return t.error("length octect is too long");n=0;for(var s=0;i>s;s++){n<<=8;var o=t.readUInt8(r);if(t.isError(o))return o;n|=o}return n}var a=t("inherits"),f=t("../../asn1"),u=f.base,c=f.bignum,h=f.constants.der;e.exports=n,n.prototype.decode=function(t,e){return t instanceof u.DecoderBuffer||(t=new u.DecoderBuffer(t,e)),this.tree._decode(t,e)},a(i,u.Node),i.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;var n=t.save(),i=s(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||r)},i.prototype._decodeTag=function(t,e,r){var n=s(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;var i=o(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');var a=t.save(),f=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(f)?f:(i=t.offset-a.offset,t.restore(a),t.skip(i,'Failed to match body of: "'+e+'"'))},i.prototype._skipUntilEnd=function(t,e){for(;;){var r=s(t,e);if(t.isError(r))return r;var n=o(t,r.primitive,e);if(t.isError(n))return n;var i;if(i=r.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,e),t.isError(i))return i;if("end"===r.tagStr)break}},i.prototype._decodeList=function(t,e,r){for(var n=[];!t.isEmpty();){var i=this._peekTag(t,"end");if(t.isError(i))return i;var s=r.decode(t,"der");if(t.isError(s)&&i)break;n.push(s)}return n},i.prototype._decodeStr=function(t,e){if("octstr"===e)return t.raw();if("bitstr"===e){var r=t.readUInt8();return t.isError(r)?r:{unused:r,data:t.raw()}}if("ia5str"===e||"utf8str"===e)return t.raw().toString();if("numstr"===e){var n=t.raw().toString("ascii");return this._isNumstr(n)?n:t.error("Decoding of string type: numstr unsupported characters")}if("printstr"===e){var i=t.raw().toString("ascii");return this._isPrintstr(i)?i:t.error("Decoding of string type: printstr unsupported characters")}if("bmpstr"===e){var s=t.raw();if(s.length%2===1)return t.error("Decoding of string type: bmpstr length mismatch");for(var o="",a=0;a<s.length/2;a++)o+=String.fromCharCode(s.readUInt16BE(2*a));return o}return t.error("Decoding of string type: "+e+" unsupported")},i.prototype._decodeObjid=function(t,e,r){for(var n=[],i=0;!t.isEmpty();){var s=t.readUInt8();i<<=7,i|=127&s,0===(128&s)&&(n.push(i),i=0)}128&s&&n.push(i);var o=n[0]/40|0,a=n[0]%40;if(r?result=n:result=[o,a].concat(n.slice(1)),e){var f=e[result.join(" ")];void 0===f&&(f=e[result.join(".")]),void 0!==f&&(result=f)}return result},i.prototype._decodeTime=function(t,e){var r=t.raw().toString();if("gentime"===e)var n=0|r.slice(0,4),i=0|r.slice(4,6),s=0|r.slice(6,8),o=0|r.slice(8,10),a=0|r.slice(10,12),f=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");var n=0|r.slice(0,2),i=0|r.slice(2,4),s=0|r.slice(4,6),o=0|r.slice(6,8),a=0|r.slice(8,10),f=0|r.slice(10,12);n=70>n?2e3+n:1900+n}return Date.UTC(n,i-1,s,o,a,f,0)},i.prototype._decodeNull=function(t){return null},i.prototype._decodeBool=function(t){var e=t.readUInt8();return t.isError(e)?e:0!==e},i.prototype._decodeInt=function(t,e){var r=t.raw(),n=new c(r);return e&&(n=e[n.toString(10)]||n),n},i.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},{"../../asn1":115,inherits:296}],124:[function(t,e,r){var n=r;n.der=t("./der"),n.pem=t("./pem")},{"./der":123,"./pem":125}],125:[function(t,e,r){function n(t){o.call(this,t),this.enc="pem"}var i=t("inherits"),s=t("buffer").Buffer,o=(t("../../asn1"),t("./der"));i(n,o),e.exports=n,n.prototype.decode=function(t,e){for(var r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),i=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,f=-1,u=0;u<r.length;u++){var c=r[u].match(i);if(null!==c&&c[2]===n){if(-1!==a){if("END"!==c[1])break;f=u;break}if("BEGIN"!==c[1])break;a=u}}if(-1===a||-1===f)throw new Error("PEM section not found for: "+n);var h=r.slice(a+1,f).join("");h.replace(/[^a-z0-9\+\/=]+/gi,"");var d=new s(h,"base64");return o.prototype.decode.call(this,d,e)}},{"../../asn1":115,"./der":123,buffer:48,inherits:296}],126:[function(t,e,r){function n(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new i,this.tree._init(t.body)}function i(t){c.Node.call(this,"der",t)}function s(t){return 10>t?"0"+t:t}function o(t,e,r,n){var i;if("seqof"===t?t="seq":"setof"===t&&(t="set"),h.tagByName.hasOwnProperty(t))i=h.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=h.tagClassByName[r||"universal"]<<6)}var a=t("inherits"),f=t("buffer").Buffer,u=t("../../asn1"),c=u.base,h=(u.bignum,u.constants.der);e.exports=n,n.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},a(i,c.Node),i.prototype._encodeComposite=function(t,e,r,n){var i=o(t,e,r,this.reporter);if(n.length<128){var s=new f(2);return s[0]=i,s[1]=n.length,this._createEncoderBuffer([s,n])}for(var a=1,u=n.length;u>=256;u>>=8)a++;var s=new f(2+a);s[0]=i,s[1]=128|a;for(var u=1+a,c=n.length;c>0;u--,c>>=8)s[u]=255&c;return this._createEncoderBuffer([s,n])},i.prototype._encodeStr=function(t,e){if("octstr"===e)return this._createEncoderBuffer(t);if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("ia5str"===e||"utf8str"===e)return this._createEncoderBuffer(t);if("bmpstr"===e){for(var r=new f(2*t.length),n=0;n<t.length;n++)r.writeUInt16BE(t.charCodeAt(n),2*n);return this._createEncoderBuffer(r)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):this.reporter.error("Encoding of string type: "+e+" unsupported")},i.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s\.]+/g);for(var n=0;n<t.length;n++)t[n]|=0}else if(Array.isArray(t)){t=t.slice();for(var n=0;n<t.length;n++)t[n]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}for(var i=0,n=0;n<t.length;n++){var s=t[n];for(i++;s>=128;s>>=7)i++}for(var o=new f(i),a=o.length-1,n=t.length-1;n>=0;n--){var s=t[n];for(o[a--]=127&s;(s>>=7)>0;)o[a--]=128|127&s}return this._createEncoderBuffer(o)},i.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[s(n.getFullYear()),s(n.getUTCMonth()+1),s(n.getUTCDate()),s(n.getUTCHours()),s(n.getUTCMinutes()),s(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[s(n.getFullYear()%100),s(n.getUTCMonth()+1),s(n.getUTCDate()),s(n.getUTCHours()),s(n.getUTCMinutes()),s(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},i.prototype._encodeNull=function(){return this._createEncoderBuffer("")},i.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!f.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new f(r)}if(f.isBuffer(t)){var n=t.length;0===t.length&&n++;var i=new f(n);return t.copy(i),0===t.length&&(i[0]=0),this._createEncoderBuffer(i)}if(128>t)return this._createEncoderBuffer(t);if(256>t)return this._createEncoderBuffer([0,t]);for(var n=1,s=t;s>=256;s>>=8)n++;for(var i=new Array(n),s=i.length-1;s>=0;s--)i[s]=255&t,t>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(new f(i))},i.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},i.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},i.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i["default"])return!1;var s=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i["default"],e,r).join()),s.length!==i.defaultBuffer.length)return!1;for(n=0;n<s.length;n++)if(s[n]!==i.defaultBuffer[n])return!1;return!0}},{"../../asn1":115,buffer:48,inherits:296}],127:[function(t,e,r){var n=r;n.der=t("./der"),n.pem=t("./pem")},{"./der":126,"./pem":128}],128:[function(t,e,r){function n(t){s.call(this,t),this.enc="pem"}var i=t("inherits"),s=(t("buffer").Buffer,t("../../asn1"),t("./der"));i(n,s),e.exports=n,n.prototype.encode=function(t,e){for(var r=s.prototype.encode.call(this,t),n=r.toString("base64"),i=["-----BEGIN "+e.label+"-----"],o=0;o<n.length;o+=64)i.push(n.slice(o,o+64));return i.push("-----END "+e.label+"-----"),i.join("\n")}},{"../../asn1":115,"./der":126,buffer:48,inherits:296}],129:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],130:[function(t,e,r){arguments[4][54][0].apply(r,arguments)},{buffer:48,dup:54}],131:[function(t,e,r){arguments[4][55][0].apply(r,arguments)},{"./aes":130,"./ghash":135,buffer:48,"buffer-xor":144,"cipher-base":145,dup:55,inherits:296}],132:[function(t,e,r){arguments[4][56][0].apply(r,arguments)},{"./decrypter":133,"./encrypter":134,"./modes":136,dup:56}],133:[function(t,e,r){arguments[4][57][0].apply(r,arguments)},{"./aes":130,"./authCipher":131,"./modes":136,"./modes/cbc":137,"./modes/cfb":138,"./modes/cfb1":139,"./modes/cfb8":140,"./modes/ctr":141,"./modes/ecb":142,"./modes/ofb":143,"./streamCipher":146,buffer:48,"cipher-base":145,dup:57,evp_bytestokey:147,inherits:296}],134:[function(t,e,r){arguments[4][58][0].apply(r,arguments)},{"./aes":130,"./authCipher":131,"./modes":136,"./modes/cbc":137,"./modes/cfb":138,"./modes/cfb1":139,"./modes/cfb8":140,"./modes/ctr":141,"./modes/ecb":142,"./modes/ofb":143,"./streamCipher":146,buffer:48,"cipher-base":145,dup:58,evp_bytestokey:147,inherits:296}],135:[function(t,e,r){arguments[4][59][0].apply(r,arguments)},{buffer:48,dup:59}],136:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],137:[function(t,e,r){arguments[4][61][0].apply(r,arguments)},{"buffer-xor":144,dup:61}],138:[function(t,e,r){arguments[4][62][0].apply(r,arguments)},{buffer:48,"buffer-xor":144,dup:62}],139:[function(t,e,r){arguments[4][63][0].apply(r,arguments)},{buffer:48,dup:63}],140:[function(t,e,r){arguments[4][64][0].apply(r,arguments)},{buffer:48,dup:64}],141:[function(t,e,r){arguments[4][65][0].apply(r,arguments)},{buffer:48,"buffer-xor":144,dup:65}],142:[function(t,e,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],143:[function(t,e,r){arguments[4][67][0].apply(r,arguments)},{buffer:48,"buffer-xor":144,dup:67}],144:[function(t,e,r){arguments[4][68][0].apply(r,arguments)},{buffer:48,dup:68}],145:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{buffer:48,dup:69,inherits:296,stream:265,string_decoder:266}],146:[function(t,e,r){arguments[4][70][0].apply(r,arguments)},{"./aes":130,buffer:48,"cipher-base":145,dup:70,inherits:296}],147:[function(t,e,r){arguments[4][81][0].apply(r,arguments)},{buffer:48,"create-hash/md5":178,dup:81}],148:[function(t,e,r){(function(r){function n(t,e,r,n){var o=g(e);if(o.curve){if("ecdsa"!==n)throw new Error("wrong private key type");return i(t,o)}if("dsa"===o.type){if("dsa"!==n)throw new Error("wrong private key type");return s(t,o,r)}if("rsa"!==n)throw new Error("wrong private key type");for(var a=o.modulus.byteLength(),f=[0,1];t.length+f.length+1<a;)f.push(255);f.push(0);for(var u=-1;++u<t.length;)f.push(t[u]);var c=p(f,o);return c}function i(t,e){var n=l[e.curve.join(".")];if(!n)throw new Error("unknown curve "+e.curve.join("."));var i=new y(n),s=i.genKeyPair();s._importPrivate(e.privateKey);var o=s.sign(t);return new r(o.toDER())}function s(t,e,r){for(var n,i=e.params.priv_key,s=e.params.p,u=e.params.q,d=e.params.g,p=new m(0),l=f(t,u).mod(u),b=!1,g=a(i,u,t,r);b===!1;)n=c(u,g,r),p=h(d,n,s,u),b=n.invm(u).imul(l.add(i.mul(p))).mod(u),b.cmpn(0)||(b=!1,p=new m(0));return o(p,b)}function o(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t)),128&e[0]&&(e=[0].concat(e));var n=t.length+e.length+4,i=[48,n,2,t.length];return i=i.concat(t,[2,e.length],e),new r(i)}function a(t,e,n,i){if(t=new r(t.toArray()),t.length<e.byteLength()){var s=new r(e.byteLength()-t.length);s.fill(0),t=r.concat([s,t])}var o=n.length,a=u(n,e),f=new r(o);f.fill(1);var c=new r(o);return c.fill(0),c=d(i,c).update(f).update(new r([0])).update(t).update(a).digest(),f=d(i,c).update(f).digest(),c=d(i,c).update(f).update(new r([1])).update(t).update(a).digest(),f=d(i,c).update(f).digest(),{k:c,v:f}}function f(t,e){var r=new m(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function u(t,e){t=f(t,e),t=t.mod(e);var n=new r(t.toArray());if(n.length<e.byteLength()){var i=new r(e.byteLength()-n.length);i.fill(0),n=r.concat([i,n])}return n}function c(t,e,n){var i,s;do{for(i=new r("");8*i.length<t.bitLength();)e.v=d(n,e.k).update(e.v).digest(),i=r.concat([i,e.v]);s=f(i,t),e.k=d(n,e.k).update(e.v).update(new r([0])).digest(),e.v=d(n,e.k).update(e.v).digest()}while(-1!==s.cmp(t));return s}function h(t,e,r,n){return t.toRed(m.mont(r)).redPow(e).fromRed().mod(n)}var d=t("create-hmac"),p=t("browserify-rsa"),l=t("./curves"),b=t("elliptic"),g=t("parse-asn1"),m=t("bn.js"),y=b.ec;e.exports=n,e.exports.getKey=a,e.exports.makeKey=c}).call(this,t("buffer").Buffer)},{"./curves":84,"bn.js":85,"browserify-rsa":86,buffer:48,"create-hmac":189,elliptic:87,"parse-asn1":114}],149:[function(t,e,r){(function(r){function n(t,e,n,o){var a=u(n);if("ec"===a.type){if("ecdsa"!==o)throw new Error("wrong public key type");return i(t,e,a)}if("dsa"===a.type){if("dsa"!==o)throw new Error("wrong public key type");return s(t,e,a)}if("rsa"!==o)throw new Error("wrong public key type");for(var f=a.modulus.byteLength(),h=[1],d=0;e.length+h.length+2<f;)h.push(255),d++;h.push(0);for(var p=-1;++p<e.length;)h.push(e[p]);h=new r(h);var l=c.mont(a.modulus);t=new c(t).toRed(l),t=t.redPow(new c(a.publicExponent)),t=new r(t.fromRed().toArray());var b=0;for(8>d&&(b=1),f=Math.min(t.length,h.length),t.length!==h.length&&(b=1),p=-1;++p<f;)b|=t[p]^h[p];return 0===b}function i(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new h(n),s=r.data.subjectPrivateKey.data;return i.verify(e,t,s)}function s(t,e,r){var n=r.data.p,i=r.data.q,s=r.data.g,a=r.data.pub_key,f=u.signature.decode(t,"der"),h=f.s,d=f.r;o(h,i),o(d,i);var p=c.mont(n),l=h.invm(i),b=s.toRed(p).redPow(new c(e).mul(l).mod(i)).fromRed().mul(a.toRed(p).redPow(d.mul(l).mod(i)).fromRed()).mod(n).mod(i);return!b.cmp(d)}function o(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}var a=t("./curves"),f=t("elliptic"),u=t("parse-asn1"),c=t("bn.js"),h=f.ec;e.exports=n}).call(this,t("buffer").Buffer)},{"./curves":84,"bn.js":85,buffer:48,elliptic:87,"parse-asn1":114}],150:[function(t,e,r){(function(r){function n(t){this.curveType=a[t],this.curveType||(this.curveType={name:t}),this.curve=new s.ec(this.curveType.name),this.keys=void 0}function i(t,e,n){Array.isArray(t)||(t=t.toArray());var i=new r(t);if(n&&i.length<n){var s=new r(n-i.length);s.fill(0),i=r.concat([s,i])}return e?i.toString(e):i}var s=t("elliptic"),o=t("bn.js");e.exports=function(t){return new n(t)};var a={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};a.p224=a.secp224r1,a.p256=a.secp256r1=a.prime256v1,a.p192=a.secp192r1=a.prime192v1,a.p384=a.secp384r1,a.p521=a.secp521r1,n.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},n.prototype.computeSecret=function(t,e,n){e=e||"utf8",r.isBuffer(t)||(t=new r(t,e));var s=this.curve.keyFromPublic(t).getPublic(),o=s.mul(this.keys.getPrivate()).getX();return i(o,n,this.curveType.byteLength)},n.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),i(r,t)},n.prototype.getPrivateKey=function(t){return i(this.keys.getPrivate(),t)},n.prototype.setPublicKey=function(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this.keys._importPublic(t),this},n.prototype.setPrivateKey=function(t,e){e=e||"utf8",r.isBuffer(t)||(t=new r(t,e));var n=new o(t);return n=n.toString(16),this.keys._importPrivate(n),this}}).call(this,t("buffer").Buffer)},{"bn.js":151,buffer:48,elliptic:152}],151:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{buffer:47,dup:85}],152:[function(t,e,r){arguments[4][87][0].apply(r,arguments)},{"../package.json":175,"./elliptic/curve":155,"./elliptic/curves":158,"./elliptic/ec":159,"./elliptic/eddsa":162,"./elliptic/hmac-drbg":165,"./elliptic/utils":167,brorand:168,dup:87}],153:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{"../../elliptic":152,"bn.js":151,dup:88}],154:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{"../../elliptic":152,"../curve":155,"bn.js":151,dup:89,inherits:296}],155:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{"./base":153,"./edwards":154,"./mont":156,"./short":157,dup:90}],156:[function(t,e,r){arguments[4][91][0].apply(r,arguments)},{"../../elliptic":152,"../curve":155,"bn.js":151,dup:91,inherits:296}],157:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{"../../elliptic":152,"../curve":155,"bn.js":151,dup:92,inherits:296}],158:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{"../elliptic":152,"./precomputed/secp256k1":166,dup:93,"hash.js":169}],159:[function(t,e,r){arguments[4][94][0].apply(r,arguments)},{"../../elliptic":152,"./key":160,"./signature":161,"bn.js":151,dup:94}],160:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"bn.js":151,dup:95}],161:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{"../../elliptic":152,"bn.js":151,dup:96}],162:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{"../../elliptic":152,"./key":163,"./signature":164,dup:97,"hash.js":169}],163:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{"../../elliptic":152,dup:98}],164:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{"../../elliptic":152,"bn.js":151,dup:99}],165:[function(t,e,r){arguments[4][100][0].apply(r,arguments)},{"../elliptic":152,dup:100,"hash.js":169}],166:[function(t,e,r){arguments[4][101][0].apply(r,arguments)},{dup:101}],167:[function(t,e,r){arguments[4][102][0].apply(r,arguments)},{"bn.js":151,dup:102}],168:[function(t,e,r){arguments[4][103][0].apply(r,arguments)},{dup:103}],169:[function(t,e,r){arguments[4][104][0].apply(r,arguments)},{"./hash/common":170,"./hash/hmac":171,"./hash/ripemd":172,"./hash/sha":173,"./hash/utils":174,dup:104}],170:[function(t,e,r){arguments[4][105][0].apply(r,arguments)},{"../hash":169,dup:105}],171:[function(t,e,r){arguments[4][106][0].apply(r,arguments)},{"../hash":169,dup:106}],172:[function(t,e,r){arguments[4][107][0].apply(r,arguments)},{"../hash":169,dup:107}],173:[function(t,e,r){arguments[4][108][0].apply(r,arguments)},{"../hash":169,dup:108}],174:[function(t,e,r){arguments[4][109][0].apply(r,arguments)},{dup:109,inherits:296}],175:[function(t,e,r){e.exports={name:"elliptic",version:"6.2.2",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{test:"make lint && istanbul test _mocha --reporter=spec test/*-test.js",coveralls:"cat ./coverage/lcov.info | coveralls"},repository:{type:"git",url:"git+ssh://[email protected]/indutny/elliptic.git"},keywords:["EC","Elliptic","curve","Cryptography"],author:{name:"Fedor Indutny",email:"[email protected]"},license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{browserify:"^3.44.2",coveralls:"^2.11.3",istanbul:"^0.3.17",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},dependencies:{"bn.js":"^4.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},gitHead:"628eb61186a7f1c81247cf991d808dc9ead83645",_id:"[email protected]",_shasum:"806bfa651a5aa4996a1e79c92b573761ea7d7574",_from:"elliptic@>=6.0.0 <7.0.0",_npmVersion:"3.3.12",_nodeVersion:"5.4.1",_npmUser:{name:"indutny",email:"[email protected]"},dist:{shasum:"806bfa651a5aa4996a1e79c92b573761ea7d7574",tarball:"http://registry.npmjs.org/elliptic/-/elliptic-6.2.2.tgz"},maintainers:[{name:"indutny",email:"[email protected]"}],directories:{},_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.2.2.tgz"}},{}],176:[function(t,e,r){(function(r){"use strict";function n(t){u.call(this,"digest"),this._hash=t,this.buffers=[]}function i(t){u.call(this,"digest"),this._hash=t}var s=t("inherits"),o=t("./md5"),a=t("ripemd160"),f=t("sha.js"),u=t("cipher-base");s(n,u),n.prototype._update=function(t){this.buffers.push(t)},n.prototype._final=function(){var t=r.concat(this.buffers),e=this._hash(t);return this.buffers=null,e},s(i,u),i.prototype._update=function(t){this._hash.update(t)},i.prototype._final=function(){return this._hash.digest()},e.exports=function(t){return t=t.toLowerCase(),"md5"===t?new n(o):"rmd160"===t||"ripemd160"===t?new n(a):new i(f(t))}}).call(this,t("buffer").Buffer)},{"./md5":178,buffer:48,"cipher-base":179,inherits:296,ripemd160:180,"sha.js":182}],177:[function(t,e,r){(function(t){"use strict";function e(e,r){if(e.length%s!==0){var n=e.length+(s-e.length%s);e=t.concat([e,o],n)}for(var i=[],a=r?e.readInt32BE:e.readInt32LE,f=0;f<e.length;f+=s)i.push(a.call(e,f));return i}function n(e,r,n){for(var i=new t(r),s=n?i.writeInt32BE:i.writeInt32LE,o=0;o<e.length;o++)s.call(i,e[o],4*o,!0);return i}function i(r,i,s,o){t.isBuffer(r)||(r=new t(r));var f=i(e(r,o),r.length*a);return n(f,s,o)}var s=4,o=new t(s);o.fill(0);var a=8;r.hash=i}).call(this,t("buffer").Buffer)},{buffer:48}],178:[function(t,e,r){"use strict";function n(t,e){t[e>>5]|=128<<e%32,t[(e+64>>>9<<4)+14]=e;for(var r=1732584193,n=-271733879,i=-1732584194,c=271733878,h=0;h<t.length;h+=16){var d=r,p=n,l=i,b=c;r=s(r,n,i,c,t[h+0],7,-680876936),c=s(c,r,n,i,t[h+1],12,-389564586),i=s(i,c,r,n,t[h+2],17,606105819),n=s(n,i,c,r,t[h+3],22,-1044525330),r=s(r,n,i,c,t[h+4],7,-176418897),c=s(c,r,n,i,t[h+5],12,1200080426),i=s(i,c,r,n,t[h+6],17,-1473231341),n=s(n,i,c,r,t[h+7],22,-45705983),r=s(r,n,i,c,t[h+8],7,1770035416),c=s(c,r,n,i,t[h+9],12,-1958414417),i=s(i,c,r,n,t[h+10],17,-42063),n=s(n,i,c,r,t[h+11],22,-1990404162),r=s(r,n,i,c,t[h+12],7,1804603682),c=s(c,r,n,i,t[h+13],12,-40341101),i=s(i,c,r,n,t[h+14],17,-1502002290),n=s(n,i,c,r,t[h+15],22,1236535329),r=o(r,n,i,c,t[h+1],5,-165796510),c=o(c,r,n,i,t[h+6],9,-1069501632),i=o(i,c,r,n,t[h+11],14,643717713),n=o(n,i,c,r,t[h+0],20,-373897302),r=o(r,n,i,c,t[h+5],5,-701558691),c=o(c,r,n,i,t[h+10],9,38016083),i=o(i,c,r,n,t[h+15],14,-660478335),n=o(n,i,c,r,t[h+4],20,-405537848),r=o(r,n,i,c,t[h+9],5,568446438),c=o(c,r,n,i,t[h+14],9,-1019803690),i=o(i,c,r,n,t[h+3],14,-187363961),n=o(n,i,c,r,t[h+8],20,1163531501),r=o(r,n,i,c,t[h+13],5,-1444681467),c=o(c,r,n,i,t[h+2],9,-51403784),i=o(i,c,r,n,t[h+7],14,1735328473),n=o(n,i,c,r,t[h+12],20,-1926607734),r=a(r,n,i,c,t[h+5],4,-378558),c=a(c,r,n,i,t[h+8],11,-2022574463),i=a(i,c,r,n,t[h+11],16,1839030562),n=a(n,i,c,r,t[h+14],23,-35309556),r=a(r,n,i,c,t[h+1],4,-1530992060),c=a(c,r,n,i,t[h+4],11,1272893353),i=a(i,c,r,n,t[h+7],16,-155497632),n=a(n,i,c,r,t[h+10],23,-1094730640),r=a(r,n,i,c,t[h+13],4,681279174),c=a(c,r,n,i,t[h+0],11,-358537222),i=a(i,c,r,n,t[h+3],16,-722521979),n=a(n,i,c,r,t[h+6],23,76029189),r=a(r,n,i,c,t[h+9],4,-640364487),c=a(c,r,n,i,t[h+12],11,-421815835),i=a(i,c,r,n,t[h+15],16,530742520),
n=a(n,i,c,r,t[h+2],23,-995338651),r=f(r,n,i,c,t[h+0],6,-198630844),c=f(c,r,n,i,t[h+7],10,1126891415),i=f(i,c,r,n,t[h+14],15,-1416354905),n=f(n,i,c,r,t[h+5],21,-57434055),r=f(r,n,i,c,t[h+12],6,1700485571),c=f(c,r,n,i,t[h+3],10,-1894986606),i=f(i,c,r,n,t[h+10],15,-1051523),n=f(n,i,c,r,t[h+1],21,-2054922799),r=f(r,n,i,c,t[h+8],6,1873313359),c=f(c,r,n,i,t[h+15],10,-30611744),i=f(i,c,r,n,t[h+6],15,-1560198380),n=f(n,i,c,r,t[h+13],21,1309151649),r=f(r,n,i,c,t[h+4],6,-145523070),c=f(c,r,n,i,t[h+11],10,-1120210379),i=f(i,c,r,n,t[h+2],15,718787259),n=f(n,i,c,r,t[h+9],21,-343485551),r=u(r,d),n=u(n,p),i=u(i,l),c=u(c,b)}return Array(r,n,i,c)}function i(t,e,r,n,i,s){return u(c(u(u(e,t),u(n,s)),i),r)}function s(t,e,r,n,s,o,a){return i(e&r|~e&n,t,e,s,o,a)}function o(t,e,r,n,s,o,a){return i(e&n|r&~n,t,e,s,o,a)}function a(t,e,r,n,s,o,a){return i(e^r^n,t,e,s,o,a)}function f(t,e,r,n,s,o,a){return i(r^(e|~n),t,e,s,o,a)}function u(t,e){var r=(65535&t)+(65535&e),n=(t>>16)+(e>>16)+(r>>16);return n<<16|65535&r}function c(t,e){return t<<e|t>>>32-e}var h=t("./helpers");e.exports=function(t){return h.hash(t,n,16)}},{"./helpers":177}],179:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{buffer:48,dup:69,inherits:296,stream:265,string_decoder:266}],180:[function(t,e,r){(function(t){function r(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e}function n(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e}function i(t,e,r){for(var n=0;16>n;n++){var i=r+n,h=e[i];e[i]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}var y,v,_,w,S,I,k,E,A,x;I=y=t[0],k=v=t[1],E=_=t[2],A=w=t[3],x=S=t[4];var P;for(n=0;80>n;n+=1)P=y+e[r+d[n]]|0,P+=16>n?s(v,_,w)+g[0]:32>n?o(v,_,w)+g[1]:48>n?a(v,_,w)+g[2]:64>n?f(v,_,w)+g[3]:u(v,_,w)+g[4],P=0|P,P=c(P,l[n]),P=P+S|0,y=S,S=w,w=c(_,10),_=v,v=P,P=I+e[r+p[n]]|0,P+=16>n?u(k,E,A)+m[0]:32>n?f(k,E,A)+m[1]:48>n?a(k,E,A)+m[2]:64>n?o(k,E,A)+m[3]:s(k,E,A)+m[4],P=0|P,P=c(P,b[n]),P=P+x|0,I=x,x=A,A=c(E,10),E=k,k=P;P=t[1]+_+A|0,t[1]=t[2]+w+x|0,t[2]=t[3]+S+I|0,t[3]=t[4]+y+k|0,t[4]=t[0]+v+E|0,t[0]=P}function s(t,e,r){return t^e^r}function o(t,e,r){return t&e|~t&r}function a(t,e,r){return(t|~e)^r}function f(t,e,r){return t&r|e&~r}function u(t,e,r){return t^(e|~r)}function c(t,e){return t<<e|t>>>32-e}function h(e){var s=[1732584193,4023233417,2562383102,271733878,3285377520];"string"==typeof e&&(e=new t(e,"utf8"));var o=r(e),a=8*e.length,f=8*e.length;o[a>>>5]|=128<<24-a%32,o[(a+64>>>9<<4)+14]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8);for(var u=0;u<o.length;u+=16)i(s,o,u);for(u=0;5>u;u++){var c=s[u];s[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var h=n(s);return new t(h)}var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],p=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],l=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],b=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],g=[0,1518500249,1859775393,2400959708,2840853838],m=[1352829926,1548603684,1836072691,2053994217,0];e.exports=h}).call(this,t("buffer").Buffer)},{buffer:48}],181:[function(t,e,r){(function(t){function r(e,r){this._block=new t(e),this._finalSize=r,this._blockSize=e,this._len=0,this._s=0}r.prototype.update=function(e,r){"string"==typeof e&&(r=r||"utf8",e=new t(e,r));for(var n=this._len+=e.length,i=this._s||0,s=0,o=this._block;n>i;){for(var a=Math.min(e.length,s+this._blockSize-i%this._blockSize),f=a-s,u=0;f>u;u++)o[i%this._blockSize+u]=e[u+s];i+=f,s+=f,i%this._blockSize===0&&this._update(o)}return this._s=i,this},r.prototype.digest=function(t){var e=8*this._len;this._block[this._len%this._blockSize]=128,this._block.fill(0,this._len%this._blockSize+1),e%(8*this._blockSize)>=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(e,this._blockSize-4);var r=this._update(this._block)||this._hash();return t?r.toString(t):r},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=r}).call(this,t("buffer").Buffer)},{buffer:48}],182:[function(t,e,r){var r=e.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};r.sha=t("./sha"),r.sha1=t("./sha1"),r.sha224=t("./sha224"),r.sha256=t("./sha256"),r.sha384=t("./sha384"),r.sha512=t("./sha512")},{"./sha":183,"./sha1":184,"./sha224":185,"./sha256":186,"./sha384":187,"./sha512":188}],183:[function(t,e,r){(function(r){function n(){this.init(),this._w=a,o.call(this,64,56)}function i(t,e){return t<<e|t>>>32-e}var s=t("inherits"),o=t("./hash"),a=new Array(80);s(n,o),n.prototype.init=function(){return this._a=1732584193,this._b=-271733879,this._c=-1732584194,this._d=271733878,this._e=-1009589776,this},n.prototype._update=function(t){function e(){return s[h-3]^s[h-8]^s[h-14]^s[h-16]}function r(t,e){s[h]=t;var r=i(o,5)+e+c+t+n;c=u,u=f,f=i(a,30),a=o,o=r,h++}var n,s=this._w,o=this._a,a=this._b,f=this._c,u=this._d,c=this._e,h=0;for(n=1518500249;16>h;)r(t.readInt32BE(4*h),a&f|~a&u);for(;20>h;)r(e(),a&f|~a&u);for(n=1859775393;40>h;)r(e(),a^f^u);for(n=-1894007588;60>h;)r(e(),a&f|a&u|f&u);for(n=-899497514;80>h;)r(e(),a^f^u);this._a=o+this._a|0,this._b=a+this._b|0,this._c=f+this._c|0,this._d=u+this._d|0,this._e=c+this._e|0},n.prototype._hash=function(){var t=new r(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":181,buffer:48,inherits:296}],184:[function(t,e,r){(function(r){function n(){this.init(),this._w=a,o.call(this,64,56)}function i(t,e){return t<<e|t>>>32-e}var s=t("inherits"),o=t("./hash"),a=new Array(80);s(n,o),n.prototype.init=function(){return this._a=1732584193,this._b=-271733879,this._c=-1732584194,this._d=271733878,this._e=-1009589776,this},n.prototype._update=function(t){function e(){return i(s[h-3]^s[h-8]^s[h-14]^s[h-16],1)}function r(t,e){s[h]=t;var r=i(o,5)+e+c+t+n;c=u,u=f,f=i(a,30),a=o,o=r,h++}var n,s=this._w,o=this._a,a=this._b,f=this._c,u=this._d,c=this._e,h=0;for(n=1518500249;16>h;)r(t.readInt32BE(4*h),a&f|~a&u);for(;20>h;)r(e(),a&f|~a&u);for(n=1859775393;40>h;)r(e(),a^f^u);for(n=-1894007588;60>h;)r(e(),a&f|a&u|f&u);for(n=-899497514;80>h;)r(e(),a^f^u);this._a=o+this._a|0,this._b=a+this._b|0,this._c=f+this._c|0,this._d=u+this._d|0,this._e=c+this._e|0},n.prototype._hash=function(){var t=new r(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":181,buffer:48,inherits:296}],185:[function(t,e,r){(function(r){function n(){this.init(),this._w=a,o.call(this,64,56)}var i=t("inherits"),s=t("./sha256"),o=t("./hash"),a=new Array(64);i(n,s),n.prototype.init=function(){return this._a=-1056596264,this._b=914150663,this._c=812702999,this._d=-150054599,this._e=-4191439,this._f=1750603025,this._g=1694076839,this._h=-1090891868,this},n.prototype._hash=function(){var t=new r(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":181,"./sha256":186,buffer:48,inherits:296}],186:[function(t,e,r){(function(r){function n(){this.init(),this._w=p,h.call(this,64,56)}function i(t,e,r){return r^t&(e^r)}function s(t,e,r){return t&e|r&(t|e)}function o(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function a(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function f(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function u(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}var c=t("inherits"),h=t("./hash"),d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],p=new Array(64);c(n,h),n.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(t){function e(){return u(n[v-2])+n[v-7]+f(n[v-15])+n[v-16]}function r(t){n[v]=t;var e=y+a(b)+i(b,g,m)+d[v]+t,r=o(c)+s(c,h,p);y=m,m=g,g=b,b=l+e,l=p,p=h,h=c,c=e+r,v++}for(var n=this._w,c=0|this._a,h=0|this._b,p=0|this._c,l=0|this._d,b=0|this._e,g=0|this._f,m=0|this._g,y=0|this._h,v=0;16>v;)r(t.readInt32BE(4*v));for(;64>v;)r(e());this._a=c+this._a|0,this._b=h+this._b|0,this._c=p+this._c|0,this._d=l+this._d|0,this._e=b+this._e|0,this._f=g+this._f|0,this._g=m+this._g|0,this._h=y+this._h|0},n.prototype._hash=function(){var t=new r(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":181,buffer:48,inherits:296}],187:[function(t,e,r){(function(r){function n(){this.init(),this._w=a,o.call(this,128,112)}var i=t("inherits"),s=t("./sha512"),o=t("./hash"),a=new Array(160);i(n,s),n.prototype.init=function(){return this._a=-876896931,this._b=1654270250,this._c=-1856437926,this._d=355462360,this._e=1731405415,this._f=-1900787065,this._g=-619958771,this._h=1203062813,this._al=-1056596264,this._bl=914150663,this._cl=812702999,this._dl=-150054599,this._el=-4191439,this._fl=1750603025,this._gl=1694076839,this._hl=-1090891868,this},n.prototype._hash=function(){function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}var e=new r(48);return t(this._a,this._al,0),t(this._b,this._bl,8),t(this._c,this._cl,16),t(this._d,this._dl,24),t(this._e,this._el,32),t(this._f,this._fl,40),e},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":181,"./sha512":188,buffer:48,inherits:296}],188:[function(t,e,r){(function(r){function n(){this.init(),this._w=b,p.call(this,128,112)}function i(t,e,r){return r^t&(e^r)}function s(t,e,r){return t&e|r&(t|e)}function o(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function a(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function f(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function u(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function c(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function h(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}var d=t("inherits"),p=t("./hash"),l=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],b=new Array(160);d(n,p),n.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this._al=-205731576,this._bl=-2067093701,this._cl=-23791573,this._dl=1595750129,this._el=-1377402159,this._fl=725511199,this._gl=-79577749,this._hl=327033209,this},n.prototype._update=function(t){function e(){var t=p[R-30],e=p[R-30+1],r=f(t,e),i=u(e,t);t=p[R-4],e=p[R-4+1];var s=c(t,e),o=h(e,t),a=p[R-14],l=p[R-14+1],b=p[R-32],g=p[R-32+1];d=i+l,n=r+a+(i>>>0>d>>>0?1:0),d+=o,n=n+s+(o>>>0>d>>>0?1:0),d+=g,n=n+b+(g>>>0>d>>>0?1:0)}function r(){p[R]=n,p[R+1]=d;var t=s(b,g,m),e=s(I,k,E),r=o(b,I),f=o(I,b),u=a(v,x),c=a(x,v),h=l[R],T=l[R+1],C=i(v,_,w),N=i(x,P,O),j=B+c,U=S+u+(B>>>0>j>>>0?1:0);j+=N,U=U+C+(N>>>0>j>>>0?1:0),j+=T,U=U+h+(T>>>0>j>>>0?1:0),j+=d,U=U+n+(d>>>0>j>>>0?1:0);var L=f+e,D=r+t+(f>>>0>L>>>0?1:0);S=w,B=O,w=_,O=P,_=v,P=x,x=A+j|0,v=y+U+(A>>>0>x>>>0?1:0)|0,y=m,A=E,m=g,E=k,g=b,k=I,I=j+L|0,b=U+D+(j>>>0>I>>>0?1:0)|0,M++,R+=2}for(var n,d,p=this._w,b=0|this._a,g=0|this._b,m=0|this._c,y=0|this._d,v=0|this._e,_=0|this._f,w=0|this._g,S=0|this._h,I=0|this._al,k=0|this._bl,E=0|this._cl,A=0|this._dl,x=0|this._el,P=0|this._fl,O=0|this._gl,B=0|this._hl,M=0,R=0;16>M;)n=t.readInt32BE(4*R),d=t.readInt32BE(4*R+4),r();for(;80>M;)e(),r();this._al=this._al+I|0,this._bl=this._bl+k|0,this._cl=this._cl+E|0,this._dl=this._dl+A|0,this._el=this._el+x|0,this._fl=this._fl+P|0,this._gl=this._gl+O|0,this._hl=this._hl+B|0,this._a=this._a+b+(this._al>>>0<I>>>0?1:0)|0,this._b=this._b+g+(this._bl>>>0<k>>>0?1:0)|0,this._c=this._c+m+(this._cl>>>0<E>>>0?1:0)|0,this._d=this._d+y+(this._dl>>>0<A>>>0?1:0)|0,this._e=this._e+v+(this._el>>>0<x>>>0?1:0)|0,this._f=this._f+_+(this._fl>>>0<P>>>0?1:0)|0,this._g=this._g+w+(this._gl>>>0<O>>>0?1:0)|0,this._h=this._h+S+(this._hl>>>0<B>>>0?1:0)|0},n.prototype._hash=function(){function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}var e=new r(64);return t(this._a,this._al,0),t(this._b,this._bl,8),t(this._c,this._cl,16),t(this._d,this._dl,24),t(this._e,this._el,32),t(this._f,this._fl,40),t(this._g,this._gl,48),t(this._h,this._hl,56),e},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":181,buffer:48,inherits:296}],189:[function(t,e,r){(function(r){"use strict";function n(t,e){o.call(this),t=t.toLowerCase(),"string"==typeof e&&(e=new r(e));var n="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>n?e=i(t).update(e).digest():e.length<n&&(e=r.concat([e,a],n));for(var s=this._ipad=new r(n),f=this._opad=new r(n),u=0;n>u;u++)s[u]=54^e[u],f[u]=92^e[u];this._hash=i(t).update(s)}var i=t("create-hash/browser"),s=t("inherits"),o=t("stream").Transform,a=new r(128);a.fill(0),s(n,o),n.prototype.update=function(t,e){return this._hash.update(t,e),this},n.prototype._transform=function(t,e,r){this._hash.update(t),r()},n.prototype._flush=function(t){this.push(this.digest()),t()},n.prototype.digest=function(t){var e=this._hash.digest();return i(this._alg).update(this._opad).update(e).digest(t)},e.exports=function(t,e){return new n(t,e)}}).call(this,t("buffer").Buffer)},{buffer:48,"create-hash/browser":176,inherits:296,stream:265}],190:[function(t,e,r){(function(e){function n(t){var r=new e(o[t].prime,"hex"),n=new e(o[t].gen,"hex");return new a(r,n)}function i(t,r,n,o){return e.isBuffer(r)||void 0===f[r]?i(t,"binary",r,n):(r=r||"binary",o=o||"binary",n=n||new e([2]),e.isBuffer(n)||(n=new e(n,o)),"number"==typeof t?new a(s(t,n),n,!0):(e.isBuffer(t)||(t=new e(t,r)),new a(t,n,!0)))}var s=t("./lib/generatePrime"),o=t("./lib/primes.json"),a=t("./lib/dh"),f={binary:!0,hex:!0,base64:!0};r.DiffieHellmanGroup=r.createDiffieHellmanGroup=r.getDiffieHellman=n,r.createDiffieHellman=r.DiffieHellman=i}).call(this,t("buffer").Buffer)},{"./lib/dh":191,"./lib/generatePrime":192,"./lib/primes.json":193,buffer:48}],191:[function(t,e,r){(function(r){function n(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._pub=new f(t),this}function i(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._priv=new f(t),this}function s(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in y)return y[n];var i=0;if(t.isEven()||!g.simpleSieve||!g.fermatTest(t)||!c.test(t))return i+=1,i+="02"===r||"05"===r?8:4,y[n]=i,i;c.test(t.shrn(1))||(i+=2);var s;switch(r){case"02":t.mod(h).cmp(d)&&(i+=8);break;case"05":s=t.mod(p),s.cmp(l)&&s.cmp(b)&&(i+=8);break;default:i+=4}return y[n]=i,i}function o(t,e,r){this.setGenerator(e),this.__prime=new f(t),this._prime=f.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=n,this.setPrivateKey=i):this._primeCode=8}function a(t,e){var n=new r(t.toArray());return e?n.toString(e):n}var f=t("bn.js"),u=t("miller-rabin"),c=new u,h=new f(24),d=new f(11),p=new f(10),l=new f(3),b=new f(7),g=t("./generatePrime"),m=t("randombytes");e.exports=o;var y={};Object.defineProperty(o.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=s(this.__prime,this.__gen)),this._primeCode}}),o.prototype.generateKeys=function(){return this._priv||(this._priv=new f(m(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},o.prototype.computeSecret=function(t){t=new f(t),t=t.toRed(this._prime);var e=t.redPow(this._priv).fromRed(),n=new r(e.toArray()),i=this.getPrime();if(n.length<i.length){var s=new r(i.length-n.length);s.fill(0),n=r.concat([s,n])}return n},o.prototype.getPublicKey=function(t){return a(this._pub,t)},o.prototype.getPrivateKey=function(t){return a(this._priv,t)},o.prototype.getPrime=function(t){return a(this.__prime,t)},o.prototype.getGenerator=function(t){return a(this._gen,t)},o.prototype.setGenerator=function(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this.__gen=t,this._gen=new f(t),this}}).call(this,t("buffer").Buffer)},{"./generatePrime":192,"bn.js":194,buffer:48,"miller-rabin":195,randombytes:243}],192:[function(t,e,r){function n(){if(null!==v)return v;var t=1048576,e=[];e[0]=2;for(var r=1,n=3;t>n;n+=2){for(var i=Math.ceil(Math.sqrt(n)),s=0;r>s&&e[s]<=i&&n%e[s]!==0;s++);r!==s&&e[s]<=i||(e[r++]=n)}return v=e,e}function i(t){for(var e=n(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r])?!0:!1;return!0}function s(t){var e=f.mont(t);return 0===p.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function o(t,e){if(16>t)return new f(2===e||5===e?[140,123]:[140,39]);e=new f(e);for(var r,n;;){for(r=new f(a(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(d),r.testn(1)||r.iadd(p),e.cmp(p)){if(!e.cmp(l))for(;r.mod(b).cmp(g);)r.iadd(y)}else for(;r.mod(u).cmp(m);)r.iadd(y);if(n=r.shrn(1),i(n)&&i(r)&&s(n)&&s(r)&&h.test(n)&&h.test(r))return r}}var a=t("randombytes");e.exports=o,o.simpleSieve=i,o.fermatTest=s;var f=t("bn.js"),u=new f(24),c=t("miller-rabin"),h=new c,d=new f(1),p=new f(2),l=new f(5),b=(new f(16),new f(8),new f(10)),g=new f(3),m=(new f(7),new f(11)),y=new f(4),v=(new f(12),null)},{"bn.js":194,"miller-rabin":195,randombytes:243}],193:[function(t,e,r){e.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],194:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{buffer:47,dup:85}],195:[function(t,e,r){function n(t){this.rand=t||new s.Rand}var i=t("bn.js"),s=t("brorand");e.exports=n,n.create=function(t){return new n(t)},n.prototype._rand=function(t){var e=t.bitLength(),r=this.rand.generate(Math.ceil(e/8));r[0]|=3;var n=7&e;return 0!==n&&(r[r.length-1]>>=7-n),new i(r)},n.prototype.test=function(t,e,r){var n=t.bitLength(),s=i.mont(t),o=new i(1).toRed(s);e||(e=Math.max(1,n/48|0));for(var a=t.subn(1),f=a.subn(1),u=0;!a.testn(u);u++);for(var c=t.shrn(u),h=a.toRed(s),d=!0;e>0;e--){var p=this._rand(f);r&&r(p);var l=p.toRed(s).redPow(c);if(0!==l.cmp(o)&&0!==l.cmp(h)){for(var b=1;u>b;b++){if(l=l.redSqr(),0===l.cmp(o))return!1;if(0===l.cmp(h))break}if(b===u)return!1}}return d},n.prototype.getDivisor=function(t,e){var r=t.bitLength(),n=i.mont(t),s=new i(1).toRed(n);e||(e=Math.max(1,r/48|0));for(var o=t.subn(1),a=o.subn(1),f=0;!o.testn(f);f++);for(var u=t.shrn(f),c=o.toRed(n);e>0;e--){var h=this._rand(a),d=t.gcd(h);if(0!==d.cmpn(1))return d;var p=h.toRed(n).redPow(u);if(0!==p.cmp(s)&&0!==p.cmp(c)){for(var l=1;f>l;l++){if(p=p.redSqr(),0===p.cmp(s))return p.fromRed().subn(1).gcd(t);if(0===p.cmp(c))break}if(l===f)return p=p.redSqr(),p.fromRed().subn(1).gcd(t)}}return!1}},{"bn.js":194,brorand:196}],196:[function(t,e,r){arguments[4][103][0].apply(r,arguments)},{dup:103}],197:[function(t,e,r){(function(e){function n(t,e,r,n,s,o){if("function"==typeof s&&(o=s,s=void 0),"function"!=typeof o)throw new Error("No callback provided to pbkdf2");var a=i(t,e,r,n,s);setTimeout(function(){o(void 0,a)})}function i(t,r,n,i,a){if("number"!=typeof n)throw new TypeError("Iterations not a number");if(0>n)throw new TypeError("Bad iterations");if("number"!=typeof i)throw new TypeError("Key length not a number");if(0>i||i>o)throw new TypeError("Bad key length");a=a||"sha1",e.isBuffer(t)||(t=new e(t,"binary")),e.isBuffer(r)||(r=new e(r,"binary"));var f,u=1,c=new e(i),h=new e(r.length+4);r.copy(h,0,0,r.length);for(var d,p,l=1;u>=l;l++){h.writeUInt32BE(l,r.length);var b=s(a,t).update(h).digest();f||(f=b.length,p=new e(f),u=Math.ceil(i/f),d=i-(u-1)*f),b.copy(p,0,0,f);for(var g=1;n>g;g++){b=s(a,t).update(b).digest();for(var m=0;f>m;m++)p[m]^=b[m]}var y=(l-1)*f,v=l===u?d:f;p.copy(c,y,0,v)}return c}var s=t("create-hmac"),o=Math.pow(2,30)-1;r.pbkdf2=n,r.pbkdf2Sync=i}).call(this,t("buffer").Buffer)},{buffer:48,"create-hmac":189}],198:[function(t,e,r){r.publicEncrypt=t("./publicEncrypt"),r.privateDecrypt=t("./privateDecrypt"),r.privateEncrypt=function(t,e){return r.publicEncrypt(t,e,!0)},r.publicDecrypt=function(t,e){return r.privateDecrypt(t,e,!0)}},{"./privateDecrypt":239,"./publicEncrypt":240}],199:[function(t,e,r){(function(r){function n(t){var e=new r(4);return e.writeUInt32BE(t,0),e}var i=t("create-hash");e.exports=function(t,e){for(var s,o=new r(""),a=0;o.length<e;)s=n(a++),o=r.concat([o,i("sha1").update(t).update(s).digest()]);return o.slice(0,e)}}).call(this,t("buffer").Buffer)},{buffer:48,"create-hash":176}],200:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{buffer:47,dup:85}],201:[function(t,e,r){arguments[4][86][0].apply(r,arguments)},{"bn.js":200,buffer:48,dup:86,randombytes:243}],202:[function(t,e,r){arguments[4][111][0].apply(r,arguments)},{dup:111}],203:[function(t,e,r){arguments[4][112][0].apply(r,arguments)},{"asn1.js":206,dup:112}],204:[function(t,e,r){arguments[4][113][0].apply(r,arguments)},{"browserify-aes":223,buffer:48,dup:113,evp_bytestokey:238}],205:[function(t,e,r){arguments[4][114][0].apply(r,arguments)},{"./aesid.json":202,"./asn1":203,"./fixProc":204,"browserify-aes":223,buffer:48,dup:114,pbkdf2:197}],206:[function(t,e,r){arguments[4][115][0].apply(r,arguments)},{"./asn1/api":207,"./asn1/base":209,"./asn1/constants":213,"./asn1/decoders":215,"./asn1/encoders":218,"bn.js":200,dup:115}],207:[function(t,e,r){arguments[4][116][0].apply(r,arguments)},{"../asn1":206,dup:116,inherits:296,vm:270}],208:[function(t,e,r){arguments[4][117][0].apply(r,arguments)},{"../base":209,buffer:48,dup:117,inherits:296}],209:[function(t,e,r){arguments[4][118][0].apply(r,arguments)},{"./buffer":208,"./node":210,"./reporter":211,dup:118}],210:[function(t,e,r){arguments[4][119][0].apply(r,arguments)},{"../base":209,dup:119,"minimalistic-assert":220}],211:[function(t,e,r){arguments[4][120][0].apply(r,arguments)},{dup:120,inherits:296}],212:[function(t,e,r){arguments[4][121][0].apply(r,arguments)},{"../constants":213,dup:121}],213:[function(t,e,r){arguments[4][122][0].apply(r,arguments)},{"./der":212,dup:122}],214:[function(t,e,r){arguments[4][123][0].apply(r,arguments)},{"../../asn1":206,dup:123,inherits:296}],
215:[function(t,e,r){arguments[4][124][0].apply(r,arguments)},{"./der":214,"./pem":216,dup:124}],216:[function(t,e,r){arguments[4][125][0].apply(r,arguments)},{"../../asn1":206,"./der":214,buffer:48,dup:125,inherits:296}],217:[function(t,e,r){arguments[4][126][0].apply(r,arguments)},{"../../asn1":206,buffer:48,dup:126,inherits:296}],218:[function(t,e,r){arguments[4][127][0].apply(r,arguments)},{"./der":217,"./pem":219,dup:127}],219:[function(t,e,r){arguments[4][128][0].apply(r,arguments)},{"../../asn1":206,"./der":217,buffer:48,dup:128,inherits:296}],220:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],221:[function(t,e,r){arguments[4][54][0].apply(r,arguments)},{buffer:48,dup:54}],222:[function(t,e,r){arguments[4][55][0].apply(r,arguments)},{"./aes":221,"./ghash":226,buffer:48,"buffer-xor":235,"cipher-base":236,dup:55,inherits:296}],223:[function(t,e,r){arguments[4][56][0].apply(r,arguments)},{"./decrypter":224,"./encrypter":225,"./modes":227,dup:56}],224:[function(t,e,r){arguments[4][57][0].apply(r,arguments)},{"./aes":221,"./authCipher":222,"./modes":227,"./modes/cbc":228,"./modes/cfb":229,"./modes/cfb1":230,"./modes/cfb8":231,"./modes/ctr":232,"./modes/ecb":233,"./modes/ofb":234,"./streamCipher":237,buffer:48,"cipher-base":236,dup:57,evp_bytestokey:238,inherits:296}],225:[function(t,e,r){arguments[4][58][0].apply(r,arguments)},{"./aes":221,"./authCipher":222,"./modes":227,"./modes/cbc":228,"./modes/cfb":229,"./modes/cfb1":230,"./modes/cfb8":231,"./modes/ctr":232,"./modes/ecb":233,"./modes/ofb":234,"./streamCipher":237,buffer:48,"cipher-base":236,dup:58,evp_bytestokey:238,inherits:296}],226:[function(t,e,r){arguments[4][59][0].apply(r,arguments)},{buffer:48,dup:59}],227:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],228:[function(t,e,r){arguments[4][61][0].apply(r,arguments)},{"buffer-xor":235,dup:61}],229:[function(t,e,r){arguments[4][62][0].apply(r,arguments)},{buffer:48,"buffer-xor":235,dup:62}],230:[function(t,e,r){arguments[4][63][0].apply(r,arguments)},{buffer:48,dup:63}],231:[function(t,e,r){arguments[4][64][0].apply(r,arguments)},{buffer:48,dup:64}],232:[function(t,e,r){arguments[4][65][0].apply(r,arguments)},{buffer:48,"buffer-xor":235,dup:65}],233:[function(t,e,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],234:[function(t,e,r){arguments[4][67][0].apply(r,arguments)},{buffer:48,"buffer-xor":235,dup:67}],235:[function(t,e,r){arguments[4][68][0].apply(r,arguments)},{buffer:48,dup:68}],236:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{buffer:48,dup:69,inherits:296,stream:265,string_decoder:266}],237:[function(t,e,r){arguments[4][70][0].apply(r,arguments)},{"./aes":221,buffer:48,"cipher-base":236,dup:70,inherits:296}],238:[function(t,e,r){arguments[4][81][0].apply(r,arguments)},{buffer:48,"create-hash/md5":178,dup:81}],239:[function(t,e,r){(function(r){function n(t,e){var n=(t.modulus,t.modulus.byteLength()),i=(e.length,h("sha1").update(new r("")).digest()),o=i.length;if(0!==e[0])throw new Error("decryption error");var u=e.slice(1,o+1),c=e.slice(o+1),d=f(u,a(c,o)),p=f(c,a(d,n-o-1));if(s(i,p.slice(0,o)))throw new Error("decryption error");for(var l=o;0===p[l];)l++;if(1!==p[l++])throw new Error("decryption error");return p.slice(l)}function i(t,e,r){for(var n=e.slice(0,2),i=2,s=0;0!==e[i++];)if(i>=e.length){s++;break}var o=e.slice(2,i-1);e.slice(i-1,i);if(("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&s++,o.length<8&&s++,s)throw new Error("decryption error");return e.slice(i)}function s(t,e){t=new r(t),e=new r(e);var n=0,i=t.length;t.length!==e.length&&(n++,i=Math.min(t.length,e.length));for(var s=-1;++s<i;)n+=t[s]^e[s];return n}var o=t("parse-asn1"),a=t("./mgf"),f=t("./xor"),u=t("bn.js"),c=t("browserify-rsa"),h=t("create-hash"),d=t("./withPublic");e.exports=function(t,e,s){var a;a=t.padding?t.padding:s?1:4;var f=o(t),h=f.modulus.byteLength();if(e.length>h||new u(e).cmp(f.modulus)>=0)throw new Error("decryption error");var p;p=s?d(new u(e),f):c(e,f);var l=new r(h-p.length);if(l.fill(0),p=r.concat([l,p],h),4===a)return n(f,p);if(1===a)return i(f,p,s);if(3===a)return p;throw new Error("unknown padding")}}).call(this,t("buffer").Buffer)},{"./mgf":199,"./withPublic":241,"./xor":242,"bn.js":200,"browserify-rsa":201,buffer:48,"create-hash":176,"parse-asn1":205}],240:[function(t,e,r){(function(r){function n(t,e){var n=t.modulus.byteLength(),i=e.length,s=f("sha1").update(new r("")).digest(),o=s.length,d=2*o;if(i>n-d-2)throw new Error("message too long");var p=new r(n-i-d-2);p.fill(0);var l=n-o-1,b=a(o),g=c(r.concat([s,p,new r([1]),e],l),u(b,l)),m=c(b,u(g,o));return new h(r.concat([new r([0]),m,g],n))}function i(t,e,n){var i=e.length,o=t.modulus.byteLength();if(i>o-11)throw new Error("message too long");var a;return n?(a=new r(o-i-3),a.fill(255)):a=s(o-i-3),new h(r.concat([new r([0,n?1:2]),a,new r([0]),e],o))}function s(t,e){for(var n,i=new r(t),s=0,o=a(2*t),f=0;t>s;)f===o.length&&(o=a(2*t),f=0),n=o[f++],n&&(i[s++]=n);return i}var o=t("parse-asn1"),a=t("randombytes"),f=t("create-hash"),u=t("./mgf"),c=t("./xor"),h=t("bn.js"),d=t("./withPublic"),p=t("browserify-rsa");e.exports=function(t,e,r){var s;s=t.padding?t.padding:r?1:4;var a,f=o(t);if(4===s)a=n(f,e);else if(1===s)a=i(f,e,r);else{if(3!==s)throw new Error("unknown padding");if(a=new h(e),a.cmp(f.modulus)>=0)throw new Error("data too long for modulus")}return r?p(a,f):d(a,f)}}).call(this,t("buffer").Buffer)},{"./mgf":199,"./withPublic":241,"./xor":242,"bn.js":200,"browserify-rsa":201,buffer:48,"create-hash":176,"parse-asn1":205,randombytes:243}],241:[function(t,e,r){(function(r){function n(t,e){return new r(t.toRed(i.mont(e.modulus)).redPow(new i(e.publicExponent)).fromRed().toArray())}var i=t("bn.js");e.exports=n}).call(this,t("buffer").Buffer)},{"bn.js":200,buffer:48}],242:[function(t,e,r){e.exports=function(t,e){for(var r=t.length,n=-1;++n<r;)t[n]^=e[n];return t}},{}],243:[function(t,e,r){(function(t,r,n){"use strict";function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}function s(e,i){if(e>65536)throw new Error("requested too many random bytes");var s=new r.Uint8Array(e);o.getRandomValues(s);var a=new n(s.buffer);return"function"==typeof i?t.nextTick(function(){i(null,a)}):a}var o=r.crypto||r.msCrypto;o&&o.getRandomValues?e.exports=s:e.exports=i}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{_process:247,buffer:48}],244:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function s(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function a(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!s(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,s,f,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],a(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(n=arguments.length,s=new Array(n-1),f=1;n>f;f++)s[f-1]=arguments[f];r.apply(this,s)}else if(o(r)){for(n=arguments.length,s=new Array(n-1),f=1;n>f;f++)s[f-1]=arguments[f];for(u=r.slice(),n=u.length,f=0;n>f;f++)u[f].apply(this,s)}return!0},n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned){var r;r=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,s,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],s=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(a=s;a-- >0;)if(r[a]===e||r[a].listener&&r[a].listener===e){n=a;break}if(0>n)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.listenerCount=function(t,e){var r;return r=t._events&&t._events[e]?i(t._events[e])?1:t._events[e].length:0}},{}],245:[function(t,e,r){e.exports=function(t){return!(null==t||!(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)))}},{}],246:[function(t,e,r){e.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},{}],247:[function(t,e,r){function n(){c=!1,a.length?u=a.concat(u):h=-1,u.length&&i()}function i(){if(!c){var t=setTimeout(n);c=!0;for(var e=u.length;e;){for(a=u,u=[];++h<e;)a&&a[h].run();h=-1,e=u.length}a=null,c=!1,clearTimeout(t)}}function s(t,e){this.fun=t,this.array=e}function o(){}var a,f=e.exports={},u=[],c=!1,h=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new s(t,e)),1!==u.length||c||setTimeout(i,0)},s.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=o,f.addListener=o,f.once=o,f.off=o,f.removeListener=o,f.removeAllListeners=o,f.emit=o,f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},{}],248:[function(t,e,r){(function(t){!function(n){function i(t){throw new RangeError(T[t])}function s(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function o(t,e){var r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(R,".");var i=t.split("."),o=s(i,e).join(".");return n+o}function a(t){for(var e,r,n=[],i=0,s=t.length;s>i;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&s>i?(r=t.charCodeAt(i++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function f(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=j(t>>>10&1023|55296),t=56320|1023&t),e+=j(t)}).join("")}function u(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:S}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function h(t,e,r){var n=0;for(t=r?N(t/A):t>>1,t+=N(t/e);t>C*k>>1;n+=S)t=N(t/C);return N(n+(C+1)*t/(t+E))}function d(t){var e,r,n,s,o,a,c,d,p,l,b=[],g=t.length,m=0,y=P,v=x;for(r=t.lastIndexOf(O),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&i("not-basic"),b.push(t.charCodeAt(n));for(s=r>0?r+1:0;g>s;){for(o=m,a=1,c=S;s>=g&&i("invalid-input"),d=u(t.charCodeAt(s++)),(d>=S||d>N((w-m)/a))&&i("overflow"),m+=d*a,p=v>=c?I:c>=v+k?k:c-v,!(p>d);c+=S)l=S-p,a>N(w/l)&&i("overflow"),a*=l;e=b.length+1,v=h(m-o,e,0==o),N(m/e)>w-y&&i("overflow"),y+=N(m/e),m%=e,b.splice(m++,0,y)}return f(b)}function p(t){var e,r,n,s,o,f,u,d,p,l,b,g,m,y,v,_=[];for(t=a(t),g=t.length,e=P,r=0,o=x,f=0;g>f;++f)b=t[f],128>b&&_.push(j(b));for(n=s=_.length,s&&_.push(O);g>n;){for(u=w,f=0;g>f;++f)b=t[f],b>=e&&u>b&&(u=b);for(m=n+1,u-e>N((w-r)/m)&&i("overflow"),r+=(u-e)*m,e=u,f=0;g>f;++f)if(b=t[f],e>b&&++r>w&&i("overflow"),b==e){for(d=r,p=S;l=o>=p?I:p>=o+k?k:p-o,!(l>d);p+=S)v=d-l,y=S-l,_.push(j(c(l+v%y,0))),d=N(v/y);_.push(j(c(d,0))),o=h(r,m,n==s),r=0,++n}++r,++e}return _.join("")}function l(t){return o(t,function(t){return B.test(t)?d(t.slice(4).toLowerCase()):t})}function b(t){return o(t,function(t){return M.test(t)?"xn--"+p(t):t})}var g="object"==typeof r&&r&&!r.nodeType&&r,m="object"==typeof e&&e&&!e.nodeType&&e,y="object"==typeof t&&t;(y.global===y||y.window===y||y.self===y)&&(n=y);var v,_,w=2147483647,S=36,I=1,k=26,E=38,A=700,x=72,P=128,O="-",B=/^xn--/,M=/[^\x20-\x7E]/,R=/[\x2E\u3002\uFF0E\uFF61]/g,T={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=S-I,N=Math.floor,j=String.fromCharCode;if(v={version:"1.3.2",ucs2:{decode:a,encode:f},decode:d,encode:p,toASCII:b,toUnicode:l},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return v});else if(g&&m)if(e.exports==g)m.exports=v;else for(_ in v)v.hasOwnProperty(_)&&(g[_]=v[_]);else n.punycode=v}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],249:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,s){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(e);var f=1e3;s&&"number"==typeof s.maxKeys&&(f=s.maxKeys);var u=t.length;f>0&&u>f&&(u=f);for(var c=0;u>c;++c){var h,d,p,l,b=t[c].replace(a,"%20"),g=b.indexOf(r);g>=0?(h=b.substr(0,g),d=b.substr(g+1)):(h=b,d=""),p=decodeURIComponent(h),l=decodeURIComponent(d),n(o,p)?i(o[p])?o[p].push(l):o[p]=[o[p],l]:o[p]=l}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],250:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?n(o(t),function(o){var a=encodeURIComponent(i(o))+r;return s(t[o])?n(t[o],function(t){return a+encodeURIComponent(i(t))}).join(e):a+encodeURIComponent(i(t[o]))}).join(e):a?encodeURIComponent(i(a))+r+encodeURIComponent(i(t)):""};var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},{}],251:[function(t,e,r){"use strict";r.decode=r.parse=t("./decode"),r.encode=r.stringify=t("./encode")},{"./decode":249,"./encode":250}],252:[function(t,e,r){e.exports=t("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":253}],253:[function(t,e,r){"use strict";function n(t){return this instanceof n?(u.call(this,t),c.call(this,t),t&&t.readable===!1&&(this.readable=!1),t&&t.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,t&&t.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",i)):new n(t)}function i(){this.allowHalfOpen||this._writableState.ended||a(s,this)}function s(t){t.end()}var o=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=n;var a=t("process-nextick-args"),f=t("core-util-is");f.inherits=t("inherits");var u=t("./_stream_readable"),c=t("./_stream_writable");f.inherits(n,u);for(var h=o(c.prototype),d=0;d<h.length;d++){var p=h[d];n.prototype[p]||(n.prototype[p]=c.prototype[p])}},{"./_stream_readable":255,"./_stream_writable":257,"core-util-is":258,inherits:296,"process-nextick-args":259}],254:[function(t,e,r){"use strict";function n(t){return this instanceof n?void i.call(this,t):new n(t)}e.exports=n;var i=t("./_stream_transform"),s=t("core-util-is");s.inherits=t("inherits"),s.inherits(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":256,"core-util-is":258,inherits:296}],255:[function(t,e,r){(function(r){"use strict";function n(e,r){C=C||t("./_stream_duplex"),e=e||{},this.objectMode=!!e.objectMode,r instanceof C&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(T||(T=t("string_decoder/").StringDecoder),this.decoder=new T(e.encoding),this.encoding=e.encoding)}function i(e){return C=C||t("./_stream_duplex"),this instanceof i?(this._readableState=new n(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),void P.call(this)):new i(e)}function s(t,e,r,n,i){var s=u(e,r);if(s)t.emit("error",s);else if(null===r)e.reading=!1,c(t,e);else if(e.objectMode||r&&r.length>0)if(e.ended&&!i){var a=new Error("stream.push() after EOF");t.emit("error",a)}else if(e.endEmitted&&i){var a=new Error("stream.unshift() after end event");t.emit("error",a)}else!e.decoder||i||n||(r=e.decoder.write(r)),i||(e.reading=!1),e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&h(t)),p(t,e);else i||(e.reading=!1);return o(e)}function o(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}function a(t){return t>=N?t=N:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function f(t,e){return 0===e.length&&e.ended?0:e.objectMode?0===t?0:1:null===t||isNaN(t)?e.flowing&&e.buffer.length?e.buffer[0].length:e.length:0>=t?0:(t>e.highWaterMark&&(e.highWaterMark=a(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function u(t,e){var r=null;return x.isBuffer(e)||"string"==typeof e||null===e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function c(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,h(t)}}function h(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(M("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?E(d,t):d(t))}function d(t){M("emit readable"),t.emit("readable"),v(t)}function p(t,e){e.readingMore||(e.readingMore=!0,E(l,t,e))}function l(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(M("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function b(t){return function(){var e=t._readableState;M("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&O(t,"data")&&(e.flowing=!0,v(t))}}function g(t){M("readable nexttick read 0"),t.read(0)}function m(t,e){e.resumeScheduled||(e.resumeScheduled=!0,E(y,t,e))}function y(t,e){e.reading||(M("resume read 0"),t.read(0)),e.resumeScheduled=!1,t.emit("resume"),v(t),e.flowing&&!e.reading&&t.read(0)}function v(t){var e=t._readableState;if(M("flow",e.flowing),e.flowing)do var r=t.read();while(null!==r&&e.flowing)}function _(t,e){var r,n=e.buffer,i=e.length,s=!!e.decoder,o=!!e.objectMode;if(0===n.length)return null;if(0===i)r=null;else if(o)r=n.shift();else if(!t||t>=i)r=s?n.join(""):1===n.length?n[0]:x.concat(n,i),n.length=0;else if(t<n[0].length){var a=n[0];r=a.slice(0,t),n[0]=a.slice(t)}else if(t===n[0].length)r=n.shift();else{r=s?"":new x(t);for(var f=0,u=0,c=n.length;c>u&&t>f;u++){var a=n[0],h=Math.min(t-f,a.length);s?r+=a.slice(0,h):a.copy(r,f,0,h),h<a.length?n[0]=a.slice(h):n.shift(),f+=h}}return r}function w(t){var e=t._readableState;if(e.length>0)throw new Error("endReadable called on non-empty stream");e.endEmitted||(e.ended=!0,E(S,e,t))}function S(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function I(t,e){for(var r=0,n=t.length;n>r;r++)e(t[r],r)}function k(t,e){for(var r=0,n=t.length;n>r;r++)if(t[r]===e)return r;return-1}e.exports=i;var E=t("process-nextick-args"),A=t("isarray"),x=t("buffer").Buffer;i.ReadableState=n;var P,O=(t("events"),function(t,e){return t.listeners(e).length});!function(){try{P=t("stream")}catch(e){}finally{P||(P=t("events").EventEmitter)}}();var x=t("buffer").Buffer,B=t("core-util-is");B.inherits=t("inherits");var M,R=t("util");M=R&&R.debuglog?R.debuglog("stream"):function(){};var T;B.inherits(i,P);var C,C;i.prototype.push=function(t,e){var r=this._readableState;return r.objectMode||"string"!=typeof t||(e=e||r.defaultEncoding,e!==r.encoding&&(t=new x(t,e),e="")),s(this,r,t,e,!1)},i.prototype.unshift=function(t){var e=this._readableState;return s(this,e,t,"",!0)},i.prototype.isPaused=function(){return this._readableState.flowing===!1},i.prototype.setEncoding=function(e){return T||(T=t("string_decoder/").StringDecoder),this._readableState.decoder=new T(e),this._readableState.encoding=e,this};var N=8388608;i.prototype.read=function(t){M("read",t);var e=this._readableState,r=t;if(("number"!=typeof t||t>0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return M("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?w(this):h(this),null;if(t=f(t,e),0===t&&e.ended)return 0===e.length&&w(this),null;var n=e.needReadable;M("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&(n=!0,M("length less than watermark",n)),(e.ended||e.reading)&&(n=!1,M("reading or ended",n)),n&&(M("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1),n&&!e.reading&&(t=f(r,e));var i;return i=t>0?_(t,e):null,null===i&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),r!==t&&e.ended&&0===e.length&&w(this),null!==i&&this.emit("data",i),i},i.prototype._read=function(t){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(t,e){function n(t){M("onunpipe"),t===h&&s()}function i(){M("onend"),t.end()}function s(){M("cleanup"),t.removeListener("close",f),t.removeListener("finish",u),t.removeListener("drain",g),t.removeListener("error",a),t.removeListener("unpipe",n),h.removeListener("end",i),h.removeListener("end",s),h.removeListener("data",o),m=!0,!d.awaitDrain||t._writableState&&!t._writableState.needDrain||g()}function o(e){M("ondata");var r=t.write(e);!1===r&&(1!==d.pipesCount||d.pipes[0]!==t||1!==h.listenerCount("data")||m||(M("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++),h.pause())}function a(e){M("onerror",e),c(),t.removeListener("error",a),0===O(t,"error")&&t.emit("error",e)}function f(){t.removeListener("finish",u),c()}function u(){M("onfinish"),t.removeListener("close",f),c()}function c(){M("unpipe"),h.unpipe(t)}var h=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=t;break;case 1:d.pipes=[d.pipes,t];break;default:d.pipes.push(t)}d.pipesCount+=1,M("pipe count=%d opts=%j",d.pipesCount,e);var p=(!e||e.end!==!1)&&t!==r.stdout&&t!==r.stderr,l=p?i:s;d.endEmitted?E(l):h.once("end",l),t.on("unpipe",n);var g=b(h);t.on("drain",g);var m=!1;return h.on("data",o),t._events&&t._events.error?A(t._events.error)?t._events.error.unshift(a):t._events.error=[a,t._events.error]:t.on("error",a),t.once("close",f),t.once("finish",u),t.emit("pipe",h),d.flowing||(M("pipe resume"),h.resume()),t},i.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;n>i;i++)r[i].emit("unpipe",this);return this}var i=k(e.pipes,t);return-1===i?this:(e.pipes.splice(i,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this),this)},i.prototype.on=function(t,e){var r=P.prototype.on.call(this,t,e);if("data"===t&&!1!==this._readableState.flowing&&this.resume(),"readable"===t&&this.readable){var n=this._readableState;n.readableListening||(n.readableListening=!0,n.emittedReadable=!1,n.needReadable=!0,n.reading?n.length&&h(this,n):E(g,this))}return r},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){var t=this._readableState;return t.flowing||(M("resume"),t.flowing=!0,m(this,t)),this},i.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this},i.prototype.wrap=function(t){var e=this._readableState,r=!1,n=this;t.on("end",function(){if(M("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&n.push(t)}n.push(null)}),t.on("data",function(i){if(M("wrapped data"),e.decoder&&(i=e.decoder.write(i)),(!e.objectMode||null!==i&&void 0!==i)&&(e.objectMode||i&&i.length)){var s=n.push(i);s||(r=!0,t.pause())}});for(var i in t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));var s=["error","close","destroy","pause","resume"];return I(s,function(e){t.on(e,n.emit.bind(n,e))}),n._read=function(e){M("wrapped _read",e),r&&(r=!1,t.resume())},n},i._fromList=_}).call(this,t("_process"))},{"./_stream_duplex":253,_process:247,buffer:48,"core-util-is":258,events:244,inherits:296,isarray:246,"process-nextick-args":259,"string_decoder/":266,util:47}],256:[function(t,e,r){"use strict";function n(t){this.afterTransform=function(e,r){return i(t,e,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function i(t,e,r){var n=t._transformState;n.transforming=!1;var i=n.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&t.push(r),i&&i(e);var s=t._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&t._read(s.highWaterMark)}function s(t){if(!(this instanceof s))return new s(t);a.call(this,t),this._transformState=new n(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(t){o(e,t)}):o(e)})}function o(t,e){if(e)return t.emit("error",e);var r=t._writableState,n=t._transformState;if(r.length)throw new Error("calling transform done when ws.length != 0");if(n.transforming)throw new Error("calling transform done when still transforming");return t.push(null)}e.exports=s;var a=t("./_stream_duplex"),f=t("core-util-is");f.inherits=t("inherits"),f.inherits(s,a),s.prototype.push=function(t,e){return this._transformState.needTransform=!1,a.prototype.push.call(this,t,e)},s.prototype._transform=function(t,e,r){throw new Error("not implemented")},s.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},s.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0}},{"./_stream_duplex":253,"core-util-is":258,inherits:296}],257:[function(t,e,r){"use strict";function n(){}function i(t,e,r){this.chunk=t,this.encoding=e,this.callback=r,this.next=null}function s(e,r){x=x||t("./_stream_duplex"),e=e||{},this.objectMode=!!e.objectMode,r instanceof x&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var s=e.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){l(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1}function o(e){return x=x||t("./_stream_duplex"),this instanceof o||this instanceof x?(this._writableState=new s(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),void E.call(this)):new o(e)}function a(t,e){var r=new Error("write after end");t.emit("error",r),S(e,r)}function f(t,e,r,n){var i=!0;if(!I.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==r&&!e.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");t.emit("error",s),S(n,s),i=!1}return i}function u(t,e,r){return t.objectMode||t.decodeStrings===!1||"string"!=typeof e||(e=new I(e,r)),e}function c(t,e,r,n,s){r=u(e,r,n),I.isBuffer(r)&&(n="buffer");var o=e.objectMode?1:r.length;e.length+=o;var a=e.length<e.highWaterMark;if(a||(e.needDrain=!0),e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest=new i(r,n,s),f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest}else h(t,e,!1,o,r,n,s);return a}function h(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function d(t,e,r,n,i){--e.pendingcb,r?S(i,n):i(n),t._writableState.errorEmitted=!0,t.emit("error",n)}function p(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function l(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(p(r),e)d(t,r,n,e,i);else{var s=y(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||m(t,r),n?S(b,t,r,s,i):b(t,r,s,i)}}function b(t,e,r,n){r||g(t,e),e.pendingcb--,n(),_(t,e)}function g(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function m(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){for(var n=[],i=[];r;)i.push(r.callback),n.push(r),r=r.next;e.pendingcb++,e.lastBufferedRequest=null,h(t,e,!0,e.length,n,"",function(t){for(var r=0;r<i.length;r++)e.pendingcb--,i[r](t)})}else{for(;r;){var s=r.chunk,o=r.encoding,a=r.callback,f=e.objectMode?1:s.length;if(h(t,e,!1,f,s,o,a),r=r.next,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function y(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function v(t,e){e.prefinished||(e.prefinished=!0,t.emit("prefinish"))}function _(t,e){var r=y(e);return r&&(0===e.pendingcb?(v(t,e),e.finished=!0,t.emit("finish")):v(t,e)),r}function w(t,e,r){e.ending=!0,_(t,e),r&&(e.finished?S(r):t.once("finish",r)),e.ended=!0}e.exports=o;var S=t("process-nextick-args"),I=t("buffer").Buffer;o.WritableState=s;var k=t("core-util-is");k.inherits=t("inherits");var E,A={deprecate:t("util-deprecate")};!function(){try{E=t("stream")}catch(e){}finally{E||(E=t("events").EventEmitter)}}();var I=t("buffer").Buffer;
k.inherits(o,E);var x;s.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(s.prototype,"buffer",{get:A.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(t){}}();var x;o.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},o.prototype.write=function(t,e,r){var i=this._writableState,s=!1;return"function"==typeof e&&(r=e,e=null),I.isBuffer(t)?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=n),i.ended?a(this,r):f(this,i,t,r)&&(i.pendingcb++,s=c(this,i,t,e,r)),s},o.prototype.cork=function(){var t=this._writableState;t.corked++},o.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||m(this,t))},o.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);this._writableState.defaultEncoding=t},o.prototype._write=function(t,e,r){r(new Error("not implemented"))},o.prototype._writev=null,o.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||w(this,n,r)}},{"./_stream_duplex":253,buffer:48,"core-util-is":258,events:244,inherits:296,"process-nextick-args":259,"util-deprecate":260}],258:[function(t,e,r){(function(t){function e(t){return Array.isArray?Array.isArray(t):"[object Array]"===g(t)}function n(t){return"boolean"==typeof t}function i(t){return null===t}function s(t){return null==t}function o(t){return"number"==typeof t}function a(t){return"string"==typeof t}function f(t){return"symbol"==typeof t}function u(t){return void 0===t}function c(t){return"[object RegExp]"===g(t)}function h(t){return"object"==typeof t&&null!==t}function d(t){return"[object Date]"===g(t)}function p(t){return"[object Error]"===g(t)||t instanceof Error}function l(t){return"function"==typeof t}function b(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function g(t){return Object.prototype.toString.call(t)}r.isArray=e,r.isBoolean=n,r.isNull=i,r.isNullOrUndefined=s,r.isNumber=o,r.isString=a,r.isSymbol=f,r.isUndefined=u,r.isRegExp=c,r.isObject=h,r.isDate=d,r.isError=p,r.isFunction=l,r.isPrimitive=b,r.isBuffer=t.isBuffer}).call(this,{isBuffer:t("../../../../insert-module-globals/node_modules/is-buffer/index.js")})},{"../../../../insert-module-globals/node_modules/is-buffer/index.js":245}],259:[function(t,e,r){(function(t){"use strict";function r(e){for(var r=new Array(arguments.length-1),n=0;n<r.length;)r[n++]=arguments[n];t.nextTick(function(){e.apply(null,r)})}!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports=r:e.exports=t.nextTick}).call(this,t("_process"))},{_process:247}],260:[function(t,e,r){(function(t){function r(t,e){function r(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}if(n("noDeprecation"))return t;var i=!1;return r}function n(e){try{if(!t.localStorage)return!1}catch(r){return!1}var n=t.localStorage[e];return null==n?!1:"true"===String(n).toLowerCase()}e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],261:[function(t,e,r){e.exports=t("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":254}],262:[function(t,e,r){var n=function(){try{return t("stream")}catch(e){}}();r=e.exports=t("./lib/_stream_readable.js"),r.Stream=n||r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":253,"./lib/_stream_passthrough.js":254,"./lib/_stream_readable.js":255,"./lib/_stream_transform.js":256,"./lib/_stream_writable.js":257}],263:[function(t,e,r){e.exports=t("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":256}],264:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":257}],265:[function(t,e,r){function n(){i.call(this)}e.exports=n;var i=t("events").EventEmitter,s=t("inherits");s(n,i),n.Readable=t("readable-stream/readable.js"),n.Writable=t("readable-stream/writable.js"),n.Duplex=t("readable-stream/duplex.js"),n.Transform=t("readable-stream/transform.js"),n.PassThrough=t("readable-stream/passthrough.js"),n.Stream=n,n.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&u.pause&&u.pause()}function n(){u.readable&&u.resume&&u.resume()}function s(){c||(c=!0,t.end())}function o(){c||(c=!0,"function"==typeof t.destroy&&t.destroy())}function a(t){if(f(),0===i.listenerCount(this,"error"))throw t}function f(){u.removeListener("data",r),t.removeListener("drain",n),u.removeListener("end",s),u.removeListener("close",o),u.removeListener("error",a),t.removeListener("error",a),u.removeListener("end",f),u.removeListener("close",f),t.removeListener("close",f)}var u=this;u.on("data",r),t.on("drain",n),t._isStdio||e&&e.end===!1||(u.on("end",s),u.on("close",o));var c=!1;return u.on("error",a),t.on("error",a),u.on("end",f),u.on("close",f),t.on("close",f),t.emit("pipe",u),t}},{events:244,inherits:296,"readable-stream/duplex.js":252,"readable-stream/passthrough.js":261,"readable-stream/readable.js":262,"readable-stream/transform.js":263,"readable-stream/writable.js":264}],266:[function(t,e,r){function n(t){if(t&&!f(t))throw new Error("Unknown encoding: "+t)}function i(t){return t.toString(this.encoding)}function s(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function o(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}var a=t("buffer").Buffer,f=a.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=r.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),n(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=i)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";t=t.slice(r,t.length),e=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var n=e.charCodeAt(e.length-1);if(!(n>=55296&&56319>=n)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,n=e.charCodeAt(i);if(n>=55296&&56319>=n){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),t.copy(this.charBuffer,0,0,s),e.substring(0,i)}return e},u.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(2>=e&&r>>4==14){this.charLength=3;break}if(3>=e&&r>>3==30){this.charLength=4;break}}this.charReceived=e},u.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},{buffer:48}],267:[function(t,e,r){function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,r){if(t&&u(t)&&t instanceof n)return t;var i=new n;return i.parse(t,e,r),i}function s(t){return f(t)&&(t=i(t)),t instanceof n?t.format():n.prototype.format.call(t)}function o(t,e){return i(t,!1,!0).resolve(e)}function a(t,e){return t?i(t,!1,!0).resolveObject(e):e}function f(t){return"string"==typeof t}function u(t){return"object"==typeof t&&null!==t}function c(t){return null===t}function h(t){return null==t}var d=t("punycode");r.parse=i,r.resolve=o,r.resolveObject=a,r.format=s,r.Url=n;var p=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,b=["<",">",'"',"`"," ","\r","\n"," "],g=["{","}","|","\\","^","`"].concat(b),m=["'"].concat(g),y=["%","/","?",";","#"].concat(m),v=["/","?","#"],_=255,w=/^[a-z0-9A-Z_-]{0,63}$/,S=/^([a-z0-9A-Z_-]{0,63})(.*)$/,I={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=t("querystring");n.prototype.parse=function(t,e,r){if(!f(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t;n=n.trim();var i=p.exec(n);if(i){i=i[0];var s=i.toLowerCase();this.protocol=s,n=n.substr(i.length)}if(r||i||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var o="//"===n.substr(0,2);!o||i&&k[i]||(n=n.substr(2),this.slashes=!0)}if(!k[i]&&(o||i&&!E[i])){for(var a=-1,u=0;u<v.length;u++){var c=n.indexOf(v[u]);-1!==c&&(-1===a||a>c)&&(a=c)}var h,l;l=-1===a?n.lastIndexOf("@"):n.lastIndexOf("@",a),-1!==l&&(h=n.slice(0,l),n=n.slice(l+1),this.auth=decodeURIComponent(h)),a=-1;for(var u=0;u<y.length;u++){var c=n.indexOf(y[u]);-1!==c&&(-1===a||a>c)&&(a=c)}-1===a&&(a=n.length),this.host=n.slice(0,a),n=n.slice(a),this.parseHost(),this.hostname=this.hostname||"";var b="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!b)for(var g=this.hostname.split(/\./),u=0,x=g.length;x>u;u++){var P=g[u];if(P&&!P.match(w)){for(var O="",B=0,M=P.length;M>B;B++)O+=P.charCodeAt(B)>127?"x":P[B];if(!O.match(w)){var R=g.slice(0,u),T=g.slice(u+1),C=P.match(S);C&&(R.push(C[1]),T.unshift(C[2])),T.length&&(n="/"+T.join(".")+n),this.hostname=R.join(".");break}}}if(this.hostname.length>_?this.hostname="":this.hostname=this.hostname.toLowerCase(),!b){for(var N=this.hostname.split("."),j=[],u=0;u<N.length;++u){var U=N[u];j.push(U.match(/[^A-Za-z0-9_-]/)?"xn--"+d.encode(U):U)}this.hostname=j.join(".")}var L=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+L,this.href+=this.host,b&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==n[0]&&(n="/"+n))}if(!I[s])for(var u=0,x=m.length;x>u;u++){var z=m[u],F=encodeURIComponent(z);F===z&&(F=escape(z)),n=n.split(z).join(F)}var K=n.indexOf("#");-1!==K&&(this.hash=n.substr(K),n=n.slice(0,K));var H=n.indexOf("?");if(-1!==H?(this.search=n.substr(H),this.query=n.substr(H+1),e&&(this.query=A.parse(this.query)),n=n.slice(0,H)):e&&(this.search="",this.query={}),n&&(this.pathname=n),E[s]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var L=this.pathname||"",U=this.search||"";this.path=L+U}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,s="";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(s=A.stringify(this.query));var o=this.search||s&&"?"+s||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||E[e])&&i!==!1?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),o&&"?"!==o.charAt(0)&&(o="?"+o),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),o=o.replace("#","%23"),e+i+r+o+n},n.prototype.resolve=function(t){return this.resolveObject(i(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if(f(t)){var e=new n;e.parse(t,!1,!0),t=e}var r=new n;if(Object.keys(this).forEach(function(t){r[t]=this[t]},this),r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(r[e]=t[e])}),E[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(t.protocol&&t.protocol!==r.protocol){if(!E[t.protocol])return Object.keys(t).forEach(function(e){r[e]=t[e]}),r.href=r.format(),r;if(r.protocol=t.protocol,t.host||k[t.protocol])r.pathname=t.pathname;else{for(var i=(t.pathname||"").split("/");i.length&&!(t.host=i.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),r.pathname=i.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var s=r.pathname||"",o=r.search||"";r.path=s+o}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var a=r.pathname&&"/"===r.pathname.charAt(0),u=t.host||t.pathname&&"/"===t.pathname.charAt(0),d=u||a||r.host&&t.pathname,p=d,l=r.pathname&&r.pathname.split("/")||[],i=t.pathname&&t.pathname.split("/")||[],b=r.protocol&&!E[r.protocol];if(b&&(r.hostname="",r.port=null,r.host&&(""===l[0]?l[0]=r.host:l.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===i[0]?i[0]=t.host:i.unshift(t.host)),t.host=null),d=d&&(""===i[0]||""===l[0])),u)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,l=i;else if(i.length)l||(l=[]),l.pop(),l=l.concat(i),r.search=t.search,r.query=t.query;else if(!h(t.search)){if(b){r.hostname=r.host=l.shift();var g=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return r.search=t.search,r.query=t.query,c(r.pathname)&&c(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!l.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var m=l.slice(-1)[0],y=(r.host||t.host)&&("."===m||".."===m)||""===m,v=0,_=l.length;_>=0;_--)m=l[_],"."==m?l.splice(_,1):".."===m?(l.splice(_,1),v++):v&&(l.splice(_,1),v--);if(!d&&!p)for(;v--;v)l.unshift("..");!d||""===l[0]||l[0]&&"/"===l[0].charAt(0)||l.unshift(""),y&&"/"!==l.join("/").substr(-1)&&l.push("");var w=""===l[0]||l[0]&&"/"===l[0].charAt(0);if(b){r.hostname=r.host=w?"":l.length?l.shift():"";var g=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return d=d||r.host&&l.length,d&&!w&&l.unshift(""),l.length?r.pathname=l.join("/"):(r.pathname=null,r.path=null),c(r.pathname)&&c(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=l.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:248,querystring:251}],268:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],269:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(e)?n.showHidden=e:e&&r._extend(n,e),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),f(n,t,n.depth)}function s(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function o(t,e){return t}function a(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function f(t,e,n){if(t.customInspect&&e&&A(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return v(i)||(i=f(t,i,n)),i}var s=u(t,e);if(s)return s;var o=Object.keys(e),b=a(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),E(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return c(e);if(0===o.length){if(A(e)){var g=e.name?": "+e.name:"";return t.stylize("[Function"+g+"]","special")}if(S(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(k(e))return t.stylize(Date.prototype.toString.call(e),"date");if(E(e))return c(e)}var m="",y=!1,_=["{","}"];if(l(e)&&(y=!0,_=["[","]"]),A(e)){var w=e.name?": "+e.name:"";m=" [Function"+w+"]"}if(S(e)&&(m=" "+RegExp.prototype.toString.call(e)),k(e)&&(m=" "+Date.prototype.toUTCString.call(e)),E(e)&&(m=" "+c(e)),0===o.length&&(!y||0==e.length))return _[0]+m+_[1];if(0>n)return S(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var I;return I=y?h(t,e,n,b,o):o.map(function(r){return d(t,e,n,b,r,y)}),t.seen.pop(),p(I,m,_)}function u(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return y(e)?t.stylize(""+e,"number"):b(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i){for(var s=[],o=0,a=e.length;a>o;++o)M(e,String(o))?s.push(d(t,e,r,n,String(o),!0)):s.push("");return i.forEach(function(i){i.match(/^\d+$/)||s.push(d(t,e,r,n,i,!0))}),s}function d(t,e,r,n,i,s){var o,a,u;if(u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},u.get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=g(r)?f(t,u.value,null):f(t,u.value,r-1),a.indexOf("\n")>-1&&(a=s?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),w(o)){if(s&&i.match(/^\d+$/))return a;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function p(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function l(t){return Array.isArray(t)}function b(t){return"boolean"==typeof t}function g(t){return null===t}function m(t){return null==t}function y(t){return"number"==typeof t}function v(t){return"string"==typeof t}function _(t){return"symbol"==typeof t}function w(t){return void 0===t}function S(t){return I(t)&&"[object RegExp]"===P(t)}function I(t){return"object"==typeof t&&null!==t}function k(t){return I(t)&&"[object Date]"===P(t)}function E(t){return I(t)&&("[object Error]"===P(t)||t instanceof Error)}function A(t){return"function"==typeof t}function x(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function P(t){return Object.prototype.toString.call(t)}function O(t){return 10>t?"0"+t.toString(10):t.toString(10)}function B(){var t=new Date,e=[O(t.getHours()),O(t.getMinutes()),O(t.getSeconds())].join(":");return[t.getDate(),N[t.getMonth()],e].join(" ")}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var R=/%[sdj%]/g;r.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(i(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,s=n.length,o=String(t).replace(R,function(t){if("%%"===t)return"%";if(r>=s)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}}),a=n[r];s>r;a=n[++r])o+=g(a)||!I(a)?" "+a:" "+i(a);return o},r.deprecate=function(t,i){function s(){if(!o){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),o=!0}return t.apply(this,arguments)}if(w(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(e.noDeprecation===!0)return t;var o=!1;return s};var T,C={};r.debuglog=function(t){if(w(T)&&(T=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!C[t])if(new RegExp("\\b"+t+"\\b","i").test(T)){var n=e.pid;C[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else C[t]=function(){};return C[t]},r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=l,r.isBoolean=b,r.isNull=g,r.isNullOrUndefined=m,r.isNumber=y,r.isString=v,r.isSymbol=_,r.isUndefined=w,r.isRegExp=S,r.isObject=I,r.isDate=k,r.isError=E,r.isFunction=A,r.isPrimitive=x,r.isBuffer=t("./support/isBuffer");var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",B(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!I(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":268,_process:247,inherits:296}],270:[function(require,module,exports){function Context(){}var indexOf=require("indexof"),Object_keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var r in t)e.push(r);return e},forEach=function(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r<t.length;r++)e(t[r],r,t)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(t,e,r){Object.defineProperty(t,e,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(t){return function(t,e,r){t[e]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];Context.prototype={};var Script=exports.Script=function(t){return this instanceof Script?void(this.code=t):new Script(t)};Script.prototype.runInContext=function(t){if(!(t instanceof Context))throw new TypeError("needs a 'context' argument.");var e=document.createElement("iframe");e.style||(e.style={}),e.style.display="none",document.body.appendChild(e);var r=e.contentWindow,n=r.eval,i=r.execScript;!n&&i&&(i.call(r,"null"),n=r.eval),forEach(Object_keys(t),function(e){r[e]=t[e]}),forEach(globals,function(e){t[e]&&(r[e]=t[e])});var s=Object_keys(r),o=n.call(r,this.code);return forEach(Object_keys(r),function(e){(e in t||-1===indexOf(s,e))&&(t[e]=r[e])}),forEach(globals,function(e){e in t||defineProp(t,e,r[e])}),document.body.removeChild(e),o},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(t){var e=Script.createContext(t),r=this.runInContext(e);return forEach(Object_keys(e),function(r){t[r]=e[r]}),r},forEach(Object_keys(Script.prototype),function(t){exports[t]=Script[t]=function(e){var r=Script(e);return r[t].apply(r,[].slice.call(arguments,1))}}),exports.createScript=function(t){return exports.Script(t)},exports.createContext=Script.createContext=function(t){var e=new Context;return"object"==typeof t&&forEach(Object_keys(t),function(r){e[r]=t[r]}),e}},{indexof:271}],271:[function(t,e,r){var n=[].indexOf;e.exports=function(t,e){if(n)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}},{}],272:[function(t,e,r){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,("le"===e||"be"===e)&&(r=e,e=10),void(null!==t&&this._init(t||0,e||10,r||"be")))}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),s=e;i>s;s++){var o=t.charCodeAt(s)-48;n<<=4,n|=o>=49&&54>=o?o-49+10:o>=17&&22>=o?o-17+10:15&o}return n}function o(t,e,r,n){for(var i=0,s=Math.min(t.length,r),o=e;s>o;o++){var a=t.charCodeAt(o)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}function a(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function f(){a.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function u(){a.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function c(){a.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function h(){a.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function d(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function p(t){d.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).ishln(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.sign=!0,this.minv=this.minv.mod(this.r)}"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26,i.prototype._init=function(t,e,n){if("number"==typeof t)return 0>t&&(this.sign=!0,t=-t),void(67108864>t?(this.words=[67108863&t],this.length=1):4503599627370496>t?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(9007199254740992>t),this.words=[67108863&t,t/67108864&67108863,1],this.length=3));if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&36>=e),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.sign=!0),this.strip()},i.prototype._initArray=function(t,e,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 i=0;i<this.length;i++)this.words[i]=0;var s=0;if("be"===n)for(var i=t.length-1,o=0;i>=0;i-=3){var a=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,s+=24,s>=26&&(s-=26,o++)}else if("le"===n)for(var i=0,o=0;i<t.length;i+=3){var a=t[i]|t[i+1]<<8|t[i+2]<<16;this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,s+=24,s>=26&&(s-=26,o++)}return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;for(var n=0,r=t.length-6,i=0;r>=e;r-=6){var o=s(t,r,r+6);this.words[i]|=o<<n&67108863,this.words[i+1]|=o>>>26-n&4194303,n+=24,n>=26&&(n-=26,i++)}if(r+6!==e){var o=s(t,e,r+6);this.words[i]|=o<<n&67108863,this.words[i+1]|=o>>>26-n&4194303}this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;67108863>=i;i*=e)n++;n--,i=i/e|0;for(var s=t.length-r,a=s%n,f=Math.min(s,s-a)+r,u=0,c=r;f>c;c+=n)u=o(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){for(var h=1,u=o(t,c,t.length,e),c=0;a>c;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.sign=this.sign,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],b=[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],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){if(t=t||10,16===t||"hex"===t){for(var n="",i=0,e=0|e||1,s=0,o=0;o<this.length;o++){var a=this.words[o],f=(16777215&(a<<i|s)).toString(16);s=a>>>24-i&16777215,n=0!==s||o!==this.length-1?l[6-f.length]+f+n:f+n,i+=2,i>=26&&(i-=26,o--)}for(0!==s&&(n=s.toString(16)+n);n.length%e!==0;)n="0"+n;return this.sign&&(n="-"+n),n}if(t===(0|t)&&t>=2&&36>=t){var u=b[t],c=g[t],n="",h=this.clone();for(h.sign=!1;0!==h.cmpn(0);){var d=h.modn(c).toString(t);h=h.idivn(c),n=0!==h.cmpn(0)?l[u-d.length]+d+n:d+n}return 0===this.cmpn(0)&&(n="0"+n),this.sign&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(){this.strip();var t=new Array(this.byteLength());t[0]=0;for(var e=this.clone(),r=0;0!==e.cmpn(0);r++){var n=e.andln(255);e.ishrn(8),t[t.length-r-1]=n}return t},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},i.prototype.bitLength=function(){var t=0,e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var t=this.clone();return t.sign=!this.sign,t},i.prototype.ior=function(t){for(this.sign=this.sign||t.sign;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.iand=function(t){this.sign=this.sign&&t.sign;var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.ixor=function(t){this.sign=this.sign||t.sign;var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);
for(var n=t/26|0,i=t%26;this.length<=n;)this.words[this.length++]=0;return e?this.words[n]=this.words[n]|1<<i:this.words[n]=this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(t){if(this.sign&&!t.sign){this.sign=!1;var e=this.isub(t);return this.sign=!this.sign,this._normSign()}if(!this.sign&&t.sign){t.sign=!1;var e=this.isub(t);return t.sign=!0,e._normSign()}var r,n;this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,s=0;s<n.length;s++){var e=r.words[s]+n.words[s]+i;this.words[s]=67108863&e,i=e>>>26}for(;0!==i&&s<r.length;s++){var e=r.words[s]+i;this.words[s]=67108863&e,i=e>>>26}if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},i.prototype.add=function(t){if(t.sign&&!this.sign){t.sign=!1;var e=this.sub(t);return t.sign=!0,e}if(!t.sign&&this.sign){this.sign=!1;var e=t.sub(this);return this.sign=!0,e}return this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(t.sign){t.sign=!1;var e=this.iadd(t);return t.sign=!0,e._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r=this.cmp(t);if(0===r)return this.sign=!1,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var s=0,o=0;o<i.length;o++){var e=n.words[o]-i.words[o]+s;s=e>>26,this.words[o]=67108863&e}for(;0!==s&&o<n.length;o++){var e=n.words[o]+s;s=e>>26,this.words[o]=67108863&e}if(0===s&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.sign=!0),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)},i.prototype._smallMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0;n<e.length-1;n++){for(var i=r>>>26,s=67108863&r,o=Math.min(n,t.length-1),a=Math.max(0,n-this.length+1);o>=a;a++){var f=n-a,u=0|this.words[f],c=0|t.words[a],h=u*c,d=67108863&h;i=i+(h/67108864|0)|0,d=d+s|0,s=67108863&d,i=i+(d>>>26)|0}e.words[n]=s,r=i}return 0!==r?e.words[n]=r:e.length--,e.strip()},i.prototype._bigMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0,i=0;i<e.length-1;i++){var s=n;n=0;for(var o=67108863&r,a=Math.min(i,t.length-1),f=Math.max(0,i-this.length+1);a>=f;f++){var u=i-f,c=0|this.words[u],h=0|t.words[f],d=c*h,p=67108863&d;s=s+(d/67108864|0)|0,p=p+o|0,o=67108863&p,s=s+(p>>>26)|0,n+=s>>>26,s&=67108863}e.words[i]=o,r=s,s=n}return 0!==r?e.words[i]=r:e.length--,e.strip()},i.prototype.mulTo=function(t,e){var r;return r=this.length+t.length<63?this._smallMulTo(t,e):this._bigMulTo(t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var e=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var n=this.length-2;n>=0;n--){for(var i=0,s=0,o=Math.min(n,r-1),a=Math.max(0,n-e+1);o>=a;a++){var f=n-a,u=this.words[f],c=t.words[a],h=u*c,d=67108863&h;i+=h/67108864|0,d+=s,s=67108863&d,i+=d>>>26}this.words[n]=s,this.words[n+1]+=i,i=0}for(var i=0,f=1;f<this.length;f++){var p=this.words[f]+i;this.words[f]=67108863&p,i=p>>>26}return this.strip()},i.prototype.imuln=function(t){r("number"==typeof t);for(var e=0,n=0;n<this.length;n++){var i=this.words[n]*t,s=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=s>>>26,this.words[n]=67108863&s}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.mul(this)},i.prototype.ishln=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=67108863>>>26-e<<26-e;if(0!==e){for(var s=0,o=0;o<this.length;o++){var a=this.words[o]&i,f=this.words[o]-a<<e;this.words[o]=f|s,s=a>>>26-e}s&&(this.words[o]=s,this.length++)}if(0!==n){for(var o=this.length-1;o>=0;o--)this.words[o+n]=this.words[o];for(var o=0;n>o;o++)this.words[o]=0;this.length+=n}return this.strip()},i.prototype.ishrn=function(t,e,n){r("number"==typeof t&&t>=0);var i;i=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,f=n;if(i-=o,i=Math.max(0,i),f){for(var u=0;o>u;u++)f.words[u]=this.words[u];f.length=o}if(0===o);else if(this.length>o){this.length-=o;for(var u=0;u<this.length;u++)this.words[u]=this.words[u+o]}else this.words[0]=0,this.length=1;for(var c=0,u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=this.words[u];this.words[u]=c<<26-s|h>>>s,c=h&a}return f&&0!==c&&(f.words[f.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return!1;var s=this.words[n];return!!(s&i)},i.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(!this.sign,"imaskn works only with positive numbers"),0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r("number"==typeof t),0>t?this.isubn(-t):this.sign?1===this.length&&this.words[0]<t?(this.words[0]=t-this.words[0],this.sign=!1,this):(this.sign=!1,this.isubn(t),this.sign=!0,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),0>t)return this.iaddn(-t);if(this.sign)return this.sign=!1,this.iaddn(t),this.sign=!0,this;this.words[0]-=t;for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.sign=!1,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var i,s=t.length+n;if(this.words.length<s){for(var o=new Array(s),i=0;i<this.length;i++)o[i]=this.words[i];this.words=o}else i=this.length;for(this.length=Math.max(this.length,s);i<this.length;i++)this.words[i]=0;for(var a=0,i=0;i<t.length;i++){var f=this.words[i+n]+a,u=t.words[i]*e;f-=67108863&u,a=(f>>26)-(u/67108864|0),this.words[i+n]=67108863&f}for(;i<this.length-n;i++){var f=this.words[i+n]+a;a=f>>26,this.words[i+n]=67108863&f}if(0===a)return this.strip();r(-1===a),a=0;for(var i=0;i<this.length;i++){var f=-this.words[i]+a;a=f>>26,this.words[i]=67108863&f}return this.sign=!0,this.strip()},i.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),s=t,o=s.words[s.length-1],a=this._countBits(o);r=26-a,0!==r&&(s=s.shln(r),n.ishln(r),o=s.words[s.length-1]);var f,u=n.length-s.length;if("mod"!==e){f=new i(null),f.length=u+1,f.words=new Array(f.length);for(var c=0;c<f.length;c++)f.words[c]=0}var h=n.clone()._ishlnsubmul(s,1,u);h.sign||(n=h,f&&(f.words[u]=1));for(var d=u-1;d>=0;d--){var p=67108864*n.words[s.length+d]+n.words[s.length+d-1];for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(s,p,d);n.sign;)p--,n.sign=!1,n._ishlnsubmul(s,1,d),0!==n.cmpn(0)&&(n.sign=!n.sign);f&&(f.words[d]=p)}return f&&f.strip(),n.strip(),"div"!==e&&0!==r&&n.ishrn(r),{div:f?f:null,mod:n}},i.prototype.divmod=function(t,e){if(r(0!==t.cmpn(0)),this.sign&&!t.sign){var n,s,o=this.neg().divmod(t,e);return"mod"!==e&&(n=o.div.neg()),"div"!==e&&(s=0===o.mod.cmpn(0)?o.mod:t.sub(o.mod)),{div:n,mod:s}}if(!this.sign&&t.sign){var n,o=this.divmod(t.neg(),e);return"mod"!==e&&(n=o.div.neg()),{div:n,mod:o.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),e):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,"div").div},i.prototype.mod=function(t){return this.divmod(t,"mod").mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(0===e.mod.cmpn(0))return e.div;var r=e.div.sign?e.mod.isub(t):e.mod,n=t.shrn(1),i=t.andln(1),s=r.cmp(n);return 0>s||1===i&&0===s?e.div:e.div.sign?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(67108863>=t);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+this.words[i])%t;return n},i.prototype.idivn=function(t){r(67108863>=t);for(var e=0,n=this.length-1;n>=0;n--){var i=this.words[n]+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var s=new i(1),o=new i(0),a=new i(0),f=new i(1),u=0;e.isEven()&&n.isEven();)e.ishrn(1),n.ishrn(1),++u;for(var c=n.clone(),h=e.clone();0!==e.cmpn(0);){for(;e.isEven();)e.ishrn(1),s.isEven()&&o.isEven()?(s.ishrn(1),o.ishrn(1)):(s.iadd(c).ishrn(1),o.isub(h).ishrn(1));for(;n.isEven();)n.ishrn(1),a.isEven()&&f.isEven()?(a.ishrn(1),f.ishrn(1)):(a.iadd(c).ishrn(1),f.isub(h).ishrn(1));e.cmp(n)>=0?(e.isub(n),s.isub(a),o.isub(f)):(n.isub(e),a.isub(s),f.isub(o))}return{a:a,b:f,gcd:n.ishln(u)}},i.prototype._invmp=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var s=new i(1),o=new i(0),a=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(;e.isEven();)e.ishrn(1),s.isEven()?s.ishrn(1):s.iadd(a).ishrn(1);for(;n.isEven();)n.ishrn(1),o.isEven()?o.ishrn(1):o.iadd(a).ishrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(o)):(n.isub(e),o.isub(s))}return 0===e.cmpn(1)?s:o},i.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var e=this.clone(),r=t.clone();e.sign=!1,r.sign=!1;for(var n=0;e.isEven()&&r.isEven();n++)e.ishrn(1),r.ishrn(1);for(;;){for(;e.isEven();)e.ishrn(1);for(;r.isEven();)r.ishrn(1);var i=e.cmp(r);if(0>i){var s=e;e=r,r=s}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.ishln(n)},i.prototype.invm=function(t){return this.egcd(t).a.mod(t)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n){for(var s=this.length;n+1>s;s++)this.words[s]=0;return this.words[n]|=i,this.length=n+1,this}for(var o=i,s=n;0!==o&&s<this.length;s++){var a=this.words[s];a+=o,o=a>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.cmpn=function(t){var e=0>t;if(e&&(t=-t),this.sign&&!e)return-1;if(!this.sign&&e)return 1;t&=67108863,this.strip();var r;if(this.length>1)r=1;else{var n=this.words[0];r=n===t?0:t>n?-1:1}return this.sign&&(r=-r),r},i.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var e=this.ucmp(t);return this.sign?-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=this.words[r],i=t.words[r];if(n!==i){i>n?e=-1:n>i&&(e=1);break}}return e},i.red=function(t){return new d(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};a.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},a.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength();while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},a.prototype.split=function(t,e){t.ishrn(this.n,0,e)},a.prototype.imulK=function(t){return t.imul(this.k)},n(f,a),f.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;n>i;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];e.words[e.length++]=s&r;for(var i=10;i<t.length;i++){var o=t.words[i];t.words[i-10]=(o&r)<<4|s>>>22,s=o}t.words[i-10]=s>>>22,t.length-=9},f.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e,r=0,n=0;n<t.length;n++){var i=t.words[n];e=64*i,r+=977*i,e+=r/67108864|0,r&=67108863,t.words[n]=r,r=e}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(u,a),n(c,a),n(h,a),h.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*t.words[r]+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function y(t){if(m[t])return m[t];var y;if("k256"===t)y=new f;else if("p224"===t)y=new u;else if("p192"===t)y=new c;else{if("p25519"!==t)throw new Error("Unknown prime "+t);y=new h}return m[t]=y,y},d.prototype._verify1=function(t){r(!t.sign,"red works only with positives"),r(t.red,"red works only with red numbers")},d.prototype._verify2=function(t,e){r(!t.sign&&!e.sign,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},d.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},d.prototype.neg=function(t){var e=t.clone();return e.sign=!e.sign,e.iadd(this.m)._forceRed(this)},d.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},d.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},d.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},d.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},d.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.shln(e))},d.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},d.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},d.prototype.isqr=function(t){return this.imul(t,t)},d.prototype.sqr=function(t){return this.mul(t,t)},d.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new i(1)).ishrn(2),s=this.pow(t,n);return s}for(var o=this.m.subn(1),a=0;0!==o.cmpn(0)&&0===o.andln(1);)a++,o.ishrn(1);r(0!==o.cmpn(0));var f=new i(1).toRed(this),u=f.redNeg(),c=this.m.subn(1).ishrn(1),h=this.m.bitLength();for(h=new i(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var d=this.pow(h,o),s=this.pow(t,o.addn(1).ishrn(1)),p=this.pow(t,o),l=a;0!==p.cmp(f);){for(var b=p,g=0;0!==b.cmp(f);g++)b=b.redSqr();r(l>g);var m=this.pow(d,new i(1).ishln(l-g-1));s=s.redMul(m),d=m.redSqr(),p=p.redMul(d),l=g}return s},d.prototype.invm=function(t){var e=t._invmp(this.m);return e.sign?(e.sign=!1,this.imod(e).redNeg()):this.imod(e)},d.prototype.pow=function(t,e){var r=[];if(0===e.cmpn(0))return new i(1);for(var n=e.clone();0!==n.cmpn(0);)r.push(n.andln(1)),n.ishrn(1);for(var s=t,o=0;o<r.length&&0===r[o];o++,s=this.sqr(s));if(++o<r.length)for(var n=this.sqr(s);o<r.length;o++,n=this.sqr(n))0!==r[o]&&(s=this.mul(s,n));return s},d.prototype.convertTo=function(t){return t.clone()},d.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new p(t)},n(p,d),p.prototype.convertTo=function(t){return this.imod(t.shln(this.shift))},p.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},p.prototype.imul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).ishrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},p.prototype.mul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=r.isub(n).ishrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):s.cmpn(0)<0&&(o=s.iadd(this.m)),o._forceRed(this)},p.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}("undefined"==typeof e||e,this)},{}],273:[function(t,e,r){function n(t){if(0===t.length)return"";var e,r,n=[0];for(e=0;e<t.length;e++){for(r=0;r<n.length;r++)n[r]<<=8;n[0]+=t[e];var i=0;for(r=0;r<n.length;++r)n[r]+=i,i=n[r]/f|0,n[r]%=f;for(;i;)n.push(i%f),i=i/f|0}for(e=0;0===t[e]&&e<t.length-1;e++)n.push(0);return n.reverse().map(function(t){return s[t]}).join("")}function i(t){if(0===t.length)return[];var e,r,n=[0];for(e=0;e<t.length;e++){var i=t[e];if(!(i in o))throw new Error("Non-base58 character");for(r=0;r<n.length;r++)n[r]*=f;n[0]+=o[i];var s=0;for(r=0;r<n.length;++r)n[r]+=s,s=n[r]>>8,n[r]&=255;for(;s;)n.push(255&s),s>>=8}for(e=0;"1"===t[e]&&e<t.length-1;e++)n.push(0);return n.reverse()}for(var s="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",o={},a=0;a<s.length;a++)o[s.charAt(a)]=a;var f=58;e.exports={encode:n,decode:i}},{}],274:[function(t,e,r){e.exports=function(t,e){for(var r=0,n=0;n<t.length&&n!=e.length&&(r=t[n]<e[n]?-1:t[n]>e[n]?1:0,0==r);++n);return 0==r&&(e.length>t.length?r=-1:t.length>e.length&&(r=1)),r}},{}],275:[function(t,e,r){"use strict";var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.hmacDRBG=t("./elliptic/hmac-drbg"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec")},{"../package.json":295,"./elliptic/curve":278,"./elliptic/curves":281,"./elliptic/ec":282,"./elliptic/hmac-drbg":285,"./elliptic/utils":287,brorand:288}],276:[function(t,e,r){"use strict";function n(t,e){this.type=t,this.p=new s(e.p,16),this.red=e.prime?s.red(e.prime):s.mont(this.p),this.zero=new s(0).toRed(this.red),this.one=new s(1).toRed(this.red),this.two=new s(2).toRed(this.red),this.n=e.n&&new s(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function i(t,e){this.curve=t,this.type=e,this.precomputed=null}var s=t("bn.js"),o=t("../../elliptic"),a=o.utils.getNAF,f=o.utils.getJSF,u=o.utils.assert;e.exports=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(t,e){var r=t._getDoubles(),n=a(e,1),i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;for(var s=[],o=0;o<n.length;o+=r.step){for(var f=0,e=o+r.step-1;e>=o;e--)f=(f<<1)+n[e];s.push(f)}for(var u=this.jpoint(null,null,null),c=this.jpoint(null,null,null),h=i;h>0;h--){for(var o=0;o<s.length;o++){var f=s[o];f===h?c=c.mixedAdd(r.points[o]):f===-h&&(c=c.mixedAdd(r.points[o].neg()))}u=u.add(c)}return u.toP()},n.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=a(e,r),o=this.jpoint(null,null,null),f=s.length-1;f>=0;f--){for(var e=0;f>=0&&0===s[f];f--)e++;if(f>=0&&e++,o=o.dblp(e),0>f)break;var c=s[f];u(0!==c),o="affine"===t.type?c>0?o.mixedAdd(i[c-1>>1]):o.mixedAdd(i[-c-1>>1].neg()):c>0?o.add(i[c-1>>1]):o.add(i[-c-1>>1].neg())}return"affine"===t.type?o.toP():o},n.prototype._wnafMulAdd=function(t,e,r,n){for(var i=this._wnafT1,s=this._wnafT2,o=this._wnafT3,u=0,c=0;n>c;c++){var h=e[c],d=h._getNAFPoints(t);i[c]=d.wnd,s[c]=d.points}for(var c=n-1;c>=1;c-=2){var p=c-1,l=c;if(1===i[p]&&1===i[l]){var b=[e[p],null,null,e[l]];0===e[p].y.cmp(e[l].y)?(b[1]=e[p].add(e[l]),b[2]=e[p].toJ().mixedAdd(e[l].neg())):0===e[p].y.cmp(e[l].y.redNeg())?(b[1]=e[p].toJ().mixedAdd(e[l]),b[2]=e[p].add(e[l].neg())):(b[1]=e[p].toJ().mixedAdd(e[l]),b[2]=e[p].toJ().mixedAdd(e[l].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],m=f(r[p],r[l]);u=Math.max(m[0].length,u),o[p]=new Array(u),o[l]=new Array(u);for(var y=0;u>y;y++){var v=0|m[0][y],_=0|m[1][y];o[p][y]=g[3*(v+1)+(_+1)],o[l][y]=0,s[p]=b}}else o[p]=a(r[p],i[p]),o[l]=a(r[l],i[l]),u=Math.max(o[p].length,u),u=Math.max(o[l].length,u)}for(var w=this.jpoint(null,null,null),S=this._wnafT4,c=u;c>=0;c--){for(var I=0;c>=0;){for(var k=!0,y=0;n>y;y++)S[y]=0|o[y][c],0!==S[y]&&(k=!1);if(!k)break;I++,c--}if(c>=0&&I++,w=w.dblp(I),0>c)break;for(var y=0;n>y;y++){var h,E=S[y];0!==E&&(E>0?h=s[y][E-1>>1]:0>E&&(h=s[y][-E-1>>1].neg()),w="affine"===h.type?w.mixedAdd(h):w.add(h))}}for(var c=0;n>c;c++)s[c]=null;return w.toP()},n.BasePoint=i,i.prototype.validate=function(){return this.curve.validate(this)},i.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},i.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;e>i;i+=t){for(var s=0;t>s;s++)n=n.dbl();r.push(n)}return{step:t,points:r}},i.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;r>i;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},i.prototype._getBeta=function(){return null},i.prototype.dblp=function(t){for(var e=this,r=0;t>r;r++)e=e.dbl();return e}},{"../../elliptic":275,"bn.js":272}],277:[function(t,e,r){"use strict";function n(t){this.twisted=1!==(0|t.a),this.mOneA=this.twisted&&-1===(0|t.a),this.extended=this.mOneA,u.call(this,"edwards",t),this.a=new a(t.a,16).mod(this.red.m).toRed(this.red),this.c=new a(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new a(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|t.c)}function i(t,e,r,n,i){u.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new a(e,16),this.y=new a(r,16),this.z=n?new a(n,16):this.curve.one,this.t=i&&new a(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var s=t("../curve"),o=t("../../elliptic"),a=t("bn.js"),f=t("inherits"),u=s.base,c=o.utils.assert;f(n,u),e.exports=n,n.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},n.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},n.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},n.prototype.pointFromX=function(t,e){e=new a(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()).redSqrt(),f=o.fromRed().isOdd();return(t&&!f||!t&&f)&&(o=o.redNeg()),this.point(e,o,s.one)},n.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},f(i,u.BasePoint),n.prototype.pointFromJSON=function(t){return i.fromJSON(this,t)},n.prototype.point=function(t,e,r,n){return new i(this,t,e,r,n)},i.fromJSON=function(t,e){return new i(t,e[0],e[1],e[2])},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},i.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),s=n.redAdd(e),o=s.redSub(r),a=n.redSub(e),f=i.redMul(o),u=s.redMul(a),c=i.redMul(a),h=o.redMul(s);return this.curve.point(f,u,h,c)},i.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var o=this.curve._mulA(i),a=o.redAdd(s);if(this.zOne)t=n.redSub(i).redSub(s).redMul(a.redSub(this.curve.two)),e=a.redMul(o.redSub(s)),r=a.redSqr().redSub(a).redSub(a);else{var f=this.z.redSqr(),u=a.redSub(f).redISub(f);t=n.redSub(i).redISub(s).redMul(u),e=a.redMul(o.redSub(s)),r=a.redMul(u)}}else{var o=i.redAdd(s),f=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=o.redSub(f).redSub(f);t=this.curve._mulC(n.redISub(o)).redMul(u),e=this.curve._mulC(o).redMul(i.redISub(s)),r=o.redMul(u)}return this.curve.point(t,e,r)},i.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},i.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),s=r.redSub(e),o=i.redSub(n),a=i.redAdd(n),f=r.redAdd(e),u=s.redMul(o),c=a.redMul(f),h=s.redMul(f),d=o.redMul(a);return this.curve.point(u,c,d,h)},i.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),s=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(s).redMul(o),f=i.redSub(a),u=i.redAdd(a),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(o),h=n.redMul(f).redMul(c);return this.curve.twisted?(e=n.redMul(u).redMul(o.redSub(this.curve._mulA(s))),r=f.redMul(u)):(e=n.redMul(u).redMul(o.redSub(s)),r=this.curve._mulC(f).redMul(u)),this.curve.point(h,e,r)},i.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},i.prototype.mul=function(t){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},i.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2)},i.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},i.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},i.prototype.getY=function(){return this.normalize(),this.y.fromRed()},i.prototype.toP=i.prototype.normalize,i.prototype.mixedAdd=i.prototype.add},{"../../elliptic":275,"../curve":278,"bn.js":272,inherits:296}],278:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{"./base":276,"./edwards":277,"./mont":279,"./short":280,dup:90}],279:[function(t,e,r){"use strict";function n(t){f.call(this,"mont",t),this.a=new o(t.a,16).toRed(this.red),this.b=new o(t.b,16).toRed(this.red),this.i4=new o(4).toRed(this.red).redInvm(),this.two=new o(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(t,e,r){f.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new o(e,16),this.z=new o(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var s=t("../curve"),o=t("bn.js"),a=t("inherits"),f=s.base;a(n,f),e.exports=n,n.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e),i=n.redSqrt();return 0===i.redSqr().cmp(n)},a(i,f.BasePoint),n.prototype.point=function(t,e){return new i(this,t,e)},n.prototype.pointFromJSON=function(t){return i.fromJSON(this,t)},i.prototype.precompute=function(){},i.fromJSON=function(t,e){return new i(t,e[0],e[1]||t.one)},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var t=this.x.redAdd(this.z),e=t.redSqr(),r=this.x.redSub(this.z),n=r.redSqr(),i=e.redSub(n),s=e.redMul(n),o=i.redMul(n.redAdd(this.curve.a24.redMul(i)));return this.curve.point(s,o)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),s=t.x.redSub(t.z),o=s.redMul(r),a=i.redMul(n),f=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(f,u)},i.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=this,s=[];0!==e.cmpn(0);e.ishrn(1))s.push(e.andln(1));for(var o=s.length-1;o>=0;o--)0===s[o]?(r=r.diffAdd(n,i),n=n.dbl()):(n=r.diffAdd(n,i),r=r.dbl());return n},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":278,"bn.js":272,inherits:296}],280:[function(t,e,r){"use strict";function n(t){c.call(this,"short",t),this.a=new f(t.a,16).toRed(this.red),this.b=new f(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function i(t,e,r,n){c.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new f(e,16),this.y=new f(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function s(t,e,r,n){c.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,
this.z=new f(0)):(this.x=new f(e,16),this.y=new f(r,16),this.z=new f(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var o=t("../curve"),a=t("../../elliptic"),f=t("bn.js"),u=t("inherits"),c=o.base,h=a.utils.assert;u(n,c),e.exports=n,n.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new f(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=n[0].cmp(n[1])<0?n[0]:n[1],e=e.toRed(this.red)}if(t.lambda)r=new f(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],h(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}var s;return s=t.basis?t.basis.map(function(t){return{a:new f(t.a,16),b:new f(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:s}}},n.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:f.mont(t),r=new f(2).toRed(e).redInvm(),n=r.redNeg(),i=new f(3).toRed(e).redNeg().redSqrt().redMul(r),s=n.redAdd(i).fromRed(),o=n.redSub(i).fromRed();return[s,o]},n.prototype._getEndoBasis=function(t){for(var e,r,n,i,s,o,a,u,c,h=this.n.shrn(Math.floor(this.n.bitLength()/2)),d=t,p=this.n.clone(),l=new f(1),b=new f(0),g=new f(0),m=new f(1),y=0;0!==d.cmpn(0);){var v=p.div(d);u=p.sub(v.mul(d)),c=g.sub(v.mul(l));var _=m.sub(v.mul(b));if(!n&&u.cmp(h)<0)e=a.neg(),r=l,n=u.neg(),i=c;else if(n&&2===++y)break;a=u,p=d,d=u,g=l,l=c,m=b,b=_}s=u.neg(),o=c;var w=n.sqr().add(i.sqr()),S=s.sqr().add(o.sqr());return S.cmp(w)>=0&&(s=e,o=r),n.sign&&(n=n.neg(),i=i.neg()),s.sign&&(s=s.neg(),o=o.neg()),[{a:n,b:i},{a:s,b:o}]},n.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=i.mul(r.a),a=s.mul(n.a),f=i.mul(r.b),u=s.mul(n.b),c=t.sub(o).sub(a),h=f.add(u).neg();return{k1:c,k2:h}},n.prototype.pointFromX=function(t,e){e=new f(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt(),i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},n.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},n.prototype._endoWnafMulAdd=function(t,e){for(var r=this._endoWnafT1,n=this._endoWnafT2,i=0;i<t.length;i++){var s=this._endoSplit(e[i]),o=t[i],a=o._getBeta();s.k1.sign&&(s.k1.sign=!s.k1.sign,o=o.neg(!0)),s.k2.sign&&(s.k2.sign=!s.k2.sign,a=a.neg(!0)),r[2*i]=o,r[2*i+1]=a,n[2*i]=s.k1,n[2*i+1]=s.k2}for(var f=this._wnafMulAdd(1,r,n,2*i),u=0;2*i>u;u++)r[u]=null,n[u]=null;return f},u(i,c.BasePoint),n.prototype.point=function(t,e,r){return new i(this,t,e,r)},n.prototype.pointFromJSON=function(t,e){return i.fromJSON(this,t,e)},i.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},i.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},i.fromJSON=function(t,e,r){function n(e){return t.point(e[0],e[1],r)}"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;var s=e[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(n))}},i},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return this.inf},i.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},i.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),s=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},i.prototype.getX=function(){return this.x.fromRed()},i.prototype.getY=function(){return this.y.fromRed()},i.prototype.mul=function(t){return t=new f(t,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},i.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},i.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},i.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},i.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t},u(s,c.BasePoint),n.prototype.jpoint=function(t,e,r){return new s(this,t,e,r)},s.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},s.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},s.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),f=s.redSub(o);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),h=n.redMul(u),d=f.redSqr().redIAdd(c).redISub(h).redISub(h),p=f.redMul(h.redISub(d)).redISub(s.redMul(c)),l=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,p,l)},s.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(n),a=i.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),u=f.redMul(o),c=r.redMul(f),h=a.redSqr().redIAdd(u).redISub(c).redISub(c),d=a.redMul(c.redISub(h)).redISub(i.redMul(u)),p=this.z.redMul(o);return this.curve.jpoint(h,d,p)},s.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;t>r;r++)e=e.dbl();return e}for(var n=this.curve.a,i=this.curve.tinv,s=this.x,o=this.y,a=this.z,f=a.redSqr().redSqr(),u=o.redAdd(o),r=0;t>r;r++){var c=s.redSqr(),h=u.redSqr(),d=h.redSqr(),p=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(f)),l=s.redMul(h),b=p.redSqr().redISub(l.redAdd(l)),g=l.redISub(b),m=p.redMul(g);m=m.redIAdd(m).redISub(d);var y=u.redMul(a);t>r+1&&(f=f.redMul(d)),s=b,a=y,u=m}return this.curve.jpoint(s,u.redMul(i),a)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},s.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),s=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(s);o=o.redIAdd(o);var a=n.redAdd(n).redIAdd(n),f=a.redSqr().redISub(o).redISub(o),u=s.redIAdd(s);u=u.redIAdd(u),u=u.redIAdd(u),t=f,e=a.redMul(o.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),p=this.x.redAdd(h).redSqr().redISub(c).redISub(d);p=p.redIAdd(p);var l=c.redAdd(c).redIAdd(c),b=l.redSqr(),g=d.redIAdd(d);g=g.redIAdd(g),g=g.redIAdd(g),t=b.redISub(p).redISub(p),e=l.redMul(p.redISub(t)).redISub(g),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(t,e,r)},s.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),s=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(s);o=o.redIAdd(o);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),f=a.redSqr().redISub(o).redISub(o);t=f;var u=s.redIAdd(s);u=u.redIAdd(u),u=u.redIAdd(u),e=a.redMul(o.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),p=this.x.redSub(c).redMul(this.x.redAdd(c));p=p.redAdd(p).redIAdd(p);var l=d.redIAdd(d);l=l.redIAdd(l);var b=l.redAdd(l);t=p.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var g=h.redSqr();g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g),e=p.redMul(l.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},s.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),s=e.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(i)),f=e.redAdd(e);f=f.redIAdd(f);var u=f.redMul(o),c=a.redSqr().redISub(u.redAdd(u)),h=u.redISub(c),d=o.redSqr();d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var p=a.redMul(h).redISub(d),l=r.redAdd(r).redMul(n);return this.curve.jpoint(c,p,l)},s.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),s=i.redSqr(),o=this.x.redAdd(e).redSqr().redISub(t).redISub(n);o=o.redIAdd(o),o=o.redAdd(o).redIAdd(o),o=o.redISub(s);var a=o.redSqr(),f=n.redIAdd(n);f=f.redIAdd(f),f=f.redIAdd(f),f=f.redIAdd(f);var u=i.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(f),c=e.redMul(u);c=c.redIAdd(c),c=c.redIAdd(c);var h=this.x.redMul(a).redISub(c);h=h.redIAdd(h),h=h.redIAdd(h);var d=this.y.redMul(u.redMul(f.redISub(u)).redISub(o.redMul(a)));d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var p=this.z.redAdd(o).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,d,p)},s.prototype.mul=function(t,e){return t=new f(t,e),this.curve._wnafMul(this,t)},s.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},s.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":275,"../curve":278,"bn.js":272,inherits:296}],281:[function(t,e,r){"use strict";function n(t){"short"===t.type?this.curve=new a.curve["short"](t):"edwards"===t.type?this.curve=new a.curve.edwards(t):this.curve=new a.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function i(t,e){Object.defineProperty(s,t,{configurable:!0,enumerable:!0,get:function(){var r=new n(e);return Object.defineProperty(s,t,{configurable:!0,enumerable:!0,value:r}),r}})}var s=r,o=t("hash.js"),a=t("../elliptic"),f=a.utils.assert;s.PresetCurve=n,i("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),i("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),i("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),i("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),i("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var u;try{u=t("./precomputed/secp256k1")}catch(c){u=void 0}i("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",u]})},{"../elliptic":275,"./precomputed/secp256k1":286,"hash.js":289}],282:[function(t,e,r){"use strict";function n(t){return this instanceof n?("string"==typeof t&&(a(s.curves.hasOwnProperty(t),"Unknown curve "+t),t=s.curves[t]),t instanceof s.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),void(this.hash=t.hash||t.curve.hash)):new n(t)}var i=t("bn.js"),s=t("../../elliptic"),o=s.utils,a=o.assert,f=t("./key"),u=t("./signature");e.exports=n,n.prototype.keyPair=function(t){return new f(this,t)},n.prototype.keyFromPrivate=function(t,e){return f.fromPrivate(this,t,e)},n.prototype.keyFromPublic=function(t,e){return f.fromPublic(this,t,e)},n.prototype.genKeyPair=function(t){t||(t={});for(var e=new s.hmacDRBG({hash:this.hash,pers:t.pers,entropy:t.entropy||s.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var o=new i(e.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},n.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.shrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},n.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var o=this.n.byteLength(),a=e.getPrivate().toArray(),f=a.length;21>f;f++)a.unshift(0);for(var c=t.toArray(),f=c.length;o>f;f++)c.unshift(0);for(var h=new s.hmacDRBG({hash:this.hash,entropy:a,nonce:c}),d=this.n.sub(new i(1));;){var p=new i(h.generate(this.n.byteLength()));if(p=this._truncateToN(p,!0),!(p.cmpn(1)<=0||p.cmp(d)>=0)){var l=this.g.mul(p);if(!l.isInfinity()){var b=l.getX().mod(this.n);if(0!==b.cmpn(0)){var g=p.invm(this.n).mul(b.mul(e.getPrivate()).iadd(t)).mod(this.n);if(0!==g.cmpn(0))return n.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g)),new u({r:b,s:g})}}}}},n.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n),e=new u(e,"hex");var s=e.r,o=e.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),f=a.mul(t).mod(this.n),c=a.mul(s).mod(this.n),h=this.g.mulAdd(f,r.getPublic(),c);return h.isInfinity()?!1:0===h.getX().mod(this.n).cmp(s)}},{"../../elliptic":275,"./key":283,"./signature":284,"bn.js":272}],283:[function(t,e,r){"use strict";function n(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var i=t("bn.js"),s=t("../../elliptic"),o=s.utils;e.exports=n,n.fromPublic=function(t,e,r){return e instanceof n?e:new n(t,{pub:e,pubEnc:r})},n.fromPrivate=function(t,e,r){return e instanceof n?e:new n(t,{priv:e,privEnc:r})},n.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},n.prototype.getPublic=function(t,e){if(this.pub||(this.pub=this.ec.g.mul(this.priv)),"string"==typeof t&&(e=t,t=null),!e)return this.pub;for(var r=this.ec.curve.p.byteLength(),n=this.pub.getX().toArray(),i=n.length;r>i;i++)n.unshift(0);var s;if("mont"!==this.ec.curve.type)if(t)s=[this.pub.getY().isEven()?2:3].concat(n);else{for(var a=this.pub.getY().toArray(),i=a.length;r>i;i++)a.unshift(0);var s=[4].concat(n,a)}else s=n;return o.encode(s,e)},n.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},n.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.mod(this.ec.curve.n)},n.prototype._importPublic=function(t,e){return t.x||t.y?void(this.pub=this.ec.curve.point(t.x,t.y)):(t=o.toArray(t,e),"mont"!==this.ec.curve.type?this._importPublicShort(t):this._importPublicMont(t))},n.prototype._importPublicShort=function(t){var e=this.ec.curve.p.byteLength();4===t[0]&&t.length-1===2*e?this.pub=this.ec.curve.point(t.slice(1,1+e),t.slice(1+e,1+2*e)):2!==t[0]&&3!==t[0]||t.length-1!==e||(this.pub=this.ec.curve.pointFromX(3===t[0],t.slice(1,1+e)))},n.prototype._importPublicMont=function(t){this.pub=this.ec.curve.point(t,1)},n.prototype.derive=function(t){return t.mul(this.priv).getX()},n.prototype.sign=function(t){return this.ec.sign(t,this)},n.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},n.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":275,"bn.js":272}],284:[function(t,e,r){"use strict";function n(t,e){return t instanceof n?t:void(this._importDER(t,e)||(a(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16)))}var i=t("bn.js"),s=t("../../elliptic"),o=s.utils,a=o.assert;e.exports=n,n.prototype._importDER=function(t,e){if(t=o.toArray(t,e),t.length<6||48!==t[0]||2!==t[2])return!1;var r=t[1];if(1+r>t.length)return!1;var n=t[3];if(n>=128)return!1;if(4+n+2>=t.length)return!1;if(2!==t[4+n])return!1;var s=t[5+n];return s>=128?!1:4+n+2+s>t.length?!1:(this.r=new i(t.slice(4,4+n)),this.s=new i(t.slice(4+n+2,4+n+2+s)),!0)},n.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r));var n=e.length+r.length+4,i=[48,n,2,e.length];return i=i.concat(e,[2,r.length],r),o.encode(i,t)}},{"../../elliptic":275,"bn.js":272}],285:[function(t,e,r){arguments[4][100][0].apply(r,arguments)},{"../elliptic":275,dup:100,"hash.js":289}],286:[function(t,e,r){arguments[4][101][0].apply(r,arguments)},{dup:101}],287:[function(t,e,r){"use strict";function n(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if(e){if("hex"===e){t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),s=i>>8,o=255&i;s?r.push(s,o):r.push(o)}return r}function i(t){return 1===t.length?"0"+t:t}function s(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}function o(t,e){for(var r=[],n=1<<e+1,i=t.clone();i.cmpn(1)>=0;){var s;if(i.isOdd()){var o=i.andln(n-1);s=o>(n>>1)-1?(n>>1)-o:o,i.isubn(s)}else s=0;r.push(s);for(var a=0!==i.cmpn(0)&&0===i.andln(n-1)?e+1:1,f=1;a>f;f++)r.push(0);i.ishrn(a)}return r}function a(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var s=t.andln(3)+n&3,o=e.andln(3)+i&3;3===s&&(s=-1),3===o&&(o=-1);var a;if(0===(1&s))a=0;else{var f=t.andln(7)+n&7;a=3!==f&&5!==f||2!==o?s:-s}r[0].push(a);var u;if(0===(1&o))u=0;else{var f=e.andln(7)+i&7;u=3!==f&&5!==f||2!==s?o:-o}r[1].push(u),2*n===a+1&&(n=1-n),2*i===u+1&&(i=1-i),t.ishrn(1),e.ishrn(1)}return r}var f=r;f.assert=function(t,e){if(!t)throw new Error(e||"Assertion failed")},f.toArray=n,f.zero2=i,f.toHex=s,f.encode=function(t,e){return"hex"===e?s(t):t},f.getNAF=o,f.getJSF=a},{}],288:[function(t,e,r){arguments[4][103][0].apply(r,arguments)},{dup:103}],289:[function(t,e,r){arguments[4][104][0].apply(r,arguments)},{"./hash/common":290,"./hash/hmac":291,"./hash/ripemd":292,"./hash/sha":293,"./hash/utils":294,dup:104}],290:[function(t,e,r){arguments[4][105][0].apply(r,arguments)},{"../hash":289,dup:105}],291:[function(t,e,r){arguments[4][106][0].apply(r,arguments)},{"../hash":289,dup:106}],292:[function(t,e,r){arguments[4][107][0].apply(r,arguments)},{"../hash":289,dup:107}],293:[function(t,e,r){arguments[4][108][0].apply(r,arguments)},{"../hash":289,dup:108}],294:[function(t,e,r){arguments[4][109][0].apply(r,arguments)},{dup:109,inherits:296}],295:[function(t,e,r){e.exports={name:"elliptic",version:"3.0.3",description:"EC cryptography",main:"lib/elliptic.js",scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},repository:{type:"git",url:"git+ssh://[email protected]/indutny/elliptic.git"},keywords:["EC","Elliptic","curve","Cryptography"],author:{name:"Fedor Indutny",email:"[email protected]"},license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",_id:"[email protected]",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_from:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz"}},{}],296:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],297:[function(t,e,r){(function(t){(function(){function n(t,e){if(t!==e){var r=null===t,n=t===E,i=t===t,s=null===e,o=e===E,a=e===e;if(t>e&&!s||!i||r&&!o&&a||n&&a)return 1;if(e>t&&!r||!a||s&&!n&&i||o&&i)return-1}return 0}function i(t,e,r){for(var n=t.length,i=r?n:-1;r?i--:++i<n;)if(e(t[i],i,t))return i;return-1}function s(t,e,r){if(e!==e)return g(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function o(t){return"function"==typeof t||!1}function a(t){return null==t?"":t+""}function f(t,e){for(var r=-1,n=t.length;++r<n&&e.indexOf(t.charAt(r))>-1;);return r}function u(t,e){for(var r=t.length;r--&&e.indexOf(t.charAt(r))>-1;);return r}function c(t,e){return n(t.criteria,e.criteria)||t.index-e.index}function h(t,e,r){for(var i=-1,s=t.criteria,o=e.criteria,a=s.length,f=r.length;++i<a;){var u=n(s[i],o[i]);if(u){if(i>=f)return u;var c=r[i];return u*("asc"===c||c===!0?1:-1)}}return t.index-e.index}function d(t){return qt[t]}function p(t){return Vt[t]}function l(t,e,r){return e?t=Wt[t]:r&&(t=Xt[t]),"\\"+t}function b(t){return"\\"+Xt[t]}function g(t,e,r){for(var n=t.length,i=e+(r?0:-1);r?i--:++i<n;){var s=t[i];if(s!==s)return i}return-1}function m(t){return!!t&&"object"==typeof t}function y(t){return 160>=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function v(t,e){for(var r=-1,n=t.length,i=-1,s=[];++r<n;)t[r]===e&&(t[r]=q,s[++i]=r);return s}function _(t,e){for(var r,n=-1,i=t.length,s=-1,o=[];++n<i;){var a=t[n],f=e?e(a,n,t):a;n&&r===f||(r=f,o[++s]=a)}return o}function w(t){for(var e=-1,r=t.length;++e<r&&y(t.charCodeAt(e)););return e}function S(t){for(var e=t.length;e--&&y(t.charCodeAt(e)););return e}function I(t){return Yt[t]}function k(t){function e(t){if(m(t)&&!Oa(t)&&!(t instanceof Z)){if(t instanceof y)return t;if(to.call(t,"__chain__")&&to.call(t,"__wrapped__"))return pn(t)}return new y(t)}function r(){}function y(t,e,r){this.__wrapped__=t,this.__actions__=r||[],this.__chain__=!!e}function Z(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Po,this.__views__=[]}function et(){var t=new Z(this.__wrapped__);return t.__actions__=te(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=te(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=te(this.__views__),t}function nt(){if(this.__filtered__){var t=new Z(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function qt(){var t=this.__wrapped__.value(),e=this.__dir__,r=Oa(t),n=0>e,i=r?t.length:0,s=Vr(0,i,this.__views__),o=s.start,a=s.end,f=a-o,u=n?a:o-1,c=this.__iteratees__,h=c.length,d=0,p=Io(f,this.__takeCount__);if(!r||z>i||i==f&&p==f)return rr(n&&r?t.reverse():t,this.__actions__);var l=[];t:for(;f--&&p>d;){u+=e;for(var b=-1,g=t[u];++b<h;){var m=c[b],y=m.iteratee,v=m.type,_=y(g);if(v==K)g=_;else if(!_){if(v==F)continue t;break t}}l[d++]=g}return l}function Vt(){this.__data__={}}function Yt(t){return this.has(t)&&delete this.__data__[t]}function Gt(t){return"__proto__"==t?E:this.__data__[t]}function Wt(t){return"__proto__"!=t&&to.call(this.__data__,t)}function Xt(t,e){return"__proto__"!=t&&(this.__data__[t]=e),this}function Jt(t){var e=t?t.length:0;for(this.data={hash:mo(null),set:new co};e--;)this.push(t[e])}function Zt(t,e){var r=t.data,n="string"==typeof e||Ci(e)?r.set.has(e):r.hash[e];return n?0:-1}function Qt(t){var e=this.data;"string"==typeof t||Ci(t)?e.set.add(t):e.hash[t]=!0}function $t(t,e){for(var r=-1,n=t.length,i=-1,s=e.length,o=zs(n+s);++r<n;)o[r]=t[r];for(;++i<s;)o[r++]=e[i];return o}function te(t,e){var r=-1,n=t.length;for(e||(e=zs(n));++r<n;)e[r]=t[r];return e}function ee(t,e){for(var r=-1,n=t.length;++r<n&&e(t[r],r,t)!==!1;);
return t}function ie(t,e){for(var r=t.length;r--&&e(t[r],r,t)!==!1;);return t}function se(t,e){for(var r=-1,n=t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function oe(t,e,r,n){for(var i=-1,s=t.length,o=n,a=o;++i<s;){var f=t[i],u=+e(f);r(u,o)&&(o=u,a=f)}return a}function ae(t,e){for(var r=-1,n=t.length,i=-1,s=[];++r<n;){var o=t[r];e(o,r,t)&&(s[++i]=o)}return s}function fe(t,e){for(var r=-1,n=t.length,i=zs(n);++r<n;)i[r]=e(t[r],r,t);return i}function ue(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function ce(t,e,r,n){var i=-1,s=t.length;for(n&&s&&(r=t[++i]);++i<s;)r=e(r,t[i],i,t);return r}function he(t,e,r,n){var i=t.length;for(n&&i&&(r=t[--i]);i--;)r=e(r,t[i],i,t);return r}function de(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function pe(t,e){for(var r=t.length,n=0;r--;)n+=+e(t[r])||0;return n}function le(t,e){return t===E?e:t}function be(t,e,r,n){return t!==E&&to.call(n,r)?t:e}function ge(t,e,r){for(var n=-1,i=za(e),s=i.length;++n<s;){var o=i[n],a=t[o],f=r(a,e[o],o,t,e);(f===f?f===a:a!==a)&&(a!==E||o in t)||(t[o]=f)}return t}function me(t,e){return null==e?t:ve(e,za(e),t)}function ye(t,e){for(var r=-1,n=null==t,i=!n&&Jr(t),s=i?t.length:0,o=e.length,a=zs(o);++r<o;){var f=e[r];i?a[r]=Zr(f,s)?t[f]:E:a[r]=n?E:t[f]}return a}function ve(t,e,r){r||(r={});for(var n=-1,i=e.length;++n<i;){var s=e[n];r[s]=t[s]}return r}function _e(t,e,r){var n=typeof t;return"function"==n?e===E?t:sr(t,e,r):null==t?xs:"object"==n?De(t):e===E?Ts(t):ze(t,e)}function we(t,e,r,n,i,s,o){var a;if(r&&(a=i?r(t,n,i):r(t)),a!==E)return a;if(!Ci(t))return t;var f=Oa(t);if(f){if(a=Yr(t),!e)return te(t,a)}else{var u=ro.call(t),c=u==J;if(u!=$&&u!=V&&(!c||i))return Ht[u]?Wr(t,u,e):i?t:{};if(a=Gr(c?{}:t),!e)return me(a,t)}s||(s=[]),o||(o=[]);for(var h=s.length;h--;)if(s[h]==t)return o[h];return s.push(t),o.push(a),(f?ee:Me)(t,function(n,i){a[i]=we(n,e,r,i,t,s,o)}),a}function Se(t,e,r){if("function"!=typeof t)throw new Xs(H);return ho(function(){t.apply(E,r)},e)}function Ie(t,e){var r=t?t.length:0,n=[];if(!r)return n;var i=-1,o=Kr(),a=o==s,f=a&&e.length>=z?lr(e):null,u=e.length;f&&(o=Zt,a=!1,e=f);t:for(;++i<r;){var c=t[i];if(a&&c===c){for(var h=u;h--;)if(e[h]===c)continue t;n.push(c)}else o(e,c,0)<0&&n.push(c)}return n}function ke(t,e){var r=!0;return jo(t,function(t,n,i){return r=!!e(t,n,i)}),r}function Ee(t,e,r,n){var i=n,s=i;return jo(t,function(t,o,a){var f=+e(t,o,a);(r(f,i)||f===n&&f===s)&&(i=f,s=t)}),s}function Ae(t,e,r,n){var i=t.length;for(r=null==r?0:+r||0,0>r&&(r=-r>i?0:i+r),n=n===E||n>i?i:+n||0,0>n&&(n+=i),i=r>n?0:n>>>0,r>>>=0;i>r;)t[r++]=e;return t}function xe(t,e){var r=[];return jo(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r}function Pe(t,e,r,n){var i;return r(t,function(t,r,s){return e(t,r,s)?(i=n?r:t,!1):void 0}),i}function Oe(t,e,r,n){n||(n=[]);for(var i=-1,s=t.length;++i<s;){var o=t[i];m(o)&&Jr(o)&&(r||Oa(o)||Ei(o))?e?Oe(o,e,r,n):ue(n,o):r||(n[n.length]=o)}return n}function Be(t,e){return Lo(t,e,ts)}function Me(t,e){return Lo(t,e,za)}function Re(t,e){return Do(t,e,za)}function Te(t,e){for(var r=-1,n=e.length,i=-1,s=[];++r<n;){var o=e[r];Ti(t[o])&&(s[++i]=o)}return s}function Ce(t,e,r){if(null!=t){r!==E&&r in hn(t)&&(e=[r]);for(var n=0,i=e.length;null!=t&&i>n;)t=t[e[n++]];return n&&n==i?t:E}}function Ne(t,e,r,n,i,s){return t===e?!0:null==t||null==e||!Ci(t)&&!m(e)?t!==t&&e!==e:je(t,e,Ne,r,n,i,s)}function je(t,e,r,n,i,s,o){var a=Oa(t),f=Oa(e),u=Y,c=Y;a||(u=ro.call(t),u==V?u=$:u!=$&&(a=Hi(t))),f||(c=ro.call(e),c==V?c=$:c!=$&&(f=Hi(e)));var h=u==$,d=c==$,p=u==c;if(p&&!a&&!h)return Lr(t,e,u);if(!i){var l=h&&to.call(t,"__wrapped__"),b=d&&to.call(e,"__wrapped__");if(l||b)return r(l?t.value():t,b?e.value():e,n,i,s,o)}if(!p)return!1;s||(s=[]),o||(o=[]);for(var g=s.length;g--;)if(s[g]==t)return o[g]==e;s.push(t),o.push(e);var m=(a?Ur:Dr)(t,e,r,n,i,s,o);return s.pop(),o.pop(),m}function Ue(t,e,r){var n=e.length,i=n,s=!r;if(null==t)return!i;for(t=hn(t);n--;){var o=e[n];if(s&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++n<i;){o=e[n];var a=o[0],f=t[a],u=o[1];if(s&&o[2]){if(f===E&&!(a in t))return!1}else{var c=r?r(f,u,a):E;if(!(c===E?Ne(u,f,r,!0):c))return!1}}return!0}function Le(t,e){var r=-1,n=Jr(t)?zs(t.length):[];return jo(t,function(t,i,s){n[++r]=e(t,i,s)}),n}function De(t){var e=Hr(t);if(1==e.length&&e[0][2]){var r=e[0][0],n=e[0][1];return function(t){return null==t?!1:t[r]===n&&(n!==E||r in hn(t))}}return function(t){return Ue(t,e)}}function ze(t,e){var r=Oa(t),n=$r(t)&&rn(e),i=t+"";return t=dn(t),function(s){if(null==s)return!1;var o=i;if(s=hn(s),(r||!n)&&!(o in s)){if(s=1==t.length?s:Ce(s,We(t,0,-1)),null==s)return!1;o=An(t),s=hn(s)}return s[o]===e?e!==E||o in s:Ne(e,s[o],E,!0)}}function Fe(t,e,r,n,i){if(!Ci(t))return t;var s=Jr(e)&&(Oa(e)||Hi(e)),o=s?E:za(e);return ee(o||e,function(a,f){if(o&&(f=a,a=e[f]),m(a))n||(n=[]),i||(i=[]),Ke(t,e,f,Fe,r,n,i);else{var u=t[f],c=r?r(u,a,f,t,e):E,h=c===E;h&&(c=a),c===E&&(!s||f in t)||!h&&(c===c?c===u:u!==u)||(t[f]=c)}}),t}function Ke(t,e,r,n,i,s,o){for(var a=s.length,f=e[r];a--;)if(s[a]==f)return void(t[r]=o[a]);var u=t[r],c=i?i(u,f,r,t,e):E,h=c===E;h&&(c=f,Jr(f)&&(Oa(f)||Hi(f))?c=Oa(u)?u:Jr(u)?te(u):[]:zi(f)||Ei(f)?c=Ei(u)?Wi(u):zi(u)?u:{}:h=!1),s.push(f),o.push(c),h?t[r]=n(c,f,i,s,o):(c===c?c!==u:u===u)&&(t[r]=c)}function He(t){return function(e){return null==e?E:e[t]}}function qe(t){var e=t+"";return t=dn(t),function(r){return Ce(r,t,e)}}function Ve(t,e){for(var r=t?e.length:0;r--;){var n=e[r];if(n!=i&&Zr(n)){var i=n;po.call(t,n,1)}}return t}function Ye(t,e){return t+yo(Ao()*(e-t+1))}function Ge(t,e,r,n,i){return i(t,function(t,i,s){r=n?(n=!1,t):e(r,t,i,s)}),r}function We(t,e,r){var n=-1,i=t.length;e=null==e?0:+e||0,0>e&&(e=-e>i?0:i+e),r=r===E||r>i?i:+r||0,0>r&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=zs(i);++n<i;)s[n]=t[n+e];return s}function Xe(t,e){var r;return jo(t,function(t,n,i){return r=e(t,n,i),!r}),!!r}function Je(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}function Ze(t,e,r){var n=zr(),i=-1;e=fe(e,function(t){return n(t)});var s=Le(t,function(t){var r=fe(e,function(e){return e(t)});return{criteria:r,index:++i,value:t}});return Je(s,function(t,e){return h(t,e,r)})}function Qe(t,e){var r=0;return jo(t,function(t,n,i){r+=+e(t,n,i)||0}),r}function $e(t,e){var r=-1,n=Kr(),i=t.length,o=n==s,a=o&&i>=z,f=a?lr():null,u=[];f?(n=Zt,o=!1):(a=!1,f=e?[]:u);t:for(;++r<i;){var c=t[r],h=e?e(c,r,t):c;if(o&&c===c){for(var d=f.length;d--;)if(f[d]===h)continue t;e&&f.push(h),u.push(c)}else n(f,h,0)<0&&((e||a)&&f.push(h),u.push(c))}return u}function tr(t,e){for(var r=-1,n=e.length,i=zs(n);++r<n;)i[r]=t[e[r]];return i}function er(t,e,r,n){for(var i=t.length,s=n?i:-1;(n?s--:++s<i)&&e(t[s],s,t););return r?We(t,n?0:s,n?s+1:i):We(t,n?s+1:0,n?i:s)}function rr(t,e){var r=t;r instanceof Z&&(r=r.value());for(var n=-1,i=e.length;++n<i;){var s=e[n];r=s.func.apply(s.thisArg,ue([r],s.args))}return r}function nr(t,e,r){var n=0,i=t?t.length:n;if("number"==typeof e&&e===e&&Mo>=i){for(;i>n;){var s=n+i>>>1,o=t[s];(r?e>=o:e>o)&&null!==o?n=s+1:i=s}return i}return ir(t,e,xs,r)}function ir(t,e,r,n){e=r(e);for(var i=0,s=t?t.length:0,o=e!==e,a=null===e,f=e===E;s>i;){var u=yo((i+s)/2),c=r(t[u]),h=c!==E,d=c===c;if(o)var p=d||n;else p=a?d&&h&&(n||null!=c):f?d&&(n||h):null==c?!1:n?e>=c:e>c;p?i=u+1:s=u}return Io(s,Bo)}function sr(t,e,r){if("function"!=typeof t)return xs;if(e===E)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,n,i){return t.call(e,r,n,i)};case 4:return function(r,n,i,s){return t.call(e,r,n,i,s)};case 5:return function(r,n,i,s,o){return t.call(e,r,n,i,s,o)}}return function(){return t.apply(e,arguments)}}function or(t){var e=new so(t.byteLength),r=new lo(e);return r.set(new lo(t)),e}function ar(t,e,r){for(var n=r.length,i=-1,s=So(t.length-n,0),o=-1,a=e.length,f=zs(a+s);++o<a;)f[o]=e[o];for(;++i<n;)f[r[i]]=t[i];for(;s--;)f[o++]=t[i++];return f}function fr(t,e,r){for(var n=-1,i=r.length,s=-1,o=So(t.length-i,0),a=-1,f=e.length,u=zs(o+f);++s<o;)u[s]=t[s];for(var c=s;++a<f;)u[c+a]=e[a];for(;++n<i;)u[c+r[n]]=t[s++];return u}function ur(t,e){return function(r,n,i){var s=e?e():{};if(n=zr(n,i,3),Oa(r))for(var o=-1,a=r.length;++o<a;){var f=r[o];t(s,f,n(f,o,r),r)}else jo(r,function(e,r,i){t(s,e,n(e,r,i),i)});return s}}function cr(t){return mi(function(e,r){var n=-1,i=null==e?0:r.length,s=i>2?r[i-2]:E,o=i>2?r[2]:E,a=i>1?r[i-1]:E;for("function"==typeof s?(s=sr(s,a,5),i-=2):(s="function"==typeof a?a:E,i-=s?1:0),o&&Qr(r[0],r[1],o)&&(s=3>i?E:s,i=1);++n<i;){var f=r[n];f&&t(e,f,s)}return e})}function hr(t,e){return function(r,n){var i=r?Ko(r):0;if(!en(i))return t(r,n);for(var s=e?i:-1,o=hn(r);(e?s--:++s<i)&&n(o[s],s,o)!==!1;);return r}}function dr(t){return function(e,r,n){for(var i=hn(e),s=n(e),o=s.length,a=t?o:-1;t?a--:++a<o;){var f=s[a];if(r(i[f],f,i)===!1)break}return e}}function pr(t,e){function r(){var i=this&&this!==re&&this instanceof r?n:t;return i.apply(e,arguments)}var n=gr(t);return r}function lr(t){return mo&&co?new Jt(t):null}function br(t){return function(e){for(var r=-1,n=ks(cs(e)),i=n.length,s="";++r<i;)s=t(s,n[r],r);return s}}function gr(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=No(t.prototype),n=t.apply(r,e);return Ci(n)?n:r}}function mr(t){function e(r,n,i){i&&Qr(r,n,i)&&(n=E);var s=jr(r,t,E,E,E,E,E,n);return s.placeholder=e.placeholder,s}return e}function yr(t,e){return mi(function(r){var n=r[0];return null==n?n:(r.push(e),t.apply(E,r))})}function vr(t,e){return function(r,n,i){if(i&&Qr(r,n,i)&&(n=E),n=zr(n,i,3),1==n.length){r=Oa(r)?r:cn(r);var s=oe(r,n,t,e);if(!r.length||s!==e)return s}return Ee(r,n,t,e)}}function _r(t,e){return function(r,n,s){if(n=zr(n,s,3),Oa(r)){var o=i(r,n,e);return o>-1?r[o]:E}return Pe(r,n,t)}}function wr(t){return function(e,r,n){return e&&e.length?(r=zr(r,n,3),i(e,r,t)):-1}}function Sr(t){return function(e,r,n){return r=zr(r,n,3),Pe(e,r,t,!0)}}function Ir(t){return function(){for(var e,r=arguments.length,n=t?r:-1,i=0,s=zs(r);t?n--:++n<r;){var o=s[i++]=arguments[n];if("function"!=typeof o)throw new Xs(H);!e&&y.prototype.thru&&"wrapper"==Fr(o)&&(e=new y([],!0))}for(n=e?-1:r;++n<r;){o=s[n];var a=Fr(o),f="wrapper"==a?Fo(o):E;e=f&&tn(f[0])&&f[1]==(C|B|R|N)&&!f[4].length&&1==f[9]?e[Fr(f[0])].apply(e,f[3]):1==o.length&&tn(o)?e[a]():e.thru(o)}return function(){var t=arguments,n=t[0];if(e&&1==t.length&&Oa(n)&&n.length>=z)return e.plant(n).value();for(var i=0,o=r?s[i].apply(this,t):n;++i<r;)o=s[i].call(this,o);return o}}}function kr(t,e){return function(r,n,i){return"function"==typeof n&&i===E&&Oa(r)?t(r,n):e(r,sr(n,i,3))}}function Er(t){return function(e,r,n){return("function"!=typeof r||n!==E)&&(r=sr(r,n,3)),t(e,r,ts)}}function Ar(t){return function(e,r,n){return("function"!=typeof r||n!==E)&&(r=sr(r,n,3)),t(e,r)}}function xr(t){return function(e,r,n){var i={};return r=zr(r,n,3),Me(e,function(e,n,s){var o=r(e,n,s);n=t?o:n,e=t?e:o,i[n]=e}),i}}function Pr(t){return function(e,r,n){return e=a(e),(t?e:"")+Rr(e,r,n)+(t?"":e)}}function Or(t){var e=mi(function(r,n){var i=v(n,e.placeholder);return jr(r,t,E,n,i)});return e}function Br(t,e){return function(r,n,i,s){var o=arguments.length<3;return"function"==typeof n&&s===E&&Oa(r)?t(r,n,i,o):Ge(r,zr(n,s,4),i,o,e)}}function Mr(t,e,r,n,i,s,o,a,f,u){function c(){for(var y=arguments.length,_=y,w=zs(y);_--;)w[_]=arguments[_];if(n&&(w=ar(w,n,i)),s&&(w=fr(w,s,o)),l||g){var S=c.placeholder,I=v(w,S);if(y-=I.length,u>y){var k=a?te(a):E,A=So(u-y,0),O=l?I:E,B=l?E:I,M=l?w:E,C=l?E:w;e|=l?R:T,e&=~(l?T:R),b||(e&=~(x|P));var N=[t,e,r,M,O,C,B,k,f,A],j=Mr.apply(E,N);return tn(t)&&Ho(j,N),j.placeholder=S,j}}var U=d?r:this,L=p?U[t]:t;return a&&(w=fn(w,a)),h&&f<w.length&&(w.length=f),this&&this!==re&&this instanceof c&&(L=m||gr(t)),L.apply(U,w)}var h=e&C,d=e&x,p=e&P,l=e&B,b=e&O,g=e&M,m=p?E:gr(t);return c}function Rr(t,e,r){var n=t.length;if(e=+e,n>=e||!_o(e))return"";var i=e-n;return r=null==r?" ":r+"",gs(r,go(i/r.length)).slice(0,i)}function Tr(t,e,r,n){function i(){for(var e=-1,a=arguments.length,f=-1,u=n.length,c=zs(u+a);++f<u;)c[f]=n[f];for(;a--;)c[f++]=arguments[++e];var h=this&&this!==re&&this instanceof i?o:t;return h.apply(s?r:this,c)}var s=e&x,o=gr(t);return i}function Cr(t){var e=qs[t];return function(t,r){return r=r===E?0:+r||0,r?(r=fo(10,r),e(t*r)/r):e(t)}}function Nr(t){return function(e,r,n,i){var s=zr(n);return null==n&&s===_e?nr(e,r,t):ir(e,r,s(n,i,1),t)}}function jr(t,e,r,n,i,s,o,a){var f=e&P;if(!f&&"function"!=typeof t)throw new Xs(H);var u=n?n.length:0;if(u||(e&=~(R|T),n=i=E),u-=i?i.length:0,e&T){var c=n,h=i;n=i=E}var d=f?E:Fo(t),p=[t,e,r,n,i,c,h,s,o,a];if(d&&(nn(p,d),e=p[1],a=p[9]),p[9]=null==a?f?0:t.length:So(a-u,0)||0,e==x)var l=pr(p[0],p[2]);else l=e!=R&&e!=(x|R)||p[4].length?Mr.apply(E,p):Tr.apply(E,p);var b=d?zo:Ho;return b(l,p)}function Ur(t,e,r,n,i,s,o){var a=-1,f=t.length,u=e.length;if(f!=u&&!(i&&u>f))return!1;for(;++a<f;){var c=t[a],h=e[a],d=n?n(i?h:c,i?c:h,a):E;if(d!==E){if(d)continue;return!1}if(i){if(!de(e,function(t){return c===t||r(c,t,n,i,s,o)}))return!1}else if(c!==h&&!r(c,h,n,i,s,o))return!1}return!0}function Lr(t,e,r){switch(r){case G:case W:return+t==+e;case X:return t.name==e.name&&t.message==e.message;case Q:return t!=+t?e!=+e:t==+e;case tt:case rt:return t==e+""}return!1}function Dr(t,e,r,n,i,s,o){var a=za(t),f=a.length,u=za(e),c=u.length;if(f!=c&&!i)return!1;for(var h=f;h--;){var d=a[h];if(!(i?d in e:to.call(e,d)))return!1}for(var p=i;++h<f;){d=a[h];var l=t[d],b=e[d],g=n?n(i?b:l,i?l:b,d):E;if(!(g===E?r(l,b,n,i,s,o):g))return!1;p||(p="constructor"==d)}if(!p){var m=t.constructor,y=e.constructor;if(m!=y&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y))return!1}return!0}function zr(t,r,n){var i=e.callback||Es;return i=i===Es?_e:i,n?i(t,r,n):i}function Fr(t){for(var e=t.name,r=Co[e],n=r?r.length:0;n--;){var i=r[n],s=i.func;if(null==s||s==t)return i.name}return e}function Kr(t,r,n){var i=e.indexOf||kn;return i=i===kn?s:i,t?i(t,r,n):i}function Hr(t){for(var e=es(t),r=e.length;r--;)e[r][2]=rn(e[r][1]);return e}function qr(t,e){var r=null==t?E:t[e];return Ui(r)?r:E}function Vr(t,e,r){for(var n=-1,i=r.length;++n<i;){var s=r[n],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=Io(e,t+o);break;case"takeRight":t=So(t,e-o)}}return{start:t,end:e}}function Yr(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&to.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function Gr(t){var e=t.constructor;return"function"==typeof e&&e instanceof e||(e=Ys),new e}function Wr(t,e,r){var n=t.constructor;switch(e){case it:return or(t);case G:case W:return new n(+t);case st:case ot:case at:case ft:case ut:case ct:case ht:case dt:case pt:var i=t.buffer;return new n(r?or(i):i,t.byteOffset,t.length);case Q:case rt:return new n(t);case tt:var s=new n(t.source,Rt.exec(t));s.lastIndex=t.lastIndex}return s}function Xr(t,e,r){null==t||$r(e,t)||(e=dn(e),t=1==e.length?t:Ce(t,We(e,0,-1)),e=An(e));var n=null==t?t:t[e];return null==n?E:n.apply(t,r)}function Jr(t){return null!=t&&en(Ko(t))}function Zr(t,e){return t="number"==typeof t||Nt.test(t)?+t:-1,e=null==e?Ro:e,t>-1&&t%1==0&&e>t}function Qr(t,e,r){if(!Ci(r))return!1;var n=typeof e;if("number"==n?Jr(r)&&Zr(e,r.length):"string"==n&&e in r){var i=r[e];return t===t?t===i:i!==i}return!1}function $r(t,e){var r=typeof t;if("string"==r&&Et.test(t)||"number"==r)return!0;if(Oa(t))return!1;var n=!kt.test(t);return n||null!=e&&t in hn(e)}function tn(t){var r=Fr(t);if(!(r in Z.prototype))return!1;var n=e[r];if(t===n)return!0;var i=Fo(n);return!!i&&t===i[0]}function en(t){return"number"==typeof t&&t>-1&&t%1==0&&Ro>=t}function rn(t){return t===t&&!Ci(t)}function nn(t,e){var r=t[1],n=e[1],i=r|n,s=C>i,o=n==C&&r==B||n==C&&r==N&&t[7].length<=e[8]||n==(C|N)&&r==B;if(!s&&!o)return t;n&x&&(t[2]=e[2],i|=r&x?0:O);var a=e[3];if(a){var f=t[3];t[3]=f?ar(f,a,e[4]):te(a),t[4]=f?v(t[3],q):te(e[4])}return a=e[5],a&&(f=t[5],t[5]=f?fr(f,a,e[6]):te(a),t[6]=f?v(t[5],q):te(e[6])),a=e[7],a&&(t[7]=te(a)),n&C&&(t[8]=null==t[8]?e[8]:Io(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function sn(t,e){return t===E?e:Ba(t,e,sn)}function on(t,e){t=hn(t);for(var r=-1,n=e.length,i={};++r<n;){var s=e[r];s in t&&(i[s]=t[s])}return i}function an(t,e){var r={};return Be(t,function(t,n,i){e(t,n,i)&&(r[n]=t)}),r}function fn(t,e){for(var r=t.length,n=Io(e.length,r),i=te(t);n--;){var s=e[n];t[n]=Zr(s,r)?i[s]:E}return t}function un(t){for(var e=ts(t),r=e.length,n=r&&t.length,i=!!n&&en(n)&&(Oa(t)||Ei(t)),s=-1,o=[];++s<r;){var a=e[s];(i&&Zr(a,n)||to.call(t,a))&&o.push(a)}return o}function cn(t){return null==t?[]:Jr(t)?Ci(t)?t:Ys(t):ss(t)}function hn(t){return Ci(t)?t:Ys(t)}function dn(t){if(Oa(t))return t;var e=[];return a(t).replace(At,function(t,r,n,i){e.push(n?i.replace(Bt,"$1"):r||t)}),e}function pn(t){return t instanceof Z?t.clone():new y(t.__wrapped__,t.__chain__,te(t.__actions__))}function ln(t,e,r){e=(r?Qr(t,e,r):null==e)?1:So(yo(e)||1,1);for(var n=0,i=t?t.length:0,s=-1,o=zs(go(i/e));i>n;)o[++s]=We(t,n,n+=e);return o}function bn(t){for(var e=-1,r=t?t.length:0,n=-1,i=[];++e<r;){var s=t[e];s&&(i[++n]=s)}return i}function gn(t,e,r){var n=t?t.length:0;return n?((r?Qr(t,e,r):null==e)&&(e=1),We(t,0>e?0:e)):[]}function mn(t,e,r){var n=t?t.length:0;return n?((r?Qr(t,e,r):null==e)&&(e=1),e=n-(+e||0),We(t,0,0>e?0:e)):[]}function yn(t,e,r){return t&&t.length?er(t,zr(e,r,3),!0,!0):[]}function vn(t,e,r){return t&&t.length?er(t,zr(e,r,3),!0):[]}function _n(t,e,r,n){var i=t?t.length:0;return i?(r&&"number"!=typeof r&&Qr(t,e,r)&&(r=0,n=i),Ae(t,e,r,n)):[]}function wn(t){return t?t[0]:E}function Sn(t,e,r){var n=t?t.length:0;return r&&Qr(t,e,r)&&(e=!1),n?Oe(t,e):[]}function In(t){var e=t?t.length:0;return e?Oe(t,!0):[]}function kn(t,e,r){var n=t?t.length:0;if(!n)return-1;if("number"==typeof r)r=0>r?So(n+r,0):r;else if(r){var i=nr(t,e);return n>i&&(e===e?e===t[i]:t[i]!==t[i])?i:-1}return s(t,e,r||0)}function En(t){return mn(t,1)}function An(t){var e=t?t.length:0;return e?t[e-1]:E}function xn(t,e,r){var n=t?t.length:0;if(!n)return-1;var i=n;if("number"==typeof r)i=(0>r?So(n+r,0):Io(r||0,n-1))+1;else if(r){i=nr(t,e,!0)-1;var s=t[i];return(e===e?e===s:s!==s)?i:-1}if(e!==e)return g(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Pn(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var r=0,n=Kr(),i=t.length;++r<i;)for(var s=0,o=t[r];(s=n(e,o,s))>-1;)po.call(e,s,1);return e}function On(t,e,r){var n=[];if(!t||!t.length)return n;var i=-1,s=[],o=t.length;for(e=zr(e,r,3);++i<o;){var a=t[i];e(a,i,t)&&(n.push(a),s.push(i))}return Ve(t,s),n}function Bn(t){return gn(t,1)}function Mn(t,e,r){var n=t?t.length:0;return n?(r&&"number"!=typeof r&&Qr(t,e,r)&&(e=0,r=n),We(t,e,r)):[]}function Rn(t,e,r){var n=t?t.length:0;return n?((r?Qr(t,e,r):null==e)&&(e=1),We(t,0,0>e?0:e)):[]}function Tn(t,e,r){var n=t?t.length:0;return n?((r?Qr(t,e,r):null==e)&&(e=1),e=n-(+e||0),We(t,0>e?0:e)):[]}function Cn(t,e,r){return t&&t.length?er(t,zr(e,r,3),!1,!0):[]}function Nn(t,e,r){return t&&t.length?er(t,zr(e,r,3)):[]}function jn(t,e,r,n){var i=t?t.length:0;if(!i)return[];null!=e&&"boolean"!=typeof e&&(n=r,r=Qr(t,e,n)?E:e,e=!1);var o=zr();return(null!=r||o!==_e)&&(r=o(r,n,3)),e&&Kr()==s?_(t,r):$e(t,r)}function Un(t){if(!t||!t.length)return[];var e=-1,r=0;t=ae(t,function(t){return Jr(t)?(r=So(t.length,r),!0):void 0});for(var n=zs(r);++e<r;)n[e]=fe(t,He(e));return n}function Ln(t,e,r){var n=t?t.length:0;if(!n)return[];var i=Un(t);return null==e?i:(e=sr(e,r,4),fe(i,function(t){return ce(t,e,E,!0)}))}function Dn(){for(var t=-1,e=arguments.length;++t<e;){var r=arguments[t];if(Jr(r))var n=n?ue(Ie(n,r),Ie(r,n)):r}return n?$e(n):[]}function zn(t,e){var r=-1,n=t?t.length:0,i={};for(!n||e||Oa(t[0])||(e=[]);++r<n;){var s=t[r];e?i[s]=e[r]:s&&(i[s[0]]=s[1])}return i}function Fn(t){var r=e(t);return r.__chain__=!0,r}function Kn(t,e,r){return e.call(r,t),t}function Hn(t,e,r){return e.call(r,t)}function qn(){return Fn(this)}function Vn(){return new y(this.value(),this.__chain__)}function Yn(t){for(var e,n=this;n instanceof r;){var i=pn(n);e?s.__wrapped__=i:e=i;var s=i;n=n.__wrapped__}return s.__wrapped__=t,e}function Gn(){var t=this.__wrapped__,e=function(t){return r&&r.__dir__<0?t:t.reverse()};if(t instanceof Z){var r=t;return this.__actions__.length&&(r=new Z(this)),r=r.reverse(),r.__actions__.push({func:Hn,args:[e],thisArg:E}),new y(r,this.__chain__)}return this.thru(e)}function Wn(){return this.value()+""}function Xn(){return rr(this.__wrapped__,this.__actions__)}function Jn(t,e,r){var n=Oa(t)?se:ke;return r&&Qr(t,e,r)&&(e=E),("function"!=typeof e||r!==E)&&(e=zr(e,r,3)),n(t,e)}function Zn(t,e,r){var n=Oa(t)?ae:xe;return e=zr(e,r,3),n(t,e)}function Qn(t,e){return ia(t,De(e))}function $n(t,e,r,n){var i=t?Ko(t):0;return en(i)||(t=ss(t),i=t.length),r="number"!=typeof r||n&&Qr(e,r,n)?0:0>r?So(i+r,0):r||0,"string"==typeof t||!Oa(t)&&Ki(t)?i>=r&&t.indexOf(e,r)>-1:!!i&&Kr(t,e,r)>-1}function ti(t,e,r){var n=Oa(t)?fe:Le;return e=zr(e,r,3),n(t,e)}function ei(t,e){return ti(t,Ts(e))}function ri(t,e,r){var n=Oa(t)?ae:xe;return e=zr(e,r,3),n(t,function(t,r,n){return!e(t,r,n)})}function ni(t,e,r){if(r?Qr(t,e,r):null==e){t=cn(t);var n=t.length;return n>0?t[Ye(0,n-1)]:E}var i=-1,s=Gi(t),n=s.length,o=n-1;for(e=Io(0>e?0:+e||0,n);++i<e;){var a=Ye(i,o),f=s[a];s[a]=s[i],s[i]=f}return s.length=e,s}function ii(t){return ni(t,Po)}function si(t){var e=t?Ko(t):0;return en(e)?e:za(t).length}function oi(t,e,r){var n=Oa(t)?de:Xe;return r&&Qr(t,e,r)&&(e=E),("function"!=typeof e||r!==E)&&(e=zr(e,r,3)),n(t,e)}function ai(t,e,r){if(null==t)return[];r&&Qr(t,e,r)&&(e=E);var n=-1;e=zr(e,r,3);var i=Le(t,function(t,r,i){return{criteria:e(t,r,i),index:++n,value:t}});return Je(i,c)}function fi(t,e,r,n){return null==t?[]:(n&&Qr(e,r,n)&&(r=E),Oa(e)||(e=null==e?[]:[e]),Oa(r)||(r=null==r?[]:[r]),Ze(t,e,r))}function ui(t,e){return Zn(t,De(e))}function ci(t,e){if("function"!=typeof e){if("function"!=typeof t)throw new Xs(H);var r=t;t=e,e=r}return t=_o(t=+t)?t:0,function(){return--t<1?e.apply(this,arguments):void 0}}function hi(t,e,r){return r&&Qr(t,e,r)&&(e=E),e=t&&null==e?t.length:So(+e||0,0),jr(t,C,E,E,E,E,e)}function di(t,e){var r;if("function"!=typeof e){if("function"!=typeof t)throw new Xs(H);var n=t;t=e,e=n}return function(){return--t>0&&(r=e.apply(this,arguments)),1>=t&&(e=E),r}}function pi(t,e,r){function n(){p&&oo(p),u&&oo(u),b=0,u=p=l=E}function i(e,r){r&&oo(r),u=p=l=E,e&&(b=ba(),c=t.apply(d,f),p||u||(f=d=E))}function s(){var t=e-(ba()-h);0>=t||t>e?i(l,u):p=ho(s,t)}function o(){i(m,p)}function a(){if(f=arguments,h=ba(),d=this,l=m&&(p||!y),g===!1)var r=y&&!p;else{u||y||(b=h);var n=g-(h-b),i=0>=n||n>g;i?(u&&(u=oo(u)),b=h,c=t.apply(d,f)):u||(u=ho(o,n))}return i&&p?p=oo(p):p||e===g||(p=ho(s,e)),r&&(i=!0,c=t.apply(d,f)),!i||p||u||(f=d=E),c}var f,u,c,h,d,p,l,b=0,g=!1,m=!0;if("function"!=typeof t)throw new Xs(H);if(e=0>e?0:+e||0,r===!0){var y=!0;m=!1}else Ci(r)&&(y=!!r.leading,g="maxWait"in r&&So(+r.maxWait||0,e),m="trailing"in r?!!r.trailing:m);return a.cancel=n,a}function li(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Xs(H);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=t.apply(this,n);return r.cache=s.set(i,o),o};return r.cache=new li.Cache,r}function bi(t){if("function"!=typeof t)throw new Xs(H);return function(){return!t.apply(this,arguments)}}function gi(t){return di(2,t)}function mi(t,e){if("function"!=typeof t)throw new Xs(H);return e=So(e===E?t.length-1:+e||0,0),function(){for(var r=arguments,n=-1,i=So(r.length-e,0),s=zs(i);++n<i;)s[n]=r[e+n];switch(e){case 0:return t.call(this,s);case 1:return t.call(this,r[0],s);case 2:return t.call(this,r[0],r[1],s)}var o=zs(e+1);for(n=-1;++n<e;)o[n]=r[n];return o[e]=s,t.apply(this,o)}}function yi(t){if("function"!=typeof t)throw new Xs(H);return function(e){return t.apply(this,e)}}function vi(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new Xs(H);return r===!1?n=!1:Ci(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),pi(t,e,{leading:n,maxWait:+e,trailing:i})}function _i(t,e){return e=null==e?xs:e,jr(e,R,E,[t],[])}function wi(t,e,r,n){return e&&"boolean"!=typeof e&&Qr(t,e,r)?e=!1:"function"==typeof e&&(n=r,r=e,e=!1),"function"==typeof r?we(t,e,sr(r,n,1)):we(t,e)}function Si(t,e,r){return"function"==typeof e?we(t,!0,sr(e,r,1)):we(t,!0)}function Ii(t,e){return t>e}function ki(t,e){return t>=e}function Ei(t){return m(t)&&Jr(t)&&to.call(t,"callee")&&!uo.call(t,"callee")}function Ai(t){return t===!0||t===!1||m(t)&&ro.call(t)==G}function xi(t){return m(t)&&ro.call(t)==W}function Pi(t){return!!t&&1===t.nodeType&&m(t)&&!zi(t)}function Oi(t){return null==t?!0:Jr(t)&&(Oa(t)||Ki(t)||Ei(t)||m(t)&&Ti(t.splice))?!t.length:!za(t).length}function Bi(t,e,r,n){r="function"==typeof r?sr(r,n,3):E;var i=r?r(t,e):E;return i===E?Ne(t,e,r):!!i}function Mi(t){return m(t)&&"string"==typeof t.message&&ro.call(t)==X}function Ri(t){return"number"==typeof t&&_o(t)}function Ti(t){return Ci(t)&&ro.call(t)==J}function Ci(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Ni(t,e,r,n){return r="function"==typeof r?sr(r,n,3):E,Ue(t,Hr(e),r)}function ji(t){return Di(t)&&t!=+t}function Ui(t){return null==t?!1:Ti(t)?io.test($s.call(t)):m(t)&&Ct.test(t)}function Li(t){return null===t}function Di(t){return"number"==typeof t||m(t)&&ro.call(t)==Q}function zi(t){var e;if(!m(t)||ro.call(t)!=$||Ei(t)||!to.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var r;return Be(t,function(t,e){r=e}),r===E||to.call(t,r)}function Fi(t){return Ci(t)&&ro.call(t)==tt}function Ki(t){return"string"==typeof t||m(t)&&ro.call(t)==rt}function Hi(t){return m(t)&&en(t.length)&&!!Kt[ro.call(t)]}function qi(t){return t===E}function Vi(t,e){return e>t}function Yi(t,e){return e>=t}function Gi(t){var e=t?Ko(t):0;return en(e)?e?te(t):[]:ss(t)}function Wi(t){return ve(t,ts(t))}function Xi(t,e,r){var n=No(t);return r&&Qr(t,e,r)&&(e=E),e?me(n,e):n}function Ji(t){return Te(t,ts(t))}function Zi(t,e,r){var n=null==t?E:Ce(t,dn(e),e+"");return n===E?r:n}function Qi(t,e){if(null==t)return!1;var r=to.call(t,e);if(!r&&!$r(e)){if(e=dn(e),t=1==e.length?t:Ce(t,We(e,0,-1)),null==t)return!1;e=An(e),r=to.call(t,e)}return r||en(t.length)&&Zr(e,t.length)&&(Oa(t)||Ei(t))}function $i(t,e,r){r&&Qr(t,e,r)&&(e=E);for(var n=-1,i=za(t),s=i.length,o={};++n<s;){var a=i[n],f=t[a];e?to.call(o,f)?o[f].push(a):o[f]=[a]:o[f]=a}return o}function ts(t){if(null==t)return[];Ci(t)||(t=Ys(t));var e=t.length;e=e&&en(e)&&(Oa(t)||Ei(t))&&e||0;for(var r=t.constructor,n=-1,i="function"==typeof r&&r.prototype===t,s=zs(e),o=e>0;++n<e;)s[n]=n+"";for(var a in t)o&&Zr(a,e)||"constructor"==a&&(i||!to.call(t,a))||s.push(a);return s}function es(t){t=hn(t);for(var e=-1,r=za(t),n=r.length,i=zs(n);++e<n;){var s=r[e];i[e]=[s,t[s]]}return i}function rs(t,e,r){var n=null==t?E:t[e];return n===E&&(null==t||$r(e,t)||(e=dn(e),t=1==e.length?t:Ce(t,We(e,0,-1)),n=null==t?E:t[An(e)]),n=n===E?r:n),Ti(n)?n.call(t):n}function ns(t,e,r){if(null==t)return t;var n=e+"";e=null!=t[n]||$r(e,t)?[n]:dn(e);for(var i=-1,s=e.length,o=s-1,a=t;null!=a&&++i<s;){var f=e[i];Ci(a)&&(i==o?a[f]=r:null==a[f]&&(a[f]=Zr(e[i+1])?[]:{})),a=a[f]}return t}function is(t,e,r,n){var i=Oa(t)||Hi(t);if(e=zr(e,n,4),null==r)if(i||Ci(t)){var s=t.constructor;r=i?Oa(t)?new s:[]:No(Ti(s)?s.prototype:E)}else r={};return(i?ee:Me)(t,function(t,n,i){return e(r,t,n,i)}),r}function ss(t){return tr(t,za(t))}function os(t){return tr(t,ts(t))}function as(t,e,r){return e=+e||0,r===E?(r=e,e=0):r=+r||0,t>=Io(e,r)&&t<So(e,r)}function fs(t,e,r){r&&Qr(t,e,r)&&(e=r=E);var n=null==t,i=null==e;if(null==r&&(i&&"boolean"==typeof t?(r=t,t=1):"boolean"==typeof e&&(r=e,i=!0)),n&&i&&(e=1,i=!1),t=+t||0,i?(e=t,t=0):e=+e||0,r||t%1||e%1){var s=Ao();return Io(t+s*(e-t+ao("1e-"+((s+"").length-1))),e)}return Ye(t,e)}function us(t){return t=a(t),t&&t.charAt(0).toUpperCase()+t.slice(1)}function cs(t){return t=a(t),t&&t.replace(jt,d).replace(Ot,"")}function hs(t,e,r){t=a(t),e+="";var n=t.length;return r=r===E?n:Io(0>r?0:+r||0,n),r-=e.length,r>=0&&t.indexOf(e,r)==r}function ds(t){return t=a(t),t&&_t.test(t)?t.replace(yt,p):t}function ps(t){return t=a(t),t&&Pt.test(t)?t.replace(xt,l):t||"(?:)"}function ls(t,e,r){t=a(t),e=+e;var n=t.length;if(n>=e||!_o(e))return t;var i=(e-n)/2,s=yo(i),o=go(i);return r=Rr("",o,r),r.slice(0,s)+t+r}function bs(t,e,r){return(r?Qr(t,e,r):null==e)?e=0:e&&(e=+e),t=vs(t),Eo(t,e||(Tt.test(t)?16:10))}function gs(t,e){var r="";if(t=a(t),e=+e,1>e||!t||!_o(e))return r;do e%2&&(r+=t),e=yo(e/2),t+=t;while(e);return r}function ms(t,e,r){return t=a(t),r=null==r?0:Io(0>r?0:+r||0,t.length),t.lastIndexOf(e,r)==r}function ys(t,r,n){var i=e.templateSettings;n&&Qr(t,r,n)&&(r=n=E),t=a(t),r=ge(me({},n||r),i,be);var s,o,f=ge(me({},r.imports),i.imports,be),u=za(f),c=tr(f,u),h=0,d=r.interpolate||Ut,p="__p += '",l=Gs((r.escape||Ut).source+"|"+d.source+"|"+(d===It?Mt:Ut).source+"|"+(r.evaluate||Ut).source+"|$","g"),g="//# sourceURL="+("sourceURL"in r?r.sourceURL:"lodash.templateSources["+ ++Ft+"]")+"\n";t.replace(l,function(e,r,n,i,a,f){return n||(n=i),p+=t.slice(h,f).replace(Lt,b),r&&(s=!0,p+="' +\n__e("+r+") +\n'"),a&&(o=!0,p+="';\n"+a+";\n__p += '"),n&&(p+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),h=f+e.length,e}),p+="';\n";var m=r.variable;m||(p="with (obj) {\n"+p+"\n}\n"),p=(o?p.replace(lt,""):p).replace(bt,"$1").replace(gt,"$1;"),p="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var y=Za(function(){return Hs(u,g+"return "+p).apply(E,c)});if(y.source=p,Mi(y))throw y;return y}function vs(t,e,r){var n=t;return(t=a(t))?(r?Qr(n,e,r):null==e)?t.slice(w(t),S(t)+1):(e+="",t.slice(f(t,e),u(t,e)+1)):t}function _s(t,e,r){var n=t;return t=a(t),t?(r?Qr(n,e,r):null==e)?t.slice(w(t)):t.slice(f(t,e+"")):t}function ws(t,e,r){var n=t;return t=a(t),t?(r?Qr(n,e,r):null==e)?t.slice(0,S(t)+1):t.slice(0,u(t,e+"")+1):t}function Ss(t,e,r){r&&Qr(t,e,r)&&(e=E);var n=j,i=U;if(null!=e)if(Ci(e)){var s="separator"in e?e.separator:s;n="length"in e?+e.length||0:n,i="omission"in e?a(e.omission):i}else n=+e||0;if(t=a(t),n>=t.length)return t;var o=n-i.length;if(1>o)return i;var f=t.slice(0,o);if(null==s)return f+i;if(Fi(s)){if(t.slice(o).search(s)){var u,c,h=t.slice(0,o);for(s.global||(s=Gs(s.source,(Rt.exec(s)||"")+"g")),s.lastIndex=0;u=s.exec(h);)c=u.index;f=f.slice(0,null==c?o:c)}}else if(t.indexOf(s,o)!=o){var d=f.lastIndexOf(s);d>-1&&(f=f.slice(0,d))}return f+i}function Is(t){return t=a(t),t&&vt.test(t)?t.replace(mt,I):t}function ks(t,e,r){return r&&Qr(t,e,r)&&(e=E),t=a(t),t.match(e||Dt)||[]}function Es(t,e,r){return r&&Qr(t,e,r)&&(e=E),m(t)?Ps(t):_e(t,e)}function As(t){return function(){return t}}function xs(t){return t}function Ps(t){return De(we(t,!0))}function Os(t,e){return ze(t,we(e,!0))}function Bs(t,e,r){if(null==r){var n=Ci(e),i=n?za(e):E,s=i&&i.length?Te(e,i):E;(s?s.length:n)||(s=!1,r=e,e=t,t=this)}s||(s=Te(e,za(e)));var o=!0,a=-1,f=Ti(t),u=s.length;r===!1?o=!1:Ci(r)&&"chain"in r&&(o=r.chain);for(;++a<u;){var c=s[a],h=e[c];t[c]=h,f&&(t.prototype[c]=function(e){return function(){var r=this.__chain__;if(o||r){var n=t(this.__wrapped__),i=n.__actions__=te(this.__actions__);return i.push({func:e,args:arguments,thisArg:t}),n.__chain__=r,n}return e.apply(t,ue([this.value()],arguments))}}(h))}return t}function Ms(){return re._=no,this}function Rs(){}function Ts(t){return $r(t)?He(t):qe(t)}function Cs(t){return function(e){return Ce(t,dn(e),e+"")}}function Ns(t,e,r){r&&Qr(t,e,r)&&(e=r=E),t=+t||0,r=null==r?1:+r||0,null==e?(e=t,t=0):e=+e||0;for(var n=-1,i=So(go((e-t)/(r||1)),0),s=zs(i);++n<i;)s[n]=t,
t+=r;return s}function js(t,e,r){if(t=yo(t),1>t||!_o(t))return[];var n=-1,i=zs(Io(t,Oo));for(e=sr(e,r,1);++n<t;)Oo>n?i[n]=e(n):e(n);return i}function Us(t){var e=++eo;return a(t)+e}function Ls(t,e){return(+t||0)+(+e||0)}function Ds(t,e,r){return r&&Qr(t,e,r)&&(e=E),e=zr(e,r,3),1==e.length?pe(Oa(t)?t:cn(t),e):Qe(t,e)}t=t?ne.defaults(re.Object(),t,ne.pick(re,zt)):re;var zs=t.Array,Fs=t.Date,Ks=t.Error,Hs=t.Function,qs=t.Math,Vs=t.Number,Ys=t.Object,Gs=t.RegExp,Ws=t.String,Xs=t.TypeError,Js=zs.prototype,Zs=Ys.prototype,Qs=Ws.prototype,$s=Hs.prototype.toString,to=Zs.hasOwnProperty,eo=0,ro=Zs.toString,no=re._,io=Gs("^"+$s.call(to).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),so=t.ArrayBuffer,oo=t.clearTimeout,ao=t.parseFloat,fo=qs.pow,uo=Zs.propertyIsEnumerable,co=qr(t,"Set"),ho=t.setTimeout,po=Js.splice,lo=t.Uint8Array,bo=qr(t,"WeakMap"),go=qs.ceil,mo=qr(Ys,"create"),yo=qs.floor,vo=qr(zs,"isArray"),_o=t.isFinite,wo=qr(Ys,"keys"),So=qs.max,Io=qs.min,ko=qr(Fs,"now"),Eo=t.parseInt,Ao=qs.random,xo=Vs.NEGATIVE_INFINITY,Po=Vs.POSITIVE_INFINITY,Oo=4294967295,Bo=Oo-1,Mo=Oo>>>1,Ro=9007199254740991,To=bo&&new bo,Co={};e.support={};e.templateSettings={escape:wt,evaluate:St,interpolate:It,variable:"",imports:{_:e}};var No=function(){function t(){}return function(e){if(Ci(e)){t.prototype=e;var r=new t;t.prototype=E}return r||{}}}(),jo=hr(Me),Uo=hr(Re,!0),Lo=dr(),Do=dr(!0),zo=To?function(t,e){return To.set(t,e),t}:xs,Fo=To?function(t){return To.get(t)}:Rs,Ko=He("length"),Ho=function(){var t=0,e=0;return function(r,n){var i=ba(),s=D-(i-e);if(e=i,s>0){if(++t>=L)return r}else t=0;return zo(r,n)}}(),qo=mi(function(t,e){return m(t)&&Jr(t)?Ie(t,Oe(e,!1,!0)):[]}),Vo=wr(),Yo=wr(!0),Go=mi(function(t){for(var e=t.length,r=e,n=zs(h),i=Kr(),o=i==s,a=[];r--;){var f=t[r]=Jr(f=t[r])?f:[];n[r]=o&&f.length>=120?lr(r&&f):null}var u=t[0],c=-1,h=u?u.length:0,d=n[0];t:for(;++c<h;)if(f=u[c],(d?Zt(d,f):i(a,f,0))<0){for(var r=e;--r;){var p=n[r];if((p?Zt(p,f):i(t[r],f,0))<0)continue t}d&&d.push(f),a.push(f)}return a}),Wo=mi(function(t,e){e=Oe(e);var r=ye(t,e);return Ve(t,e.sort(n)),r}),Xo=Nr(),Jo=Nr(!0),Zo=mi(function(t){return $e(Oe(t,!1,!0))}),Qo=mi(function(t,e){return Jr(t)?Ie(t,e):[]}),$o=mi(Un),ta=mi(function(t){var e=t.length,r=e>2?t[e-2]:E,n=e>1?t[e-1]:E;return e>2&&"function"==typeof r?e-=2:(r=e>1&&"function"==typeof n?(--e,n):E,n=E),t.length=e,Ln(t,r,n)}),ea=mi(function(t){return t=Oe(t),this.thru(function(e){return $t(Oa(e)?e:[hn(e)],t)})}),ra=mi(function(t,e){return ye(t,Oe(e))}),na=ur(function(t,e,r){to.call(t,r)?++t[r]:t[r]=1}),ia=_r(jo),sa=_r(Uo,!0),oa=kr(ee,jo),aa=kr(ie,Uo),fa=ur(function(t,e,r){to.call(t,r)?t[r].push(e):t[r]=[e]}),ua=ur(function(t,e,r){t[r]=e}),ca=mi(function(t,e,r){var n=-1,i="function"==typeof e,s=$r(e),o=Jr(t)?zs(t.length):[];return jo(t,function(t){var a=i?e:s&&null!=t?t[e]:E;o[++n]=a?a.apply(t,r):Xr(t,e,r)}),o}),ha=ur(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]}),da=Br(ce,jo),pa=Br(he,Uo),la=mi(function(t,e){if(null==t)return[];var r=e[2];return r&&Qr(e[0],e[1],r)&&(e.length=1),Ze(t,Oe(e),[])}),ba=ko||function(){return(new Fs).getTime()},ga=mi(function(t,e,r){var n=x;if(r.length){var i=v(r,ga.placeholder);n|=R}return jr(t,n,e,r,i)}),ma=mi(function(t,e){e=e.length?Oe(e):Ji(t);for(var r=-1,n=e.length;++r<n;){var i=e[r];t[i]=jr(t[i],x,t)}return t}),ya=mi(function(t,e,r){var n=x|P;if(r.length){var i=v(r,ya.placeholder);n|=R}return jr(e,n,t,r,i)}),va=mr(B),_a=mr(M),wa=mi(function(t,e){return Se(t,1,e)}),Sa=mi(function(t,e,r){return Se(t,e,r)}),Ia=Ir(),ka=Ir(!0),Ea=mi(function(t,e){if(e=Oe(e),"function"!=typeof t||!se(e,o))throw new Xs(H);var r=e.length;return mi(function(n){for(var i=Io(n.length,r);i--;)n[i]=e[i](n[i]);return t.apply(this,n)})}),Aa=Or(R),xa=Or(T),Pa=mi(function(t,e){return jr(t,N,E,E,E,Oe(e))}),Oa=vo||function(t){return m(t)&&en(t.length)&&ro.call(t)==Y},Ba=cr(Fe),Ma=cr(function(t,e,r){return r?ge(t,e,r):me(t,e)}),Ra=yr(Ma,le),Ta=yr(Ba,sn),Ca=Sr(Me),Na=Sr(Re),ja=Er(Lo),Ua=Er(Do),La=Ar(Me),Da=Ar(Re),za=wo?function(t){var e=null==t?E:t.constructor;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&Jr(t)?un(t):Ci(t)?wo(t):[]}:un,Fa=xr(!0),Ka=xr(),Ha=mi(function(t,e){if(null==t)return{};if("function"!=typeof e[0]){var e=fe(Oe(e),Ws);return on(t,Ie(ts(t),e))}var r=sr(e[0],e[1],3);return an(t,function(t,e,n){return!r(t,e,n)})}),qa=mi(function(t,e){return null==t?{}:"function"==typeof e[0]?an(t,sr(e[0],e[1],3)):on(t,Oe(e))}),Va=br(function(t,e,r){return e=e.toLowerCase(),t+(r?e.charAt(0).toUpperCase()+e.slice(1):e)}),Ya=br(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),Ga=Pr(),Wa=Pr(!0),Xa=br(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}),Ja=br(function(t,e,r){return t+(r?" ":"")+(e.charAt(0).toUpperCase()+e.slice(1))}),Za=mi(function(t,e){try{return t.apply(E,e)}catch(r){return Mi(r)?r:new Ks(r)}}),Qa=mi(function(t,e){return function(r){return Xr(r,t,e)}}),$a=mi(function(t,e){return function(r){return Xr(t,r,e)}}),tf=Cr("ceil"),ef=Cr("floor"),rf=vr(Ii,xo),nf=vr(Vi,Po),sf=Cr("round");return e.prototype=r.prototype,y.prototype=No(r.prototype),y.prototype.constructor=y,Z.prototype=No(r.prototype),Z.prototype.constructor=Z,Vt.prototype["delete"]=Yt,Vt.prototype.get=Gt,Vt.prototype.has=Wt,Vt.prototype.set=Xt,Jt.prototype.push=Qt,li.Cache=Vt,e.after=ci,e.ary=hi,e.assign=Ma,e.at=ra,e.before=di,e.bind=ga,e.bindAll=ma,e.bindKey=ya,e.callback=Es,e.chain=Fn,e.chunk=ln,e.compact=bn,e.constant=As,e.countBy=na,e.create=Xi,e.curry=va,e.curryRight=_a,e.debounce=pi,e.defaults=Ra,e.defaultsDeep=Ta,e.defer=wa,e.delay=Sa,e.difference=qo,e.drop=gn,e.dropRight=mn,e.dropRightWhile=yn,e.dropWhile=vn,e.fill=_n,e.filter=Zn,e.flatten=Sn,e.flattenDeep=In,e.flow=Ia,e.flowRight=ka,e.forEach=oa,e.forEachRight=aa,e.forIn=ja,e.forInRight=Ua,e.forOwn=La,e.forOwnRight=Da,e.functions=Ji,e.groupBy=fa,e.indexBy=ua,e.initial=En,e.intersection=Go,e.invert=$i,e.invoke=ca,e.keys=za,e.keysIn=ts,e.map=ti,e.mapKeys=Fa,e.mapValues=Ka,e.matches=Ps,e.matchesProperty=Os,e.memoize=li,e.merge=Ba,e.method=Qa,e.methodOf=$a,e.mixin=Bs,e.modArgs=Ea,e.negate=bi,e.omit=Ha,e.once=gi,e.pairs=es,e.partial=Aa,e.partialRight=xa,e.partition=ha,e.pick=qa,e.pluck=ei,e.property=Ts,e.propertyOf=Cs,e.pull=Pn,e.pullAt=Wo,e.range=Ns,e.rearg=Pa,e.reject=ri,e.remove=On,e.rest=Bn,e.restParam=mi,e.set=ns,e.shuffle=ii,e.slice=Mn,e.sortBy=ai,e.sortByAll=la,e.sortByOrder=fi,e.spread=yi,e.take=Rn,e.takeRight=Tn,e.takeRightWhile=Cn,e.takeWhile=Nn,e.tap=Kn,e.throttle=vi,e.thru=Hn,e.times=js,e.toArray=Gi,e.toPlainObject=Wi,e.transform=is,e.union=Zo,e.uniq=jn,e.unzip=Un,e.unzipWith=Ln,e.values=ss,e.valuesIn=os,e.where=ui,e.without=Qo,e.wrap=_i,e.xor=Dn,e.zip=$o,e.zipObject=zn,e.zipWith=ta,e.backflow=ka,e.collect=ti,e.compose=ka,e.each=oa,e.eachRight=aa,e.extend=Ma,e.iteratee=Es,e.methods=Ji,e.object=zn,e.select=Zn,e.tail=Bn,e.unique=jn,Bs(e,e),e.add=Ls,e.attempt=Za,e.camelCase=Va,e.capitalize=us,e.ceil=tf,e.clone=wi,e.cloneDeep=Si,e.deburr=cs,e.endsWith=hs,e.escape=ds,e.escapeRegExp=ps,e.every=Jn,e.find=ia,e.findIndex=Vo,e.findKey=Ca,e.findLast=sa,e.findLastIndex=Yo,e.findLastKey=Na,e.findWhere=Qn,e.first=wn,e.floor=ef,e.get=Zi,e.gt=Ii,e.gte=ki,e.has=Qi,e.identity=xs,e.includes=$n,e.indexOf=kn,e.inRange=as,e.isArguments=Ei,e.isArray=Oa,e.isBoolean=Ai,e.isDate=xi,e.isElement=Pi,e.isEmpty=Oi,e.isEqual=Bi,e.isError=Mi,e.isFinite=Ri,e.isFunction=Ti,e.isMatch=Ni,e.isNaN=ji,e.isNative=Ui,e.isNull=Li,e.isNumber=Di,e.isObject=Ci,e.isPlainObject=zi,e.isRegExp=Fi,e.isString=Ki,e.isTypedArray=Hi,e.isUndefined=qi,e.kebabCase=Ya,e.last=An,e.lastIndexOf=xn,e.lt=Vi,e.lte=Yi,e.max=rf,e.min=nf,e.noConflict=Ms,e.noop=Rs,e.now=ba,e.pad=ls,e.padLeft=Ga,e.padRight=Wa,e.parseInt=bs,e.random=fs,e.reduce=da,e.reduceRight=pa,e.repeat=gs,e.result=rs,e.round=sf,e.runInContext=k,e.size=si,e.snakeCase=Xa,e.some=oi,e.sortedIndex=Xo,e.sortedLastIndex=Jo,e.startCase=Ja,e.startsWith=ms,e.sum=Ds,e.template=ys,e.trim=vs,e.trimLeft=_s,e.trimRight=ws,e.trunc=Ss,e.unescape=Is,e.uniqueId=Us,e.words=ks,e.all=Jn,e.any=oi,e.contains=$n,e.eq=Bi,e.detect=ia,e.foldl=da,e.foldr=pa,e.head=wn,e.include=$n,e.inject=da,Bs(e,function(){var t={};return Me(e,function(r,n){e.prototype[n]||(t[n]=r)}),t}(),!1),e.sample=ni,e.prototype.sample=function(t){return this.__chain__||null!=t?this.thru(function(e){return ni(e,t)}):ni(this.value())},e.VERSION=A,ee(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){e[t].placeholder=e}),ee(["drop","take"],function(t,e){Z.prototype[t]=function(r){var n=this.__filtered__;if(n&&!e)return new Z(this);r=null==r?1:So(yo(r)||0,0);var i=this.clone();return n?i.__takeCount__=Io(i.__takeCount__,r):i.__views__.push({size:r,type:t+(i.__dir__<0?"Right":"")}),i},Z.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),ee(["filter","map","takeWhile"],function(t,e){var r=e+1,n=r!=K;Z.prototype[t]=function(t,e){var i=this.clone();return i.__iteratees__.push({iteratee:zr(t,e,1),type:r}),i.__filtered__=i.__filtered__||n,i}}),ee(["first","last"],function(t,e){var r="take"+(e?"Right":"");Z.prototype[t]=function(){return this[r](1).value()[0]}}),ee(["initial","rest"],function(t,e){var r="drop"+(e?"":"Right");Z.prototype[t]=function(){return this.__filtered__?new Z(this):this[r](1)}}),ee(["pluck","where"],function(t,e){var r=e?"filter":"map",n=e?De:Ts;Z.prototype[t]=function(t){return this[r](n(t))}}),Z.prototype.compact=function(){return this.filter(xs)},Z.prototype.reject=function(t,e){return t=zr(t,e,1),this.filter(function(e){return!t(e)})},Z.prototype.slice=function(t,e){t=null==t?0:+t||0;var r=this;return r.__filtered__&&(t>0||0>e)?new Z(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==E&&(e=+e||0,r=0>e?r.dropRight(-e):r.take(e-t)),r)},Z.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},Z.prototype.toArray=function(){return this.take(Po)},Me(Z.prototype,function(t,r){var n=/^(?:filter|map|reject)|While$/.test(r),i=/^(?:first|last)$/.test(r),s=e[i?"take"+("last"==r?"Right":""):r];s&&(e.prototype[r]=function(){var e=i?[1]:arguments,r=this.__chain__,o=this.__wrapped__,a=!!this.__actions__.length,f=o instanceof Z,u=e[0],c=f||Oa(o);c&&n&&"function"==typeof u&&1!=u.length&&(f=c=!1);var h=function(t){return i&&r?s(t,1)[0]:s.apply(E,ue([t],e))},d={func:Hn,args:[h],thisArg:E},p=f&&!a;if(i&&!r)return p?(o=o.clone(),o.__actions__.push(d),t.call(o)):s.call(E,this.value())[0];if(!i&&c){o=p?o:new Z(this);var l=t.apply(o,e);return l.__actions__.push(d),new y(l,r)}return this.thru(h)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var r=(/^(?:replace|split)$/.test(t)?Qs:Js)[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?r.apply(this.value(),t):this[n](function(e){return r.apply(e,t)})}}),Me(Z.prototype,function(t,r){var n=e[r];if(n){var i=n.name,s=Co[i]||(Co[i]=[]);s.push({name:r,func:n})}}),Co[Mr(E,P).name]=[{name:"wrapper",func:E}],Z.prototype.clone=et,Z.prototype.reverse=nt,Z.prototype.value=qt,e.prototype.chain=qn,e.prototype.commit=Vn,e.prototype.concat=ea,e.prototype.plant=Yn,e.prototype.reverse=Gn,e.prototype.toString=Wn,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Xn,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var E,A="3.10.1",x=1,P=2,O=4,B=8,M=16,R=32,T=64,C=128,N=256,j=30,U="...",L=150,D=16,z=200,F=1,K=2,H="Expected a function",q="__lodash_placeholder__",V="[object Arguments]",Y="[object Array]",G="[object Boolean]",W="[object Date]",X="[object Error]",J="[object Function]",Z="[object Map]",Q="[object Number]",$="[object Object]",tt="[object RegExp]",et="[object Set]",rt="[object String]",nt="[object WeakMap]",it="[object ArrayBuffer]",st="[object Float32Array]",ot="[object Float64Array]",at="[object Int8Array]",ft="[object Int16Array]",ut="[object Int32Array]",ct="[object Uint8Array]",ht="[object Uint8ClampedArray]",dt="[object Uint16Array]",pt="[object Uint32Array]",lt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,gt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39|#96);/g,yt=/[&<>"'`]/g,vt=RegExp(mt.source),_t=RegExp(yt.source),wt=/<%-([\s\S]+?)%>/g,St=/<%([\s\S]+?)%>/g,It=/<%=([\s\S]+?)%>/g,kt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,Et=/^\w*$/,At=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,xt=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,Pt=RegExp(xt.source),Ot=/[\u0300-\u036f\ufe20-\ufe23]/g,Bt=/\\(\\)?/g,Mt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Rt=/\w*$/,Tt=/^0[xX]/,Ct=/^\[object .+?Constructor\]$/,Nt=/^\d+$/,jt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Ut=/($^)/,Lt=/['\n\r\u2028\u2029\\]/g,Dt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),zt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Ft=-1,Kt={};Kt[st]=Kt[ot]=Kt[at]=Kt[ft]=Kt[ut]=Kt[ct]=Kt[ht]=Kt[dt]=Kt[pt]=!0,Kt[V]=Kt[Y]=Kt[it]=Kt[G]=Kt[W]=Kt[X]=Kt[J]=Kt[Z]=Kt[Q]=Kt[$]=Kt[tt]=Kt[et]=Kt[rt]=Kt[nt]=!1;var Ht={};Ht[V]=Ht[Y]=Ht[it]=Ht[G]=Ht[W]=Ht[st]=Ht[ot]=Ht[at]=Ht[ft]=Ht[ut]=Ht[Q]=Ht[$]=Ht[tt]=Ht[rt]=Ht[ct]=Ht[ht]=Ht[dt]=Ht[pt]=!0,Ht[X]=Ht[J]=Ht[Z]=Ht[et]=Ht[nt]=!1;var qt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},Vt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},Yt={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},Gt={"function":!0,object:!0},Wt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Xt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Jt=Gt[typeof r]&&r&&!r.nodeType&&r,Zt=Gt[typeof e]&&e&&!e.nodeType&&e,Qt=Jt&&Zt&&"object"==typeof t&&t&&t.Object&&t,$t=Gt[typeof self]&&self&&self.Object&&self,te=Gt[typeof window]&&window&&window.Object&&window,ee=Zt&&Zt.exports===Jt&&Jt,re=Qt||te!==(this&&this.window)&&te||$t||this,ne=k();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(re._=ne,define(function(){return ne})):Jt&&Zt?ee?(Zt.exports=ne)._=ne:Jt._=ne:re._=ne}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],298:[function(t,e,r){(function(r){var n=t("./word-array"),i=function(){function t(){}return{extend:function(e){t.prototype=this;var r=new t;return e&&r.mixIn(e),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=i.extend({reset:function(){this._data=new n,this._nDataBytes=0},_append:function(t){r.isBuffer(t)&&(t=n.fromBuffer(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,r=e.words,i=e.sigBytes,s=this.blockSize,o=4*s,a=i/o;a=t?Math.ceil(a):Math.max((0|a)-this._minBufferSize,0);var f=a*s,u=Math.min(4*f,i);if(f){for(var c=0;f>c;c+=s)this._doProcessBlock(r,c);var h=r.splice(0,f);e.sigBytes-=u}return new n(h,u)},clone:function(){var t=i.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),o=s.extend({cfg:i.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){s.reset.call(this),this._doReset()},update:function(t){return"string"==typeof t&&(t=n.fromBuffer(new r(t,"utf8"))),r.isBuffer(t)&&(t=n.fromBuffer(t)),this._append(t),this._process(),this},finalize:function(t){"string"==typeof t&&(t=n.fromBuffer(new r(t,"utf8"))),r.isBuffer(t)&&(t=n.fromBuffer(t)),t&&this._append(t);var e=this._doFinalize();return e.toBuffer()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}}});e.exports.Hasher=o}).call(this,t("buffer").Buffer)},{"./word-array":302,buffer:48}],299:[function(t,e,r){(function(r){function n(t){if(!(this instanceof n))return new n(t);var e=this._hasher=new i.init;"string"==typeof t&&(t=s.fromBuffer(new r(t,"utf8"))),r.isBuffer(t)&&(t=s.fromBuffer(t));var o=e.blockSize,a=4*o;t.sigBytes>a&&(t=e.finalize(t)),t.clamp();for(var f=this._oKey=t.clone(),u=this._iKey=t.clone(),c=f.words,h=u.words,d=0;o>d;d++)c[d]^=1549556828,h[d]^=909522486;f.sigBytes=u.sigBytes=a,this.reset()}var i=t("./sha512").sha512,s=t("./word-array");n.prototype.reset=function(){var t=this._hasher;t.reset(),t.update(this._iKey)},n.prototype.update=function(t){return"string"==typeof t&&(t=s.fromBuffer(new r(t,"utf8"))),r.isBuffer(t)&&(t=s.fromBuffer(t)),this._hasher.update(t),this},n.prototype.finalize=function(t){"string"==typeof t&&(t=s.fromBuffer(new r(t,"utf8"))),r.isBuffer(t)&&(t=s.fromBuffer(t));var e=this._hasher,n=e.finalize(t);e.reset();var i=e.finalize(this._oKey.clone().concat(n));return i},e.exports=n}).call(this,t("buffer").Buffer)},{"./sha512":301,"./word-array":302,buffer:48}],300:[function(t,e,r){e.exports=t("./sha512"),e.exports.hmac=t("./hmac")},{"./hmac":299,"./sha512":301}],301:[function(t,e,r){var n=t("./cryptojs").Hasher,i=t("./x64"),s=i.Word,o=i.WordArray,a=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],f=[];!function(){for(var t=0;80>t;t++)f[t]=s()}();var u=n.extend({_doReset:function(){this._hash=new o([s(1779033703,4089235720),s(3144134277,2227873595),s(1013904242,4271175723),s(2773480762,1595750129),s(1359893119,2917565137),s(2600822924,725511199),s(528734635,4215389547),s(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],u=r[4],c=r[5],h=r[6],d=r[7],p=n.high,l=n.low,b=i.high,g=i.low,m=s.high,y=s.low,v=o.high,_=o.low,w=u.high,S=u.low,I=c.high,k=c.low,E=h.high,A=h.low,x=d.high,P=d.low,O=p,B=l,M=b,R=g,T=m,C=y,N=v,j=_,U=w,L=S,D=I,z=k,F=E,K=A,H=x,q=P,V=0;80>V;V++){var Y=f[V];if(16>V)var G=Y.high=0|t[e+2*V],W=Y.low=0|t[e+2*V+1];else{var X=f[V-15],J=X.high,Z=X.low,Q=(J>>>1|Z<<31)^(J>>>8|Z<<24)^J>>>7,$=(Z>>>1|J<<31)^(Z>>>8|J<<24)^(Z>>>7|J<<25),tt=f[V-2],et=tt.high,rt=tt.low,nt=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,it=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),st=f[V-7],ot=st.high,at=st.low,ft=f[V-16],ut=ft.high,ct=ft.low,W=$+at,G=Q+ot+($>>>0>W>>>0?1:0),W=W+it,G=G+nt+(it>>>0>W>>>0?1:0),W=W+ct,G=G+ut+(ct>>>0>W>>>0?1:0);Y.high=G,Y.low=W}var ht=U&D^~U&F,dt=L&z^~L&K,pt=O&M^O&T^M&T,lt=B&R^B&C^R&C,bt=(O>>>28|B<<4)^(O<<30|B>>>2)^(O<<25|B>>>7),gt=(B>>>28|O<<4)^(B<<30|O>>>2)^(B<<25|O>>>7),mt=(U>>>14|L<<18)^(U>>>18|L<<14)^(U<<23|L>>>9),yt=(L>>>14|U<<18)^(L>>>18|U<<14)^(L<<23|U>>>9),vt=a[V],_t=vt.high,wt=vt.low,St=q+yt,It=H+mt+(q>>>0>St>>>0?1:0),St=St+dt,It=It+ht+(dt>>>0>St>>>0?1:0),St=St+wt,It=It+_t+(wt>>>0>St>>>0?1:0),St=St+W,It=It+G+(W>>>0>St>>>0?1:0),kt=gt+lt,Et=bt+pt+(gt>>>0>kt>>>0?1:0);H=F,q=K,F=D,K=z,D=U,z=L,L=j+St|0,U=N+It+(j>>>0>L>>>0?1:0)|0,N=T,j=C,T=M,C=R,M=O,R=B,B=St+kt|0,O=It+Et+(St>>>0>B>>>0?1:0)|0}l=n.low=l+B,n.high=p+O+(B>>>0>l>>>0?1:0),g=i.low=g+R,i.high=b+M+(R>>>0>g>>>0?1:0),y=s.low=y+C,s.high=m+T+(C>>>0>y>>>0?1:0),_=o.low=_+j,o.high=v+N+(j>>>0>_>>>0?1:0),S=u.low=S+L,u.high=w+U+(L>>>0>S>>>0?1:0),k=c.low=k+z,c.high=I+D+(z>>>0>k>>>0?1:0),A=h.low=A+K,h.high=E+F+(K>>>0>A>>>0?1:0),P=d.low=P+q,d.high=x+H+(q>>>0>P>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;e[n>>>5]|=128<<24-n%32,e[(n+128>>>10<<5)+30]=Math.floor(r/4294967296),e[(n+128>>>10<<5)+31]=r,t.sigBytes=4*e.length,this._process();var i=this._hash.toX32();return i},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});e.exports=n._createHelper(u),e.exports.sha512=u},{"./cryptojs":298,"./x64":303}],302:[function(t,e,r){(function(t,r){function n(t,e){this.words=t||[],void 0!=e?this.sigBytes=e:this.sigBytes=4*this.words.length}e.exports=n,n.prototype.concat=function(t){r.isBuffer(t)&&(t=n.fromBuffer(t));var e=this.words,i=t.words,s=this.sigBytes,o=t.sigBytes;if(this.clamp(),s%4)for(var a=0;o>a;a++){var f=i[a>>>2]>>>24-a%4*8&255;e[s+a>>>2]|=f<<24-(s+a)%4*8}else if(i.length>65535)for(var a=0;o>a;a+=4)e[s+a>>>2]=i[a>>>2];else e.push.apply(e,i);return this.sigBytes+=o,this},n.prototype.clamp=function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=Math.ceil(e/4)},n.prototype.clone=function(){var t=new n(this.words.slice(0));return t},n.prototype.toBuffer=function(){for(var t=new r(4*this.words.length),e=0;e<this.words.length;++e){var n=this.words[e];t.writeUInt32BE(n,4*e,!0)}return t},n.fromBuffer=function(e){var r=e.length,i=r%4,s=[];if(t.browser){for(var o=0;r-i>o;o+=4){var a=e.readUInt32BE(o);s.push(a)}for(var f=0,u=r-i,c=0;i>c;c+=1)f|=e.readUInt8(u+c)<<8*(3-c);return i>0&&s.push(f),new n(s,e.length)}for(var o=0;r>o;o+=4){var a=e.readUInt32BE(o,!0);s.push(a)}return new n(s,e.length)}}).call(this,t("_process"),t("buffer").Buffer)},{_process:247,buffer:48}],303:[function(t,e,r){function n(t,e){return this instanceof n?(this.high=t,void(this.low=e)):new n(t,e)}function i(t){this.words=t||[]}var s=t("./word-array");i.prototype.toX32=function(){for(var t=this.words,e=t.length,r=[],n=0;e>n;n++){var i=t[n];r.push(i.high),r.push(i.low)}return new s(r,this.sigBytes)},e.exports.Word=n,e.exports.WordArray=i},{"./word-array":302}],304:[function(t,e,r){e.exports={name:"bitcore-lib",version:"0.13.13",description:"A pure and powerful JavaScript Bitcoin library.",author:"BitPay <[email protected]>",main:"index.js",scripts:{lint:"gulp lint",test:"gulp test",coverage:"gulp coverage",build:"gulp"},contributors:[{name:"Daniel Cousens",email:"[email protected]"},{name:"Esteban Ordano",email:"[email protected]"},{name:"Gordon Hall",email:"[email protected]"},{name:"Jeff Garzik",email:"[email protected]"},{name:"Kyle Drake",email:"[email protected]"},{name:"Manuel Araoz",email:"[email protected]"},{name:"Matias Alejo Garcia",email:"[email protected]"},{name:"Ryan X. Charles",email:"[email protected]"},{name:"Stefan Thomas",email:"[email protected]"},{name:"Stephen Pair",email:"[email protected]"},{name:"Wei Lu",email:"[email protected]"}],keywords:["bitcoin","transaction","address","p2p","ecies","cryptocurrency","blockchain","payment","bip21","bip32","bip37","bip69","bip70","multisig"],repository:{type:"git",url:"https://github.com/bitpay/bitcore-lib.git"},browser:{request:"browser-request"},dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1",sha512:"=0.0.1"},devDependencies:{"bitcore-build":"bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},license:"MIT"}},{}],"bitcore-lib":[function(t,e,r){(function(r,n){"use strict";var i=e.exports;i.version="v"+t("./package.json").version,i.versionGuard=function(t){if(void 0!==t){var e="More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.";throw new Error(e)}},i.versionGuard(r._bitcore),r._bitcore=i.version,i.crypto={},i.crypto.BN=t("./lib/crypto/bn"),i.crypto.ECDSA=t("./lib/crypto/ecdsa"),i.crypto.Hash=t("./lib/crypto/hash"),i.crypto.Random=t("./lib/crypto/random"),i.crypto.Point=t("./lib/crypto/point"),i.crypto.Signature=t("./lib/crypto/signature"),i.encoding={},i.encoding.Base58=t("./lib/encoding/base58"),i.encoding.Base58Check=t("./lib/encoding/base58check"),i.encoding.BufferReader=t("./lib/encoding/bufferreader"),i.encoding.BufferWriter=t("./lib/encoding/bufferwriter"),i.encoding.Varint=t("./lib/encoding/varint"),i.util={},i.util.buffer=t("./lib/util/buffer"),i.util.js=t("./lib/util/js"),i.util.preconditions=t("./lib/util/preconditions"),i.errors=t("./lib/errors"),i.Address=t("./lib/address"),i.Block=t("./lib/block"),i.MerkleBlock=t("./lib/block/merkleblock"),i.BlockHeader=t("./lib/block/blockheader"),i.HDPrivateKey=t("./lib/hdprivatekey.js"),i.HDPublicKey=t("./lib/hdpublickey.js"),i.Networks=t("./lib/networks"),i.Opcode=t("./lib/opcode"),i.PrivateKey=t("./lib/privatekey"),i.PublicKey=t("./lib/publickey"),i.Script=t("./lib/script"),i.Transaction=t("./lib/transaction"),i.URI=t("./lib/uri"),i.Unit=t("./lib/unit"),i.deps={},i.deps.bnjs=t("bn.js"),i.deps.bs58=t("bs58"),i.deps.Buffer=n,i.deps.elliptic=t("elliptic"),i.deps._=t("lodash"),i._HDKeyCache=t("./lib/hdkeycache"),i.Transaction.sighash=t("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"./lib/address":1,"./lib/block":4,"./lib/block/blockheader":3,"./lib/block/merkleblock":5,"./lib/crypto/bn":6,"./lib/crypto/ecdsa":7,"./lib/crypto/hash":8,"./lib/crypto/point":9,"./lib/crypto/random":10,"./lib/crypto/signature":11,"./lib/encoding/base58":12,"./lib/encoding/base58check":13,"./lib/encoding/bufferreader":14,"./lib/encoding/bufferwriter":15,"./lib/encoding/varint":16,"./lib/errors":17,"./lib/hdkeycache":19,"./lib/hdprivatekey.js":20,"./lib/hdpublickey.js":21,"./lib/networks":22,"./lib/opcode":23,"./lib/privatekey":24,"./lib/publickey":25,"./lib/script":26,"./lib/transaction":29,"./lib/transaction/sighash":37,"./lib/unit":41,"./lib/uri":42,"./lib/util/buffer":43,"./lib/util/js":44,"./lib/util/preconditions":45,"./package.json":304,"bn.js":272,bs58:273,buffer:48,elliptic:275,lodash:297}]},{},[]);