copay/lib/bitcore.js

375 lines
332 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=
// modules are defined as an array
// [ module function, map of requireuires ]
//
// map of requireuires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the requireuire for previous bundles
(function outer (modules, cache, entry) {
// Save the require from previous bundle to this closure if any
var previousRequire = typeof require == "function" && require;
function newRequire(name, jumped, inSkipCache){
var m, skipCache = inSkipCache;
if (typeof name === 'string') {
if (name.charAt(0) === '!' ) {
name = name.substr(1);
skipCache=true;
}
}
if(skipCache || !cache[name]) {
if(!modules[name]) {
// if we cannot find the the module within our internal map or
// cache jump to the current global require ie. the last bundle
// that was added to the page.
var currentRequire = typeof require == "function" && require;
if (!jumped && currentRequire) return currentRequire(name, true);
// If there are other bundles on this page the require from the
// previous one is saved to 'previousRequire'. Repeat this as
// many times as there are bundles until the module is found or
// we exhaust the require chain.
if (previousRequire) return previousRequire(name, true);
throw new Error('Cannot find module \'' + name + '\'');
}
m = {exports:{}};
var nextSkipCache = inSkipCache ? false : skipCache;
if (!skipCache) cache[name] = m;
skipCache = false;
modules[name][0].call(m.exports, function(x){
var id = modules[name][1][x];
return newRequire(id ? id : x, false, nextSkipCache);
},m,m.exports,outer,modules,cache,entry);
}
return m ? m.exports:cache[name].exports;
}
for(var i=0;i<entry.length;i++) newRequire(entry[i]);
// Override the current require with this new one
return newRequire;
})
({"./Address":[function(require,module,exports){
module.exports=require('5EBmBp');
},{}],"5EBmBp":[function(require,module,exports){
"use strict";function Address(){Address.super(this,arguments)}var imports=require("soop").imports(),coinUtil=imports.coinUtil||require("./util/util"),parent=imports.parent||require("./util/VersionedData"),networks=imports.networks||require("./networks"),Script=imports.Script||require("./Script");Address.parent=parent,parent.applyEncodingsTo(Address),Address.fromPubKey=function(r,e){if(e||(e="livenet"),33!=r.length&&65!=r.length)throw new Error("Invalid public key");var t=networks[e].addressVersion,s=coinUtil.sha256ripe160(r);return new Address(t,s)},Address.fromPubKeys=function(r,e,t,s){t||(t="livenet");for(var i in e){var n=e[i];if(33!=n.length&&65!=n.length)throw new Error("Invalid public key")}var o=Script.createMultisig(r,e,s);return Address.fromScript(o,t)},Address.fromScript=function(r,e){e||(e="livenet");var t=networks[e].P2SHVersion,s=r.getBuffer(),i=coinUtil.sha256ripe160(s);return new Address(t,i)},Address.prototype.validate=function(){if(this.doAsBinary(function(){if(Address.super(this,"validate",arguments),21!==this.data.length)throw new Error("invalid data length")}),"undefined"==typeof this.network())throw new Error("invalid network")},Address.prototype.isValid=function(){var r=Address.super(this,"isValid",arguments);return r},Address.prototype.network=function(){var r,e=this.version(),t=networks.livenet,s=networks.testnet;return e===t.addressVersion||e===t.P2SHVersion?r=t:(e===s.addressVersion||e===s.P2SHVersion)&&(r=s),r},Address.prototype.isScript=function(){return this.isValid()&&this.version()===this.network().P2SHVersion},module.exports=require("soop")(Address);
},{"./Script":"clx6XL","./networks":"ULNIu2","./util/VersionedData":"QLzNQg","./util/util":"ACyo5H","soop":146}],"./BIP32":[function(require,module,exports){
module.exports=require('easvXl');
},{}],"easvXl":[function(require,module,exports){
(function(e){function i(e,i){if(e.length<i)throw new Error("not enough data");for(var t=0,n=0;i>n;n++)t*=256,t+=e[n];return t}function t(e){return i(e,1)}function n(e){return i(e,4)}var r=require("soop").imports(),s=r.base58||require("base58-native").base58,h=r.coinUtil||require("./util/util"),d=r.Key||require("./Key"),c=r.Point||require("./Point"),a=r.bignum||require("bignum"),o=(require("crypto"),require("./networks")),y=new a("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16),l=(new a("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798",16),function(i){if("mainnet"==i||"livenet"==i?this.version=o.livenet.bip32privateVersion:"testnet"==i&&(this.version=o.testnet.bip32privateVersion),"mainnet"==i||"livenet"==i||"testnet"==i)return this.depth=0,this.parentFingerprint=new e([0,0,0,0]),this.childIndex=new e([0,0,0,0]),this.chainCode=d.generateSync().private,this.eckey=d.generateSync(),this.hasPrivateKey=!0,this.pubKeyHash=h.sha256ripe160(this.eckey.public),this.buildExtendedPublicKey(),void this.buildExtendedPrivateKey();if("string"==typeof i){var t=s.decode(i);if(82!=t.length)throw new Error("Not enough data");var n=t.slice(78,82);i=t.slice(0,78);var r=h.sha256(h.sha256(i));if(r[0]!=n[0]||r[1]!=n[1]||r[2]!=n[2]||r[3]!=n[3])throw new Error("Invalid checksum")}void 0!==i&&this.initFromBytes(i)});l.seed=function(i,t){if(t||(t="livenet"),e.isBuffer(i)||(i=new e(i,"hex")),i.length<16)return!1;var n=h.sha512hmac(i,new e("Bitcoin seed")),r=new l;return r.depth=0,r.parentFingerprint=new e([0,0,0,0]),r.childIndex=new e([0,0,0,0]),r.chainCode=n.slice(32,64),r.version=o[t].bip32privateVersion,r.eckey=new d,r.eckey.private=n.slice(0,32),r.eckey.regenerateSync(),r.hasPrivateKey=!0,r.pubKeyHash=h.sha256ripe160(r.eckey.public),r.buildExtendedPublicKey(),r.buildExtendedPrivateKey(),r},l.prototype.initFromBytes=function(e){if(78!=e.length)throw new Error("not enough data");this.version=n(e.slice(0,4)),this.depth=t(e.slice(4,5)),this.parentFingerprint=e.slice(5,9),this.childIndex=n(e.slice(9,13)),this.chainCode=e.slice(13,45);var i=e.slice(45,78),r=this.version==o.livenet.bip32privateVersion||this.version==o.testnet.bip32privateVersion,s=this.version==o.livenet.bip32publicVersion||this.version==o.testnet.bip32publicVersion;if(r&&0==i[0])this.eckey=new d,this.eckey.private=i.slice(1,33),this.eckey.compressed=!0,this.eckey.regenerateSync(),this.pubKeyHash=h.sha256ripe160(this.eckey.public),this.hasPrivateKey=!0;else{if(!s||2!=i[0]&&3!=i[0])throw new Error("Invalid key");this.eckey=new d,this.eckey.public=i,this.pubKeyHash=h.sha256ripe160(this.eckey.public),this.hasPrivateKey=!1}this.buildExtendedPublicKey(),this.buildExtendedPrivateKey()},l.prototype.buildExtendedPublicKey=function(){this.extendedPublicKey=new e([]);var i=null;switch(this.version){case o.livenet.bip32publicVersion:case o.livenet.bip32privateVersion:i=o.livenet.bip32publicVersion;break;case o.testnet.bip32publicVersion:case o.testnet.bip32privateVersion:i=o.testnet.bip32publicVersion;break;default:throw new Error("Unknown version")}this.extendedPublicKey=e.concat([this.extendedPublicKey,new e([i>>24])]),this.extendedPublicKey=e.concat([this.extendedPublicKey,new e([i>>16&255])]),this.extendedPublicKey=e.concat([this.extendedPublicKey,new e([i>>8&255])]),this.extendedPublicKey=e.concat([this.extendedPublicKey,new e([255&i])]),this.extendedPublicKey=e.concat([this.extendedPublicKey,new e([this.depth])]),this.extendedPublicKey=e.concat([this.extendedPublicKey,this.parentFingerprint]),this.extendedPublicKey=e.concat([this.extendedPublicKey,new e([this.childIndex>>>24])]),this.extendedPublicKey=e.concat([this.extendedPublicKey,new e([this.childIndex>>>16&255])]),this.extendedPublicKey=e.concat([this.extendedPublicKey,new e([this.childIndex>>>8&255])]),this.extendedPublicKey=e.concat([this.extendedPublicKey,new e([255&this.childIndex])]),this.extendedPublicKey=e.concat([this.extendedPublicKey,this.chainCode]),this.extendedPublicKey=e.concat([this.extendedPublicKey,this.eckey.public])},l.prototype.extendedPublicKeyString=function(i){if(void 0===i||"base58"===i){var t=h.sha256(h.sha256(this.extendedPublicKey)),n=t.slice(0,4),r=e.concat([this.extendedPublicKey,n]);return s.encode(r)}if("hex"===i)return this.extendedPublicKey.toString("hex");throw new Error("bad format")},l.prototype.buildExtendedPrivateKey=function(){if(this.hasPrivateKey){this.extendedPrivateKey=new e([]);var i=this.version;this.extendedPrivateKey=e.concat([this.extendedPrivateKey,new e([i>>24])]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,new e([i>>16&255])]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,new e([i>>8&255])]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,new e([255&i])]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,new e([this.depth])]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,this.parentFingerprint]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,new e([this.childIndex>>>24])]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,new e([this.childIndex>>>16&255])]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,new e([this.childIndex>>>8&255])]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,new e([255&this.childIndex])]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,this.chainCode]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,new e([0])]),this.extendedPrivateKey=e.concat([this.extendedPrivateKey,this.eckey.private])}},l.prototype.extendedPrivateKeyString=function(i){if(void 0===i||"base58"===i){var t=h.sha256(h.sha256(this.extendedPrivateKey)),n=t.slice(0,4),r=e.concat([this.extendedPrivateKey,n]);return s.encode(r)}if("hex"===i)return this.extendedPrivateKey.toString("hex");throw new Error("bad format")},l.prototype.derive=function(e){var i=e.split("/");if("m"==e||"M"==e||"m'"==e||"M'"==e)return this;var t=this;for(var n in i){var r=i[n];if(0!=n){var s=r.length>1&&"'"==r[r.length-1],h=2147483647&parseInt(s?r.slice(0,r.length-1):r);s&&(h+=2147483648),t=t.deriveChild(h)}else if("m"!=r)throw new Error("invalid path")}return t},l.prototype.deriveChild=function(i){var t=[];t.push(i>>24&255),t.push(i>>16&255),t.push(i>>8&255),t.push(255&i),t=new e(t);var n=0!=(2147483648&i),r=this.version==o.livenet.bip32privateVersion||this.version==o.testnet.bip32privateVersion;if(n&&(!this.hasPrivateKey||!r))throw new Error("Cannot do private key derivation without private key");var s=null;if(this.hasPrivateKey){var u=null;u=e.concat(n?[new e([0]),this.eckey.private,t]:[this.eckey.public,t]);var v=h.sha512hmac(u,this.chainCode),p=a.fromBuffer(v.slice(0,32),{size:32}),b=v.slice(32,64),K=a.fromBuffer(this.eckey.private,{size:32}),x=p.add(K).mod(y);s=new l,s.chainCode=b,s.eckey=new d,s.eckey.private=x.toBuffer({size:32}),s.eckey.regenerateSync(),s.hasPrivateKey=!0}else{var u=e.concat([this.eckey.public,t]),v=h.sha512hmac(u,this.chainCode),p=a.fromBuffer(v.slice(0,32),{size:32}),b=v.slice(32,64),P=new d;P.private=p.toBuffer({size:32}),P.regenerateSync();var w=c.fromKey(P),f=new d;f.public=this.eckey.public;var F=c.fromKey(f),k=c.add(w,F).toKey().public;s=new l,s.chainCode=new e(b);var g=new d;g.public=k,s.eckey=g,s.hasPrivateKey=!1}return s.childIndex=i,s.parentFingerprint=this.pubKeyHash.slice(0,4),s.version=this.version,s.depth=this.depth+1,s.eckey.compressed=!0,s.pubKeyHash=h.sha256ripe160(s.eckey.public),s.buildExtendedPublicKey(),s.buildExtendedPrivateKey(),s},module.exports=require("soop")(l)}).call(this,require("buffer").Buffer);
},{"./Key":"Af1Gom","./Point":"8PQ/SZ","./networks":"ULNIu2","./util/util":"ACyo5H","base58-native":"xtP2pj","bignum":"J4nwo8","buffer":75,"crypto":79,"soop":146}],"KqTx5b":[function(require,module,exports){
(function(t){function e(t){"object"!=typeof t&&(t={}),this.hash=t.hash||null,this.prev_hash=t.prev_hash||i.NULL_HASH,this.merkle_root=t.merkle_root||i.NULL_HASH,this.timestamp=t.timestamp||0,this.bits=t.bits||0,this.nonce=t.nonce||0,this.version=t.version||0,this.height=t.height||0,this.size=t.size||0,this.active=t.active||!1,this.chainWork=t.chainWork||i.EMPTY_BUFFER,this.txs=t.txs||[]}var r=require("soop").imports(),i=r.util||require("./util/util"),o=(r.Debug1||function(){},r.Script||require("./Script")),s=r.Bignum||require("bignum"),h=(r.Binary||require("binary"),r.Step||require("step"),r.buffertools||require("buffertools")),n=r.Transaction||require("./Transaction"),a=n.In,c=n.Out,u=n.COINBASE_OP,l=r.VerificationError||require("./util/error").VerificationError,f={maxTimeOffset:7200,largestHash:s(2).pow(256)};e.prototype.getHeader=function(){var e=new t(80),r=0;return e.writeUInt32LE(this.version,r),r+=4,this.prev_hash.copy(e,r),r+=32,this.merkle_root.copy(e,r),r+=32,e.writeUInt32LE(this.timestamp,r),r+=4,e.writeUInt32LE(this.bits,r),r+=4,e.writeUInt32LE(this.nonce,r),r+=4,e},e.prototype.parse=function(t,e){if(this.version=t.word32le(),this.prev_hash=t.buffer(32),this.merkle_root=t.buffer(32),this.timestamp=t.word32le(),this.bits=t.word32le(),this.nonce=t.word32le(),this.txs=[],this.size=0,!e)for(var r=t.varInt(),i=0;r>i;i++){var o=new n;o.parse(t),this.txs.push(o)}},e.prototype.calcHash=function(){var t=this.getHeader();return i.twoSha256(t)},e.prototype.checkHash=function(){return this.hash&&this.hash.length?0==h.compare(this.calcHash(),this.hash):!1},e.prototype.getHash=function(){return this.hash&&this.hash.length||(this.hash=this.calcHash()),this.hash},e.prototype.checkProofOfWork=function(){var t=i.decodeDiffBits(this.bits),e=h.reverse(this.hash);if(h.compare(e,t)>0)throw new l("Difficulty target not met");return!0},e.prototype.getWork=function(){var t=i.decodeDiffBits(this.bits,!0);return f.largestHash.div(t.add(1))},e.prototype.checkTimestamp=function(){var t=(new Date).getTime()/1e3;if(this.timestamp>t+f.maxTimeOffset)throw new l("Timestamp too far into the future");return!0},e.prototype.checkTransactions=function(t){if(!Array.isArray(t)||t.length<=0)throw new l("No transactions");if(!t[0].isCoinBase())throw new l("First tx must be coinbase");for(var e=1;e<t.length;e++)if(t[e].isCoinBase())throw new l("Tx index "+e+" must not be coinbase");return!0},e.prototype.getMerkleTree=function(e){if(0==e.length)return[i.NULL_HASH.slice(0)];for(var r=e.map(function(t){return t instanceof n?t.getHash():t}),o=0,s=e.length;s>1;s=Math.floor((s+1)/2)){for(var h=0;s>h;h+=2){var a=Math.min(h+1,s-1),c=r[o+h],u=r[o+a];r.push(i.twoSha256(t.concat([c,u])))}o+=s}return r},e.prototype.calcMerkleRoot=function(t){var e=this.getMerkleTree(t);return e[e.length-1]},e.prototype.checkMerkleRoot=function(e){if(!this.merkle_root||!this.merkle_root.length)throw new l("No merkle root");if(0!==h.compare(this.calcMerkleRoot(e),new t(this.merkle_root)))throw new l("Merkle root incorrect");return!0},e.prototype.checkBlock=function(t){if(!this.checkHash())throw new l("Block hash invalid");if(this.checkProofOfWork(),this.checkTimestamp(),t&&(this.checkTransactions(t),!this.checkMerkleRoot(t)))throw new l("Merkle hash invalid");return!0},e.getBlockValue=function(t){var e=s(50).mul(i.COIN);return e=e.div(s(2).pow(Math.floor(t/21e4)))},e.prototype.getBlockValue=function(){return e.getBlockValue(this.height)},e.prototype.toString=function(){return"<Block "+i.formatHashAlt(this.hash)+" height="+this.height+">"},e.prototype.createCoinbaseTx=function(t){var e=new n;return e.ins.push(new a({s:i.EMPTY_BUFFER,q:4294967295,o:u})),e.outs.push(new c({v:i.bigIntToValue(this.getBlockValue()),s:o.createPubKeyOut(t).getBuffer()})),e},e.prototype.solve=function(t,e){var r=this.getHeader(),o=i.decodeDiffBits(this.bits);t.solve(r,o,e)},e.prototype.getStandardizedObject=function(t){var e={hash:i.formatHashFull(this.getHash()),version:this.version,prev_block:i.formatHashFull(this.prev_hash),mrkl_root:i.formatHashFull(this.merkle_root),time:this.timestamp,bits:this.bits,nonce:this.nonce,height:this.height};if(t){var r=this.getMerkleTree(t).map(function(t){return i.formatHashFull(t)});e.mrkl_root=r[r.length-1],e.n_tx=t.length;var o=80;o+=i.getVarIntSize(t.length),t=t.map(function(t){return t=t.getStandardizedObject(),o+=t.size,t}),e.size=o,e.tx=t,e.mrkl_tree=r}else e.size=this.size;return e},module.exports=require("soop")(e)}).call(this,require("buffer").Buffer);
},{"./Script":"clx6XL","./Transaction":"RNv6Te","./util/error":155,"./util/util":"ACyo5H","bignum":"J4nwo8","binary":62,"buffer":75,"buffertools":"fugeBw","soop":146,"step":147}],"./Block":[function(require,module,exports){
module.exports=require('KqTx5b');
},{}],"ZnXdbH":[function(require,module,exports){
function Bloom(){this.data="",this.hashFuncs=0}function ROTL32(t,n){return t<<n|t>>32-n}function getBlockU32(t,n){var o=4*t,s=n[o+0]<<0|n[o+1]<<8|n[o+2]<<16|n[o+3]<<24;return s}function toInt(t){return~~t}function min(t,n){return n>t?t:n}var MAX_BLOOM_FILTER_SIZE=36e3,MAX_HASH_FUNCS=50,LN2SQUARED=.48045301391820144,LN2=.6931471805599453,bit_mask=[1,2,4,8,16,32,64,128];Bloom.prototype.hash=function(t,n){for(var o=t*(4294967295/(this.hashFuncs-1)),s=3432918353,a=461845907,h=n.length/4,i=-h;i;i++){var r=getBlockU32(i);r*=s,r=ROTLF32(r,15),r*=a,o^=r,o=ROTFL(o,13),o=5*o+3864292196}var e=n.slice(4*h),r=0;switch(3&n.length){case 3:r^=e[2]<<16;case 2:r^=e[1]<<8;case 1:r^=e[0],r*=s,r=ROTL32(r,15),r*=a,o^=r}return o^=n.length,o^=o>>16,o*=2246822507,o^=o>>13,o*=3266489909,o^=o>>16,o%(8*this.data.length)},Bloom.prototype.insert=function(t){for(var n=0;n<this.hashFuncs;n++){var o=this.hash(n,t);this.data[o>>3]|=bit_mask[7&o]}},Bloom.prototype.contains=function(t){for(var n=0;n<this.hashFuncs;n++){var o=this.hash(n,t);if(!(this.data[o>>3]&bit_mask[7&o]))return!1}return!0},Bloom.prototype.sizeOk=function(){return this.data.length<=MAX_BLOOM_FILTER_SIZE&&this.hashFuncs<=MAX_HASH_FUNCS},Bloom.prototype.init=function(t,n){var o=min(toInt(-1/LN2SQUARED*t*Math.log(n)),8*MAX_BLOOM_FILTER_SIZE)/8;this.data[o]=0,this.hashFuncs=min(toInt(8*this.data.length/t*LN2),MAX_HASH_FUNCS)},module.exports=require("soop")(Bloom);
},{"soop":146}],"./Bloom":[function(require,module,exports){
module.exports=require('ZnXdbH');
},{}],"./Buffers.monkey":[function(require,module,exports){
module.exports=require('jmkPxi');
},{}],"jmkPxi":[function(require,module,exports){
(function(f){exports.patch=function(t){t.prototype.skip=function(t){if(0!=t){if(t==this.length)return this.buffers=[],void(this.length=0);var s=this.pos(t);this.buffers=this.buffers.slice(s.buf),this.buffers[0]=new f(this.buffers[0].slice(s.offset)),this.length-=t}}}}).call(this,require("buffer").Buffer);
},{"buffer":75}],"./Connection":[function(require,module,exports){
module.exports=require('h81grl');
},{}],"h81grl":[function(require,module,exports){
(function(e){function t(e,r){t.super(this,arguments),this.socket=e,this.peer=r,this.active=!1,this.recvVer=0,this.sendVer=0,this.bestHeight=0,this.inbound=!!e.server,this.getaddr=!1,this.buffers=new c,(new Date).getTime()>1329696e6&&(this.recvVer=209,this.sendVer=209),this.setupHandlers()}var r=require("soop").imports(),s=r.config||require("./config"),n=r.log||require("./util/log"),i=r.network||require("./networks")[s.network],o=1e7,a=7e4,h=(r.Binary||require("binary"),r.Put||require("bufferput")),c=r.Buffers||require("buffers");require("./Buffers.monkey").patch(c);var d=require("./Block"),f=require("./Transaction"),u=r.util||require("./util/util"),p=r.Parser||require("./util/BinaryParser"),g=r.buffertools||require("buffertools"),l=r.doubleSha256||u.twoSha256,v=u.generateNonce(),b=6e4;t.parent=r.parent||require("events").EventEmitter,t.prototype.setupHandlers=function(){this.socket.addListener("connect",this.handleConnect.bind(this)),this.socket.addListener("error",this.handleError.bind(this)),this.socket.addListener("end",this.handleDisconnect.bind(this)),this.socket.addListener("data",function(e){var t=35;n.debug("["+this.peer+"] Recieved "+e.length+" bytes of data:"),n.debug("... "+g.toHex(e.slice(0,t>e.length?e.length:t))+(e.length>t?"...":""))}.bind(this)),this.socket.addListener("data",this.handleData.bind(this))},t.prototype.handleConnect=function(){this.inbound||this.sendVersion(),this.emit("connect",{conn:this,socket:this.socket,peer:this.peer})},t.prototype.handleError=function(e){110==e.errno||"ETIMEDOUT"==e.errno?n.info("connection timed out for "+this.peer):111==e.errno||"ECONNREFUSED"==e.errno?n.info("connection refused for "+this.peer):n.warn("connection with "+this.peer+" "+e.toString()),this.emit("error",{conn:this,socket:this.socket,peer:this.peer,err:e})},t.prototype.handleDisconnect=function(){this.emit("disconnect",{conn:this,socket:this.socket,peer:this.peer})},t.prototype.handleMessage=function(t){if(t){try{switch(t.command){case"version":if(0===g.compare(v,t.nonce))return void this.socket.end();this.inbound&&this.sendVersion(),t.version>=209&&this.sendMessage("verack",new e([])),this.sendVer=Math.min(t.version,a),t.version<209?this.recvVer=Math.min(t.version,a):this.once("verack",function(){this.recvVer=t.version}.bind(this)),this.bestHeight=t.start_height;break;case"verack":this.recvVer=Math.min(t.version,a),this.active=!0;break;case"ping":"object"==typeof t.nonce&&this.sendPong(t.nonce)}}catch(r){return void n.err('Error while handling "'+t.command+'" message from '+this.peer+":\n"+(r.stack?r.stack:r.toString()))}this.emit(t.command,{conn:this,socket:this.socket,peer:this.peer,message:t})}},t.prototype.sendPong=function(e){this.sendMessage("pong",e)},t.prototype.sendVersion=function(){var t="/BitcoinX:0.1/",r=new h;r.word32le(a),r.word64le(1),r.word64le(Math.round((new Date).getTime()/1e3)),r.pad(26),r.pad(26),r.put(v),r.varint(t.length),r.put(new e(t,"ascii")),r.word32le(0),this.sendMessage("version",r.buffer())},t.prototype.sendGetBlocks=function(t,r,s){r=r||u.NULL_HASH;var n=new h;n.word32le(this.sendVer),n.varint(t.length);for(var i=0;i<t.length;i++){if(32!=t[i].length)throw new Error("Invalid hash length");n.put(t[i])}var o=new e(r,"binary");if(32!=o.length)throw new Error("Invalid hash length");n.put(o);var a="getblocks";s&&(a="getheaders"),this.sendMessage(a,n.buffer())},t.prototype.sendGetHeaders=function(e,t){this.sendGetBlocks(e,t,!0)},t.prototype.sendGetData=function(e){var t=new h;t.varint(e.length);for(var r=0;r<e.length;r++)t.word32le(e[r].type),t.put(e[r].hash);this.sendMessage("getdata",t.buffer())},t.prototype.sendGetAddr=function(){var e=new h;this.sendMessage("getaddr",e.buffer())},t.prototype.sendInv=function(e){Array.isArray(e)||(e=[e]);var t=new h;t.varint(e.length),e.forEach(function(e){t.word32le(e instanceof d?2:1),t.put(e.getHash())}),this.sendMessage("inv",t.buffer())},t.prototype.sendHeaders=function(e){var t=new h;t.varint(e.length),e.forEach(function(e){t.put(e),t.word8(0)}),this.sendMessage("headers",t.buffer())},t.prototype.sendTx=function(e){this.sendMessage("tx",e.serialize())},t.prototype.sendBlock=function(e,t){var r=new h;r.put(e.getHeader()),r.varint(t.length),t.forEach(function(e){r.put(e.serialize())}),this.sendMessage("block",r.buffer())},t.prototype.sendMessage=function(t,r){try{var s=i.magic,o=new e(t,"ascii");if(o.length>12)throw"Command name too long";var a;a=this.sendVer>=209?l(r).slice(0,4):new e([]);var c=new h;c.put(s),c.put(o),c.pad(12-o.length),c.word32le(r.length),c.put(a),c.put(r);var d=c.buffer();n.debug("["+this.peer+"] Sending message "+t+" ("+r.length+" bytes)"),this.socket.write(d)}catch(f){n.err("Error while sending message to peer "+this.peer+": "+(f.stack?f.stack:f.toString()))}},t.prototype.handleData=function(e){return this.buffers.push(e),this.buffers.length>o?(n.err("Peer "+this.peer+" exceeded maxreceivebuffer, disconnecting."+(err.stack?err.stack:err.toString())),void this.socket.destroy()):void this.processData()},t.prototype.processData=function(){if(!(this.buffers.length<20)){for(var e=i.magic,t=0;;){if(this.buffers.get(t)===e[0]&&this.buffers.get(t+1)===e[1]&&this.buffers.get(t+2)===e[2]&&this.buffers.get(t+3)===e[3]){0!==t&&(n.debug("["+this.peer+"] Received "+t+" bytes of inter-message garbage: "),n.debug("... "+this.buffers.slice(0,t)),this.buffers.skip(t));break}if(t>this.buffers.length-4)return void this.buffers.skip(t);t++}var r=this.buffers.get(16)+(this.buffers.get(17)<<8)+(this.buffers.get(18)<<16)+(this.buffers.get(19)<<24),s=this.recvVer>=209?24:20,o=s+r;if(!(this.buffers.length<o)){var a=this.buffers.slice(4,16).toString("ascii").replace(/\0+$/,""),h=this.buffers.slice(s,o),c=this.recvVer>=209?this.buffers.slice(20,24):null;if(n.debug("["+this.peer+"] Received message "+a+" ("+r+" bytes)"),null!==c){var d=l(h).slice(0,4);if(0!==g.compare(d,c))return void n.err("["+this.peer+"] Checksum failed",{cmd:a,expected:d.toString("hex"),actual:c.toString("hex")})}var f;try{f=this.parseMessage(a,h)}catch(u){n.err("Error while parsing message "+a+" from "+this.peer+":\n"+(u.stack?u.stack:u.toString()))}f&&this.handleMessage(f),this.buffers.skip(o),this.processData()}}},t.prototype.parseMessage=function(e,t){var r,s=new p(t),i={command:e};switch(e){case"version":i.version=s.word32le(),i.services=s.word64le(),i.timestamp=s.word64le(),i.addr_me=s.buffer(26),i.addr_you=s.buffer(26),i.nonce=s.buffer(8),i.subversion=s.varStr(),i.start_height=s.word32le();break;case"inv":case"getdata":for(i.count=s.varInt(),i.invs=[],r=0;r<i.count;r++)i.invs.push({type:s.word32le(),hash:s.buffer(32)});break;case"headers":for(i.count=s.varInt(),i.headers=[],r=0;r<i.count;r++){var o=new d;o.parse(s),i.headers.push(o)}break;case"block":var a=new d;a.parse(s),i.block=a,i.version=a.version,i.prev_hash=a.prev_hash,i.merkle_root=a.merkle_root,i.timestamp=a.timestamp,i.bits=a.bits,i.nonce=a.nonce,i.txs=a.txs,i.size=t.length;break;case"tx":var h=new f;return h.parse(s),{command:e,version:h.version,lock_time:h.lock_time,ins:h.ins,outs:h.outs,tx:h};case"getblocks":case"getheaders":i.version=s.word32le();var c=s.varInt();for(i.starts=[],r=0;c>r;r++)i.starts.push(s.buffer(32));i.stop=s.buffer(32);break;case"addr":var u=s.varInt();for(u>1e3&&(u=1e3),i.addrs=[],r=0;u>r;r++)i.addrs.push({time:s.word32le(),services:s.word64le(),ip:s.buffer(16),port:s.word16be()});break;case"alert":i.payload=s.varStr(),i.signature=s.varStr();break;case"ping":this.recvVer>b&&(i.nonce=s.buffer(8));break;case"getaddr":case"verack":case"reject":break;default:return n.err("Connection.parseMessage(): Command not implemented",{cmd:e}),null}return i},module.exports=require("soop")(t)}).call(this,require("buffer").Buffer);
},{"./Block":"KqTx5b","./Buffers.monkey":"jmkPxi","./Transaction":"RNv6Te","./config":"4itQ50","./networks":"ULNIu2","./util/BinaryParser":"b3ZSD7","./util/log":"AdF7pF","./util/util":"ACyo5H","binary":62,"buffer":75,"bufferput":"aXRuS6","buffers":"OBo3aV","buffertools":"fugeBw","events":84,"soop":146}],"ypnq12":[function(require,module,exports){
exports.intFromCompact=function(r){var t=(r>>>24&255)>>>0,n=(16777215&r)<<8*(t-3)>>>0;return n};
},{}],"./Deserialize":[function(require,module,exports){
module.exports=require('ypnq12');
},{}],"./Gruntfile":[function(require,module,exports){
module.exports=require('NbSoFu');
},{}],"NbSoFu":[function(require,module,exports){
"use strict";module.exports=function(s){s.loadNpmTasks("grunt-contrib-watch"),s.loadNpmTasks("grunt-mocha-test"),s.loadNpmTasks("grunt-markdown"),s.loadNpmTasks("grunt-shell"),s.initConfig({shell:{browserify:{options:{stdout:!0,stderr:!0},command:"dev"===s.option("target")?"node ./browser/build.js -a -d ":"node ./browser/build.js -a"}},watch:{readme:{files:["README.md"],tasks:["markdown"]},scripts:{files:["**/*.js","**/*.html","!**/node_modules/**","!browser/bundle.js","!browser/testdata.js","!browser/vendor-bundle.js"],tasks:["shell"]}},mochaTest:{options:{reporter:"spec"},src:["test/*.js"]},markdown:{all:{files:[{expand:!0,src:"README.md",dest:".",ext:".html"}]}}}),s.registerTask("default",["shell","watch"])};
},{}],"./Key":[function(require,module,exports){
module.exports=require('Af1Gom');
},{}],"Af1Gom":[function(require,module,exports){
(function(e,r){if(e.versions){var t=require("bindings")("KeyModule"),s=t.Key;module.exports=s}else{var o=require("./browser/vendor-bundle.js").ECKey,n=require("buffertools"),i=function(){this._pub=null,this.compressed=!0},u=i.bufferToArray=function(e){for(var r=[],t=e.length,s=0;t>s;s++)r.push(e.readUInt8(s));return r};Object.defineProperty(i.prototype,"public",{set:function(e){if(!r.isBuffer(e))throw new Error("Arg should be a buffer");var t=e[0];this.compressed=4!==t,this._pub=e},get:function(){return this._pub}}),i.generateSync=function(){var e=new o;e.setCompressed(!0);var t=e.getPub(),s=new i;return s.private=new r(e.priv.toByteArrayUnsigned()),s.public=new r(t),s},i.prototype.regenerateSync=function(){if(!this.private)throw new Error("Key does not have a private key set");var e=new o(n.toHex(this.private));return e.setCompressed(this.compressed),this.public=new r(e.getPub()),this},i.prototype.signSync=function(e){if(!this.private)throw new Error("Key does not have a private key set");if(!r.isBuffer(e)||32!==e.length)throw new Error("Arg should be a 32 bytes hash buffer");var t=new o(n.toHex(this.private));t.setCompressed(this.compressed);var s=t.sign(u(e));return new r(s)},i.prototype.verifySignature=function(e,r,t){try{var s=this.verifySignatureSync(e,r);t(null,s)}catch(o){t(o)}},i.prototype.verifySignatureSync=function(e,t){var s=this;if(!r.isBuffer(e)||32!==e.length)throw new Error("Arg 1 should be a 32 bytes hash buffer");if(!r.isBuffer(t))throw new Error("Arg 2 should be a buffer");if(!s.public)throw new Error("Key does not have a public key set");var n=new o;n.setPub(u(s.public)),n.setCompressed(s.compressed);var i=u(t),f=n.verify(u(e),i);return f},module.exports=i}}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),require("buffer").Buffer);
},{"./browser/vendor-bundle.js":53,"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91,"bindings":66,"buffer":75,"buffertools":"fugeBw"}],"ahN55r":[function(require,module,exports){
exports.patch=function(t){t.prototype.round=function(t){if(!t)return Math.round(this);var r=Math.pow(10,t);return Math.round(this*r)/r}};
},{}],"./Number.monkey":[function(require,module,exports){
module.exports=require('ahN55r');
},{}],"./Opcode":[function(require,module,exports){
module.exports=require('zHwnes');
},{}],"zHwnes":[function(require,module,exports){
function Opcode(O){this.code=O}var imports=require("soop").imports();Opcode.prototype.toString=function(){return Opcode.reverseMap[this.code]},Opcode.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_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},Opcode.reverseMap=[];for(var k in Opcode.map)Opcode.map.hasOwnProperty(k)&&(Opcode.reverseMap[Opcode.map[k]]=k.substr(3));Opcode.asList=function(){var O=[];for(var P in Opcode.map)Opcode.map.hasOwnProperty(P)&&O.push(P);return O},module.exports=require("soop")(Opcode);
},{"soop":146}],"6VMrjH":[function(require,module,exports){
(function(t){function e(r,o,i){if("string"==typeof r){if(r.indexOf(":")&&!o){var n=r.split(":");r=n[0],o=n[1]}this.host=r,this.port=+o||8333}else if(r instanceof e)this.host=r.host,this.port=r.port;else{if(!t.isBuffer(r))throw new Error("Could not instantiate peer, invalid parameter type: "+typeof r);if(0!=s.compare(e.IPV6_IPV4_PADDING,r.slice(0,12)))throw new Error("IPV6 not supported yet! Cannot instantiate host.");this.host=Array.prototype.slice.apply(r.slice(12)).join("."),this.port=+o||8333}this.services=i?i:null,this.lastSeen=0}var r=require("soop").imports(),o=r.Net||require("net"),i=r.Binary||require("binary"),s=r.buffertools||require("buffertools");e.IPV6_IPV4_PADDING=new t([0,0,0,0,0,0,0,0,0,0,255,255]),e.prototype.createConnection=function(){var t=o.createConnection(this.port,this.host);return t},e.prototype.getHostAsBuffer=function(){return new t(this.host.split("."))},e.prototype.toString=function(){return this.host+":"+this.port},e.prototype.toBuffer=function(){var t=i.put();return t.word32le(this.lastSeen),t.word64le(this.services),t.put(this.getHostAsBuffer()),t.word16be(this.port),t.buffer()},module.exports=require("soop")(e)}).call(this,require("buffer").Buffer);
},{"binary":62,"buffer":75,"buffertools":"fugeBw","net":71,"soop":146}],"./Peer":[function(require,module,exports){
module.exports=require('6VMrjH');
},{}],"./PeerManager":[function(require,module,exports){
module.exports=require('z6R5yC');
},{}],"z6R5yC":[function(require,module,exports){
function PeerManager(){this.active=!1,this.timer=null,this.peers=[],this.connections=[],this.isConnected=!1,this.peerDiscovery=!1,this.interval=5e3,this.minConnections=8,this.minKnownPeers=10}var imports=require("soop").imports(),config=imports.config||require("./config"),log=imports.log||require("./util/log"),network=imports.network||require("./networks")[config.network],Connection=imports.Connection||require("soop").load("./Connection",{config:config,network:network})||require("./Connection"),Peer=imports.Peer||require("./Peer");GetAdjustedTime=imports.GetAdjustedTime||function(){return Math.floor((new Date).getTime()/1e3)},PeerManager.parent=imports.parent||require("events").EventEmitter,PeerManager.Connection=Connection,PeerManager.prototype.start=function(){this.active=!0,this.timer||(this.timer=setInterval(this.checkStatus.bind(this),this.interval))},PeerManager.prototype.stop=function(){this.active=!1,this.timer&&(clearInterval(this.timer),this.timer=null);for(var e=0;e<this.connections.length;e++)this.connections[e].socket.end()},PeerManager.prototype.addPeer=function(e,n){if(e instanceof Peer)this.peers.push(e);else{if("string"!=typeof e)throw log.err("Node.addPeer(): Invalid value provided for peer",{val:e}),"Node.addPeer(): Invalid value provided for peer.";this.addPeer(new Peer(e,n))}},PeerManager.prototype.checkStatus=function(){if(this.peers.length){var e={};this.peers.forEach(function(n){e[n.toString()]=n}),this.connections.forEach(function(n){var t=n.peer.toString();"undefined"!==e[t]&&delete e[t]}),Object.keys(e).forEach(function(n){this.connectTo(e[n])}.bind(this))}},PeerManager.prototype.connectTo=function(e){log.info("connecting to "+e);try{return this.addConnection(e.createConnection(),e)}catch(n){return log.err("creating connection",n),null}},PeerManager.prototype.addConnection=function(e,n){var t=new Connection(e,n);return this.connections.push(t),this.emit("connection",t),t.addListener("version",this.handleVersion.bind(this)),t.addListener("verack",this.handleReady.bind(this)),t.addListener("addr",this.handleAddr.bind(this)),t.addListener("getaddr",this.handleGetAddr.bind(this)),t.addListener("error",this.handleError.bind(this)),t.addListener("disconnect",this.handleDisconnect.bind(this)),t},PeerManager.prototype.handleVersion=function(e){e.peer.version=e.message.version,e.peer.start_height=e.message.start_height,!e.conn.inbound,this.peerDiscovery&&(e.message.version>=31402||this.peers.length<1e3)&&(e.conn.sendGetAddr(),e.conn.getaddr=!0)},PeerManager.prototype.handleReady=function(e){log.info("connected to "+e.conn.peer.host+":"+e.conn.peer.port),this.emit("connect",{pm:this,conn:e.conn,socket:e.socket,peer:e.peer}),0==this.isConnected&&(this.emit("netConnected",e),this.isConnected=!0)},PeerManager.prototype.handleAddr=function(e){if(this.peerDiscovery){var n=GetAdjustedTime();e.message.addrs.forEach(function(e){try{(e.time<=1e8||e.time>n+600)&&(e.time=n-432e3);var t=new Peer(e.ip,e.port,e.services);t.lastSeen=e.time,this.peers.push(t)}catch(r){log.warn("Invalid addr received: "+r.message)}}.bind(this)),e.message.addrs.length<1e3&&(e.conn.getaddr=!1)}},PeerManager.prototype.handleGetAddr=function(){},PeerManager.prototype.handleError=function(e){log.err("unkown error with peer "+e.peer+" (disconnecting): "+e.err),this.handleDisconnect.apply(this,[].slice.call(arguments))},PeerManager.prototype.handleDisconnect=function(e){log.info("disconnected from peer "+e.peer);var n=this.connections.indexOf(e.conn);-1!=n&&this.connections.splice(n,1),this.connections.length||(this.emit("netDisconnected"),this.isConnected=!1)},PeerManager.prototype.getActiveConnection=function(){var e=this.connections.filter(function(e){return e.active});if(e.length){var n=Math.floor(Math.random()*e.length),t=e[n];return t.socket.writable?t:(e.splice(n,1),this.getActiveConnection())}return null},PeerManager.prototype.getActiveConnections=function(){return this.connections.slice(0)},module.exports=require("soop")(PeerManager);
},{"./Connection":"h81grl","./Peer":"6VMrjH","./config":"4itQ50","./networks":"ULNIu2","./util/log":"AdF7pF","events":84,"soop":146}],"./Point":[function(require,module,exports){
module.exports=require('8PQ/SZ');
},{}],"8PQ/SZ":[function(require,module,exports){
(function(e,r){"use strict";var s=require("soop").imports(),o=s.Key||require("./Key"),n=s.bignum||require("bignum"),t=require("assert");if(!e.versions){var i=require("./browser/vendor-bundle.js").ECKey,u=require("./browser/vendor-bundle.js").ECPointFp,f=require("./browser/vendor-bundle.js").ECFieldElementFp,d=require("./browser/vendor-bundle.js").getSECCurveByName,c=require("./browser/vendor-bundle.js").BigInteger;require("chai").should()}var l=function(e,r){this.x=e,this.y=r};l.add=function(s,i){if(e.versions){var g=s.toKey();g.compressed=!1;var p=i.toKey();p.compressed=!1;var w=o.addUncompressed(g.public,p.public),b=new o;return b.compressed=!1,b.public=w,b.compressed=!0,l.fromKey(b)}var m=d("secp256k1"),v=s.x.toBuffer({size:32}).toString("hex"),a=new c(v,16),y=s.y.toBuffer({size:32}).toString("hex"),B=new c(y,16),h=new f(m.getCurve().getQ(),a),C=new f(m.getCurve().getQ(),B),x=new u(m.getCurve(),h,C),z=i.x.toBuffer({size:32}).toString("hex"),q=new c(z,16),K=i.y.toBuffer({size:32}).toString("hex"),j=new c(K,16),P=new f(m.getCurve().getQ(),q),E=new f(m.getCurve().getQ(),j),S=new u(m.getCurve(),P,E),A=x.add(S),Q=new l,U=new r(A.getX().toBigInteger().toByteArrayUnsigned());Q.x=n.fromBuffer(U,{size:U.length}),t(U.length<=32);var F=new r(A.getY().toBigInteger().toByteArrayUnsigned());return t(F.length<=32),Q.y=n.fromBuffer(F,{size:F.length}),Q},l.fromKey=function(s){if(e.versions){var t=new l,u=new r(s.public),f=new o;return f.compressed=s.compressed,f.public=u,f.compressed=!1,t.x=n.fromBuffer(f.public.slice(1,33),{size:32}),t.y=n.fromBuffer(f.public.slice(33,65),{size:32}),t}var t=new l,u=new r(s.public),f=new i;return f.setCompressed(s.compressed),f.setPub(o.bufferToArray(u)),f.setCompressed(!1),t.x=n.fromBuffer(new r(f.getPub()).slice(1,33),{size:32}),t.y=n.fromBuffer(new r(f.getPub()).slice(33,65),{size:32}),t},l.prototype.toKey=function(){if(e.versions){var s=this.x.toBuffer({size:32}),n=this.y.toBuffer({size:32}),t=new o;t.compressed=!1;var u=new r([4]);return t.public=r.concat([u,s,n]),t.compressed=!0,t}var s=this.x.toBuffer({size:32}),n=this.y.toBuffer({size:32}),t=new i;t.setCompressed(!1);var u=new r([4]),f=r.concat([u,s,n]);t.setPub(o.bufferToArray(f)),t.setCompressed(!0);var d=new o;return d.public=new r(t.getPub()),d},module.exports=require("soop")(l)}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),require("buffer").Buffer);
},{"./Key":"Af1Gom","./browser/vendor-bundle.js":53,"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91,"assert":72,"bignum":"J4nwo8","buffer":75,"chai":112,"soop":146}],"./PrivateKey":[function(require,module,exports){
module.exports=require('+A60Qr');
},{}],"+A60Qr":[function(require,module,exports){
(function(t){function e(t,i,r){e.super(this,arguments),void 0!==r&&this.compressed(r)}var i=require("soop").imports(),r=i.parent||require("./util/VersionedData"),n=i.networks||require("./networks");e.parent=r,r.applyEncodingsTo(e),e.prototype.validate=function(){if(this.doAsBinary(function(){if(e.super(this,"validate",arguments),this.data.length<32||this.data.length>33&&!this.compressed()||34==this.data.length&&1!=this.data[33]||this.data.length>34)throw new Error("invalid data length")}),"undefined"==typeof this.network())throw new Error("invalid network")},e.prototype.payload=function(t){if(t)return this.doAsBinary(function(){t.copy(this.data,1)}),t;var e=this.as("binary");return 34==e.length?e.slice(1,33):33==e.length?e.slice(1):void 0},e.prototype.compressed=function(e){if(void 0===e){var i=34,r=this.as("binary");if(r.length==i&&1==r[i-1])return!0;if(r.length==i-1)return!1;throw new Error("invalid private key")}this.doAsBinary(function(){var i=34;if(e){var r=new t(i);this.data.copy(r),this.data=r,this.data[i-1]=1}else this.data=this.data.slice(0,i-1)})},e.prototype.network=function(){var t,e=this.version(),i=n.livenet,r=n.testnet;return e===i.privKeyVersion?t=i:e===r.privKeyVersion&&(t=r),t},module.exports=require("soop")(e)}).call(this,require("buffer").Buffer);
},{"./networks":"ULNIu2","./util/VersionedData":"QLzNQg","buffer":75,"soop":146}],"Svwrvc":[function(require,module,exports){
(function(t){function e(t){t=t||{},this.host=t.host||"127.0.0.1",this.port=t.port||8332,this.user=t.user||"user",this.pass=t.pass||"pass",this.protocol="http"==t.protocol?n:i,this.batchedCalls=null,this.disableAgent=t.disableAgent||!1}function r(t,e,r){function s(t,e){return function(){var s=arguments.length-1;if(this.batchedCalls)var s=arguments.length;for(var o=0;s>o;o++)e[o]&&(arguments[o]=e[o](arguments[o]));this.batchedCalls?this.batchedCalls.push({jsonrpc:"2.0",method:t,params:c(arguments)}):r.call(this,{method:t,params:c(arguments,0,arguments.length-1)},arguments[arguments.length-1])}}var o={str:function(t){return t.toString()},"int":function(t){return parseFloat(t)},"float":function(t){return parseFloat(t)},bool:function(t){return t===!0||"1"==t||"true"==t||"true"==t.toString().toLowerCase()}};for(var n in e)if(e.hasOwnProperty(n)){for(var i=e[n].split(" "),a=0;a<i.length;a++)i[a]=o[i[a]]?o[i[a]]:o.string;var l=n.toLowerCase();t.prototype[n]=s(l,i),t.prototype[l]=t.prototype[n]}}function s(e,r){var e,s=this;e=JSON.stringify(e);var o=t(s.user+":"+s.pass).toString("base64"),n={host:s.host,path:"/",method:"POST",port:s.port,agent:s.disableAgent?!1:void 0};if(s.httpOptions)for(var i in s.httpOptions)n[i]=s.httpOptions[i];var l=null,c=this.protocol.request(n,function(t){var e="";t.on("data",function(t){e+=t}),t.on("end",function(){if(401==t.statusCode)return void r(new Error("bitcoin JSON-RPC connection rejected: 401 unauthorized"));if(403==t.statusCode)return void r(new Error("bitcoin JSON-RPC connection rejected: 403 forbidden"));if(l)return void r(l);try{var s=JSON.parse(e)}catch(o){return a.err(o.stack),a.err(e),a.err("HTTP Status code:"+t.statusCode),void r(o)}r(s.error,s)})});c.on("error",function(t){var e=new Error("Could not connect to bitcoin via RPC: "+t.message);a.err(e),r(e)}),c.setHeader("Content-Length",e.length),c.setHeader("Content-Type","application/json"),c.setHeader("Authorization","Basic "+o),c.write(e),c.end()}var o=require("soop").imports(),n=o.http||require("http"),i=o.https||require("https"),a=o.log||require("./util/log");e.prototype.batch=function(t,e){this.batchedCalls=[],t(),s.call(this,this.batchedCalls,e),this.batchedCalls=null};var l={addMultiSigAddress:"",addNode:"",backupWallet:"",createMultiSig:"",createRawTransaction:"",decodeRawTransaction:"",dumpPrivKey:"",encryptWallet:"",getAccount:"",getAccountAddress:"str",getAddedNodeInfo:"",getAddressesByAccount:"",getBalance:"str int",getBestBlockHash:"",getBlock:"",getBlockCount:"",getBlockHash:"int",getBlockNumber:"",getBlockTemplate:"",getConnectionCount:"",getDifficulty:"",getGenerate:"",getHashesPerSec:"",getInfo:"",getMemoryPool:"",getMiningInfo:"",getNewAddress:"",getPeerInfo:"",getRawMemPool:"",getRawTransaction:"str int",getReceivedByAccount:"str int",getReceivedByAddress:"str int",getTransaction:"",getTxOut:"str int bool",getTxOutSetInfo:"",getWork:"",help:"",importAddress:"str str bool",importPrivKey:"str str bool",keyPoolRefill:"",listAccounts:"int",listAddressGroupings:"",listReceivedByAccount:"int bool",listReceivedByAddress:"int bool",listSinceBlock:"str int",listTransactions:"str int int",listUnspent:"int int",listLockUnspent:"bool",lockUnspent:"",move:"str str float int str",sendFrom:"str str float int str str",sendMany:"str str int str",sendRawTransaction:"",sendToAddress:"str float str str",setAccount:"",setGenerate:"bool int",setTxFee:"float",signMessage:"",signRawTransaction:"",stop:"",submitBlock:"",validateAddress:"",verifyMessage:"",walletLock:"",walletPassPhrase:"string int",walletPassphraseChange:""},c=function(t,e,r){return Array.prototype.slice.call(t,e,r)};r(e,l,s),module.exports=require("soop")(e)}).call(this,require("buffer").Buffer);
},{"./util/log":"AdF7pF","buffer":75,"http":85,"https":89,"soop":146}],"./RpcClient":[function(require,module,exports){
module.exports=require('Svwrvc');
},{}],"4cPRZZ":[function(require,module,exports){
(function(t){function i(n,r){return"number"!=typeof n?void i.super(this,arguments):(this.data=new t(2+r.length),this.__proto__=this.encodings.binary,this.prefix(15),this.type(n),void this.payload(r))}var n=require("soop").imports(),r=n.parent||require("./util/VersionedData");i.parent=r,r.applyEncodingsTo(i),i.SIN_PERSIST_MAINNET=1,i.SIN_PERSIST_TESTNET=17,i.SIN_EPHEM=2,i.prototype.prefix=function(t){return t||0===t?(this.doAsBinary(function(){this.data.writeUInt8(t,0)}),t):this.as("binary").readUInt8(0)},i.prototype.type=function(t){return t||0===t?(this.doAsBinary(function(){this.data.writeUInt8(t,1)}),t):this.as("binary").readUInt8(1)},i.prototype.payload=function(t){return t?(this.doAsBinary(function(){t.copy(this.data,2)}),t):this.as("binary").slice(1)},i.prototype.validate=function(){this.doAsBinary(function(){if(i.super(this,"validate",arguments),22!=this.data.length)throw new Error("invalid data length")})},module.exports=require("soop")(i)}).call(this,require("buffer").Buffer);
},{"./util/VersionedData":"QLzNQg","buffer":75,"soop":146}],"./SIN":[function(require,module,exports){
module.exports=require('4cPRZZ');
},{}],"7/Dc/8":[function(require,module,exports){
function SINKey(e){"object"!=typeof e&&(e={}),this.created=e.created,this.privKey=e.privKey}var coinUtil=require("./util/util"),timeUtil=require("./util/time"),Key=require("./Key"),SIN=require("./SIN");SINKey.prototype.generate=function(){this.privKey=Key.generateSync(),this.created=timeUtil.curtime()},SINKey.prototype.pubkeyHash=function(){return coinUtil.sha256ripe160(this.privKey.public)},SINKey.prototype.storeObj=function(){var e=this.privKey.public.toString("hex"),t=this.pubkeyHash(),i=new SIN(SIN.SIN_EPHEM,t),r={created:this.created,priv:this.privKey.private.toString("hex"),pub:e,sin:i.toString()};return r},module.exports=require("soop")(SINKey);
},{"./Key":"Af1Gom","./SIN":"4cPRZZ","./util/time":158,"./util/util":"ACyo5H","soop":146}],"./SINKey":[function(require,module,exports){
module.exports=require('7/Dc/8');
},{}],"clx6XL":[function(require,module,exports){
(function(Buffer){function Script(t){this.buffer=t?t:util.EMPTY_BUFFER,this.chunks=[],this.parse()}function isSmallIntOp(t){return t==OP_0||t>=OP_1&&OP_16>=t}function prefixSize(t){return OP_PUSHDATA1>t?1:255>=t?2:65535>=t?3:5}function encodeLen(t){var r=void 0;return OP_PUSHDATA1>t?(r=new Buffer(1),r.writeUInt8(t,0)):255>=t?(r=new Buffer(2),r.writeUInt8(OP_PUSHDATA1,0),r.writeUInt8(t,1)):65535>=t?(r=new Buffer(3),r.writeUInt8(OP_PUSHDATA2,0),r.writeUInt16LE(t,1)):(r=new Buffer(5),r.writeUInt8(OP_PUSHDATA4,0),r.writeUInt32LE(t,1)),r}var imports=require("soop").imports(),config=imports.config||require("./config"),log=imports.log||require("./util/log"),Opcode=imports.Opcode||require("./Opcode"),buffertools=imports.buffertools||require("buffertools");for(var i in Opcode.map)eval(i+" = "+Opcode.map[i]+";");var util=imports.util||require("./util/util"),Parser=imports.Parser||require("./util/BinaryParser"),Put=imports.Put||require("bufferput"),TX_UNKNOWN=0,TX_PUBKEY=1,TX_PUBKEYHASH=2,TX_MULTISIG=3,TX_SCRIPTHASH=4,TX_TYPES=["unknown","pubkey","pubkeyhash","multisig","scripthash"];Script.TX_UNKNOWN=TX_UNKNOWN,Script.TX_PUBKEY=TX_PUBKEY,Script.TX_PUBKEYHASH=TX_PUBKEYHASH,Script.TX_MULTISIG=TX_MULTISIG,Script.TX_SCRIPTHASH=TX_SCRIPTHASH,Script.prototype.parse=function(){this.chunks=[];for(var t=new Parser(this.buffer);!t.eof();){var r,e,i=t.word8();i>0&&OP_PUSHDATA1>i?this.chunks.push(t.buffer(i)):i===OP_PUSHDATA1?(r=t.word8(),e=t.buffer(r),this.chunks.push(e)):i===OP_PUSHDATA2?(r=t.word16le(),e=t.buffer(r),this.chunks.push(e)):i===OP_PUSHDATA4?(r=t.word32le(),e=t.buffer(r),this.chunks.push(e)):this.chunks.push(i)}},Script.prototype.isPushOnly=function(){for(var t=0;t<this.chunks.length;t++){var r=this.chunks[t];if(!Buffer.isBuffer(r)&&r>OP_16)return!1}return!0},Script.prototype.isP2SH=function(){return 3==this.chunks.length&&this.chunks[0]==OP_HASH160&&Buffer.isBuffer(this.chunks[1])&&20==this.chunks[1].length&&this.chunks[2]==OP_EQUAL},Script.prototype.isPubkey=function(){return 2==this.chunks.length&&Buffer.isBuffer(this.chunks[0])&&this.chunks[1]==OP_CHECKSIG},Script.prototype.isPubkeyHash=function(){return 5==this.chunks.length&&this.chunks[0]==OP_DUP&&this.chunks[1]==OP_HASH160&&Buffer.isBuffer(this.chunks[2])&&20==this.chunks[2].length&&this.chunks[3]==OP_EQUALVERIFY&&this.chunks[4]==OP_CHECKSIG},Script.prototype.isMultiSig=function(){return this.chunks.length>3&&isSmallIntOp(this.chunks[0])&&isSmallIntOp(this.chunks[this.chunks.length-2])&&this.chunks[this.chunks.length-1]==OP_CHECKMULTISIG},Script.prototype.finishedMultiSig=function(){for(var t=0,r=0;r<this.chunks.length-1;r++)0!==this.chunks[r]&&t++;var e=this.chunks[this.chunks.length-1],i=new Script(e),n=i.chunks[0]-80;return t==n?!0:!1},Script.prototype.removePlaceHolders=function(){var t=[];for(var r in this.chunks)if(this.chunks.hasOwnProperty(r)){var e=this.chunks[r];0!=e&&t.push(e)}return this.chunks=t,this.updateBuffer(),this},Script.prototype.prependOp0=function(){var t=[0];for(i in this.chunks)this.chunks.hasOwnProperty(i)&&t.push(this.chunks[i]);return this.chunks=t,this.updateBuffer(),this},Script.prototype.classify=function(){return this.isPubkeyHash()?TX_PUBKEYHASH:this.isP2SH()?TX_SCRIPTHASH:this.isMultiSig()?TX_MULTISIG:this.isPubkey()?TX_PUBKEY:TX_UNKNOWN},Script.prototype.capture=function(){var t=this.classify(),r=[];switch(t){case TX_PUBKEY:r.push(this.chunks[0]);break;case TX_PUBKEYHASH:r.push(this.chunks[2]);break;case TX_MULTISIG:for(var e=1;e<this.chunks.length-2;e++)r.push(this.chunks[e]);break;case TX_SCRIPTHASH:r.push(this.chunks[1]);break;case TX_UNKNOWN:}return r},Script.prototype.captureOne=function(){var t=this.capture();return t[0]},Script.prototype.getOutType=function(){var t=this.classify();switch(t){case TX_PUBKEY:return"Pubkey";case TX_PUBKEYHASH:return"Address";default:return"Strange"}},Script.prototype.getRawOutType=function(){return TX_TYPES[this.classify()]},Script.prototype.simpleOutHash=function(){switch(this.getOutType()){case"Address":return this.chunks[2];case"Pubkey":return util.sha256ripe160(this.chunks[0]);default:return log.debug("Encountered non-standard scriptPubKey"),log.debug("Strange script was: "+this.toString()),null}},Script.prototype.getInType=function(){return 1==this.chunks.length?"Pubkey":2==this.chunks.length&&Buffer.isBuffer(this.chunks[0])&&Buffer.isBuffer(this.chunks[1])?"Address":"Strange"},Script.prototype.simpleInPubKey=function(){switch(this.getInType()){case"Address":return this.chunks[1];case"Pubkey":return null;default:return log.debug("Encountered non-standard scriptSig"),log.debug("Strange script was: "+this.toString()),null}},Script.prototype.getBuffer=function(){return this.buffer},Script.prototype.serialize=Script.prototype.getBuffer,Script.prototype.getStringContent=function(t,r){null===t&&(t=!0),"undefined"==typeof r&&(r=15);for(var e="",i=0,n=this.chunks.length;n>i;i++){var u=this.chunks[i];if(i>0&&(e+=" "),e+=Buffer.isBuffer(u)?"0x"+util.formatBuffer(u,t?null:0):Opcode.reverseMap[u],r&&i>r){e+=" ...";break}}return e},Script.prototype.toString=function(t,r){var e="<Script ";return e+=this.getStringContent(t,r),e+=">"},Script.prototype.writeOp=function(t){var r=Buffer(this.buffer.length+1);this.buffer.copy(r),r.writeUInt8(t,this.buffer.length),this.buffer=r,this.chunks.push(t)},Script.prototype.writeN=function(t){if(0>t||t>16)throw new Error("writeN: out of range value "+t);this.writeOp(0==t?OP_0:OP_1+t-1)},Script.prototype.writeBytes=function(t){this.buffer.length+prefixSize(t.length)+t.length;this.buffer=Buffer.concat([this.buffer,encodeLen(t.length),t]),this.chunks.push(t)},Script.prototype.updateBuffer=function(){this.buffer=Script.chunksToBuffer(this.chunks)},Script.prototype.findAndDelete=function(t){var r=!1;if(Buffer.isBuffer(t))for(var e=0,i=this.chunks.length;i>e;e++)Buffer.isBuffer(this.chunks[e])&&0===buffertools.compare(this.chunks[e],t)&&(this.chunks.splice(e,1),e--,r=!0);else{if("number"!=typeof t)throw new Error("Invalid chunk datatype.");for(var e=0,i=this.chunks.length;i>e;e++)this.chunks[e]===t&&(this.chunks.splice(e,1),e--,r=!0)}r&&this.updateBuffer()},Script.createPubKeyOut=function(t){var r=new Script;return r.writeBytes(t),r.writeOp(OP_CHECKSIG),r},Script.createPubKeyHashOut=function(t){var r=new Script;return r.writeOp(OP_DUP),r.writeOp(OP_HASH160),r.writeBytes(t),r.writeOp(OP_EQUALVERIFY),r.writeOp(OP_CHECKSIG),r},Script._sortKeys=function(t){return t.sort(function(t,r){for(var e=t.length>t.length?t.length:r.length,i=0;e>=i;i++){if(void 0===t[i])return-1;if(void 0===r[i])return 1;if(t[i]<r[i])return-1;if(t[i]>r[i])return 1}return 0})},Script.createMultisig=function(t,r,e){e=e||{};var i=e.noSorting?r:this._sortKeys(r),n=new Script;return n.writeN(t),i.forEach(function(t){n.writeBytes(t)}),n.writeN(i.length),n.writeOp(OP_CHECKMULTISIG),n},Script.createP2SH=function(t){var r=new Script;return r.writeOp(OP_HASH160),r.writeBytes(t),r.writeOp(OP_EQUAL),r},Script.fromTestData=function(t){t=t.map(function(t){return"string"==typeof t?new Buffer(t,"hex"):t});var r=new Script;return r.chunks=t,r.updateBuffer(),r},Script.fromChunks=function(t){var r=new Script;return r.chunks=t,r.updateBuffer(),r},Script.fromHumanReadable=function(t){return new Script(Script.stringToBuffer(t))},Script.prototype.toHumanReadable=function(){for(var t="",r=0,e=this.chunks.length;e>r;r++){var i=this.chunks[r];if(r>0&&(t+=" "),Buffer.isBuffer(i))0===i.length?t+="0":(t+="0x"+util.formatBuffer(encodeLen(i.length),0)+" ",t+="0x"+util.formatBuffer(i,0));else{var n=Opcode.reverseMap[i];"undefined"==typeof n&&(n="0x"+i.toString(16)),t+=n}}return t},Script.prototype.countMissingSignatures=function(){var t=0;if(Buffer.isBuffer(this.chunks[0])||0!==this.chunks[0])0===buffertools.compare(this.getBuffer(),util.EMPTY_BUFFER)&&(t=1);else for(var r=1;r<this.chunks.length;r++)(0===this.chunks[r]||0===buffertools.compare(this.chunks[r],util.EMPTY_BUFFER))&&t++;return t},Script.stringToBuffer=function(t){for(var r=new Put,e=t.split(" "),i=0;i<e.length;i++){var n=e[i];if(""!==n)if(n.length>2&&"0x"===n.substring(0,2))r.put(new Buffer(n.substring(2,n.length),"hex"));else{var u=Opcode.map["OP_"+n]||Opcode.map[n];if("undefined"!=typeof u)r.word8(u);else{var s=parseInt(n);if(isNaN(s)){if("'"!==n[0]||"'"!==n[n.length-1])throw new Error('Could not parse word "'+n+'" from script "'+t+'"');n=n.substring(1,n.length-1);for(var h="",f=0;f<n.length;f++)h+=""+n.charCodeAt(f).toString(16);r.put(Script.chunksToBuffer([new Buffer(n)]))}else{var c=util.intToBufferSM(s);r.put(Script.chunksToBuffer([c]))}}}}return r.buffer()},Script.chunksToBuffer=function(t){for(var r=new Put,e=0,i=t.length;i>e;e++){var n=t[e];if(Buffer.isBuffer(n))n.length<OP_PUSHDATA1?r.word8(n.length):n.length<=255?(r.word8(OP_PUSHDATA1),r.word8(n.length)):n.length<=65535?(r.word8(OP_PUSHDATA2),r.word16le(n.length)):(r.word8(OP_PUSHDATA4),r.word32le(n.length)),r.put(n);else{if("number"!=typeof n)throw new Error("Script.chunksToBuffer(): Invalid chunk datatype");r.word8(n)}}return r.buffer()},module.exports=require("soop")(Script)}).call(this,require("buffer").Buffer);
},{"./Opcode":"zHwnes","./config":"4itQ50","./util/BinaryParser":"b3ZSD7","./util/log":"AdF7pF","./util/util":"ACyo5H","buffer":75,"bufferput":"aXRuS6","buffertools":"fugeBw","soop":146}],"./Script":[function(require,module,exports){
module.exports=require('clx6XL');
},{}],"./ScriptInterpreter":[function(require,module,exports){
module.exports=require('2heyj2');
},{}],"2heyj2":[function(require,module,exports){
(function(process,Buffer){function ScriptInterpreter(t){this.opts=t||{},this.stack=[],this.disableUnsafeOpcodes=!0}var imports=require("soop").imports(),config=imports.config||require("./config"),log=imports.log||require("./util/log"),util=imports.util||require("./util/util"),Opcode=imports.Opcode||require("./Opcode"),buffertools=imports.buffertools||require("buffertools"),bignum=imports.bignum||require("bignum"),Util=imports.Util||require("./util/util"),Script=require("./Script"),Key=require("./Key"),SIGHASH_ALL=1,SIGHASH_NONE=2,SIGHASH_SINGLE=3,SIGHASH_ANYONECANPAY=80;for(var i in Opcode.map)eval(i+" = "+Opcode.map[i]+";");var intToBufferSM=Util.intToBufferSM,bufferSMToInt=Util.bufferSMToInt;ScriptInterpreter.prototype.eval=function(t,e,r,s,a){function i(a){function u(){if(D&&M>0){var t=F[G],c=B[V];checkSig(t,c,H,e,r,s,function(t,e){!t&&e?(G++,M--):(V++,y--,M>y&&(D=!1)),u.call(this)}.bind(this))}else{if(this.stack.push(new Buffer([D?1:0])),P===OP_CHECKMULTISIGVERIFY){if(!D)throw new Error("OP_CHECKMULTISIGVERIFY negative");this.stackPop()}i.call(this,a)}}try{if(c>=t.chunks.length)return o.length?void a(new Error("Execution stack ended non-empty")):void a(null);var O=!~o.indexOf(!1),P=t.chunks[c++];if(P.length>520)throw new Error("Max push value size exceeded (>520)");if(P>OP_16&&++p>201)throw new Error("Opcode limit exceeded (>200)");if(this.disableUnsafeOpcodes&&"number"==typeof P&&(P===OP_CAT||P===OP_SUBSTR||P===OP_LEFT||P===OP_RIGHT||P===OP_INVERT||P===OP_AND||P===OP_OR||P===OP_XOR||P===OP_2MUL||P===OP_2DIV||P===OP_MUL||P===OP_DIV||P===OP_MOD||P===OP_LSHIFT||P===OP_RSHIFT))throw new Error("Encountered a disabled opcode");if(O&&Buffer.isBuffer(P))this.stack.push(P);else if(O||P>=OP_IF&&OP_ENDIF>=P)switch(P){case OP_0:this.stack.push(new Buffer([]));break;case OP_1NEGATE:case OP_1:case OP_2:case OP_3:case OP_4:case OP_5:case OP_6:case OP_7:case OP_8:case OP_9:case OP_10:case OP_11:case OP_12:case OP_13:case OP_14:case OP_15:case OP_16:var f=P-OP_1+1,k=intToBufferSM(f);this.stack.push(k);break;case OP_NOP:case OP_NOP1:case OP_NOP2:case OP_NOP3:case OP_NOP4:case OP_NOP5:case OP_NOP6:case OP_NOP7:case OP_NOP8:case OP_NOP9:case OP_NOP10:break;case OP_IF:case OP_NOTIF:var l=!1;O&&(l=castBool(this.stackPop()),P===OP_NOTIF&&(l=!l)),o.push(l);break;case OP_ELSE:if(o.length<1)throw new Error("Unmatched OP_ELSE");o[o.length-1]=!o[o.length-1];break;case OP_ENDIF:if(o.length<1)throw new Error("Unmatched OP_ENDIF");o.pop();break;case OP_VERIFY:var l=castBool(this.stackTop());if(!l)throw new Error("OP_VERIFY negative");this.stackPop();break;case OP_RETURN:throw new Error("OP_RETURN");case OP_TOALTSTACK:n.push(this.stackPop());break;case OP_FROMALTSTACK:if(n.length<1)throw new Error("OP_FROMALTSTACK with alt stack empty");this.stack.push(n.pop());break;case OP_2DROP:this.stackPop(),this.stackPop();break;case OP_2DUP:var _=this.stackTop(2),S=this.stackTop(1);this.stack.push(_),this.stack.push(S);break;case OP_3DUP:var _=this.stackTop(3),S=this.stackTop(2),E=this.stackTop(1);this.stack.push(_),this.stack.push(S),this.stack.push(E);break;case OP_2OVER:var _=this.stackTop(4),S=this.stackTop(3);this.stack.push(_),this.stack.push(S);break;case OP_2ROT:var _=this.stackTop(6),S=this.stackTop(5);this.stack.splice(this.stack.length-6,2),this.stack.push(_),this.stack.push(S);break;case OP_2SWAP:this.stackSwap(4,2),this.stackSwap(3,1);break;case OP_IFDUP:var l=this.stackTop();castBool(l)&&this.stack.push(l);break;case OP_DEPTH:var l=bignum(this.stack.length);this.stack.push(intToBufferSM(l));break;case OP_DROP:this.stackPop();break;case OP_DUP:this.stack.push(this.stackTop());break;case OP_NIP:if(this.stack.length<2)throw new Error("OP_NIP insufficient stack size");this.stack.splice(this.stack.length-2,1);break;case OP_OVER:this.stack.push(this.stackTop(2));break;case OP_PICK:case OP_ROLL:var w=castInt(this.stackPop());if(0>w||w>=this.stack.length)throw new Error("OP_PICK/OP_ROLL insufficient stack size");var l=this.stackTop(w+1);P===OP_ROLL&&this.stack.splice(this.stack.length-w-1,1),this.stack.push(l);break;case OP_ROT:this.stackSwap(3,2),this.stackSwap(2,1);break;case OP_SWAP:this.stackSwap(2,1);break;case OP_TUCK:if(this.stack.length<2)throw new Error("OP_TUCK insufficient stack size");this.stack.splice(this.stack.length-2,0,this.stackTop());break;case OP_CAT:var _=this.stackTop(2),S=this.stackTop(1);this.stackPop(),this.stackPop(),this.stack.push(Buffer.concat([_,S]));break;case OP_SUBSTR:var g=this.stackTop(3),v=castInt(this.stackTop(2)),T=castInt(this.stackTop(1));if(0>v||0>T)throw new Error("OP_SUBSTR start < 0 or len < 0");if(v+T>=g.length)throw new Error("OP_SUBSTR range out of bounds");this.stackPop(),this.stackPop(),this.stack[this.stack.length-1]=g.slice(v,v+T);break;case OP_LEFT:case OP_RIGHT:var g=this.stackTop(2),I=castInt(this.stackTop(1));if(0>I)throw new Error("OP_LEFT/OP_RIGHT size < 0");I>g.length&&(I=g.length),this.stackPop(),this.stack[this.stack.length-1]=P===OP_LEFT?g.slice(0,I):g.slice(g.length-I);break;case OP_SIZE:var l=bignum(this.stackTop().length);this.stack.push(intToBufferSM(l));break;case OP_INVERT:for(var g=this.stackTop(),b=0,d=g.length;d>b;b++)g[b]=~g[b];break;case OP_AND:case OP_OR:case OP_XOR:var _=this.stackTop(2),S=this.stackTop(1);this.stackPop(),this.stackPop();var A=new Buffer(Math.max(_.length,S.length));if(P===OP_AND)for(var b=0,d=A.length;d>b;b++)A[b]=_[b]&S[b];else if(P===OP_OR)for(var b=0,d=A.length;d>b;b++)A[b]=_[b]|S[b];else if(P===OP_XOR)for(var b=0,d=A.length;d>b;b++)A[b]=_[b]^S[b];this.stack.push(A);break;case OP_EQUAL:case OP_EQUALVERIFY:var _=this.stackTop(2),S=this.stackTop(1),l=0===buffertools.compare(_,S);if(this.stackPop(),this.stackPop(),this.stack.push(new Buffer([l?1:0])),P===OP_EQUALVERIFY){if(!l)throw new Error("OP_EQUALVERIFY negative");this.stackPop()}break;case OP_1ADD:case OP_1SUB:case OP_2MUL:case OP_2DIV:case OP_NEGATE:case OP_ABS:case OP_NOT:case OP_0NOTEQUAL:var N=bufferSMToInt(this.stackTop());switch(P){case OP_1ADD:N=N.add(bignum(1));break;case OP_1SUB:N=N.sub(bignum(1));break;case OP_2MUL:N=N.mul(bignum(2));break;case OP_2DIV:N=N.div(bignum(2));break;case OP_NEGATE:N=N.neg();break;case OP_ABS:N=N.abs();break;case OP_NOT:N=bignum(0==N.cmp(0)?1:0);break;case OP_0NOTEQUAL:N=bignum(0==N.cmp(0)?0:1)}this.stack[this.stack.length-1]=intToBufferSM(N);break;case OP_ADD:case OP_SUB:case OP_MUL:case OP_DIV:case OP_MOD:case OP_LSHIFT:case OP_RSHIFT:case OP_BOOLAND:case OP_BOOLOR:case OP_NUMEQUAL:case OP_NUMEQUALVERIFY:case OP_NUMNOTEQUAL:case OP_LESSTHAN:case OP_GREATERTHAN:case OP_LESSTHANOREQUAL:case OP_GREATERTHANOREQUAL:case OP_MIN:case OP_MAX:var N,_=bufferSMToInt(this.stackTop(2)),S=bufferSMToInt(this.stackTop(1));switch(P){case OP_ADD:N=_.add(S);break;case OP_SUB:N=_.sub(S);break;case OP_MUL:N=_.mul(S);break;case OP_DIV:N=_.div(S);break;case OP_MOD:N=_.mod(S);break;case OP_LSHIFT:if(S.cmp(0)<0||S.cmp(2048)>0)throw new Error("OP_LSHIFT parameter out of bounds");N=_.shiftLeft(S);break;case OP_RSHIFT:if(S.cmp(0)<0||S.cmp(2048)>0)throw new Error("OP_RSHIFT parameter out of bounds");N=_.shiftRight(S);break;case OP_BOOLAND:N=bignum(0!=_.cmp(0)&&0!=S.cmp(0)?1:0);break;case OP_BOOLOR:N=bignum(0!=_.cmp(0)||0!=S.cmp(0)?1:0);break;case OP_NUMEQUAL:case OP_NUMEQUALVERIFY:N=bignum(0==_.cmp(S)?1:0);break;case OP_NUMNOTEQUAL:N=bignum(0!=_.cmp(S)?1:0);break;case OP_LESSTHAN:N=bignum(_.lt(S)?1:0);break;case OP_GREATERTHAN:N=bignum(_.gt(S)?1:0);break;case OP_LESSTHANOREQUAL:N=bignum(_.gt(S)?0:1);break;case OP_GREATERTHANOREQUAL:N=bignum(_.lt(S)?0:1);break;case OP_MIN:N=_.lt(S)?_:S;break;case OP_MAX:N=_.gt(S)?_:S}if(this.stackPop(),this.stackPop(),this.stack.push(intToBufferSM(N)),P===OP_NUMEQUALVERIFY){if(!castBool(this.stackTop()))throw new Error("OP_NUMEQUALVERIFY negative");this.stackPop()}break;case OP_WITHIN:var _=bufferSMToInt(this.stackTop(3)),S=bufferSMToInt(this.stackTop(2)),E=bufferSMToInt(this.stackTop(1));this.stackPop(),this.stackPop(),this.stackPop();var l=_.cmp(S)>=0&&_.cmp(E)<0;this.stack.push(intToBufferSM(l?1:0));break;case OP_RIPEMD160:case OP_SHA1:case OP_SHA256:case OP_HASH160:case OP_HASH256:var m,l=this.stackPop();P===OP_RIPEMD160?m=Util.ripe160(l):P===OP_SHA1?m=Util.sha1(l):P===OP_SHA256?m=Util.sha256(l):P===OP_HASH160?m=Util.sha256ripe160(l):P===OP_HASH256&&(m=Util.twoSha256(l)),this.stack.push(m);break;case OP_CODESEPARATOR:h=c;break;case OP_CHECKSIG:case OP_CHECKSIGVERIFY:var R=this.stackTop(2),U=this.stackTop(1),L=t.chunks.slice(h),H=Script.fromChunks(L);return H.findAndDelete(R),this.isCanonicalSignature(new Buffer(R)),void checkSig(R,U,H,e,r,s,function(t,e){var r;if(r=t?!1:e,this.stackPop(),this.stackPop(),this.stack.push(new Buffer([r?1:0])),P===OP_CHECKSIGVERIFY){if(!r)throw new Error("OP_CHECKSIGVERIFY negative");this.stackPop()}i.call(this,a)}.bind(this));case OP_CHECKMULTISIG:case OP_CHECKMULTISIGVERIFY:var y=castInt(this.stackPop());if(0>y||y>20)throw new Error("OP_CHECKMULTISIG keysCount out of bounds");if(p+=y,p>201)throw new Error("Opcode limit exceeded (>200)");for(var B=[],b=0,d=y;d>b;b++){var U=this.stackPop();B.push(U)}var M=castInt(this.stackPop());if(0>M||M>y)throw new Error("OP_CHECKMULTISIG sigsCount out of bounds");for(var F=[],b=0,d=M;d>b;b++)F.push(this.stackPop());this.stackPop();var L=t.chunks.slice(h),H=Script.fromChunks(L),C=this;F.forEach(function(t){C.isCanonicalSignature(new Buffer(t)),H.findAndDelete(t)});var D=!0,G=0,V=0;return void u.call(this);default:throw new Error("Unknown opcode encountered")}if(this.stack.length+n.length>1e3)throw new Error("Maximum stack size exceeded");i.call(this,a)}catch(K){a(K)}}if("function"!=typeof a)throw new Error("ScriptInterpreter.eval() requires a callback");var c=0,o=[],n=[],h=0,p=0;return t.buffer.length>1e4?(a(new Error("Oversized script (> 10k bytes)")),this):void i.call(this,a)},ScriptInterpreter.prototype.evalTwo=function(t,e,r,s,a,i){var c=this;c.eval(t,r,s,a,function(t){return t?void i(t):void c.eval(e,r,s,a,i)})},ScriptInterpreter.prototype.stackTop=function(t){if(t=+t||1,1>t&&(t=1),t>this.stack.length)throw new Error("ScriptInterpreter.stackTop(): Stack underrun");return this.stack[this.stack.length-t]},ScriptInterpreter.prototype.stackBack=function(){return this.stack[this.stack.length-1]},ScriptInterpreter.prototype.stackPop=function(){if(this.stack.length<1)throw new Error("ScriptInterpreter.stackTop(): Stack underrun");return this.stack.pop()},ScriptInterpreter.prototype.stackSwap=function(t,e){if(this.stack.length<t||this.stack.length<e)throw new Error("ScriptInterpreter.stackTop(): Stack underrun");var r=this.stack,s=r.length,a=r[s-t];r[s-t]=r[s-e],r[s-e]=a},ScriptInterpreter.prototype.getPrimitiveStack=function(){return this.stack.map(function(t){if(t.length>2)return buffertools.toHex(t.slice(0));var e=bufferSMToInt(t);return e.cmp(-128)>=0&&e.cmp(127)<=0?e.toNumber():buffertools.toHex(t.slice(0))})};var castBool=ScriptInterpreter.castBool=function(t){for(var e=0,r=t.length;r>e;e++)if(0!=t[e])return e==r-1&&128==t[e]?!1:!0;return!1},castInt=ScriptInterpreter.castInt=function(t){return bufferSMToInt(t).toNumber()};ScriptInterpreter.prototype.getResult=function(){if(0===this.stack.length)throw new Error("Empty stack after script evaluation");return castBool(this.stack[this.stack.length-1])},ScriptInterpreter.verify=function(t,e,r,s,a,i){if("function"!=typeof i)throw new Error("ScriptInterpreter.verify() requires a callback");var c=new ScriptInterpreter;return c.evalTwo(t,e,r,s,a,function(t){if(t)return void i(t);var e=c.getResult();i(null,e)}),c},ScriptInterpreter.prototype.verifyStep4=function(t,e){return 0==e.stack.length?void t(null,!1):void t(null,castBool(e.stackBack()))},ScriptInterpreter.prototype.verifyStep3=function(t,e,r,s,a,i,c){if(0===this.stack.length)return void i(null,!1);if(0==castBool(this.stackBack()))return void i(null,!1);if(!this.opts.verifyP2SH||!e.isP2SH())return void i(null,!0);if(!t.isPushOnly())return void i(null,!1);if(0===c.length)throw new Error("siCopy should have length != 0");var o=new Script(c.stackPop()),n=this;c.eval(o,r,s,a,function(t){return t?i(t):void n.verifyStep4(i,c)})},ScriptInterpreter.prototype.verifyStep2=function(t,e,r,s,a,i,c){var c;this.opts.verifyP2SH&&(c=new ScriptInterpreter(this.opts),this.stack.forEach(function(t){c.stack.push(t)}));var o=this;this.eval(e,r,s,a,function(n){return n?i(n):void o.verifyStep3(t,e,r,s,a,i,c)})},ScriptInterpreter.prototype.verifyFull=function(t,e,r,s,a,i){var c=this;this.eval(t,r,s,a,function(o){return o?i(o):void c.verifyStep2(t,e,r,s,a,i)})},ScriptInterpreter.verifyFull=function(t,e,r,s,a,i,c){var o=new ScriptInterpreter(i);o.verifyFull(t,e,r,s,a,c)};var checkSig=ScriptInterpreter.checkSig=function(t,e,r,s,a,i,c){if(!t.length)return void c(null,!1);if(0===i)i=t[t.length-1];else if(i!=t[t.length-1])return void c(null,!1);t=t.slice(0,t.length-1);var o=s.hashForSignature(r,a,i),n=new Key;0===e.length&&(e=new Buffer("00","hex")),n.public=e,n.verifySignature(o,t,c)};ScriptInterpreter.prototype.isCanonicalSignature=function(t){if(!Buffer.isBuffer(t))throw new Error("arg should be a Buffer");if(this.opts.dontVerifyStrictEnc)return!0;var e=t.length;if(9>e)throw new Error("Non-canonical signature: too short");if(e>73)throw new Error("Non-canonical signature: too long");var r=t[e-1]&~SIGHASH_ANYONECANPAY;if(SIGHASH_ALL>r||r>SIGHASH_SINGLE)throw new Error("Non-canonical signature: unknown hashtype byte");if(48!==t[0])throw new Error("Non-canonical signature: wrong type");if(t[1]!==e-3)throw new Error("Non-canonical signature: wrong length marker");var s=t[3];if(5+s>=e)throw new Error("Non-canonical signature: S length misplaced");var a=t[5+s];if(s+a+7!==e)throw new Error("Non-canonical signature: R+S length mismatch");var i=4,c=new Buffer(s);if(t.copy(c,0,i,i+s),2!==t[i-2])throw new Error("Non-canonical signature: R value type mismatch");if(0==s)throw new Error("Non-canonical signature: R length is zero");if(128&c[0])throw new Error("Non-canonical signature: R value negative");if(s>1&&0==c[0]&&!(128&c[1]))throw new Error("Non-canonical signature: R value excessively padded");var o=6+s,n=new Buffer(a);if(t.copy(n,0,o,o+a),2!=t[o-2])throw new Error("Non-canonical signature: S value type mismatch");if(0==a)throw new Error("Non-canonical signature: S length is zero");if(128&n[0])throw new Error("Non-canonical signature: S value negative");if(a>1&&0==n[0]&&!(128&n[1]))throw new Error("Non-canonical signature: S value excessively padded");if(this.opts.verifyEvenS&&1&n[a-1])throw new Error("Non-canonical signature: S value odd");return!0},module.exports=require("soop")(ScriptInterpreter)}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),require("buffer").Buffer);
},{"./Key":"Af1Gom","./Opcode":"zHwnes","./Script":"clx6XL","./config":"4itQ50","./util/log":"AdF7pF","./util/util":"ACyo5H","/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91,"bignum":"J4nwo8","buffer":75,"buffertools":"fugeBw","soop":146}],"./Sign":[function(require,module,exports){
module.exports=require('xzKFX3');
},{}],"xzKFX3":[function(require,module,exports){
(function(r){function e(e,n,t){var i=t[n],s=new r(i.priv,"hex"),o=new KeyModule.Key;o.private=s;var a=o.signSync(e);return a}function n(n,t,i,s,o,a){var u=t.ins[n],h=u.getScript(),w=u.getOutpointHash();if(!(w in i))throw new Error("signTxIn missing input hash");var c=i[w],d=u.getOutpointIndex();if(c.outs.length>=d)throw new Error("signTxIn missing input index");var f=c.outs[d],p=f.getScript(),g=p.classify();if(g==TX_UNKNOWN)throw new Error("unknown TX type");var v=p.capture(),k=void 0,y=void 0,l=void 0,S=void 0;if(g==TX_SCRIPTHASH){var T=new Address(s.P2SHVersion,v[0]),E=T.toString();if(!(E in a))throw new Error("unknown script hash address");if(k=new r(a[E],"hex"),y=new Script(k),l=y.classify(),l==TX_UNKNOWN)throw new Error("unknown subscript TX type");S=y.capture()}var B=t.hashForSignature(p,X,0);switch(g){case TX_PUBKEY:if(h.chunks.length>0)return;var b=util.sha256ripe160(v[0]),T=new Address(s.addressVersion,b),E=T.toString();if(!(E in o))throw new Error("unknown pubkey");var H=e(B,E,o);h.writeBytes(H);break;case TX_PUBKEYHASH:if(h.chunks.length>0)return;var T=new Address(s.addressVersion,v[0]),E=T.toString();if(!(E in o))throw new Error("unknown pubkey hash address");var H=e(B,E,o);h.writeBytes(H),h.writeBytes(key.public);break;case TX_SCRIPTHASH:if(h.chunks.length>0)return;var T=new Address(s.addressVersion,S[0]),E=T.toString();if(!(E in o))throw new Error("unknown script(pubkey hash) address");var H=e(B,E,o);h.writeBytes(H),h.writeBytes(key.public);break;case TX_MULTISIG:for(;h.chunks.length<v.length;)h.writeBytes(util.EMPTY_BUFFER);for(var X=0;X<v.length;X++)if(!(h.chunks[X].length>0)){var b=util.sha256ripe160(h.chunks[X]),T=new Address(s.addressVersion,b),E=T.toString();if(E in o){var H=e(B,E,o);h.chunks[X]=H}}}txtype==TX_SCRIPTHASH&&h.writeBytes(k)}exports.Transaction=function(r,e,t,i,s){for(var o=0;o<r.ins.length;o++)n(o,r,e,t,i,s)}}).call(this,require("buffer").Buffer);
},{"buffer":75}],"./Transaction":[function(require,module,exports){
module.exports=require('RNv6Te');
},{}],"RNv6Te":[function(require,module,exports){
(function(t){function e(e){if("object"!=typeof e&&(e={}),e.o)this.o=e.o;else if(e.oTxHash&&"undefined"!=typeof e.oIndex&&e.oIndex>=0){var i=new t(e.oTxHash,"hex");i=c.reverse(i);var s=new t(4);s.writeUInt32LE(e.oIndex,0),this.o=t.concat([i,s])}this.s=t.isBuffer(e.s)?e.s:t.isBuffer(e.script)?e.script:u.EMPTY_BUFFER,this.q=e.q?e.q:e.sequence}function i(t){"object"!=typeof t&&(t={}),this.v=t.v?t.v:t.value,this.s=t.s?t.s:t.script}function s(t){"object"!=typeof t&&(t={}),this.hash=t.hash||null,this.version=t.version,this.lock_time=t.lock_time,this.ins=Array.isArray(t.ins)?t.ins.map(function(t){var i=new e;return i.s=t.s,i.q=t.q,i.o=t.o,i}):[],this.outs=Array.isArray(t.outs)?t.outs.map(function(t){var e=new i;return e.v=t.v,e.s=t.s,e}):[],t.buffer&&(this._buffer=t.buffer)}{var r=require("soop").imports(),n=(r.config||require("./config"),r.log||require("./util/log"),r.Address||require("./Address")),o=r.Script||require("./Script"),h=r.ScriptInterpreter||require("./ScriptInterpreter"),u=r.util||require("./util/util"),a=r.bignum||require("bignum"),f=r.Put||require("bufferput"),p=r.Parser||require("./util/BinaryParser"),c=(r.Step||require("step"),r.buffertools||require("buffertools")),l=(r.error||require("./util/error"),r.networks||require("./networks"),r.WalletKey||require("./WalletKey"),r.PrivateKey||require("./PrivateKey"),t.concat([u.NULL_HASH,new t("FFFFFFFF","hex")]));parseInt(1e-4*u.COIN)}s.COINBASE_OP=l,e.MAX_SEQUENCE=4294967295,e.prototype.getScript=function(){return new o(this.s)},e.prototype.isCoinBase=function(){return this.o?0===c.compare(new t(this.o),l):!1},e.prototype.serialize=function(){var e=u.varIntBuf(this.s.length),i=new t(4);i.writeUInt32LE(this.q,0);var s=t.concat([this.o,e,this.s,i]);return s},e.prototype.getOutpointHash=function(){return"undefined"!=typeof this.o.outHashCache?this.o.outHashCache:this.o.outHashCache=this.o.slice(0,32)},e.prototype.getOutpointIndex=function(){return this.o[32]+(this.o[33]<<8)+(this.o[34]<<16)+(this.o[35]<<24)},e.prototype.setOutpointIndex=function(t){this.o[32]=255&t,this.o[33]=t>>8&255,this.o[34]=t>>16&255,this.o[35]=t>>24&255},i.prototype.getValue=function(){return new p(this.v).word64lu()},i.prototype.getScript=function(){return new o(this.s)},i.prototype.serialize=function(){var e=u.varIntBuf(this.s.length);return t.concat([this.v,e,this.s])},s.In=e,s.Out=i,s.prototype.isCoinBase=function(){return 1==this.ins.length&&this.ins[0].isCoinBase()},s.prototype.isStandard=function(){var t;for(t=0;t<this.ins.length;t++)if("Strange"==this.ins[t].getScript().getInType())return!1;for(t=0;t<this.outs.length;t++)if("Strange"==this.outs[t].getScript().getOutType())return!1;return!0},s.prototype.serialize=function(){var e=[],i=new t(4);i.writeUInt32LE(this.version,0),e.push(i),e.push(u.varIntBuf(this.ins.length)),this.ins.forEach(function(t){e.push(t.serialize())}),e.push(u.varIntBuf(this.outs.length)),this.outs.forEach(function(t){e.push(t.serialize())});var i=new t(4);return i.writeUInt32LE(this.lock_time,0),e.push(i),this._buffer=t.concat(e),this._buffer},s.prototype.getBuffer=function(){return this._buffer?this._buffer:this.serialize()},s.prototype.calcHash=function(){return this.hash=u.twoSha256(this.getBuffer()),this.hash},s.prototype.checkHash=function(){return this.hash&&this.hash.length?0===c.compare(this.calcHash(),this.hash):!1},s.prototype.getHash=function(){return this.hash&&this.hash.length||(this.hash=this.calcHash()),this.hash},s.prototype.calcNormalizedHash=function(){return this.normalizedHash=this.hashForSignature(new o,0,g),this.normalizedHash},s.prototype.getNormalizedHash=function(){return this.normalizedHash&&this.normalizedHash.length||(this.normalizedHash=this.calcNormalizedHash()),this.normalizedHash},s.prototype.inputs=function(){for(var t=[],e=0;e<this.ins.length;e++){var i=this.ins[e],s=i.getOutpointHash(),r=i.getOutpointIndex();t.push([s,r])}return t},s.prototype.verifyInput=function(t,e,i,s){var r=this.ins[t].getScript();return h.verifyFull(r,e,this,t,0,i,s)},s.prototype.getAffectedKeys=function(t){if(!this.affects||!this.affects.length){this.affects=[];for(var e=0,i=this.outs.length;i>e;e++){var s=this.outs[e],r=s.getScript(),n=r.simpleOutPubKeyHash();n&&this.affects.push(n)}for(var o=t.txIndex,e=0,i=this.ins.length;i>e;e++){var h=this.ins[e];if(!h.isCoinBase()){var u=h.getOutpointHash(),a=h.getOutpointIndex(),f=u.toString("base64"),p=o[f];if(!p)throw new Error("Input not found!");var s=p[a],r=s.getScript(),n=r.simpleOutPubKeyHash();n&&this.affects.push(n)}}}var c={};return this.affects.forEach(function(t){c[t.toString("base64")]=t}),c};var v=171,g=1,y=2,I=3,S=128;s.SIGHASH_ALL=g,s.SIGHASH_NONE=y,s.SIGHASH_SINGLE=I,s.SIGHASH_ANYONECANPAY=S;var b=function(t,e,i,s){this.txTo=t,this.scriptCode=e,this.nIn=i,this.anyoneCanPay=!!(s&S);var r=31&s;this.hashSingle=r===I,this.hashNone=r===y,this.bytes=new f};b.prototype.serializeOutput=function(t){if(this.hashSingle&&t!=this.nIn)this.bytes.put(u.INT64_MAX),this.bytes.varint(0);else{var e=this.txTo.outs[t];this.bytes.put(e.v),this.bytes.varint(e.s.length),this.bytes.put(e.s)}},b.prototype.serializeScriptCode=function(){this.scriptCode.findAndDelete(v),this.bytes.varint(this.scriptCode.buffer.length),this.bytes.put(this.scriptCode.buffer)},b.prototype.serializeInput=function(t){this.anyoneCanPay&&(t=this.nIn),this.bytes.put(this.txTo.ins[t].o),t!==this.nIn?this.bytes.varint(0):this.serializeScriptCode(),this.bytes.word32le(t!==this.nIn&&(this.hashSingle||this.hashNone)?0:this.txTo.ins[t].q)},b.prototype.serialize=function(){this.bytes.word32le(this.txTo.version);var t=this.anyoneCanPay?1:this.txTo.ins.length;this.bytes.varint(t);for(var e=0;t>e;e++)this.serializeInput(e);var i=this.hashNone?0:this.hashSingle?this.nIn+1:this.txTo.outs.length;this.bytes.varint(i);for(var s=0;i>s;s++)this.serializeOutput(s);this.bytes.word32le(this.txTo.lock_time)},b.prototype.buffer=function(){return this.serialize(),this.bytes.buffer()},s.Serializer=b;var d=function(){var e=new t(32);e.writeUInt8(1,0);for(var i=1;32>i;i++)e.writeUInt8(0,i);return e};s.prototype.hashForSignature=function(e,i,s){if(+i!==i||0>i||i>=this.ins.length)return d();var r=31&s;if(r===I&&i>=this.outs.length)return d();var n=new b(this,e,i,s),o=n.buffer(),h=(new f).word32le(s).buffer();return o=t.concat([o,h]),u.twoSha256(o)},s.prototype.getStandardizedObject=function(){var e={hash:u.formatHashFull(this.getHash()),version:this.version,lock_time:this.lock_time},i=8;i+=u.getVarIntSize(this.ins.length);var s=this.ins.map(function(e){var s={prev_out:{hash:c.reverse(new t(e.getOutpointHash())).toString("hex"),n:e.getOutpointIndex()},sequence:e.q};return e.isCoinBase()?s.coinbase=e.s.toString("hex"):s.scriptSig=new o(e.s).getStringContent(!1,0),i+=36+u.getVarIntSize(e.s.length)+e.s.length+4,s});i+=u.getVarIntSize(this.outs.length);var r=this.outs.map(function(t){return i+=u.getVarIntSize(t.s.length)+t.s.length+8,{value:u.formatValue(t.v),scriptPubKey:new o(t.s).getStringContent(!1,0)}});return e.size=i,e["in"]=s,e.out=r,e},s.prototype.toObject=function(){return this},s.prototype.fromObj=function(s){var r={};r.version=s.version||1,r.lock_time=s.lock_time||0,r.ins=[],r.outs=[],s.inputs.forEach(function(i){var s=new e;s.s=u.EMPTY_BUFFER,s.q=4294967295;var n=new t(i.txid,"hex");n=c.reverse(n);var o=parseInt(i.vout),h=new t(4);h.writeUInt32LE(o,0),s.o=t.concat([n,h]),r.ins.push(s)});var h=Object.keys(s.outputs);h.forEach(function(t){var e=new n(t),h=o.createPubKeyHashOut(e.payload()),f=a(s.outputs[t]),p=u.bigIntToValue(f),c=new i;c.v=p,c.s=h.getBuffer(),r.outs.push(c)}),this.lock_time=r.lock_time,this.version=r.version,this.ins=r.ins,this.outs=r.outs},s.prototype.parse=function(s){t.isBuffer(s)&&(this._buffer=s,s=new p(s));{var r;s.pos}this.version=s.word32le();var n=s.varInt();for(this.ins=[],j=0;n>j;j++){var o=new e;o.o=s.buffer(36),r=s.varInt(),o.s=s.buffer(r),o.q=s.word32le(),this.ins.push(o)}var h=s.varInt();for(this.outs=[],j=0;h>j;j++){var u=new i;u.v=s.buffer(8),r=s.varInt(),u.s=s.buffer(r),this.outs.push(u)}this.lock_time=s.word32le(),this.calcHash()},s.prototype.calcSize=function(){var t=8;return t+=u.getVarIntSize(this.ins.length),this.ins.forEach(function(e){t+=36+u.getVarIntSize(e.s.length)+e.s.length+4}),t+=u.getVarIntSize(this.outs.length),this.outs.forEach(function(e){t+=u.getVarIntSize(e.s.length)+e.s.length+8}),this.size=t,t},s.prototype.getSize=function(){return this.size||(this.size=this.calcSize()),this.size},s.prototype.countInputMissingSignatures=function(t){var e=new o(this.ins[t].s);return e.countMissingSignatures()},s.prototype.isInputComplete=function(t){return 0===this.countInputMissingSignatures(t)},s.prototype.isComplete=function(){for(var t=!0,e=this.ins.length,i=0;e>i;i++)if(!this.isInputComplete(i)){t=!1;break}return t},module.exports=require("soop")(s)}).call(this,require("buffer").Buffer);
},{"./Address":"5EBmBp","./PrivateKey":"+A60Qr","./Script":"clx6XL","./ScriptInterpreter":"2heyj2","./WalletKey":"jf0Qcv","./config":"4itQ50","./networks":"ULNIu2","./util/BinaryParser":"b3ZSD7","./util/error":155,"./util/log":"AdF7pF","./util/util":"ACyo5H","bignum":"J4nwo8","buffer":75,"bufferput":"aXRuS6","buffertools":"fugeBw","soop":146,"step":147}],"r8OfJa":[function(require,module,exports){
(function(t){"use strict";function e(t){return t=t||{},this.lockTime=t.lockTime||0,this.spendUnconfirmed=t.spendUnconfirmed||!1,(t.fee||t.feeSat)&&(this.givenFeeSat=t.fee?t.fee*s.COIN:t.feeSat),this.remainderOut=t.remainderOut,this.signhash=t.signhash||c.SIGHASH_ALL,this.tx={},this.inputsSigned=0,this.signaturesAdded=0,this}var r=require("soop").imports(),i=r.Address||require("./Address"),n=r.Script||require("./Script"),s=r.util||require("./util/util"),a=r.bignum||require("bignum"),o=r.buffertools||require("buffertools"),u=r.networks||require("./networks"),h=r.WalletKey||require("./WalletKey"),p=r.PrivateKey||require("./PrivateKey"),c=r.Transaction||require("./Transaction"),f=parseInt(1e-4*s.COIN);e.scriptForAddress=function(t){var e,r=u.livenet,s=u.testnet,a=new i(t),o=a.version();if(o===r.addressVersion||o===s.addressVersion)e=n.createPubKeyHashOut(a.payload());else{if(o!==r.P2SHVersion&&o!==s.P2SHVersion)throw new Error("invalid output address");e=n.createP2SH(a.payload())}return e},e._scriptForPubkeys=function(e){for(var r=e.pubkeys.length,i=[],s=0;r>s;s++)i.push(new t(e.pubkeys[s],"hex"));return n.createMultisig(e.nreq,i)},e._scriptForOut=function(t){var e;if(t.address)e=this.scriptForAddress(t.address);else{if(!(t.pubkeys||t.nreq||t.nreq>1))throw new Error("unknown out type");e=this._scriptForPubkeys(t)}return e},e.infoForP2sh=function(t,e){var r=this._scriptForOut(t),n=s.sha256ripe160(r.getBuffer()),a="testnet"===e?u.testnet.P2SHVersion:u.livenet.P2SHVersion,o=new i(a,n),h=o.as("base58");return{script:r,scriptBufHex:r.getBuffer().toString("hex"),hash:n,address:h}},e.prototype.setUnspent=function(t){return this.utxos=t,this},e.prototype._setInputMap=function(){for(var e=[],r=this.selectedUtxos.length,i=0;r>i;i++){var s=this.selectedUtxos[i],a=new t(s.scriptPubKey,"hex"),o=new n(a),u=o.classify();if(u===n.TX_UNKNOWN)throw new Error("unkown output type at:"+i+" Type:"+o.getRawOutType());e.push({address:s.address,scriptPubKey:o,scriptType:u,i:i})}return this.inputMap=e,this},e.prototype.getSelectedUnspent=function(){return this.selectedUtxos},e.prototype._selectUnspent=function(t){if(!this.utxos||!this.utxos.length)throw new Error("unspent not set");var e=[6,1];this.spendUnconfirmed&&e.push(0);var r=[],i=a(0),n=!1,o=null,u=this.utxos.length;do{for(var h=e.shift(),p=0;u>p;p++){var c=this.utxos[p],f=c.confirmations||0;if(!(h>f||o&&f>=o)){var d=c.amountSat||s.parseValue(c.amount);if(i=i.add(d),r.push(c),i.cmp(t)>=0){n=!0;break}}}o=h}while(!n&&e.length);if(!n)throw new Error("no enough unspent to fulfill totalNeededAmount [SAT]:"+t);return this.selectedUtxos=r,this._setInputMap(),this},e.prototype._setInputs=function(e){var r=this.selectedUtxos,i=r.length,n=a(0);e.ins=[];for(var u=0;i>u;u++){n=n.add(s.parseValue(r[u].amount));var h={};h.s=s.EMPTY_BUFFER,h.q=4294967295;var p=new t(r[u].txid,"hex"),c=o.reverse(p),f=parseInt(r[u].vout),d=new t(4);d.writeUInt32LE(f,0),h.o=t.concat([c,d]),e.ins.push(h)}return this.valueInSat=n,this},e.prototype._setFee=function(t){if("undefined"==typeof this.valueOutSat)throw new Error("valueOutSat undefined");var e=this.valueOutSat.add(t);if(this.valueInSat.cmp(e)<0){var r=this.valueInSat.toString(),i=e.toString();throw new Error("transaction input amount is less than outputs: "+r+" < "+i+" [SAT]")}return this.feeSat=t,this},e.prototype._setRemainder=function(t,r){if("undefined"==typeof this.valueInSat||"undefined"==typeof this.valueOutSat)throw new Error("valueInSat / valueOutSat undefined");var i=this.valueInSat.sub(this.valueOutSat).sub(this.feeSat),n=t.outs.length;if(this.remainderSat=a(0),n>r&&t.outs.pop(),i.cmp(0)>0){var o=this.remainderOut||this.selectedUtxos[0],u=s.bigIntToValue(i),h=e._scriptForOut(o),p={v:u,s:h.getBuffer()};t.outs.push(p),this.remainderSat=i}return this},e.prototype._setFeeAndRemainder=function(t){var e,r=500,i=t.outs.length;do{e=parseInt(r/1e3)+1;var n=this.givenFeeSat?this.givenFeeSat:e*f,s=this.valueOutSat.add(n);this._selectUnspent(s)._setInputs(t)._setFee(n)._setRemainder(t,i),r=new c(t).getSize()}while(r>1e3*(e+1));return this},e.prototype.setOutputs=function(t){var r=a(0),i={};i.version=1,i.lock_time=this.lockTime||0,i.ins=[],i.outs=[];for(var n=t.length,o=0;n>o;o++){var u=t[o].amountSat||s.parseValue(t[o].amount),h=s.bigIntToValue(u),p=e._scriptForOut(t[o]),f={v:h,s:p.getBuffer()};i.outs.push(f);var d=t[o].amountSat||s.parseValue(t[o].amount);r=r.add(d)}return this.valueOutSat=r,this._setFeeAndRemainder(i),this.tx=new c(i),this},e._mapKeys=function(t){for(var e,r={},i=t.length,n=0;i>n;n++){var s=t[n];if("string"==typeof s){var a=new p(s);e=new h({network:a.network()}),e.fromObj({priv:s})}else{if(!(s instanceof h))throw new Error("argument must be an array of strings (WIF format) or WalletKey objects");e=s}r[e.storeObj().addr]=e}return r},e._signHashAndVerify=function(t,e){var r,i=10;do r=t.privKey.signSync(e);while(t.privKey.verifySignatureSync(e,r)===!1&&i--);if(0>i)throw new Error("could not sign input: verification failed");return r},e.prototype._checkTx=function(){if(!this.tx||!this.tx.ins.length||!this.tx.outs.length)throw new Error("tx is not defined")},e.prototype._multiFindKey=function(t,e){var r;return[u.livenet,u.testnet].forEach(function(n){[n.addressVersion,n.P2SHVersion].forEach(function(n){var s=new i(n,e);!r&&t[s]&&(r=t[s])})}),r},e.prototype._findWalletKey=function(t,e){var r;if(e.address)r=t[e.address];else if(e.pubKeyHash)r=this._multiFindKey(t,e.pubKeyHash);else{if(!e.pubKeyBuf)throw new Error("no infomation at input to find keys");var i=s.sha256ripe160(e.pubKeyBuf);r=this._multiFindKey(t,i)}return r},e.prototype._signPubKey=function(r,i,s){if(this.tx.ins[i.i].s.length>0)return{};var a=this._findWalletKey(r,i);if(a){var o=e._signHashAndVerify(a,s),u=new t(1);u[0]=this.signhash;var h=t.concat([o,u]),p=new n;return p.chunks.push(h),p.updateBuffer(),{isFullySigned:!0,signaturesAdded:1,script:p.getBuffer()}}},e.prototype._signPubKeyHash=function(r,i,s){if(this.tx.ins[i.i].s.length>0)return{};var a=this._findWalletKey(r,i);if(a){var o=e._signHashAndVerify(a,s),u=new t(1);u[0]=this.signhash;var h=t.concat([o,u]),p=new n;return p.chunks.push(h),p.chunks.push(a.privKey.public),p.updateBuffer(),{isFullySigned:!0,signaturesAdded:1,script:p.getBuffer()}}};e.prototype._initMultiSig=function(t,e){var r=!1;if(t.chunks.length<e+1)for(r=!0,t.writeN(0);t.chunks.length<=e;)t.chunks.push(s.EMPTY_BUFFER);return r},e.prototype._isSignedWithKey=function(e,r,i,n){for(var s=!1,a=1;n>=a;a++){var o=r.chunks[a];if(0!==o&&0!==o.length){var u=new t(o.slice(0,o.length-1));e.privKey.verifySignatureSync(i,u)===!0&&(s=!0)}}return s},e.prototype._chunkIsEmpty=function(t){return 0===t||0===o.compare(t,s.EMPTY_BUFFER)},e.prototype._updateMultiSig=function(r,i,n,s){var a=this._initMultiSig(i,s);if(this._isSignedWithKey(r,i,n,s))return null;for(var o=1;s>=o;o++){var u=i.chunks[o];if(this._chunkIsEmpty(u)){var h=e._signHashAndVerify(r,n),p=new t(1);p[0]=this.signhash;var c=t.concat([h,p]);i.chunks[o]=c,i.updateBuffer(),a=!0;break}}return a?i:null},e.prototype._signMultiSig=function(t,e,r){for(var i=e.scriptPubKey.capture(),s=e.scriptPubKey.chunks[0]-80,a=i.length,o=this.tx.ins[e.i].s,u=new n(o),h=0,p=0;a>p&&u.countMissingSignatures();p++){var c=this._findWalletKey(t,{pubKeyBuf:i[p]});if(c){var f=this._updateMultiSig(c,u,r,s);f&&(u=f,h++)}}return{isFullySigned:0===u.countMissingSignatures(),signaturesAdded:h,script:u.getBuffer()}};var d={};e.prototype._scriptIsAppended=function(t,e){var r=t.chunks.length;return void 0===t.chunks[r-1]?!1:"number"==typeof t.chunks[r-1]?!1:0!==o.compare(t.chunks[r-1],e)?!1:!0},e.prototype._addScript=function(t,e){var r=new n(t);return this._scriptIsAppended(r,e)||(r.chunks.push(e),r.updateBuffer()),r.getBuffer()},e.prototype._getInputForP2sh=function(t,e){var r,i=t.classify();switch(i){case n.TX_PUBKEYHASH:r=t.captureOne();break;case n.TX_PUBKEY:var a=t.captureOne();r=s.sha256ripe160(a)}return{i:e,pubKeyHash:r,scriptPubKey:t,scriptType:i}},e.prototype._signScriptHash=function(e,r){this.tx.ins[r.i].s;if(!this.hashToScriptMap)throw new Error("hashToScriptMap not set");var i=this.hashToScriptMap[r.address];if(i){var s=new t(i,"hex"),a=new n(s),o=a.classify();if(!d[o]||o===n.TX_SCRIPTHASH)throw new Error("dont know how to sign p2sh script type:"+a.getRawOutType());var u=this._getInputForP2sh(a,r.i),h=this.tx.hashForSignature(a,u.i,this.signhash),p=d[o].call(this,e,u,h);return p&&p.script&&p.signaturesAdded&&(p.script=this._addScript(p.script,s)),p}},d[n.TX_PUBKEYHASH]=e.prototype._signPubKeyHash,d[n.TX_PUBKEY]=e.prototype._signPubKey,d[n.TX_MULTISIG]=e.prototype._signMultiSig,d[n.TX_SCRIPTHASH]=e.prototype._signScriptHash,e.prototype.sign=function(t){this._checkTx();for(var r=this.tx,i=r.ins,n=i.length,s=e._mapKeys(t),a=0;n>a;a++){var o=this.inputMap[a],u=this.tx.hashForSignature(o.scriptPubKey,a,this.signhash),h=d[o.scriptType].call(this,s,o,u);h&&h.script&&(r.ins[a].s=h.script,h.isFullySigned&&this.inputsSigned++,h.signaturesAdded&&(this.signaturesAdded+=h.signaturesAdded))}return this},e.prototype.setHashToScriptMap=function(t){return this.hashToScriptMap=t,this},e.prototype.isFullySigned=function(){return this.inputsSigned===this.tx.ins.length},e.prototype.build=function(){return this._checkTx(),this.tx},e.prototype.toObj=function(){var t={valueInSat:this.valueInSat.toString(),valueOutSat:this.valueOutSat.toString(),feeSat:this.feeSat.toString(),remainderSat:this.remainderSat.toString(),hashToScriptMap:this.hashToScriptMap,selectedUtxos:this.selectedUtxos,inputsSigned:this.inputsSigned,signaturesAdded:this.signaturesAdded,signhash:this.signhash,spendUnconfirmed:this.spendUnconfirmed};return this.tx&&(t.tx=this.tx.serialize().toString("hex")),t},e.fromObj=function(r){var i=new e;if(i.valueInSat=r.valueInSat.toString(),i.valueOutSat=r.valueOutSat.toString(),i.feeSat=r.feeSat.toString(),i.remainderSat=r.remainderSat.toString(),i.hashToScriptMap=r.hashToScriptMap,i.selectedUtxos=r.selectedUtxos,i.inputsSigned=r.inputsSigned,i.signaturesAdded=r.signaturesAdded,i.signhash=r.signhash,i.spendUnconfirmed=r.spendUnconfirmed,i._setInputMap(),r.tx){var n=new c;n.parse(new t(r.tx,"hex")),i.tx=n}return i},e.prototype._checkMergeability=function(t){var e=this;if(["valueInSat","valueOutSat","feeSat","remainderSat","signhash","spendUnconfirmed"].forEach(function(r){if(e[r].toString()!==t[r].toString())throw new Error("mismatch at TransactionBuilder match: "+r+": "+e[r]+" vs. "+t[r])}),e.hashToScriptMap){var r=0;if(t.hashToScriptMap||(r=1),Object.keys(e.hashToScriptMap).forEach(function(i){t.hashToScriptMap[i]||(r=1),e.hashToScriptMap[i]!==t.hashToScriptMap[i]&&(r=1)}),r)throw new Error("mismatch at TransactionBuilder hashToScriptMap")}var r=0,i=0;if(e.selectedUtxos.forEach(function(e){if(!r){var n=t.selectedUtxos[i++];n||(r=1),["address","hash","scriptPubKey","vout","amount"].forEach(function(t){e[t]!==n[t]&&(r=t)})}}),r)throw new Error("mismatch at TransactionBuilder selectedUtxos #"+i-1+" Key:"+r);if(r=0,i=0,e.inputMap.forEach(function(e){if(!r){var n=t.inputMap[i++];n||(r=1),["address","scriptType","scriptPubKey","i"].forEach(function(t){e[t].toString()!==n[t].toString()&&(r=t)})}}),r)throw new Error("mismatch at TransactionBuilder inputMap #"+i-1+" Key:"+r)},e.prototype._mergeInputSig=function(t,e,r){if(0===o.compare(t,e))return t;var i=new n(t),s=new n(e),a=i.chunks.length,u=s.chunks.length,h={};if(a&&u&&a!==u)throw new Error("TX sig types mismatch in merge");if(!a&&!u)return t;if(a&&!u)return t;if(!a&&u)return e;for(var p=0;a>p;p++)this._chunkIsEmpty(i.chunks[p])||(h[i.chunks[p]]=1);for(var c=[],p=0;u>p;p++)this._chunkIsEmpty(s.chunks[p])||h[s.chunks[p]]||c.push(s.chunks[p]);if(!c)return console.log("[TransactionBuilder.js.857: NO DIFF FOUND, just ORDER DIFF]"),i.getBuffer();for(var f=[],p=1;a>p;p++)this._chunkIsEmpty(i.chunks[p])&&f.push(p);if(f.length<c.length){if(!r)throw new Error("no enough empty slots to merge Txs: Check ignoreConflictingSignatures option")}else{for(var p=0;p<c.length;p++)i.chunks[f[p]]=c[p],this.signaturesAdded++;i.updateBuffer()}return i.getBuffer()},e.prototype._mergeTx=function(t,e){var r=this.tx,i=t,n=r.ins.length;if(n!==i.ins.length)throw new Error("TX in length mismatch in merge");this.inputsSigned=0;for(var s=0;n>s;s++){var a=r.ins[s],u=i.ins[s];if(a.q!==u.q)throw new Error("TX sequence ins mismatch in merge. Input:",s);if(0!==o.compare(a.o,u.o))throw new Error("TX .o in mismatch in merge. Input:",s);a.s=this._mergeInputSig(a.s,u.s,e),r.isInputComplete(s)&&this.inputsSigned++}},e.prototype.merge=function(t,e){if(this._checkMergeability(t),this.tx||t.tx){if(this.tx.getNormalizedHash().toString("hex")!==t.tx.getNormalizedHash().toString("hex"))throw new Error("mismatch at TransactionBuilder NTXID");this._mergeTx(t.tx,e)}},module.exports=require("soop")(e)}).call(this,require("buffer").Buffer);
},{"./Address":"5EBmBp","./PrivateKey":"+A60Qr","./Script":"clx6XL","./Transaction":"RNv6Te","./WalletKey":"jf0Qcv","./networks":"ULNIu2","./util/util":"ACyo5H","bignum":"J4nwo8","buffer":75,"buffertools":"fugeBw","soop":146}],"./TransactionBuilder":[function(require,module,exports){
module.exports=require('r8OfJa');
},{}],"kdpPkl":[function(require,module,exports){
(function(t){function e(t){"object"!=typeof t&&(t={}),this.datastore=JSON.parse(t.datastore?JSON.stringify(t.datastore):JSON.stringify(u)),this.network=void 0,this.dirty=t.dirty||!0}var r=require("soop").imports(),i=function(e){return new t(e,"hex")},n=require("fs"),s=require("./util/EncFile"),o=require("./Address"),a=require("./networks"),d=r.util||require("./util/util"),h="aes-256-cbc",u={client:"libcoin",client_version:"0.0.1",network:"testnet",version:1,best_hash:null,best_height:-1,keys:[],sin:{},scripts:{}};e.prototype.readSync=function(t,e){this.datastore=s.readJFileSync(h,e,t),this.dirty=!1},e.prototype.writeSync=function(t,e){var r=t+".tmp";s.writeJFileSync(h,e,r,this.datastore),n.renameSync(r,t),this.dirty=!1},e.prototype.setNetwork=function(t){switch(t||(t=this.datastore.network),t){case"mainnet":case"livenet":this.network=a.livenet;break;case"testnet":this.network=a.testnet;break;default:throw new Error("Unsupported network")}this.datastore.network=this.network.name,this.dirty=!0},e.prototype.addKey=function(t){this.datastore.keys.push(t),this.dirty=!0},e.prototype.addSIN=function(t){this.datastore.sin[t.sin]=t,this.dirty=!0},e.prototype.findKeyHash=function(t){for(var e=t.toString(),r=0;r<this.datastore.keys.length;r++){var i=this.datastore.keys[r],n=i.addr,s=new o(n);if(s.payload().toString()==e)return i}return void 0},e.prototype.expandKey=function(t){var e=new o(t);try{e.validate();var r=e.payload(),n=this.findKeyHash(r);t=n.pub}catch(s){}var a=/^[a-fA-F0-9]+$/;if(!t.match(a))throw new Error("Unknown key type");return i(t)},e.prototype.expandKeys=function(t){var e=[],r=this;return t.forEach(function(t){var i=r.expandKey(t);e.push(i)}),e},e.prototype.addScript=function(t){var e=t.getBuffer(),r=d.sha256ripe160(e),i=new o(this.network.P2SHVersion,r),n=i.as("base58");return this.datastore.scripts[n]=e.toString("hex"),this.dirty=!0,n},module.exports=require("soop")(e)}).call(this,require("buffer").Buffer);
},{"./Address":"5EBmBp","./networks":"ULNIu2","./util/EncFile":150,"./util/util":"ACyo5H","buffer":75,"fs":71,"soop":146}],"./Wallet":[function(require,module,exports){
module.exports=require('kdpPkl');
},{}],"./WalletKey":[function(require,module,exports){
module.exports=require('jf0Qcv');
},{}],"jf0Qcv":[function(require,module,exports){
(function(e){function r(e){if(e||(e={}),!e.network)throw new Error("network parameter is required");this.network=e.network,this.created=e.created,this.privKey=e.privKey}var i=(require("soop").imports(),require("./util/util")),t=require("./util/time"),s=require("./Key"),p=require("./PrivateKey"),o=require("./Address");r.prototype.generate=function(){this.privKey=s.generateSync(),this.created=t.curtime()},r.prototype.storeObj=function(){var e=this.privKey.public.toString("hex"),r=i.sha256ripe160(this.privKey.public),t=new o(this.network.addressVersion,r),s=new p(this.network.privKeyVersion,this.privKey.private,this.privKey.compressed),n={created:this.created,priv:s.toString(),pub:e,addr:t.toString()};return n},r.prototype.fromObj=function(r){if(this.created=r.created,this.privKey=new s,64==r.priv.length)this.privKey.private=new e(r.priv,"hex"),this.privKey.compressed="undefined"==typeof r.compressed?!0:r.compressed;else{var i=new p(r.priv);i.validate(),this.privKey.private=new e(i.payload()),this.privKey.compressed=i.compressed()}this.privKey.regenerateSync()},module.exports=require("soop")(r)}).call(this,require("buffer").Buffer);
},{"./Address":"5EBmBp","./Key":"Af1Gom","./PrivateKey":"+A60Qr","./util/time":158,"./util/util":"ACyo5H","buffer":75,"soop":146}],"bitcore":[function(require,module,exports){
module.exports=require('tmvhGl');
},{}],"tmvhGl":[function(require,module,exports){
(function(e,r){var o=function(e,r){Object.defineProperty(module.exports,e,{get:function(){return require(r)}})};o("bignum","bignum"),o("base58","base58-native"),o("bufferput","bufferput"),o("buffertools","buffertools"),o("Buffers.monkey","./Buffers.monkey"),o("config","./config"),o("const","./const"),o("Deserialize","./Deserialize"),o("log","./util/log"),o("networks","./networks"),o("util","./util/util"),o("EncodedData","./util/EncodedData"),o("VersionedData","./util/VersionedData"),o("BinaryParser","./util/BinaryParser"),o("Address","./Address"),o("BIP32","./BIP32"),o("Point","./Point"),o("Opcode","./Opcode"),o("Script","./Script"),o("Transaction","./Transaction"),o("TransactionBuilder","./TransactionBuilder"),o("Connection","./Connection"),o("Peer","./Peer"),o("Block","./Block"),o("ScriptInterpreter","./ScriptInterpreter"),o("Bloom","./Bloom"),o("Key","./Key"),Object.defineProperty(module.exports,"KeyModule",{get:function(){return console.log("KeyModule is deprecated."),require("bindings")("KeyModule")}}),o("SINKey","./SINKey"),o("SIN","./SIN"),o("PrivateKey","./PrivateKey"),o("RpcClient","./RpcClient"),o("Wallet","./Wallet"),o("WalletKey","./WalletKey"),o("PeerManager","./PeerManager"),module.exports.Buffer=r,"undefined"==typeof e.versions&&module.exports.bignum.config({EXPONENTIAL_AT:9999999,DECIMAL_PLACES:0,ROUNDING_MODE:1})}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),require("buffer").Buffer);
},{"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91,"bindings":66,"buffer":75}],53:[function(require,module,exports){
function BigInteger(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function nbi(){return new BigInteger(null)}function am1(t,e,i,r,n,o){for(;--o>=0;){var s=e*this[t++]+i[r]+n;n=Math.floor(s/67108864),i[r++]=67108863&s}return n}function am2(t,e,i,r,n,o){for(var s=32767&e,u=e>>15;--o>=0;){var p=32767&this[t],h=this[t++]>>15,a=u*p+h*s;p=s*p+((32767&a)<<15)+i[r]+(1073741823&n),n=(p>>>30)+(a>>>15)+u*h+(n>>>30),i[r++]=1073741823&p}return n}function am3(t,e,i,r,n,o){for(var s=16383&e,u=e>>14;--o>=0;){var p=16383&this[t],h=this[t++]>>14,a=u*p+h*s;p=s*p+((16383&a)<<14)+i[r]+n,n=(p>>28)+(a>>14)+u*h,i[r++]=268435455&p}return n}function int2char(t){return BI_RM.charAt(t)}function intAt(t,e){var i=BI_RC[t.charCodeAt(e)];return null==i?-1:i}function bnpCopyTo(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function bnpFromInt(t){this.t=1,this.s=0>t?-1:0,t>0?this[0]=t:-1>t?this[0]=t+DV:this.t=0}function nbv(t){var e=nbi();return e.fromInt(t),e}function bnpFromString(t,e){var i;if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else{if(4!=e)return void this.fromRadix(t,e);i=2}this.t=0,this.s=0;for(var r=t.length,n=!1,o=0;--r>=0;){var s=8==i?255&t[r]:intAt(t,r);0>s?"-"==t.charAt(r)&&(n=!0):(n=!1,0==o?this[this.t++]=s:o+i>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,o+=i,o>=this.DB&&(o-=this.DB))}8==i&&0!=(128&t[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function bnToString(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var i,r=(1<<e)-1,n=!1,o="",s=this.t,u=this.DB-s*this.DB%e;if(s-->0)for(u<this.DB&&(i=this[s]>>u)>0&&(n=!0,o=int2char(i));s>=0;)e>u?(i=(this[s]&(1<<u)-1)<<e-u,i|=this[--s]>>(u+=this.DB-e)):(i=this[s]>>(u-=e)&r,0>=u&&(u+=this.DB,--s)),i>0&&(n=!0),n&&(o+=int2char(i));return n?o:"0"}function bnNegate(){var t=nbi();return BigInteger.ZERO.subTo(this,t),t}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(e=i-t.t,0!=e)return this.s<0?-e:e;for(;--i>=0;)if(0!=(e=this[i]-t[i]))return e;return 0}function nbits(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s}function bnpDRShiftTo(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s}function bnpLShiftTo(t,e){var i,r=t%this.DB,n=this.DB-r,o=(1<<n)-1,s=Math.floor(t/this.DB),u=this.s<<r&this.DM;for(i=this.t-1;i>=0;--i)e[i+s+1]=this[i]>>n|u,u=(this[i]&o)<<r;for(i=s-1;i>=0;--i)e[i]=0;e[s]=u,e.t=this.t+s+1,e.s=this.s,e.clamp()}function bnpRShiftTo(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)return void(e.t=0);var r=t%this.DB,n=this.DB-r,o=(1<<r)-1;e[0]=this[i]>>r;for(var s=i+1;s<this.t;++s)e[s-i-1]|=(this[s]&o)<<n,e[s-i]=this[s]>>r;r>0&&(e[this.t-i-1]|=(this.s&o)<<n),e.t=this.t-i,e.clamp()}function bnpSubTo(t,e){for(var i=0,r=0,n=Math.min(t.t,this.t);n>i;)r+=this[i]-t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<t.t;)r-=t[i],e[i++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=0>r?-1:0,-1>r?e[i++]=this.DV+r:r>0&&(e[i++]=r),e.t=i,e.clamp()}function bnpMultiplyTo(t,e){var i=this.abs(),r=t.abs(),n=i.t;for(e.t=n+r.t;--n>=0;)e[n]=0;for(n=0;n<r.t;++n)e[n+i.t]=i.am(0,r[n],e,n,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&BigInteger.ZERO.subTo(e,e)}function bnpSquareTo(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var r=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,r,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()}function bnpDivRemTo(t,e,i){var r=t.abs();if(!(r.t<=0)){var n=this.abs();if(n.t<r.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=nbi());var o=nbi(),s=this.s,u=t.s,p=this.DB-nbits(r[r.t-1]);p>0?(r.lShiftTo(p,o),n.lShiftTo(p,i)):(r.copyTo(o),n.copyTo(i));var h=o.t,a=o[h-1];if(0!=a){var F=a*(1<<this.F1)+(h>1?o[h-2]>>this.F2:0),g=this.FV/F,f=(1<<this.F1)/F,c=1<<this.F2,l=i.t,B=l-h,m=null==e?nbi():e;for(o.dlShiftTo(B,m),i.compareTo(m)>=0&&(i[i.t++]=1,i.subTo(m,i)),BigInteger.ONE.dlShiftTo(h,m),m.subTo(o,o);o.t<h;)o[o.t++]=0;for(;--B>=0;){var y=i[--l]==a?this.DM:Math.floor(i[l]*g+(i[l-1]+c)*f);if((i[l]+=o.am(0,y,i,B,0,h))<y)for(o.dlShiftTo(B,m),i.subTo(m,i);i[l]<--y;)i.subTo(m,i)}null!=e&&(i.drShiftTo(h,e),s!=u&&BigInteger.ZERO.subTo(e,e)),i.t=h,i.clamp(),p>0&&i.rShiftTo(p,i),0>s&&BigInteger.ZERO.subTo(i,i)}}}function bnMod(t){var e=nbi();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(BigInteger.ZERO)>0&&t.subTo(e,e),e}function Classic(t){this.m=t}function cConvert(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function cRevert(t){return t}function cReduce(t){t.divRemTo(this.m,null,t)}function cMulTo(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function cSqrTo(t,e){t.squareTo(e),this.reduce(e)}function bnpInvDigit(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function Montgomery(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function montConvert(t){var e=nbi();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(BigInteger.ZERO)>0&&this.m.subTo(e,e),e}function montRevert(t){var e=nbi();return t.copyTo(e),this.reduce(e),e}function montReduce(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],r=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(i=e+this.m.t,t[i]+=this.m.am(0,r,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function montSqrTo(t,e){t.squareTo(e),this.reduce(e)}function montMulTo(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(t,e){if(t>4294967295||1>t)return BigInteger.ONE;var i=nbi(),r=nbi(),n=e.convert(this),o=nbits(t)-1;for(n.copyTo(i);--o>=0;)if(e.sqrTo(i,r),(t&1<<o)>0)e.mulTo(r,n,i);else{var s=i;i=r,r=s}return e.revert(i)}function bnModPowInt(t,e){var i;return i=256>t||e.isEven()?new Classic(e):new Montgomery(e),this.exp(t,i)}function bnClone(){var t=nbi();return this.copyTo(t),t}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function bnByteValue(){return 0==this.t?this.s:this[0]<<24>>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(t){if(null==t&&(t=10),0==this.signum()||2>t||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),r=nbv(i),n=nbi(),o=nbi(),s="";for(this.divRemTo(r,n,o);n.signum()>0;)s=(i+o.intValue()).toString(t).substr(1)+s,n.divRemTo(r,n,o);return o.intValue().toString(t)+s}function bnpFromRadix(t,e){this.fromInt(0),null==e&&(e=10);for(var i=this.chunkSize(e),r=Math.pow(e,i),n=!1,o=0,s=0,u=0;u<t.length;++u){var p=intAt(t,u);0>p?"-"==t.charAt(u)&&0==this.signum()&&(n=!0):(s=e*s+p,++o>=i&&(this.dMultiply(r),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(s,0)),n&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(t,e,i){if("number"==typeof e)if(2>t)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(t-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(BigInteger.ONE.shiftLeft(t-1),this);else{var r=new Array,n=7&t;r.length=(t>>3)+1,e.nextBytes(r),n>0?r[0]&=(1<<n)-1:r[0]=0,this.fromString(r,256)}}function bnToByteArray(){var t=this.t,e=new Array;e[0]=this.s;var i,r=this.DB-t*this.DB%8,n=0;if(t-->0)for(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r&&(e[n++]=i|this.s<<this.DB-r);t>=0;)8>r?(i=(this[t]&(1<<r)-1)<<8-r,i|=this[--t]>>(r+=this.DB-8)):(i=this[t]>>(r-=8)&255,0>=r&&(r+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==n&&(128&this.s)!=(128&i)&&++n,(n>0||i!=this.s)&&(e[n++]=i);return e}function bnEquals(t){return 0==this.compareTo(t)}function bnMin(t){return this.compareTo(t)<0?this:t}function bnMax(t){return this.compareTo(t)>0?this:t}function bnpBitwiseTo(t,e,i){var r,n,o=Math.min(t.t,this.t);for(r=0;o>r;++r)i[r]=e(this[r],t[r]);if(t.t<this.t){for(n=t.s&this.DM,r=o;r<this.t;++r)i[r]=e(this[r],n);i.t=this.t}else{for(n=this.s&this.DM,r=o;r<t.t;++r)i[r]=e(n,t[r]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()}function op_and(t,e){return t&e}function bnAnd(t){var e=nbi();return this.bitwiseTo(t,op_and,e),e}function op_or(t,e){return t|e}function bnOr(t){var e=nbi();return this.bitwiseTo(t,op_or,e),e}function op_xor(t,e){return t^e}function bnXor(t){var e=nbi();return this.bitwiseTo(t,op_xor,e),e}function op_andnot(t,e){return t&~e}function bnAndNot(t){var e=nbi();return this.bitwiseTo(t,op_andnot,e),e}function bnNot(){for(var t=nbi(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}function bnShiftLeft(t){var e=nbi();return 0>t?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function bnShiftRight(t){var e=nbi();return 0>t?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function lbit(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function bnGetLowestSetBit(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+lbit(this[t]);return this.s<0?this.t*this.DB:-1}function cbit(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function bnBitCount(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=cbit(this[i]^e);return t}function bnTestBit(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)}function bnpChangeBit(t,e){var i=BigInteger.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i}function bnSetBit(t){return this.changeBit(t,op_or)}function bnClearBit(t){return this.changeBit(t,op_andnot)}function bnFlipBit(t){return this.changeBit(t,op_xor)}function bnpAddTo(t,e){for(var i=0,r=0,n=Math.min(t.t,this.t);n>i;)r+=this[i]+t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<t.t;)r+=t[i],e[i++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=0>r?-1:0,r>0?e[i++]=r:-1>r&&(e[i++]=this.DV+r),e.t=i,e.clamp()}function bnAdd(t){var e=nbi();return this.addTo(t,e),e}function bnSubtract(t){var e=nbi();return this.subTo(t,e),e}function bnMultiply(t){var e=nbi();return this.multiplyTo(t,e),e}function bnSquare(){var t=nbi();return this.squareTo(t),t}function bnDivide(t){var e=nbi();return this.divRemTo(t,e,null),e}function bnRemainder(t){var e=nbi();return this.divRemTo(t,null,e),e}function bnDivideAndRemainder(t){var e=nbi(),i=nbi();return this.divRemTo(t,e,i),new Array(e,i)}function bnpDMultiply(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function NullExp(){}function nNop(t){return t}function nMulTo(t,e,i){t.multiplyTo(e,i)}function nSqrTo(t,e){t.squareTo(e)}function bnPow(t){return this.exp(t,new NullExp)}function bnpMultiplyLowerTo(t,e,i){var r=Math.min(this.t+t.t,e);for(i.s=0,i.t=r;r>0;)i[--r]=0;var n;for(n=i.t-this.t;n>r;++r)i[r+this.t]=this.am(0,t[r],i,r,0,this.t);for(n=Math.min(t.t,e);n>r;++r)this.am(0,t[r],i,r,0,e-r);i.clamp()}function bnpMultiplyUpperTo(t,e,i){--e;var r=i.t=this.t+t.t-e;for(i.s=0;--r>=0;)i[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)i[this.t+r-e]=this.am(e-r,t[r],i,0,0,this.t+r-e);i.clamp(),i.drShiftTo(1,i)}function Barrett(t){this.r2=nbi(),this.q3=nbi(),BigInteger.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function barrettConvert(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=nbi();return t.copyTo(e),this.reduce(e),e}function barrettRevert(t){return t}function barrettReduce(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function barrettSqrTo(t,e){t.squareTo(e),this.reduce(e)}function barrettMulTo(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function bnModPow(t,e){var i,r,n=t.bitLength(),o=nbv(1);if(0>=n)return o;i=18>n?1:48>n?3:144>n?4:768>n?5:6,r=8>n?new Classic(e):e.isEven()?new Barrett(e):new Montgomery(e);var s=new Array,u=3,p=i-1,h=(1<<i)-1;if(s[1]=r.convert(this),i>1){var a=nbi();for(r.sqrTo(s[1],a);h>=u;)s[u]=nbi(),r.mulTo(a,s[u-2],s[u]),u+=2}var F,g,f=t.t-1,c=!0,l=nbi();for(n=nbits(t[f])-1;f>=0;){for(n>=p?F=t[f]>>n-p&h:(F=(t[f]&(1<<n+1)-1)<<p-n,f>0&&(F|=t[f-1]>>this.DB+n-p)),u=i;0==(1&F);)F>>=1,--u;if((n-=u)<0&&(n+=this.DB,--f),c)s[F].copyTo(o),c=!1;else{for(;u>1;)r.sqrTo(o,l),r.sqrTo(l,o),u-=2;u>0?r.sqrTo(o,l):(g=o,o=l,l=g),r.mulTo(l,s[F],o)}for(;f>=0&&0==(t[f]&1<<n);)r.sqrTo(o,l),g=o,o=l,l=g,--n<0&&(n=this.DB-1,--f)}return r.revert(o)}function bnGCD(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var r=e;e=i,i=r}var n=e.getLowestSetBit(),o=i.getLowestSetBit();if(0>o)return e;for(o>n&&(o=n),o>0&&(e.rShiftTo(o,e),i.rShiftTo(o,i));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=i.getLowestSetBit())>0&&i.rShiftTo(n,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return o>0&&i.lShiftTo(o,i),i}function bnpModInt(t){if(0>=t)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(0==e)i=this[0]%t;else for(var r=this.t-1;r>=0;--r)i=(e*i+this[r])%t;return i}function bnModInverse(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return BigInteger.ZERO;for(var i=t.clone(),r=this.clone(),n=nbv(1),o=nbv(0),s=nbv(0),u=nbv(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),e?(n.isEven()&&o.isEven()||(n.addTo(this,n),o.subTo(t,o)),n.rShiftTo(1,n)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;r.isEven();)r.rShiftTo(1,r),e?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(t,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);i.compareTo(r)>=0?(i.subTo(r,i),e&&n.subTo(s,n),o.subTo(u,o)):(r.subTo(i,r),e&&s.subTo(n,s),u.subTo(o,u))}return 0!=r.compareTo(BigInteger.ONE)?BigInteger.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u}function bnIsProbablePrime(t){var e,i=this.abs();if(1==i.t&&i[0]<=lowprimes[lowprimes.length-1]){for(e=0;e<lowprimes.length;++e)if(i[0]==lowprimes[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<lowprimes.length;){for(var r=lowprimes[e],n=e+1;n<lowprimes.length&&lplim>r;)r*=lowprimes[n++];for(r=i.modInt(r);n>e;)if(r%lowprimes[e++]==0)return!1}return i.millerRabin(t)}function bnpMillerRabin(t){var e=this.subtract(BigInteger.ONE),i=e.getLowestSetBit();if(0>=i)return!1;var r=e.shiftRight(i);t=t+1>>1,t>lowprimes.length&&(t=lowprimes.length);for(var n=nbi(),o=0;t>o;++o){n.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var s=n.modPow(r,this);if(0!=s.compareTo(BigInteger.ONE)&&0!=s.compareTo(e)){for(var u=1;u++<i&&0!=s.compareTo(e);)if(s=s.modPowInt(2,this),0==s.compareTo(BigInteger.ONE))return!1;if(0!=s.compareTo(e))return!1}}return!0}function Arcfour(){this.i=0,this.j=0,this.S=new Array}function ARC4init(t){var e,i,r;for(e=0;256>e;++e)this.S[e]=e;for(i=0,e=0;256>e;++e)i=i+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[i],this.S[i]=r;this.i=0,this.j=0}function ARC4next(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]}function prng_newstate(){return new Arcfour}function rng_seed_int(t){rng_pool[rng_pptr++]^=255&t,rng_pool[rng_pptr++]^=t>>8&255,rng_pool[rng_pptr++]^=t>>16&255,rng_pool[rng_pptr++]^=t>>24&255,rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}function rng_get_byte(){if(null==rng_state){for(rng_seed_time(),rng_state=prng_newstate(),rng_state.init(rng_pool),rng_pptr=0;rng_pptr<rng_pool.length;++rng_pptr)rng_pool[rng_pptr]=0;rng_pptr=0}return rng_state.next()}function rng_get_bytes(t){var e;for(e=0;e<t.length;++e)t[e]=rng_get_byte()}function SecureRandom(){}function ECFieldElementFp(t,e){this.x=e,this.q=t}function feFpEquals(t){return t==this?!0:this.q.equals(t.q)&&this.x.equals(t.x)}function feFpToBigInteger(){return this.x}function feFpNegate(){return new ECFieldElementFp(this.q,this.x.negate().mod(this.q))}function feFpAdd(t){return new ECFieldElementFp(this.q,this.x.add(t.toBigInteger()).mod(this.q))}function feFpSubtract(t){return new ECFieldElementFp(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))}function feFpMultiply(t){return new ECFieldElementFp(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))}function feFpSquare(){return new ECFieldElementFp(this.q,this.x.square().mod(this.q))}function feFpDivide(t){return new ECFieldElementFp(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))}function ECPointFp(t,e,i,r){this.curve=t,this.x=e,this.y=i,this.z=null==r?BigInteger.ONE:r,this.zinv=null}function pointFpGetX(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpGetY(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpEquals(t){if(t==this)return!0;if(this.isInfinity())return t.isInfinity();if(t.isInfinity())return this.isInfinity();var e,i;return e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),e.equals(BigInteger.ZERO)?(i=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q),i.equals(BigInteger.ZERO)):!1}function pointFpIsInfinity(){return null==this.x&&null==this.y?!0:this.z.equals(BigInteger.ZERO)&&!this.y.toBigInteger().equals(BigInteger.ZERO)}function pointFpNegate(){return new ECPointFp(this.curve,this.x,this.y.negate(),this.z)}function pointFpAdd(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),i=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(BigInteger.ZERO.equals(i))return BigInteger.ZERO.equals(e)?this.twice():this.curve.getInfinity();var r=new BigInteger("3"),n=this.x.toBigInteger(),o=this.y.toBigInteger(),s=(t.x.toBigInteger(),t.y.toBigInteger(),i.square()),u=s.multiply(i),p=n.multiply(s),h=e.square().multiply(this.z),a=h.subtract(p.shiftLeft(1)).multiply(t.z).subtract(u).multiply(i).mod(this.curve.q),F=p.multiply(r).multiply(e).subtract(o.multiply(u)).subtract(h.multiply(e)).multiply(t.z).add(e.multiply(u)).mod(this.curve.q),g=u.multiply(this.z).multiply(t.z).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(F),g)}function pointFpTwice(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new BigInteger("3"),e=this.x.toBigInteger(),i=this.y.toBigInteger(),r=i.multiply(this.z),n=r.multiply(i).mod(this.curve.q),o=this.curve.a.toBigInteger(),s=e.square().multiply(t);BigInteger.ZERO.equals(o)||(s=s.add(this.z.square().multiply(o))),s=s.mod(this.curve.q);var u=s.square().subtract(e.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(r).mod(this.curve.q),p=s.multiply(t).multiply(e).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(s.square().multiply(s)).mod(this.curve.q),h=r.square().multiply(r).shiftLeft(3).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(p),h)}function pointFpMultiply(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,i=t,r=i.multiply(new BigInteger("3")),n=this.negate(),o=this;for(e=r.bitLength()-2;e>0;--e){o=o.twice();var s=r.testBit(e),u=i.testBit(e);s!=u&&(o=o.add(s?this:n))}return o}function pointFpMultiplyTwo(t,e,i){var r;r=t.bitLength()>i.bitLength()?t.bitLength()-1:i.bitLength()-1;for(var n=this.curve.getInfinity(),o=this.add(e);r>=0;)n=n.twice(),t.testBit(r)?n=n.add(i.testBit(r)?o:this):i.testBit(r)&&(n=n.add(e)),--r;return n}function ECCurveFp(t,e,i){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(i),this.infinity=new ECPointFp(this,null,null)}function curveFpGetQ(){return this.q}function curveFpGetA(){return this.a}function curveFpGetB(){return this.b}function curveFpEquals(t){return t==this?!0:this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)}function curveFpGetInfinity(){return this.infinity}function curveFpFromBigInteger(t){return new ECFieldElementFp(this.q,t)}function curveFpDecodePointHex(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var e=(t.length-2)/2,i=t.substr(2,e),r=t.substr(e+2,e);return new ECPointFp(this,this.fromBigInteger(new BigInteger(i,16)),this.fromBigInteger(new BigInteger(r,16)));default:return null}}function X9ECParameters(t,e,i,r){this.curve=t,this.g=e,this.n=i,this.h=r}function x9getCurve(){return this.curve}function x9getG(){return this.g}function x9getN(){return this.n}function x9getH(){return this.h}function fromHex(t){return new BigInteger(t,16)}function secp128r1(){var t=fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),e=fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),i=fromHex("E87579C11079F43DD824993C2CEE5ED3"),r=fromHex("FFFFFFFE0000000075A30D1B9038A115"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83");return new X9ECParameters(o,s,r,n)}function secp160k1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),e=BigInteger.ZERO,i=fromHex("7"),r=fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE");return new X9ECParameters(o,s,r,n)}function secp160r1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),e=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),i=fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),r=fromHex("0100000000000000000001F4C8F927AED3CA752257"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32");return new X9ECParameters(o,s,r,n)}function secp192k1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),e=BigInteger.ZERO,i=fromHex("3"),r=fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");return new X9ECParameters(o,s,r,n)}function secp192r1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),e=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),i=fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),r=fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811");return new X9ECParameters(o,s,r,n)}function secp224r1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),e=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),i=fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),r=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");return new X9ECParameters(o,s,r,n)}function secp256k1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"),e=BigInteger.ZERO,i=fromHex("7"),r=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8");return new X9ECParameters(o,s,r,n)}function secp256r1(){var t=fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),e=fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),i=fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),r=fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");return new X9ECParameters(o,s,r,n)}function getSECCurveByName(t){return"secp128r1"==t?secp128r1():"secp160k1"==t?secp160k1():"secp160r1"==t?secp160r1():"secp192k1"==t?secp192k1():"secp192r1"==t?secp192r1():"secp224r1"==t?secp224r1():"secp256k1"==t?secp256k1():"secp256r1"==t?secp256r1():null}function integerToBytes(t,e){var i=t.toByteArrayUnsigned();if(e<i.length)i=i.slice(i.length-e);else for(;e>i.length;)i.unshift(0);return i}function dmp(t){return t instanceof BigInteger||(t=t.toBigInteger()),Crypto.util.bytesToHex(t.toByteArrayUnsigned())}if("undefined"==typeof window&&(window=this),Bitcoin={},"undefined"==typeof navigator){var navigator={};navigator.appName="NodeJS"}var base64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Crypto=window.Crypto={},util=Crypto.util={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&util.rotl(t,8)|4278255360&util.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=util.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],i=0,r=0;i<t.length;i++,r+=8)e[r>>>5]|=t[i]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],i=0;i<32*t.length;i+=8)e.push(t[i>>>5]>>>24-i%32&255);return e},bytesToHex:function(t){for(var e=[],i=0;i<t.length;i++)e.push((t[i]>>>4).toString(16)),e.push((15&t[i]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],i=0;i<t.length;i+=2)e.push(parseInt(t.substr(i,2),16));return e},bytesToBase64:function(t){if("function"==typeof btoa)return btoa(Binary.bytesToString(t));for(var e=[],i=0;i<t.length;i+=3)for(var r=t[i]<<16|t[i+1]<<8|t[i+2],n=0;4>n;n++)e.push(8*i+6*n<=8*t.length?base64map.charAt(r>>>6*(3-n)&63):"=");return e.join("")},base64ToBytes:function(t){if("function"==typeof atob)return Binary.stringToBytes(atob(t));t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],i=0,r=0;i<t.length;r=++i%4)0!=r&&e.push((base64map.indexOf(t.charAt(i-1))&Math.pow(2,-2*r+8)-1)<<2*r|base64map.indexOf(t.charAt(i))>>>6-2*r);return e}};Crypto.mode={};var charenc=Crypto.charenc={},UTF8=charenc.UTF8={stringToBytes:function(t){return Binary.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(Binary.bytesToString(t)))}},Binary=charenc.Binary={stringToBytes:function(t){for(var e=[],i=0;i<t.length;i++)e.push(t.charCodeAt(i));return e},bytesToString:function(t){for(var e=[],i=0;i<t.length;i++)e.push(String.fromCharCode(t[i]));return e.join("")}},CryptoJS=CryptoJS||function(t,e){var i={},r=i.lib={},n=function(){},o=r.Base={extend:function(t){n.prototype=this;var e=new n;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},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=r.WordArray=o.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:4*t.length},toString:function(t){return(t||p).stringify(this)},concat:function(t){var e=this.words,i=t.words,r=this.sigBytes;if(t=t.sigBytes,this.clamp(),r%4)for(var n=0;t>n;n++)e[r+n>>>2]|=(i[n>>>2]>>>24-8*(n%4)&255)<<24-8*((r+n)%4);else if(65535<i.length)for(n=0;t>n;n+=4)e[r+n>>>2]=i[n>>>2];else e.push.apply(e,i);return this.sigBytes+=t,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-8*(i%4),e.length=t.ceil(i/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var i=[],r=0;e>r;r+=4)i.push(4294967296*t.random()|0);return new s.init(i,e)}}),u=i.enc={},p=u.Hex={stringify:function(t){var e=t.words;t=t.sigBytes;for(var i=[],r=0;t>r;r++){var n=e[r>>>2]>>>24-8*(r%4)&255;i.push((n>>>4).toString(16)),i.push((15&n).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,i=[],r=0;e>r;r+=2)i[r>>>3]|=parseInt(t.substr(r,2),16)<<24-4*(r%8);return new s.init(i,e/2)}},h=u.Latin1={stringify:function(t){var e=t.words;t=t.sigBytes;for(var i=[],r=0;t>r;r++)i.push(String.fromCharCode(e[r>>>2]>>>24-8*(r%4)&255));return i.join("")},parse:function(t){for(var e=t.length,i=[],r=0;e>r;r++)i[r>>>2]|=(255&t.charCodeAt(r))<<24-8*(r%4);return new s.init(i,e)}},a=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},F=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=a.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var i=this._data,r=i.words,n=i.sigBytes,o=this.blockSize,u=n/(4*o),u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0);if(e=u*o,n=t.min(4*e,n),e){for(var p=0;e>p;p+=o)this._doProcessBlock(r,p);p=r.splice(0,e),i.sigBytes-=n}return new s.init(p,n)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});r.Hasher=F.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){F.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,i){return new t.init(i).finalize(e)}},_createHmacHelper:function(t){return function(e,i){return new g.HMAC.init(t,i).finalize(e)}}});var g=i.algo={};return i}(Math);!function(){var t=CryptoJS,e=t.lib,i=e.WordArray,r=e.Hasher,e=t.algo,n=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),s=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),p=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),e=e.RIPEMD160=r.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])
},_doProcessBlock:function(t,e){for(var i=0;16>i;i++){var r=e+i,a=t[r];t[r]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var F,g,f,c,l,B,m,y,d,v,r=this._hash.words,a=p.words,b=h.words,I=n.words,E=o.words,C=s.words,T=u.words;B=F=r[0],m=g=r[1],y=f=r[2],d=c=r[3],v=l=r[4];for(var w,i=0;80>i;i+=1)w=F+t[e+I[i]]|0,w=16>i?w+((g^f^c)+a[0]):32>i?w+((g&f|~g&c)+a[1]):48>i?w+(((g|~f)^c)+a[2]):64>i?w+((g&c|f&~c)+a[3]):w+((g^(f|~c))+a[4]),w|=0,w=w<<C[i]|w>>>32-C[i],w=w+l|0,F=l,l=c,c=f<<10|f>>>22,f=g,g=w,w=B+t[e+E[i]]|0,w=16>i?w+((m^(y|~d))+b[0]):32>i?w+((m&d|y&~d)+b[1]):48>i?w+(((m|~y)^d)+b[2]):64>i?w+((m&y|~m&d)+b[3]):w+((m^y^d)+b[4]),w|=0,w=w<<T[i]|w>>>32-T[i],w=w+v|0,B=v,v=d,d=y<<10|y>>>22,y=m,m=w;w=r[1]+f+d|0,r[1]=r[2]+c+v|0,r[2]=r[3]+l+B|0,r[3]=r[4]+F+m|0,r[4]=r[0]+g+y|0,r[0]=w},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;for(e[r>>>5]|=128<<24-r%32,e[(r+64>>>9<<4)+14]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(e.length+1),this._process(),t=this._hash,e=t.words,i=0;5>i;i++)r=e[i],e[i]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);return t},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});t.RIPEMD160=r._createHelper(e),t.HmacRIPEMD160=r._createHmacHelper(e)}(Math),module.exports.crypto31=CryptoJS;var dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr="0".charCodeAt(0),vv=0;9>=vv;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFlipBit,BigInteger.prototype.add=bnAdd,BigInteger.prototype.subtract=bnSubtract,BigInteger.prototype.multiply=bnMultiply,BigInteger.prototype.divide=bnDivide,BigInteger.prototype.remainder=bnRemainder,BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder,BigInteger.prototype.modPow=bnModPow,BigInteger.prototype.modInverse=bnModInverse,BigInteger.prototype.pow=bnPow,BigInteger.prototype.gcd=bnGCD,BigInteger.prototype.isProbablePrime=bnIsProbablePrime,BigInteger.prototype.square=bnSquare,module.exports.BigInteger=BigInteger,Arcfour.prototype.init=ARC4init,Arcfour.prototype.next=ARC4next;var rng_psize=256;BigInteger.valueOf=nbv,BigInteger.prototype.toByteArrayUnsigned=function(){var t=this.abs().toByteArray();return t.length?(0==t[0]&&(t=t.slice(1)),t.map(function(t){return 0>t?t+256:t})):t},BigInteger.fromByteArrayUnsigned=function(t){return t.length?new BigInteger(128&t[0]?[0].concat(t):t):t.valueOf(0)},BigInteger.prototype.toByteArraySigned=function(){var t=this.abs().toByteArrayUnsigned(),e=this.compareTo(BigInteger.ZERO)<0;return e?128&t[0]?t.unshift(128):t[0]|=128:128&t[0]&&t.unshift(0),t},BigInteger.fromByteArraySigned=function(t){return 128&t[0]?(t[0]&=127,BigInteger.fromByteArrayUnsigned(t).negate()):BigInteger.fromByteArrayUnsigned(t)};var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];"undefined"==typeof window.console&&(window.console={});for(var i=0;i<names.length;++i)"undefined"==typeof window.console[names[i]]&&(window.console[names[i]]=function(){});Bitcoin.Util={isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},makeFilledArray:function(t,e){for(var i=[],r=0;t>r;)i[r++]=e;return i},numToVarInt:function(t){if(253>t)return[t];if(65536>t)return[253,255&t,t>>>8];if(4294967296>t)return[254].concat(Crypto.util.wordsToBytes([t]).reverse());throw"quadword not implemented"},valueToBigInt:function(t){return t instanceof BigInteger?t:BigInteger.fromByteArrayUnsigned(t)},formatValue:function(t){for(var e=this.valueToBigInt(t).toString(),i=e.length>8?e.substr(0,e.length-8):"0",r=e.length>8?e.substr(e.length-8):e;r.length<8;)r="0"+r;for(r=r.replace(/0*$/,"");r.length<2;)r+="0";return i+"."+r},parseValue:function(t){for(var e=t.split("."),i=e[0],r=e[1]||"0";r.length<8;)r+="0";r=r.replace(/^0+/g,"");var n=BigInteger.valueOf(parseInt(i));return n=n.multiply(BigInteger.valueOf(1e8)),n=n.add(BigInteger.valueOf(parseInt(r)))},sha256ripe160:function(t){return Crypto.RIPEMD160(Crypto.SHA256(t,{asBytes:!0}),{asBytes:!0})}};for(var i in Crypto.util)Crypto.util.hasOwnProperty(i)&&(Bitcoin.Util[i]=Crypto.util[i]);var rng_state,rng_pool,rng_pptr;if(null==rng_pool){rng_pool=new Array,rng_pptr=0;var t;if("Netscape"==navigator.appName&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;t<z.length;++t)rng_pool[rng_pptr++]=255&z.charCodeAt(t)}for(;rng_psize>rng_pptr;)t=Math.floor(65536*Math.random()),rng_pool[rng_pptr++]=t>>>8,rng_pool[rng_pptr++]=255&t;rng_pptr=0,rng_seed_time()}SecureRandom.prototype.nextBytes=rng_get_bytes,ECFieldElementFp.prototype.equals=feFpEquals,ECFieldElementFp.prototype.toBigInteger=feFpToBigInteger,ECFieldElementFp.prototype.negate=feFpNegate,ECFieldElementFp.prototype.add=feFpAdd,ECFieldElementFp.prototype.subtract=feFpSubtract,ECFieldElementFp.prototype.multiply=feFpMultiply,ECFieldElementFp.prototype.square=feFpSquare,ECFieldElementFp.prototype.divide=feFpDivide,ECPointFp.prototype.getX=pointFpGetX,ECPointFp.prototype.getY=pointFpGetY,ECPointFp.prototype.equals=pointFpEquals,ECPointFp.prototype.isInfinity=pointFpIsInfinity,ECPointFp.prototype.negate=pointFpNegate,ECPointFp.prototype.add=pointFpAdd,ECPointFp.prototype.twice=pointFpTwice,ECPointFp.prototype.multiply=pointFpMultiply,ECPointFp.prototype.multiplyTwo=pointFpMultiplyTwo,ECCurveFp.prototype.getQ=curveFpGetQ,ECCurveFp.prototype.getA=curveFpGetA,ECCurveFp.prototype.getB=curveFpGetB,ECCurveFp.prototype.equals=curveFpEquals,ECCurveFp.prototype.getInfinity=curveFpGetInfinity,ECCurveFp.prototype.fromBigInteger=curveFpFromBigInteger,ECCurveFp.prototype.decodePointHex=curveFpDecodePointHex,module.exports.ECPointFp=ECPointFp,module.exports.ECFieldElementFp=ECFieldElementFp,X9ECParameters.prototype.getCurve=x9getCurve,X9ECParameters.prototype.getG=x9getG,X9ECParameters.prototype.getN=x9getN,X9ECParameters.prototype.getH=x9getH,module.exports.getSECCurveByName=getSECCurveByName,ECFieldElementFp.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},ECPointFp.prototype.getEncoded=function(t){var e=this.getX().toBigInteger(),i=this.getY().toBigInteger(),r=integerToBytes(e,32);return t?r.unshift(i.isEven()?2:3):(r.unshift(4),r=r.concat(integerToBytes(i,32))),r},ECPointFp.decodeFrom=function(t,e){var i=e[0],r=e.length-1;if(4===i)var n=e.slice(1,1+r/2),o=e.slice(1+r/2,1+r),s=BigInteger.fromByteArrayUnsigned(n),u=BigInteger.fromByteArrayUnsigned(o);else{var n=e.slice(1),s=BigInteger.fromByteArrayUnsigned(n),p=t.getQ(),h=s.multiply(s).multiply(s).add(new BigInteger("7")).mod(p),a=p.add(new BigInteger("1")).divide(new BigInteger("4")),u=h.modPow(a,p);u.mod(new BigInteger("2")).toString()!=""+i%2&&(u=p.subtract(u))}return new ECPointFp(t,t.fromBigInteger(s),t.fromBigInteger(u))},ECPointFp.prototype.add2D=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;if(this.x.equals(t.x))return this.y.equals(t.y)?this.twice():this.curve.getInfinity();var e=t.x.subtract(this.x),i=t.y.subtract(this.y),r=i.divide(e),n=r.square().subtract(this.x).subtract(t.x),o=r.multiply(this.x.subtract(n)).subtract(this.y);return new ECPointFp(this.curve,n,o)},ECPointFp.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=this.curve.fromBigInteger(BigInteger.valueOf(2)),e=this.curve.fromBigInteger(BigInteger.valueOf(3)),i=this.x.square().multiply(e).add(this.curve.a).divide(this.y.multiply(t)),r=i.square().subtract(this.x.multiply(t)),n=i.multiply(this.x.subtract(r)).subtract(this.y);return new ECPointFp(this.curve,r,n)},ECPointFp.prototype.multiply2D=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,i=t,r=i.multiply(new BigInteger("3")),n=this.negate(),o=this;for(e=r.bitLength()-2;e>0;--e){o=o.twice();var s=r.testBit(e),u=i.testBit(e);s!=u&&(o=o.add2D(s?this:n))}return o},ECPointFp.prototype.isOnCurve=function(){var t=this.getX().toBigInteger(),e=this.getY().toBigInteger(),i=this.curve.getA().toBigInteger(),r=this.curve.getB().toBigInteger(),n=this.curve.getQ(),o=e.multiply(e).mod(n),s=t.multiply(t).multiply(t).add(i.multiply(t)).add(r).mod(n);return o.equals(s)},ECPointFp.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},ECPointFp.prototype.validate=function(){var t=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var e=this.getX().toBigInteger(),i=this.getY().toBigInteger();if(e.compareTo(BigInteger.ONE)<0||e.compareTo(t.subtract(BigInteger.ONE))>0)throw new Error("x coordinate out of bounds");if(i.compareTo(BigInteger.ONE)<0||i.compareTo(t.subtract(BigInteger.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(t).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0},Bitcoin.ECDSA=function(){function t(t,e,i,r){for(var n=Math.max(e.bitLength(),r.bitLength()),o=t.add2D(i),s=t.curve.getInfinity(),u=n-1;u>=0;--u)s=s.twice2D(),s.z=BigInteger.ONE,e.testBit(u)?s=s.add2D(r.testBit(u)?o:t):r.testBit(u)&&(s=s.add2D(i));return s}var e=getSECCurveByName("secp256k1"),i=new SecureRandom,r=null,n={getBigRandom:function(t){return new BigInteger(t.bitLength(),i).mod(t.subtract(BigInteger.ONE)).add(BigInteger.ONE)},sign:function(t,i){var r=i,o=e.getN(),s=BigInteger.fromByteArrayUnsigned(t);do var u=n.getBigRandom(o),p=e.getG(),h=p.multiply(u),a=h.getX().toBigInteger().mod(o);while(a.compareTo(BigInteger.ZERO)<=0);var F=u.modInverse(o).multiply(s.add(r.multiply(a))).mod(o);return n.serializeSig(a,F)},verify:function(t,i,r){var o,s;if(Bitcoin.Util.isArray(i)){var u=n.parseSig(i);o=u.r,s=u.s}else{if("object"!=typeof i||!i.r||!i.s)throw"Invalid value for signature";o=i.r,s=i.s}var p;if(r instanceof ECPointFp)p=r;else{if(!Bitcoin.Util.isArray(r))throw"Invalid format for pubkey value, must be byte array or ECPointFp";p=ECPointFp.decodeFrom(e.getCurve(),r)}var h=BigInteger.fromByteArrayUnsigned(t);return n.verifyRaw(h,o,s,p)},verifyRaw:function(t,i,r,n){var o=e.getN(),s=e.getG();if(i.compareTo(BigInteger.ONE)<0||i.compareTo(o)>=0)return!1;if(r.compareTo(BigInteger.ONE)<0||r.compareTo(o)>=0)return!1;var u=r.modInverse(o),p=t.multiply(u).mod(o),h=i.multiply(u).mod(o),a=s.multiply(p).add(n.multiply(h)),F=a.getX().toBigInteger().mod(o);return F.equals(i)},serializeSig:function(t,e){var i=t.toByteArraySigned(),r=e.toByteArraySigned(),n=[];return n.push(2),n.push(i.length),n=n.concat(i),n.push(2),n.push(r.length),n=n.concat(r),n.unshift(n.length),n.unshift(48),n},parseSig:function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(e=2,2!=t[e])throw new Error("First element in signature must be a DERInteger");var i=t.slice(e+2,e+2+t[e+1]);if(e+=2+t[e+1],2!=t[e])throw new Error("Second element in signature must be a DERInteger");var r=t.slice(e+2,e+2+t[e+1]);e+=2+t[e+1];var n=BigInteger.fromByteArrayUnsigned(i),o=BigInteger.fromByteArrayUnsigned(r);return{r:n,s:o}},parseSigCompact:function(t){if(65!==t.length)throw"Signature has the wrong length";var i=t[0]-27;if(0>i||i>7)throw"Invalid signature type";var r=e.getN(),n=BigInteger.fromByteArrayUnsigned(t.slice(1,33)).mod(r),o=BigInteger.fromByteArrayUnsigned(t.slice(33,65)).mod(r);return{r:n,s:o,i:i}},recoverPubKey:function(i,o,s,u){u=3&u;var p=1&u,h=u>>1,a=e.getN(),F=e.getG(),g=e.getCurve(),f=g.getQ(),c=g.getA().toBigInteger(),l=g.getB().toBigInteger();r||(r=f.add(BigInteger.ONE).divide(BigInteger.valueOf(4)));var B=h?i.add(a):i,m=B.multiply(B).multiply(B).add(c.multiply(B)).add(l).mod(f),y=m.modPow(r,f),d=(y.isEven()?u%2:(u+1)%2,(y.isEven()?!p:p)?y:f.subtract(y)),v=new ECPointFp(g,g.fromBigInteger(B),g.fromBigInteger(d));v.validate();var b=BigInteger.fromByteArrayUnsigned(s),I=BigInteger.ZERO.subtract(b).mod(a),E=i.modInverse(a),C=t(v,o,F,I).multiply(E);if(C.validate(),!n.verifyRaw(b,i,o,C))throw"Pubkey recovery unsuccessful";var T=new Bitcoin.ECKey;return T.pub=C,T},calcPubkeyRecoveryParam:function(t,e,i,r){for(var n=0;4>n;n++)try{var o=Bitcoin.ECDSA.recoverPubKey(e,i,r,n);if(o.getBitcoinAddress().toString()==t)return n}catch(s){}throw"Unable to find valid recovery factor"}};return n}(),Bitcoin.ECKey=function(){var t=Bitcoin.ECDSA,e=getSECCurveByName("secp256k1"),i=(new SecureRandom,function(r){if(r)r instanceof BigInteger?this.priv=r:Bitcoin.Util.isArray(r)?this.priv=BigInteger.fromByteArrayUnsigned(r):"string"==typeof r&&(this.priv=BigInteger.fromByteArrayUnsigned(51==r.length&&"5"==r[0]?i.decodeString(r):Crypto.util.hexToBytes(r)));else{var n=e.getN();this.priv=t.getBigRandom(n)}this.compressed=!!i.compressByDefault});return i.compressByDefault=!1,i.prototype.setCompressed=function(t){this.compressed=!!t},i.prototype.getPub=function(){return this.getPubPoint().getEncoded(this.compressed)},i.prototype.getPubPoint=function(){return this.pub||(this.pub=e.getG().multiply(this.priv)),this.pub},i.prototype.getPubKeyHash=function(){return this.pubKeyHash?this.pubKeyHash:this.pubKeyHash=Bitcoin.Util.sha256ripe160(this.getPub())},i.prototype.getBitcoinAddress=function(){var t=this.getPubKeyHash(),e=new Bitcoin.Address(t);return e},i.prototype.getExportedPrivateKey=function(){for(var t=this.priv.toByteArrayUnsigned();t.length<32;)t.unshift(0);t.unshift(128);var e=Crypto.SHA256(Crypto.SHA256(t,{asBytes:!0}),{asBytes:!0}),i=t.concat(e.slice(0,4));return Bitcoin.Base58.encode(i)},i.prototype.setPub=function(t){this.pub=ECPointFp.decodeFrom(e.getCurve(),t)},i.prototype.toString=function(t){return"base64"===t?Crypto.util.bytesToBase64(this.priv.toByteArrayUnsigned()):Crypto.util.bytesToHex(this.priv.toByteArrayUnsigned())},i.prototype.sign=function(e){return t.sign(e,this.priv)},i.prototype.verify=function(e,i){return t.verify(e,i,this.getPub())},i.decodeString=function(t){var e=Bitcoin.Base58.decode(t),i=e.slice(0,33),r=Crypto.SHA256(Crypto.SHA256(i,{asBytes:!0}),{asBytes:!0});if(r[0]!=e[33]||r[1]!=e[34]||r[2]!=e[35]||r[3]!=e[36])throw"Checksum validation failed!";var n=i.shift();if(128!=n)throw"Version "+n+" not supported!";return i},i}(),module.exports.ECKey=Bitcoin.ECKey;
},{}],"./config":[function(require,module,exports){
module.exports=require('4itQ50');
},{}],"4itQ50":[function(require,module,exports){
module.exports={network:"livenet",logger:"normal"};
},{}],"./const":[function(require,module,exports){
module.exports=require('f08cvL');
},{}],"f08cvL":[function(require,module,exports){
MSG={TX:1,BLOCK:2,FILTERED_BLOCK:3},MSG.to_str=function(t){switch(t){case MSG.TX:return"transaction";case MSG.BLOCK:return"block";case MSG.FILTERED_BLOCK:return"filtered block";default:return"unknown"}},exports.MSG=MSG;
},{}],"ULNIu2":[function(require,module,exports){
(function(e){var i=(require("bufferput"),require("buffertools")),r=function(i){return new e(i,"hex")};exports.livenet={name:"livenet",magic:r("f9beb4d9"),addressVersion:0,privKeyVersion:128,P2SHVersion:5,bip32publicVersion:76067358,bip32privateVersion:76066276,genesisBlock:{hash:r("6FE28C0AB6F1B372C1A6A246AE63F74F931E8365E15A089C68D6190000000000"),merkle_root:r("3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A"),height:0,nonce:2083236893,version:1,prev_hash:i.fill(new e(32),0),timestamp:1231006505,bits:486604799}},exports.testnet={name:"testnet",magic:r("0b110907"),addressVersion:111,privKeyVersion:239,P2SHVersion:196,bip32publicVersion:70617039,bip32privateVersion:70615956,genesisBlock:{hash:r("43497FD7F826957108F4A30FD9CEC3AEBA79972084E90EAD01EA330900000000"),merkle_root:r("3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A"),height:0,nonce:414098458,version:1,prev_hash:i.fill(new e(32),0),timestamp:1296688602,bits:486604799}}}).call(this,require("buffer").Buffer);
},{"buffer":75,"bufferput":"aXRuS6","buffertools":"fugeBw"}],"./networks":[function(require,module,exports){
module.exports=require('ULNIu2');
},{}],"base58-native":[function(require,module,exports){
module.exports=require('xtP2pj');
},{}],"xtP2pj":[function(require,module,exports){
(function(e){function r(r){return new e(t.createHash("sha256").update(r).digest("binary"),"binary")}function n(e){return r(r(e))}for(var t=require("crypto"),o=require("bignum"),i=new e(1024),c=new e(0),u="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",f=u[0],a=new e(u,"ascii"),l={},d=0;d<u.length;d++)l[u[d]]=d;var h={encode:function(r){var n,t,c=o.fromBuffer(r);n=r.length<512?i:new e(r.length<<1);for(var u=n.length-1;c.gt(0);)t=c.mod(58),c=c.div(58),n[u]=a[t.toNumber()],u--;for(var f=0;0==r[f];)n[u]=a[0],f++,u--;return n.slice(u+1,n.length).toString("ascii")},decode:function(r){if(0==r.length)return c;for(var n=o(0),t=0;t<r.length;t++)n.mul(58),n=n.mul(58),n=n.add(l[r[t]]);for(var t=0;t<r.length&&r[t]==f;)t++;if(t>0){var i=new e(t);return i.fill(0),t==r.length?i:(n=n.toBuffer(),e.concat([i,n],t+n.length))}return n.toBuffer()}},s={encode:function(r){var t=new e(r.length+4),o=n(r);return r.copy(t),o.copy(t,r.length),h.encode(t)},decode:function(e){var r=h.decode(e);if(r.length<4)throw new Error("invalid input: too short");var t=r.slice(0,-4),o=r.slice(-4),i=n(t),c=i.slice(0,4);if(o.toString()!=c.toString())throw new Error("checksum mismatch");return t}};exports.setBuffer=function(e){i=e},exports.base58=h,exports.base58Check=s,exports.encode=h.encode,exports.decode=h.decode}).call(this,require("buffer").Buffer);
},{"bignum":"J4nwo8","buffer":75,"crypto":79}],62:[function(require,module,exports){
(function(t){function n(t){for(var n=0,e=0;e<t.length;e++)n+=Math.pow(256,e)*t[e];return n}function e(t){for(var n=0,e=0;e<t.length;e++)n+=Math.pow(256,t.length-e-1)*t[e];return n}function r(t){var n=e(t);return 128==(128&t[0])&&(n-=Math.pow(256,t.length)),n}function o(t){var e=n(t);return 128==(128&t[t.length-1])&&(e-=Math.pow(256,t.length)),e}function i(t){var i={};return[1,2,4,8].forEach(function(u){var s=8*u;i["word"+s+"le"]=i["word"+s+"lu"]=t(u,n),i["word"+s+"ls"]=t(u,o),i["word"+s+"be"]=i["word"+s+"bu"]=t(u,e),i["word"+s+"bs"]=t(u,r)}),i.word8=i.word8u=i.word8be,i.word8s=i.word8bs,i}var u=require("chainsaw"),s=require("events").EventEmitter,f=require("buffers"),c=require("./lib/vars.js"),l=require("stream").Stream;exports=module.exports=function(n,e){if(t.isBuffer(n))return exports.parse(n);var r=exports.stream();return n&&n.pipe?n.pipe(r):n&&(n.on(e||"data",function(t){r.write(t)}),n.on("end",function(){r.end()})),r},exports.stream=function(n){function e(t,n,e){a={bytes:t,skip:e,cb:function(t){a=null,n(t)}},r()}function r(){if(!a)return void(b&&(w=!0));if("function"==typeof a)a();else{var t=p+a.bytes;if(g.length>=t){var n;null==p?(n=g.splice(0,t),a.skip||(n=n.slice())):(a.skip||(n=g.slice(p,t)),p=t),a.skip?a.cb():a.cb(n)}}}function o(n){function o(){w||n.next()}var u=i(function(t,n){return function(r){e(t,function(t){v.set(r,n(t)),o()})}});return u.tap=function(t){n.nest(t,v.store)},u.into=function(t,e){v.get(t)||v.set(t,{});var r=v;v=c(r.get(t)),n.nest(function(){e.apply(this,arguments),this.tap(function(){v=r})},v.store)},u.flush=function(){v.store={},o()},u.loop=function(t){var e=!1;n.nest(!1,function r(){this.vars=v.store,t.call(this,function(){e=!0,o()},v.store),this.tap(function(){e?n.next():r.call(this)}.bind(this))},v.store)},u.buffer=function(t,n){"string"==typeof n&&(n=v.get(n)),e(n,function(n){v.set(t,n),o()})},u.skip=function(t){"string"==typeof t&&(t=v.get(t)),e(t,function(){o()})},u.scan=function(n,e){if("string"==typeof e)e=new t(e);else if(!t.isBuffer(e))throw new Error("search must be a Buffer or a string");var i=0;a=function(){var t=g.indexOf(e,p+i),u=t-p-i;-1!==t?(a=null,null!=p?(v.set(n,g.slice(p,p+i+u)),p+=i+u+e.length):(v.set(n,g.slice(0,i+u)),g.splice(0,i+u+e.length)),o(),r()):u=Math.max(g.length-e.length-p-i,0),i+=u},r()},u.peek=function(t){p=0,n.nest(function(){t.call(this,v.store),this.tap(function(){p=null})})},u}if(n)return exports.apply(null,arguments);var a=null,p=null,h=u.light(o);h.writable=!0;var g=f();h.write=function(t){g.push(t),r()};var v=c(),w=!1,b=!1;return h.end=function(){b=!0},h.pipe=l.prototype.pipe,Object.getOwnPropertyNames(s.prototype).forEach(function(t){h[t]=s.prototype[t]}),h},exports.parse=function(n){var e=i(function(t,i){return function(u){if(r+t<=n.length){var s=n.slice(r,r+t);r+=t,o.set(u,i(s))}else o.set(u,null);return e}}),r=0,o=c();return e.vars=o.store,e.tap=function(t){return t.call(e,o.store),e},e.into=function(t,n){o.get(t)||o.set(t,{});var r=o;return o=c(r.get(t)),n.call(e,o.store),o=r,e},e.loop=function(t){for(var n=!1,r=function(){n=!0};n===!1;)t.call(e,r,o.store);return e},e.buffer=function(t,i){"string"==typeof i&&(i=o.get(i));var u=n.slice(r,Math.min(n.length,r+i));return r+=i,o.set(t,u),e},e.skip=function(t){return"string"==typeof t&&(t=o.get(t)),r+=t,e},e.scan=function(i,u){if("string"==typeof u)u=new t(u);else if(!t.isBuffer(u))throw new Error("search must be a Buffer or a string");o.set(i,null);for(var s=0;s+r<=n.length-u.length+1;s++){for(var f=0;f<u.length&&n[r+s+f]===u[f];f++);if(f===u.length)break}return o.set(i,n.slice(r,r+s)),r+=s+u.length,e},e.peek=function(t){var n=r;return t.call(e,o.store),r=n,e},e.flush=function(){return o.store={},e},e.eof=function(){return r>=n.length},e}}).call(this,require("buffer").Buffer);
},{"./lib/vars.js":63,"buffer":75,"buffers":"OBo3aV","chainsaw":64,"events":84,"stream":98}],63:[function(require,module,exports){
module.exports=function(t){function n(t,n){var e=r.store,o=t.split(".");o.slice(0,-1).forEach(function(t){void 0===e[t]&&(e[t]={}),e=e[t]});var u=o[o.length-1];return 1==arguments.length?e[u]:e[u]=n}var r={get:function(t){return n(t)},set:function(t,r){return n(t,r)},store:t||{}};return r};
},{}],64:[function(require,module,exports){
(function(n){function t(n){var e=t.saw(n,{}),r=n.call(e.handlers,e);return void 0!==r&&(e.handlers=r),e.record(),e.chain()}function e(n){n.step=0,n.pop=function(){return n.actions[n.step++]},n.trap=function(t,e){var r=Array.isArray(t)?t:[t];n.actions.push({path:r,step:n.step,cb:e,trap:!0})},n.down=function(t){var e=(Array.isArray(t)?t:[t]).join("/"),r=n.actions.slice(n.step).map(function(t){return t.trap&&t.step<=n.step?!1:t.path.join("/")==e}).indexOf(!0);r>=0?n.step+=r:n.step=n.actions.length;var a=n.actions[n.step-1];a&&a.trap?(n.step=a.step,a.cb()):n.next()},n.jump=function(t){n.step=t,n.next()}}var r=require("traverse"),a=require("events").EventEmitter;module.exports=t,t.light=function(n){var e=t.saw(n,{}),r=n.call(e.handlers,e);return void 0!==r&&(e.handlers=r),e.chain()},t.saw=function(s,o){var i=new a;return i.handlers=o,i.actions=[],i.chain=function(){var t=r(i.handlers).map(function(n){if(this.isRoot)return n;var e=this.path;"function"==typeof n&&this.update(function(){return i.actions.push({path:e,args:[].slice.call(arguments)}),t})});return n.nextTick(function(){i.emit("begin"),i.next()}),t},i.pop=function(){return i.actions.shift()},i.next=function(){var n=i.pop();if(n){if(!n.trap){var t=i.handlers;n.path.forEach(function(n){t=t[n]}),t.apply(i.handlers,n.args)}}else i.emit("end")},i.nest=function(n){var e=[].slice.call(arguments,1),r=!0;if("boolean"==typeof n){var r=n;n=e.shift()}var a=t.saw(s,{}),o=s.call(a.handlers,a);void 0!==o&&(a.handlers=o),"undefined"!=typeof i.step&&a.record(),n.apply(a.chain(),e),r!==!1&&a.on("end",i.next)},i.record=function(){e(i)},["trap","down","jump"].forEach(function(n){i[n]=function(){throw new Error("To use the trap, down and jump features, please call record() first to start recording actions.")}}),i}}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"));
},{"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91,"events":84,"traverse":65}],65:[function(require,module,exports){
function Traverse(e){return this instanceof Traverse?void(this.value=e):new Traverse(e)}function walk(e,t,r){var n=[],o=[],a=!0;return function i(e){var c=r?copy(e):e,s={},f={node:c,node_:e,path:[].concat(n),parent:o.slice(-1)[0],key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(e){f.isRoot||(f.parent.node[f.key]=e),f.node=e},"delete":function(){delete f.parent.node[f.key]},remove:function(){Array.isArray(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key]},before:function(e){s.before=e},after:function(e){s.after=e},pre:function(e){s.pre=e},post:function(e){s.post=e},stop:function(){a=!1}};if(!a)return f;if("object"==typeof c&&null!==c){f.isLeaf=0==Object.keys(c).length;for(var u=0;u<o.length;u++)if(o[u].node_===e){f.circular=o[u];break}}else f.isLeaf=!0;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot;var l=t.call(f,f.node);if(void 0!==l&&f.update&&f.update(l),s.before&&s.before.call(f,f.node),"object"==typeof f.node&&null!==f.node&&!f.circular){o.push(f);var p=Object.keys(f.node);p.forEach(function(e,t){n.push(e),s.pre&&s.pre.call(f,f.node[e],e);var o=i(f.node[e]);r&&Object.hasOwnProperty.call(f.node,e)&&(f.node[e]=o.node),o.isLast=t==p.length-1,o.isFirst=0==t,s.post&&s.post.call(f,o),n.pop()}),o.pop()}return s.after&&s.after.call(f,f.node),f}(e).node}function copy(e){if("object"==typeof e&&null!==e){var t;return t=Array.isArray(e)?[]:e instanceof Date?new Date(e):e instanceof Boolean?new Boolean(e):e instanceof Number?new Number(e):e instanceof String?new String(e):Object.create(Object.getPrototypeOf(e)),Object.keys(e).forEach(function(r){t[r]=e[r]}),t}return e}module.exports=Traverse,Traverse.prototype.get=function(e){for(var t=this.value,r=0;r<e.length;r++){var n=e[r];if(!Object.hasOwnProperty.call(t,n)){t=void 0;break}t=t[n]}return t},Traverse.prototype.set=function(e,t){for(var r=this.value,n=0;n<e.length-1;n++){var o=e[n];Object.hasOwnProperty.call(r,o)||(r[o]={}),r=r[o]}return r[e[n]]=t,t},Traverse.prototype.map=function(e){return walk(this.value,e,!0)},Traverse.prototype.forEach=function(e){return this.value=walk(this.value,e,!1),this.value},Traverse.prototype.reduce=function(e,t){var r=1===arguments.length,n=r?this.value:t;return this.forEach(function(t){this.isRoot&&r||(n=e.call(this,n,t))}),n},Traverse.prototype.deepEqual=function(e){if(1!==arguments.length)throw new Error("deepEqual requires exactly one object to compare against");var t=!0,r=e;return this.forEach(function(n){var o=function(){return void(t=!1)}.bind(this);if(!this.isRoot){if("object"!=typeof r)return o();r=r[this.key]}var a=r;this.post(function(){r=a});var i=function(e){return Object.prototype.toString.call(e)};if(this.circular)Traverse(e).get(this.circular.path)!==a&&o();else if(typeof a!=typeof n)o();else if(null===a||null===n||void 0===a||void 0===n)a!==n&&o();else if(a.__proto__!==n.__proto__)o();else if(a===n);else if("function"==typeof a)a instanceof RegExp?a.toString()!=n.toString()&&o():a!==n&&o();else if("object"==typeof a)if("[object Arguments]"===i(n)||"[object Arguments]"===i(a))i(a)!==i(n)&&o();else if(a instanceof Date||n instanceof Date)a instanceof Date&&n instanceof Date&&a.getTime()===n.getTime()||o();else{var c=Object.keys(a),s=Object.keys(n);if(c.length!==s.length)return o();for(var f=0;f<c.length;f++){var u=c[f];Object.hasOwnProperty.call(n,u)||o()}}}),t},Traverse.prototype.paths=function(){var e=[];return this.forEach(function(){e.push(this.path)}),e},Traverse.prototype.nodes=function(){var e=[];return this.forEach(function(){e.push(this.node)}),e},Traverse.prototype.clone=function(){var e=[],t=[];return function r(n){for(var o=0;o<e.length;o++)if(e[o]===n)return t[o];if("object"==typeof n&&null!==n){var a=copy(n);return e.push(n),t.push(a),Object.keys(n).forEach(function(e){a[e]=r(n[e])}),e.pop(),t.pop(),a}return n}(this.value)},Object.keys(Traverse.prototype).forEach(function(e){Traverse[e]=function(t){var r=[].slice.call(arguments,1),n=Traverse(t);return n[e].apply(n,r)}});
},{}],66:[function(require,module,exports){
(function(e,r){function o(e){"string"==typeof e?e={bindings:e}:e||(e={}),e.__proto__=d,e.module_root||(e.module_root=exports.getRoot(exports.getFileName())),".node"!=i.extname(e.bindings)&&(e.bindings+=".node");for(var r,o,n,s=[],a=0,l=e.try.length;l>a;a++){r=t.apply(null,e.try[a].map(function(r){return e[r]||r})),s.push(r);try{return o=e.path?require.resolve(r):require(r),e.path||(o.path=r),o}catch(u){if(!/not find/i.test(u.message))throw u}}throw n=new Error("Could not locate the bindings file. Tried:\n"+s.map(function(r){return e.arrow+r}).join("\n")),n.tries=s,n}var n=require("fs"),i=require("path"),t=i.join,s=i.dirname,a=n.existsSync||i.existsSync,d={arrow:e.env.NODE_BINDINGS_ARROW||" → ",compiled:e.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:e.platform,arch:e.arch,version:e.versions.node,bindings:"bindings.node","try":[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"]]};module.exports=exports=o,exports.getFileName=function(){var e,o=Error.prepareStackTrace,n=Error.stackTraceLimit,i={};return Error.stackTraceLimit=10,Error.prepareStackTrace=function(o,n){for(var i=0,t=n.length;t>i;i++)if(e=n[i].getFileName(),e!==r)return},Error.captureStackTrace(i),i.stack,Error.prepareStackTrace=o,Error.stackTraceLimit=n,e},exports.getRoot=function(r){for(var o,n=s(r);;){if("."===n&&(n=e.cwd()),a(t(n,"package.json"))||a(t(n,"node_modules")))return n;if(o===n)throw new Error('Could not find module root given file: "'+r+'". Do you have a `package.json` file? ');o=n,n=t(n,"..")}}}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"/node_modules/bindings/bindings.js");
},{"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91,"fs":71,"path":92}],"J4nwo8":[function(require,module,exports){
(function(e){function n(e,i){var s,o,l,c,g,p,d=this;if(!(d instanceof n))return new n(e,i);if(e instanceof n){if(O=0,i===s)return d.s=e.s,d.e=e.e,void(d.c=(e=e.c)?e.slice():e);e+=""}if(""===e&&(e=0),"string"!=typeof e&&(e=(l="number"==typeof e||"[object Number]"==Object.prototype.toString.call(e))&&0===e&&0>1/e?"-0":e+""),p=e,i===s&&S.test(e))d.s="-"==e.charAt(0)?(e=e.slice(1),-1):1;else{if(10==i)return u(e,h,a);if(e=E.call(e).replace(/^\+(?!-)/,""),d.s="-"==e.charAt(0)?(e=e.replace(/^-(?!-)/,""),-1):1,null!=i?i!=(0|i)&&w||(f=!(i>=2&&65>i))?(t(i,2),g=S.test(e)):(c="["+N.slice(0,i=0|i)+"]+",e=e.replace(/\.$/,"").replace(/^\./,"0."),(g=new RegExp("^"+c+"(?:\\."+c+")?$",37>i?"i":"").test(e))?(l&&(e.replace(/^0\.0*|\./,"").length>15&&t(p,0),l=!l),e=r(e,10,i,d.s)):"Infinity"!=e&&"NaN"!=e&&(t(p,1,i),e="NaN")):g=S.test(e),!g)return d.c=d.e=null,"Infinity"!=e&&("NaN"!=e&&t(p,3),d.s=null),void(O=0)}for((s=e.indexOf("."))>-1&&(e=e.replace(".","")),(o=e.search(/e/i))>0?(0>s&&(s=o),s+=+e.slice(o+1),e=e.substring(0,o)):0>s&&(s=e.length),o=0;"0"==e.charAt(o);o++);if(i=e.length,l&&i>15&&e.slice(o).length>15&&t(p,0),O=0,(s-=o+1)>v)d.c=d.e=null;else if(o==i||m>s)d.c=[d.e=0];else{for(;"0"==e.charAt(--i););for(d.e=s,d.c=[],s=0;i>=o;d.c[s++]=+e.charAt(o++));}}function t(e,n,t,r,i,s){if(w){var o,u=["new BigNumber","cmp","div","eq","gt","gte","lt","lte","minus","mod","plus","times","toFr"][O?0>O?-O:O:0>1/O?1:0]+"()",l=f?" out of range":" not a"+(i?" non-zero":"n")+" integer";throw l=([u+" number type has more than 15 significant digits",u+" not a base "+t+" number",u+" base"+l,u+" not a number"][n]||t+"() "+n+(s?" not a boolean or binary digit":l+(r?" or not ["+(f?" negative, positive":" integer, integer")+" ]":"")))+": "+e,f=O=0,o=new Error(l),o.name="BigNumber Error",o}}function r(e,t,r,s){function o(e,n){var i,s,o=0,u=e.length,f=[0];for(n=n||r;u>o;o++){for(s=f.length,i=0;s>i;f[i]*=n,i++);for(f[0]+=N.indexOf(e.charAt(o)),i=0;i<f.length;i++)f[i]>t-1&&(null==f[i+1]&&(f[i+1]=0),f[i+1]+=f[i]/t^0,f[i]%=t)}return f.reverse()}function u(e){for(var n=0,t=e.length,r="";t>n;r+=N.charAt(e[n++]));return r}var f,l,c,h,a,g;if(37>r&&(e=e.toLowerCase()),(f=e.indexOf("."))>-1)if(f=e.length-f-1,l=o(new n(r).pow(f).toF(),10),h=e.split("."),c=o(h[1]),h=o(h[0]),g=i(c,l,c.length-l.length,s,t,1&h[h.length-1]),a=g.c,f=g.e){for(;++f;a.unshift(0));e=u(h)+"."+u(a)}else a[0]?h[f=h.length-1]<t-1?(++h[f],e=u(h)):e=new n(u(h),t).plus(R).toS(t):e=u(h);else e=u(o(e));return e}function i(e,t,r,i,s,u){var f,l,c,a,g,p=t.slice(),w=f=t.length,d=e.length,b=e.slice(0,f),N=b.length,O=new n(R),S=O.c=[],E=0,A=h+(O.e=r)+1;for(O.s=i,i=0>A?0:A;N++<f;b.push(0));p.unshift(0);do{for(c=0;s>c;c++){if(f!=(N=b.length))a=f>N?1:-1;else for(g=-1,a=0;++g<f;)if(t[g]!=b[g]){a=t[g]>b[g]?1:-1;break}if(!(0>a))break;for(l=N==f?t:p;N;){if(b[--N]<l[N]){for(g=N;g&&!b[--g];b[g]=s-1);--b[g],b[N]+=s}b[N]-=l[N]}for(;!b[0];b.shift());}S[E++]=a?c:++c,b[0]&&a?b[N]=e[w]||0:b=[e[w]]}while((w++<d||null!=b[0])&&i--);return S[0]||1==E||(--O.e,S.shift()),E>A&&o(O,h,s,u,null!=b[0]),O.e>v?O.c=O.e=null:O.e<m&&(O.c=[O.e=0]),O}function s(e,t,r){var i=t-(e=new n(e)).e,s=e.c;if(!s)return e.toS();for(s.length>++t&&o(e,i,10),i=0==s[0]?i+1:r?t:e.e+i+1;s.length<i;s.push(0));return i=e.e,1==r||2==r&&(--t<i||g>=i)?(e.s<0&&s[0]?"-":"")+(s.length>1?(s.splice(1,0,"."),s.join("")):s[0])+(0>i?"e":"e+")+i:e.toS()}function o(e,n,t,r,i){var s=e.c,o=e.s<0,u=t/2,f=e.e+n+1,l=s[f],c=i||0>f||null!=s[f+1];if(i=4>a?(null!=l||c)&&(0==a||2==a&&!o||3==a&&o):l>u||l==u&&(4==a||c||6==a&&(1&s[f-1]||!n&&r)||7==a&&!o||8==a&&o),1>f||!s[0])return s.length=0,s.push(0),i?(s[0]=1,e.e=-n):e.e=0,e;if(s.length=f--,i)for(--t;++s[f]>t;)s[f]=0,f--||(++e.e,s.unshift(1));for(f=s.length;!s[--f];s.pop());return e}function u(e,t,r){var i=a;return a=r,e=new n(e),e.c&&o(e,t,10),a=i,e}var f,l=1e9,c=1e6,h=20,a=4,g=-7,p=21,m=-l,v=l,w=!0,d=parseInt,b=n.prototype,N="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",O=0,S=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,E=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},R=n(1);n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.fromBuffer=function(e,t){t||(t={});var r={1:"big","-1":"little"}[t.endian]||t.endian||"big",i="auto"===t.size?Math.ceil(e.length):t.size||1;if(e.length%i!==0)throw new RangeError("Buffer length ("+e.length+") must be a multiple of size ("+i+")");for(var s=[],o=0;o<e.length;o+=i){for(var u=[],f=0;i>f;f++)u.push(e[o+("big"===r?f:i-f-1)]);s.push(u.map(function(e){return(16>e?"0":"")+e.toString(16)}).join(""))}return n(s.join(""),16)},n.config=function(){var e,n,r=0,i={},s=arguments,o=s[0],u="config",c=function(e,n,t){return!((f=n>e||e>t)||d(e)!=e&&0!==e)},b=o&&"object"==typeof o?function(){return o.hasOwnProperty(n)?null!=(e=o[n]):void 0}:function(){return s.length>r?null!=(e=s[r++]):void 0};return b(n="DECIMAL_PLACES")&&(c(e,0,l)?h=0|e:t(e,n,u)),i[n]=h,b(n="ROUNDING_MODE")&&(c(e,0,8)?a=0|e:t(e,n,u)),i[n]=a,b(n="EXPONENTIAL_AT")&&(c(e,-l,l)?g=-(p=~~(0>e?-e:+e)):!f&&e&&c(e[0],-l,0)&&c(e[1],0,l)?(g=~~e[0],p=~~e[1]):t(e,n,u,1)),i[n]=[g,p],b(n="RANGE")&&(c(e,-l,l)&&~~e?m=-(v=~~(0>e?-e:+e)):!f&&e&&c(e[0],-l,-1)&&c(e[1],1,l)?(m=~~e[0],v=~~e[1]):t(e,n,u,1,1)),i[n]=[m,v],b(n="ERRORS")&&(e===!!e||1===e||0===e?(f=O=0,d=(w=!!e)?parseInt:parseFloat):t(e,n,u,0,0,1)),i[n]=w,i},b.abs=b.absoluteValue=function(){var e=new n(this);return e.s<0&&(e.s=1),e},b.bitLength=function(){return this.toString(2).length},b.ceil=function(){return u(this,0,2)},b.comparedTo=b.cmp=function(e,t){var r,i=this,s=i.c,o=(O=-O,e=new n(e,t)).c,u=i.s,f=e.s,l=i.e,c=e.e;if(!u||!f)return null;if(r=s&&!s[0],t=o&&!o[0],r||t)return r?t?0:-f:u;if(u!=f)return u;if(r=0>u,t=l==c,!s||!o)return t?0:!s^r?1:-1;if(!t)return l>c^r?1:-1;for(u=-1,f=(l=s.length)<(c=o.length)?l:c;++u<f;)if(s[u]!=o[u])return s[u]>o[u]^r?1:-1;return l==c?0:l>c^r?1:-1},b.dividedBy=b.div=function(e,t){var r=this.c,s=this.e,o=this.s,u=(O=2,e=new n(e,t)).c,f=e.e,l=e.s,c=o==l?1:-1;return(s||r&&r[0])&&(f||u&&u[0])?i(r,u,s-f,c,10):new n(o&&l&&(r?!u||r[0]!=u[0]:u)?r&&0==r[0]||!u?0*c:c/0:0/0)},b.equals=b.eq=function(e,n){return O=3,0===this.cmp(e,n)},b.floor=function(){return u(this,0,3)},b.greaterThan=b.gt=function(e,n){return O=4,this.cmp(e,n)>0},b.greaterThanOrEqualTo=b.gte=function(e,n){return O=5,1==(n=this.cmp(e,n))||0===n},b.isFinite=b.isF=function(){return!!this.c},b.isNaN=function(){return!this.s},b.isNegative=b.isNeg=function(){return this.s<0},b.isZero=b.isZ=function(){return!!this.c&&0==this.c[0]},b.lessThan=b.lt=function(e,n){return O=6,this.cmp(e,n)<0},b.lessThanOrEqualTo=b.lte=b.le=function(e,n){return O=7,-1==(n=this.cmp(e,n))||0===n},b.minus=b.sub=function(e,t){var r,i,s,o,u=this,f=u.s;if(t=(O=8,e=new n(e,t)).s,!f||!t)return new n(0/0);if(f!=t)return e.s=-t,u.plus(e);var l=u.c,c=u.e,h=e.c,g=e.e;if(!c||!g){if(!l||!h)return l?(e.s=-t,e):new n(h?u:0/0);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new n(l[0]?u:3==a?-0:0)}if(l=l.slice(),f=c-g){for(r=(o=0>f)?(f=-f,l):(g=c,h),r.reverse(),t=f;t--;r.push(0));r.reverse()}else for(s=((o=l.length<h.length)?l:h).length,f=t=0;s>t;t++)if(l[t]!=h[t]){o=l[t]<h[t];break}if(o&&(r=l,l=h,h=r,e.s=-e.s),(t=-((s=l.length)-h.length))>0)for(;t--;l[s++]=0);for(t=h.length;t>f;){if(l[--t]<h[t]){for(i=t;i&&!l[--i];l[i]=9);--l[i],l[t]+=10}l[t]-=h[t]}for(;0==l[--s];l.pop());for(;0==l[0];l.shift(),--g);return(m>g||!l[0])&&(l[0]||(e.s=3==a?-1:1),l=[g=0]),e.c=l,e.e=g,e},b.modulo=b.mod=function(e,t){var r=this,i=r.c,s=(O=9,e=new n(e,t)).c,o=r.s,u=e.s;return t=!o||!u||s&&!s[0],t||i&&!i[0]?new n(t?0/0:r):(r.s=e.s=1,t=1==e.cmp(r),r.s=o,e.s=u,t?new n(r):(o=h,u=a,h=0,a=1,r=r.div(e),h=o,a=u,this.minus(r.times(e))))},b.negated=b.neg=function(){var e=new n(this);return e.s=-e.s||null,e},b.plus=b.add=function(e,t){var r,i=this,s=i.s;if(t=(O=10,e=new n(e,t)).s,!s||!t)return new n(0/0);if(s!=t)return e.s=-t,i.minus(e);var o=i.e,u=i.c,f=e.e,l=e.c;if(!o||!f){if(!u||!l)return new n(s/0);if(!u[0]||!l[0])return l[0]?e:new n(u[0]?i:0*s)}if(u=u.slice(),s=o-f){for(r=s>0?(f=o,l):(s=-s,u),r.reverse();s--;r.push(0));r.reverse()}for(u.length-l.length<0&&(r=l,l=u,u=r),s=l.length,t=0;s;t=(u[--s]=u[s]+l[s]+t)/10^0,u[s]%=10);for(t&&(u.unshift(t),++f>v&&(u=f=null)),s=u.length;0==u[--s];u.pop());return e.c=u,e.e=f,e},b.toPower=b.pow=function(e){var r=0*e==0?0|e:e,i=new n(this),s=new n(R);if(((f=-c>e||e>c)&&(r=1*e/0)||d(e)!=e&&0!==e&&!(r=0/0))&&!t(e,"exponent","pow")||!r)return new n(Math.pow(i.toS(),r));for(r=0>r?-r:r;1&r&&(s=s.times(i)),r>>=1,r;)i=i.times(i);return 0>e?R.div(s):s},b.powm=function(e,n){return this.pow(e).mod(n)},b.round=function(e,n){return e=null==e||((f=0>e||e>l)||d(e)!=e)&&!t(e,"decimal places","round")?0:0|e,n=null==n||((f=0>n||n>8)||d(n)!=n&&0!==n)&&!t(n,"mode","round")?a:0|n,u(this,e,n)},b.squareRoot=b.sqrt=function(){var e,t,r,i,s=this,u=s.c,f=s.s,l=s.e,c=h,g=a,p=new n("0.5");if(1!==f||!u||!u[0])return new n(!f||0>f&&(!u||u[0])?0/0:u?s:1/0);for(f=Math.sqrt(s.toS()),a=1,0==f||f==1/0?(e=u.join(""),e.length+l&1||(e+="0"),t=new n(Math.sqrt(e)+""),t.c||(t.c=[1]),t.e=((l+1)/2|0)-(0>l||1&l)):t=new n(e=f.toString()),r=t.e,f=r+(h+=4),3>f&&(f=0),l=f;;)if(i=t,t=p.times(i.plus(s.div(i))),i.c.slice(0,f).join("")===t.c.slice(0,f).join("")){if(u=t.c,f-=e&&t.e<r,9!=u[f]||9!=u[f-1]||9!=u[f-2]||!(9==u[f-3]||e&&4==u[f-3])){if(!(u[l]||u[l-1]||u[l-2]||u[l-3]&&5!=u[l-3]||(u.length>l-2&&(u.length=l-2),t.times(t).eq(s)))){for(;u.length<l-3;)u.push(0);u[l-3]++}return a=g,o(t,h=c,10),t}if(e&&9==u[f-3]&&(i=t.round(c,0),i.times(i).eq(s)))return a=g,h=c,i;h+=4,f+=4,e=""}},b.times=b.mul=function(e,t){var r,i=this,s=i.c,o=(O=11,e=new n(e,t)).c,u=i.e,f=e.e,l=i.s;if(e.s=l==(t=e.s)?1:-1,!((u||s&&s[0])&&(f||o&&o[0])))return new n(!l||!t||s&&!s[0]&&!o||o&&!o[0]&&!s?0/0:s&&o?0*e.s:e.s/0);for(e.e=u+f,(l=s.length)<(t=o.length)&&(r=s,s=o,o=r,f=l,l=t,t=f),f=l+t,r=[];f--;r.push(0));for(u=t-1;u>-1;u--){for(t=0,f=l+u;f>u;t=r[f]+o[u]*s[f-u-1]+t,r[f--]=t%10|0,t=t/10|0);t&&(r[f]=(r[f]+t)%10)}for(t&&++e.e,!r[0]&&r.shift(),f=r.length;!r[--f];r.pop());return e.c=e.e>v?e.e=null:e.e<m?[e.e=0]:r,e},b.toBuffer=function(n){if("string"==typeof n){if("mpint"!==n)return"Unsupported Buffer representation";var t=this.abs(),r=t.toBuffer({size:1,endian:"big"}),i=1===r.length&&0===r[0]?0:r.length;128&r[0]&&i++;var s=new e(4+i);i>0&&r.copy(s,4+(128&r[0]?1:0)),128&r[0]&&(s[4]=0),s[0]=i&255<<24,s[1]=i&255<<16,s[2]=65280&i,s[3]=255&i;var o=this.lt(0);if(o)for(var u=4;u<s.length;u++)s[u]=255-s[u];return s[4]=127&s[4]|(o?128:0),o&&s[s.length-1]++,s}n||(n={});var f={1:"big","-1":"little"}[n.endian]||n.endian||"big",l=this.toString(16);if("-"===l.charAt(0))throw new Error("converting negative numbers to Buffers not supported yet");for(var c="auto"===n.size?Math.ceil(l.length/2):n.size||1,i=Math.ceil(l.length/(2*c))*c,r=new e(i);l.length<2*i;)l="0"+l;var h=l.split(new RegExp("(.{"+2*c+"})")).filter(function(e){return e.length>0});return h.forEach(function(e,n){for(var t=0;c>t;t++){var i=n*c+("big"===f?t:c-t-1);r[i]=parseInt(e.slice(2*t,2*t+2),16)}}),r},b.toExponential=b.toE=function(e){return s(this,(null==e||((f=0>e||e>l)||d(e)!=e&&0!==e)&&!t(e,"decimal places","toE"))&&this.c?this.c.length-1:0|e,1)},b.toFixed=b.toF=function(e){var n,r,i,o=this;return null==e||((f=0>e||e>l)||d(e)!=e&&0!==e)&&!t(e,"decimal places","toF")||(i=o.e+(0|e)),n=g,e=p,g=-(p=1/0),i==r?r=o.toS():(r=s(o,i),o.s<0&&o.c&&(o.c[0]?r.indexOf("-")<0&&(r="-"+r):r=r.replace(/^-/,""))),g=n,p=e,r},b.toFraction=b.toFr=function(e){var r,i,s,o,u,l,c,g=o=new n(R),p=s=new n("0"),m=this,d=m.c,b=v,N=h,S=a,E=new n(R);if(!d)return m.toS();for(c=E.e=d.length-m.e-1,(null==e||(!(O=12,l=new n(e)).s||(f=l.cmp(g)<0||!l.c)||w&&l.e<l.c.length-1)&&!t(e,"max denominator","toFr")||(e=l).cmp(E)>0)&&(e=c>0?E:g),v=1/0,l=new n(d.join("")),h=0,a=1;r=l.div(E),u=o.plus(r.times(p)),1!=u.cmp(e);)o=p,p=u,g=s.plus(r.times(u=g)),s=u,E=l.minus(r.times(u=E)),l=u;return u=e.minus(o).div(p),s=s.plus(u.times(g)),o=o.plus(u.times(p)),s.s=g.s=m.s,h=2*c,a=S,i=g.div(p).minus(m).abs().cmp(s.div(o).minus(m).abs())<1?[g.toS(),p.toS()]:[s.toS(),o.toS()],v=b,h=N,i},b.toPrecision=b.toP=function(e){return null==e||((f=1>e||e>l)||d(e)!=e)&&!t(e,"precision","toP")?this.toS():s(this,0|--e,2)},b.toString=b.toS=function(e){var n,i,o,u=this,l=u.e;if(null===l)i=u.s?"Infinity":"NaN";else{if(e===n&&(g>=l||l>=p))return s(u,u.c.length-1,1);if(i=u.c.join(""),0>l){for(;++l;i="0"+i);i="0."+i}else if(o=i.length,l>0)if(++l>o)for(l-=o;l--;i+="0");else o>l&&(i=i.slice(0,l)+"."+i.slice(l));else if(n=i.charAt(0),o>1)i=n+"."+i.slice(1);else if("0"==n)return n;if(null!=e)if((f=!(e>=2&&65>e))||e!=(0|e)&&w)t(e,"base","toS");else if(i=r(i,0|e,10,u.s),"0"==i)return i}return u.s<0?"-"+i:i},b.toNumber=function(){return parseInt(this.toString(),10)},b.valueOf=function(){return this.toS()},module.exports=n}).call(this,require("buffer").Buffer);
},{"buffer":75}],"bignum":[function(require,module,exports){
module.exports=require('J4nwo8');
},{}],"buffertools":[function(require,module,exports){
module.exports=require('fugeBw');
},{}],"fugeBw":[function(require,module,exports){
(function(t){"use strict";function r(){this.writable=!0,this.buffer=null}var e=require("events"),n=require("util"),i={};module.exports.Buffer=t;var o=function(r){return r instanceof t||r instanceof Uint8Array},f=function(t){return function(){var r=this;if(o(r));else{if(!o(arguments[0]))throw new Error("Argument should be a buffer object.");r=arguments[0],Array.prototype.shift.apply(arguments)}return t.apply(r,arguments)}},u=function(t){return function(){var r=this;if(o(r));else{if(!o(arguments[0]))throw Error("Argument should be a buffer object.");r=arguments[0],Array.prototype.shift.apply(arguments)}var e=arguments[0];if("string"==typeof e||e instanceof String||o(e))return t.apply(r,arguments);throw new Error("Second argument must be a string or a buffer.")}};i.clear=f(function(){for(var t=0;t<this.length;t++)this[t]=0;return this}),i.fill=f(function(t){for(var r="undefined"==typeof t.length?1:t.length,e=0;e<this.length;e+=r)for(var n=0;r>n;n++)this[e+n]="undefined"==typeof t.length?t:"string"==typeof t[n]?t[n].charCodeAt(0):t[n];return this}),i.indexOf=f(function(t,r){if(r=r||0,0===t.length)return-1;for(var e=r;e<this.length-t.length+1;e+=1){for(var n=!0,i=0;i<t.length;i++){var o=this[e+i],f=t[i];if("string"==typeof f&&(f=f.charCodeAt(0)),o!==f){n=!1;break}}if(n)return e}return-1}),i.equals=u(function(t){return 0===i.compare(this,t)}),i.compare=u(function(t){var r=this,e=r.length,n=t.length;if(e!==n)return e>n?1:-1;for(var i=0;e>i;i++){var o=r[i],f=t[i];if("string"==typeof f&&(f=f.charCodeAt(0)),o!==f)return o>f?1:-1}return 0}),i.concat=function(){for(var r=0,e=0;e<arguments.length;e++){if(void 0===arguments[e].length)throw Error("all arguments must be strings or Buffers");r+=arguments[e].length}for(var n=new t(r),i=0,e=0;e<arguments.length;e++)for(var o=0;o<arguments[e].length;o++)n[i++]="string"==typeof arguments[e][o]?arguments[e][o].charCodeAt(0):arguments[e][o];return n},i.reverse=f(function(){for(var r=new t(this.length),e=0;e<this.length;e++)r[e]=this[this.length-e-1];return r}),i.toHex=f(function(){for(var t="",r=0;r<this.length;r++){var e=this[r].toString(16);1==e.length&&(e="0"+e),e.length>2&&(e=e.substring(1,3)),t+=e}return t}),i.fromHex=f(function(){var r=this.length;if(r%2!==0)throw new Error("Invalid hex string length");for(var e=new t(r/2),n=0;n<e.length;n++){var i=String.fromCharCode(this[2*n]),o=String.fromCharCode(this[2*n+1]);e[n]=parseInt(i+o,16)}return e}),exports.extend=function(){var r;r=arguments.length>0?Array.prototype.slice.call(arguments):"function"==typeof Uint8Array?[t.prototype,Uint8Array.prototype]:[t.prototype];for(var e=0,n=r.length;n>e;e+=1){var o=r[e];for(var f in i)o[f]=i[f];o!==exports&&(o.concat=function(){var t=[this].concat(Array.prototype.slice.call(arguments));return i.concat.apply(i,t)})}},exports.extend(exports),n.inherits(r,e.EventEmitter),r.prototype._append=function(r,e){if(!this.writable)throw new Error("Stream is not writable.");if(t.isBuffer(r));else{if("string"!=typeof r)throw new Error("Argument should be either a buffer or a string.");r=new t(r,e||"utf8")}this.buffer?this.buffer=i.concat(this.buffer,r):(this.buffer=new t(r.length),r.copy(this.buffer))},r.prototype.write=function(t,r){return this._append(t,r),!0},r.prototype.end=function(t,r){t&&this._append(t,r),this.emit("close"),this.writable=!1},r.prototype.getBuffer=function(){return this.buffer?this.buffer:new t(0)},r.prototype.toString=function(){return this.getBuffer().toString()},exports.WritableBufferStream=r}).call(this,require("buffer").Buffer);
},{"buffer":75,"events":84,"util":107}],71:[function(require,module,exports){
},{}],72:[function(require,module,exports){
function replacer(t,e){return util.isUndefined(e)?""+e:!util.isNumber(e)||!isNaN(e)&&isFinite(e)?util.isFunction(e)||util.isRegExp(e)?e.toString():e:e.toString()}function truncate(t,e){return util.isString(t)?t.length<e?t:t.slice(0,e):t}function getMessage(t){return truncate(JSON.stringify(t.actual,replacer),128)+" "+t.operator+" "+truncate(JSON.stringify(t.expected,replacer),128)}function fail(t,e,r,i,s){throw new assert.AssertionError({message:r,actual:t,expected:e,operator:i,stackStartFunction:s})}function ok(t,e){t||fail(t,!0,e,"==",assert.ok)}function _deepEqual(t,e){if(t===e)return!0;if(util.isBuffer(t)&&util.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 util.isDate(t)&&util.isDate(e)?t.getTime()===e.getTime():util.isRegExp(t)&&util.isRegExp(e)?t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase:util.isObject(t)||util.isObject(e)?objEquiv(t,e):t==e}function isArguments(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function objEquiv(t,e){if(util.isNullOrUndefined(t)||util.isNullOrUndefined(e))return!1;if(t.prototype!==e.prototype)return!1;if(isArguments(t))return isArguments(e)?(t=pSlice.call(t),e=pSlice.call(e),_deepEqual(t,e)):!1;try{var r,i,s=objectKeys(t),n=objectKeys(e)}catch(a){return!1}if(s.length!=n.length)return!1;for(s.sort(),n.sort(),i=s.length-1;i>=0;i--)if(s[i]!=n[i])return!1;for(i=s.length-1;i>=0;i--)if(r=s[i],!_deepEqual(t[r],e[r]))return!1;return!0}function expectedException(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 _throws(t,e,r,i){var s;util.isString(r)&&(i=r,r=null);try{e()}catch(n){s=n}if(i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),t&&!s&&fail(s,r,"Missing expected exception"+i),!t&&expectedException(s,r)&&fail(s,r,"Got unwanted exception"+i),t&&s&&r&&!expectedException(s,r)||!t&&s)throw s}var util=require("util/"),pSlice=Array.prototype.slice,hasOwn=Object.prototype.hasOwnProperty,assert=module.exports=ok;assert.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=getMessage(this),this.generatedMessage=!0);var e=t.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var i=r.stack,s=e.name,n=i.indexOf("\n"+s);if(n>=0){var a=i.indexOf("\n",n+1);i=i.substring(a+1)}this.stack=i}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(t,e,r){t!=e&&fail(t,e,r,"==",assert.equal)},assert.notEqual=function(t,e,r){t==e&&fail(t,e,r,"!=",assert.notEqual)},assert.deepEqual=function(t,e,r){_deepEqual(t,e)||fail(t,e,r,"deepEqual",assert.deepEqual)},assert.notDeepEqual=function(t,e,r){_deepEqual(t,e)&&fail(t,e,r,"notDeepEqual",assert.notDeepEqual)},assert.strictEqual=function(t,e,r){t!==e&&fail(t,e,r,"===",assert.strictEqual)},assert.notStrictEqual=function(t,e,r){t===e&&fail(t,e,r,"!==",assert.notStrictEqual)},assert.throws=function(){_throws.apply(this,[!0].concat(pSlice.call(arguments)))},assert.doesNotThrow=function(){_throws.apply(this,[!1].concat(pSlice.call(arguments)))},assert.ifError=function(t){if(t)throw t};var objectKeys=Object.keys||function(t){var e=[];for(var r in t)hasOwn.call(t,r)&&e.push(r);return e};
},{"util/":74}],73:[function(require,module,exports){
module.exports=function(o){return o&&"object"==typeof o&&"function"==typeof o.copy&&"function"==typeof o.fill&&"function"==typeof o.readUInt8};
},{}],74:[function(require,module,exports){
(function(e,t){function r(e,t){var r={seen:[],stylize:o};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(t)?r.showHidden=t:t&&exports._extend(r,t),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=n),s(r,e,r.depth)}function n(e,t){var n=r.styles[t];return n?"["+r.colors[n][0]+"m"+e+"["+r.colors[n][1]+"m":e}function o(e){return e}function i(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function s(e,t,r){if(e.customInspect&&t&&S(t.inspect)&&t.inspect!==exports.inspect&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return x(n)||(n=s(e,n,r)),n}var o=u(e,t);if(o)return o;var g=Object.keys(t),y=i(g);if(e.showHidden&&(g=Object.getOwnPropertyNames(t)),O(t)&&(g.indexOf("message")>=0||g.indexOf("description")>=0))return c(t);if(0===g.length){if(S(t)){var d=t.name?": "+t.name:"";return e.stylize("[Function"+d+"]","special")}if(v(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(j(t))return e.stylize(Date.prototype.toString.call(t),"date");if(O(t))return c(t)}var m="",h=!1,b=["{","}"];if(f(t)&&(h=!0,b=["[","]"]),S(t)){var w=t.name?": "+t.name:"";m=" [Function"+w+"]"}if(v(t)&&(m=" "+RegExp.prototype.toString.call(t)),j(t)&&(m=" "+Date.prototype.toUTCString.call(t)),O(t)&&(m=" "+c(t)),0===g.length&&(!h||0==t.length))return b[0]+m+b[1];if(0>r)return v(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var z;return z=h?l(e,t,r,y,g):g.map(function(n){return a(e,t,r,y,n,h)}),e.seen.pop(),p(z,m,b)}function u(e,t){if(b(t))return e.stylize("undefined","undefined");if(x(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,r,n,o){for(var i=[],s=0,u=t.length;u>s;++s)i.push(_(t,String(s))?a(e,t,r,n,String(s),!0):"");return o.forEach(function(o){o.match(/^\d+$/)||i.push(a(e,t,r,n,o,!0))}),i}function a(e,t,r,n,o,i){var u,c,l;if(l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},l.get?c=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(c=e.stylize("[Setter]","special")),_(n,o)||(u="["+o+"]"),c||(e.seen.indexOf(l.value)<0?(c=y(r)?s(e,l.value,null):s(e,l.value,r-1),c.indexOf("\n")>-1&&(c=i?c.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+c.split("\n").map(function(e){return" "+e}).join("\n"))):c=e.stylize("[Circular]","special")),b(u)){if(i&&o.match(/^\d+$/))return c;u=JSON.stringify(""+o),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+c}function p(e,t,r){var n=0,o=e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function f(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function y(e){return null===e}function d(e){return null==e}function m(e){return"number"==typeof e}function x(e){return"string"==typeof e}function h(e){return"symbol"==typeof e}function b(e){return void 0===e}function v(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function j(e){return w(e)&&"[object Date]"===E(e)}function O(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function z(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function E(e){return Object.prototype.toString.call(e)}function D(e){return 10>e?"0"+e.toString(10):e.toString(10)}function N(){var e=new Date,t=[D(e.getHours()),D(e.getMinutes()),D(e.getSeconds())].join(":");return[e.getDate(),U[e.getMonth()],t].join(" ")}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var A=/%[sdj%]/g;exports.format=function(e){if(!x(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(r(arguments[n]));return t.join(" ")}for(var n=1,o=arguments,i=o.length,s=String(e).replace(A,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch(t){return"[Circular]"}default:return e}}),u=o[n];i>n;u=o[++n])s+=y(u)||!w(u)?" "+u:" "+r(u);return s},exports.deprecate=function(r,n){function o(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}if(b(t.process))return function(){return exports.deprecate(r,n).apply(this,arguments)};if(e.noDeprecation===!0)return r;var i=!1;return o};var J,R={};exports.debuglog=function(t){if(b(J)&&(J=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!R[t])if(new RegExp("\\b"+t+"\\b","i").test(J)){var r=e.pid;R[t]=function(){var e=exports.format.apply(exports,arguments);console.error("%s %d: %s",t,r,e)}}else R[t]=function(){};return R[t]},exports.inspect=r,r.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]},r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=f,exports.isBoolean=g,exports.isNull=y,exports.isNullOrUndefined=d,exports.isNumber=m,exports.isString=x,exports.isSymbol=h,exports.isUndefined=b,exports.isRegExp=v,exports.isObject=w,exports.isDate=j,exports.isError=O,exports.isFunction=S,exports.isPrimitive=z,exports.isBuffer=require("./support/isBuffer");var U=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];exports.log=function(){console.log("%s - %s",N(),exports.format.apply(exports,arguments))},exports.inherits=require("inherits"),exports._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});
},{"./support/isBuffer":73,"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91,"inherits":90}],75:[function(require,module,exports){
function Buffer(e,t,r){if(!(this instanceof Buffer))return new Buffer(e,t,r);var n=typeof e;if("base64"===t&&"string"===n)for(e=stringtrim(e);e.length%4!==0;)e+="=";var i;if("number"===n)i=coerce(e);else if("string"===n)i=Buffer.byteLength(e,t);else{if("object"!==n)throw new Error("First argument needs to be a number, array or string.");i=coerce(e.length)}var s;Buffer._useTypedArrays?s=Buffer._augment(new Uint8Array(i)):(s=this,s.length=i,s._isBuffer=!0);var a;if(Buffer._useTypedArrays&&"number"==typeof e.byteLength)s._set(e);else if(isArrayish(e))for(a=0;i>a;a++)s[a]=Buffer.isBuffer(e)?e.readUInt8(a):e[a];else if("string"===n)s.write(e,0,t);else if("number"===n&&!Buffer._useTypedArrays&&!r)for(a=0;i>a;a++)s[a]=0;return s}function _hexWrite(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var s=t.length;assert(s%2===0,"Invalid hex string"),n>s/2&&(n=s/2);for(var a=0;n>a;a++){var o=parseInt(t.substr(2*a,2),16);assert(!isNaN(o),"Invalid hex string"),e[r+a]=o}return Buffer._charsWritten=2*a,a}function _utf8Write(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(utf8ToBytes(t),e,r,n);return i}function _asciiWrite(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(asciiToBytes(t),e,r,n);return i}function _binaryWrite(e,t,r,n){return _asciiWrite(e,t,r,n)}function _base64Write(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(base64ToBytes(t),e,r,n);return i}function _utf16leWrite(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(utf16leToBytes(t),e,r,n);return i}function _base64Slice(e,t,r){return base64.fromByteArray(0===t&&r===e.length?e:e.slice(t,r))}function _utf8Slice(e,t,r){var n="",i="";r=Math.min(e.length,r);for(var s=t;r>s;s++)e[s]<=127?(n+=decodeUtf8Char(i)+String.fromCharCode(e[s]),i=""):i+="%"+e[s].toString(16);return n+decodeUtf8Char(i)}function _asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;r>i;i++)n+=String.fromCharCode(e[i]);return n}function _binarySlice(e,t,r){return _asciiSlice(e,t,r)}function _hexSlice(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var i="",s=t;r>s;s++)i+=toHex(e[s]);return i}function _utf16leSlice(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function _readUInt16(e,t,r,n){n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(void 0!==t&&null!==t,"missing offset"),assert(t+1<e.length,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var s;return r?(s=e[t],i>t+1&&(s|=e[t+1]<<8)):(s=e[t]<<8,i>t+1&&(s|=e[t+1])),s}}function _readUInt32(e,t,r,n){n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(void 0!==t&&null!==t,"missing offset"),assert(t+3<e.length,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var s;return r?(i>t+2&&(s=e[t+2]<<16),i>t+1&&(s|=e[t+1]<<8),s|=e[t],i>t+3&&(s+=e[t+3]<<24>>>0)):(i>t+1&&(s=e[t+1]<<16),i>t+2&&(s|=e[t+2]<<8),i>t+3&&(s|=e[t+3]),s+=e[t]<<24>>>0),s}}function _readInt16(e,t,r,n){n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(void 0!==t&&null!==t,"missing offset"),assert(t+1<e.length,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var s=_readUInt16(e,t,r,!0),a=32768&s;return a?-1*(65535-s+1):s}}function _readInt32(e,t,r,n){n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(void 0!==t&&null!==t,"missing offset"),assert(t+3<e.length,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var s=_readUInt32(e,t,r,!0),a=2147483648&s;return a?-1*(4294967295-s+1):s}}function _readFloat(e,t,r,n){return n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(t+3<e.length,"Trying to read beyond buffer length")),ieee754.read(e,t,r,23,4)}function _readDouble(e,t,r,n){return n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(t+7<e.length,"Trying to read beyond buffer length")),ieee754.read(e,t,r,52,8)}function _writeUInt16(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+1<e.length,"trying to write beyond buffer length"),verifuint(t,65535));var s=e.length;if(!(r>=s))for(var a=0,o=Math.min(s-r,2);o>a;a++)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function _writeUInt32(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3<e.length,"trying to write beyond buffer length"),verifuint(t,4294967295));var s=e.length;if(!(r>=s))for(var a=0,o=Math.min(s-r,4);o>a;a++)e[r+a]=t>>>8*(n?a:3-a)&255}function _writeInt16(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+1<e.length,"Trying to write beyond buffer length"),verifsint(t,32767,-32768));var s=e.length;r>=s||(t>=0?_writeUInt16(e,t,r,n,i):_writeUInt16(e,65535+t+1,r,n,i))}function _writeInt32(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3<e.length,"Trying to write beyond buffer length"),verifsint(t,2147483647,-2147483648));var s=e.length;r>=s||(t>=0?_writeUInt32(e,t,r,n,i):_writeUInt32(e,4294967295+t+1,r,n,i))}function _writeFloat(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3<e.length,"Trying to write beyond buffer length"),verifIEEE754(t,3.4028234663852886e38,-3.4028234663852886e38));var s=e.length;r>=s||ieee754.write(e,t,r,n,23,4)}function _writeDouble(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+7<e.length,"Trying to write beyond buffer length"),verifIEEE754(t,1.7976931348623157e308,-1.7976931348623157e308));var s=e.length;r>=s||ieee754.write(e,t,r,n,52,8)}function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function clamp(e,t,r){return"number"!=typeof e?r:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function coerce(e){return e=~~Math.ceil(+e),0>e?0:e}function isArray(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function isArrayish(e){return isArray(e)||Buffer.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function toHex(e){return 16>e?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(127>=n)t.push(e.charCodeAt(r));else{var i=r;n>=55296&&57343>=n&&r++;for(var s=encodeURIComponent(e.slice(i,r+1)).substr(1).split("%"),a=0;a<s.length;a++)t.push(parseInt(s[a],16))}}return t}function asciiToBytes(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t}function utf16leToBytes(e){for(var t,r,n,i=[],s=0;s<e.length;s++)t=e.charCodeAt(s),r=t>>8,n=t%256,i.push(n),i.push(r);return i}function base64ToBytes(e){return base64.toByteArray(e)}function blitBuffer(e,t,r,n){for(var i=0;n>i&&!(i+r>=t.length||i>=e.length);i++)t[i+r]=e[i];return i}function decodeUtf8Char(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function verifuint(e,t){assert("number"==typeof e,"cannot write a non-number as a number"),assert(e>=0,"specified a negative value for writing an unsigned value"),assert(t>=e,"value is larger than maximum value for type"),assert(Math.floor(e)===e,"value has a fractional component")}function verifsint(e,t,r){assert("number"==typeof e,"cannot write a non-number as a number"),assert(t>=e,"value larger than maximum allowed value"),assert(e>=r,"value smaller than minimum allowed value"),assert(Math.floor(e)===e,"value has a fractional component")}function verifIEEE754(e,t,r){assert("number"==typeof e,"cannot write a non-number as a number"),assert(t>=e,"value larger than maximum allowed value"),assert(e>=r,"value smaller than minimum allowed value")}function assert(e,t){if(!e)throw new Error(t||"Failed assertion")}var base64=require("base64-js"),ieee754=require("ieee754");exports.Buffer=Buffer,exports.SlowBuffer=Buffer,exports.INSPECT_MAX_BYTES=50,Buffer.poolSize=8192,Buffer._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(r){return!1}}(),Buffer.isEncoding=function(e){switch(String(e).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}},Buffer.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},Buffer.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=utf8ToBytes(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=base64ToBytes(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},Buffer.concat=function(e,t){if(assert(isArray(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new Buffer(0);if(1===e.length)return e[0];var r;if("number"!=typeof t)for(t=0,r=0;r<e.length;r++)t+=e[r].length;var n=new Buffer(t),i=0;for(r=0;r<e.length;r++){var s=e[r];s.copy(n,i),i+=s.length}return n},Buffer.prototype.write=function(e,t,r,n){if(isFinite(t))isFinite(r)||(n=r,r=void 0);else{var i=n;n=t,t=r,r=i}t=Number(t)||0;var s=this.length-t;r?(r=Number(r),r>s&&(r=s)):r=s,n=String(n||"utf8").toLowerCase();var a;switch(n){case"hex":a=_hexWrite(this,e,t,r);break;case"utf8":case"utf-8":a=_utf8Write(this,e,t,r);break;case"ascii":a=_asciiWrite(this,e,t,r);break;case"binary":a=_binaryWrite(this,e,t,r);break;case"base64":a=_base64Write(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":a=_utf16leWrite(this,e,t,r);break;default:throw new Error("Unknown encoding")}return a},Buffer.prototype.toString=function(e,t,r){var n=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,r=void 0!==r?Number(r):r=n.length,r===t)return"";var i;switch(e){case"hex":i=_hexSlice(n,t,r);break;case"utf8":case"utf-8":i=_utf8Slice(n,t,r);break;case"ascii":i=_asciiSlice(n,t,r);break;case"binary":i=_binarySlice(n,t,r);break;case"base64":i=_base64Slice(n,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=_utf16leSlice(n,t,r);break;default:throw new Error("Unknown encoding")}return i},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Buffer.prototype.copy=function(e,t,r,n){var i=this;if(r||(r=0),n||0===n||(n=this.length),t||(t=0),n!==r&&0!==e.length&&0!==i.length){assert(n>=r,"sourceEnd < sourceStart"),assert(t>=0&&t<e.length,"targetStart out of bounds"),assert(r>=0&&r<i.length,"sourceStart out of bounds"),assert(n>=0&&n<=i.length,"sourceEnd out of bounds"),n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var s=n-r;if(100>s||!Buffer._useTypedArrays)for(var a=0;s>a;a++)e[a+t]=this[a+r];else e._set(this.subarray(r,r+s),t)}},Buffer.prototype.slice=function(e,t){var r=this.length;if(e=clamp(e,r,0),t=clamp(t,r,r),Buffer._useTypedArrays)return Buffer._augment(this.subarray(e,t));for(var n=t-e,i=new Buffer(n,void 0,!0),s=0;n>s;s++)i[s]=this[s+e];return i},Buffer.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},Buffer.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},Buffer.prototype.readUInt8=function(e,t){return t||(assert(void 0!==e&&null!==e,"missing offset"),assert(e<this.length,"Trying to read beyond buffer length")),e>=this.length?void 0:this[e]},Buffer.prototype.readUInt16LE=function(e,t){return _readUInt16(this,e,!0,t)},Buffer.prototype.readUInt16BE=function(e,t){return _readUInt16(this,e,!1,t)},Buffer.prototype.readUInt32LE=function(e,t){return _readUInt32(this,e,!0,t)},Buffer.prototype.readUInt32BE=function(e,t){return _readUInt32(this,e,!1,t)},Buffer.prototype.readInt8=function(e,t){if(t||(assert(void 0!==e&&null!==e,"missing offset"),assert(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length)){var r=128&this[e];return r?-1*(255-this[e]+1):this[e]}},Buffer.prototype.readInt16LE=function(e,t){return _readInt16(this,e,!0,t)},Buffer.prototype.readInt16BE=function(e,t){return _readInt16(this,e,!1,t)},Buffer.prototype.readInt32LE=function(e,t){return _readInt32(this,e,!0,t)},Buffer.prototype.readInt32BE=function(e,t){return _readInt32(this,e,!1,t)},Buffer.prototype.readFloatLE=function(e,t){return _readFloat(this,e,!0,t)},Buffer.prototype.readFloatBE=function(e,t){return _readFloat(this,e,!1,t)},Buffer.prototype.readDoubleLE=function(e,t){return _readDouble(this,e,!0,t)},Buffer.prototype.readDoubleBE=function(e,t){return _readDouble(this,e,!1,t)},Buffer.prototype.writeUInt8=function(e,t,r){r||(assert(void 0!==e&&null!==e,"missing value"),assert(void 0!==t&&null!==t,"missing offset"),assert(t<this.length,"trying to write beyond buffer length"),verifuint(e,255)),t>=this.length||(this[t]=e)},Buffer.prototype.writeUInt16LE=function(e,t,r){_writeUInt16(this,e,t,!0,r)},Buffer.prototype.writeUInt16BE=function(e,t,r){_writeUInt16(this,e,t,!1,r)},Buffer.prototype.writeUInt32LE=function(e,t,r){_writeUInt32(this,e,t,!0,r)},Buffer.prototype.writeUInt32BE=function(e,t,r){_writeUInt32(this,e,t,!1,r)},Buffer.prototype.writeInt8=function(e,t,r){r||(assert(void 0!==e&&null!==e,"missing value"),assert(void 0!==t&&null!==t,"missing offset"),assert(t<this.length,"Trying to write beyond buffer length"),verifsint(e,127,-128)),t>=this.length||(e>=0?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},Buffer.prototype.writeInt16LE=function(e,t,r){_writeInt16(this,e,t,!0,r)},Buffer.prototype.writeInt16BE=function(e,t,r){_writeInt16(this,e,t,!1,r)},Buffer.prototype.writeInt32LE=function(e,t,r){_writeInt32(this,e,t,!0,r)},Buffer.prototype.writeInt32BE=function(e,t,r){_writeInt32(this,e,t,!1,r)},Buffer.prototype.writeFloatLE=function(e,t,r){_writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){_writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){_writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){_writeDouble(this,e,t,!1,r)},Buffer.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),assert("number"==typeof e&&!isNaN(e),"value is not a number"),assert(r>=t,"end < start"),r!==t&&0!==this.length){assert(t>=0&&t<this.length,"start out of bounds"),assert(r>=0&&r<=this.length,"end out of bounds");for(var n=t;r>n;n++)this[n]=e}},Buffer.prototype.inspect=function(){for(var e=[],t=this.length,r=0;t>r;r++)if(e[r]=toHex(this[r]),r===exports.INSPECT_MAX_BYTES){e[r+1]="...";break}return"<Buffer "+e.join(" ")+">"},Buffer.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(Buffer._useTypedArrays)return new Buffer(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;r>t;t+=1)e[t]=this[t];return e.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var BP=Buffer.prototype;Buffer._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=BP.get,e.set=BP.set,e.write=BP.write,e.toString=BP.toString,e.toLocaleString=BP.toString,e.toJSON=BP.toJSON,e.copy=BP.copy,e.slice=BP.slice,e.readUInt8=BP.readUInt8,e.readUInt16LE=BP.readUInt16LE,e.readUInt16BE=BP.readUInt16BE,e.readUInt32LE=BP.readUInt32LE,e.readUInt32BE=BP.readUInt32BE,e.readInt8=BP.readInt8,e.readInt16LE=BP.readInt16LE,e.readInt16BE=BP.readInt16BE,e.readInt32LE=BP.readInt32LE,e.readInt32BE=BP.readInt32BE,e.readFloatLE=BP.readFloatLE,e.readFloatBE=BP.readFloatBE,e.readDoubleLE=BP.readDoubleLE,e.readDoubleBE=BP.readDoubleBE,e.writeUInt8=BP.writeUInt8,e.writeUInt16LE=BP.writeUInt16LE,e.writeUInt16BE=BP.writeUInt16BE,e.writeUInt32LE=BP.writeUInt32LE,e.writeUInt32BE=BP.writeUInt32BE,e.writeInt8=BP.writeInt8,e.writeInt16LE=BP.writeInt16LE,e.writeInt16BE=BP.writeInt16BE,e.writeInt32LE=BP.writeInt32LE,e.writeInt32BE=BP.writeInt32BE,e.writeFloatLE=BP.writeFloatLE,e.writeFloatBE=BP.writeFloatBE,e.writeDoubleLE=BP.writeDoubleLE,e.writeDoubleBE=BP.writeDoubleBE,e.fill=BP.fill,e.inspect=BP.inspect,e.toArrayBuffer=BP.toArrayBuffer,e};
},{"base64-js":76,"ieee754":77}],76:[function(require,module,exports){
var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(){"use strict";function r(r){var t=r.charCodeAt(0);return t===a?62:t===h?63:o>t?-1:o+10>t?t-o+26+26:A+26>t?t-A:c+26>t?t-c+26:void 0}function t(t){function e(r){u[l++]=r}var a,h,o,c,A,u;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.length;A="="===t.charAt(i-2)?2:"="===t.charAt(i-1)?1:0,u=new n(3*t.length/4-A),o=A>0?t.length-4:t.length;var l=0;for(a=0,h=0;o>a;a+=4,h+=3)c=r(t.charAt(a))<<18|r(t.charAt(a+1))<<12|r(t.charAt(a+2))<<6|r(t.charAt(a+3)),e((16711680&c)>>16),e((65280&c)>>8),e(255&c);return 2===A?(c=r(t.charAt(a))<<2|r(t.charAt(a+1))>>4,e(255&c)):1===A&&(c=r(t.charAt(a))<<10|r(t.charAt(a+1))<<4|r(t.charAt(a+2))>>2,e(c>>8&255),e(255&c)),u}function e(r){function t(r){return lookup.charAt(r)}function e(r){return t(r>>18&63)+t(r>>12&63)+t(r>>6&63)+t(63&r)}var n,a,h,o=r.length%3,c="";for(n=0,h=r.length-o;h>n;n+=3)a=(r[n]<<16)+(r[n+1]<<8)+r[n+2],c+=e(a);switch(o){case 1:a=r[r.length-1],c+=t(a>>2),c+=t(a<<4&63),c+="==";break;case 2:a=(r[r.length-2]<<8)+r[r.length-1],c+=t(a>>10),c+=t(a>>4&63),c+=t(a<<2&63),c+="="}return c}var n="undefined"!=typeof Uint8Array?Uint8Array:Array,a=("0".charCodeAt(0),"+".charCodeAt(0)),h="/".charCodeAt(0),o="0".charCodeAt(0),c="a".charCodeAt(0),A="A".charCodeAt(0);module.exports.toByteArray=t,module.exports.fromByteArray=e}();
},{}],77:[function(require,module,exports){
exports.read=function(o,t,a,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,n=a?h-1:0,s=a?-1:1,N=o[t+n];for(n+=s,M=N&(1<<-i)-1,N>>=-i,i+=w;i>0;M=256*M+o[t+n],n+=s,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+o[t+n],n+=s,i-=8);if(0===M)M=1-e;else{if(M===f)return p?0/0:1/0*(N?-1:1);p+=Math.pow(2,r),M-=e}return(N?-1:1)*p*Math.pow(2,M-r)},exports.write=function(o,t,a,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,n=i>>1,s=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,N=r?0:M-1,u=r?1:-1,l=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(w=isNaN(t)?1:0,p=i):(p=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-p))<1&&(p--,f*=2),t+=p+n>=1?s/f:s*Math.pow(2,1-n),t*f>=2&&(p++,f/=2),p+n>=i?(w=0,p=i):p+n>=1?(w=(t*f-1)*Math.pow(2,h),p+=n):(w=t*Math.pow(2,n-1)*Math.pow(2,h),p=0));h>=8;o[a+N]=255&w,N+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;o[a+N]=255&p,N+=u,p/=256,e-=8);o[a+N-u]|=128*l};
},{}],78:[function(require,module,exports){
function toArray(r,e){if(r.length%intSize!==0){var f=r.length+(intSize-r.length%intSize);r=Buffer.concat([r,zeroBuffer],f)}for(var t=[],n=e?r.readInt32BE:r.readInt32LE,u=0;u<r.length;u+=intSize)t.push(n.call(r,u));return t}function toBuffer(r,e,f){for(var t=new Buffer(e),n=f?t.writeInt32BE:t.writeInt32LE,u=0;u<r.length;u++)n.call(t,r[u],4*u,!0);return t}function hash(r,e,f,t){Buffer.isBuffer(r)||(r=new Buffer(r));var n=e(toArray(r,t),r.length*chrsz);return toBuffer(n,f,t)}var Buffer=require("buffer").Buffer,intSize=4,zeroBuffer=new Buffer(intSize);zeroBuffer.fill(0);var chrsz=8;module.exports={hash:hash};
},{"buffer":75}],79:[function(require,module,exports){
function hmac(e,r,f){Buffer.isBuffer(r)||(r=new Buffer(r)),Buffer.isBuffer(f)||(f=new Buffer(f)),r.length>blocksize?r=e(r):r.length<blocksize&&(r=Buffer.concat([r,zeroBuffer],blocksize));for(var t=new Buffer(blocksize),n=new Buffer(blocksize),i=0;blocksize>i;i++)t[i]=54^r[i],n[i]=92^r[i];var c=e(Buffer.concat([t,f]));return e(Buffer.concat([n,c]))}function hash(e,r){e=e||"sha1";var f=algorithms[e],t=[],n=0;return f||error("algorithm:",e,"is not yet supported"),{update:function(e){return Buffer.isBuffer(e)||(e=new Buffer(e)),t.push(e),n+=e.length,this},digest:function(e){var n=Buffer.concat(t),i=r?hmac(f,r,n):f(n);return t=null,e?i.toString(e):i}}}function error(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function each(e,r){for(var f in e)r(e[f],f)}var Buffer=require("buffer").Buffer,sha=require("./sha"),sha256=require("./sha256"),rng=require("./rng"),md5=require("./md5"),algorithms={sha1:sha,sha256:sha256,md5:md5},blocksize=64,zeroBuffer=new Buffer(blocksize);zeroBuffer.fill(0),exports.createHash=function(e){return hash(e)},exports.createHmac=function(e,r){return hash(e,r)},exports.randomBytes=function(e,r){if(!r||!r.call)return new Buffer(rng(e));try{r.call(this,void 0,new Buffer(rng(e)))}catch(f){r(f)}},each(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(e){exports[e]=function(){error("sorry,",e,"is not implemented yet")}});
},{"./md5":80,"./rng":81,"./sha":82,"./sha256":83,"buffer":75}],80:[function(require,module,exports){
function md5_vm_test(){return"900150983cd24fb0d6963f7d28e17f72"==hex_md5("abc")}function core_md5(d,_){d[_>>5]|=128<<_%32,d[(_+64>>>9<<4)+14]=_;for(var m=1732584193,f=-271733879,i=-1732584194,h=271733878,r=0;r<d.length;r+=16){var n=m,e=f,g=i,t=h;m=md5_ff(m,f,i,h,d[r+0],7,-680876936),h=md5_ff(h,m,f,i,d[r+1],12,-389564586),i=md5_ff(i,h,m,f,d[r+2],17,606105819),f=md5_ff(f,i,h,m,d[r+3],22,-1044525330),m=md5_ff(m,f,i,h,d[r+4],7,-176418897),h=md5_ff(h,m,f,i,d[r+5],12,1200080426),i=md5_ff(i,h,m,f,d[r+6],17,-1473231341),f=md5_ff(f,i,h,m,d[r+7],22,-45705983),m=md5_ff(m,f,i,h,d[r+8],7,1770035416),h=md5_ff(h,m,f,i,d[r+9],12,-1958414417),i=md5_ff(i,h,m,f,d[r+10],17,-42063),f=md5_ff(f,i,h,m,d[r+11],22,-1990404162),m=md5_ff(m,f,i,h,d[r+12],7,1804603682),h=md5_ff(h,m,f,i,d[r+13],12,-40341101),i=md5_ff(i,h,m,f,d[r+14],17,-1502002290),f=md5_ff(f,i,h,m,d[r+15],22,1236535329),m=md5_gg(m,f,i,h,d[r+1],5,-165796510),h=md5_gg(h,m,f,i,d[r+6],9,-1069501632),i=md5_gg(i,h,m,f,d[r+11],14,643717713),f=md5_gg(f,i,h,m,d[r+0],20,-373897302),m=md5_gg(m,f,i,h,d[r+5],5,-701558691),h=md5_gg(h,m,f,i,d[r+10],9,38016083),i=md5_gg(i,h,m,f,d[r+15],14,-660478335),f=md5_gg(f,i,h,m,d[r+4],20,-405537848),m=md5_gg(m,f,i,h,d[r+9],5,568446438),h=md5_gg(h,m,f,i,d[r+14],9,-1019803690),i=md5_gg(i,h,m,f,d[r+3],14,-187363961),f=md5_gg(f,i,h,m,d[r+8],20,1163531501),m=md5_gg(m,f,i,h,d[r+13],5,-1444681467),h=md5_gg(h,m,f,i,d[r+2],9,-51403784),i=md5_gg(i,h,m,f,d[r+7],14,1735328473),f=md5_gg(f,i,h,m,d[r+12],20,-1926607734),m=md5_hh(m,f,i,h,d[r+5],4,-378558),h=md5_hh(h,m,f,i,d[r+8],11,-2022574463),i=md5_hh(i,h,m,f,d[r+11],16,1839030562),f=md5_hh(f,i,h,m,d[r+14],23,-35309556),m=md5_hh(m,f,i,h,d[r+1],4,-1530992060),h=md5_hh(h,m,f,i,d[r+4],11,1272893353),i=md5_hh(i,h,m,f,d[r+7],16,-155497632),f=md5_hh(f,i,h,m,d[r+10],23,-1094730640),m=md5_hh(m,f,i,h,d[r+13],4,681279174),h=md5_hh(h,m,f,i,d[r+0],11,-358537222),i=md5_hh(i,h,m,f,d[r+3],16,-722521979),f=md5_hh(f,i,h,m,d[r+6],23,76029189),m=md5_hh(m,f,i,h,d[r+9],4,-640364487),h=md5_hh(h,m,f,i,d[r+12],11,-421815835),i=md5_hh(i,h,m,f,d[r+15],16,530742520),f=md5_hh(f,i,h,m,d[r+2],23,-995338651),m=md5_ii(m,f,i,h,d[r+0],6,-198630844),h=md5_ii(h,m,f,i,d[r+7],10,1126891415),i=md5_ii(i,h,m,f,d[r+14],15,-1416354905),f=md5_ii(f,i,h,m,d[r+5],21,-57434055),m=md5_ii(m,f,i,h,d[r+12],6,1700485571),h=md5_ii(h,m,f,i,d[r+3],10,-1894986606),i=md5_ii(i,h,m,f,d[r+10],15,-1051523),f=md5_ii(f,i,h,m,d[r+1],21,-2054922799),m=md5_ii(m,f,i,h,d[r+8],6,1873313359),h=md5_ii(h,m,f,i,d[r+15],10,-30611744),i=md5_ii(i,h,m,f,d[r+6],15,-1560198380),f=md5_ii(f,i,h,m,d[r+13],21,1309151649),m=md5_ii(m,f,i,h,d[r+4],6,-145523070),h=md5_ii(h,m,f,i,d[r+11],10,-1120210379),i=md5_ii(i,h,m,f,d[r+2],15,718787259),f=md5_ii(f,i,h,m,d[r+9],21,-343485551),m=safe_add(m,n),f=safe_add(f,e),i=safe_add(i,g),h=safe_add(h,t)}return Array(m,f,i,h)}function md5_cmn(d,_,m,f,i,h){return safe_add(bit_rol(safe_add(safe_add(_,d),safe_add(f,h)),i),m)}function md5_ff(d,_,m,f,i,h,r){return md5_cmn(_&m|~_&f,d,_,i,h,r)}function md5_gg(d,_,m,f,i,h,r){return md5_cmn(_&f|m&~f,d,_,i,h,r)}function md5_hh(d,_,m,f,i,h,r){return md5_cmn(_^m^f,d,_,i,h,r)}function md5_ii(d,_,m,f,i,h,r){return md5_cmn(m^(_|~f),d,_,i,h,r)}function safe_add(d,_){var m=(65535&d)+(65535&_),f=(d>>16)+(_>>16)+(m>>16);return f<<16|65535&m}function bit_rol(d,_){return d<<_|d>>>32-_}var helpers=require("./helpers");module.exports=function(d){return helpers.hash(d,core_md5,16)};
},{"./helpers":78}],81:[function(require,module,exports){
!function(){var r,n,t=this;r=function(r){for(var n,n,t=new Array(r),o=0;r>o;o++)0==(3&o)&&(n=4294967296*Math.random()),t[o]=n>>>((3&o)<<3)&255;return t},t.crypto&&crypto.getRandomValues&&(n=function(r){var n=new Uint8Array(r);return crypto.getRandomValues(n),n}),module.exports=n||r}();
},{}],82:[function(require,module,exports){
function core_sha1(r,a){r[a>>5]|=128<<24-a%32,r[(a+64>>9<<4)+15]=a;for(var e=Array(80),d=1732584193,s=-271733879,f=-1732584194,n=271733878,t=-1009589776,o=0;o<r.length;o+=16){for(var _=d,u=s,h=f,l=n,c=t,i=0;80>i;i++){e[i]=16>i?r[o+i]:rol(e[i-3]^e[i-8]^e[i-14]^e[i-16],1);var v=safe_add(safe_add(rol(d,5),sha1_ft(i,s,f,n)),safe_add(safe_add(t,e[i]),sha1_kt(i)));t=n,n=f,f=rol(s,30),s=d,d=v}d=safe_add(d,_),s=safe_add(s,u),f=safe_add(f,h),n=safe_add(n,l),t=safe_add(t,c)}return Array(d,s,f,n,t)}function sha1_ft(r,a,e,d){return 20>r?a&e|~a&d:40>r?a^e^d:60>r?a&e|a&d|e&d:a^e^d}function sha1_kt(r){return 20>r?1518500249:40>r?1859775393:60>r?-1894007588:-899497514}function safe_add(r,a){var e=(65535&r)+(65535&a),d=(r>>16)+(a>>16)+(e>>16);return d<<16|65535&e}function rol(r,a){return r<<a|r>>>32-a}var helpers=require("./helpers");module.exports=function(r){return helpers.hash(r,core_sha1,20,!0)};
},{"./helpers":78}],83:[function(require,module,exports){
var helpers=require("./helpers"),safe_add=function(a,e){var r=(65535&a)+(65535&e),d=(a>>16)+(e>>16)+(r>>16);return d<<16|65535&r},S=function(a,e){return a>>>e|a<<32-e},R=function(a,e){return a>>>e},Ch=function(a,e,r){return a&e^~a&r},Maj=function(a,e,r){return a&e^a&r^e&r},Sigma0256=function(a){return S(a,2)^S(a,13)^S(a,22)},Sigma1256=function(a){return S(a,6)^S(a,11)^S(a,25)},Gamma0256=function(a){return S(a,7)^S(a,18)^R(a,3)},Gamma1256=function(a){return S(a,17)^S(a,19)^R(a,10)},core_sha256=function(a,e){var r,d,n,f,s,t,u,_,o,i,S,c,m=new Array(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),h=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),g=new Array(64);a[e>>5]|=128<<24-e%32,a[(e+64>>9<<4)+15]=e;for(var o=0;o<a.length;o+=16){r=h[0],d=h[1],n=h[2],f=h[3],s=h[4],t=h[5],u=h[6],_=h[7];for(var i=0;64>i;i++)g[i]=16>i?a[i+o]:safe_add(safe_add(safe_add(Gamma1256(g[i-2]),g[i-7]),Gamma0256(g[i-15])),g[i-16]),S=safe_add(safe_add(safe_add(safe_add(_,Sigma1256(s)),Ch(s,t,u)),m[i]),g[i]),c=safe_add(Sigma0256(r),Maj(r,d,n)),_=u,u=t,t=s,s=safe_add(f,S),f=n,n=d,d=r,r=safe_add(S,c);h[0]=safe_add(r,h[0]),h[1]=safe_add(d,h[1]),h[2]=safe_add(n,h[2]),h[3]=safe_add(f,h[3]),h[4]=safe_add(s,h[4]),h[5]=safe_add(t,h[5]),h[6]=safe_add(u,h[6]),h[7]=safe_add(_,h[7])}return h};module.exports=function(a){return helpers.hash(a,core_sha256,32,!0)};
},{"./helpers":78}],84:[function(require,module,exports){
function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(e){return"function"==typeof e}function isNumber(e){return"number"==typeof e}function isObject(e){return"object"==typeof e&&null!==e}function isUndefined(e){return void 0===e}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(e){if(!isNumber(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},EventEmitter.prototype.emit=function(e){var t,n,s,i,r,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length))throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');if(n=this._events[e],isUndefined(n))return!1;if(isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(s=arguments.length,i=new Array(s-1),r=1;s>r;r++)i[r-1]=arguments[r];n.apply(this,i)}else if(isObject(n)){for(s=arguments.length,i=new Array(s-1),r=1;s>r;r++)i[r-1]=arguments[r];for(o=n.slice(),s=o.length,r=0;s>r;r++)o[r].apply(this,i)}return!0},EventEmitter.prototype.addListener=function(e,t){var n;if(!isFunction(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,isFunction(t.listener)?t.listener:t),this._events[e]?isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,isObject(this._events[e])&&!this._events[e].warned){var n;n=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}return this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(e,t){function n(){this.removeListener(e,n),s||(s=!0,t.apply(this,arguments))}if(!isFunction(t))throw TypeError("listener must be a function");var s=!1;return n.listener=t,this.on(e,n),this},EventEmitter.prototype.removeListener=function(e,t){var n,s,i,r;if(!isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],i=n.length,s=-1,n===t||isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(isObject(n)){for(r=i;r-->0;)if(n[r]===t||n[r].listener&&n[r].listener===t){s=r;break}if(0>s)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(s,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},EventEmitter.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],isFunction(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},EventEmitter.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},EventEmitter.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?isFunction(e._events[t])?1:e._events[t].length:0};
},{}],85:[function(require,module,exports){
var http=module.exports,EventEmitter=require("events").EventEmitter,Request=require("./lib/request"),url=require("url");http.request=function(e,t){"string"==typeof e&&(e=url.parse(e)),e||(e={}),e.host||e.port||(e.port=parseInt(window.location.port,10)),!e.host&&e.hostname&&(e.host=e.hostname),e.scheme||(e.scheme=window.location.protocol.split(":")[0]),e.host||(e.host=window.location.hostname||window.location.host),/:/.test(e.host)&&(e.port||(e.port=e.host.split(":")[1]),e.host=e.host.split(":")[0]),e.port||(e.port="https"==e.scheme?443:80);var o=new Request(new xhrHttp,e);return t&&o.on("response",t),o},http.get=function(e,t){e.method="GET";var o=http.request(e,t);return o.end(),o},http.Agent=function(){},http.Agent.defaultMaxSockets=4;var xhrHttp=function(){if("undefined"==typeof window)throw new Error("no window object present");if(window.XMLHttpRequest)return window.XMLHttpRequest;if(window.ActiveXObject){for(var e=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{var o=new window.ActiveXObject(e[t]);return function(){if(o){var r=o;return o=null,r}return new window.ActiveXObject(e[t])}}catch(r){}throw new Error("ajax not supported in this browser")}throw new Error("ajax not supported in this browser")}();http.STATUS_CODES={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};
},{"./lib/request":86,"events":84,"url":105}],86:[function(require,module,exports){
var Stream=require("stream"),Response=require("./response"),Base64=require("Base64"),inherits=require("inherits"),Request=module.exports=function(e,t){var r=this;r.writable=!0,r.xhr=e,r.body=[],r.uri=(t.scheme||"http")+"://"+t.host+(t.port?":"+t.port:"")+(t.path||"/"),"undefined"==typeof t.withCredentials&&(t.withCredentials=!0);try{e.withCredentials=t.withCredentials}catch(s){}if(e.open(t.method||"GET",r.uri,!0),r._headers={},t.headers)for(var o=objectKeys(t.headers),i=0;i<o.length;i++){var n=o[i];if(r.isSafeRequestHeader(n)){var a=t.headers[n];r.setHeader(n,a)}}t.auth&&this.setHeader("Authorization","Basic "+Base64.btoa(t.auth));var h=new Response;h.on("close",function(){r.emit("close")}),h.on("ready",function(){r.emit("response",h)}),e.onreadystatechange=function(){e.__aborted||h.handle(e)}};inherits(Request,Stream),Request.prototype.setHeader=function(e,t){this._headers[e.toLowerCase()]=t},Request.prototype.getHeader=function(e){return this._headers[e.toLowerCase()]},Request.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},Request.prototype.write=function(e){this.body.push(e)},Request.prototype.destroy=function(){this.xhr.__aborted=!0,this.xhr.abort(),this.emit("close")},Request.prototype.end=function(e){void 0!==e&&this.body.push(e);for(var t=objectKeys(this._headers),r=0;r<t.length;r++){var s=t[r],o=this._headers[s];if(isArray(o))for(var i=0;i<o.length;i++)this.xhr.setRequestHeader(s,o[i]);else this.xhr.setRequestHeader(s,o)}if(0===this.body.length)this.xhr.send("");else if("string"==typeof this.body[0])this.xhr.send(this.body.join(""));else if(isArray(this.body[0])){for(var n=[],r=0;r<this.body.length;r++)n.push.apply(n,this.body[r]);this.xhr.send(n)}else if(/Array/.test(Object.prototype.toString.call(this.body[0]))){for(var a=0,r=0;r<this.body.length;r++)a+=this.body[r].length;for(var n=new this.body[0].constructor(a),h=0,r=0;r<this.body.length;r++)for(var d=this.body[r],i=0;i<d.length;i++)n[h++]=d[i];this.xhr.send(n)}else{for(var n="",r=0;r<this.body.length;r++)n+=this.body[r].toString();this.xhr.send(n)}},Request.unsafeHeaders=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"],Request.prototype.isSafeRequestHeader=function(e){return e?-1===indexOf(Request.unsafeHeaders,e.toLowerCase()):!1};var objectKeys=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t},isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1};
},{"./response":87,"Base64":88,"inherits":90,"stream":98}],87:[function(require,module,exports){
function parseHeaders(e){for(var t=e.getAllResponseHeaders().split(/\r?\n/),s={},r=0;r<t.length;r++){var a=t[r];if(""!==a){var i=a.match(/^([^:]+):\s*(.*)/);if(i){var o=i[1].toLowerCase(),n=i[2];void 0!==s[o]?isArray(s[o])?s[o].push(n):s[o]=[s[o],n]:s[o]=n}else s[a]=!0}}return s}var Stream=require("stream"),util=require("util"),Response=module.exports=function(){this.offset=0,this.readable=!0};util.inherits(Response,Stream);var capable={streaming:!0,status2:!0};Response.prototype.getResponse=function(e){var t=String(e.responseType).toLowerCase();return"blob"===t?e.responseBlob||e.response:"arraybuffer"===t?e.response:e.responseText},Response.prototype.getHeader=function(e){return this.headers[e.toLowerCase()]},Response.prototype.handle=function(e){if(2===e.readyState&&capable.status2){try{this.statusCode=e.status,this.headers=parseHeaders(e)}catch(t){capable.status2=!1}capable.status2&&this.emit("ready")}else if(capable.streaming&&3===e.readyState){try{this.statusCode||(this.statusCode=e.status,this.headers=parseHeaders(e),this.emit("ready"))}catch(t){}try{this._emitData(e)}catch(t){capable.streaming=!1}}else 4===e.readyState&&(this.statusCode||(this.statusCode=e.status,this.emit("ready")),this._emitData(e),e.error?this.emit("error",this.getResponse(e)):this.emit("end"),this.emit("close"))},Response.prototype._emitData=function(e){var t=this.getResponse(e);return t.toString().match(/ArrayBuffer/)?(this.emit("data",new Uint8Array(t,this.offset)),void(this.offset=t.byteLength)):void(t.length>this.offset&&(this.emit("data",t.slice(this.offset)),this.offset=t.length))};var isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};
},{"stream":98,"util":107}],88:[function(require,module,exports){
!function(){function t(t){this.message=t}var e="undefined"!=typeof exports?exports:this,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",e.btoa||(e.btoa=function(e){for(var o,n,a=0,i=r,c="";e.charAt(0|a)||(i="=",a%1);c+=i.charAt(63&o>>8-a%1*8)){if(n=e.charCodeAt(a+=.75),n>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return c}),e.atob||(e.atob=function(e){if(e=e.replace(/=+$/,""),e.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,n,a=0,i=0,c="";n=e.charAt(i++);~n&&(o=a%4?64*o+n:n,a++%4)?c+=String.fromCharCode(255&o>>(-2*a&6)):0)n=r.indexOf(n);return c})}();
},{}],89:[function(require,module,exports){
var http=require("http"),https=module.exports;for(var key in http)http.hasOwnProperty(key)&&(https[key]=http[key]);https.request=function(t,e){return t||(t={}),t.scheme="https",http.request.call(this,t,e)};
},{"http":85}],90:[function(require,module,exports){
module.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t};
},{}],91:[function(require,module,exports){
function noop(){}var process=module.exports={};process.nextTick=function(){var o="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(o)return function(o){return window.setImmediate(o)};if(e){var n=[];return window.addEventListener("message",function(o){var e=o.source;if((e===window||null===e)&&"process-tick"===o.data&&(o.stopPropagation(),n.length>0)){var s=n.shift();s()}},!0),function(o){n.push(o),window.postMessage("process-tick","*")}}return function(o){setTimeout(o,0)}}(),process.title="browser",process.browser=!0,process.env={},process.argv=[],process.on=noop,process.once=noop,process.off=noop,process.emit=noop,process.binding=function(){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(){throw new Error("process.chdir is not supported")};
},{}],92:[function(require,module,exports){
(function(r){function t(r,t){for(var e=0,n=r.length-1;n>=0;n--){var s=r[n];"."===s?r.splice(n,1):".."===s?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e--;e)r.unshift("..");return r}function e(r,t){if(r.filter)return r.filter(t);for(var e=[],n=0;n<r.length;n++)t(r[n],n,r)&&e.push(r[n]);return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,s=function(r){return n.exec(r).slice(1)};exports.resolve=function(){for(var n="",s=!1,o=arguments.length-1;o>=-1&&!s;o--){var i=o>=0?arguments[o]:r.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(n=i+"/"+n,s="/"===i.charAt(0))}return n=t(e(n.split("/"),function(r){return!!r}),!s).join("/"),(s?"/":"")+n||"."},exports.normalize=function(r){var n=exports.isAbsolute(r),s="/"===o(r,-1);return r=t(e(r.split("/"),function(r){return!!r}),!n).join("/"),r||n||(r="."),r&&s&&(r+="/"),(n?"/":"")+r},exports.isAbsolute=function(r){return"/"===r.charAt(0)},exports.join=function(){var r=Array.prototype.slice.call(arguments,0);return exports.normalize(e(r,function(r){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))},exports.relative=function(r,t){function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var n=e(r.split("/")),s=e(t.split("/")),o=Math.min(n.length,s.length),i=o,u=0;o>u;u++)if(n[u]!==s[u]){i=u;break}for(var l=[],u=i;u<n.length;u++)l.push("..");return l=l.concat(s.slice(i)),l.join("/")},exports.sep="/",exports.delimiter=":",exports.dirname=function(r){var t=s(r),e=t[0],n=t[1];return e||n?(n&&(n=n.substr(0,n.length-1)),e+n):"."},exports.basename=function(r,t){var e=s(r)[2];return t&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),e},exports.extname=function(r){return s(r)[3]};var o="b"==="ab".substr(-1)?function(r,t,e){return r.substr(t,e)}:function(r,t,e){return 0>t&&(t=r.length+t),r.substr(t,e)}}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"));
},{"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91}],93:[function(require,module,exports){
(function(e){!function(o){function n(e){throw RangeError(M[e])}function t(e,o){for(var n=e.length;n--;)e[n]=o(e[n]);return e}function r(e,o){return t(e.split(L),o).join(".")}function f(e){for(var o,n,t=[],r=0,f=e.length;f>r;)o=e.charCodeAt(r++),o>=55296&&56319>=o&&f>r?(n=e.charCodeAt(r++),56320==(64512&n)?t.push(((1023&o)<<10)+(1023&n)+65536):(t.push(o),r--)):t.push(o);return t}function i(e){return t(e,function(e){var o="";return e>65535&&(e-=65536,o+=T(e>>>10&1023|55296),e=56320|1023&e),o+=T(e)}).join("")}function u(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:C}function c(e,o){return e+22+75*(26>e)-((0!=o)<<5)}function d(e,o,n){var t=0;for(e=n?R(e/A):e>>1,e+=R(e/o);e>P*j>>1;t+=C)e=R(e/P);return R(t+(P+1)*e/(e+m))}function l(e){var o,t,r,f,c,l,s,p,a,h,v=[],w=e.length,g=0,y=F,m=I;for(t=e.lastIndexOf(E),0>t&&(t=0),r=0;t>r;++r)e.charCodeAt(r)>=128&&n("not-basic"),v.push(e.charCodeAt(r));for(f=t>0?t+1:0;w>f;){for(c=g,l=1,s=C;f>=w&&n("invalid-input"),p=u(e.charCodeAt(f++)),(p>=C||p>R((x-g)/l))&&n("overflow"),g+=p*l,a=m>=s?b:s>=m+j?j:s-m,!(a>p);s+=C)h=C-a,l>R(x/h)&&n("overflow"),l*=h;o=v.length+1,m=d(g-c,o,0==c),R(g/o)>x-y&&n("overflow"),y+=R(g/o),g%=o,v.splice(g++,0,y)}return i(v)}function s(e){var o,t,r,i,u,l,s,p,a,h,v,w,g,y,m,A=[];for(e=f(e),w=e.length,o=F,t=0,u=I,l=0;w>l;++l)v=e[l],128>v&&A.push(T(v));for(r=i=A.length,i&&A.push(E);w>r;){for(s=x,l=0;w>l;++l)v=e[l],v>=o&&s>v&&(s=v);for(g=r+1,s-o>R((x-t)/g)&&n("overflow"),t+=(s-o)*g,o=s,l=0;w>l;++l)if(v=e[l],o>v&&++t>x&&n("overflow"),v==o){for(p=t,a=C;h=u>=a?b:a>=u+j?j:a-u,!(h>p);a+=C)m=p-h,y=C-h,A.push(T(c(h+m%y,0))),p=R(m/y);A.push(T(c(p,0))),u=d(t,g,r==i),t=0,++r}++t,++o}return A.join("")}function p(e){return r(e,function(e){return O.test(e)?l(e.slice(4).toLowerCase()):e})}function a(e){return r(e,function(e){return S.test(e)?"xn--"+s(e):e})}var h="object"==typeof exports&&exports,v="object"==typeof module&&module&&module.exports==h&&module,w="object"==typeof e&&e;(w.global===w||w.window===w)&&(o=w);var g,y,x=2147483647,C=36,b=1,j=26,m=38,A=700,I=72,F=128,E="-",O=/^xn--/,S=/[^ -~]/,L=/\x2E|\u3002|\uFF0E|\uFF61/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=C-b,R=Math.floor,T=String.fromCharCode;if(g={version:"1.2.4",ucs2:{decode:f,encode:i},decode:l,encode:s,toASCII:a,toUnicode:p},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return g});else if(h&&!h.nodeType)if(v)v.exports=g;else for(y in g)g.hasOwnProperty(y)&&(h[y]=g[y]);else o.punycode=g}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});
},{}],94:[function(require,module,exports){
"use strict";function hasOwnProperty(r,e){return Object.prototype.hasOwnProperty.call(r,e)}module.exports=function(r,e,t,n){e=e||"&",t=t||"=";var o={};if("string"!=typeof r||0===r.length)return o;var a=/\+/g;r=r.split(e);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var p=r.length;s>0&&p>s&&(p=s);for(var y=0;p>y;++y){var u,c,i,l,f=r[y].replace(a,"%20"),v=f.indexOf(t);v>=0?(u=f.substr(0,v),c=f.substr(v+1)):(u=f,c=""),i=decodeURIComponent(u),l=decodeURIComponent(c),hasOwnProperty(o,i)?isArray(o[i])?o[i].push(l):o[i]=[o[i],l]:o[i]=l}return o};var isArray=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)};
},{}],95:[function(require,module,exports){
"use strict";function map(r,e){if(r.map)return r.map(e);for(var t=[],n=0;n<r.length;n++)t.push(e(r[n],n));return t}var stringifyPrimitive=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}};module.exports=function(r,e,t,n){return e=e||"&",t=t||"=",null===r&&(r=void 0),"object"==typeof r?map(objectKeys(r),function(n){var i=encodeURIComponent(stringifyPrimitive(n))+t;return isArray(r[n])?r[n].map(function(r){return i+encodeURIComponent(stringifyPrimitive(r))}).join(e):i+encodeURIComponent(stringifyPrimitive(r[n]))}).join(e):n?encodeURIComponent(stringifyPrimitive(n))+t+encodeURIComponent(stringifyPrimitive(r)):""};var isArray=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)},objectKeys=Object.keys||function(r){var e=[];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.push(t);return e};
},{}],96:[function(require,module,exports){
"use strict";exports.decode=exports.parse=require("./decode"),exports.encode=exports.stringify=require("./encode");
},{"./decode":94,"./encode":95}],97:[function(require,module,exports){
function Duplex(e){return this instanceof Duplex?(Readable.call(this,e),Writable.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",onend)):new Duplex(e)}function onend(){if(!this.allowHalfOpen&&!this._writableState.ended){var e=this;setImmediate(function(){e.end()})}}module.exports=Duplex;var inherits=require("inherits"),setImmediate=require("process/browser.js").nextTick,Readable=require("./readable.js"),Writable=require("./writable.js");inherits(Duplex,Readable),Duplex.prototype.write=Writable.prototype.write,Duplex.prototype.end=Writable.prototype.end,Duplex.prototype._write=Writable.prototype._write;
},{"./readable.js":101,"./writable.js":103,"inherits":90,"process/browser.js":99}],98:[function(require,module,exports){
function Stream(){EE.call(this)}module.exports=Stream;var EE=require("events").EventEmitter,inherits=require("inherits");inherits(Stream,EE),Stream.Readable=require("./readable.js"),Stream.Writable=require("./writable.js"),Stream.Duplex=require("./duplex.js"),Stream.Transform=require("./transform.js"),Stream.PassThrough=require("./passthrough.js"),Stream.Stream=Stream,Stream.prototype.pipe=function(e,r){function t(r){e.writable&&!1===e.write(r)&&m.pause&&m.pause()}function n(){m.readable&&m.resume&&m.resume()}function o(){u||(u=!0,e.end())}function i(){u||(u=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(a(),0===EE.listenerCount(this,"error"))throw e}function a(){m.removeListener("data",t),e.removeListener("drain",n),m.removeListener("end",o),m.removeListener("close",i),m.removeListener("error",s),e.removeListener("error",s),m.removeListener("end",a),m.removeListener("close",a),e.removeListener("close",a)}var m=this;m.on("data",t),e.on("drain",n),e._isStdio||r&&r.end===!1||(m.on("end",o),m.on("close",i));var u=!1;return m.on("error",s),e.on("error",s),m.on("end",a),m.on("close",a),e.on("close",a),e.emit("pipe",m),e};
},{"./duplex.js":97,"./passthrough.js":100,"./readable.js":101,"./transform.js":102,"./writable.js":103,"events":84,"inherits":90}],99:[function(require,module,exports){
var process=module.exports={};process.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(n){var o=[];return window.addEventListener("message",function(e){var n=e.source;if((n===window||null===n)&&"process-tick"===e.data&&(e.stopPropagation(),o.length>0)){var r=o.shift();r()}},!0),function(e){o.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),process.title="browser",process.browser=!0,process.env={},process.argv=[],process.binding=function(){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(){throw new Error("process.chdir is not supported")};
},{}],100:[function(require,module,exports){
function PassThrough(r){return this instanceof PassThrough?void Transform.call(this,r):new PassThrough(r)}module.exports=PassThrough;var Transform=require("./transform.js"),inherits=require("inherits");inherits(PassThrough,Transform),PassThrough.prototype._transform=function(r,s,o){o(null,r)};
},{"./transform.js":102,"inherits":90}],101:[function(require,module,exports){
(function(e){function t(e){e=e||{};var t=e.highWaterMark;this.highWaterMark=t||0===t?t:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!e.objectMode,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(_||(_=require("string_decoder").StringDecoder),this.decoder=new _(e.encoding),this.encoding=e.encoding)}function n(e){return this instanceof n?(this._readableState=new t(e,this),this.readable=!0,void S.call(this)):new n(e)}function r(e,t,n,r,a){var o=d(t,n);if(o)e.emit("error",o);else if(null===n||void 0===n)t.reading=!1,t.ended||s(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!a){var u=new Error("stream.push() after EOF");e.emit("error",u)}else if(t.endEmitted&&a){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else!t.decoder||a||r||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,a?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&l(e),h(e,t);else a||(t.reading=!1);return i(t)}function i(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function a(e){if(e>=L)e=L;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function o(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||null===e?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function d(e,t){var n=null;return R.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function s(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?l(e):v(e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?E(function(){u(e)}):u(e))}function u(e){e.emit("readable")}function h(e,t){t.readingMore||(t.readingMore=!0,E(function(){f(e,t)}))}function f(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function p(e){return function(){var t=e._readableState;t.awaitDrain--,0===t.awaitDrain&&c(e)}}function c(e){function t(e){var t=e.write(n);!1===t&&r.awaitDrain++}var n,r=e._readableState;for(r.awaitDrain=0;r.pipesCount&&null!==(n=e.read());)if(1===r.pipesCount?t(r.pipes,0,null):w(r.pipes,t),e.emit("data",n),r.awaitDrain>0)return;return 0===r.pipesCount?(r.flowing=!1,void(M.listenerCount(e,"data")>0&&b(e))):void(r.ranOut=!0)}function g(){this._readableState.ranOut&&(this._readableState.ranOut=!1,c(this))}function b(e,t){var n=e._readableState;if(n.flowing)throw new Error("Cannot switch to old mode now.");var r=t||!1,i=!1;e.readable=!0,e.pipe=S.prototype.pipe,e.on=e.addListener=S.prototype.on,e.on("readable",function(){i=!0;for(var t;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(i=!1,e._readableState.needReadable=!0)}),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,i?E(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function m(e,t){var n,r=t.buffer,i=t.length,a=!!t.decoder,o=!!t.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(o)n=r.shift();else if(!e||e>=i)n=a?r.join(""):R.concat(r,i),r.length=0;else if(e<r[0].length){var d=r[0];n=d.slice(0,e),r[0]=d.slice(e)}else if(e===r[0].length)n=r.shift();else{n=a?"":new R(e);for(var s=0,l=0,u=r.length;u>l&&e>s;l++){var d=r[0],h=Math.min(e-s,d.length);a?n+=d.slice(0,h):d.copy(n,s,0,h),h<d.length?r[0]=d.slice(h):r.shift(),s+=h}}return n}function v(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,E(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function w(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function y(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}module.exports=n,n.ReadableState=t;var _,M=require("events").EventEmitter,S=require("./index.js"),R=require("buffer").Buffer,E=require("process/browser.js").nextTick,C=require("inherits");C(n,S),n.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new R(e,t),t="")),r(this,n,e,t,!1)},n.prototype.unshift=function(e){var t=this._readableState;return r(this,t,e,"",!0)},n.prototype.setEncoding=function(e){_||(_=require("string_decoder").StringDecoder),this._readableState.decoder=new _(e),this._readableState.encoding=e};var L=8388608;n.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l(this),null;if(e=o(e,t),0===e&&t.ended)return 0===t.length&&v(this),null;var r=t.needReadable;t.length-e<=t.highWaterMark&&(r=!0),(t.ended||t.reading)&&(r=!1),r&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=o(n,t));var i;return i=e>0?m(e,t):null,null===i&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&v(this),i},n.prototype._read=function(){this.emit("error",new Error("not implemented"))},n.prototype.pipe=function(t,n){function r(e){e===u&&a()}function i(){t.end()}function a(){t.removeListener("close",d),t.removeListener("finish",s),t.removeListener("drain",m),t.removeListener("error",o),t.removeListener("unpipe",r),u.removeListener("end",i),u.removeListener("end",a),(!t._writableState||t._writableState.needDrain)&&m()}function o(e){l(),0===v&&0===M.listenerCount(t,"error")&&t.emit("error",e)}function d(){t.removeListener("finish",s),l()}function s(){t.removeListener("close",d),l()}function l(){u.unpipe(t)}var u=this,h=this._readableState;switch(h.pipesCount){case 0:h.pipes=t;break;case 1:h.pipes=[h.pipes,t];break;default:h.pipes.push(t)}h.pipesCount+=1;var f=(!n||n.end!==!1)&&t!==e.stdout&&t!==e.stderr,b=f?i:a;h.endEmitted?E(b):u.once("end",b),t.on("unpipe",r);var m=p(u);t.on("drain",m);var v=M.listenerCount(t,"error");return t.once("error",o),t.once("close",d),t.once("finish",s),t.emit("pipe",u),h.flowing||(this.on("readable",g),h.flowing=!0,E(function(){c(u)})),t},n.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",g),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",g),t.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var i=y(t.pipes,e);return-1===i?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},n.prototype.on=function(e,t){var n=S.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||b(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&l(this,r):this.read(0))}return n},n.prototype.addListener=n.prototype.on,n.prototype.resume=function(){b(this),this.read(0),this.emit("resume")},n.prototype.pause=function(){b(this,!0),this.emit("pause")},n.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(t.decoder&&(i=t.decoder.write(i)),i&&(t.objectMode||i.length)){var a=r.push(i);a||(n=!0,e.pause())}});for(var i in e)"function"==typeof e[i]&&"undefined"==typeof this[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));var a=["error","close","destroy","pause","resume"];return w(a,function(t){e.on(t,function(e){return r.emit.apply(r,t,e)})}),r._read=function(){n&&(n=!1,e.resume())},r},n._fromList=m}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"));
},{"./index.js":98,"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91,"buffer":75,"events":84,"inherits":90,"process/browser.js":99,"string_decoder":104}],102:[function(require,module,exports){
function TransformState(r,t){this.afterTransform=function(r,n){return afterTransform(t,r,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function afterTransform(r,t,n){var e=r._transformState;e.transforming=!1;var a=e.writecb;if(!a)return r.emit("error",new Error("no writecb in Transform class"));e.writechunk=null,e.writecb=null,null!==n&&void 0!==n&&r.push(n),a&&a(t);var i=r._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&r._read(i.highWaterMark)}function Transform(r){if(!(this instanceof Transform))return new Transform(r);Duplex.call(this,r);var t=(this._transformState=new TransformState(r,this),this);this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("finish",function(){"function"==typeof this._flush?this._flush(function(r){done(t,r)}):done(t)})}function done(r,t){if(t)return r.emit("error",t);var n=r._writableState,e=(r._readableState,r._transformState);if(n.length)throw new Error("calling transform done when ws.length != 0");if(e.transforming)throw new Error("calling transform done when still transforming");return r.push(null)}module.exports=Transform;var Duplex=require("./duplex.js"),inherits=require("inherits");inherits(Transform,Duplex),Transform.prototype.push=function(r,t){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,r,t)},Transform.prototype._transform=function(){throw new Error("not implemented")},Transform.prototype._write=function(r,t,n){var e=this._transformState;if(e.writecb=n,e.writechunk=r,e.writeencoding=t,!e.transforming){var a=this._readableState;(e.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}},Transform.prototype._read=function(){var r=this._transformState;r.writechunk&&r.writecb&&!r.transforming?(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform)):r.needTransform=!0};
},{"./duplex.js":97,"inherits":90}],103:[function(require,module,exports){
function WriteReq(e,t,r){this.chunk=e,this.encoding=t,this.callback=r}function WritableState(e,t){e=e||{};var r=e.highWaterMark;this.highWaterMark=r||0===r?r:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){onwrite(t,e)},this.writecb=null,this.writelen=0,this.buffer=[]}function Writable(e){return this instanceof Writable||this instanceof Stream.Duplex?(this._writableState=new WritableState(e,this),this.writable=!0,void Stream.call(this)):new Writable(e)}function writeAfterEnd(e,t,r){var i=new Error("write after end");e.emit("error",i),setImmediate(function(){r(i)})}function validChunk(e,t,r,i){var n=!0;if(!Buffer.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==r&&!t.objectMode){var f=new TypeError("Invalid non-string/buffer chunk");e.emit("error",f),setImmediate(function(){i(f)}),n=!1}return n}function decodeChunk(e,t,r){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new Buffer(t,r)),t}function writeOrBuffer(e,t,r,i,n){r=decodeChunk(t,r,i);var f=t.objectMode?1:r.length;t.length+=f;var o=t.length<t.highWaterMark;return t.needDrain=!o,t.writing?t.buffer.push(new WriteReq(r,i,n)):doWrite(e,t,f,r,i,n),o}function doWrite(e,t,r,i,n,f){t.writelen=r,t.writecb=f,t.writing=!0,t.sync=!0,e._write(i,n,t.onwrite),t.sync=!1}function onwriteError(e,t,r,i,n){r?setImmediate(function(){n(i)}):n(i),e.emit("error",i)}function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function onwrite(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(onwriteStateUpdate(r),t)onwriteError(e,r,i,t,n);else{var f=needFinish(e,r);f||r.bufferProcessing||!r.buffer.length||clearBuffer(e,r),i?setImmediate(function(){afterWrite(e,r,f,n)}):afterWrite(e,r,f,n)}}function afterWrite(e,t,r,i){r||onwriteDrain(e,t),i(),r&&finishMaybe(e,t)}function onwriteDrain(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function clearBuffer(e,t){t.bufferProcessing=!0;for(var r=0;r<t.buffer.length;r++){var i=t.buffer[r],n=i.chunk,f=i.encoding,o=i.callback,a=t.objectMode?1:n.length;if(doWrite(e,t,a,n,f,o),t.writing){r++;break}}t.bufferProcessing=!1,r<t.buffer.length?t.buffer=t.buffer.slice(r):t.buffer.length=0}function needFinish(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function finishMaybe(e,t){var r=needFinish(e,t);return r&&(t.finished=!0,e.emit("finish")),r}function endWritable(e,t,r){t.ending=!0,finishMaybe(e,t),r&&(t.finished?setImmediate(r):e.once("finish",r)),t.ended=!0}module.exports=Writable,Writable.WritableState=WritableState;var isUint8Array="undefined"!=typeof Uint8Array?function(e){return e instanceof Uint8Array}:function(e){return e&&e.constructor&&"Uint8Array"===e.constructor.name},isArrayBuffer="undefined"!=typeof ArrayBuffer?function(e){return e instanceof ArrayBuffer}:function(e){return e&&e.constructor&&"ArrayBuffer"===e.constructor.name},inherits=require("inherits"),Stream=require("./index.js"),setImmediate=require("process/browser.js").nextTick,Buffer=require("buffer").Buffer;inherits(Writable,Stream),Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},Writable.prototype.write=function(e,t,r){var i=this._writableState,n=!1;return"function"==typeof t&&(r=t,t=null),!Buffer.isBuffer(e)&&isUint8Array(e)&&(e=new Buffer(e)),isArrayBuffer(e)&&"undefined"!=typeof Uint8Array&&(e=new Buffer(new Uint8Array(e))),Buffer.isBuffer(e)?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=function(){}),i.ended?writeAfterEnd(this,i,r):validChunk(this,i,e,r)&&(n=writeOrBuffer(this,i,e,t,r)),n},Writable.prototype._write=function(e,t,r){r(new Error("not implemented"))},Writable.prototype.end=function(e,t,r){var i=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),"undefined"!=typeof e&&null!==e&&this.write(e,t),i.ending||i.finished||endWritable(this,i,r)};
},{"./index.js":98,"buffer":75,"inherits":90,"process/browser.js":99}],104:[function(require,module,exports){
function assertEncoding(e){if(e&&!Buffer.isEncoding(e))throw new Error("Unknown encoding: "+e)}function passThroughWrite(e){return e.toString(this.encoding)}function utf16DetectIncompleteChar(e){var t=this.charReceived=e.length%2;return this.charLength=t?2:0,t}function base64DetectIncompleteChar(e){var t=this.charReceived=e.length%3;return this.charLength=t?3:0,t}var Buffer=require("buffer").Buffer,StringDecoder=exports.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),assertEncoding(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=base64DetectIncompleteChar;break;default:return void(this.write=passThroughWrite)}this.charBuffer=new Buffer(6),this.charReceived=0,this.charLength=0};StringDecoder.prototype.write=function(e){for(var t="",r=0;this.charLength;){var h=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,r,h),this.charReceived+=h-r,r=h,this.charReceived<this.charLength)return"";t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=t.charCodeAt(t.length-1);if(!(i>=55296&&56319>=i)){if(this.charReceived=this.charLength=0,h==e.length)return t;e=e.slice(h,e.length);break}this.charLength+=this.surrogateSize,t=""}var c=this.detectIncompleteChar(e),n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-c,n),this.charReceived=c,n-=c),t+=e.toString(this.encoding,0,n);var n=t.length-1,i=t.charCodeAt(n);if(i>=55296&&56319>=i){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),this.charBuffer.write(t.charAt(t.length-1),this.encoding),t.substring(0,n)}return t},StringDecoder.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(2>=t&&r>>4==14){this.charLength=3;break}if(3>=t&&r>>3==30){this.charLength=4;break}}return t},StringDecoder.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,h=this.charBuffer,i=this.encoding;t+=h.slice(0,r).toString(i)}return t};
},{"buffer":75}],105:[function(require,module,exports){
!function(){"use strict";function t(t,h,a){if(t&&"object"==typeof t&&t.href)return t;if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n={},p=t;p=p.trim();var i=r.exec(p);if(i){i=i[0];var q=i.toLowerCase();n.protocol=q,p=p.substr(i.length)}if(a||i||p.match(/^\/\/[^@\/]+@[^@\/]+/)){var j="//"===p.substr(0,2);!j||i&&g[i]||(p=p.substr(2),n.slashes=!0)}if(!g[i]&&(j||i&&!y[i])){var x=p.indexOf("@");if(-1!==x){for(var A=p.slice(0,x),O=!0,z=0,C=m.length;C>z;z++)if(-1!==A.indexOf(m[z])){O=!1;break}O&&(n.auth=decodeURIComponent(A),p=p.substr(x+1))}for(var Z=-1,z=0,C=f.length;C>z;z++){var k=p.indexOf(f[z]);-1!==k&&(0>Z||Z>k)&&(Z=k)}-1!==Z?(n.host=p.substr(0,Z),p=p.substr(Z)):(n.host=p,p="");for(var w=s(n.host),I=Object.keys(w),z=0,C=I.length;C>z;z++){var R=I[z];n[R]=w[R]}n.hostname=n.hostname||"";var U="["===n.hostname[0]&&"]"===n.hostname[n.hostname.length-1];if(n.hostname.length>l)n.hostname="";else if(!U)for(var $=n.hostname.split(/\./),z=0,C=$.length;C>z;z++){var _=$[z];if(_&&!_.match(u)){for(var L="",E=0,P=_.length;P>E;E++)L+=_.charCodeAt(E)>127?"x":_[E];if(!L.match(u)){var T=$.slice(0,z),B=$.slice(z+1),D=_.match(v);D&&(T.push(D[1]),B.unshift(D[2])),B.length&&(p="/"+B.join(".")+p),n.hostname=T.join(".");break}}}if(n.hostname=n.hostname.toLowerCase(),!U){for(var F=n.hostname.split("."),G=[],z=0;z<F.length;++z){var H=F[z];G.push(H.match(/[^A-Za-z0-9_-]/)?"xn--"+o.encode(H):H)}n.hostname=G.join(".")}n.host=(n.hostname||"")+(n.port?":"+n.port:""),n.href+=n.host,U&&(n.hostname=n.hostname.substr(1,n.hostname.length-2),"/"!==p[0]&&(p="/"+p))}if(!d[q])for(var z=0,C=c.length;C>z;z++){var J=c[z],K=encodeURIComponent(J);K===J&&(K=escape(J)),p=p.split(J).join(K)}var M=p.indexOf("#");-1!==M&&(n.hash=p.substr(M),p=p.slice(0,M));var N=p.indexOf("?");return-1!==N?(n.search=p.substr(N),n.query=p.substr(N+1),h&&(n.query=b.parse(n.query)),p=p.slice(0,N)):h&&(n.search="",n.query={}),p&&(n.pathname=p),y[i]&&n.hostname&&!n.pathname&&(n.pathname="/"),(n.pathname||n.search)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=e(n),n}function e(e){"string"==typeof e&&(e=t(e));var h=e.auth||"";h&&(h=encodeURIComponent(h),h=h.replace(/%3A/i,":"),h+="@");var a=e.protocol||"",s=e.pathname||"",o=e.hash||"",r=!1,n="";void 0!==e.host?r=h+e.host:void 0!==e.hostname&&(r=h+(-1===e.hostname.indexOf(":")?e.hostname:"["+e.hostname+"]"),e.port&&(r+=":"+e.port)),e.query&&"object"==typeof e.query&&Object.keys(e.query).length&&(n=b.stringify(e.query));var p=e.search||n&&"?"+n||"";return a&&":"!==a.substr(-1)&&(a+=":"),e.slashes||(!a||y[a])&&r!==!1?(r="//"+(r||""),s&&"/"!==s.charAt(0)&&(s="/"+s)):r||(r=""),o&&"#"!==o.charAt(0)&&(o="#"+o),p&&"?"!==p.charAt(0)&&(p="?"+p),a+r+s+p+o}function h(t,h){return e(a(t,h))}function a(h,a){if(!h)return a;if(h=t(e(h),!1,!0),a=t(e(a),!1,!0),h.hash=a.hash,""===a.href)return h.href=e(h),h;if(a.slashes&&!a.protocol)return a.protocol=h.protocol,y[a.protocol]&&a.hostname&&!a.pathname&&(a.path=a.pathname="/"),a.href=e(a),a;if(a.protocol&&a.protocol!==h.protocol){if(!y[a.protocol])return a.href=e(a),a;if(h.protocol=a.protocol,!a.host&&!g[a.protocol]){for(var s=(a.pathname||"").split("/");s.length&&!(a.host=s.shift()););a.host||(a.host=""),a.hostname||(a.hostname=""),""!==s[0]&&s.unshift(""),s.length<2&&s.unshift(""),a.pathname=s.join("/")}return h.pathname=a.pathname,h.search=a.search,h.query=a.query,h.host=a.host||"",h.auth=a.auth,h.hostname=a.hostname||a.host,h.port=a.port,(void 0!==h.pathname||void 0!==h.search)&&(h.path=(h.pathname?h.pathname:"")+(h.search?h.search:"")),h.slashes=h.slashes||a.slashes,h.href=e(h),h}var o=h.pathname&&"/"===h.pathname.charAt(0),r=void 0!==a.host||a.pathname&&"/"===a.pathname.charAt(0),n=r||o||h.host&&a.pathname,p=n,i=h.pathname&&h.pathname.split("/")||[],s=a.pathname&&a.pathname.split("/")||[],c=h.protocol&&!y[h.protocol];if(c&&(delete h.hostname,delete h.port,h.host&&(""===i[0]?i[0]=h.host:i.unshift(h.host)),delete h.host,a.protocol&&(delete a.hostname,delete a.port,a.host&&(""===s[0]?s[0]=a.host:s.unshift(a.host)),delete a.host),n=n&&(""===s[0]||""===i[0])),r)h.host=a.host||""===a.host?a.host:h.host,h.hostname=a.hostname||""===a.hostname?a.hostname:h.hostname,h.search=a.search,h.query=a.query,i=s;else if(s.length)i||(i=[]),i.pop(),i=i.concat(s),h.search=a.search,h.query=a.query;else if("search"in a){if(c){h.hostname=h.host=i.shift();var f=h.host&&h.host.indexOf("@")>0?h.host.split("@"):!1;f&&(h.auth=f.shift(),h.host=h.hostname=f.shift())}return h.search=a.search,h.query=a.query,(void 0!==h.pathname||void 0!==h.search)&&(h.path=(h.pathname?h.pathname:"")+(h.search?h.search:"")),h.href=e(h),h}if(!i.length)return delete h.pathname,h.search?delete h.path:h.path="/"+h.search,h.href=e(h),h;for(var m=i.slice(-1)[0],l=(h.host||a.host)&&("."===m||".."===m)||""===m,u=0,v=i.length;v>=0;v--)m=i[v],"."==m?i.splice(v,1):".."===m?(i.splice(v,1),u++):u&&(i.splice(v,1),u--);if(!n&&!p)for(;u--;u)i.unshift("..");!n||""===i[0]||i[0]&&"/"===i[0].charAt(0)||i.unshift(""),l&&"/"!==i.join("/").substr(-1)&&i.push("");var d=""===i[0]||i[0]&&"/"===i[0].charAt(0);if(c){h.hostname=h.host=d?"":i.length?i.shift():"";var f=h.host&&h.host.indexOf("@")>0?h.host.split("@"):!1;f&&(h.auth=f.shift(),h.host=h.hostname=f.shift())}return n=n||h.host&&i.length,n&&!d&&i.unshift(""),h.pathname=i.join("/"),(void 0!==h.pathname||void 0!==h.search)&&(h.path=(h.pathname?h.pathname:"")+(h.search?h.search:"")),h.auth=a.auth||h.auth,h.slashes=h.slashes||a.slashes,h.href=e(h),h}function s(t){var e={},h=n.exec(t);return h&&(h=h[0],":"!==h&&(e.port=h.substr(1)),t=t.substr(0,t.length-h.length)),t&&(e.hostname=t),e}var o=require("punycode");exports.parse=t,exports.resolve=h,exports.resolveObject=a,exports.format=e;var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,p=["<",">",'"',"`"," ","\r","\n"," "],i=["{","}","|","\\","^","~","`"].concat(p),c=["'"].concat(p),f=["%","/","?",";","#"].concat(i).concat(c),m=["/","@","?","#"].concat(p),l=255,u=/^[a-zA-Z0-9][a-z0-9A-Z_-]{0,62}$/,v=/^([a-zA-Z0-9][a-z0-9A-Z_-]{0,62})(.*)$/,d={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=require("querystring")}();
},{"punycode":93,"querystring":96}],106:[function(require,module,exports){
module.exports=require(73)
},{}],107:[function(require,module,exports){
module.exports=require(74)
},{"./support/isBuffer":106,"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91,"inherits":90}],"aXRuS6":[function(require,module,exports){
(function(t){function e(){this.words=[],this.len=0}module.exports=e,e.prototype.put=function(t){return this.words.push({buffer:t}),this.len+=t.length,this},e.prototype.word8=function(t){return this.words.push({bytes:1,value:t}),this.len+=1,this},e.prototype.floatle=function(t){return this.words.push({bytes:"float",endian:"little",value:t}),this.len+=4,this},e.prototype.varint=function(t){253>t?this.word8(t):65536>=t?(this.word8(253),this.word16le(t)):1>=t?(this.word8(254),this.word32le(t)):(this.word8(255),this.word64le(t))},[8,16,24,32,64].forEach(function(t){e.prototype["word"+t+"be"]=function(e){return this.words.push({endian:"big",bytes:t/8,value:e}),this.len+=t/8,this},e.prototype["word"+t+"le"]=function(e){return this.words.push({endian:"little",bytes:t/8,value:e}),this.len+=t/8,this}}),e.prototype.pad=function(t){return this.words.push({endian:"big",bytes:t,value:0}),this.len+=t,this},e.prototype.length=function(){return this.len},e.prototype.buffer=function(){var e=new t(this.len),o=0;return this.words.forEach(function(t){if(t.buffer)t.buffer.copy(e,o,0),o+=t.buffer.length;else if("float"==t.bytes){var r=Math.abs(t.value),i=1*(t.value>=0),n=Math.ceil(Math.log(r)/Math.LN2),s=r/(1<<n);e[o++]=i<<7&~~(n/2),e[o++]=(1&n)<<7&~~(s/65536),e[o++]=0,e[o++]=0,o+=4}else for(var h="big"===t.endian,u=h?[8*(t.bytes-1),-8]:[0,8],l=u[0];h?l>=0:l<8*t.bytes;l+=u[1])e[o++]=l>=32?255&Math.floor(t.value/Math.pow(2,l)):t.value>>l&255}),e},e.prototype.write=function(t){t.write(this.buffer())}}).call(this,require("buffer").Buffer);
},{"buffer":75}],"bufferput":[function(require,module,exports){
module.exports=require('aXRuS6');
},{}],"OBo3aV":[function(require,module,exports){
(function(t){function e(t){return this instanceof e?(this.buffers=t||[],void(this.length=this.buffers.reduce(function(t,e){return t+e.length},0))):new e(t)}module.exports=e,e.prototype.push=function(){for(var e=0;e<arguments.length;e++)if(!t.isBuffer(arguments[e]))throw new TypeError("Tried to push a non-buffer");for(var e=0;e<arguments.length;e++){var r=arguments[e];this.buffers.push(r),this.length+=r.length}return this.length},e.prototype.unshift=function(){for(var e=0;e<arguments.length;e++)if(!t.isBuffer(arguments[e]))throw new TypeError("Tried to unshift a non-buffer");for(var e=0;e<arguments.length;e++){var r=arguments[e];this.buffers.unshift(r),this.length+=r.length}return this.length},e.prototype.copy=function(t,e,r,n){return this.slice(r,n).copy(t,e,0,n-r)},e.prototype.splice=function(r,n){var s=this.buffers,i=r>=0?r:this.length-r,h=[].slice.call(arguments,2);void 0===n?n=this.length-i:n>this.length-i&&(n=this.length-i);for(var r=0;r<h.length;r++)this.length+=h[r].length;for(var f=new e,o=0,l=0;l<s.length&&o+s[l].length<i;l++)o+=s[l].length;if(i-o>0){var u=i-o;if(u+n<s[l].length){f.push(s[l].slice(u,u+n));for(var g=s[l],p=new t(u),r=0;u>r;r++)p[r]=g[r];for(var a=new t(g.length-u-n),r=u+n;r<g.length;r++)a[r-n-u]=g[r];if(h.length>0){var c=h.slice();c.unshift(p),c.push(a),s.splice.apply(s,[l,1].concat(c)),l+=c.length,h=[]}else s.splice(l,1,p,a),l+=2}else f.push(s[l].slice(u)),s[l]=s[l].slice(0,u),l++}for(h.length>0&&(s.splice.apply(s,[l,0].concat(h)),l+=h.length);f.length<n;){var v=s[l],b=v.length,y=Math.min(b,n-f.length);y===b?(f.push(v),s.splice(l,1)):(f.push(v.slice(0,y)),s[l]=s[l].slice(y))}return this.length-=f.length,f},e.prototype.slice=function(e,r){var n=this.buffers;void 0===r&&(r=this.length),void 0===e&&(e=0),r>this.length&&(r=this.length);for(var s=0,i=0;i<n.length&&s+n[i].length<=e;i++)s+=n[i].length;for(var h=new t(r-e),f=0,o=i;r-e>f&&o<n.length;o++){var l=n[o].length,u=0===f?e-s:0,g=f+l>=r-e?Math.min(u+(r-e)-f,l):l;n[o].copy(h,f,u,g),f+=g-u}return h},e.prototype.pos=function(t){if(0>t||t>=this.length)throw new Error("oob");for(var e=t,r=0,n=null;;){if(n=this.buffers[r],e<n.length)return{buf:r,offset:e};e-=n.length,r++}},e.prototype.get=function(t){var e=this.pos(t);return this.buffers[e.buf].get(e.offset)},e.prototype.set=function(t,e){var r=this.pos(t);return this.buffers[r.buf].set(r.offset,e)},e.prototype.indexOf=function(e,r){if("string"==typeof e)e=new t(e);else if(!(e instanceof t))throw new Error("Invalid type for a search string");if(!e.length)return 0;if(!this.length)return-1;var n,s=0,i=0,h=0,f=0;if(r){var o=this.pos(r);s=o.buf,i=o.offset,f=r}for(;;){for(;i>=this.buffers[s].length;)if(i=0,s++,s>=this.buffers.length)return-1;var l=this.buffers[s][i];if(l==e[h]){if(0==h&&(n={i:s,j:i,pos:f}),h++,h==e.length)return n.pos}else 0!=h&&(s=n.i,i=n.j,f=n.pos,h=0);i++,f++}},e.prototype.toBuffer=function(){return this.slice()},e.prototype.toString=function(t,e,r){return this.slice(e,r).toString(t)}}).call(this,require("buffer").Buffer);
},{"buffer":75}],"buffers":[function(require,module,exports){
module.exports=require('OBo3aV');
},{}],112:[function(require,module,exports){
module.exports=require("./lib/chai");
},{"./lib/chai":113}],113:[function(require,module,exports){
var used=[],exports=module.exports={};exports.version="1.9.1",exports.AssertionError=require("assertion-error");var util=require("./chai/utils");exports.use=function(e){return~used.indexOf(e)||(e(this,util),used.push(e)),this};var config=require("./chai/config");exports.config=config;var assertion=require("./chai/assertion");exports.use(assertion);var core=require("./chai/core/assertions");exports.use(core);var expect=require("./chai/interface/expect");exports.use(expect);var should=require("./chai/interface/should");exports.use(should);var assert=require("./chai/interface/assert");exports.use(assert);
},{"./chai/assertion":114,"./chai/config":115,"./chai/core/assertions":116,"./chai/interface/assert":117,"./chai/interface/expect":118,"./chai/interface/should":119,"./chai/utils":130,"assertion-error":139}],114:[function(require,module,exports){
var config=require("./config");module.exports=function(e,t){function i(e,t,i){n(this,"ssfi",i||arguments.callee),n(this,"object",e),n(this,"message",t)}var o=e.AssertionError,n=t.flag;e.Assertion=i,Object.defineProperty(i,"includeStack",{get:function(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),config.includeStack},set:function(e){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),config.includeStack=e}}),Object.defineProperty(i,"showDiff",{get:function(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),config.showDiff},set:function(e){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),config.showDiff=e}}),i.addProperty=function(e,i){t.addProperty(this.prototype,e,i)},i.addMethod=function(e,i){t.addMethod(this.prototype,e,i)},i.addChainableMethod=function(e,i,o){t.addChainableMethod(this.prototype,e,i,o)},i.overwriteProperty=function(e,i){t.overwriteProperty(this.prototype,e,i)},i.overwriteMethod=function(e,i){t.overwriteMethod(this.prototype,e,i)},i.overwriteChainableMethod=function(e,i,o){t.overwriteChainableMethod(this.prototype,e,i,o)},i.prototype.assert=function(e,i,s,r,c,a){var f=t.test(this,arguments);if(!0!==a&&(a=!1),!0!==config.showDiff&&(a=!1),!f){var i=t.getMessage(this,arguments),d=t.getActual(this,arguments);throw new o(i,{actual:d,expected:r,showDiff:a},config.includeStack?this.assert:n(this,"ssfi"))}},Object.defineProperty(i.prototype,"_obj",{get:function(){return n(this,"object")},set:function(e){n(this,"object",e)}})};
},{"./config":"4itQ50"}],115:[function(require,module,exports){
module.exports={includeStack:!1,showDiff:!0,truncateThreshold:40};
},{}],116:[function(require,module,exports){
module.exports=function(t,e){function s(t,s){s&&m(this,"message",s),t=t.toLowerCase();var o=m(this,"object"),i=~["a","e","i","o","u"].indexOf(t.charAt(0))?"an ":"a ";this.assert(t===e.type(o),"expected #{this} to be "+i+t,"expected #{this} not to be "+i+t)}function o(){m(this,"contains",!0)}function i(t,s){s&&m(this,"message",s);var o=m(this,"object"),i=!1;if("array"===e.type(o)&&"object"===e.type(t)){for(var h in o)if(e.eql(o[h],t)){i=!0;break}}else if("object"===e.type(t)){if(!m(this,"negate")){for(var n in t)new y(o).property(n,t[n]);return}var a={};for(var n in t)a[n]=o[n];i=e.eql(a,t)}else i=o&&~o.indexOf(t);this.assert(i,"expected #{this} to include "+e.inspect(t),"expected #{this} to not include "+e.inspect(t))}function h(){var t=m(this,"object"),e=Object.prototype.toString.call(t);this.assert("[object Arguments]"===e,"expected #{this} to be arguments but got "+e,"expected #{this} to not be arguments")}function n(t,e){e&&m(this,"message",e);var s=m(this,"object");return m(this,"deep")?this.eql(t):void this.assert(t===s,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",t,this._obj,!0)}function a(t,s){s&&m(this,"message",s),this.assert(e.eql(t,m(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",t,this._obj,!0)}function r(t,e){e&&m(this,"message",e);var s=m(this,"object");if(m(this,"doLength")){new y(s,e).to.have.property("length");var o=s.length;this.assert(o>t,"expected #{this} to have a length above #{exp} but got #{act}","expected #{this} to not have a length above #{exp}",t,o)}else this.assert(s>t,"expected #{this} to be above "+t,"expected #{this} to be at most "+t)}function d(t,e){e&&m(this,"message",e);var s=m(this,"object");if(m(this,"doLength")){new y(s,e).to.have.property("length");var o=s.length;this.assert(o>=t,"expected #{this} to have a length at least #{exp} but got #{act}","expected #{this} to have a length below #{exp}",t,o)}else this.assert(s>=t,"expected #{this} to be at least "+t,"expected #{this} to be below "+t)}function c(t,e){e&&m(this,"message",e);var s=m(this,"object");if(m(this,"doLength")){new y(s,e).to.have.property("length");var o=s.length;this.assert(t>o,"expected #{this} to have a length below #{exp} but got #{act}","expected #{this} to not have a length below #{exp}",t,o)}else this.assert(t>s,"expected #{this} to be below "+t,"expected #{this} to be at least "+t)}function p(t,e){e&&m(this,"message",e);var s=m(this,"object");if(m(this,"doLength")){new y(s,e).to.have.property("length");var o=s.length;this.assert(t>=o,"expected #{this} to have a length at most #{exp} but got #{act}","expected #{this} to have a length above #{exp}",t,o)}else this.assert(t>=s,"expected #{this} to be at most "+t,"expected #{this} to be above "+t)}function l(t,s){s&&m(this,"message",s);var o=e.getName(t);this.assert(m(this,"object")instanceof t,"expected #{this} to be an instance of "+o,"expected #{this} to not be an instance of "+o)}function u(t,s){s&&m(this,"message",s);var o=m(this,"object");this.assert(o.hasOwnProperty(t),"expected #{this} to have own property "+e.inspect(t),"expected #{this} to not have own property "+e.inspect(t))}function b(){m(this,"doLength",!0)}function f(t,e){e&&m(this,"message",e);var s=m(this,"object");new y(s,e).to.have.property("length");var o=s.length;this.assert(o==t,"expected #{this} to have a length of #{exp} but got #{act}","expected #{this} to not have a length of #{act}",t,o)}function x(t){var s,o=m(this,"object"),i=!0;if(t=t instanceof Array?t:Array.prototype.slice.call(arguments),!t.length)throw new Error("keys required");var h=Object.keys(o),n=t.length;if(i=t.every(function(t){return~h.indexOf(t)}),m(this,"negate")||m(this,"contains")||(i=i&&t.length==h.length),n>1){t=t.map(function(t){return e.inspect(t)});var a=t.pop();s=t.join(", ")+", and "+a}else s=e.inspect(t[0]);s=(n>1?"keys ":"key ")+s,s=(m(this,"contains")?"contain ":"have ")+s,this.assert(i,"expected #{this} to "+s,"expected #{this} to not "+s)}function g(t,s,o){o&&m(this,"message",o);var i=m(this,"object");new y(i,o).is.a("function");var h=!1,n=null,a=null,r=null;0===arguments.length?(s=null,t=null):t&&(t instanceof RegExp||"string"==typeof t)?(s=t,t=null):t&&t instanceof Error?(n=t,t=null,s=null):"function"==typeof t?(a=t.prototype.name||t.name,"Error"===a&&t!==Error&&(a=(new t).name)):t=null;try{i()}catch(d){if(n)return this.assert(d===n,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}",n instanceof Error?n.toString():n,d instanceof Error?d.toString():d),m(this,"object",d),this;if(t&&(this.assert(d instanceof t,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp} but #{act} was thrown",a,d instanceof Error?d.toString():d),!s))return m(this,"object",d),this;var c="object"===e.type(d)&&"message"in d?d.message:""+d;if(null!=c&&s&&s instanceof RegExp)return this.assert(s.exec(c),"expected #{this} to throw error matching #{exp} but got #{act}","expected #{this} to throw error not matching #{exp}",s,c),m(this,"object",d),this;if(null!=c&&s&&"string"==typeof s)return this.assert(~c.indexOf(s),"expected #{this} to throw error including #{exp} but got #{act}","expected #{this} to throw error not including #{act}",s,c),m(this,"object",d),this;h=!0,r=d}var p="",l=null!==a?a:n?"#{exp}":"an error";h&&(p=" but #{act} was thrown"),this.assert(h===!0,"expected #{this} to throw "+l+p,"expected #{this} to not throw "+l+p,n instanceof Error?n.toString():n,r instanceof Error?r.toString():r),m(this,"object",r)}function v(t,e,s){return t.every(function(t){return s?e.some(function(e){return s(t,e)}):-1!==e.indexOf(t)})}var y=t.Assertion,m=(Object.prototype.toString,e.flag);["to","be","been","is","and","has","have","with","that","at","of","same"].forEach(function(t){y.addProperty(t,function(){return this})}),y.addProperty("not",function(){m(this,"negate",!0)}),y.addProperty("deep",function(){m(this,"deep",!0)}),y.addChainableMethod("an",s),y.addChainableMethod("a",s),y.addChainableMethod("include",i,o),y.addChainableMethod("contain",i,o),y.addProperty("ok",function(){this.assert(m(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),y.addProperty("true",function(){this.assert(!0===m(this,"object"),"expected #{this} to be true","expected #{this} to be false",this.negate?!1:!0)}),y.addProperty("false",function(){this.assert(!1===m(this,"object"),"expected #{this} to be false","expected #{this} to be true",this.negate?!0:!1)}),y.addProperty("null",function(){this.assert(null===m(this,"object"),"expected #{this} to be null","expected #{this} not to be null")}),y.addProperty("undefined",function(){this.assert(void 0===m(this,"object"),"expected #{this} to be undefined","expected #{this} not to be undefined")}),y.addProperty("exist",function(){this.assert(null!=m(this,"object"),"expected #{this} to exist","expected #{this} to not exist")}),y.addProperty("empty",function(){var t=m(this,"object"),e=t;Array.isArray(t)||"string"==typeof object?e=t.length:"object"==typeof t&&(e=Object.keys(t).length),this.assert(!e,"expected #{this} to be empty","expected #{this} not to be empty")}),y.addProperty("arguments",h),y.addProperty("Arguments",h),y.addMethod("equal",n),y.addMethod("equals",n),y.addMethod("eq",n),y.addMethod("eql",a),y.addMethod("eqls",a),y.addMethod("above",r),y.addMethod("gt",r),y.addMethod("greaterThan",r),y.addMethod("least",d),y.addMethod("gte",d),y.addMethod("below",c),y.addMethod("lt",c),y.addMethod("lessThan",c),y.addMethod("most",p),y.addMethod("lte",p),y.addMethod("within",function(t,e,s){s&&m(this,"message",s);var o=m(this,"object"),i=t+".."+e;if(m(this,"doLength")){new y(o,s).to.have.property("length");var h=o.length;this.assert(h>=t&&e>=h,"expected #{this} to have a length within "+i,"expected #{this} to not have a length within "+i)}else this.assert(o>=t&&e>=o,"expected #{this} to be within "+i,"expected #{this} to not be within "+i)}),y.addMethod("instanceof",l),y.addMethod("instanceOf",l),y.addMethod("property",function(t,s,o){o&&m(this,"message",o);var i=m(this,"deep")?"deep property ":"property ",h=m(this,"negate"),n=m(this,"object"),a=m(this,"deep")?e.getPathValue(t,n):n[t];if(h&&void 0!==s){if(void 0===a)throw o=null!=o?o+": ":"",new Error(o+e.inspect(n)+" has no "+i+e.inspect(t))}else this.assert(void 0!==a,"expected #{this} to have a "+i+e.inspect(t),"expected #{this} to not have "+i+e.inspect(t));void 0!==s&&this.assert(s===a,"expected #{this} to have a "+i+e.inspect(t)+" of #{exp}, but got #{act}","expected #{this} to not have a "+i+e.inspect(t)+" of #{act}",s,a),m(this,"object",a)}),y.addMethod("ownProperty",u),y.addMethod("haveOwnProperty",u),y.addChainableMethod("length",f,b),y.addMethod("lengthOf",f,b),y.addMethod("match",function(t,e){e&&m(this,"message",e);var s=m(this,"object");this.assert(t.exec(s),"expected #{this} to match "+t,"expected #{this} not to match "+t)}),y.addMethod("string",function(t,s){s&&m(this,"message",s);var o=m(this,"object");new y(o,s).is.a("string"),this.assert(~o.indexOf(t),"expected #{this} to contain "+e.inspect(t),"expected #{this} to not contain "+e.inspect(t))}),y.addMethod("keys",x),y.addMethod("key",x),y.addMethod("throw",g),y.addMethod("throws",g),y.addMethod("Throw",g),y.addMethod("respondTo",function(t,s){s&&m(this,"message",s);var o=m(this,"object"),i=m(this,"itself"),h="function"!==e.type(o)||i?o[t]:o.prototype[t];this.assert("function"==typeof h,"expected #{this} to respond to "+e.inspect(t),"expected #{this} to not respond to "+e.inspect(t))}),y.addProperty("itself",function(){m(this,"itself",!0)}),y.addMethod("satisfy",function(t,s){s&&m(this,"message",s);var o=m(this,"object");this.assert(t(o),"expected #{this} to satisfy "+e.objDisplay(t),"expected #{this} to not satisfy"+e.objDisplay(t),this.negate?!1:!0,t(o))}),y.addMethod("closeTo",function(t,e,s){s&&m(this,"message",s);var o=m(this,"object");this.assert(Math.abs(o-t)<=e,"expected #{this} to be close to "+t+" +/- "+e,"expected #{this} not to be close to "+t+" +/- "+e)}),y.addMethod("members",function(t,s){s&&m(this,"message",s);var o=m(this,"object");new y(o).to.be.an("array"),new y(t).to.be.an("array");var i=m(this,"deep")?e.eql:void 0;return m(this,"contains")?this.assert(v(t,o,i),"expected #{this} to be a superset of #{act}","expected #{this} to not be a superset of #{act}",o,t):void this.assert(v(o,t,i)&&v(t,o,i),"expected #{this} to have the same members as #{act}","expected #{this} to not have the same members as #{act}",o,t)})};
},{}],117:[function(require,module,exports){
module.exports=function(chai,util){var Assertion=chai.Assertion,flag=util.flag,assert=chai.assert=function(t,e){var n=new Assertion(null,null,chai.assert);n.assert(t,e,"[ negation message unavailable ]")};assert.fail=function(t,e,n,s){throw n=n||"assert.fail()",new chai.AssertionError(n,{actual:t,expected:e,operator:s},assert.fail)},assert.ok=function(t,e){new Assertion(t,e).is.ok},assert.notOk=function(t,e){new Assertion(t,e).is.not.ok},assert.equal=function(t,e,n){var s=new Assertion(t,n,assert.equal);s.assert(e==flag(s,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",e,t)},assert.notEqual=function(t,e,n){var s=new Assertion(t,n,assert.notEqual);s.assert(e!=flag(s,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",e,t)},assert.strictEqual=function(t,e,n){new Assertion(t,n).to.equal(e)},assert.notStrictEqual=function(t,e,n){new Assertion(t,n).to.not.equal(e)},assert.deepEqual=function(t,e,n){new Assertion(t,n).to.eql(e)},assert.notDeepEqual=function(t,e,n){new Assertion(t,n).to.not.eql(e)},assert.isTrue=function(t,e){new Assertion(t,e).is["true"]},assert.isFalse=function(t,e){new Assertion(t,e).is["false"]},assert.isNull=function(t,e){new Assertion(t,e).to.equal(null)},assert.isNotNull=function(t,e){new Assertion(t,e).to.not.equal(null)},assert.isUndefined=function(t,e){new Assertion(t,e).to.equal(void 0)},assert.isDefined=function(t,e){new Assertion(t,e).to.not.equal(void 0)},assert.isFunction=function(t,e){new Assertion(t,e).to.be.a("function")},assert.isNotFunction=function(t,e){new Assertion(t,e).to.not.be.a("function")},assert.isObject=function(t,e){new Assertion(t,e).to.be.a("object")},assert.isNotObject=function(t,e){new Assertion(t,e).to.not.be.a("object")},assert.isArray=function(t,e){new Assertion(t,e).to.be.an("array")},assert.isNotArray=function(t,e){new Assertion(t,e).to.not.be.an("array")},assert.isString=function(t,e){new Assertion(t,e).to.be.a("string")},assert.isNotString=function(t,e){new Assertion(t,e).to.not.be.a("string")},assert.isNumber=function(t,e){new Assertion(t,e).to.be.a("number")},assert.isNotNumber=function(t,e){new Assertion(t,e).to.not.be.a("number")},assert.isBoolean=function(t,e){new Assertion(t,e).to.be.a("boolean")},assert.isNotBoolean=function(t,e){new Assertion(t,e).to.not.be.a("boolean")},assert.typeOf=function(t,e,n){new Assertion(t,n).to.be.a(e)},assert.notTypeOf=function(t,e,n){new Assertion(t,n).to.not.be.a(e)},assert.instanceOf=function(t,e,n){new Assertion(t,n).to.be.instanceOf(e)},assert.notInstanceOf=function(t,e,n){new Assertion(t,n).to.not.be.instanceOf(e)},assert.include=function(t,e,n){new Assertion(t,n,assert.include).include(e)},assert.notInclude=function(t,e,n){new Assertion(t,n,assert.notInclude).not.include(e)},assert.match=function(t,e,n){new Assertion(t,n).to.match(e)},assert.notMatch=function(t,e,n){new Assertion(t,n).to.not.match(e)},assert.property=function(t,e,n){new Assertion(t,n).to.have.property(e)},assert.notProperty=function(t,e,n){new Assertion(t,n).to.not.have.property(e)},assert.deepProperty=function(t,e,n){new Assertion(t,n).to.have.deep.property(e)},assert.notDeepProperty=function(t,e,n){new Assertion(t,n).to.not.have.deep.property(e)},assert.propertyVal=function(t,e,n,s){new Assertion(t,s).to.have.property(e,n)},assert.propertyNotVal=function(t,e,n,s){new Assertion(t,s).to.not.have.property(e,n)},assert.deepPropertyVal=function(t,e,n,s){new Assertion(t,s).to.have.deep.property(e,n)},assert.deepPropertyNotVal=function(t,e,n,s){new Assertion(t,s).to.not.have.deep.property(e,n)},assert.lengthOf=function(t,e,n){new Assertion(t,n).to.have.length(e)},assert.Throw=function(t,e,n,s){("string"==typeof e||e instanceof RegExp)&&(n=e,e=null);var o=new Assertion(t,s).to.Throw(e,n);return flag(o,"object")},assert.doesNotThrow=function(t,e,n){"string"==typeof e&&(n=e,e=null),new Assertion(t,n).to.not.Throw(e)},assert.operator=function(val,operator,val2,msg){if(!~["==","===",">",">=","<","<=","!=","!=="].indexOf(operator))throw new Error('Invalid operator "'+operator+'"');var test=new Assertion(eval(val+operator+val2),msg);test.assert(!0===flag(test,"object"),"expected "+util.inspect(val)+" to be "+operator+" "+util.inspect(val2),"expected "+util.inspect(val)+" to not be "+operator+" "+util.inspect(val2))},assert.closeTo=function(t,e,n,s){new Assertion(t,s).to.be.closeTo(e,n)},assert.sameMembers=function(t,e,n){new Assertion(t,n).to.have.same.members(e)},assert.includeMembers=function(t,e,n){new Assertion(t,n).to.include.members(e)},assert.ifError=function(t,e){new Assertion(t,e).to.not.be.ok},function t(e,n){return assert[n]=assert[e],t}("Throw","throw")("Throw","throws")};
},{}],118:[function(require,module,exports){
module.exports=function(e){e.expect=function(n,t){return new e.Assertion(n,t)}};
},{}],119:[function(require,module,exports){
module.exports=function(t){function n(){function t(){return this instanceof String||this instanceof Number?new o(this.constructor(this),null,t):this instanceof Boolean?new o(1==this,null,t):new o(this,null,t)}function n(t){Object.defineProperty(this,"should",{value:t,enumerable:!0,configurable:!0,writable:!0})}Object.defineProperty(Object.prototype,"should",{set:n,get:t,configurable:!0});var e={};return e.equal=function(t,n,e){new o(t,e).to.equal(n)},e.Throw=function(t,n,e,i){new o(t,i).to.Throw(n,e)},e.exist=function(t,n){new o(t,n).to.exist},e.not={},e.not.equal=function(t,n,e){new o(t,e).to.not.equal(n)},e.not.Throw=function(t,n,e,i){new o(t,i).to.not.Throw(n,e)},e.not.exist=function(t,n){new o(t,n).to.not.exist},e["throw"]=e.Throw,e.not["throw"]=e.not.Throw,e}var o=t.Assertion;t.should=n,t.Should=n};
},{}],120:[function(require,module,exports){
var transferFlags=require("./transferFlags"),flag=require("./flag"),config=require("../config"),hasProtoSupport="__proto__"in Object,excludeNames=/^(?:length|name|arguments|caller)$/,call=Function.prototype.call,apply=Function.prototype.apply;module.exports=function(e,t,r,a){"function"!=typeof a&&(a=function(){});var o={method:r,chainingBehavior:a};e.__methods||(e.__methods={}),e.__methods[t]=o,Object.defineProperty(e,t,{get:function(){o.chainingBehavior.call(this);var t=function n(){var e=flag(this,"ssfi");e&&config.includeStack===!1&&flag(this,"ssfi",n);var t=o.method.apply(this,arguments);return void 0===t?this:t};if(hasProtoSupport){var r=t.__proto__=Object.create(this);r.call=call,r.apply=apply}else{var a=Object.getOwnPropertyNames(e);a.forEach(function(r){if(!excludeNames.test(r)){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a)}})}return transferFlags(this,t),t},configurable:!0})};
},{"../config":115,"./flag":123,"./transferFlags":137}],121:[function(require,module,exports){
var config=require("../config"),flag=require("./flag");module.exports=function(i,f,r){i[f]=function(){var a=flag(this,"ssfi");a&&config.includeStack===!1&&flag(this,"ssfi",i[f]);var n=r.apply(this,arguments);return void 0===n?this:n}};
},{"../config":115,"./flag":123}],122:[function(require,module,exports){
module.exports=function(e,t,i){Object.defineProperty(e,t,{get:function(){var e=i.call(this);return void 0===e?this:e},configurable:!0})};
},{}],123:[function(require,module,exports){
module.exports=function(e,t,l){var n=e.__flags||(e.__flags=Object.create(null));return 3!==arguments.length?n[t]:void(n[t]=l)};
},{}],124:[function(require,module,exports){
module.exports=function(e,n){return n.length>4?n[4]:e._obj};
},{}],125:[function(require,module,exports){
module.exports=function(r){var n=[];for(var o in r)n.push(o);return n};
},{}],126:[function(require,module,exports){
var flag=require("./flag"),getActual=require("./getActual"),inspect=require("./inspect"),objDisplay=require("./objDisplay");module.exports=function(e,a){var l=flag(e,"negate"),r=flag(e,"object"),t=a[3],g=getActual(e,a),i=l?a[2]:a[1],p=flag(e,"message");return i=i||"",i=i.replace(/#{this}/g,objDisplay(r)).replace(/#{act}/g,objDisplay(g)).replace(/#{exp}/g,objDisplay(t)),p?p+": "+i:i};
},{"./flag":123,"./getActual":124,"./inspect":131,"./objDisplay":132}],127:[function(require,module,exports){
module.exports=function(e){if(e.name)return e.name;var n=/^\s?function ([^(]*)\(/.exec(e);return n&&n[1]?n[1]:""};
},{}],128:[function(require,module,exports){
function parsePath(e){var t=e.replace(/\[/g,".["),a=t.match(/(\\\.|[^.]+?)+/g);return a.map(function(e){var t=/\[(\d+)\]$/,a=t.exec(e);return a?{i:parseFloat(a[1])}:{p:e}})}function _getPathValue(e,t){for(var a,r=t,n=0,u=e.length;u>n;n++){var o=e[n];r?("undefined"!=typeof o.p?r=r[o.p]:"undefined"!=typeof o.i&&(r=r[o.i]),n==u-1&&(a=r)):a=void 0}return a}var getPathValue=module.exports=function(e,t){var a=parsePath(e);return _getPathValue(a,t)};
},{}],129:[function(require,module,exports){
module.exports=function(){function e(e){-1===t.indexOf(e)&&t.push(e)}for(var t=Object.getOwnPropertyNames(subject),o=Object.getPrototypeOf(subject);null!==o;)Object.getOwnPropertyNames(o).forEach(e),o=Object.getPrototypeOf(o);return t};
},{}],130:[function(require,module,exports){
var exports=module.exports={};exports.test=require("./test"),exports.type=require("./type"),exports.getMessage=require("./getMessage"),exports.getActual=require("./getActual"),exports.inspect=require("./inspect"),exports.objDisplay=require("./objDisplay"),exports.flag=require("./flag"),exports.transferFlags=require("./transferFlags"),exports.eql=require("deep-eql"),exports.getPathValue=require("./getPathValue"),exports.getName=require("./getName"),exports.addProperty=require("./addProperty"),exports.addMethod=require("./addMethod"),exports.overwriteProperty=require("./overwriteProperty"),exports.overwriteMethod=require("./overwriteMethod"),exports.addChainableMethod=require("./addChainableMethod"),exports.overwriteChainableMethod=require("./overwriteChainableMethod");
},{"./addChainableMethod":120,"./addMethod":121,"./addProperty":122,"./flag":123,"./getActual":124,"./getMessage":126,"./getName":127,"./getPathValue":128,"./inspect":131,"./objDisplay":132,"./overwriteChainableMethod":133,"./overwriteMethod":134,"./overwriteProperty":135,"./test":136,"./transferFlags":137,"./type":138,"deep-eql":140}],131:[function(require,module,exports){
function inspect(e,t,r){var n={showHidden:t,seen:[],stylize:function(e){return e}};return formatValue(n,e,"undefined"==typeof r?2:r)}function formatValue(e,t,r){if(t&&"function"==typeof t.inspect&&t.inspect!==exports.inspect&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r);return"string"!=typeof n&&(n=formatValue(e,n,r)),n}var o=formatPrimitive(e,t);if(o)return o;if(isDOMElement(t))return getOuterHTML(t);var i=getEnumerableProperties(t),u=e.showHidden?getProperties(t):i;if(0===u.length||isError(t)&&(1===u.length&&"stack"===u[0]||2===u.length&&"description"===u[0]&&"stack"===u[1])){if("function"==typeof t){var a=getName(t),l=a?": "+a:"";return e.stylize("[Function"+l+"]","special")}if(isRegExp(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(isDate(t))return e.stylize(Date.prototype.toUTCString.call(t),"date");if(isError(t))return formatError(t)}var c="",p=!1,s=["{","}"];if(isArray(t)&&(p=!0,s=["[","]"]),"function"==typeof t){var a=getName(t),l=a?": "+a:"";c=" [Function"+l+"]"}if(isRegExp(t)&&(c=" "+RegExp.prototype.toString.call(t)),isDate(t)&&(c=" "+Date.prototype.toUTCString.call(t)),isError(t))return formatError(t);if(0===u.length&&(!p||0==t.length))return s[0]+c+s[1];if(0>r)return isRegExp(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var f;return f=p?formatArray(e,t,r,i,u):u.map(function(n){return formatProperty(e,t,r,i,n,p)}),e.seen.pop(),reduceToSingleString(f,c,s)}function formatPrimitive(e,t){switch(typeof t){case"undefined":return e.stylize("undefined","undefined");case"string":var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string");case"number":return e.stylize(""+t,"number");case"boolean":return e.stylize(""+t,"boolean")}return null===t?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,t,r,n,o){for(var i=[],u=0,a=t.length;a>u;++u)i.push(Object.prototype.hasOwnProperty.call(t,String(u))?formatProperty(e,t,r,n,String(u),!0):"");return o.forEach(function(o){o.match(/^\d+$/)||i.push(formatProperty(e,t,r,n,o,!0))}),i}function formatProperty(e,t,r,n,o,i){var u,a;if(t.__lookupGetter__&&(t.__lookupGetter__(o)?a=t.__lookupSetter__(o)?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):t.__lookupSetter__(o)&&(a=e.stylize("[Setter]","special"))),n.indexOf(o)<0&&(u="["+o+"]"),a||(e.seen.indexOf(t[o])<0?(a=null===r?formatValue(e,t[o],null):formatValue(e,t[o],r-1),a.indexOf("\n")>-1&&(a=i?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),"undefined"==typeof u){if(i&&o.match(/^\d+$/))return a;u=JSON.stringify(""+o),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+a}function reduceToSingleString(e,t,r){var n=0,o=e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.length+1},0);return o>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function isArray(e){return Array.isArray(e)||"object"==typeof e&&"[object Array]"===objectToString(e)}function isRegExp(e){return"object"==typeof e&&"[object RegExp]"===objectToString(e)}function isDate(e){return"object"==typeof e&&"[object Date]"===objectToString(e)}function isError(e){return"object"==typeof e&&"[object Error]"===objectToString(e)}function objectToString(e){return Object.prototype.toString.call(e)}var getName=require("./getName"),getProperties=require("./getProperties"),getEnumerableProperties=require("./getEnumerableProperties");module.exports=inspect;var getOuterHTML=function(e){if("outerHTML"in e)return e.outerHTML;var t,r="http://www.w3.org/1999/xhtml",n=document.createElementNS(r,"_"),o=((window.HTMLElement||window.Element).prototype,new XMLSerializer);return document.xmlVersion?o.serializeToString(e):(n.appendChild(e.cloneNode(!1)),t=n.innerHTML.replace("><",">"+e.innerHTML+"<"),n.innerHTML="",t)},isDOMElement=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName};
},{"./getEnumerableProperties":125,"./getName":127,"./getProperties":129}],132:[function(require,module,exports){
var inspect=require("./inspect"),config=require("../config");module.exports=function(e){var n=inspect(e),t=Object.prototype.toString.call(e);if(config.truncateThreshold&&n.length>=config.truncateThreshold){if("[object Function]"===t)return e.name&&""!==e.name?"[Function: "+e.name+"]":"[Function]";if("[object Array]"===t)return"[ Array("+e.length+") ]";if("[object Object]"===t){var r=Object.keys(e),c=r.length>2?r.splice(0,2).join(", ")+", ...":r.join(", ");return"{ Object ("+c+") }"}return n}return n};
},{"../config":115,"./inspect":131}],133:[function(require,module,exports){
module.exports=function(i,t,n,o){var r=i.__methods[t],a=r.chainingBehavior;r.chainingBehavior=function(){var i=o(a).call(this);return void 0===i?this:i};var h=r.method;r.method=function(){var i=n(h).apply(this,arguments);return void 0===i?this:i}};
},{}],134:[function(require,module,exports){
module.exports=function(t,n,i){var o=t[n],r=function(){return this};o&&"function"==typeof o&&(r=o),t[n]=function(){var t=i(r).apply(this,arguments);return void 0===t?this:t}};
},{}],135:[function(require,module,exports){
module.exports=function(t,e,n){var o=Object.getOwnPropertyDescriptor(t,e),r=function(){};o&&"function"==typeof o.get&&(r=o.get),Object.defineProperty(t,e,{get:function(){var t=n(r).call(this);return void 0===t?this:t},configurable:!0})};
},{}],136:[function(require,module,exports){
var flag=require("./flag");module.exports=function(e,r){var a=flag(e,"negate"),f=r[0];return a?!f:f};
},{"./flag":123}],137:[function(require,module,exports){
module.exports=function(e,a,l){var s=e.__flags||(e.__flags=Object.create(null));a.__flags||(a.__flags=Object.create(null)),l=3===arguments.length?l:!0;for(var _ in s)(l||"object"!==_&&"ssfi"!==_&&"message"!=_)&&(a.__flags[_]=s[_])};
},{}],138:[function(require,module,exports){
var natives={"[object Arguments]":"arguments","[object Array]":"array","[object Date]":"date","[object Function]":"function","[object Number]":"number","[object RegExp]":"regexp","[object String]":"string"};module.exports=function(e){var t=Object.prototype.toString.call(e);return natives[t]?natives[t]:null===e?"null":void 0===e?"undefined":e===Object(e)?"object":typeof e};
},{}],139:[function(require,module,exports){
function exclude(){function r(r,e){Object.keys(e).forEach(function(o){~t.indexOf(o)||(r[o]=e[o])})}var t=[].slice.call(arguments);return function(){for(var t=[].slice.call(arguments),e=0,o={};e<t.length;e++)r(o,t[e]);return o}}function AssertionError(r,t,e){var o=exclude("name","message","stack","constructor","toJSON"),s=o(t||{});this.message=r||"Unspecified AssertionError",this.showDiff=!1;for(var n in s)this[n]=s[n];e=e||arguments.callee,e&&Error.captureStackTrace&&Error.captureStackTrace(this,e)}module.exports=AssertionError,AssertionError.prototype=Object.create(Error.prototype),AssertionError.prototype.name="AssertionError",AssertionError.prototype.constructor=AssertionError,AssertionError.prototype.toJSON=function(r){var t=exclude("constructor","toJSON","stack"),e=t({name:this.name},this);return!1!==r&&this.stack&&(e.stack=this.stack),e};
},{}],140:[function(require,module,exports){
module.exports=require("./lib/eql");
},{"./lib/eql":141}],141:[function(require,module,exports){
function deepEqual(e,r,t){return sameValue(e,r)?!0:"date"===type(e)?dateEqual(e,r):"regexp"===type(e)?regexpEqual(e,r):Buffer.isBuffer(e)?bufferEqual(e,r):"arguments"===type(e)?argumentsEqual(e,r,t):typeEqual(e,r)?"object"!==type(e)&&"object"!==type(r)&&"array"!==type(e)&&"array"!==type(r)?sameValue(e,r):objectEqual(e,r,t):!1}function sameValue(e,r){return e===r?0!==e||1/e===1/r:e!==e&&r!==r}function typeEqual(e,r){return type(e)===type(r)}function dateEqual(e,r){return"date"!==type(r)?!1:sameValue(e.getTime(),r.getTime())}function regexpEqual(e,r){return"regexp"!==type(r)?!1:sameValue(e.toString(),r.toString())}function argumentsEqual(e,r,t){return"arguments"!==type(r)?!1:(e=[].slice.call(e),r=[].slice.call(r),deepEqual(e,r,t))}function enumerable(e){var r=[];for(var t in e)r.push(t);return r}function iterableEqual(e,r){if(e.length!==r.length)return!1;for(var t=0,u=!0;t<e.length;t++)if(e[t]!==r[t]){u=!1;break}return u}function bufferEqual(e,r){return Buffer.isBuffer(r)?iterableEqual(e,r):!1}function isValue(e){return null!==e&&void 0!==e}function objectEqual(e,r,t){if(!isValue(e)||!isValue(r))return!1;if(e.prototype!==r.prototype)return!1;var u;if(t){for(u=0;u<t.length;u++)if(t[u][0]===e&&t[u][1]===r||t[u][0]===r&&t[u][1]===e)return!0}else t=[];try{var a=enumerable(e),n=enumerable(r)}catch(f){return!1}if(a.sort(),n.sort(),!iterableEqual(a,n))return!1;t.push([e,r]);var l;for(u=a.length-1;u>=0;u--)if(l=a[u],!deepEqual(e[l],r[l],t))return!1;return!0}var type=require("type-detect"),Buffer;try{Buffer=require("buffer").Buffer}catch(ex){Buffer={},Buffer.isBuffer=function(){return!1}}module.exports=deepEqual;
},{"buffer":75,"type-detect":142}],142:[function(require,module,exports){
module.exports=require("./lib/type");
},{"./lib/type":143}],143:[function(require,module,exports){
function getType(t){var e=Object.prototype.toString.call(t);return natives[e]?natives[e]:null===t?"null":void 0===t?"undefined":t===Object(t)?"object":typeof t}function Library(){this.tests={}}var exports=module.exports=getType,natives={"[object Array]":"array","[object RegExp]":"regexp","[object Function]":"function","[object Arguments]":"arguments","[object Date]":"date"};exports.Library=Library,Library.prototype.of=getType,Library.prototype.define=function(t,e){return 1===arguments.length?this.tests[t]:(this.tests[t]=e,this)},Library.prototype.test=function(t,e){if(e===getType(t))return!0;var r=this.tests[e];if(r&&"regexp"===getType(r))return r.test(t);if(r&&"function"===getType(r))return r(t);throw new ReferenceError('Type test "'+e+'" not defined or invalid.')};
},{}],144:[function(require,module,exports){
!function(n){function e(n,e,t){var f=0,b=[0],c="",s=null,c=t||"UTF8";if("UTF8"!==c&&"UTF16"!==c)throw"encoding must be UTF8 or UTF16";if("HEX"===e){if(0!==n.length%2)throw"srcString of HEX type must be in byte increments";s=a(n),f=s.binLen,b=s.value}else if("ASCII"===e||"TEXT"===e)s=r(n,c),f=s.binLen,b=s.value;else{if("B64"!==e)throw"inputFormat must be HEX, TEXT, ASCII, or B64";s=o(n),f=s.binLen,b=s.value}this.getHash=function(n,e,t,r){var a,o=null,c=b.slice(),s=f;if(3===arguments.length?"number"!=typeof t&&(r=t,t=1):2===arguments.length&&(t=1),t!==parseInt(t,10)||1>t)throw"numRounds must a integer >= 1";switch(e){case"HEX":o=i;break;case"B64":o=w;break;default:throw"format must be HEX or B64"}if("SHA-1"===n)for(a=0;t>a;a++)c=L(c,s),s=160;else if("SHA-224"===n)for(a=0;t>a;a++)c=P(c,s,n),s=224;else if("SHA-256"===n)for(a=0;t>a;a++)c=P(c,s,n),s=256;else if("SHA-384"===n)for(a=0;t>a;a++)c=P(c,s,n),s=384;else{if("SHA-512"!==n)throw"Chosen SHA variant is not supported";for(a=0;t>a;a++)c=P(c,s,n),s=512}return o(c,u(r))},this.getHMAC=function(n,e,t,s,l){var p,h,H,v,A=[],d=[];switch(p=null,s){case"HEX":s=i;break;case"B64":s=w;break;default:throw"outputFormat must be HEX or B64"}if("SHA-1"===t)h=64,v=160;else if("SHA-224"===t)h=64,v=224;else if("SHA-256"===t)h=64,v=256;else if("SHA-384"===t)h=128,v=384;else{if("SHA-512"!==t)throw"Chosen SHA variant is not supported";h=128,v=512}if("HEX"===e)p=a(n),H=p.binLen,p=p.value;else if("ASCII"===e||"TEXT"===e)p=r(n,c),H=p.binLen,p=p.value;else{if("B64"!==e)throw"inputFormat must be HEX, TEXT, ASCII, or B64";p=o(n),H=p.binLen,p=p.value}for(n=8*h,e=h/4-1,H/8>h?(p="SHA-1"===t?L(p,H):P(p,H,t),p[e]&=4294967040):h>H/8&&(p[e]&=4294967040),h=0;e>=h;h+=1)A[h]=909522486^p[h],d[h]=1549556828^p[h];return t="SHA-1"===t?L(d.concat(L(A.concat(b),n+f)),n+v):P(d.concat(P(A.concat(b),n+f,t)),n+v,t),s(t,u(l))}}function t(n,e){this.a=n,this.b=e}function r(n,e){var t,r,a=[],o=[],i=0;if("UTF8"===e)for(r=0;r<n.length;r+=1)for(t=n.charCodeAt(r),o=[],t>2048?(o[0]=224|(61440&t)>>>12,o[1]=128|(4032&t)>>>6,o[2]=128|63&t):t>128?(o[0]=192|(1984&t)>>>6,o[1]=128|63&t):o[0]=t,t=0;t<o.length;t+=1)a[i>>>2]|=o[t]<<24-i%4*8,i+=1;else if("UTF16"===e)for(r=0;r<n.length;r+=1)a[i>>>2]|=n.charCodeAt(r)<<16-i%4*8,i+=2;return{value:a,binLen:8*i}}function a(n){var e,t,r=[],a=n.length;if(0!==a%2)throw"String of HEX type must be in byte increments";for(e=0;a>e;e+=2){if(t=parseInt(n.substr(e,2),16),isNaN(t))throw"String of HEX type contains invalid characters";r[e>>>3]|=t<<24-e%8*4}return{value:r,binLen:4*a}}function o(n){var e,t,r,a,o,i=[],w=0;if(-1===n.search(/^[a-zA-Z0-9=+\/]+$/))throw"Invalid character in base-64 string";if(e=n.indexOf("="),n=n.replace(/\=/g,""),-1!==e&&e<n.length)throw"Invalid '=' found in base-64 string";for(t=0;t<n.length;t+=4){for(o=n.substr(t,4),r=a=0;r<o.length;r+=1)e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(o[r]),a|=e<<18-6*r;for(r=0;r<o.length-1;r+=1)i[w>>2]|=(a>>>16-8*r&255)<<24-w%4*8,w+=1}return{value:i,binLen:8*w}}function i(n,e){var t,r,a="",o=4*n.length;for(t=0;o>t;t+=1)r=n[t>>>2]>>>8*(3-t%4),a+="0123456789abcdef".charAt(r>>>4&15)+"0123456789abcdef".charAt(15&r);return e.outputUpper?a.toUpperCase():a}function w(n,e){var t,r,a,o="",i=4*n.length;for(t=0;i>t;t+=3)for(a=(n[t>>>2]>>>8*(3-t%4)&255)<<16|(n[t+1>>>2]>>>8*(3-(t+1)%4)&255)<<8|n[t+2>>>2]>>>8*(3-(t+2)%4)&255,r=0;4>r;r+=1)o=8*t+6*r<=32*n.length?o+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>>6*(3-r)&63):o+e.b64Pad;return o}function u(n){var e={outputUpper:!1,b64Pad:"="};try{n.hasOwnProperty("outputUpper")&&(e.outputUpper=n.outputUpper),n.hasOwnProperty("b64Pad")&&(e.b64Pad=n.b64Pad)}catch(t){}if("boolean"!=typeof e.outputUpper)throw"Invalid outputUpper formatting option";if("string"!=typeof e.b64Pad)throw"Invalid b64Pad formatting option";return e}function f(n,e){return n<<e|n>>>32-e}function b(n,e){return n>>>e|n<<32-e}function c(n,e){var r=null,r=new t(n.a,n.b);return r=32>=e?new t(r.a>>>e|r.b<<32-e&4294967295,r.b>>>e|r.a<<32-e&4294967295):new t(r.b>>>e-32|r.a<<64-e&4294967295,r.a>>>e-32|r.b<<64-e&4294967295)}function s(n,e){var r=null;return r=32>=e?new t(n.a>>>e,n.b>>>e|n.a<<32-e&4294967295):new t(0,n.a>>>e-32)}function l(n,e,t){return n^e^t}function p(n,e,t){return n&e^~n&t}function h(n,e,r){return new t(n.a&e.a^~n.a&r.a,n.b&e.b^~n.b&r.b)}function H(n,e,t){return n&e^n&t^e&t}function v(n,e,r){return new t(n.a&e.a^n.a&r.a^e.a&r.a,n.b&e.b^n.b&r.b^e.b&r.b)}function A(n){return b(n,2)^b(n,13)^b(n,22)}function d(n){var e=c(n,28),r=c(n,34);return n=c(n,39),new t(e.a^r.a^n.a,e.b^r.b^n.b)}function S(n){return b(n,6)^b(n,11)^b(n,25)}function g(n){var e=c(n,14),r=c(n,18);return n=c(n,41),new t(e.a^r.a^n.a,e.b^r.b^n.b)}function m(n){return b(n,7)^b(n,18)^n>>>3}function U(n){var e=c(n,1),r=c(n,8);return n=s(n,7),new t(e.a^r.a^n.a,e.b^r.b^n.b)}function E(n){return b(n,17)^b(n,19)^n>>>10}function T(n){var e=c(n,19),r=c(n,61);return n=s(n,6),new t(e.a^r.a^n.a,e.b^r.b^n.b)}function X(n,e){var t=(65535&n)+(65535&e);return((n>>>16)+(e>>>16)+(t>>>16)&65535)<<16|65535&t}function y(n,e,t,r){var a=(65535&n)+(65535&e)+(65535&t)+(65535&r);return((n>>>16)+(e>>>16)+(t>>>16)+(r>>>16)+(a>>>16)&65535)<<16|65535&a}function I(n,e,t,r,a){var o=(65535&n)+(65535&e)+(65535&t)+(65535&r)+(65535&a);return((n>>>16)+(e>>>16)+(t>>>16)+(r>>>16)+(a>>>16)+(o>>>16)&65535)<<16|65535&o}function C(n,e){var r,a,o;return r=(65535&n.b)+(65535&e.b),a=(n.b>>>16)+(e.b>>>16)+(r>>>16),o=(65535&a)<<16|65535&r,r=(65535&n.a)+(65535&e.a)+(a>>>16),a=(n.a>>>16)+(e.a>>>16)+(r>>>16),new t((65535&a)<<16|65535&r,o)}function F(n,e,r,a){var o,i,w;return o=(65535&n.b)+(65535&e.b)+(65535&r.b)+(65535&a.b),i=(n.b>>>16)+(e.b>>>16)+(r.b>>>16)+(a.b>>>16)+(o>>>16),w=(65535&i)<<16|65535&o,o=(65535&n.a)+(65535&e.a)+(65535&r.a)+(65535&a.a)+(i>>>16),i=(n.a>>>16)+(e.a>>>16)+(r.a>>>16)+(a.a>>>16)+(o>>>16),new t((65535&i)<<16|65535&o,w)}function x(n,e,r,a,o){var i,w,u;return i=(65535&n.b)+(65535&e.b)+(65535&r.b)+(65535&a.b)+(65535&o.b),w=(n.b>>>16)+(e.b>>>16)+(r.b>>>16)+(a.b>>>16)+(o.b>>>16)+(i>>>16),u=(65535&w)<<16|65535&i,i=(65535&n.a)+(65535&e.a)+(65535&r.a)+(65535&a.a)+(65535&o.a)+(w>>>16),w=(n.a>>>16)+(e.a>>>16)+(r.a>>>16)+(a.a>>>16)+(o.a>>>16)+(i>>>16),new t((65535&w)<<16|65535&i,u)}function L(n,e){var t,r,a,o,i,w,u,b,c,s=[],h=p,v=l,A=H,d=f,S=X,g=I,m=[1732584193,4023233417,2562383102,271733878,3285377520];for(n[e>>>5]|=128<<24-e%32,n[(e+65>>>9<<4)+15]=e,c=n.length,u=0;c>u;u+=16){for(t=m[0],r=m[1],a=m[2],o=m[3],i=m[4],b=0;80>b;b+=1)s[b]=16>b?n[b+u]:d(s[b-3]^s[b-8]^s[b-14]^s[b-16],1),w=20>b?g(d(t,5),h(r,a,o),i,1518500249,s[b]):40>b?g(d(t,5),v(r,a,o),i,1859775393,s[b]):60>b?g(d(t,5),A(r,a,o),i,2400959708,s[b]):g(d(t,5),v(r,a,o),i,3395469782,s[b]),i=o,o=a,a=d(r,30),r=t,t=w;m[0]=S(t,m[0]),m[1]=S(r,m[1]),m[2]=S(a,m[2]),m[3]=S(o,m[3]),m[4]=S(i,m[4])}return m}function P(n,e,r){var a,o,i,w,u,f,b,c,s,l,L,P,B,k,O,N,j,z,M,R,Z,q,D,G,J,K,Q=[],V=[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];if(l=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],o=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],"SHA-224"===r||"SHA-256"===r)L=64,a=(e+65>>>9<<4)+15,k=16,O=1,J=Number,N=X,j=y,z=I,M=m,R=E,Z=A,q=S,G=H,D=p,l="SHA-224"===r?l:o;else{if("SHA-384"!==r&&"SHA-512"!==r)throw"Unexpected error in SHA-2 implementation";L=80,a=(e+128>>>10<<5)+31,k=32,O=2,J=t,N=C,j=F,z=x,M=U,R=T,Z=d,q=g,G=v,D=h,V=[new J(V[0],3609767458),new J(V[1],602891725),new J(V[2],3964484399),new J(V[3],2173295548),new J(V[4],4081628472),new J(V[5],3053834265),new J(V[6],2937671579),new J(V[7],3664609560),new J(V[8],2734883394),new J(V[9],1164996542),new J(V[10],1323610764),new J(V[11],3590304994),new J(V[12],4068182383),new J(V[13],991336113),new J(V[14],633803317),new J(V[15],3479774868),new J(V[16],2666613458),new J(V[17],944711139),new J(V[18],2341262773),new J(V[19],2007800933),new J(V[20],1495990901),new J(V[21],1856431235),new J(V[22],3175218132),new J(V[23],2198950837),new J(V[24],3999719339),new J(V[25],766784016),new J(V[26],2566594879),new J(V[27],3203337956),new J(V[28],1034457026),new J(V[29],2466948901),new J(V[30],3758326383),new J(V[31],168717936),new J(V[32],1188179964),new J(V[33],1546045734),new J(V[34],1522805485),new J(V[35],2643833823),new J(V[36],2343527390),new J(V[37],1014477480),new J(V[38],1206759142),new J(V[39],344077627),new J(V[40],1290863460),new J(V[41],3158454273),new J(V[42],3505952657),new J(V[43],106217008),new J(V[44],3606008344),new J(V[45],1432725776),new J(V[46],1467031594),new J(V[47],851169720),new J(V[48],3100823752),new J(V[49],1363258195),new J(V[50],3750685593),new J(V[51],3785050280),new J(V[52],3318307427),new J(V[53],3812723403),new J(V[54],2003034995),new J(V[55],3602036899),new J(V[56],1575990012),new J(V[57],1125592928),new J(V[58],2716904306),new J(V[59],442776044),new J(V[60],593698344),new J(V[61],3733110249),new J(V[62],2999351573),new J(V[63],3815920427),new J(3391569614,3928383900),new J(3515267271,566280711),new J(3940187606,3454069534),new J(4118630271,4000239992),new J(116418474,1914138554),new J(174292421,2731055270),new J(289380356,3203993006),new J(460393269,320620315),new J(685471733,587496836),new J(852142971,1086792851),new J(1017036298,365543100),new J(1126000580,2618297676),new J(1288033470,3409855158),new J(1501505948,4234509866),new J(1607167915,987167468),new J(1816402316,1246189591)],l="SHA-384"===r?[new J(3418070365,l[0]),new J(1654270250,l[1]),new J(2438529370,l[2]),new J(355462360,l[3]),new J(1731405415,l[4]),new J(41048885895,l[5]),new J(3675008525,l[6]),new J(1203062813,l[7])]:[new J(o[0],4089235720),new J(o[1],2227873595),new J(o[2],4271175723),new J(o[3],1595750129),new J(o[4],2917565137),new J(o[5],725511199),new J(o[6],4215389547),new J(o[7],327033209)]}for(n[e>>>5]|=128<<24-e%32,n[a]=e,K=n.length,P=0;K>P;P+=k){for(e=l[0],a=l[1],o=l[2],i=l[3],w=l[4],u=l[5],f=l[6],b=l[7],B=0;L>B;B+=1)Q[B]=16>B?new J(n[B*O+P],n[B*O+P+1]):j(R(Q[B-2]),Q[B-7],M(Q[B-15]),Q[B-16]),c=z(b,q(w),D(w,u,f),V[B],Q[B]),s=N(Z(e),G(e,a,o)),b=f,f=u,u=w,w=N(i,c),i=o,o=a,a=e,e=N(c,s);l[0]=N(e,l[0]),l[1]=N(a,l[1]),l[2]=N(o,l[2]),l[3]=N(i,l[3]),l[4]=N(w,l[4]),l[5]=N(u,l[5]),l[6]=N(f,l[6]),l[7]=N(b,l[7])}if("SHA-224"===r)n=[l[0],l[1],l[2],l[3],l[4],l[5],l[6]];else if("SHA-256"===r)n=l;else if("SHA-384"===r)n=[l[0].a,l[0].b,l[1].a,l[1].b,l[2].a,l[2].b,l[3].a,l[3].b,l[4].a,l[4].b,l[5].a,l[5].b];else{if("SHA-512"!==r)throw"Unexpected error in SHA-2 implementation";n=[l[0].a,l[0].b,l[1].a,l[1].b,l[2].a,l[2].b,l[3].a,l[3].b,l[4].a,l[4].b,l[5].a,l[5].b,l[6].a,l[6].b,l[7].a,l[7].b]}return n}"function"==typeof define?define(function(){return e}):"undefined"!=typeof exports?"undefined"!=typeof module&&module.exports?module.exports=exports=e:exports=e:n.jsSHA=e}(this);
},{}],145:[function(require,module,exports){
module.exports=function(){var r=Error.prepareStackTrace;Error.prepareStackTrace=function(r,e){return e};var e=new Error;Error.captureStackTrace(e,arguments.callee);var a=e.stack;return Error.prepareStackTrace=r,a};
},{}],146:[function(require,module,exports){
(function(e,r){var t=require("path"),o=require("callsite"),i=module.paths,s=module.filename;module.exports=function(e){return e.inherit=function(e){arguments.length>1&&e.inherit(Array.prototype.slice.call(arguments,1)),this.super_=e,this.prototype.__proto__=e.prototype,this.__proto__=e},e.super=function(e,r,t){return this.super_?"string"==typeof r?this.super_.prototype[r].apply(e,t):this.super_.apply(e,r):void 0},e.default=function(){return this._default||(this._default=new this),this._default},e.parent&&e.inherit(e.parent),e};var n=function(e,n){if("./"==e.slice(0,2)||"../"==e.slice(0,3)){var u=o()[1].getFileName();e=t.resolve(t.dirname(u),e)}module.paths=module.parent.paths,module.filename=module.parent.filename,e=require.resolve(e),module.paths=i,module.filename=s;var a=require.cache[e];a&&delete require.cache[e],r._imports=n;var l=require(e);return delete require.cache[e],a&&(require.cache[e]=a),l},u=function(e,t){r._imports=t;var o;try{o=require("!"+e)}catch(i){throw console.log("SOOP:"+i.message+"\nNote that SOOP requires a custom browserify configuration. please check soop's readme"),i}return o};module.exports.load=e.versions?n:u,module.exports.imports=function(){var e=r._imports||{};return r._imports={},e}}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});
},{"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91,"callsite":145,"path":92}],147:[function(require,module,exports){
(function(n){function e(){function e(){if(0!==a.length){var n=a.shift();t=r=0,o=[];try{u=!0;var l=n.apply(e,arguments)}catch(s){e(s)}void 0!==l&&e(void 0,l),u=!1}else if(arguments[0])throw arguments[0]}var r,t,o,u,a=Array.prototype.slice.call(arguments);e.parallel=function(){function a(){0===r&&e.apply(null,o)}var l=1+t++;return r++,n.nextTick(a),function(){r--,arguments[0]&&(o[0]=arguments[0]),o[l]=arguments[1],u||a()}},e.group=function(){function r(){0===a&&t(s,l)}var t=e.parallel(),o=0,a=0,l=[],s=void 0;return n.nextTick(r),function(){var n=o++;return a++,function(){a--,arguments[0]&&(s=arguments[0]),l[n]=arguments[1],u||r()}}},e()}e.fn=function(){var n=Array.prototype.slice.call(arguments);return function(){var r=Array.prototype.slice.call(arguments),t=[function(){this.apply(null,r)}].concat(n);"function"==typeof r[r.length-1]&&t.push(r.pop()),e.apply(null,t)}},"undefined"!=typeof module&&"exports"in module&&(module.exports=e)}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"));
},{"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91}],"b3ZSD7":[function(require,module,exports){
(function(t){function r(t){this.subject=t,this.pos=0}function o(t){for(var r=0,o=0;o<t.length;o++)r+=Math.pow(256,o)*t[o];return r}function e(t){for(var r=0,o=0;o<t.length;o++)r+=Math.pow(256,t.length-o-1)*t[o];return r}function s(t){var r=e(t);return 128==(128&t[0])&&(r-=Math.pow(256,t.length)),r}function n(t){var r=o(t);return 128==(128&t[t.length-1])&&(r-=Math.pow(256,t.length)),r}function i(t,r){return function(){var o=this.buffer(t);return r(o)}}require("soop").imports();r.prototype.buffer=function(t){var r=this.subject.slice(this.pos,this.pos+t);return this.pos+=t,r},r.prototype.search=function(r){var o;if("string"==typeof r||t.isBuffer(r))return o=this.subject.slice(this.pos).indexOf(r),-1!==o&&(this.pos+=o+r.length),o;if("number"==typeof r){r=255&r;for(var e=this.pos,s=this.subject.length;s>e;e++)if(this.subject[e]==r)return o=e-this.pos,this.pos=e+1,o;return-1}},r.prototype.scan=function(t){var r=this.pos,o=this.search(t);if(-1!==o)return this.subject.slice(r,r+o);throw new Error("No match")},r.prototype.eof=function(){return this.pos>=this.subject.length},[1,2,4,8].forEach(function(t){var p=8*t;r.prototype["word"+p+"le"]=r.prototype["word"+p+"lu"]=i(t,o),r.prototype["word"+p+"ls"]=i(t,n),r.prototype["word"+p+"be"]=r.prototype["word"+p+"bu"]=i(t,e),r.prototype["word"+p+"bs"]=i(t,s),r.prototype.word8=r.prototype.word8u=r.prototype.word8be,r.prototype.word8s=r.prototype.word8bs}),r.prototype.varInt=function(){var t=this.word8();switch(t){case 253:return this.word16le();case 254:return this.word32le();case 255:return this.word64le();default:return t}},r.prototype.varStr=function(){var t=this.varInt();return this.buffer(t)},module.exports=require("soop")(r)}).call(this,require("buffer").Buffer);
},{"buffer":75,"soop":146}],"./util/BinaryParser":[function(require,module,exports){
module.exports=require('b3ZSD7');
},{}],150:[function(require,module,exports){
var fs=require("fs"),crypto=require("crypto");exports.readFileSync=function(r,e,i){var t=fs.readFileSync(i,"binary");if(t.length<32)throw new Error("Crypted file "+i+" truncated");var a=t.slice(0,-32),n=t.slice(-32),c=crypto.createHmac("sha256",e);c.update(a);var y=c.digest("binary");if(y.toString()!=n.toString())throw new Error("Crypted file "+i+" failed HMAC checksum verification");var o=crypto.createDecipher(r,e),p=o.update(a,"binary","binary");return p+=o.final("binary")},exports.readJFileSync=function(r,e,i){var t=this.readFileSync(r,e,i);return JSON.parse(t)},exports.writeFileSync=function(r,e,i,t){var a=crypto.createCipher(r,e),n=a.update(t,"binary","binary");n+=a.final("binary");var c=crypto.createHmac("sha256",e);c.update(n);var y=c.digest("binary");return fs.writeFileSync(i,n+y,"binary"),!0},exports.writeJFileSync=function(r,e,i,t){var a=JSON.stringify(t);return this.writeFileSync(r,e,i,a)};
},{"crypto":79,"fs":71}],"./util/EncodedData":[function(require,module,exports){
module.exports=require('eLfUFE');
},{}],"eLfUFE":[function(require,module,exports){
(function(t){function n(t,n){this.data=t,this.__proto__=n||"string"!=typeof t?this.encodings[n||"binary"]:this.encodings.base58}var i=require("soop").imports(),r=i.base58||require("base58-native").base58Check;n.prototype.encoding=function(t){return t&&t!=this._encoding&&(this.data=this.as(t),this.__proto__=this.encodings[t]),this._encoding},n.prototype.withEncoding=function(t){return new n(this.as(t),t)},n.prototype.as=function(t){if(!e[t])throw new Error("invalid encoding");return this.converters[t].call(this)},n.prototype._validate=function(){this.withEncoding("binary")},n.prototype.isValid=function(){try{return this.validate(),!0}catch(t){return!1}},n.prototype.validate=function(){this._validate()},n.prototype.isValid=function(){try{return this.validate(),!0}catch(t){return!1}},n.prototype.toString=function(){return this.as("base58")},n.prototype.doAsBinary=function(t){var n=this.encoding();this.encoding("binary"),t.apply(this),this.encoding(n)};var e={binary:{converters:{binary:function(){var n=new t(this.data.length);return this.data.copy(n),n},base58:function(){return r.encode(this.data)},hex:function(){return this.data.toString("hex")}},_validate:function(){}},base58:{converters:{binary:function(){return r.decode(this.data)},hex:function(){return this.withEncoding("binary").as("hex")}}},hex:{converters:{binary:function(){return new t(this.data,"hex")},base58:function(){return this.withEncoding("binary").as("base58")}}}},o=function(){return this.data};for(var a in e)e.hasOwnProperty(a)&&(e[a].converters[a]||(e[a].converters[a]=o),e[a]._encoding=a);n.applyEncodingsTo=function(t){var n={};for(var i in e){var r=e[i],o={};for(var a in r)o[a]=r[a];o.__proto__=t.prototype,n[i]=o}t.prototype.encodings=n},n.applyEncodingsTo(n),module.exports=require("soop")(n)}).call(this,require("buffer").Buffer);
},{"base58-native":"xtP2pj","buffer":75,"soop":146}],"./util/VersionedData":[function(require,module,exports){
module.exports=require('QLzNQg');
},{}],"QLzNQg":[function(require,module,exports){
(function(t){function e(i,r){return"number"!=typeof i?void e.super(this,arguments):(this.data=new t(r.length+1),this.__proto__=this.encodings.binary,this.version(i),void this.payload(r))}var i=require("soop").imports(),r=(i.base58||require("base58-native").base58Check,i.parent||require("./EncodedData"));e.parent=r,r.applyEncodingsTo(e),e.prototype.version=function(t){return t||0===t?(this.doAsBinary(function(){this.data.writeUInt8(t,0)}),t):this.as("binary").readUInt8(0)},e.prototype.payload=function(t){return t?(this.doAsBinary(function(){t.copy(this.data,1)}),t):this.as("binary").slice(1)},module.exports=require("soop")(e)}).call(this,require("buffer").Buffer);
},{"./EncodedData":"eLfUFE","base58-native":"xtP2pj","buffer":75,"soop":146}],155:[function(require,module,exports){
function MissingSourceError(r,o){Error.call(this),this.message=r,this.missingTxHash=o,this.name="MissingSourceError"}function VerificationError(r,o){Error.call(this),this.message=r,this.missingTxHash=o,this.name="VerificationError"}MissingSourceError.prototype.__proto__=Error.prototype,exports.MissingSourceError=MissingSourceError,VerificationError.prototype.__proto__=Error.prototype,exports.VerificationError=VerificationError;
},{}],"./util/log":[function(require,module,exports){
module.exports=require('AdF7pF');
},{}],"AdF7pF":[function(require,module,exports){
"use strict";var noop=function(){},cl=function(){console.log(arguments)},loggers={none:{info:noop,warn:noop,err:noop,debug:noop},normal:{info:cl,warn:cl,err:cl,debug:noop},debug:{info:cl,warn:cl,err:cl,debug:cl}},config=require("../config");module.exports=config.log?config.log:loggers[config.logger||"normal"];
},{"../config":"4itQ50"}],158:[function(require,module,exports){
exports.curtime=function(){return Math.round(Date.now()/1e3)};
},{}],"./util/util":[function(require,module,exports){
module.exports=require('ACyo5H');
},{}],"ACyo5H":[function(require,module,exports){
(function(e,t){function n(r){for(r=r.substr(0,8);r.length<8;)r+="0";return r}function o(r){return s(r[1]).mul("100000000").add(n(r[2]))}function f(r){return s(n(r[1]))}function u(r){return s(r[1]).mul("100000000")}var i,a=require("crypto"),s=require("bignum"),l=require("binary"),c=require("bufferput"),h=require("buffertools"),p=require("jssha"),v=!e.versions;v&&(i=require("../browser/vendor-bundle.js"));{var g=exports.sha256=function(r){return new t(a.createHash("sha256").update(r).digest("binary"),"binary")},d=(exports.sha512hmac=function(r,e){if(v){var n=new p(r.toString("hex"),"HEX"),o=n.getHMAC(e.toString("hex"),"HEX","SHA-512","HEX");return o=new t(o,"hex")}var f=a.createHmac("sha512",e),o=f.update(r).digest();return o},exports.ripe160=function(r){if(!t.isBuffer(r))throw new Error("arg should be a buffer");if(v){for(var e=new i.crypto31.lib.WordArray.init(Crypto.util.bytesToWords(r),r.length),n=i.crypto31.RIPEMD160(e),o=n.words,f=[],u=0;u<32*o.length;u+=8)f.push(o[u>>>5]>>>24-u%32&255);return new t(f,"hex")}return new t(a.createHash("rmd160").update(r).digest("binary"),"binary")}),w=(exports.sha1=function(r){return new t(a.createHash("sha1").update(r).digest("binary"),"binary")},exports.twoSha256=function(r){return g(g(r))},exports.sha256ripe160=function(r){return d(g(r))},exports.formatHash=function(r){var e=new t(10);return r.copy(e,0,22,32),h.reverse(e).toString("hex")},exports.formatHashFull=function(r){var e=new t(r.length);r.copy(e);var n=h.toHex(h.reverse(e));return n}),x=(exports.formatHashAlt=function(r){var e=w(r);return e=e.replace(/^0*/,""),e.substr(0,10)},exports.formatBuffer=function(r,e){null===e&&(e=10),(e>r.length||0===e)&&(e=r.length);var n=new t(e);r.copy(n,0,0,e);var o=h.toHex(n);return n.length<r.length&&(o+="..."),o},exports.valueToBigInt=function(r){return t.isBuffer(r)?s.fromBuffer(r,{endian:"little",size:8}):r});exports.bigIntToValue=function(r){return t.isBuffer(r)?r:r.toBuffer({endian:"little",size:8})}}exports.bytesNeededToStore=bytesNeededToStore=function(r){return 0===r?0:Math.ceil((r.toString(2).replace("-","").length+1)/8)},exports.negativeBuffer=negativeBuffer=function(r){for(var e=new t(r.length),n=0;n<r.length;n++)e[n]=~r[n],e[n]<0&&(e[n]+=256);for(var n=r.length-1;n>=0&&(e[n]+=1,e[n]>=256&&(e[n]-=256),0===e[n]);n--);return e},exports.intToBuffer2C=function(r){var e=bytesNeededToStore(r),t=new c,n=r.toString(16),o="-"===n[0];n=n.replace("-","");for(var f=0;e>f;f++){var u=n.substring(n.length-2*(f+1),n.length-2*f);1===u.lenght&&(u="0"+u);var i=parseInt(u,16);t.word8(i)}var a=t.buffer();return o&&(a=h.reverse(a),a=negativeBuffer(a),a=h.reverse(a)),a};var b=function(r){var e;return 128&r[0]?(e=new t(r.length+1),r.copy(e,1),e[0]=0):e=r,e};exports.intToBufferSM=function(r){"number"==typeof r&&(r=s(r));var e,n,o=r.cmp(0);return o>0?(e=r.toBuffer(),n=b(e),n=h.reverse(n)):0==o?n=new t([]):(e=r.neg().toBuffer(),n=b(e),n[0]|=128,n=h.reverse(n)),n},exports.bufferSMToInt=function(r){if(!r.length)return s(0);if(r.length>4)throw new Error("Bigint cast overflow (> 4 bytes)");var e=new t(r.length);r.copy(e),e=h.reverse(e);var n=128&e[0];return n?(e[0]&=127,s.fromBuffer(e).neg()):s.fromBuffer(e)};var y=(exports.formatValue=function(r){for(var e=x(r).toString(),t=e.length>8?e.substr(0,e.length-8):"0",n=e.length>8?e.substr(e.length-8):e;n.length<8;)n="0"+n;for(n=n.replace(/0*$/,"");n.length<2;)n+="0";return t+"."+n},/^\s*(\d+)\.(\d+)/),m=/^\s*\.(\d+)/,B=/^\s*(\d+)/;exports.parseValue=function(r){"string"!=typeof r&&(r=r.toString());var e=r.match(y);return e?o(e):(e=r.match(m))?f(e):(e=r.match(B),e?u(e):void 0)};{var I=(exports.createSynchrotron=function(r){var e={};return function(t){var n=Array.prototype.slice.call(arguments),o=function(){n[0]=function(){e[t]&&(e[t].length?e[t].shift()():delete e[t])},r.apply(null,n)};e[t]?e[t].push(o):(e[t]=[],o())}},exports.generateNonce=function(){var e=4294967296,n=255,o=new t(8),f=0;return r=Math.random()*e,o[f++]=r&n,o[f++]=(r>>>=8)&n,o[f++]=(r>>>=8)&n,o[f++]=(r>>>=8)&n,r=Math.random()*e,o[f++]=r&n,o[f++]=(r>>>=8)&n,o[f++]=(r>>>=8)&n,o[f++]=(r>>>=8)&n,o},exports.decodeDiffBits=function(r,e){r=+r;for(var n=s(16777215&r),o=8*((r>>>24)-3);o-->0;)n=n.mul(2);if(e)return n;var f=n.toBuffer(),u=new t(32);return h.fill(u,0),f.copy(u,32-f.length),u}),S=(exports.encodeDiffBits=function(r){if(t.isBuffer(r))r=s.fromBuffer(r);else if("function"!=typeof r.toBuffer)throw new Error("Incorrect variable type for difficulty");var e=r.toBuffer("mpint"),n=e.length-4,o=n<<24;return n>=1&&(o|=e[4]<<16),n>=2&&(o|=e[5]<<8),n>=3&&(o|=e[6]),o},exports.calcDifficulty=function(r){t.isBuffer(r)||(r=I(r));var e=s.fromBuffer(r,{order:"forward"}),n=s.fromBuffer(H,{order:"forward"});return n.div(e).toNumber()},exports.reverseBytes32=function(r){if(r.length%4)throw new Error("Util.reverseBytes32(): Data length must be multiple of 4");for(var e=new c,t=l.parse(r);!t.eof();){var n=t.word32le("word").vars.word;e.word32be(n)}return e.buffer()},exports.getVarIntSize=function(r){return 253>r?1:65536>r?3:4294967296>r?5:9},exports.varIntBuf=function(r){var e=void 0;return 253>r?(e=new t(1),e.writeUInt8(r,0)):65536>r?(e=new t(3),e.writeUInt8(253,0),e.writeUInt16LE(r,1)):4294967296>r?(e=new t(5),e.writeUInt8(254,0),e.writeUInt32LE(r,1)):(e=new t(9),e.writeUInt8(255,0),e.writeInt32LE(-1&r,1),e.writeUInt32LE(Math.floor(r/4294967296),5)),e});exports.varStrBuf=function(r){return t.concat([S(r.length),r])}}exports.NULL_HASH=h.fill(new t(32),0),exports.EMPTY_BUFFER=new t(0),exports.ZERO_VALUE=h.fill(new t(8),0);var E=new t("ffffffffffffffff","hex");exports.INT64_MAX=E,exports.COIN=1e8;var H=exports.MAX_TARGET=new t("00000000FFFF0000000000000000000000000000000000000000000000000000","hex")}).call(this,require("/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),require("buffer").Buffer);
},{"../browser/vendor-bundle.js":53,"/Users/ryanxcharles/dev/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":91,"bignum":"J4nwo8","binary":62,"buffer":75,"bufferput":"aXRuS6","buffertools":"fugeBw","crypto":79,"jssha":144}]},{},[])