copay/lib/bitcore.js

375 lines
332 KiB
JavaScript
Raw Normal View History

2014-04-16 17:49:30 -07:00
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||
},{"./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,n
},{"./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
},{"./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 lo
},{"./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),th
},{"./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=[];
},{"./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
},{"./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
},_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,
},{}],"./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_
},{"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[
},{"./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 b
},{"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.r
},{"./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.endin
},{"./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[
},{"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("func
},{}],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(
},{}],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.appendCh
},{"./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>
},{}],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},expo
},{"../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}]},{},[])