-
Notifications
You must be signed in to change notification settings - Fork 32
/
bitcore.js
285 lines (279 loc) · 260 KB
/
bitcore.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
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(),parent=imports.parent||require("./util/VersionedData");Address.parent=parent,parent.applyEncodingsTo(Address),Address.prototype.validate=function(){this.doAsBinary(function(){if(Address.super(this,"validate",arguments),21!==this.data.length)throw new Error("invalid data length")})},Address.prototype.isValid=function(){var r=Address.super(this,"isValid",arguments);return r},module.exports=require("soop")(Address);
},{"./util/VersionedData":"QLzNQg","soop":102}],"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||r.NULL_HASH,this.merkle_root=t.merkle_root||r.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||r.EMPTY_BUFFER,this.txs=t.txs||[]}var i=require("soop").imports(),r=i.util||require("./util/util"),o=i.Debug1||function(){},h=i.Script||require("./Script"),s=i.Bignum||require("bignum"),n=(i.Binary||require("binary"),i.Step||require("step")),a=i.buffertools||require("buffertools"),c=i.Transaction||require("./Transaction"),f=c.In,u=c.Out,l=c.COINBASE_OP,p=i.VerificationError||require("./util/error").VerificationError,g={maxTimeOffset:7200,largestHash:s(2).pow(256)};e.prototype.getHeader=function(){var e=new t(80),i=0;return e.writeUInt32LE(this.version,i),i+=4,this.prev_hash.copy(e,i),i+=32,this.merkle_root.copy(e,i),i+=32,e.writeUInt32LE(this.timestamp,i),i+=4,e.writeUInt32LE(this.bits,i),i+=4,e.writeUInt32LE(this.nonce,i),i+=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 i=t.varInt(),r=0;i>r;r++){var o=new c;o.parse(t),this.txs.push(o)}},e.prototype.calcHash=function(){var t=this.getHeader();return r.twoSha256(t)},e.prototype.checkHash=function(){return this.hash&&this.hash.length?0==a.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=r.decodeDiffBits(this.bits);if(a.reverse(this.hash),a.compare(this.hash,t)>0)throw new p("Difficulty target not met");return a.reverse(this.hash),!0},e.prototype.getWork=function(){var t=r.decodeDiffBits(this.bits,!0);return g.largestHash.div(t.add(1))},e.prototype.checkTimestamp=function(){var t=(new Date).getTime()/1e3;if(this.timestamp>t+g.maxTimeOffset)throw new p("Timestamp too far into the future");return!0},e.prototype.checkTransactions=function(t){if(!Array.isArray(t)||t.length<=0)throw new p("No transactions");if(!t[0].isCoinBase())throw new p("First tx must be coinbase");for(var e=1;e<t.length;e++)if(t[e].isCoinBase())throw new p("Tx index "+e+" must not be coinbase");return!0},e.prototype.getMerkleTree=function(e){if(0==e.length)return[r.NULL_HASH.slice(0)];for(var i=e.map(function(t){return t instanceof c?t.getHash():t}),o=0,h=e.length;h>1;h=Math.floor((h+1)/2)){for(var s=0;h>s;s+=2){var n=Math.min(s+1,h-1),a=i[o+s],f=i[o+n];i.push(r.twoSha256(t.concat([a,f])))}o+=h}return i},e.prototype.calcMerkleRoot=function(t){var e=this.getMerkleTree(t);return e[e.length-1]},e.prototype.checkMerkleRoot=function(){if(!this.merkle_root||!this.merkle_root.length)throw new p("No merkle root");if(0==a.compare(this.calcMerkleRoot(),this.merkle_root))throw new p("Merkle root incorrect");return!0},e.prototype.checkBlock=function(t){if(!this.checkHash())throw new p("Block hash invalid");if(this.checkProofOfWork(),this.checkTimestamp(),t&&(this.checkTransactions(t),!this.checkMerkleRoot(t)))throw new p("Merkle hash invalid");return!0},e.getBlockValue=function(t){var e=s(50).mul(r.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 "+r.formatHashAlt(this.hash)+" height="+this.height+">"},e.prototype.attachTo=function(t){this.height=t.height+1,this.setChainWork(t.getChainWork().add(this.getWork()))},e.prototype.setChainWork=function(e){if(t.isBuffer(e));else{if("function"!=typeof e.toBuffer)throw new Error("Block.setChainWork(): Invalid datatype");e=e.toBuffer()}this.chainWork=e},e.prototype.getChainWork=function(){return s.fromBuffer(this.chainWork)},e.prototype.moreWorkThan=function(t){return this.getChainWork().cmp(t.getChainWork())>0},e.prototype.getNextWork=function(t,e,i){function h(e,i){try{e.height>0&&e.height%u!==0&&e.bits==n?t.getBlockByHeight(e.height-1,function(t,e){try{if(t)throw t;h(e,i)}catch(t){i(t)}}):i(null,e.bits)}catch(r){i(r)}}var s=this,n=t.getMinDiff(),a=r.decodeDiffBits(n,!0),c=t.getTargetTimespan(),f=t.getTargetSpacing(),u=c/f;if(0==this.height&&i(null,this.bits),(this.height+1)%u!==0)if(t.isTestnet()){{t.getTopBlock()}e.timestamp>this.timestamp+2*f?i(null,n):this.bits!=n?i(null,this.bits):h(this,i)}else i(null,this.bits);else t.getBlockByHeight(this.height-u+1,function(t,e){try{if(t)throw t;var h=s.timestamp-e.timestamp;c/4>h&&(h=c/4),h>4*c&&(h=4*c);var n=r.decodeDiffBits(s.bits,!0),f=n.mul(h).div(c);f.cmp(a)>0&&(f=a),o("Difficulty retarget (target="+c+", actual="+h+")"),o("Before: "+n.toBuffer().toString("hex")),o("After: "+f.toBuffer().toString("hex")),i(null,r.encodeDiffBits(f))}catch(t){i(t)}})};var m=11;e.prototype.getMedianTimePast=function(t,e){var i=this;n(function(){for(var e=[],r=0,o=m;o>r&&i.height-r>=0;r++)e.push(i.height-r);t.getBlocksByHeights(e,this)},function(t,e){if(t)throw t;var i=e.map(function(t){if(!t)throw new Error("Prior block missing, cannot calculate median time");return+t.timestamp});i=i.sort(),this(null,i[Math.floor(i.length/2)])},e)},e.prototype.verifyChild=function(t,e,i){var r=this;n(function(){r.getNextWork(t,e,this)},function(t,i){if(t)throw t;if(+e.bits!==+i)throw new p("Incorrect proof of work '"+e.bits+"', should be '"+i+"'.");this()},function(e){if(e)throw e;r.getMedianTimePast(t,this)},function(t,i){if(t)throw t;if(e.timestamp<=i)throw new p("Block's timestamp is too early");this()},i)},e.prototype.createCoinbaseTx=function(t){var e=new c;return e.ins.push(new f({s:r.EMPTY_BUFFER,q:4294967295,o:l})),e.outs.push(new u({v:r.bigIntToValue(this.getBlockValue()),s:h.createPubKeyOut(t).getBuffer()})),e},e.prototype.prepareNextBlock=function(t,i,r,o){var h=this,s=new e;n(function(){h.getMedianTimePast(t,this)},function(e,i){if(e)throw e;r||(r=Math.max(i+1,Math.floor((new Date).getTime()/1e3))),h.getNextWork(t,s,this)},function(t,e){if(t)throw t;s.bits=e,this(null)},function(t){if(t)throw t;s.version=1,s.timestamp=r,s.prev_hash=h.getHash().slice(0),s.height=h.height+1;var e=[],o=s.createCoinbaseTx(i);e.push(o),s.merkle_root=s.calcMerkleRoot(e),this(null,{block:s,txs:e})},o)},e.prototype.mineNextBlock=function(t,e,i,r,o){this.prepareNextBlock(t,e,i,function(t,e){try{if(t)throw t;var i=e.block,h=e.txs;return i.solve(r,function(t,e){i.nonce=e,i.getHash(),o(t,i,h)}),i}catch(s){o(s)}})},e.prototype.solve=function(t,e){var i=this.getHeader(),o=r.decodeDiffBits(this.bits);t.solve(i,o,e)},e.prototype.getStandardizedObject=function(t){var e={hash:r.formatHashFull(this.getHash()),version:this.version,prev_block:r.formatHashFull(this.prev_hash),mrkl_root:r.formatHashFull(this.merkle_root),time:this.timestamp,bits:this.bits,nonce:this.nonce,height:this.height};if(t){var i=this.getMerkleTree(t).map(function(t){return r.formatHashFull(t)});e.mrkl_root=i[i.length-1],e.n_tx=t.length;var o=80;o+=r.getVarIntSize(t.length),t=t.map(function(t){return t=t.getStandardizedObject(),o+=t.size,t}),e.size=o,e.tx=t,e.mrkl_tree=i}else e.size=this.size;return e},module.exports=require("soop")(e)}).call(this,require("buffer").Buffer);
},{"./Script":"clx6XL","./Transaction":"RNv6Te","./util/error":110,"./util/util":"ACyo5H","bignum":"J4nwo8","binary":56,"buffer":66,"buffertools":"fugeBw","soop":102,"step":103}],"./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":102}],"./Bloom":[function(require,module,exports){
module.exports=require('ZnXdbH');
},{}],"./Buffers.monkey":[function(require,module,exports){
module.exports=require('jmkPxi');
},{}],"jmkPxi":[function(require,module,exports){
exports.patch=function(t){t.prototype.skip=function(t){if(0!=t){if(t==this.length)return this.buffers=[],void(this.length=0);var f=this.pos(t);this.buffers=this.buffers.slice(f.buf),this.buffers[0].length-=f.offset,this.buffers[0].offset+=f.offset,this.length-=t}}};
},{}],"./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){var n=new h;n.word32le(this.sendVer),n.varint(t.length);for(var i=0;i<t.length;i++){if(32!=t[i].length)throw new Error("Invalid hash length");n.put(t[i])}var o=new e(r,"binary");if(32!=o.length)throw new Error("Invalid hash length");n.put(o);var a="getblocks";s&&(a="getheaders"),this.sendMessage(a,n.buffer())},t.prototype.sendGetHeaders=function(e,t){this.sendGetBlocks(e,t,!0)},t.prototype.sendGetData=function(e){var t=new h;t.varint(e.length);for(var r=0;r<e.length;r++)t.word32le(e[r].type),t.put(e[r].hash);this.sendMessage("getdata",t.buffer())},t.prototype.sendGetAddr=function(){var e=new h;this.sendMessage("getaddr",e.buffer())},t.prototype.sendInv=function(e){Array.isArray(e)||(e=[e]);var t=new h;t.varint(e.length),e.forEach(function(e){t.word32le(e instanceof d?2:1),t.put(e.getHash())}),this.sendMessage("inv",t.buffer())},t.prototype.sendHeaders=function(e){var t=new h;t.varint(e.length),e.forEach(function(e){t.put(e),t.word8(0)}),this.sendMessage("headers",t.buffer())},t.prototype.sendTx=function(e){this.sendMessage("tx",e.serialize())},t.prototype.sendBlock=function(e,t){var r=new h;r.put(e.getHeader()),r.varint(t.length),t.forEach(function(e){r.put(e.serialize())}),this.sendMessage("block",r.buffer())},t.prototype.sendMessage=function(t,r){try{var s=i.magic,o=new e(t,"ascii");if(o.length>12)throw"Command name too long";var a;a=this.sendVer>=209?l(r).slice(0,4):new e([]);var c=new h;c.put(s),c.put(o),c.pad(12-o.length),c.word32le(r.length),c.put(a),c.put(r);var d=c.buffer();n.debug("["+this.peer+"] Sending message "+t+" ("+r.length+" bytes)"),this.socket.write(d)}catch(f){n.err("Error while sending message to peer "+this.peer+": "+(f.stack?f.stack:f.toString()))}},t.prototype.handleData=function(e){return this.buffers.push(e),this.buffers.length>o?(n.err("Peer "+this.peer+" exceeded maxreceivebuffer, disconnecting."+(err.stack?err.stack:err.toString())),void this.socket.destroy()):void this.processData()},t.prototype.processData=function(){if(!(this.buffers.length<20)){for(var e=i.magic,t=0;;){if(this.buffers.get(t)===e[0]&&this.buffers.get(t+1)===e[1]&&this.buffers.get(t+2)===e[2]&&this.buffers.get(t+3)===e[3]){0!==t&&(n.debug("["+this.peer+"] Received "+t+" bytes of inter-message garbage: "),n.debug("... "+this.buffers.slice(0,t)),this.buffers.skip(t));break}if(t>this.buffers.length-4)return void this.buffers.skip(t);t++}var r=this.buffers.get(16)+(this.buffers.get(17)<<8)+(this.buffers.get(18)<<16)+(this.buffers.get(19)<<24),s=this.recvVer>=209?24:20,o=s+r;if(!(this.buffers.length<o)){var a=this.buffers.slice(4,16).toString("ascii").replace(/\0+$/,""),h=this.buffers.slice(s,o),c=this.recvVer>=209?this.buffers.slice(20,24):null;if(n.debug("["+this.peer+"] Received message "+a+" ("+r+" bytes)"),null!==c){var d=l(h).slice(0,4);if(0!==g.compare(d,c))return void n.err("["+this.peer+"] Checksum failed",{cmd:a,expected:d.toString("hex"),actual:c.toString("hex")})}var f;try{f=this.parseMessage(a,h)}catch(u){n.err("Error while parsing message "+a+" from "+this.peer+":\n"+(u.stack?u.stack:u.toString()))}f&&this.handleMessage(f),this.buffers.skip(o),this.processData()}}},t.prototype.parseMessage=function(e,t){var r,s=new p(t),i={command:e};switch(e){case"version":i.version=s.word32le(),i.services=s.word64le(),i.timestamp=s.word64le(),i.addr_me=s.buffer(26),i.addr_you=s.buffer(26),i.nonce=s.buffer(8),i.subversion=s.varStr(),i.start_height=s.word32le();break;case"inv":case"getdata":for(i.count=s.varInt(),i.invs=[],r=0;r<i.count;r++)i.invs.push({type:s.word32le(),hash:s.buffer(32)});break;case"headers":for(i.count=s.varInt(),i.headers=[],r=0;r<i.count;r++){var o=new d;o.parse(s),i.headers.push(o)}break;case"block":var a=new d;a.parse(s),i.block=a,i.version=a.version,i.prev_hash=a.prev_hash,i.merkle_root=a.merkle_root,i.timestamp=a.timestamp,i.bits=a.bits,i.nonce=a.nonce,i.txs=a.txs,i.size=t.length;break;case"tx":var h=new f;return h.parse(s),{command:e,version:h.version,lock_time:h.lock_time,ins:h.ins,outs:h.outs,tx:h};case"getblocks":case"getheaders":i.version=s.word32le();var c=s.varInt();for(i.starts=[],r=0;c>r;r++)i.starts.push(s.buffer(32));i.stop=s.buffer(32);break;case"addr":var u=s.varInt();for(u>1e3&&(u=1e3),i.addrs=[],r=0;u>r;r++)i.addrs.push({time:s.word32le(),services:s.word64le(),ip:s.buffer(16),port:s.word16be()});break;case"alert":i.payload=s.varStr(),i.signature=s.varStr();break;case"ping":this.recvVer>b&&(i.nonce=s.buffer(8));break;case"getaddr":case"verack":case"reject":break;default:return n.err("Connection.parseMessage(): Command not implemented",{cmd:e}),null}return i},module.exports=require("soop")(t)}).call(this,require("buffer").Buffer);
},{"./Block":"KqTx5b","./Buffers.monkey":"jmkPxi","./Transaction":"RNv6Te","./config":"4itQ50","./networks":"ULNIu2","./util/BinaryParser":104,"./util/log":"AdF7pF","./util/util":"ACyo5H","binary":56,"buffer":66,"bufferput":99,"buffers":100,"buffertools":"fugeBw","events":75,"soop":102}],"./Deserialize":[function(require,module,exports){
module.exports=require('ypnq12');
},{}],"ypnq12":[function(require,module,exports){
exports.intFromCompact=function(r){var t=(r>>>24&255)>>>0,n=(16777215&r)<<8*(t-3)>>>0;return n};
},{}],"./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:"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",["watch"])};
},{}],"Af1Gom":[function(require,module,exports){
(function(e,r){if(e.versions){var t=require("bindings")("KeyModule"),o=t.Key;module.exports=o}else{var s=require("./browser/vendor-bundle.js").ECKey,i=require("buffertools"),n=function(e){for(var r=[],t=e.length,o=0;t>o;o++)r.push(e.readUInt8(o));return r},u=function(){this._pub=null,this.compressed=!0};Object.defineProperty(u.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}}),u.generateSync=function(){var e=new s;e.setCompressed(!0);var t=e.getPub(),o=new u;return o.private=new r(e.priv.toByteArrayUnsigned()),o.public=new r(t),o},u.prototype.regenerateSync=function(){if(!this.private)throw new Error("Key does not have a private key set");var e=new s(i.toHex(this.private));return e.setCompressed(this.compressed),this.public=new r(e.getPub()),this},u.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 s(i.toHex(this.private));t.setCompressed(this.compressed);var o=t.sign(n(e));return new r(o)},u.prototype.verifySignatureSync=function(e,t){var o=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(!o.public)throw new Error("Key does not have a public key set");var i=new s;i.setPub(n(o.public)),i.setCompressed(o.compressed);var u=n(t),f=i.verify(n(e),u);return f},module.exports=u}}).call(this,require("/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),require("buffer").Buffer);
},{"./browser/vendor-bundle.js":47,"/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":82,"bindings":60,"buffer":66,"buffertools":"fugeBw"}],"./Key":[function(require,module,exports){
module.exports=require('Af1Gom');
},{}],"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));module.exports=require("soop")(Opcode);
},{"soop":102}],"./Peer":[function(require,module,exports){
module.exports=require('6VMrjH');
},{}],"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":56,"buffer":66,"buffertools":"fugeBw","net":65,"soop":102}],"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.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"),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(i){log.warn("Invalid addr received: "+i.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":75,"soop":102}],"./PeerManager":[function(require,module,exports){
module.exports=require('z6R5yC');
},{}],"./PrivateKey":[function(require,module,exports){
module.exports=require('+A60Qr');
},{}],"+A60Qr":[function(require,module,exports){
(function(t){function i(t,e,a){i.super(this,arguments),void 0!==a&&this.compressed(a)}var e=require("soop").imports(),a=e.parent||require("./util/VersionedData");i.parent=a,a.applyEncodingsTo(i),i.prototype.validate=function(){this.doAsBinary(function(){if(i.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")})},i.prototype.payload=function(t){if(t)return this.doAsBinary(function(){t.copy(this.data,1)}),t;var i=this.as("binary");return 34==i.length?i.slice(1,33):33==i.length?i.slice(1):void 0},i.prototype.compressed=function(i){if(void 0===i){var e=34,a=this.as("binary");if(a.length==e&&1==a[e-1])return!0;if(a.length==e-1)return!1;throw new Error("invalid private key")}this.doAsBinary(function(){var e=34;if(i){var a=new t(e);this.data.copy(a),this.data=a,this.data[e-1]=1}else this.data=this.data.slice(0,e-1)})},module.exports=require("soop")(i)}).call(this,require("buffer").Buffer);
},{"./util/VersionedData":"QLzNQg","buffer":66,"soop":102}],"./RpcClient":[function(require,module,exports){
module.exports=require('Svwrvc');
},{}],"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":66,"http":76,"https":80,"soop":102}],"./SIN":[function(require,module,exports){
module.exports=require('4cPRZZ');
},{}],"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":66,"soop":102}],"./SINKey":[function(require,module,exports){
module.exports=require('7/Dc/8');
},{}],"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":113,"./util/util":"ACyo5H","soop":102}],"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"];this.class=Script,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=t.word8();e>0&&OP_PUSHDATA1>e?this.chunks.push(t.buffer(e)):e==OP_PUSHDATA1?(r=t.word8(),this.chunks.push(t.buffer(r))):e==OP_PUSHDATA2?(r=t.word16le(),this.chunks.push(t.buffer(r))):e==OP_PUSHDATA4?(r=t.word32le(),this.chunks.push(t.buffer(r))):this.chunks.push(e)}},Script.prototype.isPushOnly=function(){for(var t=0;t<this.chunks.length;t++)if(!Buffer.isBuffer(this.chunks[t]))return!1;return!0},Script.prototype.isP2SH=function(){return 3==this.chunks.length&&this.chunks[0]==OP_HASH160&&Buffer.isBuffer(this.chunks[1])&&20==this.chunks[1].length&&this.chunks[2]==OP_EQUAL},Script.prototype.isPubkey=function(){return 2==this.chunks.length&&Buffer.isBuffer(this.chunks[0])&&this.chunks[1]==OP_CHECKSIG},Script.prototype.isPubkeyHash=function(){return 5==this.chunks.length&&this.chunks[0]==OP_DUP&&this.chunks[1]==OP_HASH160&&Buffer.isBuffer(this.chunks[2])&&20==this.chunks[2].length&&this.chunks[3]==OP_EQUALVERIFY&&this.chunks[4]==OP_CHECKSIG},Script.prototype.isMultiSig=function(){return this.chunks.length>3&&isSmallIntOp(this.chunks[0])&&isSmallIntOp(this.chunks[this.chunks.length-2])&&this.chunks[this.chunks.length-1]==OP_CHECKMULTISIG},Script.prototype.finishedMultiSig=function(){for(var t=0,r=0;r<this.chunks.length-1;r++)0!==this.chunks[r]&&t++;var e=this.chunks[this.chunks.length-1],i=new Script(e),n=i.chunks[0]-80;return t==n?!0:!1},Script.prototype.removePlaceHolders=function(){var t=[];for(var r in this.chunks)if(this.chunks.hasOwnProperty(r)){var e=this.chunks[r];0!=e&&t.push(e)}return this.chunks=t,this.updateBuffer(),this},Script.prototype.prependOp0=function(){var t=[0];for(i in this.chunks)this.chunks.hasOwnProperty(i)&&t.push(this.chunks[i]);return this.chunks=t,this.updateBuffer(),this},Script.prototype.classify=function(){return this.isPubkeyHash()?TX_PUBKEYHASH:this.isP2SH()?TX_SCRIPTHASH:this.isMultiSig()?TX_MULTISIG:this.isPubkey()?TX_PUBKEY:TX_UNKNOWN},Script.prototype.capture=function(){var t=this.classify(),r=[];switch(t){case TX_PUBKEY:r.push(this.chunks[0]);break;case TX_PUBKEYHASH:r.push(this.chunks[2]);break;case TX_MULTISIG:for(var e=1;e<this.chunks.length-2;e++)r.push(this.chunks[e]);break;case TX_SCRIPTHASH:r.push(this.chunks[1]);break;case TX_UNKNOWN:}return r},Script.prototype.captureOne=function(){var t=this.capture();return t[0]},Script.prototype.getOutType=function(){var t=this.classify();switch(t){case TX_PUBKEY:return"Pubkey";case TX_PUBKEYHASH:return"Address";default:return"Strange"}},Script.prototype.getRawOutType=function(){return TX_TYPES[this.classify()]},Script.prototype.simpleOutHash=function(){switch(this.getOutType()){case"Address":return this.chunks[2];case"Pubkey":return util.sha256ripe160(this.chunks[0]);default:return log.debug("Encountered non-standard scriptPubKey"),log.debug("Strange script was: "+this.toString()),null}},Script.prototype.getInType=function(){return 1==this.chunks.length?"Pubkey":2==this.chunks.length&&Buffer.isBuffer(this.chunks[0])&&Buffer.isBuffer(this.chunks[1])?"Address":"Strange"},Script.prototype.simpleInPubKey=function(){switch(this.getInType()){case"Address":return this.chunks[1];case"Pubkey":return null;default:return log.debug("Encountered non-standard scriptSig"),log.debug("Strange script was: "+this.toString()),null}},Script.prototype.getBuffer=function(){return this.buffer},Script.prototype.getStringContent=function(t,r){null===t&&(t=!0),"undefined"==typeof r&&(r=15);for(var e="",i=0,n=this.chunks.length;n>i;i++){var u=this.chunks[i];if(i>0&&(e+=" "),e+=Buffer.isBuffer(u)?"0x"+util.formatBuffer(u,t?null:0):Opcode.reverseMap[u],r&&i>r){e+=" ...";break}}return e},Script.prototype.toString=function(t,r){var e="<Script ";return e+=this.getStringContent(t,r),e+=">"},Script.prototype.writeOp=function(t){var r=Buffer(this.buffer.length+1);this.buffer.copy(r),r.writeUInt8(t,this.buffer.length),this.buffer=r,this.chunks.push(t)},Script.prototype.writeN=function(t){if(0>t||t>16)throw new Error("writeN: out of range value "+t);this.writeOp(0==t?OP_0:OP_1+t-1)},Script.prototype.writeBytes=function(t){this.buffer.length+prefixSize(t.length)+t.length;this.buffer=Buffer.concat([this.buffer,encodeLen(t.length),t]),this.chunks.push(t)},Script.prototype.updateBuffer=function(){this.buffer=Script.chunksToBuffer(this.chunks)},Script.prototype.findAndDelete=function(t){var r=!1;if(Buffer.isBuffer(t))for(var e=0,i=this.chunks.length;i>e;e++)Buffer.isBuffer(this.chunks[e])&&0===buffertools.compare(this.chunks[e],t)&&(this.chunks.splice(e,1),r=!0);else{if("number"!=typeof t)throw new Error("Invalid chunk datatype.");for(var e=0,i=this.chunks.length;i>e;e++)this.chunks[e]===t&&(this.chunks.splice(e,1),r=!0)}r&&this.updateBuffer()},Script.createPubKeyOut=function(t){var r=new Script;return r.writeBytes(t),r.writeOp(OP_CHECKSIG),r},Script.createPubKeyHashOut=function(t){var r=new Script;return r.writeOp(OP_DUP),r.writeOp(OP_HASH160),r.writeBytes(t),r.writeOp(OP_EQUALVERIFY),r.writeOp(OP_CHECKSIG),r},Script.createMultisig=function(t,r){var e=new Script;return e.writeN(t),r.forEach(function(t){e.writeBytes(t)}),e.writeN(r.length),e.writeOp(OP_CHECKMULTISIG),e},Script.createP2SH=function(t){var r=new Script;return r.writeOp(OP_HASH160),r.writeBytes(t),r.writeOp(OP_EQUAL),r},Script.fromTestData=function(t){t=t.map(function(t){return"string"==typeof t?new Buffer(t,"hex"):t});var r=new Script;return r.chunks=t,r.updateBuffer(),r},Script.fromChunks=function(t){var r=new Script;return r.chunks=t,r.updateBuffer(),r},Script.fromHumanReadable=function(t){return new Script(Script.stringToBuffer(t))},Script.prototype.toHumanReadable=function(){for(var t="",r=0,e=this.chunks.length;e>r;r++){var i=this.chunks[r];if(r>0&&(t+=" "),Buffer.isBuffer(i))0===i.length?t+="0":(t+="0x"+util.formatBuffer(encodeLen(i.length),0)+" ",t+="0x"+util.formatBuffer(i,0));else{var n=Opcode.reverseMap[i];"undefined"==typeof n&&(n="0x"+i.toString(16)),t+=n}}return t},Script.stringToBuffer=function(t){for(var r=new Put,e=t.split(" "),i=0;i<e.length;i++){var n=e[i];if(""!==n)if(n.length>2&&"0x"===n.substring(0,2))r.put(new Buffer(n.substring(2,n.length),"hex"));else{var u=Opcode.map["OP_"+n];if("undefined"!=typeof u)r.word8(u);else{var s=parseInt(n);if(isNaN(s)){if("'"!==n[0]||"'"!==n[n.length-1])throw new Error('Could not parse word "'+n+'" from script "'+t+'"');n=n.substring(1,n.length-1);for(var h="",f=0;f<n.length;f++)h+=""+n.charCodeAt(f).toString(16);r.put(Script.chunksToBuffer([new Buffer(n)]))}else{var c=util.intToBuffer(s);r.put(Script.chunksToBuffer([c]))}}}}return r.buffer()},Script.chunksToBuffer=function(t){for(var r=new Put,e=0,i=t.length;i>e;e++){var n=t[e];if(Buffer.isBuffer(n))n.length<OP_PUSHDATA1?r.word8(n.length):n.length<=255?(r.word8(OP_PUSHDATA1),r.word8(n.length)):n.length<=65535?(r.word8(OP_PUSHDATA2),r.word16le(n.length)):(r.word8(OP_PUSHDATA4),r.word32le(n.length)),r.put(n);else{if("number"!=typeof n)throw new Error("Script.chunksToBuffer(): Invalid chunk datatype");r.word8(n)}}return r.buffer()},module.exports=require("soop")(Script)}).call(this,require("buffer").Buffer);
},{"./Opcode":"zHwnes","./config":"4itQ50","./util/BinaryParser":104,"./util/log":"AdF7pF","./util/util":"ACyo5H","buffer":66,"bufferput":99,"buffertools":"fugeBw","soop":102}],"./Script":[function(require,module,exports){
module.exports=require('clx6XL');
},{}],"2heyj2":[function(require,module,exports){
(function(process,Buffer){function ScriptInterpreter(){this.stack=[],this.disableUnsafeOpcodes=!0}function verifyStep4(t,e,s,r,a,c,i,o,n){return 0==n.stack.length?void i(null,!1):void i(null,castBool(n.stackBack()))}function verifyStep3(t,e,s,r,a,c,i,o,n){if(0==o.stack.length)return void i(null,!1);if(0==castBool(o.stackBack()))return void i(null,!1);if(!c.verifyP2SH||!e.isP2SH())return void i(null,!0);if(!t.isPushOnly())return void i(null,!1);assert.notEqual(n.length,0);var h=new Script(n.stackPop());ok=!0,n.eval(h,s,r,a,function(h){h?i(h):verifyStep4(t,e,s,r,a,c,i,o,n)})}function verifyStep2(t,e,s,r,a,c,i,o,n){c.verifyP2SH&&o.stack.forEach(function(t){n.stack.push(t)}),o.eval(e,s,r,a,function(h){h?i(h):verifyStep3(t,e,s,r,a,c,i,o,n)})}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"),bignum=imports.bignum||require("bignum"),Util=imports.Util||require("./util/util"),Script=require("./Script");for(var i in Opcode.map)eval(i+" = "+Opcode.map[i]+";");ScriptInterpreter.prototype.eval=function(t,e,s,r,a){function c(a){function O(){try{if(F&&H>0){var t=y[D],i=N[C];checkSig(t,i,B,e,s,r,function(t,e){try{!t&&e?(D++,H--):(C++,L--,H>L&&(F=!1)),O.call(this)}catch(t){a(t)}}.bind(this))}else{if(this.stack.push(new Buffer([F?1:0])),u===OP_CHECKMULTISIGVERIFY){if(!F)throw new Error("OP_CHECKMULTISIGVERIFY negative");this.stackPop()}c.call(this,a)}}catch(o){a(o)}}if(i>=t.chunks.length)return o.length?void a(new Error("Execution stack ended non-empty")):void a(null);try{var P=!~o.indexOf(!1),u=t.chunks[i++];if(u.length>520)throw new Error("Max push value size exceeded (>520)");if(u>OP_16&&++p>201)throw new Error("Opcode limit exceeded (>200)");if(this.disableUnsafeOpcodes&&"number"==typeof u&&(u===OP_CAT||u===OP_SUBSTR||u===OP_LEFT||u===OP_RIGHT||u===OP_INVERT||u===OP_AND||u===OP_OR||u===OP_XOR||u===OP_2MUL||u===OP_2DIV||u===OP_MUL||u===OP_DIV||u===OP_MOD||u===OP_LSHIFT||u===OP_RSHIFT))throw new Error("Encountered a disabled opcode");if(P&&Buffer.isBuffer(u))this.stack.push(u);else if(P||u>=OP_IF&&OP_ENDIF>=u)switch(u){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:this.stack.push(bigintToBuffer(u-OP_1+1));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 k=!1;P&&(k=castBool(this.stackPop()),u===OP_NOTIF&&(k=!k)),o.push(k);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 k=castBool(this.stackTop());if(!k)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 f=this.stackTop(2),l=this.stackTop(1);this.stack.push(f),this.stack.push(l);break;case OP_3DUP:var f=this.stackTop(3),l=this.stackTop(2),_=this.stackTop(1);this.stack.push(f),this.stack.push(l),this.stack.push(_);break;case OP_2OVER:var f=this.stackTop(4),l=this.stackTop(3);this.stack.push(f),this.stack.push(l);break;case OP_2ROT:var f=this.stackTop(6),l=this.stackTop(5);this.stack.splice(this.stack.length-6,2),this.stack.push(f),this.stack.push(l);break;case OP_2SWAP:this.stackSwap(4,2),this.stackSwap(3,1);break;case OP_IFDUP:var k=this.stackTop();castBool(k)&&this.stack.push(k);break;case OP_DEPTH:var k=bignum(this.stack.length);this.stack.push(bigintToBuffer(k));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 b=castInt(this.stackPop());if(0>b||b>=this.stack.length)throw new Error("OP_PICK/OP_ROLL insufficient stack size");var k=this.stackTop(b+1);u===OP_ROLL&&this.stack.splice(this.stack.length-b-1,1),this.stack.push(k);break;case OP_ROT:this.stackSwap(3,2),this.stackSwap(2,1);break;case OP_SWAP:this.stackSwap(2,1);break;case OP_TUCK:if(this.stack.length<2)throw new Error("OP_TUCK insufficient stack size");this.stack.splice(this.stack.length-2,0,this.stackTop());break;case OP_CAT:var f=this.stackTop(2),l=this.stackTop(1);this.stackPop(),this.stackPop(),this.stack.push(Buffer.concat([f,l]));break;case OP_SUBSTR:var g=this.stackTop(3),E=castInt(this.stackTop(2)),T=castInt(this.stackTop(1));if(0>E||0>T)throw new Error("OP_SUBSTR start < 0 or len < 0");if(E+T>=g.length)throw new Error("OP_SUBSTR range out of bounds");this.stackPop(),this.stackPop(),this.stack[this.stack.length-1]=g.slice(E,E+T);break;case OP_LEFT:case OP_RIGHT:var g=this.stackTop(2),S=castInt(this.stackTop(1));if(0>S)throw new Error("OP_LEFT/OP_RIGHT size < 0");S>g.length&&(S=g.length),this.stackPop(),this.stack[this.stack.length-1]=u===OP_LEFT?g.slice(0,S):g.slice(g.length-S);break;case OP_SIZE:var k=bignum(this.stackTop().length);this.stack.push(bigintToBuffer(k));break;case OP_INVERT:for(var g=this.stackTop(),v=0,I=g.length;I>v;v++)g[v]=~g[v];break;case OP_AND:case OP_OR:case OP_XOR:var f=this.stackTop(2),l=this.stackTop(1);this.stackPop(),this.stackPop();var w=new Buffer(Math.max(f.length,l.length));if(u===OP_AND)for(var v=0,I=w.length;I>v;v++)w[v]=f[v]&l[v];else if(u===OP_OR)for(var v=0,I=w.length;I>v;v++)w[v]=f[v]|l[v];else if(u===OP_XOR)for(var v=0,I=w.length;I>v;v++)w[v]=f[v]^l[v];this.stack.push(w);break;case OP_EQUAL:case OP_EQUALVERIFY:var f=this.stackTop(2),l=this.stackTop(1),k=0===buffertools.compare(f,l);if(this.stackPop(),this.stackPop(),this.stack.push(new Buffer([k?1:0])),u===OP_EQUALVERIFY){if(!k)throw new Error("OP_EQUALVERIFY negative");this.stackPop()}break;case OP_1ADD:case OP_1SUB:case OP_2MUL:case OP_2DIV:case OP_NEGATE:case OP_ABS:case OP_NOT:case OP_0NOTEQUAL:var m=castBigint(this.stackTop());switch(u){case OP_1ADD:m=m.add(bignum(1));break;case OP_1SUB:m=m.sub(bignum(1));break;case OP_2MUL:m=m.mul(bignum(2));break;case OP_2DIV:m=m.div(bignum(2));break;case OP_NEGATE:m=m.neg();break;case OP_ABS:m=m.abs();break;case OP_NOT:m=bignum(0==m.cmp(0)?1:0);break;case OP_0NOTEQUAL:m=bignum(0==m.cmp(0)?0:1)}this.stack[this.stack.length-1]=bigintToBuffer(m);break;case OP_ADD:case OP_SUB:case OP_MUL:case OP_DIV:case OP_MOD:case OP_LSHIFT:case OP_RSHIFT:case OP_BOOLAND:case OP_BOOLOR:case OP_NUMEQUAL:case OP_NUMEQUALVERIFY:case OP_NUMNOTEQUAL:case OP_LESSTHAN:case OP_GREATERTHAN:case OP_LESSTHANOREQUAL:case OP_GREATERTHANOREQUAL:case OP_MIN:case OP_MAX:var m,f=castBigint(this.stackTop(2)),l=castBigint(this.stackTop(1));switch(u){case OP_ADD:m=f.add(l);break;case OP_SUB:m=f.sub(l);break;case OP_MUL:m=f.mul(l);break;case OP_DIV:m=f.div(l);break;case OP_MOD:m=f.mod(l);break;case OP_LSHIFT:if(l.cmp(0)<0||l.cmp(2048)>0)throw new Error("OP_LSHIFT parameter out of bounds");m=f.shiftLeft(l);break;case OP_RSHIFT:if(l.cmp(0)<0||l.cmp(2048)>0)throw new Error("OP_RSHIFT parameter out of bounds");m=f.shiftRight(l);break;case OP_BOOLAND:m=bignum(0!=f.cmp(0)&&0!=l.cmp(0)?1:0);break;case OP_BOOLOR:m=bignum(0!=f.cmp(0)||0!=l.cmp(0)?1:0);break;case OP_NUMEQUAL:case OP_NUMEQUALVERIFY:m=bignum(0==f.cmp(l)?1:0);break;case OP_NUMNOTEQUAL:m=bignum(0!=f.cmp(l)?1:0);break;case OP_LESSTHAN:m=bignum(f.lt(l)?1:0);break;case OP_GREATERTHAN:m=bignum(f.gt(l)?1:0);break;case OP_LESSTHANOREQUAL:m=bignum(f.gt(l)?0:1);break;case OP_GREATERTHANOREQUAL:m=bignum(f.lt(l)?0:1);break;case OP_MIN:m=f.lt(l)?f:l;break;case OP_MAX:m=f.gt(l)?f:l}if(this.stackPop(),this.stackPop(),this.stack.push(bigintToBuffer(m)),u===OP_NUMEQUALVERIFY){if(!castBool(this.stackTop()))throw new Error("OP_NUMEQUALVERIFY negative");this.stackPop()}break;case OP_WITHIN:var f=castBigint(this.stackTop(3)),l=castBigint(this.stackTop(2)),_=castBigint(this.stackTop(1));this.stackPop(),this.stackPop(),this.stackPop();var k=f.cmp(l)>=0&&f.cmp(_)<0;this.stack.push(bigintToBuffer(k?1:0));break;case OP_RIPEMD160:case OP_SHA1:case OP_SHA256:case OP_HASH160:case OP_HASH256:var d,k=this.stackPop();u===OP_RIPEMD160?d=Util.ripe160(k):u===OP_SHA1?d=Util.sha1(k):u===OP_SHA256?d=Util.sha256(k):u===OP_HASH160?d=Util.sha256ripe160(k):u===OP_HASH256&&(d=Util.twoSha256(k)),this.stack.push(d);break;case OP_CODESEPARATOR:h=i;break;case OP_CHECKSIG:case OP_CHECKSIGVERIFY:var R=this.stackTop(2),A=this.stackTop(1),U=t.chunks.slice(h),B=Script.fromChunks(U);return B.findAndDelete(R),void checkSig(R,A,B,e,s,r,function(t,e){try{var s;if(s=t?!1:e,this.stackPop(),this.stackPop(),this.stack.push(new Buffer([s?1:0])),u===OP_CHECKSIGVERIFY){if(!s)throw new Error("OP_CHECKSIGVERIFY negative");this.stackPop()}c.call(this,a)}catch(t){a(t)}}.bind(this));case OP_CHECKMULTISIG:case OP_CHECKMULTISIGVERIFY:var L=castInt(this.stackPop());if(0>L||L>20)throw new Error("OP_CHECKMULTISIG keysCount out of bounds");if(p+=L,p>201)throw new Error("Opcode limit exceeded (>200)");for(var N=[],v=0,I=L;I>v;v++)N.push(this.stackPop());var H=castInt(this.stackPop());if(0>H||H>L)throw new Error("OP_CHECKMULTISIG sigsCount out of bounds");for(var y=[],v=0,I=H;I>v;v++)y.push(this.stackPop());this.stackPop();var U=t.chunks.slice(h),B=Script.fromChunks(U);y.forEach(function(t){B.findAndDelete(t)});var F=!0,D=0,C=0;return void O.call(this);default:throw console.log("opcode "+u),new Error("Unknown opcode encountered")}if(this.stack.length+n.length>1e3)throw new Error("Maximum stack size exceeded");i%100?process.nextTick(c.bind(this,a)):c.call(this,a)}catch(M){log.debug("Script aborted: "+(M.message?M.message:M)),a(M)}}if("function"!=typeof a)throw new Error("ScriptInterpreter.eval() requires a callback");var i=0,o=[],n=[],h=0,p=0;return t.buffer.length>1e4?(a(new Error("Oversized script (> 10k bytes)")),this):void c.call(this,a)},ScriptInterpreter.prototype.evalTwo=function(t,e,s,r,a,c){var i=this;i.eval(t,s,r,a,function(t){return t?void c(t):void i.eval(e,s,r,a,c)})},ScriptInterpreter.prototype.stackTop=function(t){if(t=+t||1,1>t&&(t=1),t>this.stack.length)throw new Error("ScriptInterpreter.stackTop(): Stack underrun");return this.stack[this.stack.length-t]},ScriptInterpreter.prototype.stackBack=function(){return this.stack[-1]},ScriptInterpreter.prototype.stackPop=function(){if(this.stack.length<1)throw new Error("ScriptInterpreter.stackTop(): Stack underrun");return this.stack.pop()},ScriptInterpreter.prototype.stackSwap=function(t,e){if(this.stack.length<t||this.stack.length<e)throw new Error("ScriptInterpreter.stackTop(): Stack underrun");var s=this.stack,r=s.length,a=s[r-t];s[r-t]=s[r-e],s[r-e]=a},ScriptInterpreter.prototype.getPrimitiveStack=function(){return this.stack.map(function(t){if(t.length>2)return buffertools.toHex(t.slice(0));var e=castBigint(t);return e.cmp(-128)>=0&&e.cmp(127)<=0?e.toNumber():buffertools.toHex(t.slice(0))})};var castBool=ScriptInterpreter.castBool=function(t){for(var e=0,s=t.length;s>e;e++)if(0!=t[e])return e==s-1&&128==t[e]?!1:!0;return!1},castInt=ScriptInterpreter.castInt=function(t){return castBigint(t).toNumber()},castBigint=ScriptInterpreter.castBigint=function(t){if(!t.length)return bignum(0);if(t.length>4)throw new Error("Bigint cast overflow (> 4 bytes)");var e=new Buffer(t.length);return t.copy(e),e=buffertools.reverse(e),128&e[0]?(e[0]&=127,bignum.fromBuffer(e).neg()):bignum.fromBuffer(e)},bigintToBuffer=ScriptInterpreter.bigintToBuffer=function(t){"number"==typeof t&&(t=bignum(t));var e,s,r=t.cmp(0);return r>0?(e=t.toBuffer(),128&e[0]?(s=new Buffer(e.length+1),e.copy(s,1),s[0]=0,buffertools.reverse(s)):buffertools.reverse(e)):0==r?new Buffer([]):(e=t.neg().toBuffer(),128&e[0]?(s=new Buffer(e.length+1),e.copy(s,1),s[0]=128,buffertools.reverse(s)):(e[0]|=128,buffertools.reverse(e)))};ScriptInterpreter.prototype.getResult=function(){if(0===this.stack.length)throw new Error("Empty stack after script evaluation");return castBool(this.stack[this.stack.length-1])},ScriptInterpreter.verify=function(t,e,s,r,a,c){if("function"!=typeof c)throw new Error("ScriptInterpreter.verify() requires a callback");var i=new ScriptInterpreter;return i.evalTwo(t,e,s,r,a,function(t){if(t)return void c(t);try{var e=i.getResult()}catch(t){return void c(t)}c(null,e)}),i},ScriptInterpreter.verifyFull=function(t,e,s,r,a,c,i){var o=new ScriptInterpreter,n=new ScriptInterpreter;o.eval(t,s,r,a,function(h){h?i(h):verifyStep2(t,e,s,r,a,c,i,o,n)})};var checkSig=ScriptInterpreter.checkSig=function(t,e,s,r,a,c,i){if(!t.length)return void i(null,!1);if(0==c)c=t[t.length-1];else if(c!=t[t.length-1])return void i(null,!1);t=t.slice(0,t.length-1);try{var o=r.hashForSignature(s,a,c),n=new Util.BitcoinKey;n.public=e,n.verifySignature(o,t,i)}catch(h){i(null,!1)}};module.exports=require("soop")(ScriptInterpreter)}).call(this,require("/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),require("buffer").Buffer);
},{"./Opcode":"zHwnes","./Script":"clx6XL","./config":"4itQ50","./util/log":"AdF7pF","./util/util":"ACyo5H","/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":82,"bignum":"J4nwo8","buffer":66,"buffertools":"fugeBw","soop":102}],"./ScriptInterpreter":[function(require,module,exports){
module.exports=require('2heyj2');
},{}],"xzKFX3":[function(require,module,exports){
(function(r){function e(e,n,t){var i=t[n],s=new r(i.priv,"hex"),a=new KeyModule.Key;a.private=s;var u=a.signSync(e);return u}function n(n,t,i,s,a,u){var o=t.ins[n],h=o.getScript(),w=o.getOutpointHash();if(!(w in i))throw new Error("signTxIn missing input hash");var d=i[w],c=o.getOutpointIndex();if(d.outs.length>=c)throw new Error("signTxIn missing input index");var f=d.outs[c],p=f.getScript(),k=p.classify();if(k==TX_UNKNOWN)throw new Error("unknown TX type");var g=p.capture(),v=void 0,y=void 0,l=void 0,S=void 0;if(k==TX_SCRIPTHASH){var T=new Address(s.addressScript,g[0]),b=T.toString();if(!(b in u))throw new Error("unknown script hash address");if(v=new r(u[b],"hex"),y=new Script(v),l=y.classify(),l==TX_UNKNOWN)throw new Error("unknown subscript TX type");S=y.capture()}var E=t.hashForSignature(p,X,0);switch(k){case TX_PUBKEY:if(h.chunks.length>0)return;var B=util.sha256ripe160(g[0]),T=new Address(s.addressPubkey,B),b=T.toString();if(!(b in a))throw new Error("unknown pubkey");var P=e(E,b,a);h.writeBytes(P);break;case TX_PUBKEYHASH:if(h.chunks.length>0)return;var T=new Address(s.addressPubkey,g[0]),b=T.toString();if(!(b in a))throw new Error("unknown pubkey hash address");var P=e(E,b,a);h.writeBytes(P),h.writeBytes(key.public);break;case TX_SCRIPTHASH:if(h.chunks.length>0)return;var T=new Address(s.addressPubkey,S[0]),b=T.toString();if(!(b in a))throw new Error("unknown script(pubkey hash) address");var P=e(E,b,a);h.writeBytes(P),h.writeBytes(key.public);break;case TX_MULTISIG:for(;h.chunks.length<g.length;)h.writeBytes(util.EMPTY_BUFFER);for(var X=0;X<g.length;X++)if(!(h.chunks[X].length>0)){var B=util.sha256ripe160(h.chunks[X]),T=new Address(s.addressPubkey,B),b=T.toString();if(b in a){var P=e(E,b,a);h.chunks[X]=P}}}txtype==TX_SCRIPTHASH&&h.writeBytes(v)}exports.Transaction=function(r,e,t,i,s){for(var a=0;a<r.ins.length;a++)n(a,r,e,t,i,s)}}).call(this,require("buffer").Buffer);
},{"buffer":66}],"./Sign":[function(require,module,exports){
module.exports=require('xzKFX3');
},{}],"./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=v.reverse(i);var r=new t(4);r.writeUInt32LE(e.oIndex,0),this.o=t.concat([i,r])}this.s=t.isBuffer(e.s)?e.s:t.isBuffer(e.script)?e.script:h.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 r(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 n=require("soop").imports(),s=(n.config||require("./config"),n.log||require("./util/log")),o=n.Address||require("./Address"),u=n.Script||require("./Script"),a=n.ScriptInterpreter||require("./ScriptInterpreter"),h=n.util||require("./util/util"),f=n.bignum||require("bignum"),c=n.Put||require("bufferput"),p=n.Parser||require("./util/BinaryParser"),l=n.Step||require("step"),v=n.buffertools||require("buffertools"),g=(n.error||require("./util/error"),t.concat([h.NULL_HASH,new t("FFFFFFFF","hex")]));e.prototype.getScript=function(){return new u(this.s)},e.prototype.isCoinBase=function(){return 0===v.compare(this.o,g)},e.prototype.serialize=function(){var e=h.varIntBuf(this.s.length),i=new t(4);i.writeUInt32LE(this.q,0);var r=t.concat([this.o,e,this.s,i]);return r},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 u(this.s)},i.prototype.serialize=function(){var e=h.varIntBuf(this.s.length);return t.concat([this.v,e,this.s])},this.class=r,r.In=e,r.Out=i,r.prototype.isCoinBase=function(){return 1==this.ins.length&&this.ins[0].isCoinBase()},r.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},r.prototype.serialize=function(){var e=[],i=new t(4);i.writeUInt32LE(this.version,0),e.push(i),e.push(h.varIntBuf(this.ins.length)),this.ins.forEach(function(t){e.push(t.serialize())}),e.push(h.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},r.prototype.getBuffer=function(){return this._buffer?this._buffer:this.serialize()},r.prototype.calcHash=function(){return this.hash=h.twoSha256(this.getBuffer()),this.hash},r.prototype.checkHash=function(){return this.hash&&this.hash.length?0===v.compare(this.calcHash(),this.hash):!1},r.prototype.getHash=function(){return this.hash&&this.hash.length||(this.hash=this.calcHash()),this.hash},r.prototype.inputs=function(){for(var t=[],e=0;e<this.ins.length;e++){var i=this.ins[e],r=i.getOutpointHash(),n=i.getOutpointIndex();t.push([r,n])}return t},r.prototype.cacheInputs=function(t,e,i,r){var n=new I(this);n.buffer(t,e,i,r)},r.prototype.verify=function(t,e,i){function r(t,e){var i=t.getOutpointHash(),r=t.getOutpointIndex(),n=i.toString("base64"),s=o[n];if(!s)throw new MissingSourceError("Source tx "+h.formatHash(i)+" for inputs "+e+" not found",i.toString("base64"));var u=s[r];if(!u)throw new Error("Source output index "+r+" for input "+e+" out of bounds");return u}var n=this,o=t.txIndex,u=[],a=f(0),c=f(0);l(function(){var t=this.group();if(n.isCoinBase())throw new Error("Coinbase tx are invalid unless part of a block");n.ins.forEach(function(e,i){var s=r(e,i);a=a.add(h.valueToBigInt(s.v)),u.push(e.o),n.verifyInput(i,s.getScript(),t())})},function(t,e){if(t)throw t;for(var i=0,o=e.length;o>i;i++)if(!e[i]){var u=r(n.ins[i]);throw s.debug("Script evaluated to false"),s.debug("|- scriptSig",""+n.ins[i].getScript()),s.debug("`- scriptPubKey",""+u.getScript()),new VerificationError("Script for input "+i+" evaluated to false")}this()},function(t){if(t)throw t;e.countConflictingTransactions(u,this)},function(t,r){if(t)throw t;if(n.outs.forEach(function(t){c=c.add(h.valueToBigInt(t.v))}),a.cmp(c)<0){var o=h.formatValue(c),f=h.formatValue(a);throw new Error("Tx output value (BTC "+o+") exceeds input value (BTC "+f+")")}var p=a.sub(c);return r?void e.getConflictingTransactions(u,function(t,e){e.length?0===v.compare(e[0].getHash(),n.getHash())?(s.warn("Detected tx re-add (recoverable db corruption): "+h.formatHashAlt(e[0].getHash())),i(null,p)):i(new Error("At least one referenced output has already been spent in tx "+h.formatHashAlt(e[0].getHash()))):i(new Error("Outputs of this transaction are spent, but the transaction(s) that spend them are not available. This probably means you need to reset your database."))}):void this(null,p)},i)},r.prototype.verifyInput=function(t,e,i){return a.verify(this.ins[t].getScript(),e,this,t,0,i)},r.prototype.getAffectedKeys=function(t){if(!this.affects||!this.affects.length){this.affects=[];for(var e=0,i=this.outs.length;i>e;e++)try{var r=this.outs[e],n=r.getScript(),o=n.simpleOutPubKeyHash();o&&this.affects.push(o)}catch(u){s.debug("Unable to determine affected pubkeys: "+(u.stack?u.stack:""+u))}for(var a=t.txIndex,e=0,i=this.ins.length;i>e;e++)try{var h=this.ins[e];if(h.isCoinBase())continue;var f=h.getOutpointHash(),c=h.getOutpointIndex(),p=f.toString("base64"),l=a[p];if(!l)throw new Error("Input not found!");var r=l[c],n=r.getScript(),o=n.simpleOutPubKeyHash();o&&this.affects.push(o)}catch(u){s.debug("Unable to determine affected pubkeys: "+(u.stack?u.stack:""+u))}}var v={};return this.affects.forEach(function(t){v[t.toString("base64")]=t}),v};var d=171,b=1,w=2,y=3,S=80;r.SIGHASH_ALL=b,r.SIGHASH_NONE=w,r.SIGHASH_SINGLE=y,r.SIGHASH_ANYONECANPAY=S,r.prototype.hashForSignature=function(n,s,o){if(+s!==s||0>s||s>=this.ins.length)throw new Error("Input index '"+s+"' invalid or out of bounds ("+this.ins.length+" inputs)");var u=new r;this.ins.forEach(function(t){u.ins.push(new e(t))}),this.outs.forEach(function(t){u.outs.push(new i(t))}),u.version=this.version,u.lock_time=this.lock_time,n.findAndDelete(d);var a=31&o,f=new c;if(f.word32le(this.version),o&S)f.varint(1),f.put(this.ins[s].o),f.varint(n.buffer.length),f.put(n.buffer),f.word32le(this.ins[s].q);else{f.varint(this.ins.length);for(var p=0,l=this.ins.length;l>p;p++){{this.ins[p]}f.put(this.ins[p].o),s===p?(f.varint(n.buffer.length),f.put(n.buffer)):f.varint(0),f.word32le(a===w&&s!==p?0:this.ins[p].q)}}if(a===w)f.varint(0);else{var v;if(a===y){if(s>=u.outs.length)throw new Error("Transaction.hashForSignature(): SIGHASH_SINGLE no corresponding txout found - out of bounds");v=s+1}else v=this.outs.length;f.varint(v);for(var p=0;v>p;p++)a===y&&p!==s?(f.put(h.INT64_MAX),f.varint(0)):(f.put(this.outs[p].v),f.varint(this.outs[p].s.length),f.put(this.outs[p].s))}f.word32le(this.lock_time);var g=f.buffer();return g=t.concat([g,new t([parseInt(o),0,0,0])]),h.twoSha256(g)},r.prototype.getStandardizedObject=function(){var e={hash:h.formatHashFull(this.getHash()),version:this.version,lock_time:this.lock_time},i=8;i+=h.getVarIntSize(this.ins.length);var r=this.ins.map(function(e){var r={prev_out:{hash:v.reverse(new t(e.getOutpointHash())).toString("hex"),n:e.getOutpointIndex()}};return e.isCoinBase()?r.coinbase=e.s.toString("hex"):r.scriptSig=new u(e.s).getStringContent(!1,0),i+=36+h.getVarIntSize(e.s.length)+e.s.length+4,r});i+=h.getVarIntSize(this.outs.length);var n=this.outs.map(function(t){return i+=h.getVarIntSize(t.s.length)+t.s.length+8,{value:h.formatValue(t.v),scriptPubKey:new u(t.s).getStringContent(!1,0)}});return e.size=i,e["in"]=r,e.out=n,e},r.prototype.toObject=function(){return this},r.prototype.fromObj=function(r){var n={};n.version=r.version||1,n.lock_time=r.lock_time||0,n.ins=[],n.outs=[],r.inputs.forEach(function(i){var r=new e;r.s=h.EMPTY_BUFFER,r.q=4294967295;var s=new t(i.txid,"hex");s=v.reverse(s);var o=parseInt(i.vout),u=new t(4);u.writeUInt32LE(o,0),r.o=t.concat([s,u]),n.ins.push(r)});var s=Object.keys(r.outputs);s.forEach(function(t){var e=new o(t),s=u.createPubKeyHashOut(e.payload()),a=f(r.outputs[t]),c=h.bigIntToValue(a),p=new i;p.v=c,p.s=s.getBuffer(),n.outs.push(p)}),this.lock_time=n.lock_time,this.version=n.version,this.ins=n.ins,this.outs=n.outs},r.prototype.parse=function(r){t.isBuffer(r)&&(this._buffer=r,r=new p(r));{var n;r.pos}this.version=r.word32le();var s=r.varInt();for(this.ins=[],j=0;s>j;j++){var o=new e;o.o=r.buffer(36),n=r.varInt(),o.s=r.buffer(n),o.q=r.word32le(),this.ins.push(o)}var u=r.varInt();for(this.outs=[],j=0;u>j;j++){var a=new i;a.v=r.buffer(8),n=r.varInt(),a.s=r.buffer(n),this.outs.push(a)}this.lock_time=r.word32le(),this.calcHash()};var I=exports.TransactionInputsCache=function(t){var e=[],i=[],r={};t.ins.forEach(function(t){if(!t.isCoinBase()){var n=t.o.slice(0,32),s=n.toString("base64");-1==i.indexOf(s)&&(e.push(n),i.push(s)),r[s]||(r[s]=[]),r[s][t.getOutpointIndex()]=!0}}),this.tx=t,this.txList=e,this.txList64=i,this.txIndex={},this.requiredOuts=r,this.callbacks=[]};I.prototype.buffer=function(e,i,r,n){function s(t,e){if(t)throw t;e.forEach(function(t){var e=t.getHash().toString("base64"),i={};Object.keys(o.requiredOuts[e]).forEach(function(e){i[+e]=t.outs[+e]}),o.txIndex[e]=i,delete a[e]}),this(null)}var o=this,u=!1;"function"==typeof n&&o.callbacks.push(n);var a={};o.txList64.forEach(function(t){a[t]=!0}),l(function(){i?i.find(o.txList64,this):this(null,[])},s,function(t){if(t)throw t;var i=this;e.getOutputsByHashes(o.txList,function(t,e){i(t,e)})},s,function(e){if(e)throw e;var i="";Object.keys(a).length&&(i=Object.keys(a).map(function(e){return h.formatHash(new t(e,"base64"))}).join(",")),r&&Object.keys(a).length?setTimeout(function(){var t=Object.keys(a);t.length?o.callback(new Error("Missing inputs (timeout while searching): "+i)):u||o.callback(new Error("Callback failed to trigger"))},1e4):(u=!0,this(null,o))},o.callback.bind(o))},I.prototype.callback=function(t){var e=Array.prototype.slice.apply(arguments),i=this.callbacks;this.callbacks=[];try{i.forEach(function(t){t.apply(null,e)})}catch(t){s.err("Callback error after connecting tx inputs: "+(t.stack?t.stack:t.toString()))}},module.exports=require("soop")(r)}).call(this,require("buffer").Buffer);
},{"./Address":"5EBmBp","./Script":"clx6XL","./ScriptInterpreter":"2heyj2","./config":"4itQ50","./util/BinaryParser":104,"./util/error":110,"./util/log":"AdF7pF","./util/util":"ACyo5H","bignum":"J4nwo8","buffer":66,"bufferput":99,"buffertools":"fugeBw","soop":102,"step":103}],"./Wallet":[function(require,module,exports){
module.exports=require('kdpPkl');
},{}],"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(p)),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",p={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.addressScript,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":105,"./util/util":"ACyo5H","buffer":66,"fs":65,"soop":102}],"./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"),p=require("./Key"),s=require("./PrivateKey"),o=require("./Address");r.prototype.generate=function(){this.privKey=p.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.addressPubkey,r),p=new s(this.network.keySecret,this.privKey.private,this.privKey.compressed),n={created:this.created,priv:p.toString(),pub:e,addr:t.toString()};return n},r.prototype.fromObj=function(r){if(this.created=r.created,this.privKey=new p,64==r.priv.length)this.privKey.private=new e(r.priv,"hex"),this.privKey.compressed=!0;else{var i=new s(r.priv);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":113,"./util/util":"ACyo5H","buffer":66,"soop":102}],"bitcore":[function(require,module,exports){
module.exports=require('tmvhGl');
},{}],"tmvhGl":[function(require,module,exports){
(function(e,o){var r=function(e,o){Object.defineProperty(module.exports,e,{get:function(){return require(o)}})};r("bignum","bignum"),r("base58","base58-native"),r("buffertools","buffertools"),r("config","./config"),r("const","./const"),r("Deserialize","./Deserialize"),r("log","./util/log"),r("networks","./networks"),r("util","./util/util"),r("EncodedData","./util/EncodedData"),r("VersionedData","./util/VersionedData"),r("Address","./Address"),r("Opcode","./Opcode"),r("Script","./Script"),r("Transaction","./Transaction"),r("Connection","./Connection"),r("Peer","./Peer"),r("Block","./Block"),r("ScriptInterpreter","./ScriptInterpreter"),r("Bloom","./Bloom"),r("Key","./Key"),Object.defineProperty(module.exports,"KeyModule",{get:function(){return console.log("KeyModule is deprecated."),require("bindings")("KeyModule")}}),r("SINKey","./SINKey"),r("SIN","./SIN"),r("PrivateKey","./PrivateKey"),r("RpcClient","./RpcClient"),r("Wallet","./Wallet"),r("WalletKey","./WalletKey"),r("PeerManager","./PeerManager"),module.exports.Buffer=o,"undefined"==typeof e.versions&&module.exports.bignum.config({EXPONENTIAL_AT:9999999,DECIMAL_PLACES:0,ROUNDING_MODE:1})}).call(this,require("/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),require("buffer").Buffer);
},{"/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":82,"bindings":60,"buffer":66}],47:[function(require,module,exports){
function BigInteger(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function nbi(){return new BigInteger(null)}function am1(t,e,i,r,n,o){for(;--o>=0;){var s=e*this[t++]+i[r]+n;n=Math.floor(s/67108864),i[r++]=67108863&s}return n}function am2(t,e,i,r,n,o){for(var s=32767&e,u=e>>15;--o>=0;){var p=32767&this[t],h=this[t++]>>15,a=u*p+h*s;p=s*p+((32767&a)<<15)+i[r]+(1073741823&n),n=(p>>>30)+(a>>>15)+u*h+(n>>>30),i[r++]=1073741823&p}return n}function am3(t,e,i,r,n,o){for(var s=16383&e,u=e>>14;--o>=0;){var p=16383&this[t],h=this[t++]>>14,a=u*p+h*s;p=s*p+((16383&a)<<14)+i[r]+n,n=(p>>28)+(a>>14)+u*h,i[r++]=268435455&p}return n}function int2char(t){return BI_RM.charAt(t)}function intAt(t,e){var i=BI_RC[t.charCodeAt(e)];return null==i?-1:i}function bnpCopyTo(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function bnpFromInt(t){this.t=1,this.s=0>t?-1:0,t>0?this[0]=t:-1>t?this[0]=t+DV:this.t=0}function nbv(t){var e=nbi();return e.fromInt(t),e}function bnpFromString(t,e){var i;if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else{if(4!=e)return void this.fromRadix(t,e);i=2}this.t=0,this.s=0;for(var r=t.length,n=!1,o=0;--r>=0;){var s=8==i?255&t[r]:intAt(t,r);0>s?"-"==t.charAt(r)&&(n=!0):(n=!1,0==o?this[this.t++]=s:o+i>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,o+=i,o>=this.DB&&(o-=this.DB))}8==i&&0!=(128&t[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function bnToString(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var i,r=(1<<e)-1,n=!1,o="",s=this.t,u=this.DB-s*this.DB%e;if(s-->0)for(u<this.DB&&(i=this[s]>>u)>0&&(n=!0,o=int2char(i));s>=0;)e>u?(i=(this[s]&(1<<u)-1)<<e-u,i|=this[--s]>>(u+=this.DB-e)):(i=this[s]>>(u-=e)&r,0>=u&&(u+=this.DB,--s)),i>0&&(n=!0),n&&(o+=int2char(i));return n?o:"0"}function bnNegate(){var t=nbi();return BigInteger.ZERO.subTo(this,t),t}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(e=i-t.t,0!=e)return this.s<0?-e:e;for(;--i>=0;)if(0!=(e=this[i]-t[i]))return e;return 0}function nbits(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s}function bnpDRShiftTo(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s}function bnpLShiftTo(t,e){var i,r=t%this.DB,n=this.DB-r,o=(1<<n)-1,s=Math.floor(t/this.DB),u=this.s<<r&this.DM;for(i=this.t-1;i>=0;--i)e[i+s+1]=this[i]>>n|u,u=(this[i]&o)<<r;for(i=s-1;i>=0;--i)e[i]=0;e[s]=u,e.t=this.t+s+1,e.s=this.s,e.clamp()}function bnpRShiftTo(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)return void(e.t=0);var r=t%this.DB,n=this.DB-r,o=(1<<r)-1;e[0]=this[i]>>r;for(var s=i+1;s<this.t;++s)e[s-i-1]|=(this[s]&o)<<n,e[s-i]=this[s]>>r;r>0&&(e[this.t-i-1]|=(this.s&o)<<n),e.t=this.t-i,e.clamp()}function bnpSubTo(t,e){for(var i=0,r=0,n=Math.min(t.t,this.t);n>i;)r+=this[i]-t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<t.t;)r-=t[i],e[i++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=0>r?-1:0,-1>r?e[i++]=this.DV+r:r>0&&(e[i++]=r),e.t=i,e.clamp()}function bnpMultiplyTo(t,e){var i=this.abs(),r=t.abs(),n=i.t;for(e.t=n+r.t;--n>=0;)e[n]=0;for(n=0;n<r.t;++n)e[n+i.t]=i.am(0,r[n],e,n,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&BigInteger.ZERO.subTo(e,e)}function bnpSquareTo(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var r=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,r,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()}function bnpDivRemTo(t,e,i){var r=t.abs();if(!(r.t<=0)){var n=this.abs();if(n.t<r.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=nbi());var o=nbi(),s=this.s,u=t.s,p=this.DB-nbits(r[r.t-1]);p>0?(r.lShiftTo(p,o),n.lShiftTo(p,i)):(r.copyTo(o),n.copyTo(i));var h=o.t,a=o[h-1];if(0!=a){var F=a*(1<<this.F1)+(h>1?o[h-2]>>this.F2:0),g=this.FV/F,f=(1<<this.F1)/F,c=1<<this.F2,l=i.t,B=l-h,m=null==e?nbi():e;for(o.dlShiftTo(B,m),i.compareTo(m)>=0&&(i[i.t++]=1,i.subTo(m,i)),BigInteger.ONE.dlShiftTo(h,m),m.subTo(o,o);o.t<h;)o[o.t++]=0;for(;--B>=0;){var y=i[--l]==a?this.DM:Math.floor(i[l]*g+(i[l-1]+c)*f);if((i[l]+=o.am(0,y,i,B,0,h))<y)for(o.dlShiftTo(B,m),i.subTo(m,i);i[l]<--y;)i.subTo(m,i)}null!=e&&(i.drShiftTo(h,e),s!=u&&BigInteger.ZERO.subTo(e,e)),i.t=h,i.clamp(),p>0&&i.rShiftTo(p,i),0>s&&BigInteger.ZERO.subTo(i,i)}}}function bnMod(t){var e=nbi();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(BigInteger.ZERO)>0&&t.subTo(e,e),e}function Classic(t){this.m=t}function cConvert(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function cRevert(t){return t}function cReduce(t){t.divRemTo(this.m,null,t)}function cMulTo(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function cSqrTo(t,e){t.squareTo(e),this.reduce(e)}function bnpInvDigit(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function Montgomery(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function montConvert(t){var e=nbi();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(BigInteger.ZERO)>0&&this.m.subTo(e,e),e}function montRevert(t){var e=nbi();return t.copyTo(e),this.reduce(e),e}function montReduce(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],r=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(i=e+this.m.t,t[i]+=this.m.am(0,r,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function montSqrTo(t,e){t.squareTo(e),this.reduce(e)}function montMulTo(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(t,e){if(t>4294967295||1>t)return BigInteger.ONE;var i=nbi(),r=nbi(),n=e.convert(this),o=nbits(t)-1;for(n.copyTo(i);--o>=0;)if(e.sqrTo(i,r),(t&1<<o)>0)e.mulTo(r,n,i);else{var s=i;i=r,r=s}return e.revert(i)}function bnModPowInt(t,e){var i;return i=256>t||e.isEven()?new Classic(e):new Montgomery(e),this.exp(t,i)}function bnClone(){var t=nbi();return this.copyTo(t),t}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function bnByteValue(){return 0==this.t?this.s:this[0]<<24>>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(t){if(null==t&&(t=10),0==this.signum()||2>t||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),r=nbv(i),n=nbi(),o=nbi(),s="";for(this.divRemTo(r,n,o);n.signum()>0;)s=(i+o.intValue()).toString(t).substr(1)+s,n.divRemTo(r,n,o);return o.intValue().toString(t)+s}function bnpFromRadix(t,e){this.fromInt(0),null==e&&(e=10);for(var i=this.chunkSize(e),r=Math.pow(e,i),n=!1,o=0,s=0,u=0;u<t.length;++u){var p=intAt(t,u);0>p?"-"==t.charAt(u)&&0==this.signum()&&(n=!0):(s=e*s+p,++o>=i&&(this.dMultiply(r),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(s,0)),n&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(t,e,i){if("number"==typeof e)if(2>t)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(t-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(BigInteger.ONE.shiftLeft(t-1),this);else{var r=new Array,n=7&t;r.length=(t>>3)+1,e.nextBytes(r),n>0?r[0]&=(1<<n)-1:r[0]=0,this.fromString(r,256)}}function bnToByteArray(){var t=this.t,e=new Array;e[0]=this.s;var i,r=this.DB-t*this.DB%8,n=0;if(t-->0)for(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r&&(e[n++]=i|this.s<<this.DB-r);t>=0;)8>r?(i=(this[t]&(1<<r)-1)<<8-r,i|=this[--t]>>(r+=this.DB-8)):(i=this[t]>>(r-=8)&255,0>=r&&(r+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==n&&(128&this.s)!=(128&i)&&++n,(n>0||i!=this.s)&&(e[n++]=i);return e}function bnEquals(t){return 0==this.compareTo(t)}function bnMin(t){return this.compareTo(t)<0?this:t}function bnMax(t){return this.compareTo(t)>0?this:t}function bnpBitwiseTo(t,e,i){var r,n,o=Math.min(t.t,this.t);for(r=0;o>r;++r)i[r]=e(this[r],t[r]);if(t.t<this.t){for(n=t.s&this.DM,r=o;r<this.t;++r)i[r]=e(this[r],n);i.t=this.t}else{for(n=this.s&this.DM,r=o;r<t.t;++r)i[r]=e(n,t[r]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()}function op_and(t,e){return t&e}function bnAnd(t){var e=nbi();return this.bitwiseTo(t,op_and,e),e}function op_or(t,e){return t|e}function bnOr(t){var e=nbi();return this.bitwiseTo(t,op_or,e),e}function op_xor(t,e){return t^e}function bnXor(t){var e=nbi();return this.bitwiseTo(t,op_xor,e),e}function op_andnot(t,e){return t&~e}function bnAndNot(t){var e=nbi();return this.bitwiseTo(t,op_andnot,e),e}function bnNot(){for(var t=nbi(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}function bnShiftLeft(t){var e=nbi();return 0>t?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function bnShiftRight(t){var e=nbi();return 0>t?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function lbit(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function bnGetLowestSetBit(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+lbit(this[t]);return this.s<0?this.t*this.DB:-1}function cbit(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function bnBitCount(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=cbit(this[i]^e);return t}function bnTestBit(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)}function bnpChangeBit(t,e){var i=BigInteger.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i}function bnSetBit(t){return this.changeBit(t,op_or)}function bnClearBit(t){return this.changeBit(t,op_andnot)}function bnFlipBit(t){return this.changeBit(t,op_xor)}function bnpAddTo(t,e){for(var i=0,r=0,n=Math.min(t.t,this.t);n>i;)r+=this[i]+t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<t.t;)r+=t[i],e[i++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=0>r?-1:0,r>0?e[i++]=r:-1>r&&(e[i++]=this.DV+r),e.t=i,e.clamp()}function bnAdd(t){var e=nbi();return this.addTo(t,e),e}function bnSubtract(t){var e=nbi();return this.subTo(t,e),e}function bnMultiply(t){var e=nbi();return this.multiplyTo(t,e),e}function bnSquare(){var t=nbi();return this.squareTo(t),t}function bnDivide(t){var e=nbi();return this.divRemTo(t,e,null),e}function bnRemainder(t){var e=nbi();return this.divRemTo(t,null,e),e}function bnDivideAndRemainder(t){var e=nbi(),i=nbi();return this.divRemTo(t,e,i),new Array(e,i)}function bnpDMultiply(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function NullExp(){}function nNop(t){return t}function nMulTo(t,e,i){t.multiplyTo(e,i)}function nSqrTo(t,e){t.squareTo(e)}function bnPow(t){return this.exp(t,new NullExp)}function bnpMultiplyLowerTo(t,e,i){var r=Math.min(this.t+t.t,e);for(i.s=0,i.t=r;r>0;)i[--r]=0;var n;for(n=i.t-this.t;n>r;++r)i[r+this.t]=this.am(0,t[r],i,r,0,this.t);for(n=Math.min(t.t,e);n>r;++r)this.am(0,t[r],i,r,0,e-r);i.clamp()}function bnpMultiplyUpperTo(t,e,i){--e;var r=i.t=this.t+t.t-e;for(i.s=0;--r>=0;)i[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)i[this.t+r-e]=this.am(e-r,t[r],i,0,0,this.t+r-e);i.clamp(),i.drShiftTo(1,i)}function Barrett(t){this.r2=nbi(),this.q3=nbi(),BigInteger.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function barrettConvert(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=nbi();return t.copyTo(e),this.reduce(e),e}function barrettRevert(t){return t}function barrettReduce(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function barrettSqrTo(t,e){t.squareTo(e),this.reduce(e)}function barrettMulTo(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function bnModPow(t,e){var i,r,n=t.bitLength(),o=nbv(1);if(0>=n)return o;i=18>n?1:48>n?3:144>n?4:768>n?5:6,r=8>n?new Classic(e):e.isEven()?new Barrett(e):new Montgomery(e);var s=new Array,u=3,p=i-1,h=(1<<i)-1;if(s[1]=r.convert(this),i>1){var a=nbi();for(r.sqrTo(s[1],a);h>=u;)s[u]=nbi(),r.mulTo(a,s[u-2],s[u]),u+=2}var F,g,f=t.t-1,c=!0,l=nbi();for(n=nbits(t[f])-1;f>=0;){for(n>=p?F=t[f]>>n-p&h:(F=(t[f]&(1<<n+1)-1)<<p-n,f>0&&(F|=t[f-1]>>this.DB+n-p)),u=i;0==(1&F);)F>>=1,--u;if((n-=u)<0&&(n+=this.DB,--f),c)s[F].copyTo(o),c=!1;else{for(;u>1;)r.sqrTo(o,l),r.sqrTo(l,o),u-=2;u>0?r.sqrTo(o,l):(g=o,o=l,l=g),r.mulTo(l,s[F],o)}for(;f>=0&&0==(t[f]&1<<n);)r.sqrTo(o,l),g=o,o=l,l=g,--n<0&&(n=this.DB-1,--f)}return r.revert(o)}function bnGCD(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var r=e;e=i,i=r}var n=e.getLowestSetBit(),o=i.getLowestSetBit();if(0>o)return e;for(o>n&&(o=n),o>0&&(e.rShiftTo(o,e),i.rShiftTo(o,i));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=i.getLowestSetBit())>0&&i.rShiftTo(n,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return o>0&&i.lShiftTo(o,i),i}function bnpModInt(t){if(0>=t)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(0==e)i=this[0]%t;else for(var r=this.t-1;r>=0;--r)i=(e*i+this[r])%t;return i}function bnModInverse(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return BigInteger.ZERO;for(var i=t.clone(),r=this.clone(),n=nbv(1),o=nbv(0),s=nbv(0),u=nbv(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),e?(n.isEven()&&o.isEven()||(n.addTo(this,n),o.subTo(t,o)),n.rShiftTo(1,n)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;r.isEven();)r.rShiftTo(1,r),e?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(t,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);i.compareTo(r)>=0?(i.subTo(r,i),e&&n.subTo(s,n),o.subTo(u,o)):(r.subTo(i,r),e&&s.subTo(n,s),u.subTo(o,u))}return 0!=r.compareTo(BigInteger.ONE)?BigInteger.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u}function bnIsProbablePrime(t){var e,i=this.abs();if(1==i.t&&i[0]<=lowprimes[lowprimes.length-1]){for(e=0;e<lowprimes.length;++e)if(i[0]==lowprimes[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<lowprimes.length;){for(var r=lowprimes[e],n=e+1;n<lowprimes.length&&lplim>r;)r*=lowprimes[n++];for(r=i.modInt(r);n>e;)if(r%lowprimes[e++]==0)return!1}return i.millerRabin(t)}function bnpMillerRabin(t){var e=this.subtract(BigInteger.ONE),i=e.getLowestSetBit();if(0>=i)return!1;var r=e.shiftRight(i);t=t+1>>1,t>lowprimes.length&&(t=lowprimes.length);for(var n=nbi(),o=0;t>o;++o){n.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var s=n.modPow(r,this);if(0!=s.compareTo(BigInteger.ONE)&&0!=s.compareTo(e)){for(var u=1;u++<i&&0!=s.compareTo(e);)if(s=s.modPowInt(2,this),0==s.compareTo(BigInteger.ONE))return!1;if(0!=s.compareTo(e))return!1}}return!0}function Arcfour(){this.i=0,this.j=0,this.S=new Array}function ARC4init(t){var e,i,r;for(e=0;256>e;++e)this.S[e]=e;for(i=0,e=0;256>e;++e)i=i+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[i],this.S[i]=r;this.i=0,this.j=0}function ARC4next(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]}function prng_newstate(){return new Arcfour}function rng_seed_int(t){rng_pool[rng_pptr++]^=255&t,rng_pool[rng_pptr++]^=t>>8&255,rng_pool[rng_pptr++]^=t>>16&255,rng_pool[rng_pptr++]^=t>>24&255,rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}function rng_get_byte(){if(null==rng_state){for(rng_seed_time(),rng_state=prng_newstate(),rng_state.init(rng_pool),rng_pptr=0;rng_pptr<rng_pool.length;++rng_pptr)rng_pool[rng_pptr]=0;rng_pptr=0}return rng_state.next()}function rng_get_bytes(t){var e;for(e=0;e<t.length;++e)t[e]=rng_get_byte()}function SecureRandom(){}function ECFieldElementFp(t,e){this.x=e,this.q=t}function feFpEquals(t){return t==this?!0:this.q.equals(t.q)&&this.x.equals(t.x)}function feFpToBigInteger(){return this.x}function feFpNegate(){return new ECFieldElementFp(this.q,this.x.negate().mod(this.q))}function feFpAdd(t){return new ECFieldElementFp(this.q,this.x.add(t.toBigInteger()).mod(this.q))}function feFpSubtract(t){return new ECFieldElementFp(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))}function feFpMultiply(t){return new ECFieldElementFp(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))}function feFpSquare(){return new ECFieldElementFp(this.q,this.x.square().mod(this.q))}function feFpDivide(t){return new ECFieldElementFp(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))}function ECPointFp(t,e,i,r){this.curve=t,this.x=e,this.y=i,this.z=null==r?BigInteger.ONE:r,this.zinv=null}function pointFpGetX(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpGetY(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpEquals(t){if(t==this)return!0;if(this.isInfinity())return t.isInfinity();if(t.isInfinity())return this.isInfinity();var e,i;return e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),e.equals(BigInteger.ZERO)?(i=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q),i.equals(BigInteger.ZERO)):!1}function pointFpIsInfinity(){return null==this.x&&null==this.y?!0:this.z.equals(BigInteger.ZERO)&&!this.y.toBigInteger().equals(BigInteger.ZERO)}function pointFpNegate(){return new ECPointFp(this.curve,this.x,this.y.negate(),this.z)}function pointFpAdd(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),i=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(BigInteger.ZERO.equals(i))return BigInteger.ZERO.equals(e)?this.twice():this.curve.getInfinity();var r=new BigInteger("3"),n=this.x.toBigInteger(),o=this.y.toBigInteger(),s=(t.x.toBigInteger(),t.y.toBigInteger(),i.square()),u=s.multiply(i),p=n.multiply(s),h=e.square().multiply(this.z),a=h.subtract(p.shiftLeft(1)).multiply(t.z).subtract(u).multiply(i).mod(this.curve.q),F=p.multiply(r).multiply(e).subtract(o.multiply(u)).subtract(h.multiply(e)).multiply(t.z).add(e.multiply(u)).mod(this.curve.q),g=u.multiply(this.z).multiply(t.z).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(F),g)}function pointFpTwice(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new BigInteger("3"),e=this.x.toBigInteger(),i=this.y.toBigInteger(),r=i.multiply(this.z),n=r.multiply(i).mod(this.curve.q),o=this.curve.a.toBigInteger(),s=e.square().multiply(t);BigInteger.ZERO.equals(o)||(s=s.add(this.z.square().multiply(o))),s=s.mod(this.curve.q);var u=s.square().subtract(e.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(r).mod(this.curve.q),p=s.multiply(t).multiply(e).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(s.square().multiply(s)).mod(this.curve.q),h=r.square().multiply(r).shiftLeft(3).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(p),h)}function pointFpMultiply(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,i=t,r=i.multiply(new BigInteger("3")),n=this.negate(),o=this;for(e=r.bitLength()-2;e>0;--e){o=o.twice();var s=r.testBit(e),u=i.testBit(e);s!=u&&(o=o.add(s?this:n))}return o}function pointFpMultiplyTwo(t,e,i){var r;r=t.bitLength()>i.bitLength()?t.bitLength()-1:i.bitLength()-1;for(var n=this.curve.getInfinity(),o=this.add(e);r>=0;)n=n.twice(),t.testBit(r)?n=n.add(i.testBit(r)?o:this):i.testBit(r)&&(n=n.add(e)),--r;return n}function ECCurveFp(t,e,i){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(i),this.infinity=new ECPointFp(this,null,null)}function curveFpGetQ(){return this.q}function curveFpGetA(){return this.a}function curveFpGetB(){return this.b}function curveFpEquals(t){return t==this?!0:this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)}function curveFpGetInfinity(){return this.infinity}function curveFpFromBigInteger(t){return new ECFieldElementFp(this.q,t)}function curveFpDecodePointHex(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var e=(t.length-2)/2,i=t.substr(2,e),r=t.substr(e+2,e);return new ECPointFp(this,this.fromBigInteger(new BigInteger(i,16)),this.fromBigInteger(new BigInteger(r,16)));default:return null}}function X9ECParameters(t,e,i,r){this.curve=t,this.g=e,this.n=i,this.h=r}function x9getCurve(){return this.curve}function x9getG(){return this.g}function x9getN(){return this.n}function x9getH(){return this.h}function fromHex(t){return new BigInteger(t,16)}function secp128r1(){var t=fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),e=fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),i=fromHex("E87579C11079F43DD824993C2CEE5ED3"),r=fromHex("FFFFFFFE0000000075A30D1B9038A115"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83");return new X9ECParameters(o,s,r,n)}function secp160k1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),e=BigInteger.ZERO,i=fromHex("7"),r=fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE");return new X9ECParameters(o,s,r,n)}function secp160r1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),e=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),i=fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),r=fromHex("0100000000000000000001F4C8F927AED3CA752257"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32");return new X9ECParameters(o,s,r,n)}function secp192k1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),e=BigInteger.ZERO,i=fromHex("3"),r=fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");return new X9ECParameters(o,s,r,n)}function secp192r1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),e=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),i=fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),r=fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811");return new X9ECParameters(o,s,r,n)}function secp224r1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),e=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),i=fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),r=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");return new X9ECParameters(o,s,r,n)}function secp256k1(){var t=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"),e=BigInteger.ZERO,i=fromHex("7"),r=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8");return new X9ECParameters(o,s,r,n)}function secp256r1(){var t=fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),e=fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),i=fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),r=fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=BigInteger.ONE,o=new ECCurveFp(t,e,i),s=o.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");return new X9ECParameters(o,s,r,n)}function getSECCurveByName(t){return"secp128r1"==t?secp128r1():"secp160k1"==t?secp160k1():"secp160r1"==t?secp160r1():"secp192k1"==t?secp192k1():"secp192r1"==t?secp192r1():"secp224r1"==t?secp224r1():"secp256k1"==t?secp256k1():"secp256r1"==t?secp256r1():null}function integerToBytes(t,e){var i=t.toByteArrayUnsigned();if(e<i.length)i=i.slice(i.length-e);else for(;e>i.length;)i.unshift(0);return i}function dmp(t){return t instanceof BigInteger||(t=t.toBigInteger()),Crypto.util.bytesToHex(t.toByteArrayUnsigned())}if("undefined"==typeof window&&(window=this),Bitcoin={},"undefined"==typeof navigator){var navigator={};navigator.appName="NodeJS"}var base64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Crypto=window.Crypto={},util=Crypto.util={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&util.rotl(t,8)|4278255360&util.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=util.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],i=0,r=0;i<t.length;i++,r+=8)e[r>>>5]|=t[i]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],i=0;i<32*t.length;i+=8)e.push(t[i>>>5]>>>24-i%32&255);return e},bytesToHex:function(t){for(var e=[],i=0;i<t.length;i++)e.push((t[i]>>>4).toString(16)),e.push((15&t[i]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],i=0;i<t.length;i+=2)e.push(parseInt(t.substr(i,2),16));return e},bytesToBase64:function(t){if("function"==typeof btoa)return btoa(Binary.bytesToString(t));for(var e=[],i=0;i<t.length;i+=3)for(var r=t[i]<<16|t[i+1]<<8|t[i+2],n=0;4>n;n++)e.push(8*i+6*n<=8*t.length?base64map.charAt(r>>>6*(3-n)&63):"=");return e.join("")},base64ToBytes:function(t){if("function"==typeof atob)return Binary.stringToBytes(atob(t));t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],i=0,r=0;i<t.length;r=++i%4)0!=r&&e.push((base64map.indexOf(t.charAt(i-1))&Math.pow(2,-2*r+8)-1)<<2*r|base64map.indexOf(t.charAt(i))>>>6-2*r);return e}};Crypto.mode={};var charenc=Crypto.charenc={},UTF8=charenc.UTF8={stringToBytes:function(t){return Binary.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(Binary.bytesToString(t)))}},Binary=charenc.Binary={stringToBytes:function(t){for(var e=[],i=0;i<t.length;i++)e.push(t.charCodeAt(i));return e},bytesToString:function(t){for(var e=[],i=0;i<t.length;i++)e.push(String.fromCharCode(t[i]));return e.join("")}},CryptoJS=CryptoJS||function(t,e){var i={},r=i.lib={},n=function(){},o=r.Base={extend:function(t){n.prototype=this;var e=new n;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=r.WordArray=o.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:4*t.length},toString:function(t){return(t||p).stringify(this)},concat:function(t){var e=this.words,i=t.words,r=this.sigBytes;if(t=t.sigBytes,this.clamp(),r%4)for(var n=0;t>n;n++)e[r+n>>>2]|=(i[n>>>2]>>>24-8*(n%4)&255)<<24-8*((r+n)%4);else if(65535<i.length)for(n=0;t>n;n+=4)e[r+n>>>2]=i[n>>>2];else e.push.apply(e,i);return this.sigBytes+=t,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-8*(i%4),e.length=t.ceil(i/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var i=[],r=0;e>r;r+=4)i.push(4294967296*t.random()|0);return new s.init(i,e)}}),u=i.enc={},p=u.Hex={stringify:function(t){var e=t.words;t=t.sigBytes;for(var i=[],r=0;t>r;r++){var n=e[r>>>2]>>>24-8*(r%4)&255;i.push((n>>>4).toString(16)),i.push((15&n).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,i=[],r=0;e>r;r+=2)i[r>>>3]|=parseInt(t.substr(r,2),16)<<24-4*(r%8);return new s.init(i,e/2)}},h=u.Latin1={stringify:function(t){var e=t.words;t=t.sigBytes;for(var i=[],r=0;t>r;r++)i.push(String.fromCharCode(e[r>>>2]>>>24-8*(r%4)&255));return i.join("")},parse:function(t){for(var e=t.length,i=[],r=0;e>r;r++)i[r>>>2]|=(255&t.charCodeAt(r))<<24-8*(r%4);return new s.init(i,e)}},a=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},F=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=a.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var i=this._data,r=i.words,n=i.sigBytes,o=this.blockSize,u=n/(4*o),u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0);if(e=u*o,n=t.min(4*e,n),e){for(var p=0;e>p;p+=o)this._doProcessBlock(r,p);p=r.splice(0,e),i.sigBytes-=n}return new s.init(p,n)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});r.Hasher=F.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){F.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,i){return new t.init(i).finalize(e)}},_createHmacHelper:function(t){return function(e,i){return new g.HMAC.init(t,i).finalize(e)}}});var g=i.algo={};return i}(Math);!function(){var t=CryptoJS,e=t.lib,i=e.WordArray,r=e.Hasher,e=t.algo,n=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),s=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),p=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),e=e.RIPEMD160=r.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])
},_doProcessBlock:function(t,e){for(var i=0;16>i;i++){var r=e+i,a=t[r];t[r]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var F,g,f,c,l,B,m,y,d,v,r=this._hash.words,a=p.words,b=h.words,I=n.words,E=o.words,C=s.words,T=u.words;B=F=r[0],m=g=r[1],y=f=r[2],d=c=r[3],v=l=r[4];for(var w,i=0;80>i;i+=1)w=F+t[e+I[i]]|0,w=16>i?w+((g^f^c)+a[0]):32>i?w+((g&f|~g&c)+a[1]):48>i?w+(((g|~f)^c)+a[2]):64>i?w+((g&c|f&~c)+a[3]):w+((g^(f|~c))+a[4]),w|=0,w=w<<C[i]|w>>>32-C[i],w=w+l|0,F=l,l=c,c=f<<10|f>>>22,f=g,g=w,w=B+t[e+E[i]]|0,w=16>i?w+((m^(y|~d))+b[0]):32>i?w+((m&d|y&~d)+b[1]):48>i?w+(((m|~y)^d)+b[2]):64>i?w+((m&y|~m&d)+b[3]):w+((m^y^d)+b[4]),w|=0,w=w<<T[i]|w>>>32-T[i],w=w+v|0,B=v,v=d,d=y<<10|y>>>22,y=m,m=w;w=r[1]+f+d|0,r[1]=r[2]+c+v|0,r[2]=r[3]+l+B|0,r[3]=r[4]+F+m|0,r[4]=r[0]+g+y|0,r[0]=w},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;for(e[r>>>5]|=128<<24-r%32,e[(r+64>>>9<<4)+14]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(e.length+1),this._process(),t=this._hash,e=t.words,i=0;5>i;i++)r=e[i],e[i]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);return t},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});t.RIPEMD160=r._createHelper(e),t.HmacRIPEMD160=r._createHmacHelper(e)}(Math),module.exports.crypto31=CryptoJS;var dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr="0".charCodeAt(0),vv=0;9>=vv;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFlipBit,BigInteger.prototype.add=bnAdd,BigInteger.prototype.subtract=bnSubtract,BigInteger.prototype.multiply=bnMultiply,BigInteger.prototype.divide=bnDivide,BigInteger.prototype.remainder=bnRemainder,BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder,BigInteger.prototype.modPow=bnModPow,BigInteger.prototype.modInverse=bnModInverse,BigInteger.prototype.pow=bnPow,BigInteger.prototype.gcd=bnGCD,BigInteger.prototype.isProbablePrime=bnIsProbablePrime,BigInteger.prototype.square=bnSquare,Arcfour.prototype.init=ARC4init,Arcfour.prototype.next=ARC4next;var rng_psize=256;BigInteger.valueOf=nbv,BigInteger.prototype.toByteArrayUnsigned=function(){var t=this.abs().toByteArray();return t.length?(0==t[0]&&(t=t.slice(1)),t.map(function(t){return 0>t?t+256:t})):t},BigInteger.fromByteArrayUnsigned=function(t){return t.length?new BigInteger(128&t[0]?[0].concat(t):t):t.valueOf(0)},BigInteger.prototype.toByteArraySigned=function(){var t=this.abs().toByteArrayUnsigned(),e=this.compareTo(BigInteger.ZERO)<0;return e?128&t[0]?t.unshift(128):t[0]|=128:128&t[0]&&t.unshift(0),t},BigInteger.fromByteArraySigned=function(t){return 128&t[0]?(t[0]&=127,BigInteger.fromByteArrayUnsigned(t).negate()):BigInteger.fromByteArrayUnsigned(t)};var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];"undefined"==typeof window.console&&(window.console={});for(var i=0;i<names.length;++i)"undefined"==typeof window.console[names[i]]&&(window.console[names[i]]=function(){});Bitcoin.Util={isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},makeFilledArray:function(t,e){for(var i=[],r=0;t>r;)i[r++]=e;return i},numToVarInt:function(t){if(253>t)return[t];if(65536>t)return[253,255&t,t>>>8];if(4294967296>t)return[254].concat(Crypto.util.wordsToBytes([t]).reverse());throw"quadword not implemented"},valueToBigInt:function(t){return t instanceof BigInteger?t:BigInteger.fromByteArrayUnsigned(t)},formatValue:function(t){for(var e=this.valueToBigInt(t).toString(),i=e.length>8?e.substr(0,e.length-8):"0",r=e.length>8?e.substr(e.length-8):e;r.length<8;)r="0"+r;for(r=r.replace(/0*$/,"");r.length<2;)r+="0";return i+"."+r},parseValue:function(t){for(var e=t.split("."),i=e[0],r=e[1]||"0";r.length<8;)r+="0";r=r.replace(/^0+/g,"");var n=BigInteger.valueOf(parseInt(i));return n=n.multiply(BigInteger.valueOf(1e8)),n=n.add(BigInteger.valueOf(parseInt(r)))},sha256ripe160:function(t){return Crypto.RIPEMD160(Crypto.SHA256(t,{asBytes:!0}),{asBytes:!0})}};for(var i in Crypto.util)Crypto.util.hasOwnProperty(i)&&(Bitcoin.Util[i]=Crypto.util[i]);var rng_state,rng_pool,rng_pptr;if(null==rng_pool){rng_pool=new Array,rng_pptr=0;var t;if("Netscape"==navigator.appName&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;t<z.length;++t)rng_pool[rng_pptr++]=255&z.charCodeAt(t)}for(;rng_psize>rng_pptr;)t=Math.floor(65536*Math.random()),rng_pool[rng_pptr++]=t>>>8,rng_pool[rng_pptr++]=255&t;rng_pptr=0,rng_seed_time()}SecureRandom.prototype.nextBytes=rng_get_bytes,ECFieldElementFp.prototype.equals=feFpEquals,ECFieldElementFp.prototype.toBigInteger=feFpToBigInteger,ECFieldElementFp.prototype.negate=feFpNegate,ECFieldElementFp.prototype.add=feFpAdd,ECFieldElementFp.prototype.subtract=feFpSubtract,ECFieldElementFp.prototype.multiply=feFpMultiply,ECFieldElementFp.prototype.square=feFpSquare,ECFieldElementFp.prototype.divide=feFpDivide,ECPointFp.prototype.getX=pointFpGetX,ECPointFp.prototype.getY=pointFpGetY,ECPointFp.prototype.equals=pointFpEquals,ECPointFp.prototype.isInfinity=pointFpIsInfinity,ECPointFp.prototype.negate=pointFpNegate,ECPointFp.prototype.add=pointFpAdd,ECPointFp.prototype.twice=pointFpTwice,ECPointFp.prototype.multiply=pointFpMultiply,ECPointFp.prototype.multiplyTwo=pointFpMultiplyTwo,ECCurveFp.prototype.getQ=curveFpGetQ,ECCurveFp.prototype.getA=curveFpGetA,ECCurveFp.prototype.getB=curveFpGetB,ECCurveFp.prototype.equals=curveFpEquals,ECCurveFp.prototype.getInfinity=curveFpGetInfinity,ECCurveFp.prototype.fromBigInteger=curveFpFromBigInteger,ECCurveFp.prototype.decodePointHex=curveFpDecodePointHex,X9ECParameters.prototype.getCurve=x9getCurve,X9ECParameters.prototype.getG=x9getG,X9ECParameters.prototype.getN=x9getN,X9ECParameters.prototype.getH=x9getH,ECFieldElementFp.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},ECPointFp.prototype.getEncoded=function(t){var e=this.getX().toBigInteger(),i=this.getY().toBigInteger(),r=integerToBytes(e,32);return t?r.unshift(i.isEven()?2:3):(r.unshift(4),r=r.concat(integerToBytes(i,32))),r},ECPointFp.decodeFrom=function(t,e){var i=e[0],r=e.length-1;if(4===i)var n=e.slice(1,1+r/2),o=e.slice(1+r/2,1+r),s=BigInteger.fromByteArrayUnsigned(n),u=BigInteger.fromByteArrayUnsigned(o);else{var n=e.slice(1),s=BigInteger.fromByteArrayUnsigned(n),p=t.getQ(),h=s.multiply(s).multiply(s).add(new BigInteger("7")).mod(p),a=p.add(new BigInteger("1")).divide(new BigInteger("4")),u=h.modPow(a,p);u.mod(new BigInteger("2")).toString()!=""+i%2&&(u=p.subtract(u))}return new ECPointFp(t,t.fromBigInteger(s),t.fromBigInteger(u))},ECPointFp.prototype.add2D=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;if(this.x.equals(t.x))return this.y.equals(t.y)?this.twice():this.curve.getInfinity();var e=t.x.subtract(this.x),i=t.y.subtract(this.y),r=i.divide(e),n=r.square().subtract(this.x).subtract(t.x),o=r.multiply(this.x.subtract(n)).subtract(this.y);return new ECPointFp(this.curve,n,o)},ECPointFp.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=this.curve.fromBigInteger(BigInteger.valueOf(2)),e=this.curve.fromBigInteger(BigInteger.valueOf(3)),i=this.x.square().multiply(e).add(this.curve.a).divide(this.y.multiply(t)),r=i.square().subtract(this.x.multiply(t)),n=i.multiply(this.x.subtract(r)).subtract(this.y);return new ECPointFp(this.curve,r,n)},ECPointFp.prototype.multiply2D=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,i=t,r=i.multiply(new BigInteger("3")),n=this.negate(),o=this;for(e=r.bitLength()-2;e>0;--e){o=o.twice();var s=r.testBit(e),u=i.testBit(e);s!=u&&(o=o.add2D(s?this:n))}return o},ECPointFp.prototype.isOnCurve=function(){var t=this.getX().toBigInteger(),e=this.getY().toBigInteger(),i=this.curve.getA().toBigInteger(),r=this.curve.getB().toBigInteger(),n=this.curve.getQ(),o=e.multiply(e).mod(n),s=t.multiply(t).multiply(t).add(i.multiply(t)).add(r).mod(n);return o.equals(s)},ECPointFp.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},ECPointFp.prototype.validate=function(){var t=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var e=this.getX().toBigInteger(),i=this.getY().toBigInteger();if(e.compareTo(BigInteger.ONE)<0||e.compareTo(t.subtract(BigInteger.ONE))>0)throw new Error("x coordinate out of bounds");if(i.compareTo(BigInteger.ONE)<0||i.compareTo(t.subtract(BigInteger.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(t).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0},Bitcoin.ECDSA=function(){function t(t,e,i,r){for(var n=Math.max(e.bitLength(),r.bitLength()),o=t.add2D(i),s=t.curve.getInfinity(),u=n-1;u>=0;--u)s=s.twice2D(),s.z=BigInteger.ONE,e.testBit(u)?s=s.add2D(r.testBit(u)?o:t):r.testBit(u)&&(s=s.add2D(i));return s}var e=getSECCurveByName("secp256k1"),i=new SecureRandom,r=null,n={getBigRandom:function(t){return new BigInteger(t.bitLength(),i).mod(t.subtract(BigInteger.ONE)).add(BigInteger.ONE)},sign:function(t,i){var r=i,o=e.getN(),s=BigInteger.fromByteArrayUnsigned(t);do var u=n.getBigRandom(o),p=e.getG(),h=p.multiply(u),a=h.getX().toBigInteger().mod(o);while(a.compareTo(BigInteger.ZERO)<=0);var F=u.modInverse(o).multiply(s.add(r.multiply(a))).mod(o);return n.serializeSig(a,F)},verify:function(t,i,r){var o,s;if(Bitcoin.Util.isArray(i)){var u=n.parseSig(i);o=u.r,s=u.s}else{if("object"!=typeof i||!i.r||!i.s)throw"Invalid value for signature";o=i.r,s=i.s}var p;if(r instanceof ECPointFp)p=r;else{if(!Bitcoin.Util.isArray(r))throw"Invalid format for pubkey value, must be byte array or ECPointFp";p=ECPointFp.decodeFrom(e.getCurve(),r)}var h=BigInteger.fromByteArrayUnsigned(t);return n.verifyRaw(h,o,s,p)},verifyRaw:function(t,i,r,n){var o=e.getN(),s=e.getG();if(i.compareTo(BigInteger.ONE)<0||i.compareTo(o)>=0)return!1;if(r.compareTo(BigInteger.ONE)<0||r.compareTo(o)>=0)return!1;var u=r.modInverse(o),p=t.multiply(u).mod(o),h=i.multiply(u).mod(o),a=s.multiply(p).add(n.multiply(h)),F=a.getX().toBigInteger().mod(o);return F.equals(i)},serializeSig:function(t,e){var i=t.toByteArraySigned(),r=e.toByteArraySigned(),n=[];return n.push(2),n.push(i.length),n=n.concat(i),n.push(2),n.push(r.length),n=n.concat(r),n.unshift(n.length),n.unshift(48),n},parseSig:function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(e=2,2!=t[e])throw new Error("First element in signature must be a DERInteger");var i=t.slice(e+2,e+2+t[e+1]);if(e+=2+t[e+1],2!=t[e])throw new Error("Second element in signature must be a DERInteger");var r=t.slice(e+2,e+2+t[e+1]);e+=2+t[e+1];var n=BigInteger.fromByteArrayUnsigned(i),o=BigInteger.fromByteArrayUnsigned(r);return{r:n,s:o}},parseSigCompact:function(t){if(65!==t.length)throw"Signature has the wrong length";var i=t[0]-27;if(0>i||i>7)throw"Invalid signature type";var r=e.getN(),n=BigInteger.fromByteArrayUnsigned(t.slice(1,33)).mod(r),o=BigInteger.fromByteArrayUnsigned(t.slice(33,65)).mod(r);return{r:n,s:o,i:i}},recoverPubKey:function(i,o,s,u){u=3&u;var p=1&u,h=u>>1,a=e.getN(),F=e.getG(),g=e.getCurve(),f=g.getQ(),c=g.getA().toBigInteger(),l=g.getB().toBigInteger();r||(r=f.add(BigInteger.ONE).divide(BigInteger.valueOf(4)));var B=h?i.add(a):i,m=B.multiply(B).multiply(B).add(c.multiply(B)).add(l).mod(f),y=m.modPow(r,f),d=(y.isEven()?u%2:(u+1)%2,(y.isEven()?!p:p)?y:f.subtract(y)),v=new ECPointFp(g,g.fromBigInteger(B),g.fromBigInteger(d));v.validate();var b=BigInteger.fromByteArrayUnsigned(s),I=BigInteger.ZERO.subtract(b).mod(a),E=i.modInverse(a),C=t(v,o,F,I).multiply(E);if(C.validate(),!n.verifyRaw(b,i,o,C))throw"Pubkey recovery unsuccessful";var T=new Bitcoin.ECKey;return T.pub=C,T},calcPubkeyRecoveryParam:function(t,e,i,r){for(var n=0;4>n;n++)try{var o=Bitcoin.ECDSA.recoverPubKey(e,i,r,n);if(o.getBitcoinAddress().toString()==t)return n}catch(s){}throw"Unable to find valid recovery factor"}};return n}(),Bitcoin.ECKey=function(){var t=Bitcoin.ECDSA,e=getSECCurveByName("secp256k1"),i=(new SecureRandom,function(r){if(r)r instanceof BigInteger?this.priv=r:Bitcoin.Util.isArray(r)?this.priv=BigInteger.fromByteArrayUnsigned(r):"string"==typeof r&&(this.priv=BigInteger.fromByteArrayUnsigned(51==r.length&&"5"==r[0]?i.decodeString(r):Crypto.util.hexToBytes(r)));else{var n=e.getN();this.priv=t.getBigRandom(n)}this.compressed=!!i.compressByDefault});return i.compressByDefault=!1,i.prototype.setCompressed=function(t){this.compressed=!!t},i.prototype.getPub=function(){return this.getPubPoint().getEncoded(this.compressed)},i.prototype.getPubPoint=function(){return this.pub||(this.pub=e.getG().multiply(this.priv)),this.pub},i.prototype.getPubKeyHash=function(){return this.pubKeyHash?this.pubKeyHash:this.pubKeyHash=Bitcoin.Util.sha256ripe160(this.getPub())},i.prototype.getBitcoinAddress=function(){var t=this.getPubKeyHash(),e=new Bitcoin.Address(t);return e},i.prototype.getExportedPrivateKey=function(){for(var t=this.priv.toByteArrayUnsigned();t.length<32;)t.unshift(0);t.unshift(128);var e=Crypto.SHA256(Crypto.SHA256(t,{asBytes:!0}),{asBytes:!0}),i=t.concat(e.slice(0,4));return Bitcoin.Base58.encode(i)},i.prototype.setPub=function(t){this.pub=ECPointFp.decodeFrom(e.getCurve(),t)},i.prototype.toString=function(t){return"base64"===t?Crypto.util.bytesToBase64(this.priv.toByteArrayUnsigned()):Crypto.util.bytesToHex(this.priv.toByteArrayUnsigned())},i.prototype.sign=function(e){return t.sign(e,this.priv)},i.prototype.verify=function(e,i){return t.verify(e,i,this.getPub())},i.decodeString=function(t){var e=Bitcoin.Base58.decode(t),i=e.slice(0,33),r=Crypto.SHA256(Crypto.SHA256(i,{asBytes:!0}),{asBytes:!0});if(r[0]!=e[33]||r[1]!=e[34]||r[2]!=e[35]||r[3]!=e[36])throw"Checksum validation failed!";var n=i.shift();if(128!=n)throw"Version "+n+" not supported!";return i},i}(),module.exports.ECKey=Bitcoin.ECKey;
},{}],"4itQ50":[function(require,module,exports){
module.exports={network:"livenet",logger:"normal"};
},{}],"./config":[function(require,module,exports){
module.exports=require('4itQ50');
},{}],"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;
},{}],"./const":[function(require,module,exports){
module.exports=require('f08cvL');
},{}],"./networks":[function(require,module,exports){
module.exports=require('ULNIu2');
},{}],"ULNIu2":[function(require,module,exports){
(function(F){var e=require("bufferput"),s=require("buffertools"),r=function(e){return new F(e,"hex")};exports.livenet={name:"livenet",addressVersion:0,magic:r("f9beb4d9"),genesisBlock:{height:0,nonce:2083236893,version:1,hash:r("6FE28C0AB6F1B372C1A6A246AE63F74F931E8365E15A089C68D6190000000000"),prev_hash:s.fill(new F(32),0),timestamp:1231006505,merkle_root:r("3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A"),bits:486604799},genesisBlockTx:{outs:[{v:r("00F2052A01000000"),s:(new e).word8(65).put(r("04678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5F")).word8(172).buffer()}],lock_time:0,version:1,hash:r("3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A"),ins:[{q:4294967295,o:r("0000000000000000000000000000000000000000000000000000000000000000FFFFFFFF"),s:(new e).put(r("04FFFF001D010445")).put(new F("The Times 03/Jan/2009 Chancellor on brink of second bailout for banks","ascii")).buffer()}]},proofOfWorkLimit:r("00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),checkpoints:[],addressPubkey:0,addressScript:5,keySecret:128},exports.testnet={name:"testnet",addressVersion:111,magic:r("0b110907"),genesisBlock:{height:0,nonce:414098458,version:1,hash:r("43497FD7F826957108F4A30FD9CEC3AEBA79972084E90EAD01EA330900000000"),prev_hash:s.fill(new F(32),0),timestamp:1296688602,merkle_root:r("3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A"),bits:486604799},genesisBlockTx:module.exports.livenet.genesisBlockTx,proofOfWorkLimit:module.exports.livenet.proofOfWorkLimit,checkpoints:[],addressPubkey:111,addressScript:196,keySecret:239}}).call(this,require("buffer").Buffer);
},{"buffer":66,"bufferput":99,"buffertools":"fugeBw"}],"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":66,"crypto":70}],"base58-native":[function(require,module,exports){
module.exports=require('xtP2pj');
},{}],56:[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":57,"buffer":66,"buffers":100,"chainsaw":58,"events":75,"stream":89}],57:[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};
},{}],58:[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(o,s){var i=new a;return i.handlers=s,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(o,{}),s=o.call(a.handlers,a);void 0!==s&&(a.handlers=s),"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("/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"));
},{"/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":82,"events":75,"traverse":59}],59:[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)}});
},{}],60:[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,u=e.try.length;u>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(l){if(!/not find/i.test(l.message))throw l}}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("/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"/node_modules/bindings/bindings.js");
},{"/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":82,"fs":65,"path":83}],"J4nwo8":[function(require,module,exports){
(function(e){function n(e,i){var s,o,l,c,g,p,d=this;if(!(d instanceof n))return new n(e,i);if(e instanceof n){if(O=0,i===s)return d.s=e.s,d.e=e.e,void(d.c=(e=e.c)?e.slice():e);e+=""}if(""===e&&(e=0),"string"!=typeof e&&(e=(l="number"==typeof e||"[object Number]"==Object.prototype.toString.call(e))&&0===e&&0>1/e?"-0":e+""),p=e,i===s&&S.test(e))d.s="-"==e.charAt(0)?(e=e.slice(1),-1):1;else{if(10==i)return u(e,h,a);if(e=E.call(e).replace(/^\+(?!-)/,""),d.s="-"==e.charAt(0)?(e=e.replace(/^-(?!-)/,""),-1):1,null!=i?i!=(0|i)&&w||(f=!(i>=2&&65>i))?(t(i,2),g=S.test(e)):(c="["+N.slice(0,i=0|i)+"]+",e=e.replace(/\.$/,"").replace(/^\./,"0."),(g=new RegExp("^"+c+"(?:\\."+c+")?$",37>i?"i":"").test(e))?(l&&(e.replace(/^0\.0*|\./,"").length>15&&t(p,0),l=!l),e=r(e,10,i,d.s)):"Infinity"!=e&&"NaN"!=e&&(t(p,1,i),e="NaN")):g=S.test(e),!g)return d.c=d.e=null,"Infinity"!=e&&("NaN"!=e&&t(p,3),d.s=null),void(O=0)}for((s=e.indexOf("."))>-1&&(e=e.replace(".","")),(o=e.search(/e/i))>0?(0>s&&(s=o),s+=+e.slice(o+1),e=e.substring(0,o)):0>s&&(s=e.length),o=0;"0"==e.charAt(o);o++);if(i=e.length,l&&i>15&&e.slice(o).length>15&&t(p,0),O=0,(s-=o+1)>v)d.c=d.e=null;else if(o==i||m>s)d.c=[d.e=0];else{for(;"0"==e.charAt(--i););for(d.e=s,d.c=[],s=0;i>=o;d.c[s++]=+e.charAt(o++));}}function t(e,n,t,r,i,s){if(w){var o,u=["new BigNumber","cmp","div","eq","gt","gte","lt","lte","minus","mod","plus","times","toFr"][O?0>O?-O:O:0>1/O?1:0]+"()",l=f?" out of range":" not a"+(i?" non-zero":"n")+" integer";throw l=([u+" number type has more than 15 significant digits",u+" not a base "+t+" number",u+" base"+l,u+" not a number"][n]||t+"() "+n+(s?" not a boolean or binary digit":l+(r?" or not ["+(f?" negative, positive":" integer, integer")+" ]":"")))+": "+e,f=O=0,o=new Error(l),o.name="BigNumber Error",o}}function r(e,t,r,s){function o(e,n){var i,s,o=0,u=e.length,f=[0];for(n=n||r;u>o;o++){for(s=f.length,i=0;s>i;f[i]*=n,i++);for(f[0]+=N.indexOf(e.charAt(o)),i=0;i<f.length;i++)f[i]>t-1&&(null==f[i+1]&&(f[i+1]=0),f[i+1]+=f[i]/t^0,f[i]%=t)}return f.reverse()}function u(e){for(var n=0,t=e.length,r="";t>n;r+=N.charAt(e[n++]));return r}var f,l,c,h,a,g;if(37>r&&(e=e.toLowerCase()),(f=e.indexOf("."))>-1)if(f=e.length-f-1,l=o(new n(r).pow(f).toF(),10),h=e.split("."),c=o(h[1]),h=o(h[0]),g=i(c,l,c.length-l.length,s,t,1&h[h.length-1]),a=g.c,f=g.e){for(;++f;a.unshift(0));e=u(h)+"."+u(a)}else a[0]?h[f=h.length-1]<t-1?(++h[f],e=u(h)):e=new n(u(h),t).plus(R).toS(t):e=u(h);else e=u(o(e));return e}function i(e,t,r,i,s,u){var f,l,c,a,g,p=t.slice(),w=f=t.length,d=e.length,b=e.slice(0,f),N=b.length,O=new n(R),S=O.c=[],E=0,A=h+(O.e=r)+1;for(O.s=i,i=0>A?0:A;N++<f;b.push(0));p.unshift(0);do{for(c=0;s>c;c++){if(f!=(N=b.length))a=f>N?1:-1;else for(g=-1,a=0;++g<f;)if(t[g]!=b[g]){a=t[g]>b[g]?1:-1;break}if(!(0>a))break;for(l=N==f?t:p;N;){if(b[--N]<l[N]){for(g=N;g&&!b[--g];b[g]=s-1);--b[g],b[N]+=s}b[N]-=l[N]}for(;!b[0];b.shift());}S[E++]=a?c:++c,b[0]&&a?b[N]=e[w]||0:b=[e[w]]}while((w++<d||null!=b[0])&&i--);return S[0]||1==E||(--O.e,S.shift()),E>A&&o(O,h,s,u,null!=b[0]),O.e>v?O.c=O.e=null:O.e<m&&(O.c=[O.e=0]),O}function s(e,t,r){var i=t-(e=new n(e)).e,s=e.c;if(!s)return e.toS();for(s.length>++t&&o(e,i,10),i=0==s[0]?i+1:r?t:e.e+i+1;s.length<i;s.push(0));return i=e.e,1==r||2==r&&(--t<i||g>=i)?(e.s<0&&s[0]?"-":"")+(s.length>1?(s.splice(1,0,"."),s.join("")):s[0])+(0>i?"e":"e+")+i:e.toS()}function o(e,n,t,r,i){var s=e.c,o=e.s<0,u=t/2,f=e.e+n+1,l=s[f],c=i||0>f||null!=s[f+1];if(i=4>a?(null!=l||c)&&(0==a||2==a&&!o||3==a&&o):l>u||l==u&&(4==a||c||6==a&&(1&s[f-1]||!n&&r)||7==a&&!o||8==a&&o),1>f||!s[0])return s.length=0,s.push(0),i?(s[0]=1,e.e=-n):e.e=0,e;if(s.length=f--,i)for(--t;++s[f]>t;)s[f]=0,f--||(++e.e,s.unshift(1));for(f=s.length;!s[--f];s.pop());return e}function u(e,t,r){var i=a;return a=r,e=new n(e),e.c&&o(e,t,10),a=i,e}var f,l=1e9,c=1e6,h=20,a=4,g=-7,p=21,m=-l,v=l,w=!0,d=parseInt,b=n.prototype,N="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",O=0,S=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,E=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},R=n(1);n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.fromBuffer=function(e,t){t||(t={});var r={1:"big","-1":"little"}[t.endian]||t.endian||"big",i="auto"===t.size?Math.ceil(e.length):t.size||1;if(e.length%i!==0)throw new RangeError("Buffer length ("+e.length+") must be a multiple of size ("+i+")");for(var s=[],o=0;o<e.length;o+=i){for(var u=[],f=0;i>f;f++)u.push(e[o+("big"===r?f:i-f-1)]);s.push(u.map(function(e){return(16>e?"0":"")+e.toString(16)}).join(""))}return n(s.join(""),16)},n.config=function(){var e,n,r=0,i={},s=arguments,o=s[0],u="config",c=function(e,n,t){return!((f=n>e||e>t)||d(e)!=e&&0!==e)},b=o&&"object"==typeof o?function(){return o.hasOwnProperty(n)?null!=(e=o[n]):void 0}:function(){return s.length>r?null!=(e=s[r++]):void 0};return b(n="DECIMAL_PLACES")&&(c(e,0,l)?h=0|e:t(e,n,u)),i[n]=h,b(n="ROUNDING_MODE")&&(c(e,0,8)?a=0|e:t(e,n,u)),i[n]=a,b(n="EXPONENTIAL_AT")&&(c(e,-l,l)?g=-(p=~~(0>e?-e:+e)):!f&&e&&c(e[0],-l,0)&&c(e[1],0,l)?(g=~~e[0],p=~~e[1]):t(e,n,u,1)),i[n]=[g,p],b(n="RANGE")&&(c(e,-l,l)&&~~e?m=-(v=~~(0>e?-e:+e)):!f&&e&&c(e[0],-l,-1)&&c(e[1],1,l)?(m=~~e[0],v=~~e[1]):t(e,n,u,1,1)),i[n]=[m,v],b(n="ERRORS")&&(e===!!e||1===e||0===e?(f=O=0,d=(w=!!e)?parseInt:parseFloat):t(e,n,u,0,0,1)),i[n]=w,i},b.abs=b.absoluteValue=function(){var e=new n(this);return e.s<0&&(e.s=1),e},b.bitLength=function(){return this.toString(2).length},b.ceil=function(){return u(this,0,2)},b.comparedTo=b.cmp=function(e,t){var r,i=this,s=i.c,o=(O=-O,e=new n(e,t)).c,u=i.s,f=e.s,l=i.e,c=e.e;if(!u||!f)return null;if(r=s&&!s[0],t=o&&!o[0],r||t)return r?t?0:-f:u;if(u!=f)return u;if(r=0>u,t=l==c,!s||!o)return t?0:!s^r?1:-1;if(!t)return l>c^r?1:-1;for(u=-1,f=(l=s.length)<(c=o.length)?l:c;++u<f;)if(s[u]!=o[u])return s[u]>o[u]^r?1:-1;return l==c?0:l>c^r?1:-1},b.dividedBy=b.div=function(e,t){var r=this.c,s=this.e,o=this.s,u=(O=2,e=new n(e,t)).c,f=e.e,l=e.s,c=o==l?1:-1;return(s||r&&r[0])&&(f||u&&u[0])?i(r,u,s-f,c,10):new n(o&&l&&(r?!u||r[0]!=u[0]:u)?r&&0==r[0]||!u?0*c:c/0:0/0)},b.equals=b.eq=function(e,n){return O=3,0===this.cmp(e,n)},b.floor=function(){return u(this,0,3)},b.greaterThan=b.gt=function(e,n){return O=4,this.cmp(e,n)>0},b.greaterThanOrEqualTo=b.gte=function(e,n){return O=5,1==(n=this.cmp(e,n))||0===n},b.isFinite=b.isF=function(){return!!this.c},b.isNaN=function(){return!this.s},b.isNegative=b.isNeg=function(){return this.s<0},b.isZero=b.isZ=function(){return!!this.c&&0==this.c[0]},b.lessThan=b.lt=function(e,n){return O=6,this.cmp(e,n)<0},b.lessThanOrEqualTo=b.lte=b.le=function(e,n){return O=7,-1==(n=this.cmp(e,n))||0===n},b.minus=b.sub=function(e,t){var r,i,s,o,u=this,f=u.s;if(t=(O=8,e=new n(e,t)).s,!f||!t)return new n(0/0);if(f!=t)return e.s=-t,u.plus(e);var l=u.c,c=u.e,h=e.c,g=e.e;if(!c||!g){if(!l||!h)return l?(e.s=-t,e):new n(h?u:0/0);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new n(l[0]?u:3==a?-0:0)}if(l=l.slice(),f=c-g){for(r=(o=0>f)?(f=-f,l):(g=c,h),r.reverse(),t=f;t--;r.push(0));r.reverse()}else for(s=((o=l.length<h.length)?l:h).length,f=t=0;s>t;t++)if(l[t]!=h[t]){o=l[t]<h[t];break}if(o&&(r=l,l=h,h=r,e.s=-e.s),(t=-((s=l.length)-h.length))>0)for(;t--;l[s++]=0);for(t=h.length;t>f;){if(l[--t]<h[t]){for(i=t;i&&!l[--i];l[i]=9);--l[i],l[t]+=10}l[t]-=h[t]}for(;0==l[--s];l.pop());for(;0==l[0];l.shift(),--g);return(m>g||!l[0])&&(l[0]||(e.s=3==a?-1:1),l=[g=0]),e.c=l,e.e=g,e},b.modulo=b.mod=function(e,t){var r=this,i=r.c,s=(O=9,e=new n(e,t)).c,o=r.s,u=e.s;return t=!o||!u||s&&!s[0],t||i&&!i[0]?new n(t?0/0:r):(r.s=e.s=1,t=1==e.cmp(r),r.s=o,e.s=u,t?new n(r):(o=h,u=a,h=0,a=1,r=r.div(e),h=o,a=u,this.minus(r.times(e))))},b.negated=b.neg=function(){var e=new n(this);return e.s=-e.s||null,e},b.plus=b.add=function(e,t){var r,i=this,s=i.s;if(t=(O=10,e=new n(e,t)).s,!s||!t)return new n(0/0);if(s!=t)return e.s=-t,i.minus(e);var o=i.e,u=i.c,f=e.e,l=e.c;if(!o||!f){if(!u||!l)return new n(s/0);if(!u[0]||!l[0])return l[0]?e:new n(u[0]?i:0*s)}if(u=u.slice(),s=o-f){for(r=s>0?(f=o,l):(s=-s,u),r.reverse();s--;r.push(0));r.reverse()}for(u.length-l.length<0&&(r=l,l=u,u=r),s=l.length,t=0;s;t=(u[--s]=u[s]+l[s]+t)/10^0,u[s]%=10);for(t&&(u.unshift(t),++f>v&&(u=f=null)),s=u.length;0==u[--s];u.pop());return e.c=u,e.e=f,e},b.toPower=b.pow=function(e){var r=0*e==0?0|e:e,i=new n(this),s=new n(R);if(((f=-c>e||e>c)&&(r=1*e/0)||d(e)!=e&&0!==e&&!(r=0/0))&&!t(e,"exponent","pow")||!r)return new n(Math.pow(i.toS(),r));for(r=0>r?-r:r;1&r&&(s=s.times(i)),r>>=1,r;)i=i.times(i);return 0>e?R.div(s):s},b.powm=function(e,n){return this.pow(e).mod(n)},b.round=function(e,n){return e=null==e||((f=0>e||e>l)||d(e)!=e)&&!t(e,"decimal places","round")?0:0|e,n=null==n||((f=0>n||n>8)||d(n)!=n&&0!==n)&&!t(n,"mode","round")?a:0|n,u(this,e,n)},b.squareRoot=b.sqrt=function(){var e,t,r,i,s=this,u=s.c,f=s.s,l=s.e,c=h,g=a,p=new n("0.5");if(1!==f||!u||!u[0])return new n(!f||0>f&&(!u||u[0])?0/0:u?s:1/0);for(f=Math.sqrt(s.toS()),a=1,0==f||f==1/0?(e=u.join(""),e.length+l&1||(e+="0"),t=new n(Math.sqrt(e)+""),t.c||(t.c=[1]),t.e=((l+1)/2|0)-(0>l||1&l)):t=new n(e=f.toString()),r=t.e,f=r+(h+=4),3>f&&(f=0),l=f;;)if(i=t,t=p.times(i.plus(s.div(i))),i.c.slice(0,f).join("")===t.c.slice(0,f).join("")){if(u=t.c,f-=e&&t.e<r,9!=u[f]||9!=u[f-1]||9!=u[f-2]||!(9==u[f-3]||e&&4==u[f-3])){if(!(u[l]||u[l-1]||u[l-2]||u[l-3]&&5!=u[l-3]||(u.length>l-2&&(u.length=l-2),t.times(t).eq(s)))){for(;u.length<l-3;)u.push(0);u[l-3]++}return a=g,o(t,h=c,10),t}if(e&&9==u[f-3]&&(i=t.round(c,0),i.times(i).eq(s)))return a=g,h=c,i;h+=4,f+=4,e=""}},b.times=b.mul=function(e,t){var r,i=this,s=i.c,o=(O=11,e=new n(e,t)).c,u=i.e,f=e.e,l=i.s;if(e.s=l==(t=e.s)?1:-1,!((u||s&&s[0])&&(f||o&&o[0])))return new n(!l||!t||s&&!s[0]&&!o||o&&!o[0]&&!s?0/0:s&&o?0*e.s:e.s/0);for(e.e=u+f,(l=s.length)<(t=o.length)&&(r=s,s=o,o=r,f=l,l=t,t=f),f=l+t,r=[];f--;r.push(0));for(u=t-1;u>-1;u--){for(t=0,f=l+u;f>u;t=r[f]+o[u]*s[f-u-1]+t,r[f--]=t%10|0,t=t/10|0);t&&(r[f]=(r[f]+t)%10)}for(t&&++e.e,!r[0]&&r.shift(),f=r.length;!r[--f];r.pop());return e.c=e.e>v?e.e=null:e.e<m?[e.e=0]:r,e},b.toBuffer=function(n){if("string"==typeof n){if("mpint"!==n)return"Unsupported Buffer representation";var t=this.abs(),r=t.toBuffer({size:1,endian:"big"}),i=1===r.length&&0===r[0]?0:r.length;128&r[0]&&i++;var s=new e(4+i);i>0&&r.copy(s,4+(128&r[0]?1:0)),128&r[0]&&(s[4]=0),s[0]=i&255<<24,s[1]=i&255<<16,s[2]=65280&i,s[3]=255&i;var o=this.lt(0);if(o)for(var u=4;u<s.length;u++)s[u]=255-s[u];return s[4]=127&s[4]|(o?128:0),o&&s[s.length-1]++,s}n||(n={});var f={1:"big","-1":"little"}[n.endian]||n.endian||"big",l=this.toString(16);if("-"===l.charAt(0))throw new Error("converting negative numbers to Buffers not supported yet");for(var c="auto"===n.size?Math.ceil(l.length/2):n.size||1,i=Math.ceil(l.length/(2*c))*c,r=new e(i);l.length<2*i;)l="0"+l;var h=l.split(new RegExp("(.{"+2*c+"})")).filter(function(e){return e.length>0});return h.forEach(function(e,n){for(var t=0;c>t;t++){var i=n*c+("big"===f?t:c-t-1);r[i]=parseInt(e.slice(2*t,2*t+2),16)}}),r},b.toExponential=b.toE=function(e){return s(this,(null==e||((f=0>e||e>l)||d(e)!=e&&0!==e)&&!t(e,"decimal places","toE"))&&this.c?this.c.length-1:0|e,1)},b.toFixed=b.toF=function(e){var n,r,i,o=this;return null==e||((f=0>e||e>l)||d(e)!=e&&0!==e)&&!t(e,"decimal places","toF")||(i=o.e+(0|e)),n=g,e=p,g=-(p=1/0),i==r?r=o.toS():(r=s(o,i),o.s<0&&o.c&&(o.c[0]?r.indexOf("-")<0&&(r="-"+r):r=r.replace(/^-/,""))),g=n,p=e,r},b.toFraction=b.toFr=function(e){var r,i,s,o,u,l,c,g=o=new n(R),p=s=new n("0"),m=this,d=m.c,b=v,N=h,S=a,E=new n(R);if(!d)return m.toS();for(c=E.e=d.length-m.e-1,(null==e||(!(O=12,l=new n(e)).s||(f=l.cmp(g)<0||!l.c)||w&&l.e<l.c.length-1)&&!t(e,"max denominator","toFr")||(e=l).cmp(E)>0)&&(e=c>0?E:g),v=1/0,l=new n(d.join("")),h=0,a=1;r=l.div(E),u=o.plus(r.times(p)),1!=u.cmp(e);)o=p,p=u,g=s.plus(r.times(u=g)),s=u,E=l.minus(r.times(u=E)),l=u;return u=e.minus(o).div(p),s=s.plus(u.times(g)),o=o.plus(u.times(p)),s.s=g.s=m.s,h=2*c,a=S,i=g.div(p).minus(m).abs().cmp(s.div(o).minus(m).abs())<1?[g.toS(),p.toS()]:[s.toS(),o.toS()],v=b,h=N,i},b.toPrecision=b.toP=function(e){return null==e||((f=1>e||e>l)||d(e)!=e)&&!t(e,"precision","toP")?this.toS():s(this,0|--e,2)},b.toString=b.toS=function(e){var n,i,o,u=this,l=u.e;if(null===l)i=u.s?"Infinity":"NaN";else{if(e===n&&(g>=l||l>=p))return s(u,u.c.length-1,1);if(i=u.c.join(""),0>l){for(;++l;i="0"+i);i="0."+i}else if(o=i.length,l>0)if(++l>o)for(l-=o;l--;i+="0");else o>l&&(i=i.slice(0,l)+"."+i.slice(l));else if(n=i.charAt(0),o>1)i=n+"."+i.slice(1);else if("0"==n)return n;if(null!=e)if((f=!(e>=2&&65>e))||e!=(0|e)&&w)t(e,"base","toS");else if(i=r(i,0|e,10,u.s),"0"==i)return i}return u.s<0?"-"+i:i},b.toNumber=function(){return parseInt(this.toString(),10)},b.valueOf=function(){return this.toS()},module.exports=n}).call(this,require("buffer").Buffer);
},{"buffer":66}],"bignum":[function(require,module,exports){
module.exports=require('J4nwo8');
},{}],"fugeBw":[function(require,module,exports){
(function(t){"use strict";function r(){this.writable=!0,this.buffer=null}var e=require("events"),n=require("util"),o={};module.exports.Buffer=t;var i=function(r){return r instanceof t||r instanceof Uint8Array},f=function(t){return function(){var r=this;if(i(r));else{if(!i(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(i(r));else{if(!i(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||i(e))return t.apply(r,arguments);throw new Error("Second argument must be a string or a buffer.")}};o.clear=f(function(){for(var t=0;t<this.length;t++)this[t]=0;return this}),o.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}),o.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,o=0;o<t.length;o++){var i=this[e+o],f=t[o];if("string"==typeof f&&(f=f.charCodeAt(0)),i!==f){n=!1;break}}if(n)return e}return-1}),o.equals=u(function(t){return 0===o.compare(this,t)}),o.compare=u(function(t){var r=this,e=r.length,n=t.length;if(e!==n)return e>n?1:-1;for(var o=0;e>o;o++){var i=r[o],f=t[o];if("string"==typeof f&&(f=f.charCodeAt(0)),i!==f)return i>f?1:-1}return 0}),o.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),o=0,e=0;e<arguments.length;e++)for(var i=0;i<arguments[e].length;i++)n[o++]="string"==typeof arguments[e][i]?arguments[e][i].charCodeAt(0):arguments[e][i];return n},o.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}),o.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&&console.log("strange h ="+e),t+=e}return t}),o.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 o=String.fromCharCode(this[2*n]),i=String.fromCharCode(this[2*n+1]);e[n]=parseInt(o+i,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 i=r[e];for(var f in o)i[f]=o[f];i!==exports&&(i.concat=function(){var t=[this].concat(Array.prototype.slice.call(arguments));return o.concat.apply(o,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=o.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":66,"events":75,"util":98}],"buffertools":[function(require,module,exports){
module.exports=require('fugeBw');
},{}],65:[function(require,module,exports){
},{}],66:[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 a;Buffer._useTypedArrays?a=augment(new Uint8Array(i)):(a=this,a.length=i,a._isBuffer=!0);var s;if(Buffer._useTypedArrays&&"function"==typeof Uint8Array&&e instanceof Uint8Array)a._set(e);else if(isArrayish(e))for(s=0;i>s;s++)a[s]=Buffer.isBuffer(e)?e.readUInt8(s):e[s];else if("string"===n)a.write(e,0,t);else if("number"===n&&!Buffer._useTypedArrays&&!r)for(s=0;i>s;s++)a[s]=0;return a}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 a=t.length;assert(a%2===0,"Invalid hex string"),n>a/2&&(n=a/2);for(var s=0;n>s;s++){var o=parseInt(t.substr(2*s,2),16);assert(!isNaN(o),"Invalid hex string"),e[r+s]=o}return Buffer._charsWritten=2*s,s}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 a=t;r>a;a++)e[a]<=127?(n+=decodeUtf8Char(i)+String.fromCharCode(e[a]),i=""):i+="%"+e[a].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="",a=t;r>a;a++)i+=toHex(e[a]);return i}function _utf16leSlice(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+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 a;return r?(a=e[t],i>t+1&&(a|=e[t+1]<<8)):(a=e[t]<<8,i>t+1&&(a|=e[t+1])),a}}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 a;return r?(i>t+2&&(a=e[t+2]<<16),i>t+1&&(a|=e[t+1]<<8),a|=e[t],i>t+3&&(a+=e[t+3]<<24>>>0)):(i>t+1&&(a=e[t+1]<<16),i>t+2&&(a|=e[t+2]<<8),i>t+3&&(a|=e[t+3]),a+=e[t]<<24>>>0),a}}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 a=_readUInt16(e,t,r,!0),s=32768&a;return s?-1*(65535-a+1):a}}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 a=_readUInt32(e,t,r,!0),s=2147483648&a;return s?-1*(4294967295-a+1):a}}function _readFloat(e,t,r,n){return n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(t+3<e.length,"Trying to read beyond buffer length")),ieee754.read(e,t,r,23,4)}function _readDouble(e,t,r,n){return n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(t+7<e.length,"Trying to read beyond buffer length")),ieee754.read(e,t,r,52,8)}function _writeUInt16(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+1<e.length,"trying to write beyond buffer length"),verifuint(t,65535));var a=e.length;if(!(r>=a))for(var s=0,o=Math.min(a-r,2);o>s;s++)e[r+s]=(t&255<<8*(n?s:1-s))>>>8*(n?s:1-s)}function _writeUInt32(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3<e.length,"trying to write beyond buffer length"),verifuint(t,4294967295));var a=e.length;if(!(r>=a))for(var s=0,o=Math.min(a-r,4);o>s;s++)e[r+s]=t>>>8*(n?s:3-s)&255}function _writeInt16(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+1<e.length,"Trying to write beyond buffer length"),verifsint(t,32767,-32768));var a=e.length;r>=a||(t>=0?_writeUInt16(e,t,r,n,i):_writeUInt16(e,65535+t+1,r,n,i))}function _writeInt32(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3<e.length,"Trying to write beyond buffer length"),verifsint(t,2147483647,-2147483648));var a=e.length;r>=a||(t>=0?_writeUInt32(e,t,r,n,i):_writeUInt32(e,4294967295+t+1,r,n,i))}function _writeFloat(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3<e.length,"Trying to write beyond buffer length"),verifIEEE754(t,3.4028234663852886e38,-3.4028234663852886e38));var a=e.length;r>=a||ieee754.write(e,t,r,n,23,4)}function _writeDouble(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+7<e.length,"Trying to write beyond buffer length"),verifIEEE754(t,1.7976931348623157e308,-1.7976931348623157e308));var a=e.length;r>=a||ieee754.write(e,t,r,n,52,8)}function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function augment(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=BP.get,e.set=BP.set,e.write=BP.write,e.toString=BP.toString,e.toLocaleString=BP.toString,e.toJSON=BP.toJSON,e.copy=BP.copy,e.slice=BP.slice,e.readUInt8=BP.readUInt8,e.readUInt16LE=BP.readUInt16LE,e.readUInt16BE=BP.readUInt16BE,e.readUInt32LE=BP.readUInt32LE,e.readUInt32BE=BP.readUInt32BE,e.readInt8=BP.readInt8,e.readInt16LE=BP.readInt16LE,e.readInt16BE=BP.readInt16BE,e.readInt32LE=BP.readInt32LE,e.readInt32BE=BP.readInt32BE,e.readFloatLE=BP.readFloatLE,e.readFloatBE=BP.readFloatBE,e.readDoubleLE=BP.readDoubleLE,e.readDoubleBE=BP.readDoubleBE,e.writeUInt8=BP.writeUInt8,e.writeUInt16LE=BP.writeUInt16LE,e.writeUInt16BE=BP.writeUInt16BE,e.writeUInt32LE=BP.writeUInt32LE,e.writeUInt32BE=BP.writeUInt32BE,e.writeInt8=BP.writeInt8,e.writeInt16LE=BP.writeInt16LE,e.writeInt16BE=BP.writeInt16BE,e.writeInt32LE=BP.writeInt32LE,e.writeInt32BE=BP.writeInt32BE,e.writeFloatLE=BP.writeFloatLE,e.writeFloatBE=BP.writeFloatBE,e.writeDoubleLE=BP.writeDoubleLE,e.writeDoubleBE=BP.writeDoubleBE,e.fill=BP.fill,e.inspect=BP.inspect,e.toArrayBuffer=BP.toArrayBuffer,e}function clamp(e,t,r){return"number"!=typeof e?r:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function coerce(e){return e=~~Math.ceil(+e),0>e?0:e}function isArray(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function isArrayish(e){return isArray(e)||Buffer.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function toHex(e){return 16>e?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(127>=n)t.push(e.charCodeAt(r));else{var i=r;n>=55296&&57343>=n&&r++;for(var a=encodeURIComponent(e.slice(i,r+1)).substr(1).split("%"),s=0;s<a.length;s++)t.push(parseInt(a[s],16))}}return t}function asciiToBytes(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t}function utf16leToBytes(e){for(var t,r,n,i=[],a=0;a<e.length;a++)t=e.charCodeAt(a),r=t>>8,n=t%256,i.push(n),i.push(r);return i}function base64ToBytes(e){return base64.toByteArray(e)}function blitBuffer(e,t,r,n){for(var i=0;n>i&&!(i+r>=t.length||i>=e.length);i++)t[i+r]=e[i];return i}function decodeUtf8Char(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function verifuint(e,t){assert("number"==typeof e,"cannot write a non-number as a number"),assert(e>=0,"specified a negative value for writing an unsigned value"),assert(t>=e,"value is larger than maximum value for type"),assert(Math.floor(e)===e,"value has a fractional component")}function verifsint(e,t,r){assert("number"==typeof e,"cannot write a non-number as a number"),assert(t>=e,"value larger than maximum allowed value"),assert(e>=r,"value smaller than minimum allowed value"),assert(Math.floor(e)===e,"value has a fractional component")}function verifIEEE754(e,t,r){assert("number"==typeof e,"cannot write a non-number as a number"),assert(t>=e,"value larger than maximum allowed value"),assert(e>=r,"value smaller than minimum allowed value")}function assert(e,t){if(!e)throw new Error(t||"Failed assertion")}var base64=require("base64-js"),ieee754=require("ieee754");exports.Buffer=Buffer,exports.SlowBuffer=Buffer,exports.INSPECT_MAX_BYTES=50,Buffer.poolSize=8192,Buffer._useTypedArrays=function(){if("function"!=typeof Uint8Array||"function"!=typeof ArrayBuffer)return!1;try{var e=new Uint8Array(0);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(t){return!1}}(),Buffer.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},Buffer.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=utf8ToBytes(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=base64ToBytes(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},Buffer.concat=function(e,t){if(assert(isArray(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new Buffer(0);if(1===e.length)return e[0];var r;if("number"!=typeof t)for(t=0,r=0;r<e.length;r++)t+=e[r].length;var n=new Buffer(t),i=0;for(r=0;r<e.length;r++){var a=e[r];a.copy(n,i),i+=a.length}return n},Buffer.prototype.write=function(e,t,r,n){if(isFinite(t))isFinite(r)||(n=r,r=void 0);else{var i=n;n=t,t=r,r=i}t=Number(t)||0;var a=this.length-t;r?(r=Number(r),r>a&&(r=a)):r=a,n=String(n||"utf8").toLowerCase();var s;switch(n){case"hex":s=_hexWrite(this,e,t,r);break;case"utf8":case"utf-8":s=_utf8Write(this,e,t,r);break;case"ascii":s=_asciiWrite(this,e,t,r);break;case"binary":s=_binaryWrite(this,e,t,r);break;case"base64":s=_base64Write(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":s=_utf16leWrite(this,e,t,r);break;default:throw new Error("Unknown encoding")}return s},Buffer.prototype.toString=function(e,t,r){var n=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,r=void 0!==r?Number(r):r=n.length,r===t)return"";var i;switch(e){case"hex":i=_hexSlice(n,t,r);break;case"utf8":case"utf-8":i=_utf8Slice(n,t,r);break;case"ascii":i=_asciiSlice(n,t,r);break;case"binary":i=_binarySlice(n,t,r);break;case"base64":i=_base64Slice(n,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=_utf16leSlice(n,t,r);break;default:throw new Error("Unknown encoding")}return i},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Buffer.prototype.copy=function(e,t,r,n){var i=this;if(r||(r=0),n||0===n||(n=this.length),t||(t=0),n!==r&&0!==e.length&&0!==i.length){assert(n>=r,"sourceEnd < sourceStart"),assert(t>=0&&t<e.length,"targetStart out of bounds"),assert(r>=0&&r<i.length,"sourceStart out of bounds"),assert(n>=0&&n<=i.length,"sourceEnd out of bounds"),n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);for(var a=0;n-r>a;a++)e[a+t]=this[a+r]}},Buffer.prototype.slice=function(e,t){var r=this.length;if(e=clamp(e,r,0),t=clamp(t,r,r),Buffer._useTypedArrays)return augment(this.subarray(e,t));for(var n=t-e,i=new Buffer(n,void 0,!0),a=0;n>a;a++)i[a]=this[a+e];return i},Buffer.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},Buffer.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},Buffer.prototype.readUInt8=function(e,t){return t||(assert(void 0!==e&&null!==e,"missing offset"),assert(e<this.length,"Trying to read beyond buffer length")),e>=this.length?void 0:this[e]},Buffer.prototype.readUInt16LE=function(e,t){return _readUInt16(this,e,!0,t)},Buffer.prototype.readUInt16BE=function(e,t){return _readUInt16(this,e,!1,t)},Buffer.prototype.readUInt32LE=function(e,t){return _readUInt32(this,e,!0,t)},Buffer.prototype.readUInt32BE=function(e,t){return _readUInt32(this,e,!1,t)},Buffer.prototype.readInt8=function(e,t){if(t||(assert(void 0!==e&&null!==e,"missing offset"),assert(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length)){var r=128&this[e];return r?-1*(255-this[e]+1):this[e]}},Buffer.prototype.readInt16LE=function(e,t){return _readInt16(this,e,!0,t)},Buffer.prototype.readInt16BE=function(e,t){return _readInt16(this,e,!1,t)},Buffer.prototype.readInt32LE=function(e,t){return _readInt32(this,e,!0,t)},Buffer.prototype.readInt32BE=function(e,t){return _readInt32(this,e,!1,t)},Buffer.prototype.readFloatLE=function(e,t){return _readFloat(this,e,!0,t)},Buffer.prototype.readFloatBE=function(e,t){return _readFloat(this,e,!1,t)},Buffer.prototype.readDoubleLE=function(e,t){return _readDouble(this,e,!0,t)},Buffer.prototype.readDoubleBE=function(e,t){return _readDouble(this,e,!1,t)},Buffer.prototype.writeUInt8=function(e,t,r){r||(assert(void 0!==e&&null!==e,"missing value"),assert(void 0!==t&&null!==t,"missing offset"),assert(t<this.length,"trying to write beyond buffer length"),verifuint(e,255)),t>=this.length||(this[t]=e)},Buffer.prototype.writeUInt16LE=function(e,t,r){_writeUInt16(this,e,t,!0,r)},Buffer.prototype.writeUInt16BE=function(e,t,r){_writeUInt16(this,e,t,!1,r)},Buffer.prototype.writeUInt32LE=function(e,t,r){_writeUInt32(this,e,t,!0,r)},Buffer.prototype.writeUInt32BE=function(e,t,r){_writeUInt32(this,e,t,!1,r)},Buffer.prototype.writeInt8=function(e,t,r){r||(assert(void 0!==e&&null!==e,"missing value"),assert(void 0!==t&&null!==t,"missing offset"),assert(t<this.length,"Trying to write beyond buffer length"),verifsint(e,127,-128)),t>=this.length||(e>=0?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},Buffer.prototype.writeInt16LE=function(e,t,r){_writeInt16(this,e,t,!0,r)},Buffer.prototype.writeInt16BE=function(e,t,r){_writeInt16(this,e,t,!1,r)},Buffer.prototype.writeInt32LE=function(e,t,r){_writeInt32(this,e,t,!0,r)},Buffer.prototype.writeInt32BE=function(e,t,r){_writeInt32(this,e,t,!1,r)},Buffer.prototype.writeFloatLE=function(e,t,r){_writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){_writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){_writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){_writeDouble(this,e,t,!1,r)},Buffer.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),assert("number"==typeof e&&!isNaN(e),"value is not a number"),assert(r>=t,"end < start"),r!==t&&0!==this.length){assert(t>=0&&t<this.length,"start out of bounds"),assert(r>=0&&r<=this.length,"end out of bounds");for(var n=t;r>n;n++)this[n]=e}},Buffer.prototype.inspect=function(){for(var e=[],t=this.length,r=0;t>r;r++)if(e[r]=toHex(this[r]),r===exports.INSPECT_MAX_BYTES){e[r+1]="...";break}return"<Buffer "+e.join(" ")+">"},Buffer.prototype.toArrayBuffer=function(){if("function"==typeof Uint8Array){if(Buffer._useTypedArrays)return new Buffer(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;r>t;t+=1)e[t]=this[t];return e.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var BP=Buffer.prototype;
},{"base64-js":67,"ieee754":68}],67:[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}();
},{}],68:[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};
},{}],69:[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":66}],70:[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":71,"./rng":72,"./sha":73,"./sha256":74,"buffer":66}],71:[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":69}],72:[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}();
},{}],73:[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":69}],74:[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":69}],75:[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};
},{}],76:[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":77,"events":75,"url":96}],77:[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":78,"Base64":79,"inherits":81,"stream":89}],78:[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":89,"util":98}],79:[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})}();
},{}],80:[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":76}],81:[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};
},{}],82:[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")};
},{}],83:[function(require,module,exports){
(function(r){function t(r,t){for(var e=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(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}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(r){return n.exec(r).slice(1)};exports.resolve=function(){for(var n="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var i=s>=0?arguments[s]:r.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(n=i+"/"+n,o="/"===i.charAt(0))}return n=t(e(n.split("/"),function(r){return!!r}),!o).join("/"),(o?"/":"")+n||"."},exports.normalize=function(r){var n=exports.isAbsolute(r),o="/"===s(r,-1);return r=t(e(r.split("/"),function(r){return!!r}),!n).join("/"),r||n||(r="."),r&&o&&(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("/")),o=e(t.split("/")),s=Math.min(n.length,o.length),i=s,u=0;s>u;u++)if(n[u]!==o[u]){i=u;break}for(var l=[],u=i;u<n.length;u++)l.push("..");return l=l.concat(o.slice(i)),l.join("/")},exports.sep="/",exports.delimiter=":",exports.dirname=function(r){var t=o(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=o(r)[2];return t&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),e},exports.extname=function(r){return o(r)[3]};var s="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("/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"));
},{"/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":82}],84:[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:{});
},{}],85:[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)};
},{}],86:[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};
},{}],87:[function(require,module,exports){
"use strict";exports.decode=exports.parse=require("./decode"),exports.encode=exports.stringify=require("./encode");
},{"./decode":85,"./encode":86}],88:[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":92,"./writable.js":94,"inherits":81,"process/browser.js":90}],89:[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":88,"./passthrough.js":91,"./readable.js":92,"./transform.js":93,"./writable.js":94,"events":75,"inherits":81}],90:[function(require,module,exports){
module.exports=require(82)
},{}],91:[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":93,"inherits":81}],92:[function(require,module,exports){
(function(e){function t(e){e=e||{};var t=e.highWaterMark;this.highWaterMark=t||0===t?t:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!e.objectMode,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(_||(_=require("string_decoder").StringDecoder),this.decoder=new _(e.encoding),this.encoding=e.encoding)}function n(e){return this instanceof n?(this._readableState=new t(e,this),this.readable=!0,void S.call(this)):new n(e)}function r(e,t,n,r,a){var o=d(t,n);if(o)e.emit("error",o);else if(null===n||void 0===n)t.reading=!1,t.ended||s(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!a){var u=new Error("stream.push() after EOF");e.emit("error",u)}else if(t.endEmitted&&a){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else!t.decoder||a||r||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,a?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&l(e),h(e,t);else a||(t.reading=!1);return i(t)}function i(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function a(e){if(e>=L)e=L;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function o(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||null===e?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function d(e,t){var n=null;return R.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function s(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?l(e):v(e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?E(function(){u(e)}):u(e))}function u(e){e.emit("readable")}function h(e,t){t.readingMore||(t.readingMore=!0,E(function(){f(e,t)}))}function f(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function p(e){return function(){var t=e._readableState;t.awaitDrain--,0===t.awaitDrain&&c(e)}}function c(e){function t(e){var t=e.write(n);!1===t&&r.awaitDrain++}var n,r=e._readableState;for(r.awaitDrain=0;r.pipesCount&&null!==(n=e.read());)if(1===r.pipesCount?t(r.pipes,0,null):w(r.pipes,t),e.emit("data",n),r.awaitDrain>0)return;return 0===r.pipesCount?(r.flowing=!1,void(M.listenerCount(e,"data")>0&&b(e))):void(r.ranOut=!0)}function g(){this._readableState.ranOut&&(this._readableState.ranOut=!1,c(this))}function b(e,t){var n=e._readableState;if(n.flowing)throw new Error("Cannot switch to old mode now.");var r=t||!1,i=!1;e.readable=!0,e.pipe=S.prototype.pipe,e.on=e.addListener=S.prototype.on,e.on("readable",function(){i=!0;for(var t;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(i=!1,e._readableState.needReadable=!0)}),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,i?E(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function m(e,t){var n,r=t.buffer,i=t.length,a=!!t.decoder,o=!!t.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(o)n=r.shift();else if(!e||e>=i)n=a?r.join(""):R.concat(r,i),r.length=0;else if(e<r[0].length){var d=r[0];n=d.slice(0,e),r[0]=d.slice(e)}else if(e===r[0].length)n=r.shift();else{n=a?"":new R(e);for(var s=0,l=0,u=r.length;u>l&&e>s;l++){var d=r[0],h=Math.min(e-s,d.length);a?n+=d.slice(0,h):d.copy(n,s,0,h),h<d.length?r[0]=d.slice(h):r.shift(),s+=h}}return n}function v(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,E(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function w(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function y(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}module.exports=n,n.ReadableState=t;var _,M=require("events").EventEmitter,S=require("./index.js"),R=require("buffer").Buffer,E=require("process/browser.js").nextTick,C=require("inherits");C(n,S),n.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new R(e,t),t="")),r(this,n,e,t,!1)},n.prototype.unshift=function(e){var t=this._readableState;return r(this,t,e,"",!0)},n.prototype.setEncoding=function(e){_||(_=require("string_decoder").StringDecoder),this._readableState.decoder=new _(e),this._readableState.encoding=e};var L=8388608;n.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l(this),null;if(e=o(e,t),0===e&&t.ended)return 0===t.length&&v(this),null;var r=t.needReadable;t.length-e<=t.highWaterMark&&(r=!0),(t.ended||t.reading)&&(r=!1),r&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=o(n,t));var i;return i=e>0?m(e,t):null,null===i&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&v(this),i},n.prototype._read=function(){this.emit("error",new Error("not implemented"))},n.prototype.pipe=function(t,n){function r(e){e===u&&a()}function i(){t.end()}function a(){t.removeListener("close",d),t.removeListener("finish",s),t.removeListener("drain",m),t.removeListener("error",o),t.removeListener("unpipe",r),u.removeListener("end",i),u.removeListener("end",a),(!t._writableState||t._writableState.needDrain)&&m()}function o(e){l(),0===v&&0===M.listenerCount(t,"error")&&t.emit("error",e)}function d(){t.removeListener("finish",s),l()}function s(){t.removeListener("close",d),l()}function l(){u.unpipe(t)}var u=this,h=this._readableState;switch(h.pipesCount){case 0:h.pipes=t;break;case 1:h.pipes=[h.pipes,t];break;default:h.pipes.push(t)}h.pipesCount+=1;var f=(!n||n.end!==!1)&&t!==e.stdout&&t!==e.stderr,b=f?i:a;h.endEmitted?E(b):u.once("end",b),t.on("unpipe",r);var m=p(u);t.on("drain",m);var v=M.listenerCount(t,"error");return t.once("error",o),t.once("close",d),t.once("finish",s),t.emit("pipe",u),h.flowing||(this.on("readable",g),h.flowing=!0,E(function(){c(u)})),t},n.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",g),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",g),t.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var i=y(t.pipes,e);return-1===i?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},n.prototype.on=function(e,t){var n=S.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||b(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&l(this,r):this.read(0))}return n},n.prototype.addListener=n.prototype.on,n.prototype.resume=function(){b(this),this.read(0),this.emit("resume")},n.prototype.pause=function(){b(this,!0),this.emit("pause")},n.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(t.decoder&&(i=t.decoder.write(i)),i&&(t.objectMode||i.length)){var a=r.push(i);a||(n=!0,e.pause())}});for(var i in e)"function"==typeof e[i]&&"undefined"==typeof this[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));var a=["error","close","destroy","pause","resume"];return w(a,function(t){e.on(t,function(e){return r.emit.apply(r,t,e)})}),r._read=function(){n&&(n=!1,e.resume())},r},n._fromList=m}).call(this,require("/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"));
},{"./index.js":89,"/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":82,"buffer":66,"events":75,"inherits":81,"process/browser.js":90,"string_decoder":95}],93:[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":88,"inherits":81}],94:[function(require,module,exports){
function WriteReq(e,t,r){this.chunk=e,this.encoding=t,this.callback=r}function WritableState(e,t){e=e||{};var r=e.highWaterMark;this.highWaterMark=r||0===r?r:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){onwrite(t,e)},this.writecb=null,this.writelen=0,this.buffer=[]}function Writable(e){return this instanceof Writable||this instanceof Stream.Duplex?(this._writableState=new WritableState(e,this),this.writable=!0,void Stream.call(this)):new Writable(e)}function writeAfterEnd(e,t,r){var i=new Error("write after end");e.emit("error",i),setImmediate(function(){r(i)})}function validChunk(e,t,r,i){var n=!0;if(!Buffer.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==r&&!t.objectMode){var f=new TypeError("Invalid non-string/buffer chunk");e.emit("error",f),setImmediate(function(){i(f)}),n=!1}return n}function decodeChunk(e,t,r){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new Buffer(t,r)),t}function writeOrBuffer(e,t,r,i,n){r=decodeChunk(t,r,i);var f=t.objectMode?1:r.length;t.length+=f;var o=t.length<t.highWaterMark;return t.needDrain=!o,t.writing?t.buffer.push(new WriteReq(r,i,n)):doWrite(e,t,f,r,i,n),o}function doWrite(e,t,r,i,n,f){t.writelen=r,t.writecb=f,t.writing=!0,t.sync=!0,e._write(i,n,t.onwrite),t.sync=!1}function onwriteError(e,t,r,i,n){r?setImmediate(function(){n(i)}):n(i),e.emit("error",i)}function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function onwrite(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(onwriteStateUpdate(r),t)onwriteError(e,r,i,t,n);else{var f=needFinish(e,r);f||r.bufferProcessing||!r.buffer.length||clearBuffer(e,r),i?setImmediate(function(){afterWrite(e,r,f,n)}):afterWrite(e,r,f,n)}}function afterWrite(e,t,r,i){r||onwriteDrain(e,t),i(),r&&finishMaybe(e,t)}function onwriteDrain(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function clearBuffer(e,t){t.bufferProcessing=!0;for(var r=0;r<t.buffer.length;r++){var i=t.buffer[r],n=i.chunk,f=i.encoding,o=i.callback,a=t.objectMode?1:n.length;if(doWrite(e,t,a,n,f,o),t.writing){r++;break}}t.bufferProcessing=!1,r<t.buffer.length?t.buffer=t.buffer.slice(r):t.buffer.length=0}function needFinish(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function finishMaybe(e,t){var r=needFinish(e,t);return r&&(t.finished=!0,e.emit("finish")),r}function endWritable(e,t,r){t.ending=!0,finishMaybe(e,t),r&&(t.finished?setImmediate(r):e.once("finish",r)),t.ended=!0}module.exports=Writable,Writable.WritableState=WritableState;var isUint8Array="undefined"!=typeof Uint8Array?function(e){return e instanceof Uint8Array}:function(e){return e&&e.constructor&&"Uint8Array"===e.constructor.name},isArrayBuffer="undefined"!=typeof ArrayBuffer?function(e){return e instanceof ArrayBuffer}:function(e){return e&&e.constructor&&"ArrayBuffer"===e.constructor.name},inherits=require("inherits"),Stream=require("./index.js"),setImmediate=require("process/browser.js").nextTick,Buffer=require("buffer").Buffer;inherits(Writable,Stream),Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},Writable.prototype.write=function(e,t,r){var i=this._writableState,n=!1;return"function"==typeof t&&(r=t,t=null),!Buffer.isBuffer(e)&&isUint8Array(e)&&(e=new Buffer(e)),isArrayBuffer(e)&&"undefined"!=typeof Uint8Array&&(e=new Buffer(new Uint8Array(e))),Buffer.isBuffer(e)?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=function(){}),i.ended?writeAfterEnd(this,i,r):validChunk(this,i,e,r)&&(n=writeOrBuffer(this,i,e,t,r)),n},Writable.prototype._write=function(e,t,r){r(new Error("not implemented"))},Writable.prototype.end=function(e,t,r){var i=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),"undefined"!=typeof e&&null!==e&&this.write(e,t),i.ending||i.finished||endWritable(this,i,r)};
},{"./index.js":89,"buffer":66,"inherits":81,"process/browser.js":90}],95:[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":66}],96:[function(require,module,exports){
!function(){"use strict";function t(t,h,a){if(t&&"object"==typeof t&&t.href)return t;if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n={},p=t;p=p.trim();var i=r.exec(p);if(i){i=i[0];var q=i.toLowerCase();n.protocol=q,p=p.substr(i.length)}if(a||i||p.match(/^\/\/[^@\/]+@[^@\/]+/)){var j="//"===p.substr(0,2);!j||i&&g[i]||(p=p.substr(2),n.slashes=!0)}if(!g[i]&&(j||i&&!y[i])){var x=p.indexOf("@");if(-1!==x){for(var A=p.slice(0,x),O=!0,z=0,C=m.length;C>z;z++)if(-1!==A.indexOf(m[z])){O=!1;break}O&&(n.auth=decodeURIComponent(A),p=p.substr(x+1))}for(var Z=-1,z=0,C=f.length;C>z;z++){var k=p.indexOf(f[z]);-1!==k&&(0>Z||Z>k)&&(Z=k)}-1!==Z?(n.host=p.substr(0,Z),p=p.substr(Z)):(n.host=p,p="");for(var w=s(n.host),I=Object.keys(w),z=0,C=I.length;C>z;z++){var R=I[z];n[R]=w[R]}n.hostname=n.hostname||"";var U="["===n.hostname[0]&&"]"===n.hostname[n.hostname.length-1];if(n.hostname.length>l)n.hostname="";else if(!U)for(var $=n.hostname.split(/\./),z=0,C=$.length;C>z;z++){var _=$[z];if(_&&!_.match(u)){for(var L="",E=0,P=_.length;P>E;E++)L+=_.charCodeAt(E)>127?"x":_[E];if(!L.match(u)){var T=$.slice(0,z),B=$.slice(z+1),D=_.match(v);D&&(T.push(D[1]),B.unshift(D[2])),B.length&&(p="/"+B.join(".")+p),n.hostname=T.join(".");break}}}if(n.hostname=n.hostname.toLowerCase(),!U){for(var F=n.hostname.split("."),G=[],z=0;z<F.length;++z){var H=F[z];G.push(H.match(/[^A-Za-z0-9_-]/)?"xn--"+o.encode(H):H)}n.hostname=G.join(".")}n.host=(n.hostname||"")+(n.port?":"+n.port:""),n.href+=n.host,U&&(n.hostname=n.hostname.substr(1,n.hostname.length-2),"/"!==p[0]&&(p="/"+p))}if(!d[q])for(var z=0,C=c.length;C>z;z++){var J=c[z],K=encodeURIComponent(J);K===J&&(K=escape(J)),p=p.split(J).join(K)}var M=p.indexOf("#");-1!==M&&(n.hash=p.substr(M),p=p.slice(0,M));var N=p.indexOf("?");return-1!==N?(n.search=p.substr(N),n.query=p.substr(N+1),h&&(n.query=b.parse(n.query)),p=p.slice(0,N)):h&&(n.search="",n.query={}),p&&(n.pathname=p),y[i]&&n.hostname&&!n.pathname&&(n.pathname="/"),(n.pathname||n.search)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=e(n),n}function e(e){"string"==typeof e&&(e=t(e));var h=e.auth||"";h&&(h=encodeURIComponent(h),h=h.replace(/%3A/i,":"),h+="@");var a=e.protocol||"",s=e.pathname||"",o=e.hash||"",r=!1,n="";void 0!==e.host?r=h+e.host:void 0!==e.hostname&&(r=h+(-1===e.hostname.indexOf(":")?e.hostname:"["+e.hostname+"]"),e.port&&(r+=":"+e.port)),e.query&&"object"==typeof e.query&&Object.keys(e.query).length&&(n=b.stringify(e.query));var p=e.search||n&&"?"+n||"";return a&&":"!==a.substr(-1)&&(a+=":"),e.slashes||(!a||y[a])&&r!==!1?(r="//"+(r||""),s&&"/"!==s.charAt(0)&&(s="/"+s)):r||(r=""),o&&"#"!==o.charAt(0)&&(o="#"+o),p&&"?"!==p.charAt(0)&&(p="?"+p),a+r+s+p+o}function h(t,h){return e(a(t,h))}function a(h,a){if(!h)return a;if(h=t(e(h),!1,!0),a=t(e(a),!1,!0),h.hash=a.hash,""===a.href)return h.href=e(h),h;if(a.slashes&&!a.protocol)return a.protocol=h.protocol,y[a.protocol]&&a.hostname&&!a.pathname&&(a.path=a.pathname="/"),a.href=e(a),a;if(a.protocol&&a.protocol!==h.protocol){if(!y[a.protocol])return a.href=e(a),a;if(h.protocol=a.protocol,!a.host&&!g[a.protocol]){for(var s=(a.pathname||"").split("/");s.length&&!(a.host=s.shift()););a.host||(a.host=""),a.hostname||(a.hostname=""),""!==s[0]&&s.unshift(""),s.length<2&&s.unshift(""),a.pathname=s.join("/")}return h.pathname=a.pathname,h.search=a.search,h.query=a.query,h.host=a.host||"",h.auth=a.auth,h.hostname=a.hostname||a.host,h.port=a.port,(void 0!==h.pathname||void 0!==h.search)&&(h.path=(h.pathname?h.pathname:"")+(h.search?h.search:"")),h.slashes=h.slashes||a.slashes,h.href=e(h),h}var o=h.pathname&&"/"===h.pathname.charAt(0),r=void 0!==a.host||a.pathname&&"/"===a.pathname.charAt(0),n=r||o||h.host&&a.pathname,p=n,i=h.pathname&&h.pathname.split("/")||[],s=a.pathname&&a.pathname.split("/")||[],c=h.protocol&&!y[h.protocol];if(c&&(delete h.hostname,delete h.port,h.host&&(""===i[0]?i[0]=h.host:i.unshift(h.host)),delete h.host,a.protocol&&(delete a.hostname,delete a.port,a.host&&(""===s[0]?s[0]=a.host:s.unshift(a.host)),delete a.host),n=n&&(""===s[0]||""===i[0])),r)h.host=a.host||""===a.host?a.host:h.host,h.hostname=a.hostname||""===a.hostname?a.hostname:h.hostname,h.search=a.search,h.query=a.query,i=s;else if(s.length)i||(i=[]),i.pop(),i=i.concat(s),h.search=a.search,h.query=a.query;else if("search"in a){if(c){h.hostname=h.host=i.shift();var f=h.host&&h.host.indexOf("@")>0?h.host.split("@"):!1;f&&(h.auth=f.shift(),h.host=h.hostname=f.shift())}return h.search=a.search,h.query=a.query,(void 0!==h.pathname||void 0!==h.search)&&(h.path=(h.pathname?h.pathname:"")+(h.search?h.search:"")),h.href=e(h),h}if(!i.length)return delete h.pathname,h.search?delete h.path:h.path="/"+h.search,h.href=e(h),h;for(var m=i.slice(-1)[0],l=(h.host||a.host)&&("."===m||".."===m)||""===m,u=0,v=i.length;v>=0;v--)m=i[v],"."==m?i.splice(v,1):".."===m?(i.splice(v,1),u++):u&&(i.splice(v,1),u--);if(!n&&!p)for(;u--;u)i.unshift("..");!n||""===i[0]||i[0]&&"/"===i[0].charAt(0)||i.unshift(""),l&&"/"!==i.join("/").substr(-1)&&i.push("");var d=""===i[0]||i[0]&&"/"===i[0].charAt(0);if(c){h.hostname=h.host=d?"":i.length?i.shift():"";var f=h.host&&h.host.indexOf("@")>0?h.host.split("@"):!1;f&&(h.auth=f.shift(),h.host=h.hostname=f.shift())}return n=n||h.host&&i.length,n&&!d&&i.unshift(""),h.pathname=i.join("/"),(void 0!==h.pathname||void 0!==h.search)&&(h.path=(h.pathname?h.pathname:"")+(h.search?h.search:"")),h.auth=a.auth||h.auth,h.slashes=h.slashes||a.slashes,h.href=e(h),h}function s(t){var e={},h=n.exec(t);return h&&(h=h[0],":"!==h&&(e.port=h.substr(1)),t=t.substr(0,t.length-h.length)),t&&(e.hostname=t),e}var o=require("punycode");exports.parse=t,exports.resolve=h,exports.resolveObject=a,exports.format=e;var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,p=["<",">",'"',"`"," ","\r","\n"," "],i=["{","}","|","\\","^","~","`"].concat(p),c=["'"].concat(p),f=["%","/","?",";","#"].concat(i).concat(c),m=["/","@","?","#"].concat(p),l=255,u=/^[a-zA-Z0-9][a-z0-9A-Z_-]{0,62}$/,v=/^([a-zA-Z0-9][a-z0-9A-Z_-]{0,62})(.*)$/,d={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=require("querystring")}();
},{"punycode":84,"querystring":87}],97:[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};
},{}],98:[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),d=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 y=t.name?": "+t.name:"";return e.stylize("[Function"+y+"]","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,d,g):g.map(function(n){return p(e,t,r,d,n,h)}),e.seen.pop(),a(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"):d(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))?p(e,t,r,n,String(s),!0):"");return o.forEach(function(o){o.match(/^\d+$/)||i.push(p(e,t,r,n,o,!0))}),i}function p(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=d(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 a(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 d(e){return null===e}function y(e){return null==e}function m(e){return"number"==typeof e}function x(e){return"string"==typeof e}function h(e){return"symbol"==typeof e}function b(e){return void 0===e}function v(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function j(e){return w(e)&&"[object Date]"===E(e)}function O(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function z(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function E(e){return Object.prototype.toString.call(e)}function D(e){return 10>e?"0"+e.toString(10):e.toString(10)}function N(){var e=new Date,t=[D(e.getHours()),D(e.getMinutes()),D(e.getSeconds())].join(":");return[e.getDate(),H[e.getMonth()],t].join(" ")}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var A=/%[sdj%]/g;exports.format=function(e){if(!x(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(r(arguments[n]));return t.join(" ")}for(var n=1,o=arguments,i=o.length,s=String(e).replace(A,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch(t){return"[Circular]"}default:return e}}),u=o[n];i>n;u=o[++n])s+=d(u)||!w(u)?" "+u:" "+r(u);return s},exports.deprecate=function(r,n){function o(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}if(b(t.process))return function(){return exports.deprecate(r,n).apply(this,arguments)};if(e.noDeprecation===!0)return r;var i=!1;return o};var J,R={};exports.debuglog=function(t){if(b(J)&&(J=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!R[t])if(new RegExp("\\b"+t+"\\b","i").test(J)){var r=e.pid;R[t]=function(){var e=exports.format.apply(exports,arguments);console.error("%s %d: %s",t,r,e)}}else R[t]=function(){};return R[t]},exports.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=f,exports.isBoolean=g,exports.isNull=d,exports.isNullOrUndefined=y,exports.isNumber=m,exports.isString=x,exports.isSymbol=h,exports.isUndefined=b,exports.isRegExp=v,exports.isObject=w,exports.isDate=j,exports.isError=O,exports.isFunction=S,exports.isPrimitive=z,exports.isBuffer=require("./support/isBuffer");var H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];exports.log=function(){console.log("%s - %s",N(),exports.format.apply(exports,arguments))},exports.inherits=require("inherits"),exports._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,require("/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});
},{"./support/isBuffer":97,"/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":82,"inherits":81}],99:[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":66}],100:[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":66}],101:[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};
},{}],102:[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 u=function(e,u){if("./"==e.slice(0,2)||"../"==e.slice(0,3)){var n=o()[1].getFileName();e=t.resolve(t.dirname(n),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=u;var l=require(e);return delete require.cache[e],a&&(require.cache[e]=a),l},n=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?u:n,module.exports.imports=function(){var e=r._imports||{};return r._imports={},e}}).call(this,require("/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});
},{"/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":82,"callsite":101,"path":83}],103:[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(i){e(i)}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(i,l)}var t=e.parallel(),o=0,a=0,l=[],i=void 0;return n.nextTick(r),function(){var n=o++;return a++,function(){a--,arguments[0]&&(i=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("/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"));
},{"/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":82}],104:[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":66,"soop":102}],105:[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":70,"fs":65}],"./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":66,"soop":102}],"./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":66,"soop":102}],110:[function(require,module,exports){
function MissingSourceError(r,o){Error.call(this),Error.captureStackTrace(this,arguments.callee),this.message=r,this.missingTxHash=o,this.name="MissingSourceError"}function VerificationError(r,o){Error.call(this),Error.captureStackTrace(this,arguments.callee),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"}],113:[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"),p=require("buffertools");e.versions||(i=require("../browser/vendor-bundle.js"));var h=exports.sha256=function(r){return new t(a.createHash("sha256").update(r).digest("binary"),"binary")},w=exports.ripe160=function(r){if(!t.isBuffer(r))throw new Error("arg should be a buffer");if(!e.versions){for(var n=new i.crypto31.lib.WordArray.init(Crypto.util.bytesToWords(r),r.length),o=i.crypto31.RIPEMD160(n),f=o.words,u=[],s=0;s<32*f.length;s+=8)u.push(f[s>>>5]>>>24-s%32&255);return new t(u,"hex")}return new t(a.createHash("rmd160").update(r).digest("binary"),"binary")},d=(exports.sha1=function(r){return new t(a.createHash("sha1").update(r).digest("binary"),"binary")},exports.twoSha256=function(r){return h(h(r))},exports.sha256ripe160=function(r){return w(h(r))},exports.formatHash=function(r){var e=new t(10);return r.copy(e,0,22,32),p.reverse(e).toString("hex")},exports.formatHashFull=function(r){var e=new t(r.length);r.copy(e);var n=p.toHex(p.reverse(e));return n}),v=(exports.formatHashAlt=function(r){var e=d(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=p.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}),g=(exports.bigIntToValue=function(r){return t.isBuffer(r)?r:r.toBuffer({endian:"little",size:8})},function(r){return{hi:Math.floor(r/4294967296),lo:(4294967295&r)>>>0}}),x=function(r,e){return r.toString(2).replace("-","").length<e};exports.intToBuffer=function(r){var e=null;if(x(r,8))return e=new t(1),e.writeInt8(r,0),e;if(x(r,16))return e=new t(2),e.writeInt16LE(r,0),e;if(x(r,32))return e=new t(4),e.writeInt32LE(r,0),e;var n=g(r);return e=new t(8),e.writeInt32LE(n.hi,0),e.writeUInt32LE(n.lo,4),e};var b=(exports.formatValue=function(r){for(var e=v(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+)/,y=/^\s*(\d+)/;exports.parseValue=function(r){var e=r.match(b);return e?o(e):(e=r.match(m))?f(e):(e=r.match(y),e?u(e):void 0)};{var B=(exports.createSynchrotron=function(r){var e={};return function(t){var n=Array.prototype.slice.call(arguments),o=function(){n[0]=function(){e[t]&&(e[t].length?e[t].shift()():delete e[t])},r.apply(null,n)};e[t]?e[t].push(o):(e[t]=[],o())}},exports.generateNonce=function(){var e=4294967296,n=255,o=new t(8),f=0;return r=Math.random()*e,o[f++]=r&n,o[f++]=(r>>>=8)&n,o[f++]=(r>>>=8)&n,o[f++]=(r>>>=8)&n,r=Math.random()*e,o[f++]=r&n,o[f++]=(r>>>=8)&n,o[f++]=(r>>>=8)&n,o[f++]=(r>>>=8)&n,o},exports.decodeDiffBits=function(r,e){r=+r;var n=s(16777215&r);if(n=n.shiftLeft(8*((r>>>24)-3)),e)return n;var o=n.toBuffer(),f=new t(32);return p.fill(f,0),o.copy(f,32-o.length),f}),I=(exports.encodeDiffBits=function(r){if(t.isBuffer(r))r=s.fromBuffer(r);else if("function"!=typeof r.toBuffer)throw new Error("Incorrect variable type for difficulty");var e=r.toBuffer("mpint"),n=e.length-4,o=n<<24;return n>=1&&(o|=e[4]<<16),n>=2&&(o|=e[5]<<8),n>=3&&(o|=e[6]),o},exports.calcDifficulty=function(r){t.isBuffer(r)||(r=B(r));var e=s.fromBuffer(r,{order:"forward"}),n=s.fromBuffer(MAX_TARGET,{order:"forward"});return n.div(e).toNumber()},exports.reverseBytes32=function(r){if(r.length%4)throw new Error("Util.reverseBytes32(): Data length must be multiple of 4");for(var e=new c,t=l.parse(r);!t.eof();){var n=t.word32le("word").vars.word;e.word32be(n)}return e.buffer()},exports.getVarIntSize=function(r){return 253>r?1:65536>r?3:4294967296>r?5:9},exports.varIntBuf=function(r){var e=void 0;return 253>r?(e=new t(1),e.writeUInt8(r,0)):65536>r?(e=new t(3),e.writeUInt8(253,0),e.writeUInt16LE(r,1)):4294967296>r?(e=new t(5),e.writeUInt8(254,0),e.writeUInt32LE(r,1)):(e=new t(9),e.writeUInt8(255,0),e.writeInt32LE(-1&r,1),e.writeUInt32LE(Math.floor(r/4294967296),5)),e});exports.varStrBuf=function(r){return t.concat([I(r.length),r])}}exports.NULL_HASH=p.fill(new t(32),0),exports.EMPTY_BUFFER=new t(0),exports.ZERO_VALUE=p.fill(new t(8),0);var E=new t("ffffffffffffffff","hex");exports.INT64_MAX=E,exports.COIN=1e8,exports.MAX_TARGET=new t("00000000FFFF0000000000000000000000000000000000000000000000000000","hex")}).call(this,require("/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),require("buffer").Buffer);
},{"../browser/vendor-bundle.js":47,"/home/maraoz/git/multipaper/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":82,"bignum":"J4nwo8","binary":56,"buffer":66,"bufferput":99,"buffertools":"fugeBw","crypto":70}]},{},[])