From b7545ab6fcaae20740d2f16a1b0f172330eaefb2 Mon Sep 17 00:00:00 2001 From: Victor Hernandes Silva Maia Date: Mon, 6 Mar 2017 20:08:04 -0300 Subject: [PATCH] Add demo uploader/downloader web app --- README.md | 2 + examples/dapp_download.js | 2 +- examples/dapp_download_to_disk.js | 4 +- examples/dapp_get_routes.js | 2 +- examples/dapp_upload.js | 2 +- examples/dapp_upload_from_disk.js | 4 +- examples/data_download.js | 2 +- examples/data_upload.js | 2 +- .../ethereum_icon.png | Bin .../foo/test_text_1.txt | 0 .../foo/test_text_2.txt | 0 .../index.html | 0 .../example_dapp_uploader/ethereum_icon.png | Bin 0 -> 304 bytes examples/example_dapp_uploader/index.html | 49 + examples/example_dapp_uploader/index.js | 75 + examples/example_dapp_uploader/swarm.min.js | 1579 +++++++++++++++++ examples/example_dir/icons/ethereum_icon.png | Bin 0 -> 304 bytes examples/example_dir/icons/pokeball.png | Bin 0 -> 394 bytes examples/example_dir/intro.txt | 1 + examples/example_dir/subdir/sub_file_0.txt | 1 + examples/example_dir/subdir/sub_file_1.txt | 1 + examples/examples.js | 2 +- examples/run_node.js | 2 +- package.json | 6 + files.js => src/files.js | 0 src/pick.js | 50 + swarm.js => src/swarm.js | 39 +- 27 files changed, 1806 insertions(+), 19 deletions(-) rename examples/{example_dapp => example_dapp_simple}/ethereum_icon.png (100%) rename examples/{example_dapp => example_dapp_simple}/foo/test_text_1.txt (100%) rename examples/{example_dapp => example_dapp_simple}/foo/test_text_2.txt (100%) rename examples/{example_dapp => example_dapp_simple}/index.html (100%) create mode 100644 examples/example_dapp_uploader/ethereum_icon.png create mode 100644 examples/example_dapp_uploader/index.html create mode 100644 examples/example_dapp_uploader/index.js create mode 100644 examples/example_dapp_uploader/swarm.min.js create mode 100644 examples/example_dir/icons/ethereum_icon.png create mode 100644 examples/example_dir/icons/pokeball.png create mode 100644 examples/example_dir/intro.txt create mode 100644 examples/example_dir/subdir/sub_file_0.txt create mode 100644 examples/example_dir/subdir/sub_file_1.txt rename files.js => src/files.js (100%) create mode 100644 src/pick.js rename swarm.js => src/swarm.js (94%) diff --git a/README.md b/README.md index 92de6ae..efee813 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ This library allows you to interact with the Swarm network from JavaScript. It: - Can automatically download the Swarm binaries safely and administer the local node for you. +[Live demo!](http://swarm-gateways.net/bzz:/162a33641dcf0c065b732aed9070ec8035a1a036a3ea69f65786da6b1f2986ca/) + ## Installing npm install swarm-js diff --git a/examples/dapp_download.js b/examples/dapp_download.js index cc29aed..d613b4c 100644 --- a/examples/dapp_download.js +++ b/examples/dapp_download.js @@ -3,7 +3,7 @@ // (buffers). That allows any DApp to download the directory tree of any other // DApp in pure JavaScript. -const swarm = require("./../swarm.js").at("http://swarm-gateways.net"); +const swarm = require("./../src/swarm.js").at("http://swarm-gateways.net"); // The hash of the DApp we uploaded on the other example. const exampleDAppHash = "379d2791624c3e3719bb28f7bfa362cc9c726ec06482b5800c8e3cefaf2b7bcf"; diff --git a/examples/dapp_download_to_disk.js b/examples/dapp_download_to_disk.js index afc612e..0d2070f 100644 --- a/examples/dapp_download_to_disk.js +++ b/examples/dapp_download_to_disk.js @@ -1,11 +1,11 @@ // Downloads a directory hosted on the Swarm network to the disk. -const swarm = require("./../swarm.js").at("http://swarm-gateways.net"); +const swarm = require("./../src/swarm.js").at("http://swarm-gateways.net"); const path = require("path"); // The hash of the DApp we uploaded on the other example. const exampleDAppHash = "379d2791624c3e3719bb28f7bfa362cc9c726ec06482b5800c8e3cefaf2b7bcf"; -const targetDirPath = path.join(__dirname,"example_dapp"); +const targetDirPath = path.join(__dirname,"example_dapp_simple"); swarm.download(exampleDAppHash, targetDirPath) .then(dirPath => console.log(`Downloaded DApp to ${dirPath}.`)) diff --git a/examples/dapp_get_routes.js b/examples/dapp_get_routes.js index 375c15e..733d6e8 100644 --- a/examples/dapp_get_routes.js +++ b/examples/dapp_get_routes.js @@ -1,7 +1,7 @@ // Solves the Swarm manifest at a given path recursively, returns a flat JSON // mapping the routes of its directory tree to the hash of each file on it. -const swarm = require("./../swarm.js").at("http://swarm-gateways.net"); +const swarm = require("./../src/swarm.js").at("http://swarm-gateways.net"); const exampleDAppHash = "8587c8e716bfceea12a7306d85a8a8ccad5019020916eb5a21fa47a7f1826891"; swarm.downloadRoutes(exampleDAppHash) diff --git a/examples/dapp_upload.js b/examples/dapp_upload.js index 7a19822..dfd8007 100644 --- a/examples/dapp_upload.js +++ b/examples/dapp_upload.js @@ -5,7 +5,7 @@ // You can access it at: // http://swarm-gateways.net/bzz:/379d2791624c3e3719bb28f7bfa362cc9c726ec06482b5800c8e3cefaf2b7bcf/ -const swarm = require("./../swarm.js").at("http://swarm-gateways.net"); +const swarm = require("./../src/swarm.js").at("http://swarm-gateways.net"); // The contents of index.html. const indexHtml = new Buffer( diff --git a/examples/dapp_upload_from_disk.js b/examples/dapp_upload_from_disk.js index 601c5b6..dcf97cb 100644 --- a/examples/dapp_upload_from_disk.js +++ b/examples/dapp_upload_from_disk.js @@ -2,9 +2,9 @@ // Outputs the DApp address. In this case, it is: // 379d2791624c3e3719bb28f7bfa362cc9c726ec06482b5800c8e3cefaf2b7bcf -const swarm = require("./../swarm.js").at("http://swarm-gateways.net"); +const swarm = require("./../src/swarm.js").at("http://swarm-gateways.net"); const path = require("path"); -swarm.uploadDirectoryFromDisk("/index.html", path.join(__dirname,"example_dapp")) +swarm.uploadDirectoryFromDisk("/index.html", path.join(__dirname,"example_dapp_simple")) .then(console.log) .catch(console.log); diff --git a/examples/data_download.js b/examples/data_download.js index 937280e..de7456c 100644 --- a/examples/data_download.js +++ b/examples/data_download.js @@ -1,7 +1,7 @@ // Downloads raw data from the Swarm network. // Outputs the downloaded data: "test" -const swarm = require("./../swarm.js").at("http://swarm-gateways.net"); +const swarm = require("./../src/swarm.js").at("http://swarm-gateways.net"); const hash = "c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7"; swarm.download(hash) diff --git a/examples/data_upload.js b/examples/data_upload.js index f829397..406d31c 100644 --- a/examples/data_upload.js +++ b/examples/data_upload.js @@ -1,7 +1,7 @@ // Uploads raw data to the Swarm network. // Outputs the Swarm address: c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7 -const swarm = require("./../swarm.js").at("http://swarm-gateways.net"); +const swarm = require("./../src/swarm.js").at("http://swarm-gateways.net"); swarm.upload(new Buffer("test")) .then(console.log) diff --git a/examples/example_dapp/ethereum_icon.png b/examples/example_dapp_simple/ethereum_icon.png similarity index 100% rename from examples/example_dapp/ethereum_icon.png rename to examples/example_dapp_simple/ethereum_icon.png diff --git a/examples/example_dapp/foo/test_text_1.txt b/examples/example_dapp_simple/foo/test_text_1.txt similarity index 100% rename from examples/example_dapp/foo/test_text_1.txt rename to examples/example_dapp_simple/foo/test_text_1.txt diff --git a/examples/example_dapp/foo/test_text_2.txt b/examples/example_dapp_simple/foo/test_text_2.txt similarity index 100% rename from examples/example_dapp/foo/test_text_2.txt rename to examples/example_dapp_simple/foo/test_text_2.txt diff --git a/examples/example_dapp/index.html b/examples/example_dapp_simple/index.html similarity index 100% rename from examples/example_dapp/index.html rename to examples/example_dapp_simple/index.html diff --git a/examples/example_dapp_uploader/ethereum_icon.png b/examples/example_dapp_uploader/ethereum_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..0b2f4c335ff0bc7a324d5c23488184b2e8c157bd GIT binary patch literal 304 zcmV-00nh%4P)t`(Nw7(SP%&fkG$>CY5IWclmGi-|WBe zf6@OE|JD9m)SxKvU19pu;=jdzbD#nd5d5aP3`N0wm)v%X^_EZt5^D@weEd)pOcm-o z*Sp3q#Qc-!FWm&ojiwKRgwdQi$)o3g|ErdC$7r+X#{XR%uz9q;=YRKKBcLa3i?9Y1 zFsS!~0?K@^Cl?L{(^Na(8hvv$z#$C+O$D~$s3HKrMQ + + Swarm.js Demo + + + + + + + +

Swarm.js Demo

+ +

Provider: + + +

+ +

+ + + + +

+ +
+ +
+

Downloads to try:

+ + + + + + + + + + + + + +
Demo text62cb02b7d506e24f347ba0e8029e24bac12c4c2edd80498c9cbe64c30b97b96b
Demo image76b9b41b169cbe78cf92f4fa413065536051588db5b1dd052ed12c78754d1008
Demo directory6c03d9a5591796c86b998ccde9b5f4e99a10daf9da640f47ccf8a60b87103d24
+

This demo only interprets PNG, JPG and text. Any other binary is shown as a hex string.

+
+ + diff --git a/examples/example_dapp_uploader/index.js b/examples/example_dapp_uploader/index.js new file mode 100644 index 0000000..1468b63 --- /dev/null +++ b/examples/example_dapp_uploader/index.js @@ -0,0 +1,75 @@ +let swarm = Swarm.at("http://swarm-gateways.net"); + +// Uploads a file or directory to the Swarm network +const upload = dir => { + swarm.upload(dir).then(print).catch(console.log); +}; + +// Downloads from Swarm and inserts on site +const download = () => { + const hash = prompt("Hash:"); + if (hash) swarm.download(hash).then(print).catch(console.log); +}; + +// Sets the Swarm provider / gateway +const setProvider = e => { + swarm = Swarm.at(document.getElementById("provider").value); +}; + +// Pretty printers +const print = val => { + let p = document.createElement("p"); + let o = document.getElementById("output"); + p.appendChild(toHTML(val)); + o.insertBefore(p, o.firstChild); +}; + +// Interprets data as text/png/jpg/raw/directory, builds an HTML +const toHTML = val => { + // Directory + if (val instanceof Object && !val.length) { + let table = document.createElement("table"); + for (var key in val) { + let row = document.createElement("tr"); + let cell0 = document.createElement("td"); + let cell1 = document.createElement("td"); + cell0.appendChild(toHTML(key)); + cell1.appendChild(toHTML(val[key].data)); + row.appendChild(cell0); + row.appendChild(cell1); + table.appendChild(row); + } + return table; + + // String + } else if (typeof val === "string") { + let span = document.createElement("span"); + span.innerHTML = val; + return span; + + // Buffer + } else if (val.length) { + // PNG + if (val[1] === 80 && val[2] === 78 && val[3] === 71) { + let image = document.createElement("img"); + image.src = "data:image/png;base64," + btoa(String.fromCharCode.apply(null,val)); + return image; + + // JPG + } else if (val[0] === 0xFF && val[1] === 0xD8 && val[val.length-2] === 0xFF && val[val.length-1] === 0xD9) { + let image = document.createElement("img"); + image.src = "data:image/jpg;base64," + btoa(String.fromCharCode.apply(null,val)); + return image; + + // Plain text / binary data + } else { + let isText = true; + for (let i = 0; i < val.length; ++i) + if (val[i] < 32 || val[i] > 126) + isText = false; + return toHTML(isText + ? [].map.call(val, c => String.fromCharCode(c)).join("") + : [].map.call(val, b => ("00"+b.toString(16)).slice(-2)).join("")); + }; + }; +}; diff --git a/examples/example_dapp_uploader/swarm.min.js b/examples/example_dapp_uploader/swarm.min.js new file mode 100644 index 0000000..310b403 --- /dev/null +++ b/examples/example_dapp_uploader/swarm.min.js @@ -0,0 +1,1579 @@ +/* + +(c) 2012 by C?dric Mesnil. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + mout v0.11.1 | http://moutjs.com | MIT license + The buffer module from node.js, for the browser. + + @author Feross Aboukhadijeh + @license MIT + The buffer module from node.js, for the browser. + + @author Feross Aboukhadijeh + @license MIT + Determine if an object is a Buffer + + @author Feross Aboukhadijeh + @license MIT + https://mths.be/punycode v1.4.1 by @mathias */ +var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,l,g){if(g.get||g.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[l]=g.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; +$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(a){return $jscomp.SYMBOL_PREFIX+(a||"")+$jscomp.symbolCounter_++}; +$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var l=0;return $jscomp.iteratorPrototype(function(){return l>>0;if(0===a)return 32;var g=0;0===(a&4294901760)&&(a<<=16,g+=16);0===(a&4278190080)&&(a<<=8,g+=8);0===(a&4026531840)&&(a<<=4,g+=4);0===(a&3221225472)&&(a<<=2,g+=2);0===(a&2147483648)&&g++;return g}},"es6-impl","es3");$jscomp.polyfill("Math.imul",function(a){return a?a:function(a,g){a=Number(a);g=Number(g);var f=a&65535,k=g&65535;return f*k+((a>>>16&65535)*k+f*(g>>>16&65535)<<16>>>0)|0}},"es6-impl","es3"); +$jscomp.polyfill("Array.prototype.fill",function(a){return a?a:function(a,g,f){var k=this.length||0;0>g&&(g=Math.max(0,k+g));if(null==f||f>k)f=k;f=Number(f);0>f&&(f=Math.max(0,k+f));for(g=Number(g||0);g=b))return a.error("non-byte EncoderBuffer value");this.value=b;this.length=1}else if("string"===typeof b)this.value=b,this.length=d.byteLength(b);else if(d.isBuffer(b))this.value=b,this.length=b.length;else return a.error("Unsupported type: "+typeof b)}l=a("inherits");var b=a("../base").Reporter,d=a("buffer").Buffer;l(f,b);g.DecoderBuffer=f;f.prototype.save=function(){return{offset:this.offset,reporter:b.prototype.save.call(this)}};f.prototype.restore=function(d){var a=new f(this.base);a.offset= +d.offset;a.length=this.offset;this.offset=d.offset;b.prototype.restore.call(this,d.reporter);return a};f.prototype.isEmpty=function(){return this.offset===this.length};f.prototype.readUInt8=function(b){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(b||"DecoderBuffer overrun")};f.prototype.skip=function(b,d){if(!(this.offset+b<=this.length))return this.error(d||"DecoderBuffer overrun");var c=new f(this.base);c._reporterState=this._reporterState;c.offset=this.offset; +c.length=this.offset+b;this.offset+=b;return c};f.prototype.raw=function(b){return this.base.slice(b?b.offset:this.offset,this.length)};g.EncoderBuffer=k;k.prototype.join=function(b,a){b||(b=new d(this.length));a||(a=0);if(0===this.length)return b;Array.isArray(this.value)?this.value.forEach(function(c){c.join(b,a);a+=c.length}):("number"===typeof this.value?b[a]=this.value:"string"===typeof this.value?b.write(this.value,a):d.isBuffer(this.value)&&this.value.copy(b,a),a+=this.length);return b}},{"../base":5, +buffer:49,inherits:98}],5:[function(a,l,g){g.Reporter=a("./reporter").Reporter;g.DecoderBuffer=a("./buffer").DecoderBuffer;g.EncoderBuffer=a("./buffer").EncoderBuffer;g.Node=a("./node")},{"./buffer":4,"./node":6,"./reporter":7}],6:[function(a,l,g){function f(b,c){var e={};this._baseState=e;e.enc=b;e.parent=c||null;e.children=null;e.tag=null;e.args=null;e.reverseArgs=null;e.choice=null;e.optional=!1;e.any=!1;e.obj=!1;e.use=null;e.useDecoder=null;e.key=null;e["default"]=null;e.explicit=null;e.implicit= +null;e.contains=null;e.parent||(e.children=[],this._wrap())}var k=a("../base").Reporter,b=a("../base").EncoderBuffer,d=a("../base").DecoderBuffer,h=a("minimalistic-assert");a="seq seqof set setof objid bool gentime utctime null_ enum int objDesc bitstr bmpstr charstr genstr graphstr ia5str iso646str numstr octstr printstr t61str unistr utf8str videostr".split(" ");var m="key obj use optional explicit implicit def choice any contains".split(" ").concat(a);l.exports=f;var c="enc parent children tag args reverseArgs choice optional any obj use alteredUse key default explicit implicit contains".split(" "); +f.prototype.clone=function(){var b=this._baseState,d={};c.forEach(function(c){d[c]=b[c]});var a=new this.constructor(d.parent);a._baseState=d;return a};f.prototype._wrap=function(){var b=this._baseState;m.forEach(function(c){this[c]=function(){var e=new this.constructor(this);b.children.push(e);return e[c].apply(e,arguments)}},this)};f.prototype._init=function(b){var c=this._baseState;h(null===c.parent);b.call(this);c.children=c.children.filter(function(b){return b._baseState.parent===this},this); +h.equal(c.children.length,1,"Root node can have only one child")};f.prototype._useArgs=function(b){var c=this._baseState,e=b.filter(function(b){return b instanceof this.constructor},this);b=b.filter(function(b){return!(b instanceof this.constructor)},this);0!==e.length&&(h(null===c.children),c.children=e,e.forEach(function(b){b._baseState.parent=this},this));0!==b.length&&(h(null===c.args),c.args=b,c.reverseArgs=b.map(function(b){if("object"!==typeof b||b.constructor!==Object)return b;var c={};Object.keys(b).forEach(function(e){e== +(e|0)&&(e|=0);c[b[e]]=e});return c}))};"_peekTag _decodeTag _use _decodeStr _decodeObjid _decodeTime _decodeNull _decodeInt _decodeBool _decodeList _encodeComposite _encodeStr _encodeObjid _encodeTime _encodeNull _encodeInt _encodeBool".split(" ").forEach(function(b){f.prototype[b]=function(){throw Error(b+" not implemented for encoding: "+this._baseState.enc);}});a.forEach(function(b){f.prototype[b]=function(){var c=this._baseState,e=Array.prototype.slice.call(arguments);h(null===c.tag);c.tag=b; +this._useArgs(e);return this}});f.prototype.use=function(b){h(b);var c=this._baseState;h(null===c.use);c.use=b;return this};f.prototype.optional=function(){this._baseState.optional=!0;return this};f.prototype.def=function(b){var c=this._baseState;h(null===c["default"]);c["default"]=b;c.optional=!0;return this};f.prototype.explicit=function(b){var c=this._baseState;h(null===c.explicit&&null===c.implicit);c.explicit=b;return this};f.prototype.implicit=function(b){var c=this._baseState;h(null===c.explicit&& +null===c.implicit);c.implicit=b;return this};f.prototype.obj=function(){var b=this._baseState,c=Array.prototype.slice.call(arguments);b.obj=!0;0!==c.length&&this._useArgs(c);return this};f.prototype.key=function(b){var c=this._baseState;h(null===c.key);c.key=b;return this};f.prototype.any=function(){this._baseState.any=!0;return this};f.prototype.choice=function(b){var c=this._baseState;h(null===c.choice);c.choice=b;this._useArgs(Object.keys(b).map(function(c){return b[c]}));return this};f.prototype.contains= +function(b){var c=this._baseState;h(null===c.use);c.contains=b;return this};f.prototype._decode=function(b,c){var e=this._baseState;if(null===e.parent)return b.wrapResult(e.children[0]._decode(b,c));var a=e["default"],h=!0,n=null;null!==e.key&&(n=b.enterKey(e.key));if(e.optional){var m=null;null!==e.explicit?m=e.explicit:null!==e.implicit?m=e.implicit:null!==e.tag&&(m=e.tag);if(null!==m||e.any){if(h=this._peekTag(b,m,e.any),b.isError(h))return h}else{var f=b.save();try{null===e.choice?this._decodeGeneric(e.tag, +b,c):this._decodeChoice(b,c),h=!0}catch(w){h=!1}b.restore(f)}}var k;e.obj&&h&&(k=b.enterObject());if(h){if(null!==e.explicit){m=this._decodeTag(b,e.explicit);if(b.isError(m))return m;b=m}m=b.offset;if(null===e.use&&null===e.choice){e.any&&(f=b.save());var v=this._decodeTag(b,null!==e.implicit?e.implicit:e.tag,e.any);if(b.isError(v))return v;e.any?a=b.raw(f):b=v}c&&c.track&&null!==e.tag&&c.track(b.path(),m,b.length,"tagged");c&&c.track&&null!==e.tag&&c.track(b.path(),b.offset,b.length,"content");e.any|| +(a=null===e.choice?this._decodeGeneric(e.tag,b,c):this._decodeChoice(b,c));if(b.isError(a))return a;e.any||null!==e.choice||null===e.children||e.children.forEach(function(e){e._decode(b,c)});!e.contains||"octstr"!==e.tag&&"bitstr"!==e.tag||(a=new d(a),a=this._getUse(e.contains,b._reporterState.obj)._decode(a,c))}e.obj&&h&&(a=b.leaveObject(k));null===e.key||null===a&&!0!==h?null!==n&&b.exitKey(n):b.leaveKey(n,e.key,a);return a};f.prototype._decodeGeneric=function(b,c,d){var e=this._baseState;return"seq"=== +b||"set"===b?null:"seqof"===b||"setof"===b?this._decodeList(c,b,e.args[0],d):/str$/.test(b)?this._decodeStr(c,b,d):"objid"===b&&e.args?this._decodeObjid(c,e.args[0],e.args[1],d):"objid"===b?this._decodeObjid(c,null,null,d):"gentime"===b||"utctime"===b?this._decodeTime(c,b,d):"null_"===b?this._decodeNull(c,d):"bool"===b?this._decodeBool(c,d):"objDesc"===b?this._decodeStr(c,b,d):"int"===b||"enum"===b?this._decodeInt(c,e.args&&e.args[0],d):null!==e.use?this._getUse(e.use,c._reporterState.obj)._decode(c, +d):c.error("unknown tag: "+b)};f.prototype._getUse=function(b,c){var e=this._baseState;e.useDecoder=this._use(b,c);h(null===e.useDecoder._baseState.parent);e.useDecoder=e.useDecoder._baseState.children[0];e.implicit!==e.useDecoder._baseState.implicit&&(e.useDecoder=e.useDecoder.clone(),e.useDecoder._baseState.implicit=e.implicit);return e.useDecoder};f.prototype._decodeChoice=function(b,c){var e=this._baseState,d=null,a=!1;Object.keys(e.choice).some(function(h){var n=b.save(),m=e.choice[h];try{var f= +m._decode(b,c);if(b.isError(f))return!1;d={type:h,value:f};a=!0}catch(v){return b.restore(n),!1}return!0},this);return a?d:b.error("Choice not matched")};f.prototype._createEncoderBuffer=function(c){return new b(c,this.reporter)};f.prototype._encode=function(b,c,d){var e=this._baseState;if(null===e["default"]||e["default"]!==b)if(b=this._encodeValue(b,c,d),void 0!==b&&!this._skipDefault(b,c,d))return b};f.prototype._encodeValue=function(b,c,d){var e=this._baseState;if(null===e.parent)return e.children[0]._encode(b, +c||new k);var a=null;this.reporter=c;if(e.optional&&void 0===b)if(null!==e["default"])b=e["default"];else return;var h=null,n=!1;if(e.any)a=this._createEncoderBuffer(b);else if(e.choice)a=this._encodeChoice(b,c);else if(e.contains)h=this._getUse(e.contains,d)._encode(b,c),n=!0;else if(e.children)h=e.children.map(function(e){if("null_"===e._baseState.tag)return e._encode(null,c,b);if(null===e._baseState.key)return c.error("Child should have a key");var d=c.enterKey(e._baseState.key);if("object"!== +typeof b)return c.error("Child expected, but input is not object");e=e._encode(b[e._baseState.key],c,b);c.leaveKey(d);return e},this).filter(function(b){return b}),h=this._createEncoderBuffer(h);else if("seqof"===e.tag||"setof"===e.tag){if(!e.args||1!==e.args.length)return c.error("Too many args for : "+e.tag);if(!Array.isArray(b))return c.error("seqof/setof, but data is not Array");h=this.clone();h._baseState.implicit=null;h=this._createEncoderBuffer(b.map(function(e){return this._getUse(this._baseState.args[0], +b)._encode(e,c)},h))}else null!==e.use?a=this._getUse(e.use,d)._encode(b,c):(h=this._encodePrimitive(e.tag,b),n=!0);if(!e.any&&null===e.choice){d=null!==e.implicit?e.implicit:e.tag;var m=null===e.implicit?"universal":"context";null===d?null===e.use&&c.error("Tag could be ommited only for .use()"):null===e.use&&(a=this._encodeComposite(d,n,m,h))}null!==e.explicit&&(a=this._encodeComposite(e.explicit,!1,"context",a));return a};f.prototype._encodeChoice=function(b,c){var e=this._baseState,d=e.choice[b.type]; +d||h(!1,b.type+" not found in "+JSON.stringify(Object.keys(e.choice)));return d._encode(b.value,c)};f.prototype._encodePrimitive=function(b,c){var e=this._baseState;if(/str$/.test(b))return this._encodeStr(c,b);if("objid"===b&&e.args)return this._encodeObjid(c,e.reverseArgs[0],e.args[1]);if("objid"===b)return this._encodeObjid(c,null,null);if("gentime"===b||"utctime"===b)return this._encodeTime(c,b);if("null_"===b)return this._encodeNull();if("int"===b||"enum"===b)return this._encodeInt(c,e.args&& +e.reverseArgs[0]);if("bool"===b)return this._encodeBool(c);if("objDesc"===b)return this._encodeStr(c,b);throw Error("Unsupported tag: "+b);};f.prototype._isNumstr=function(b){return/^[0-9 ]*$/.test(b)};f.prototype._isPrintstr=function(b){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(b)}},{"../base":5,"minimalistic-assert":102}],7:[function(a,l,g){function f(b){this._reporterState={obj:null,path:[],options:b||{},errors:[]}}function k(b,d){this.path=b;this.rethrow(d)}a=a("inherits");g.Reporter=f;f.prototype.isError= +function(b){return b instanceof k};f.prototype.save=function(){var b=this._reporterState;return{obj:b.obj,pathLen:b.path.length}};f.prototype.restore=function(b){var d=this._reporterState;d.obj=b.obj;d.path=d.path.slice(0,b.pathLen)};f.prototype.enterKey=function(b){return this._reporterState.path.push(b)};f.prototype.exitKey=function(b){var d=this._reporterState;d.path=d.path.slice(0,b-1)};f.prototype.leaveKey=function(b,d,a){var h=this._reporterState;this.exitKey(b);null!==h.obj&&(h.obj[d]=a)}; +f.prototype.path=function(){return this._reporterState.path.join("/")};f.prototype.enterObject=function(){var b=this._reporterState,d=b.obj;b.obj={};return d};f.prototype.leaveObject=function(b){var d=this._reporterState,a=d.obj;d.obj=b;return a};f.prototype.error=function(b){var d=this._reporterState,a=b instanceof k;b=a?b:new k(d.path.map(function(b){return"["+JSON.stringify(b)+"]"}).join(""),b.message||b,b.stack);if(!d.options.partial)throw b;a||d.errors.push(b);return b};f.prototype.wrapResult= +function(b){var d=this._reporterState;return d.options.partial?{result:this.isError(b)?null:b,errors:d.errors}:b};a(k,Error);k.prototype.rethrow=function(b){this.message=b+" at: "+(this.path||"(shallow)");Error.captureStackTrace&&Error.captureStackTrace(this,k);if(!this.stack)try{throw Error(this.message);}catch(d){this.stack=d.stack}return this}},{inherits:98}],8:[function(a,l,g){a=a("../constants");g.tagClass={0:"universal",1:"application",2:"context",3:"private"};g.tagClassByName=a._reverse(g.tagClass); +g.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};g.tagByName=a._reverse(g.tag)},{"../constants":9}],9:[function(a,l,g){g._reverse=function(a){var f={};Object.keys(a).forEach(function(b){(b|0)==b&&(b|=0);f[a[b]]= +b});return f};g.der=a("./der")},{"./der":8}],10:[function(a,l,g){function f(b){this.enc="der";this.name=b.name;this.entity=b;this.tree=new k;this.tree._init(b.body)}function k(b){h.Node.call(this,"der",b)}function b(b,d){var e=b.readUInt8(d);if(b.isError(e))return e;var a=c.tagClass[e>>6],h=0===(e&32);if(31===(e&31))for(var n=e,e=0;128===(n&128);){n=b.readUInt8(d);if(b.isError(n))return n;e<<=7;e|=n&127}else e&=31;return{cls:a,primitive:h,tag:e,tagStr:c.tag[e]}}function d(b,c,d){var e=b.readUInt8(d); +if(b.isError(e))return e;if(!c&&128===e)return null;if(0===(e&128))return e;c=e&127;if(4d?2E3+d:1900+d;else return b.error("Decoding "+ +c+" time is not supported yet");return Date.UTC(d,a-1,h,n,m,e,0)};k.prototype._decodeNull=function(b){return null};k.prototype._decodeBool=function(b){var c=b.readUInt8();return b.isError(c)?c:0!==c};k.prototype._decodeInt=function(b,c){var e=b.raw(),e=new m(e);c&&(e=c[e.toString(10)]||e);return e};k.prototype._use=function(b,c){"function"===typeof b&&(b=b(c));return b._getDecoder("der").tree}},{"../../asn1":2,inherits:98}],11:[function(a,l,g){g.der=a("./der");g.pem=a("./pem")},{"./der":10,"./pem":12}], +12:[function(a,l,g){function f(d){b.call(this,d);this.enc="pem"}g=a("inherits");var k=a("buffer").Buffer,b=a("./der");g(f,b);l.exports=f;f.prototype.decode=function(d,a){for(var h=d.toString().split(/[\r\n]+/g),c=a.label.toUpperCase(),e=/^-----(BEGIN|END) ([^-]+)-----$/,n=-1,f=-1,r=0;rb?"0"+b:b}g=a("inherits");var d=a("buffer").Buffer;a=a("../../asn1");var h=a.base,m=a.constants.der;l.exports=f;f.prototype.encode=function(b,e){return this.tree._encode(b,e).join()};g(k, +h.Node);k.prototype._encodeComposite=function(b,e,a,h){a:{var c=b;b=this.reporter;"seqof"===c?c="seq":"setof"===c&&(c="set");if(m.tagByName.hasOwnProperty(c))c=m.tagByName[c];else if("number"!==typeof c||(c|0)!==c){b=b.error("Unknown tag: "+c);break a}31<=c?b=b.error("Multi-octet tag encoding unsupported"):(e||(c|=32),b=c|=m.tagClassByName[a||"universal"]<<6)}if(128>h.length)return e=new d(2),e[0]=b,e[1]=h.length,this._createEncoderBuffer([e,h]);c=1;for(a=h.length;256<=a;a>>=8)c++;e=new d(2+c);e[0]= +b;e[1]=128|c;a=1+c;for(b=h.length;0>=8)e[a]=b&255;return this._createEncoderBuffer([e,h])};k.prototype._encodeStr=function(b,e){if("bitstr"===e)return this._createEncoderBuffer([b.unused|0,b.data]);if("bmpstr"===e){for(var c=new d(2*b.length),a=0;a>=7)c++;var c=new d(c), +h=c.length-1;for(e=b.length-1;0<=e;e--)for(a=b[e],c[h--]=a&127;0<(a>>=7);)c[h--]=128|a&127;return this._createEncoderBuffer(c)};k.prototype._encodeTime=function(c,e){var d,a=new Date(c);"gentime"===e?d=[b(a.getFullYear()),b(a.getUTCMonth()+1),b(a.getUTCDate()),b(a.getUTCHours()),b(a.getUTCMinutes()),b(a.getUTCSeconds()),"Z"].join(""):"utctime"===e?d=[b(a.getFullYear()%100),b(a.getUTCMonth()+1),b(a.getUTCDate()),b(a.getUTCHours()),b(a.getUTCMinutes()),b(a.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+ +e+" time is not supported yet");return this._encodeStr(d,"octstr")};k.prototype._encodeNull=function(){return this._createEncoderBuffer("")};k.prototype._encodeInt=function(b,e){if("string"===typeof b){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(b))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(b));b=e[b]}if("number"!==typeof b&&!d.isBuffer(b)){var c=b.toArray();!b.sign&&c[0]&128&&c.unshift(0);b=new d(c)}if(d.isBuffer(b)){var a= +b.length;0===b.length&&a++;a=new d(a);b.copy(a);0===b.length&&(a[0]=0);return this._createEncoderBuffer(a)}if(128>b)return this._createEncoderBuffer(b);if(256>b)return this._createEncoderBuffer([0,b]);a=1;for(c=b;256<=c;c>>=8)a++;a=Array(a);for(c=a.length-1;0<=c;c--)a[c]=b&255,b>>=8;a[0]&128&&a.unshift(0);return this._createEncoderBuffer(new d(a))};k.prototype._encodeBool=function(b){return this._createEncoderBuffer(b?255:0)};k.prototype._use=function(b,e){"function"===typeof b&&(b=b(e));return b._getEncoder("der").tree}; +k.prototype._skipDefault=function(b,e,d){var c=this._baseState;if(null===c["default"])return!1;b=b.join();void 0===c.defaultBuffer&&(c.defaultBuffer=this._encodeValue(c["default"],e,d).join());if(b.length!==c.defaultBuffer.length)return!1;for(e=0;e>18&63]+b[c>>12&63]+b[c>>6&63]+b[c&63]);return d.join("")} +g.byteLength=function(b){return 3*b.length/4-f(b)};g.toByteArray=function(b){var c,e,a,m,k;c=b.length;m=f(b);k=new h(3*c/4-m);e=0>16&255,k[p++]=a>>8&255,k[p++]=a&255;2===m?(a=d[b.charCodeAt(c)]<<2|d[b.charCodeAt(c+1)]>>4,k[p++]=a&255):1===m&&(a=d[b.charCodeAt(c)]<<10|d[b.charCodeAt(c+1)]<<4|d[b.charCodeAt(c+2)]>>2,k[p++]=a>>8&255,k[p++]=a&255);return k};g.fromByteArray= +function(a){for(var c=a.length,e=c%3,d="",h=[],f=0,m=c-e;fm?m:f+16383));1===e?(a=a[c-1],d+=b[a>>2],d+=b[a<<4&63],d+="=="):2===e&&(a=(a[c-2]<<8)+a[c-1],d+=b[a>>10],d+=b[a>>4&63],d+=b[a<<2&63],d+="=");h.push(d);return h.join("")};var b=[],d=[],h="undefined"!==typeof Uint8Array?Uint8Array:Array;for(a=0;64>a;++a)b[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[a],d["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(a)]= +a;d[45]=62;d[95]=63},{}],18:[function(a,l,g){(function(f,k){function b(b,c){if(!b)throw Error(c||"Assertion failed");}function d(b,c){b.super_=c;var e=function(){};e.prototype=c.prototype;b.prototype=new e;b.prototype.constructor=b}function h(b,c,e){if(h.isBN(b))return b;this.negative=0;this.words=null;this.length=0;this.red=null;if(null!==b){if("le"===c||"be"===c)e=c,c=10;this._init(b||0,c||10,e||"be")}}function m(b,c,e){var a=0;for(e=Math.min(b.length,e);c=d?a|d-49+10:17<=d&&22>=d?a|d-17+10:a|d&15;return a}function c(b,c,e,a){var d=0;for(e=Math.min(b.length,e);c>>26,m=n&67108863,n=Math.min(F,c.length-1),E=Math.max(0,F-b.length+1);E<=n;E++)d=b.words[F- +E|0]|0,h=c.words[E]|0,d=d*h+m,f+=d/67108864|0,m=d&67108863;e.words[F]=m|0;n=f|0}0!==n?e.words[F]=n|0:e.length--;return e.strip()}function n(b,c){this.x=b;this.y=c}function t(b,c){this.name=b;this.p=new h(c,16);this.n=this.p.bitLength();this.k=(new h(1)).iushln(this.n).isub(this.p);this.tmp=this._tmp()}function r(){t.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){t.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")} +function B(){t.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function q(){t.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(c){"string"===typeof c?(c=h._prime(c),this.m=c.p,this.prime=c):(b(c.gtn(1),"modulus must be greater than 1"),this.m=c,this.prime=null)}function u(b){g.call(this,b);this.shift=this.m.bitLength();0!==this.shift%26&&(this.shift+=26-this.shift%26);this.r=(new h(1)).iushln(this.shift);this.r2=this.imod(this.r.sqr()); +this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}"object"===typeof f?f.exports=h:k.BN=h;h.BN=h;h.wordSize=26;var v;try{v=a("buffer").Buffer}catch(F){}h.isBN=function(b){return b instanceof h?!0:null!==b&&"object"===typeof b&&b.constructor.wordSize===h.wordSize&&Array.isArray(b.words)};h.max=function(b,c){return 0b.cmp(c)?b:c};h.prototype._init=function(c, +e,a){if("number"===typeof c)return this._initNumber(c,e,a);if("object"===typeof c)return this._initArray(c,e,a);"hex"===e&&(e=16);b(e===(e|0)&&2<=e&&36>=e);c=c.toString().replace(/\s+/g,"");var d=0;"-"===c[0]&&d++;16===e?this._parseHex(c,d):this._parseBase(c,e,d);"-"===c[0]&&(this.negative=1);this.strip();"le"===a&&this._initArray(this.toArray(),e,a)};h.prototype._initNumber=function(c,e,a){0>c&&(this.negative=1,c=-c);67108864>c?(this.words=[c&67108863],this.length=1):4503599627370496>c?(this.words= +[c&67108863,c/67108864&67108863],this.length=2):(b(9007199254740992>c),this.words=[c&67108863,c/67108864&67108863,1],this.length=3);"le"===a&&this._initArray(this.toArray(),e,a)};h.prototype._initArray=function(c,e,a){b("number"===typeof c.length);if(0>=c.length)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3);this.words=Array(this.length);for(e=0;e>>26-h&67108863,h+=24,26<=h&&(h-=26,a++);else if("le"===a)for(a=e=0;e>>26-h&67108863,h+=24,26<=h&&(h-=26,a++);return this.strip()};h.prototype._parseHex=function(b,c){this.length=Math.ceil((b.length-c)/6);this.words=Array(this.length);for(var e=0;e=c;e-=6)d=m(b,e,e+6),this.words[a]|=d<>>26-h&4194303,h+=24,26<=h&&(h-=26,a++);e+6!==c&&(d=m(b,c,e+6),this.words[a]|=d<>>26-h&4194303);this.strip()};h.prototype._parseBase=function(b,e,a){this.words=[0];this.length=1;for(var d=0,h=1;67108863>=h;h*=e)d++;d--;for(var h=h/e|0,n=b.length-a,f=n%d,n=Math.min(n,n-f)+a,m=a;mthis.words[0]+a?this.words[0]+=a:this._iaddn(a);if(0!==f){d=1;a=c(b,m,b.length,e);for(m=0;mthis.words[0]+ +a?this.words[0]+=a:this._iaddn(a)}};h.prototype.copy=function(b){b.words=Array(this.length);for(var c=0;c"};var w=" 0 00 000 0000 00000 000000 0000000 00000000 000000000 0000000000 00000000000 000000000000 0000000000000 00000000000000 000000000000000 0000000000000000 00000000000000000 000000000000000000 0000000000000000000 00000000000000000000 000000000000000000000 0000000000000000000000 00000000000000000000000 000000000000000000000000 0000000000000000000000000".split(" "), +l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1E7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64E6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243E5,28629151,33554432,39135393,45435424,52521875,60466176];h.prototype.toString=function(c,e){c=c||10;e=e|0||1;var a;if(16===c||"hex"===c){a="";for(var d=0,h=0,n=0;n>>24-d&16777215;a=0!==h||n!==this.length-1?w[6-m.length]+m+a:m+a;d+=2;26<=d&&(d-=26,n--)}for(0!==h&&(a=h.toString(16)+a);0!==a.length%e;)a="0"+a;0!==this.negative&&(a="-"+a);return a}if(c===(c|0)&&2<=c&&36>=c){d=l[c];h=A[c];a="";n=this.clone();for(n.negative=0;!n.isZero();)f=n.modn(h).toString(c),n=n.idivn(h),a=n.isZero()?f+a:w[d-f.length]+f+a;for(this.isZero()&&(a="0"+a);0!==a.length%e;)a="0"+a;0!==this.negative&&(a="-"+a);return a}b(!1,"Base should be between 2 and 36")}; +h.prototype.toNumber=function(){var c=this.words[0];2===this.length?c+=67108864*this.words[1]:3===this.length&&1===this.words[2]?c+=4503599627370496+67108864*this.words[1]:2>>=13);64<= +b&&(c+=7,b>>>=7);8<=b&&(c+=4,b>>>=4);2<=b&&(c+=2,b>>>=2);return c+b};h.prototype._zeroBits=function(b){if(0===b)return 26;var c=0;0===(b&8191)&&(c+=13,b>>>=13);0===(b&127)&&(c+=7,b>>>=7);0===(b&15)&&(c+=4,b>>>=4);0===(b&3)&&(c+=2,b>>>=2);0===(b&1)&&c++;return c};h.prototype.bitLength=function(){var b=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+b};h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var b=0,c=0;cb.length?this.clone().ior(b):b.clone().ior(this)};h.prototype.uor=function(b){return this.length>b.length?this.clone().iuor(b):b.clone().iuor(this)};h.prototype.iuand=function(b){var c;c=this.length>b.length?b:this;for(var e=0;eb.length?this.clone().iand(b):b.clone().iand(this)};h.prototype.uand=function(b){return this.length>b.length?this.clone().iuand(b):b.clone().iuand(this)};h.prototype.iuxor=function(b){var c;this.length>b.length?c=this:(c=b,b=this);for(var e=0;eb.length?this.clone().ixor(b):b.clone().ixor(this)};h.prototype.uxor=function(b){return this.length>b.length?this.clone().iuxor(b):b.clone().iuxor(this)};h.prototype.inotn=function(c){b("number"===typeof c&&0<=c);var e=Math.ceil(c/26)|0;c%=26;this._expand(e);0>26-c);return this.strip()};h.prototype.notn=function(b){return this.clone().inotn(b)};h.prototype.setn=function(c,e){b("number"===typeof c&&0<=c);var a=c/26|0,d=c%26;this._expand(a+1);this.words[a]=e?this.words[a]|1<b.length?e=this:(e=b,b=this);for(var a=c=0;a>>=26;for(;0!==c&&a>>=26;this.length=e.length;if(0!==c)this.words[this.length]=c,this.length++;else if(e!==this)for(;ab.length?this.clone().iadd(b):b.clone().iadd(this)};h.prototype.isub=function(b){if(0!==b.negative){b.negative=0;var c=this.iadd(b);b.negative=1;return c._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(b),this.negative=1,this._normSign();c=this.cmp(b);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;var e;0>26,this.words[d]=c&67108863;for(;0!==a&&d>26,this.words[d]=c&67108863;if(0===a&&d>>13,r=a[1]|0,m=r&8191,p=r>>>13, +E=a[2]|0,r=E&8191,q=E>>>13,v=a[3]|0,E=v&8191,B=v>>>13,w=a[4]|0,v=w&8191,F=w>>>13,g=a[5]|0,w=g&8191,u=g>>>13,y=a[6]|0,g=y&8191,l=y>>>13,C=a[7]|0,y=C&8191,J=C>>>13,A=a[8]|0,C=A&8191,A=A>>>13,G=a[9]|0,a=G&8191,G=G>>>13,z=d[0]|0,V=z&8191,P=z>>>13,Q=d[1]|0,z=Q&8191,W=Q>>>13,R=d[2]|0,Q=R&8191,O=R>>>13,ca=d[3]|0,R=ca&8191,ga=ca>>>13,aa=d[4]|0,ca=aa&8191,U=aa>>>13,X=d[5]|0,aa=X&8191,ba=X>>>13,Y=d[6]|0,X=Y&8191,ha=Y>>>13,da=d[7]|0,Y=da&8191,ia=da>>>13,ea=d[8]|0,da=ea&8191,ea=ea>>>13,fa=d[9]|0,d=fa&8191,fa= +fa>>>13;e.negative=b.negative^c.negative;e.length=19;f=Math.imul(k,V);b=Math.imul(k,P);b=b+Math.imul(t,V)|0;c=Math.imul(t,P);var oa=(n+f|0)+((b&8191)<<13)|0,n=(c+(b>>>13)|0)+(oa>>>26)|0,oa=oa&67108863;f=Math.imul(m,V);b=Math.imul(m,P);b=b+Math.imul(p,V)|0;c=Math.imul(p,P);f=f+Math.imul(k,z)|0;b=b+Math.imul(k,W)|0;b=b+Math.imul(t,z)|0;c=c+Math.imul(t,W)|0;var pa=(n+f|0)+((b&8191)<<13)|0,n=(c+(b>>>13)|0)+(pa>>>26)|0,pa=pa&67108863;f=Math.imul(r,V);b=Math.imul(r,P);b=b+Math.imul(q,V)|0;c=Math.imul(q, +P);f=f+Math.imul(m,z)|0;b=b+Math.imul(m,W)|0;b=b+Math.imul(p,z)|0;c=c+Math.imul(p,W)|0;f=f+Math.imul(k,Q)|0;b=b+Math.imul(k,O)|0;b=b+Math.imul(t,Q)|0;c=c+Math.imul(t,O)|0;var qa=(n+f|0)+((b&8191)<<13)|0,n=(c+(b>>>13)|0)+(qa>>>26)|0,qa=qa&67108863;f=Math.imul(E,V);b=Math.imul(E,P);b=b+Math.imul(B,V)|0;c=Math.imul(B,P);f=f+Math.imul(r,z)|0;b=b+Math.imul(r,W)|0;b=b+Math.imul(q,z)|0;c=c+Math.imul(q,W)|0;f=f+Math.imul(m,Q)|0;b=b+Math.imul(m,O)|0;b=b+Math.imul(p,Q)|0;c=c+Math.imul(p,O)|0;f=f+Math.imul(k, +R)|0;b=b+Math.imul(k,ga)|0;b=b+Math.imul(t,R)|0;c=c+Math.imul(t,ga)|0;var ra=(n+f|0)+((b&8191)<<13)|0,n=(c+(b>>>13)|0)+(ra>>>26)|0,ra=ra&67108863;f=Math.imul(v,V);b=Math.imul(v,P);b=b+Math.imul(F,V)|0;c=Math.imul(F,P);f=f+Math.imul(E,z)|0;b=b+Math.imul(E,W)|0;b=b+Math.imul(B,z)|0;c=c+Math.imul(B,W)|0;f=f+Math.imul(r,Q)|0;b=b+Math.imul(r,O)|0;b=b+Math.imul(q,Q)|0;c=c+Math.imul(q,O)|0;f=f+Math.imul(m,R)|0;b=b+Math.imul(m,ga)|0;b=b+Math.imul(p,R)|0;c=c+Math.imul(p,ga)|0;f=f+Math.imul(k,ca)|0;b=b+Math.imul(k, +U)|0;b=b+Math.imul(t,ca)|0;c=c+Math.imul(t,U)|0;var sa=(n+f|0)+((b&8191)<<13)|0,n=(c+(b>>>13)|0)+(sa>>>26)|0,sa=sa&67108863;f=Math.imul(w,V);b=Math.imul(w,P);b=b+Math.imul(u,V)|0;c=Math.imul(u,P);f=f+Math.imul(v,z)|0;b=b+Math.imul(v,W)|0;b=b+Math.imul(F,z)|0;c=c+Math.imul(F,W)|0;f=f+Math.imul(E,Q)|0;b=b+Math.imul(E,O)|0;b=b+Math.imul(B,Q)|0;c=c+Math.imul(B,O)|0;f=f+Math.imul(r,R)|0;b=b+Math.imul(r,ga)|0;b=b+Math.imul(q,R)|0;c=c+Math.imul(q,ga)|0;f=f+Math.imul(m,ca)|0;b=b+Math.imul(m,U)|0;b=b+Math.imul(p, +ca)|0;c=c+Math.imul(p,U)|0;f=f+Math.imul(k,aa)|0;b=b+Math.imul(k,ba)|0;b=b+Math.imul(t,aa)|0;c=c+Math.imul(t,ba)|0;var ta=(n+f|0)+((b&8191)<<13)|0,n=(c+(b>>>13)|0)+(ta>>>26)|0,ta=ta&67108863;f=Math.imul(g,V);b=Math.imul(g,P);b=b+Math.imul(l,V)|0;c=Math.imul(l,P);f=f+Math.imul(w,z)|0;b=b+Math.imul(w,W)|0;b=b+Math.imul(u,z)|0;c=c+Math.imul(u,W)|0;f=f+Math.imul(v,Q)|0;b=b+Math.imul(v,O)|0;b=b+Math.imul(F,Q)|0;c=c+Math.imul(F,O)|0;f=f+Math.imul(E,R)|0;b=b+Math.imul(E,ga)|0;b=b+Math.imul(B,R)|0;c=c+Math.imul(B, +ga)|0;f=f+Math.imul(r,ca)|0;b=b+Math.imul(r,U)|0;b=b+Math.imul(q,ca)|0;c=c+Math.imul(q,U)|0;f=f+Math.imul(m,aa)|0;b=b+Math.imul(m,ba)|0;b=b+Math.imul(p,aa)|0;c=c+Math.imul(p,ba)|0;f=f+Math.imul(k,X)|0;b=b+Math.imul(k,ha)|0;b=b+Math.imul(t,X)|0;c=c+Math.imul(t,ha)|0;var ua=(n+f|0)+((b&8191)<<13)|0,n=(c+(b>>>13)|0)+(ua>>>26)|0,ua=ua&67108863;f=Math.imul(y,V);b=Math.imul(y,P);b=b+Math.imul(J,V)|0;c=Math.imul(J,P);f=f+Math.imul(g,z)|0;b=b+Math.imul(g,W)|0;b=b+Math.imul(l,z)|0;c=c+Math.imul(l,W)|0;f=f+ +Math.imul(w,Q)|0;b=b+Math.imul(w,O)|0;b=b+Math.imul(u,Q)|0;c=c+Math.imul(u,O)|0;f=f+Math.imul(v,R)|0;b=b+Math.imul(v,ga)|0;b=b+Math.imul(F,R)|0;c=c+Math.imul(F,ga)|0;f=f+Math.imul(E,ca)|0;b=b+Math.imul(E,U)|0;b=b+Math.imul(B,ca)|0;c=c+Math.imul(B,U)|0;f=f+Math.imul(r,aa)|0;b=b+Math.imul(r,ba)|0;b=b+Math.imul(q,aa)|0;c=c+Math.imul(q,ba)|0;f=f+Math.imul(m,X)|0;b=b+Math.imul(m,ha)|0;b=b+Math.imul(p,X)|0;c=c+Math.imul(p,ha)|0;f=f+Math.imul(k,Y)|0;b=b+Math.imul(k,ia)|0;b=b+Math.imul(t,Y)|0;c=c+Math.imul(t, +ia)|0;var va=(n+f|0)+((b&8191)<<13)|0,n=(c+(b>>>13)|0)+(va>>>26)|0,va=va&67108863;f=Math.imul(C,V);b=Math.imul(C,P);b=b+Math.imul(A,V)|0;c=Math.imul(A,P);f=f+Math.imul(y,z)|0;b=b+Math.imul(y,W)|0;b=b+Math.imul(J,z)|0;c=c+Math.imul(J,W)|0;f=f+Math.imul(g,Q)|0;b=b+Math.imul(g,O)|0;b=b+Math.imul(l,Q)|0;c=c+Math.imul(l,O)|0;f=f+Math.imul(w,R)|0;b=b+Math.imul(w,ga)|0;b=b+Math.imul(u,R)|0;c=c+Math.imul(u,ga)|0;f=f+Math.imul(v,ca)|0;b=b+Math.imul(v,U)|0;b=b+Math.imul(F,ca)|0;c=c+Math.imul(F,U)|0;f=f+Math.imul(E, +aa)|0;b=b+Math.imul(E,ba)|0;b=b+Math.imul(B,aa)|0;c=c+Math.imul(B,ba)|0;f=f+Math.imul(r,X)|0;b=b+Math.imul(r,ha)|0;b=b+Math.imul(q,X)|0;c=c+Math.imul(q,ha)|0;f=f+Math.imul(m,Y)|0;b=b+Math.imul(m,ia)|0;b=b+Math.imul(p,Y)|0;c=c+Math.imul(p,ia)|0;f=f+Math.imul(k,da)|0;b=b+Math.imul(k,ea)|0;b=b+Math.imul(t,da)|0;c=c+Math.imul(t,ea)|0;var wa=(n+f|0)+((b&8191)<<13)|0,n=(c+(b>>>13)|0)+(wa>>>26)|0,wa=wa&67108863;f=Math.imul(a,V);b=Math.imul(a,P);b=b+Math.imul(G,V)|0;c=Math.imul(G,P);f=f+Math.imul(C,z)|0; +b=b+Math.imul(C,W)|0;b=b+Math.imul(A,z)|0;c=c+Math.imul(A,W)|0;f=f+Math.imul(y,Q)|0;b=b+Math.imul(y,O)|0;b=b+Math.imul(J,Q)|0;c=c+Math.imul(J,O)|0;f=f+Math.imul(g,R)|0;b=b+Math.imul(g,ga)|0;b=b+Math.imul(l,R)|0;c=c+Math.imul(l,ga)|0;f=f+Math.imul(w,ca)|0;b=b+Math.imul(w,U)|0;b=b+Math.imul(u,ca)|0;c=c+Math.imul(u,U)|0;f=f+Math.imul(v,aa)|0;b=b+Math.imul(v,ba)|0;b=b+Math.imul(F,aa)|0;c=c+Math.imul(F,ba)|0;f=f+Math.imul(E,X)|0;b=b+Math.imul(E,ha)|0;b=b+Math.imul(B,X)|0;c=c+Math.imul(B,ha)|0;f=f+Math.imul(r, +Y)|0;b=b+Math.imul(r,ia)|0;b=b+Math.imul(q,Y)|0;c=c+Math.imul(q,ia)|0;f=f+Math.imul(m,da)|0;b=b+Math.imul(m,ea)|0;b=b+Math.imul(p,da)|0;c=c+Math.imul(p,ea)|0;f=f+Math.imul(k,d)|0;b=b+Math.imul(k,fa)|0;b=b+Math.imul(t,d)|0;c=c+Math.imul(t,fa)|0;k=(n+f|0)+((b&8191)<<13)|0;n=(c+(b>>>13)|0)+(k>>>26)|0;k&=67108863;f=Math.imul(a,z);b=Math.imul(a,W);b=b+Math.imul(G,z)|0;c=Math.imul(G,W);f=f+Math.imul(C,Q)|0;b=b+Math.imul(C,O)|0;b=b+Math.imul(A,Q)|0;c=c+Math.imul(A,O)|0;f=f+Math.imul(y,R)|0;b=b+Math.imul(y, +ga)|0;b=b+Math.imul(J,R)|0;c=c+Math.imul(J,ga)|0;f=f+Math.imul(g,ca)|0;b=b+Math.imul(g,U)|0;b=b+Math.imul(l,ca)|0;c=c+Math.imul(l,U)|0;f=f+Math.imul(w,aa)|0;b=b+Math.imul(w,ba)|0;b=b+Math.imul(u,aa)|0;c=c+Math.imul(u,ba)|0;f=f+Math.imul(v,X)|0;b=b+Math.imul(v,ha)|0;b=b+Math.imul(F,X)|0;c=c+Math.imul(F,ha)|0;f=f+Math.imul(E,Y)|0;b=b+Math.imul(E,ia)|0;b=b+Math.imul(B,Y)|0;c=c+Math.imul(B,ia)|0;f=f+Math.imul(r,da)|0;b=b+Math.imul(r,ea)|0;b=b+Math.imul(q,da)|0;c=c+Math.imul(q,ea)|0;f=f+Math.imul(m,d)| +0;b=b+Math.imul(m,fa)|0;b=b+Math.imul(p,d)|0;c=c+Math.imul(p,fa)|0;m=(n+f|0)+((b&8191)<<13)|0;n=(c+(b>>>13)|0)+(m>>>26)|0;m&=67108863;f=Math.imul(a,Q);b=Math.imul(a,O);b=b+Math.imul(G,Q)|0;c=Math.imul(G,O);f=f+Math.imul(C,R)|0;b=b+Math.imul(C,ga)|0;b=b+Math.imul(A,R)|0;c=c+Math.imul(A,ga)|0;f=f+Math.imul(y,ca)|0;b=b+Math.imul(y,U)|0;b=b+Math.imul(J,ca)|0;c=c+Math.imul(J,U)|0;f=f+Math.imul(g,aa)|0;b=b+Math.imul(g,ba)|0;b=b+Math.imul(l,aa)|0;c=c+Math.imul(l,ba)|0;f=f+Math.imul(w,X)|0;b=b+Math.imul(w, +ha)|0;b=b+Math.imul(u,X)|0;c=c+Math.imul(u,ha)|0;f=f+Math.imul(v,Y)|0;b=b+Math.imul(v,ia)|0;b=b+Math.imul(F,Y)|0;c=c+Math.imul(F,ia)|0;f=f+Math.imul(E,da)|0;b=b+Math.imul(E,ea)|0;b=b+Math.imul(B,da)|0;c=c+Math.imul(B,ea)|0;f=f+Math.imul(r,d)|0;b=b+Math.imul(r,fa)|0;b=b+Math.imul(q,d)|0;c=c+Math.imul(q,fa)|0;r=(n+f|0)+((b&8191)<<13)|0;n=(c+(b>>>13)|0)+(r>>>26)|0;r&=67108863;f=Math.imul(a,R);b=Math.imul(a,ga);b=b+Math.imul(G,R)|0;c=Math.imul(G,ga);f=f+Math.imul(C,ca)|0;b=b+Math.imul(C,U)|0;b=b+Math.imul(A, +ca)|0;c=c+Math.imul(A,U)|0;f=f+Math.imul(y,aa)|0;b=b+Math.imul(y,ba)|0;b=b+Math.imul(J,aa)|0;c=c+Math.imul(J,ba)|0;f=f+Math.imul(g,X)|0;b=b+Math.imul(g,ha)|0;b=b+Math.imul(l,X)|0;c=c+Math.imul(l,ha)|0;f=f+Math.imul(w,Y)|0;b=b+Math.imul(w,ia)|0;b=b+Math.imul(u,Y)|0;c=c+Math.imul(u,ia)|0;f=f+Math.imul(v,da)|0;b=b+Math.imul(v,ea)|0;b=b+Math.imul(F,da)|0;c=c+Math.imul(F,ea)|0;f=f+Math.imul(E,d)|0;b=b+Math.imul(E,fa)|0;b=b+Math.imul(B,d)|0;c=c+Math.imul(B,fa)|0;E=(n+f|0)+((b&8191)<<13)|0;n=(c+(b>>>13)| +0)+(E>>>26)|0;E&=67108863;f=Math.imul(a,ca);b=Math.imul(a,U);b=b+Math.imul(G,ca)|0;c=Math.imul(G,U);f=f+Math.imul(C,aa)|0;b=b+Math.imul(C,ba)|0;b=b+Math.imul(A,aa)|0;c=c+Math.imul(A,ba)|0;f=f+Math.imul(y,X)|0;b=b+Math.imul(y,ha)|0;b=b+Math.imul(J,X)|0;c=c+Math.imul(J,ha)|0;f=f+Math.imul(g,Y)|0;b=b+Math.imul(g,ia)|0;b=b+Math.imul(l,Y)|0;c=c+Math.imul(l,ia)|0;f=f+Math.imul(w,da)|0;b=b+Math.imul(w,ea)|0;b=b+Math.imul(u,da)|0;c=c+Math.imul(u,ea)|0;f=f+Math.imul(v,d)|0;b=b+Math.imul(v,fa)|0;b=b+Math.imul(F, +d)|0;c=c+Math.imul(F,fa)|0;v=(n+f|0)+((b&8191)<<13)|0;n=(c+(b>>>13)|0)+(v>>>26)|0;v&=67108863;f=Math.imul(a,aa);b=Math.imul(a,ba);b=b+Math.imul(G,aa)|0;c=Math.imul(G,ba);f=f+Math.imul(C,X)|0;b=b+Math.imul(C,ha)|0;b=b+Math.imul(A,X)|0;c=c+Math.imul(A,ha)|0;f=f+Math.imul(y,Y)|0;b=b+Math.imul(y,ia)|0;b=b+Math.imul(J,Y)|0;c=c+Math.imul(J,ia)|0;f=f+Math.imul(g,da)|0;b=b+Math.imul(g,ea)|0;b=b+Math.imul(l,da)|0;c=c+Math.imul(l,ea)|0;f=f+Math.imul(w,d)|0;b=b+Math.imul(w,fa)|0;b=b+Math.imul(u,d)|0;c=c+Math.imul(u, +fa)|0;w=(n+f|0)+((b&8191)<<13)|0;n=(c+(b>>>13)|0)+(w>>>26)|0;w&=67108863;f=Math.imul(a,X);b=Math.imul(a,ha);b=b+Math.imul(G,X)|0;c=Math.imul(G,ha);f=f+Math.imul(C,Y)|0;b=b+Math.imul(C,ia)|0;b=b+Math.imul(A,Y)|0;c=c+Math.imul(A,ia)|0;f=f+Math.imul(y,da)|0;b=b+Math.imul(y,ea)|0;b=b+Math.imul(J,da)|0;c=c+Math.imul(J,ea)|0;f=f+Math.imul(g,d)|0;b=b+Math.imul(g,fa)|0;b=b+Math.imul(l,d)|0;c=c+Math.imul(l,fa)|0;g=(n+f|0)+((b&8191)<<13)|0;n=(c+(b>>>13)|0)+(g>>>26)|0;g&=67108863;f=Math.imul(a,Y);b=Math.imul(a, +ia);b=b+Math.imul(G,Y)|0;c=Math.imul(G,ia);f=f+Math.imul(C,da)|0;b=b+Math.imul(C,ea)|0;b=b+Math.imul(A,da)|0;c=c+Math.imul(A,ea)|0;f=f+Math.imul(y,d)|0;b=b+Math.imul(y,fa)|0;b=b+Math.imul(J,d)|0;c=c+Math.imul(J,fa)|0;y=(n+f|0)+((b&8191)<<13)|0;n=(c+(b>>>13)|0)+(y>>>26)|0;y&=67108863;f=Math.imul(a,da);b=Math.imul(a,ea);b=b+Math.imul(G,da)|0;c=Math.imul(G,ea);f=f+Math.imul(C,d)|0;b=b+Math.imul(C,fa)|0;b=b+Math.imul(A,d)|0;c=c+Math.imul(A,fa)|0;C=(n+f|0)+((b&8191)<<13)|0;n=(c+(b>>>13)|0)+(C>>>26)|0; +C&=67108863;f=Math.imul(a,d);b=Math.imul(a,fa);b=b+Math.imul(G,d)|0;c=Math.imul(G,fa);t=(n+f|0)+((b&8191)<<13)|0;n=(c+(b>>>13)|0)+(t>>>26)|0;h[0]=oa;h[1]=pa;h[2]=qa;h[3]=ra;h[4]=sa;h[5]=ta;h[6]=ua;h[7]=va;h[8]=wa;h[9]=k;h[10]=m;h[11]=r;h[12]=E;h[13]=v;h[14]=w;h[15]=g;h[16]=y;h[17]=C;h[18]=t&67108863;0!==n&&(h[19]=n,e.length++);return e};Math.imul||(z=e);h.prototype.mulTo=function(b,c){var a;a=this.length+b.length;if(10===this.length&&10===b.length)a=z(this,b,c);else if(63>a)a=e(this,b,c);else if(1024> +a){c.negative=b.negative^this.negative;c.length=this.length+b.length;for(var d=0,h=a=0;h>>26)|0;a+=f>>>26;f&=67108863}c.words[h]=d;d=f}0!==d?c.words[h]=d:c.length--;a=c.strip()}else a=(new n).mulp(this,b,c);return a};n.prototype.makeRBT=function(b){for(var c=Array(b),e=h.prototype._countBits(b)- +1,a=0;a>=1;return e};n.prototype.permute=function(b,c,e,a,d,h){for(var f=0;f>>=1)d++;return 1<=e))for(var a=0;ae? +0:e/67108864|0;return b};n.prototype.convert13b=function(c,e,a,d){for(var h=0,f=0;f>>=13,a[2*f+1]=h&8191,h>>>=13;for(f=2*e;fc);for(var e=0,a=0;a>26,e=e+(d/67108864|0),e=e+(h>>>26);this.words[a]=h&67108863}0!==e&&(this.words[a]=e,this.length++);return this};h.prototype.muln=function(b){return this.clone().imuln(b)};h.prototype.sqr=function(){return this.mul(this)}; +h.prototype.isqr=function(){return this.imul(this.clone())};h.prototype.pow=function(b){for(var c=Array(b.bitLength()),e=0;e>>a}if(0===c.length)return new h(1);b=this;for(e=0;e>>26-e<<26-e,d;if(0!==e){var h=0;for(d=0;d>>26-e}h&&(this.words[d]=h,this.length++)}if(0!==c){for(d=this.length-1;0<=d;d--)this.words[d+c]=this.words[d];for(d=0;d>>d<h)for(this.length-=h,f=0;f=e);f--){var n=this.words[f]|0;this.words[f]=h<<26-d|n>>>d;h=n&c}a&&0!==h&&(a.words[a.length++]=h);0===this.length&&(this.words[0]=0,this.length=1);return this.strip()};h.prototype.ishrn=function(c,e,a){b(0===this.negative);return this.iushrn(c,e,a)};h.prototype.shln=function(b){return this.clone().ishln(b)}; +h.prototype.ushln=function(b){return this.clone().iushln(b)};h.prototype.shrn=function(b){return this.clone().ishrn(b)};h.prototype.ushrn=function(b){return this.clone().iushrn(b)};h.prototype.testn=function(c){b("number"===typeof c&&0<=c);var e=c%26;c=(c-e)/26;return this.length<=c?!1:!!(this.words[c]&1<>>e<c);if(0>c)return this.isubn(-c);if(0!==this.negative){if(1===this.length&&(this.words[0]|0)c);if(0>c)return this.iaddn(-c);if(0!==this.negative)return this.negative=0,this.iaddn(c),this.negative=1,this;this.words[0]-=c;if(1===this.length&&0>this.words[0])this.words[0]=-this.words[0],this.negative=1;else for(c=0;cthis.words[c];c++)this.words[c]+= +67108864,--this.words[c+1];return this.strip()};h.prototype.addn=function(b){return this.clone().iaddn(b)};h.prototype.subn=function(b){return this.clone().isubn(b)};h.prototype.iabs=function(){this.negative=0;return this};h.prototype.abs=function(){return this.clone().iabs()};h.prototype._ishlnsubmul=function(c,e,a){var d;this._expand(c.length+a);var h,f=0;for(d=0;d>26)-(f/67108864|0),this.words[d+a]=h&67108863;for(;d>26,this.words[d+a]=h&67108863;if(0===f)return this.strip();b(-1===f);for(d=f=0;d>26,this.words[d]=h&67108863;this.negative=1;return this.strip()};h.prototype._wordDiv=function(b,c){var e,a=this.clone(),d=b,f=d.words[d.length-1]|0;e=26-this._countBits(f);0!==e&&(d=d.ushln(e),a.iushln(e),f=d.words[d.length-1]|0);var n=a.length-d.length,m;if("mod"!==c){m=new h(null);m.length=n+1;m.words=Array(m.length);for(var k=0;kthis.length||0>this.cmp(c)?{div:new h(0),mod:this}:1===c.length?"div"===e?{div:this.divn(c.words[0]), +mod:null}:"mod"===e?{div:null,mod:new h(this.modn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new h(this.modn(c.words[0]))}:this._wordDiv(c,e)};h.prototype.div=function(b){return this.divmod(b,"div",!1).div};h.prototype.mod=function(b){return this.divmod(b,"mod",!1).mod};h.prototype.umod=function(b){return this.divmod(b,"mod",!0).mod};h.prototype.divRound=function(b){var c=this.divmod(b);if(c.mod.isZero())return c.div;var e=0!==c.div.negative?c.mod.isub(b):c.mod,a=b.ushrn(1);b=b.andln(1);e=e.cmp(a); +return 0>e||1===b&&0===e?c.div:0!==c.div.negative?c.div.isubn(1):c.div.iaddn(1)};h.prototype.modn=function(c){b(67108863>=c);for(var e=67108864%c,a=0,d=this.length-1;0<=d;d--)a=(e*a+(this.words[d]|0))%c;return a};h.prototype.idivn=function(c){b(67108863>=c);for(var e=0,a=this.length-1;0<=a;a--)e=(this.words[a]|0)+67108864*e,this.words[a]=e/c|0,e%=c;return this.strip()};h.prototype.divn=function(b){return this.clone().idivn(b)};h.prototype.egcd=function(c){b(0===c.negative);b(!c.isZero());var e=this, +a=c.clone(),e=0!==e.negative?e.umod(c):e.clone();c=new h(1);for(var d=new h(0),f=new h(0),n=new h(1),m=0;e.isEven()&&a.isEven();)e.iushrn(1),a.iushrn(1),++m;for(var k=a.clone(),t=e.clone();!e.isZero();){for(var r=0,p=1;0===(e.words[0]&p)&&26>r;++r,p<<=1);if(0r;++r,p<<=1);if(0m;++m,k<<=1);if(0m;++m,k<<=1);if(0e.cmpn(0)&&e.iadd(c);return e};h.prototype.gcd=function(b){if(this.isZero())return b.abs();if(b.isZero())return this.abs();var c=this.clone();b=b.clone();c.negative=0;for(var e=b.negative=0;c.isEven()&&b.isEven();e++)c.iushrn(1),b.iushrn(1);do{for(;c.isEven();)c.iushrn(1);for(;b.isEven();)b.iushrn(1);var a=c.cmp(b);if(0>a)a=c,c=b,b=a;else if(0===a||0===b.cmpn(1))break;c.isub(b)}while(1);return b.iushln(e)};h.prototype.invm= +function(b){return this.egcd(b).a.umod(b)};h.prototype.isEven=function(){return 0===(this.words[0]&1)};h.prototype.isOdd=function(){return 1===(this.words[0]&1)};h.prototype.andln=function(b){return this.words[0]&b};h.prototype.bincn=function(c){b("number"===typeof c);var e=c%26;c=(c-e)/26;e=1<>>26,a=a&67108863;this.words[c]=a}0!==e&&(this.words[c]=e,this.length++);return this}; +h.prototype.isZero=function(){return 1===this.length&&0===this.words[0]};h.prototype.cmpn=function(c){var e=0>c;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();1=c,"Number is too big"),e=this.words[0]|0,c=e===c?0:eb.length)return 1;if(this.lengthd&&(c=1);break}}return c};h.prototype.gtn=function(b){return 1===this.cmpn(b)};h.prototype.gt=function(b){return 1===this.cmp(b)};h.prototype.gten=function(b){return 0<=this.cmpn(b)};h.prototype.gte=function(b){return 0<=this.cmp(b)};h.prototype.ltn=function(b){return-1===this.cmpn(b)};h.prototype.lt=function(b){return-1===this.cmp(b)}; +h.prototype.lten=function(b){return 0>=this.cmpn(b)};h.prototype.lte=function(b){return 0>=this.cmp(b)};h.prototype.eqn=function(b){return 0===this.cmpn(b)};h.prototype.eq=function(b){return 0===this.cmp(b)};h.red=function(b){return new g(b)};h.prototype.toRed=function(c){b(!this.red,"Already a number in reduction context");b(0===this.negative,"red works only with positives");return c.convertTo(this)._forceRed(c)};h.prototype.fromRed=function(){b(this.red,"fromRed works only with numbers in reduction context"); +return this.red.convertFrom(this)};h.prototype._forceRed=function(b){this.red=b;return this};h.prototype.forceRed=function(c){b(!this.red,"Already a number in reduction context");return this._forceRed(c)};h.prototype.redAdd=function(c){b(this.red,"redAdd works only with red numbers");return this.red.add(this,c)};h.prototype.redIAdd=function(c){b(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,c)};h.prototype.redSub=function(c){b(this.red,"redSub works only with red numbers"); +return this.red.sub(this,c)};h.prototype.redISub=function(c){b(this.red,"redISub works only with red numbers");return this.red.isub(this,c)};h.prototype.redShl=function(c){b(this.red,"redShl works only with red numbers");return this.red.shl(this,c)};h.prototype.redMul=function(c){b(this.red,"redMul works only with red numbers");this.red._verify2(this,c);return this.red.mul(this,c)};h.prototype.redIMul=function(c){b(this.red,"redMul works only with red numbers");this.red._verify2(this,c);return this.red.imul(this, +c)};h.prototype.redSqr=function(){b(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};h.prototype.redISqr=function(){b(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};h.prototype.redSqrt=function(){b(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};h.prototype.redInvm=function(){b(this.red,"redInvm works only with red numbers");this.red._verify1(this); +return this.red.invm(this)};h.prototype.redNeg=function(){b(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};h.prototype.redPow=function(c){b(this.red&&!c.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,c)};var G={k256:null,p224:null,p192:null,p25519:null};t.prototype._tmp=function(){var b=new h(null);b.words=Array(Math.ceil(this.n/13));return b};t.prototype.ireduce=function(b){var c;do this.split(b,this.tmp),b=this.imulK(b), +b=b.iadd(this.tmp),c=b.bitLength();while(c>this.n);c=c=b.length)b.words[0]=0,b.length=1;else{e=b.words[9];c.words[c.length++]=e&4194303;for(a=10;a>>22;e=d}e>>>=22;b.words[a-10]=e;b.length=0===e&&10>>26;b.words[e]=a}0!==c&&(b.words[b.length++]=c);return b};h._prime=function(b){if(G[b])return G[b];var c;if("k256"===b)c=new r;else if("p224"===b)c=new p;else if("p192"===b)c=new B;else if("p25519"===b)c=new q;else throw Error("Unknown prime "+b);return G[b]=c};g.prototype._verify1=function(c){b(0===c.negative,"red works only with positives");b(c.red,"red works only with red numbers")};g.prototype._verify2=function(c,e){b(0===(c.negative|e.negative),"red works only with positives"); +b(c.red&&c.red===e.red,"red works only with red numbers")};g.prototype.imod=function(b){return this.prime?this.prime.ireduce(b)._forceRed(this):b.umod(this.m)._forceRed(this)};g.prototype.neg=function(b){return b.isZero()?b.clone():this.m.sub(b)._forceRed(this)};g.prototype.add=function(b,c){this._verify2(b,c);var e=b.add(c);0<=e.cmp(this.m)&&e.isub(this.m);return e._forceRed(this)};g.prototype.iadd=function(b,c){this._verify2(b,c);var e=b.iadd(c);0<=e.cmp(this.m)&&e.isub(this.m);return e};g.prototype.sub= +function(b,c){this._verify2(b,c);var e=b.sub(c);0>e.cmpn(0)&&e.iadd(this.m);return e._forceRed(this)};g.prototype.isub=function(b,c){this._verify2(b,c);var e=b.isub(c);0>e.cmpn(0)&&e.iadd(this.m);return e};g.prototype.shl=function(b,c){this._verify1(b);return this.imod(b.ushln(c))};g.prototype.imul=function(b,c){this._verify2(b,c);return this.imod(b.imul(c))};g.prototype.mul=function(b,c){this._verify2(b,c);return this.imod(b.mul(c))};g.prototype.isqr=function(b){return this.imul(b,b.clone())};g.prototype.sqr= +function(b){return this.mul(b,b)};g.prototype.sqrt=function(c){if(c.isZero())return c.clone();var e=this.m.andln(3);b(1===e%2);if(3===e)return e=this.m.add(new h(1)).iushrn(2),this.pow(c,e);for(var a=this.m.subn(1),d=0;!a.isZero()&&0===a.andln(1);)d++,a.iushrn(1);b(!a.isZero());for(var e=(new h(1)).toRed(this),f=e.redNeg(),n=this.m.subn(1).iushrn(1),m=this.m.bitLength(),m=(new h(2*m*m)).toRed(this);0!==this.pow(m,n).cmp(f);)m.redIAdd(f);n=this.pow(m,a);f=this.pow(c,a.addn(1).iushrn(1));c=this.pow(c, +a);for(a=d;0!==c.cmp(e);){m=c;for(d=0;0!==m.cmp(e);d++)m=m.redSqr();b(d>m&1;d!==e[0]&&(d=this.sqr(d));if(0===t&&0===f)n=0;else if(f<<=1,f|=t,n++,4===n||0===a&&0===m)d=this.mul(d,e[f]),f=n=0}m=26}return d};g.prototype.convertTo=function(b){var c=b.umod(this.m);return c===b?c.clone():c};g.prototype.convertFrom=function(b){b=b.clone();b.red=null;return b};h.mont=function(b){return new u(b)};d(u,g);u.prototype.convertTo=function(b){return this.imod(b.ushln(this.shift))}; +u.prototype.convertFrom=function(b){b=this.imod(b.mul(this.rinv));b.red=null;return b};u.prototype.imul=function(b,c){if(b.isZero()||c.isZero())return b.words[0]=0,b.length=1,b;var e=b.imul(c),a=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=e=e.isub(a).iushrn(this.shift);0<=e.cmp(this.m)?a=e.isub(this.m):0>e.cmpn(0)&&(a=e.iadd(this.m));return a._forceRed(this)};u.prototype.mul=function(b,c){if(b.isZero()||c.isZero())return(new h(0))._forceRed(this);var e=b.mul(c),a=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), +a=e=e.isub(a).iushrn(this.shift);0<=e.cmp(this.m)?a=e.isub(this.m):0>e.cmpn(0)&&(a=e.iadd(this.m));return a._forceRed(this)};u.prototype.invm=function(b){return this.imod(b._invmp(this.m).mul(this.r2))._forceRed(this)}})("undefined"===typeof l||l,this)},{}],19:[function(a,l,g){function f(b){this.rand=b}var k;l.exports=function(b){k||(k=new f(null));return k.generate(b)};l.exports.Rand=f;f.prototype.generate=function(b){return this._rand(b)};f.prototype._rand=function(b){if(this.rand.getBytes)return this.rand.getBytes(b); +b=new Uint8Array(b);for(var a=0;ac||0>b?(e=Math.abs(b)%c,0>b?c-e:e):b}function b(b){for(;0c;b=++c)128>b?k.push(b<<1):k.push(b<<1^283);for(m=f=e=0;256>m;++m)b=f^f<<1^f<<2^f<<3^f<<4,b=b>>>8^b&255^99,this.SBOX[e]=b,this.INV_SBOX[b]=e,a=k[e],d=k[a],h=k[d],c=257*k[b]^16843008*b,this.SUB_MIX[0][e]=c<<24|c>>>8,this.SUB_MIX[1][e]=c<<16|c>>>16,this.SUB_MIX[2][e]=c<<8|c>>> +24,this.SUB_MIX[3][e]=c,c=16843009*h^65537*d^257*a^16843008*e,this.INV_SUB_MIX[0][b]=c<<24|c>>>8,this.INV_SUB_MIX[1][b]=c<<16|c>>>16,this.INV_SUB_MIX[2][b]=c<<8|c>>>24,this.INV_SUB_MIX[3][b]=c,0===e?e=f=1:(e=a^k[k[k[h^a]]],f^=k[k[f]]);return!0};var e=new d;m.blockSize=16;m.prototype.blockSize=m.blockSize;m.keySize=32;m.prototype.keySize=m.keySize;m.prototype._doReset=function(){var b,c,a,d,h;c=this._key;b=c.length;this._nRounds=b+6;d=4*(this._nRounds+1);this._keySchedule=[];for(a=0;a>>24,h=e.SBOX[h>>>24]<<24|e.SBOX[h>>>16&255]<<16|e.SBOX[h>>>8&255]<<8|e.SBOX[h&255],h^=e.RCON[a/b|0]<<24):6>>24]<<24|e.SBOX[h>>>16&255]<<16|e.SBOX[h>>>8&255]<<8|e.SBOX[h&255]:void 0,this._keySchedule[a-b]^h);this._invKeySchedule=[];for(b=0;bb||4>=a?h:e.INV_SUB_MIX[0][e.SBOX[h>>>24]]^e.INV_SUB_MIX[1][e.SBOX[h>>>16&255]]^e.INV_SUB_MIX[2][e.SBOX[h>>>8&255]]^ +e.INV_SUB_MIX[3][e.SBOX[h&255]];return!0};m.prototype.encryptBlock=function(b){b=h(new a(b));b=this._doCryptBlock(b,this._keySchedule,e.SUB_MIX,e.SBOX);var c=new a(16);c.writeUInt32BE(b[0],0);c.writeUInt32BE(b[1],4);c.writeUInt32BE(b[2],8);c.writeUInt32BE(b[3],12);return c};m.prototype.decryptBlock=function(b){b=h(new a(b));var c=[b[3],b[1]];b[1]=c[0];b[3]=c[1];b=this._doCryptBlock(b,this._invKeySchedule,e.INV_SUB_MIX,e.INV_SBOX);c=new a(16);c.writeUInt32BE(b[0],0);c.writeUInt32BE(b[3],4);c.writeUInt32BE(b[2], +8);c.writeUInt32BE(b[1],12);return c};m.prototype.scrub=function(){b(this._keySchedule);b(this._invKeySchedule);b(this._key)};m.prototype._doCryptBlock=function(b,c,e,a){var d,h,m,n,k,t,r;d=b[0]^c[0];h=b[1]^c[1];m=b[2]^c[2];n=b[3]^c[3];b=4;for(var p=1;p>>24]^e[1][h>>>16&255]^e[2][m>>>8&255]^e[3][n&255]^c[b++],t=e[0][h>>>24]^e[1][m>>>16&255]^e[2][n>>>8&255]^e[3][d&255]^c[b++],r=e[0][m>>>24]^e[1][n>>>16&255]^e[2][d>>>8&255]^e[3][h&255]^c[b++],n=e[0][n>>>24]^e[1][d>>>16&255]^ +e[2][h>>>8&255]^e[3][m&255]^c[b++],d=k,h=t,m=r;k=(a[d>>>24]<<24|a[h>>>16&255]<<16|a[m>>>8&255]<<8|a[n&255])^c[b++];t=(a[h>>>24]<<24|a[m>>>16&255]<<16|a[n>>>8&255]<<8|a[d&255])^c[b++];r=(a[m>>>24]<<24|a[n>>>16&255]<<16|a[d>>>8&255]<<8|a[h&255])^c[b++];n=(a[n>>>24]<<24|a[d>>>16&255]<<16|a[h>>>8&255]<<8|a[m&255])^c[b++];return[f(k),f(t),f(r),f(n)]};g.AES=m}).call(this,a("buffer").Buffer)},{buffer:49}],22:[function(a,l,g){(function(f){function k(c,a,h,r){if(!(this instanceof k))return new k(c,a,h);d.call(this); +this._finID=f.concat([h,new f([0,0,0,1])]);h=f.concat([h,new f([0,0,0,2])]);this._cipher=new b.AES(a);this._prev=new f(h.length);this._cache=new f("");this._secCache=new f("");this._decrypt=r;this._len=this._alen=0;h.copy(this._prev);this._mode=c;c=new f(4);c.fill(0);this._ghash=new m(this._cipher.encryptBlock(c));this._authTag=null;this._called=!1}var b=a("./aes"),d=a("cipher-base"),h=a("inherits"),m=a("./ghash"),c=a("buffer-xor");h(k,d);l.exports=k;k.prototype._update=function(b){if(!this._called&& +this._alen){var c=16-this._alen%16;16>c&&(c=new f(c),c.fill(0),this._ghash.update(c))}this._called=!0;c=this._mode.encrypt(this,b);this._decrypt?this._ghash.update(b):this._ghash.update(c);this._len+=b.length;return c};k.prototype._final=function(){if(this._decrypt&&!this._authTag)throw Error("Unsupported state or unable to authenticate data");var b=c(this._ghash["final"](8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt){var a=this._authTag,d=0;b.length!==a.length&& +d++;for(var h=Math.min(b.length,a.length),f=-1;++fm||0>b?(c=Math.abs(b)%m,0> +b?m-c:c):b}var h=new a(16);h.fill(0);l.exports=f;f.prototype.ghash=function(b){for(var c=-1;++c++h;){(a=0!==(this.state[~~(h/8)]&1<<7-h%8))&&(e=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]);d=0!==(c[3]&1);for(a=3;0>>1|(c[a-1]&1)<<31;c[0]>>>=1;d&&(c[0]^=-520093696)}this.state=b(e)}; +f.prototype.update=function(b){for(this.cache=a.concat([this.cache,b]);16<=this.cache.length;)b=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(b)};f.prototype["final"]=function(c,e){this.cache.length&&this.ghash(a.concat([this.cache,h],16));this.ghash(b([0,c,0,e]));return this.state};var m=Math.pow(2,32)}).call(this,a("buffer").Buffer)},{buffer:49}],27:[function(a,l,g){g["aes-128-ecb"]={cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"};g["aes-192-ecb"]={cipher:"AES",key:192,iv:0, +mode:"ECB",type:"block"};g["aes-256-ecb"]={cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"};g["aes-128-cbc"]={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"};g["aes-192-cbc"]={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"};g["aes-256-cbc"]={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"};g.aes128=g["aes-128-cbc"];g.aes192=g["aes-192-cbc"];g.aes256=g["aes-256-cbc"];g["aes-128-cfb"]={cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"};g["aes-192-cfb"]={cipher:"AES",key:192,iv:16,mode:"CFB", +type:"stream"};g["aes-256-cfb"]={cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"};g["aes-128-cfb8"]={cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"};g["aes-192-cfb8"]={cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"};g["aes-256-cfb8"]={cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"};g["aes-128-cfb1"]={cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"};g["aes-192-cfb1"]={cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"};g["aes-256-cfb1"]={cipher:"AES",key:256,iv:16,mode:"CFB1", +type:"stream"};g["aes-128-ofb"]={cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"};g["aes-192-ofb"]={cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"};g["aes-256-ofb"]={cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"};g["aes-128-ctr"]={cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"};g["aes-192-ctr"]={cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"};g["aes-256-ctr"]={cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"};g["aes-128-gcm"]={cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"}; +g["aes-192-gcm"]={cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"};g["aes-256-gcm"]={cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},{}],28:[function(a,l,g){var f=a("buffer-xor");g.encrypt=function(a,b){var d=f(b,a._prev);a._prev=a._cipher.encryptBlock(d);return a._prev};g.decrypt=function(a,b){var d=a._prev;a._prev=b;var h=a._cipher.decryptBlock(b);return f(h,d)}},{"buffer-xor":48}],29:[function(a,l,g){(function(f){function k(a,h,m){var c=h.length,e=b(h,a._cache);a._cache=a._cache.slice(c); +a._prev=f.concat([a._prev,m?h:e]);return e}var b=a("buffer-xor");g.encrypt=function(b,a,m){for(var c=new f(""),e;a.length;)if(0===b._cache.length&&(b._cache=b._cipher.encryptBlock(b._prev),b._prev=new f("")),b._cache.length<=a.length)e=b._cache.length,c=f.concat([c,k(b,a.slice(0,e),m)]),a=a.slice(e);else{c=f.concat([c,k(b,a,m)]);break}return c}}).call(this,a("buffer").Buffer)},{buffer:49,"buffer-xor":48}],30:[function(a,l,g){(function(a){g.encrypt=function(f,b,d){for(var h=b.length,m=new a(h),c=-1;++c< +h;){for(var e=c,n,k,r,p=f,B=b[c],q=d,g=-1,u=0;8>++g;){r=p._cipher.encryptBlock(p._prev);k=B&1<<7-g?128:0;n=r[0]^k;u+=(n&128)>>g%8;r=p;var v=p._prev;k=q?k:n;n=v.length;for(var w=-1,l=new a(v.length),v=a.concat([v,new a([k])]);++w>7;r._prev=l}m[e]=u}return m}}).call(this,a("buffer").Buffer)},{buffer:49}],31:[function(a,l,g){(function(a){g.encrypt=function(f,b,d){for(var h=b.length,m=new a(h),c=-1;++c=b.cmpn(0))throw Error("invalid sig");if(b.cmp(c)>=c)throw Error("invalid sig");}var b=a("./curves"),d=a("elliptic"),h=a("parse-asn1"),m=a("bn.js"),c=d.ec;l.exports=function(e,a,d,r){d=h(d);if("ec"===d.type){if("ecdsa"!==r)throw Error("wrong public key type");r=b[d.data.algorithm.curve.join(".")];if(!r)throw Error("unknown curve "+d.data.algorithm.curve.join("."));return(new c(r)).verify(a, +e,d.data.subjectPrivateKey.data)}if("dsa"===d.type){if("dsa"!==r)throw Error("wrong public key type");r=d.data.p;var n=d.data.q,t=d.data.g;d=d.data.pub_key;var q=h.signature.decode(e,"der");e=q.s;q=q.r;k(e,n);k(q,n);var g=m.mont(r);e=e.invm(n);return!t.toRed(g).redPow((new m(a)).mul(e).mod(n)).fromRed().mul(d.toRed(g).redPow(q.mul(e).mod(n)).fromRed()).mod(r).mod(n).cmp(q)}if("rsa"!==r)throw Error("wrong public key type");t=d.modulus.byteLength();r=[1];for(n=0;a.length+r.length+2n&&(a=1);t=Math.min(e.length,r.length);e.length!==r.length&&(a=1);for(q=-1;++qg.UNZIP)throw new TypeError("Bad argument");this.mode= +b;this.pending_close=this.write_in_progress=this.init_done=!1;this.strategy=this.memLevel=this.level=this.windowBits=0;this.dictionary=null}function d(b,c){for(var e=0;eg.Z_MAX_CHUNK))throw Error("Invalid chunk size: "+b.chunkSize);if(b.windowBits&&(b.windowBitsg.Z_MAX_WINDOWBITS))throw Error("Invalid windowBits: "+b.windowBits);if(b.level&&(b.levelg.Z_MAX_LEVEL))throw Error("Invalid compression level: "+ +b.level);if(b.memLevel&&(b.memLevelg.Z_MAX_MEMLEVEL))throw Error("Invalid memLevel: "+b.memLevel);if(b.strategy&&b.strategy!=g.Z_FILTERED&&b.strategy!=g.Z_HUFFMAN_ONLY&&b.strategy!=g.Z_RLE&&b.strategy!=g.Z_FIXED&&b.strategy!=g.Z_DEFAULT_STRATEGY)throw Error("Invalid strategy: "+b.strategy);if(b.dictionary&&!k.isBuffer(b.dictionary))throw Error("Invalid dictionary: it should be a Buffer instance");this._binding=new q.Zlib(c);var e=this;this._hadError=!1;this._binding.onerror= +function(b,c){e._binding=null;e._hadError=!0;var a=Error(b);a.errno=c;a.code=g.codes[c];e.emit("error",a)};var a=g.Z_DEFAULT_COMPRESSION;"number"===typeof b.level&&(a=b.level);var d=g.Z_DEFAULT_STRATEGY;"number"===typeof b.strategy&&(d=b.strategy);this._binding.init(b.windowBits||g.Z_DEFAULT_WINDOWBITS,a,b.memLevel||g.Z_DEFAULT_MEMLEVEL,d,b.dictionary);this._buffer=new k(this._chunkSize);this._offset=0;this._closed=!1;this._level=a;this._strategy=d;this.once("end",this.close)}var B=a("_stream_transform"), +q=a("./binding"),l=a("util"),u=a("assert").ok;q.Z_MIN_WINDOWBITS=8;q.Z_MAX_WINDOWBITS=15;q.Z_DEFAULT_WINDOWBITS=15;q.Z_MIN_CHUNK=64;q.Z_MAX_CHUNK=Infinity;q.Z_DEFAULT_CHUNK=16384;q.Z_MIN_MEMLEVEL=1;q.Z_MAX_MEMLEVEL=9;q.Z_DEFAULT_MEMLEVEL=8;q.Z_MIN_LEVEL=-1;q.Z_MAX_LEVEL=9;q.Z_DEFAULT_LEVEL=q.Z_DEFAULT_COMPRESSION;Object.keys(q).forEach(function(b){b.match(/^Z/)&&(g[b]=q[b])});g.codes={Z_OK:q.Z_OK,Z_STREAM_END:q.Z_STREAM_END,Z_NEED_DICT:q.Z_NEED_DICT,Z_ERRNO:q.Z_ERRNO,Z_STREAM_ERROR:q.Z_STREAM_ERROR, +Z_DATA_ERROR:q.Z_DATA_ERROR,Z_MEM_ERROR:q.Z_MEM_ERROR,Z_BUF_ERROR:q.Z_BUF_ERROR,Z_VERSION_ERROR:q.Z_VERSION_ERROR};Object.keys(g.codes).forEach(function(b){g.codes[g.codes[b]]=b});g.Deflate=h;g.Inflate=m;g.Gzip=c;g.Gunzip=e;g.DeflateRaw=n;g.InflateRaw=t;g.Unzip=r;g.createDeflate=function(b){return new h(b)};g.createInflate=function(b){return new m(b)};g.createDeflateRaw=function(b){return new n(b)};g.createInflateRaw=function(b){return new t(b)};g.createGzip=function(b){return new c(b)};g.createGunzip= +function(b){return new e(b)};g.createUnzip=function(b){return new r(b)};g.deflate=function(c,e,a){"function"===typeof e&&(a=e,e={});return b(new h(e),c,a)};g.deflateSync=function(b,c){return d(new h(c),b)};g.gzip=function(e,a,d){"function"===typeof a&&(d=a,a={});return b(new c(a),e,d)};g.gzipSync=function(b,e){return d(new c(e),b)};g.deflateRaw=function(c,e,a){"function"===typeof e&&(a=e,e={});return b(new n(e),c,a)};g.deflateRawSync=function(b,c){return d(new n(c),b)};g.unzip=function(c,e,a){"function"=== +typeof e&&(a=e,e={});return b(new r(e),c,a)};g.unzipSync=function(b,c){return d(new r(c),b)};g.inflate=function(c,e,a){"function"===typeof e&&(a=e,e={});return b(new m(e),c,a)};g.inflateSync=function(b,c){return d(new m(c),b)};g.gunzip=function(c,a,d){"function"===typeof a&&(d=a,a={});return b(new e(a),c,d)};g.gunzipSync=function(b,c){return d(new e(c),b)};g.inflateRaw=function(c,e,a){"function"===typeof e&&(a=e,e={});return b(new t(e),c,a)};g.inflateRawSync=function(b,c){return d(new t(c),b)};l.inherits(p, +B);p.prototype.params=function(b,c,e){if(bg.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+b);if(c!=g.Z_FILTERED&&c!=g.Z_HUFFMAN_ONLY&&c!=g.Z_RLE&&c!=g.Z_FIXED&&c!=g.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+c);if(this._level!==b||this._strategy!==c){var a=this;this.flush(q.Z_SYNC_FLUSH,function(){a._binding.params(b,c);a._hadError||(a._level=b,a._strategy=c,e&&e())})}else f.nextTick(e)};p.prototype.reset=function(){return this._binding.reset()}; +p.prototype._flush=function(b){this._transform(new k(0),"",b)};p.prototype.flush=function(b,c){var e=this._writableState;if("function"===typeof b||void 0===b&&!c)c=b,b=q.Z_FULL_FLUSH;if(e.ended)c&&f.nextTick(c);else if(e.ending){if(c)this.once("end",c)}else if(e.needDrain){var a=this;this.once("drain",function(){a.flush(c)})}else this._flushFlag=b,this.write(new k(0),"",c)};p.prototype.close=function(b){b&&f.nextTick(b);if(!this._closed){this._closed=!0;this._binding.close();var c=this;f.nextTick(function(){c.emit("close")})}}; +p.prototype._transform=function(b,c,e){var a=this._writableState;!a.ending&&!a.ended||b&&a.length!==b.length?(c=this._flushFlag,b.length>=a.length&&(this._flushFlag=this._opts.flush||q.Z_NO_FLUSH)):c=q.Z_FINISH;this._processChunk(b,c,e)};p.prototype._processChunk=function(b,c,e){function a(p,q){if(!m._hadError){var E=h-q;u(0<=E,"have should not go down");if(0=m._chunkSize)h=m._chunkSize, +m._offset=0,m._buffer=new k(m._chunkSize);if(0===q){f+=d-p;d=p;if(!n)return!0;E=m._binding.write(c,b,f,d,m._buffer,m._offset,m._chunkSize);E.callback=a;E.buffer=b}else{if(!n)return!1;e()}}}var d=b&&b.length,h=this._chunkSize-this._offset,f=0,m=this,n="function"===typeof e;if(!n){var t=[],r=0,p;this.on("error",function(b){p=b});do var q=this._binding.writeSync(c,b,f,d,this._buffer,this._offset,h);while(!this._hadError&&a(q[0],q[1]));if(this._hadError)throw p;q=k.concat(t,r);this.close();return q}q= +this._binding.write(c,b,f,d,this._buffer,this._offset,h);q.buffer=b;q.callback=a};l.inherits(h,p);l.inherits(m,p);l.inherits(c,p);l.inherits(e,p);l.inherits(n,p);l.inherits(t,p);l.inherits(r,p)}).call(this,a("_process"),a("buffer").Buffer)},{"./binding":45,_process:124,_stream_transform:145,assert:16,buffer:49,util:168}],47:[function(a,l,g){(function(f){var k=a("buffer"),b=k.Buffer,d=k.SlowBuffer,h=k.kMaxLength||2147483647;g.alloc=function(a,c,e){if("function"===typeof b.alloc)return b.alloc(a,c, +e);if("number"===typeof e)throw new TypeError("encoding must not be number");if("number"!==typeof a)throw new TypeError("size must be a number");if(a>h)throw new RangeError("size is too large");var d=c;void 0===d&&(e=void 0,d=0);c=new b(a);if("string"===typeof d){e=new b(d,e);for(var d=e.length,f=-1;++f +h)throw new RangeError("size is too large");return new b(a)};g.from=function(a,c,e){if("function"===typeof b.from&&(!f.Uint8Array||Uint8Array.from!==b.from))return b.from(a,c,e);if("number"===typeof a)throw new TypeError('"value" argument must not be a number');if("string"===typeof a)return new b(a,c);if("undefined"!==typeof ArrayBuffer&&a instanceof ArrayBuffer){var d=c;if(1===arguments.length)return new b(a);"undefined"===typeof d&&(d=0);var h=e;"undefined"===typeof h&&(h=a.byteLength-d);if(d>= +a.byteLength)throw new RangeError("'offset' is out of bounds");if(h>a.byteLength-d)throw new RangeError("'length' is out of bounds");return new b(a.slice(d,d+h))}if(b.isBuffer(a))return d=new b(a.length),a.copy(d,0,0,a.length),d;if(a){if(Array.isArray(a)||"undefined"!==typeof ArrayBuffer&&a.buffer instanceof ArrayBuffer||"length"in a)return new b(a);if("Buffer"===a.type&&Array.isArray(a.data))return new b(a.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object."); +};g.allocUnsafeSlow=function(a){if("function"===typeof b.allocUnsafeSlow)return b.allocUnsafeSlow(a);if("number"!==typeof a)throw new TypeError("size must be a number");if(a>=h)throw new RangeError("size is too large");return new d(a)}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{buffer:49}],48:[function(a,l,g){(function(a){l.exports=function(f,b){for(var d=Math.min(f.length,b.length),h=new a(d),m=0;mx)throw new RangeError("Invalid typed array length");b=new Uint8Array(b);b.__proto__=k.prototype;return b}function k(c,e,a){if("number"===typeof c){if("string"===typeof e)throw Error("If encoding is specified then the first argument must be a string");return h(c)}return b(c,e,a)}function b(b,e,a){if("number"===typeof b)throw new TypeError('"value" argument must not be a number');if(b instanceof ArrayBuffer){if(0>e||b.byteLength< +e)throw new RangeError("'offset' is out of bounds");if(b.byteLengthb)throw new RangeError('"size" argument must not be negative');}function h(b){d(b);return f(0>b?0:e(b)|0)}function m(b){for(var c=0>b.length?0:e(b.length)|0,a=f(c),d=0;d=x)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+x.toString(16)+" bytes");return b|0}function n(b,c){if(k.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||b instanceof ArrayBuffer)return b.byteLength;"string"!==typeof b&&(b=""+b);var e=b.length;if(0===e)return 0;for(var a=!1;;)switch(c){case "ascii":case "latin1":case "binary":return e; +case "utf8":case "utf-8":case void 0:return z(b).length;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*e;case "hex":return e>>>1;case "base64":return E.toByteArray(A(b)).length;default:if(a)return z(b).length;c=(""+c).toLowerCase();a=!0}}function t(b,c,e){var a=!1;if(void 0===c||0>c)c=0;if(c>this.length)return"";if(void 0===e||e>this.length)e=this.length;if(0>=e)return"";e>>>=0;c>>>=0;if(e<=c)return"";for(b||(b="utf8");;)switch(b){case "hex":b=c;c=e;e=this.length;if(!b||0>b)b=0; +if(!c||0>c||c>e)c=e;a="";for(e=b;ea?"0"+a.toString(16):a.toString(16),a=b+a;return a;case "utf8":case "utf-8":return q(this,c,e);case "ascii":b="";for(e=Math.min(this.length,e);ce&&(e=-2147483648);e=+e;isNaN(e)&&(e=d?0:b.length-1);0>e&&(e=b.length+e);if(e>=b.length){if(d)return-1;e=b.length-1}else if(0>e)if(d)e=0;else return-1;"string"=== +typeof c&&(c=k.from(c,a));if(k.isBuffer(c))return 0===c.length?-1:B(b,c,e,a,d);if("number"===typeof c)return c&=255,"function"===typeof Uint8Array.prototype.indexOf?d?Uint8Array.prototype.indexOf.call(b,c,e):Uint8Array.prototype.lastIndexOf.call(b,c,e):B(b,[c],e,a,d);throw new TypeError("val must be string, number or Buffer");}function B(b,c,e,a,d){function h(b,c){return 1===f?b[c]:b.readUInt16BE(c*f)}var f=1,m=b.length,n=c.length;if(void 0!==a&&(a=String(a).toLowerCase(),"ucs2"===a||"ucs-2"===a|| +"utf16le"===a||"utf-16le"===a)){if(2>b.length||2>c.length)return-1;f=2;m/=2;n/=2;e/=2}if(d)for(a=-1;em&&(e=m-n);0<=e;e--){m=!0;for(a=0;ad&&(h=d);break;case 2:m=b[c+1];128===(m& +192)&&(d=(d&31)<<6|m&63,127d||57343d&&(h=d))}}null===h?(h=65533,f=1):65535>>10&1023|55296),h=56320|h&1023);a.push(h);c+=f}b=a.length;if(b<=H)a=String.fromCharCode.apply(String,a);else{e="";for(c=0;cb)throw new RangeError("offset is not uint");if(b+c>e)throw new RangeError("Trying to access beyond buffer length");}function u(b,c,e,a,d,h){if(!k.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>d||cb.length)throw new RangeError("Index out of range");}function v(b,c,e,a,d,h){if(e+a>b.length)throw new RangeError("Index out of range"); +if(0>e)throw new RangeError("Index out of range");}function w(b,c,e,a,d){c=+c;e>>>=0;d||v(b,c,e,4,3.4028234663852886E38,-3.4028234663852886E38);J.write(b,c,e,a,23,4);return e+4}function C(b,c,e,a,d){c=+c;e>>>=0;d||v(b,c,e,8,1.7976931348623157E308,-1.7976931348623157E308);J.write(b,c,e,a,52,8);return e+8}function A(b){b=b.trim?b.trim():b.replace(/^\s+|\s+$/g,"");b=b.replace(K,"");if(2>b.length)return"";for(;0!==b.length%4;)b+="=";return b}function z(b,c){c=c||Infinity;for(var e,a=b.length,d=null,h= +[],f=0;fe){if(!d){if(56319e){-1<(c-=3)&&h.push(239,191,189);d=e;continue}e=(d-55296<<10|e-56320)+65536}else d&&-1<(c-=3)&&h.push(239,191,189);d=null;if(128>e){if(0>--c)break;h.push(e)}else if(2048>e){if(0>(c-=2))break;h.push(e>>6|192,e&63|128)}else if(65536>e){if(0>(c-=3))break;h.push(e>>12|224,e>>6&63|128,e&63|128)}else if(1114112> +e){if(0>(c-=4))break;h.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw Error("Invalid code point");}return h}function G(b){for(var c=[],e=0;e=c.length||d>=b.length);++d)c[d+e]=b[d];return d}var E=a("base64-js"),J=a("ieee754");g.Buffer=k;g.SlowBuffer=function(b){+b!=b&&(b=0);return k.alloc(+b)};g.INSPECT_MAX_BYTES=50;var x=2147483647;g.kMaxLength=x;k.TYPED_ARRAY_SUPPORT=function(){try{var b=new Uint8Array(1); +b.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return 42===b.foo()}catch(I){return!1}}();k.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();"undefined"!==typeof Symbol&&Symbol.species&&k[Symbol.species]===k&&($jscomp.initSymbol(), +Object.defineProperty(k,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));k.poolSize=8192;k.from=function(c,e,a){return b(c,e,a)};k.prototype.__proto__=Uint8Array.prototype;k.__proto__=Uint8Array;k.alloc=function(b,c,e){d(b);b=0>=b?f(b):void 0!==c?"string"===typeof e?f(b).fill(c,e):f(b).fill(c):f(b);return b};k.allocUnsafe=function(b){return h(b)};k.allocUnsafeSlow=function(b){return h(b)};k.isBuffer=function(b){return null!=b&&!0===b._isBuffer};k.compare=function(b,c){if(!k.isBuffer(b)|| +!k.isBuffer(c))throw new TypeError("Arguments must be Buffers");if(b===c)return 0;for(var e=b.length,a=c.length,d=0,h=Math.min(e,a);dc&&(b+=" ... "));return""};k.prototype.compare=function(b,c,e,a,d){if(!k.isBuffer(b))throw new TypeError("Argument must be a Buffer");void 0===c&&(c=0);void 0===e&&(e=b?b.length:0);void 0===a&& +(a=0);void 0===d&&(d=this.length);if(0>c||e>b.length||0>a||d>this.length)throw new RangeError("out of range index");if(a>=d&&c>=e)return 0;if(a>=d)return-1;if(c>=e)return 1;c>>>=0;e>>>=0;a>>>=0;d>>>=0;if(this===b)return 0;var h=d-a,f=e-c,m=Math.min(h,f);a=this.slice(a,d);b=b.slice(c,e);for(c=0;c>>=0,isFinite(e)?(e>>>=0,void 0===a&&(a="utf8")):(a=e,e=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var d=this.length-c;if(void 0===e||e>d)e=d;if(0e||0>c)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds"); +a||(a="utf8");for(d=!1;;)switch(a){case "hex":a:{c=Number(c)||0;a=this.length-c;e?(e=Number(e),e>a&&(e=a)):e=a;a=b.length;if(0!==a%2)throw new TypeError("Invalid hex string");e>a/2&&(e=a/2);for(a=0;a(d-=2));++m)h=a.charCodeAt(m),b=h>>8,h%=256,f.push(h),f.push(b);return F(f,this,c,e);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase();d=!0}};k.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var H=4096;k.prototype.slice=function(b,c){var e=this.length;b=~~b;c=void 0===c?e:~~c;0>b?(b+=e,0>b&&(b=0)):b>e&&(b=e);0>c?(c+=e,0>c&&(c=0)):c>e&&(c=e);c>>=0;c>>>=0;e||y(b,c,this.length);e=this[b];for(var a=1,d=0;++d>>=0;c>>>=0;e||y(b,c,this.length);e=this[b+--c];for(var a=1;0>>=0;c||y(b,1,this.length);return this[b]};k.prototype.readUInt16LE=function(b,c){b>>>=0;c||y(b,2,this.length);return this[b]|this[b+1]<<8}; +k.prototype.readUInt16BE=function(b,c){b>>>=0;c||y(b,2,this.length);return this[b]<<8|this[b+1]};k.prototype.readUInt32LE=function(b,c){b>>>=0;c||y(b,4,this.length);return(this[b]|this[b+1]<<8|this[b+2]<<16)+16777216*this[b+3]};k.prototype.readUInt32BE=function(b,c){b>>>=0;c||y(b,4,this.length);return 16777216*this[b]+(this[b+1]<<16|this[b+2]<<8|this[b+3])};k.prototype.readIntLE=function(b,c,e){b>>>=0;c>>>=0;e||y(b,c,this.length);e=this[b];for(var a=1,d=0;++d=128*a&& +(e-=Math.pow(2,8*c));return e};k.prototype.readIntBE=function(b,c,e){b>>>=0;c>>>=0;e||y(b,c,this.length);e=c;for(var a=1,d=this[b+--e];0=128*a&&(d-=Math.pow(2,8*c));return d};k.prototype.readInt8=function(b,c){b>>>=0;c||y(b,1,this.length);return this[b]&128?-1*(255-this[b]+1):this[b]};k.prototype.readInt16LE=function(b,c){b>>>=0;c||y(b,2,this.length);var e=this[b]|this[b+1]<<8;return e&32768?e|4294901760:e};k.prototype.readInt16BE=function(b,c){b>>>=0;c||y(b,2,this.length); +var e=this[b+1]|this[b]<<8;return e&32768?e|4294901760:e};k.prototype.readInt32LE=function(b,c){b>>>=0;c||y(b,4,this.length);return this[b]|this[b+1]<<8|this[b+2]<<16|this[b+3]<<24};k.prototype.readInt32BE=function(b,c){b>>>=0;c||y(b,4,this.length);return this[b]<<24|this[b+1]<<16|this[b+2]<<8|this[b+3]};k.prototype.readFloatLE=function(b,c){b>>>=0;c||y(b,4,this.length);return J.read(this,b,!0,23,4)};k.prototype.readFloatBE=function(b,c){b>>>=0;c||y(b,4,this.length);return J.read(this,b,!1,23,4)}; +k.prototype.readDoubleLE=function(b,c){b>>>=0;c||y(b,8,this.length);return J.read(this,b,!0,52,8)};k.prototype.readDoubleBE=function(b,c){b>>>=0;c||y(b,8,this.length);return J.read(this,b,!1,52,8)};k.prototype.writeUIntLE=function(b,c,e,a){b=+b;c>>>=0;e>>>=0;a||u(this,b,c,e,Math.pow(2,8*e)-1,0);a=1;var d=0;for(this[c]=b&255;++d>>=0;e>>>=0;a||u(this,b,c,e,Math.pow(2,8*e)-1,0);a=e-1;var d=1;for(this[c+a]=b& +255;0<=--a&&(d*=256);)this[c+a]=b/d&255;return c+e};k.prototype.writeUInt8=function(b,c,e){b=+b;c>>>=0;e||u(this,b,c,1,255,0);this[c]=b&255;return c+1};k.prototype.writeUInt16LE=function(b,c,e){b=+b;c>>>=0;e||u(this,b,c,2,65535,0);this[c]=b&255;this[c+1]=b>>>8;return c+2};k.prototype.writeUInt16BE=function(b,c,e){b=+b;c>>>=0;e||u(this,b,c,2,65535,0);this[c]=b>>>8;this[c+1]=b&255;return c+2};k.prototype.writeUInt32LE=function(b,c,e){b=+b;c>>>=0;e||u(this,b,c,4,4294967295,0);this[c+3]=b>>>24;this[c+ +2]=b>>>16;this[c+1]=b>>>8;this[c]=b&255;return c+4};k.prototype.writeUInt32BE=function(b,c,e){b=+b;c>>>=0;e||u(this,b,c,4,4294967295,0);this[c]=b>>>24;this[c+1]=b>>>16;this[c+2]=b>>>8;this[c+3]=b&255;return c+4};k.prototype.writeIntLE=function(b,c,e,a){b=+b;c>>>=0;a||(a=Math.pow(2,8*e-1),u(this,b,c,e,a-1,-a));a=0;var d=1,h=0;for(this[c]=b&255;++ab&&0===h&&0!==this[c+a-1]&&(h=1),this[c+a]=(b/d>>0)-h&255;return c+e};k.prototype.writeIntBE=function(b,c,e,a){b=+b;c>>>=0;a||(a=Math.pow(2, +8*e-1),u(this,b,c,e,a-1,-a));a=e-1;var d=1,h=0;for(this[c+a]=b&255;0<=--a&&(d*=256);)0>b&&0===h&&0!==this[c+a+1]&&(h=1),this[c+a]=(b/d>>0)-h&255;return c+e};k.prototype.writeInt8=function(b,c,e){b=+b;c>>>=0;e||u(this,b,c,1,127,-128);0>b&&(b=255+b+1);this[c]=b&255;return c+1};k.prototype.writeInt16LE=function(b,c,e){b=+b;c>>>=0;e||u(this,b,c,2,32767,-32768);this[c]=b&255;this[c+1]=b>>>8;return c+2};k.prototype.writeInt16BE=function(b,c,e){b=+b;c>>>=0;e||u(this,b,c,2,32767,-32768);this[c]=b>>>8;this[c+ +1]=b&255;return c+2};k.prototype.writeInt32LE=function(b,c,e){b=+b;c>>>=0;e||u(this,b,c,4,2147483647,-2147483648);this[c]=b&255;this[c+1]=b>>>8;this[c+2]=b>>>16;this[c+3]=b>>>24;return c+4};k.prototype.writeInt32BE=function(b,c,e){b=+b;c>>>=0;e||u(this,b,c,4,2147483647,-2147483648);0>b&&(b=4294967295+b+1);this[c]=b>>>24;this[c+1]=b>>>16;this[c+2]=b>>>8;this[c+3]=b&255;return c+4};k.prototype.writeFloatLE=function(b,c,e){return w(this,b,c,!0,e)};k.prototype.writeFloatBE=function(b,c,e){return w(this, +b,c,!1,e)};k.prototype.writeDoubleLE=function(b,c,e){return C(this,b,c,!0,e)};k.prototype.writeDoubleBE=function(b,c,e){return C(this,b,c,!1,e)};k.prototype.copy=function(b,c,e,a){e||(e=0);a||0===a||(a=this.length);c>=b.length&&(c=b.length);c||(c=0);0c)throw new RangeError("targetStart out of bounds");if(0>e||e>=this.length)throw new RangeError("sourceStart out of bounds");if(0>a)throw new RangeError("sourceEnd out of bounds");a> +this.length&&(a=this.length);b.length-cd)for(a=0;ad&&(b=d)}if(void 0!==a&&"string"!==typeof a)throw new TypeError("encoding must be a string"); +if("string"===typeof a&&!k.isEncoding(a))throw new TypeError("Unknown encoding: "+a);}else"number"===typeof b&&(b&=255);if(0>c||this.length>>=0;e=void 0===e?this.length:e>>>0;b||(b=0);if("number"===typeof b)for(a=c;a>5]|=128<>>9<<4)+14]= +a;for(var e=1732584193,f=-271733879,n=-1732584194,g=271733878,q=0;q>>32-h,a)}function b(b,c,a,d,h,f,m){return k(c&a|~c&d,b,c,h,f,m)}function d(b,c,a,d,h,f,m){return k(c&d| +a&~d,b,c,h,f,m)}function h(b,c,a,d,h,f,m){return k(a^(c|~d),b,c,h,f,m)}function m(b,c){var e=(b&65535)+(c&65535);return(b>>16)+(c>>16)+(e>>16)<<16|e&65535}var c=a("./helpers");l.exports=function(b){return c.hash(b,f,16)}},{"./helpers":56}],58:[function(a,l,g){(function(f){function k(c,e){h.call(this);c=c.toLowerCase();"string"===typeof e&&(e=new f(e));var a="sha512"===c||"sha384"===c?128:64;this._alg=c;this._key=e;e.length>a?e=b(c).update(e).digest():e.length>>1],a=d.r28shl(a,k),h=d.r28shl(h,k);d.pc2(a,h,c.keys,f)}};k.prototype._update=function(b,e,a,h){var c=this._desState,f=d.readUInt32BE(b,e);b=d.readUInt32BE(b,e+4);d.ip(f,b,c.tmp,0);f=c.tmp[0];b=c.tmp[1];"encrypt"===this.type?this._encrypt(c,f,b,c.tmp,0):this._decrypt(c,f,b,c.tmp,0);f=c.tmp[0];b=c.tmp[1];d.writeUInt32BE(a,f,h);d.writeUInt32BE(a,b,h+4)};k.prototype._pad=function(b,e){for(var c=b.length-e,a=e;a>>0;e=n}d.rip(a,e,h,f)};k.prototype._decrypt=function(b,e,a,h,f){for(var c=b.keys.length-2;0<=c;c-=2){var m=b.keys[c],n=b.keys[c+1];d.expand(a,b.tmp,0);m^=b.tmp[0];n^=b.tmp[1];m=d.substitute(m,n);m=d.permute(m);n=a;a= +(e^m)>>>0;e=n}d.rip(a,e,h,f)}},{"../des":60,inherits:98,"minimalistic-assert":102}],64:[function(a,l,g){function f(a,c){b.equal(c.length,24,"Invalid key length");var e=c.slice(0,8),d=c.slice(8,16),f=c.slice(16,24);this.ciphers="encrypt"===a?[h.create({type:"encrypt",key:e}),h.create({type:"decrypt",key:d}),h.create({type:"encrypt",key:f})]:[h.create({type:"decrypt",key:f}),h.create({type:"encrypt",key:d}),h.create({type:"decrypt",key:e})]}function k(b){d.call(this,b);this._edeState=new f(this.type, +this.options.key)}var b=a("minimalistic-assert");g=a("inherits");a=a("../des");var d=a.Cipher,h=a.DES;g(k,d);l.exports=k;k.create=function(b){return new k(b)};k.prototype._update=function(b,c,e,a){var d=this._edeState;d.ciphers[0]._update(b,c,e,a);d.ciphers[1]._update(e,a,e,a);d.ciphers[2]._update(e,a,e,a)};k.prototype._pad=h.prototype._pad;k.prototype._unpad=h.prototype._unpad},{"../des":60,inherits:98,"minimalistic-assert":102}],65:[function(a,l,g){g.readUInt32BE=function(b,a){return(b[0+a]<<24| +b[1+a]<<16|b[2+a]<<8|b[3+a])>>>0};g.writeUInt32BE=function(b,a,f){b[0+f]=a>>>24;b[1+f]=a>>>16&255;b[2+f]=a>>>8&255;b[3+f]=a&255};g.ip=function(b,a,f,c){for(var e=0,d=0,h=6;0<=h;h-=2){for(var m=0;24>=m;m+=8)e<<=1,e|=a>>>m+h&1;for(m=0;24>=m;m+=8)e<<=1,e|=b>>>m+h&1}for(h=6;0<=h;h-=2){for(m=1;25>=m;m+=8)d<<=1,d|=a>>>m+h&1;for(m=1;25>=m;m+=8)d<<=1,d|=b>>>m+h&1}f[c+0]=e>>>0;f[c+1]=d>>>0};g.rip=function(b,a,f,c){for(var e=0,d=0,h=0;4>h;h++)for(var m=24;0<=m;m-=8)e<<=1,e|=a>>>m+h&1,e<<=1,e|=b>>>m+h&1;for(h= +4;8>h;h++)for(m=24;0<=m;m-=8)d<<=1,d|=a>>>m+h&1,d<<=1,d|=b>>>m+h&1;f[c+0]=e>>>0;f[c+1]=d>>>0};g.pc1=function(b,a,f,c){for(var e=0,d=0,h=7;5<=h;h--){for(var m=0;24>=m;m+=8)e<<=1,e|=a>>m+h&1;for(m=0;24>=m;m+=8)e<<=1,e|=b>>m+h&1}for(m=0;24>=m;m+=8)e<<=1,e|=a>>m+h&1;for(h=1;3>=h;h++){for(m=0;24>=m;m+=8)d<<=1,d|=a>>m+h&1;for(m=0;24>=m;m+=8)d<<=1,d|=b>>m+h&1}for(m=0;24>=m;m+=8)d<<=1,d|=b>>m+h&1;f[c+0]=e>>>0;f[c+1]=d>>>0};g.r28shl=function(b,a){return b<>>28-a};var f=[14,11,17,4,27,23,25, +0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];g.pc2=function(b,a,m,c){for(var e=0,d=0,h=f.length>>>1,k=0;k>>f[k]&1;for(k=h;k>>f[k]&1;m[c+0]=e>>>0;m[c+1]=d>>>0};g.expand=function(b,a,f){var c,e=0;c=(b&1)<<5|b>>>27;for(var d=23;15<=d;d-=4)c<<=6,c|=b>>>d&63;for(d=11;3<=d;d-=4)e|=b>>>d&63,e<<=6;a[f+0]=c>>>0;a[f+1]=(e|(b&31)<<1|b>>>31)>>>0};var k=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6, +12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12, +10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2, +9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];g.substitute=function(b,a){for(var d=0,c=0;4>c;c++)var e=b>>>18-6*c&63,e=k[64*c+e],d=d<<4,d=d|e;for(c=0;4>c;c++)e=a>>>18-6*c&63,e=k[256+64*c+e],d<<=4,d|=e;return d>>>0};var b=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];g.permute=function(a){for(var d=0,f=0;f>>b[f]&1;return d>>> +0};g.padSplit=function(b,a,f){for(b=b.toString(2);b.lengthe;e+=2){for(var d=Math.ceil(Math.sqrt(e)),h=0;h< +a&&c[h]<=d&&0!==e%c[h];h++);a!==h&&c[h]<=d||(c[a++]=e)}y=c}for(a=0;ab)return 2===a||5===a?new h([140,123]):new h([140,39]);a=new h(a);for(var g,v;;){for(g=new h(d(Math.ceil(b/8)));g.bitLength()>b;)g.ishrn(1);g.isEven()&&g.iadd(e);g.testn(1)||g.iadd(n);if(!a.cmp(n))for(;g.mod(m).cmp(B);)g.iadd(q);else if(!a.cmp(t))for(;g.mod(r).cmp(p);)g.iadd(q); +v=g.shrn(1);if(f(v)&&f(g)&&k(v)&&k(g)&&c.test(v)&&c.test(g))return g}}var d=a("randombytes");l.exports=b;b.simpleSieve=f;b.fermatTest=k;var h=a("bn.js"),m=new h(24),c=new (a("miller-rabin")),e=new h(1),n=new h(2),t=new h(5);new h(16);new h(8);var r=new h(10),p=new h(3);new h(7);var B=new h(11),q=new h(4);new h(12);var y=null},{"bn.js":18,"miller-rabin":101,randombytes:135}],69:[function(a,l,g){l.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"}, +modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"}, +modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"}, +modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"}, +modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"}, +modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"}, +modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}}, +{}],70:[function(a,l,g){g.version=a("../package.json").version;g.utils=a("./elliptic/utils");g.rand=a("brorand");g.curve=a("./elliptic/curve");g.curves=a("./elliptic/curves");g.ec=a("./elliptic/ec");g.eddsa=a("./elliptic/eddsa")},{"../package.json":85,"./elliptic/curve":73,"./elliptic/curves":76,"./elliptic/ec":77,"./elliptic/eddsa":80,"./elliptic/utils":84,brorand:19}],71:[function(a,l,g){function f(c,a){this.type=c;this.p=new b(a.p,16);this.red=a.prime?b.red(a.prime):b.mont(this.p);this.zero=(new b(0)).toRed(this.red); +this.one=(new b(1)).toRed(this.red);this.two=(new b(2)).toRed(this.red);this.n=a.n&&new b(a.n,16);this.g=a.g&&this.pointFromJSON(a.g,a.gRed);this._wnafT1=Array(4);this._wnafT2=Array(4);this._wnafT3=Array(4);this._wnafT4=Array(4);var e=this.n&&this.p.div(this.n);!e||0=k;a--)n=(n<<1)+d[a];m.push(n)}for(var d=this.jpoint(null,null,null),g=this.jpoint(null,null,null);0m)break;var k=e[m];c(0!==k);f="affine"===b.type?0>1]):f.mixedAdd(d[-k-1>>1].neg()):0>1]):f.add(d[-k-1>>1].neg())}return"affine"===b.type?f.toP():f};f.prototype._wnafMulAdd=function(b,c,a,d,f){for(var e=this._wnafT1,k=this._wnafT2,n=this._wnafT3, +p=0,t=0;tt)break;for(b=0;b>1]:0>p&&(r=k[b][-p-1>>1].neg()),c="affine"===r.type?c.mixedAdd(r):c.add(r))}for(t=0;t=Math.ceil((b.bitLength()+1)/c.step):!1};k.prototype._getDoubles=function(b,c){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],e=this,d=0;d":""};k.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)};k.prototype._extDbl=function(){var b=this.x.redSqr(),a=this.y.redSqr(),d=this.z.redSqr(),d=d.redIAdd(d),h=this.curve._mulA(b),f=this.x.redAdd(this.y).redSqr().redISub(b).redISub(a),b=h.redAdd(a),d=b.redSub(d),m=h.redSub(a),a=f.redMul(d),h=b.redMul(m),f=f.redMul(m),b=d.redMul(b);return this.curve.point(a,h,b,f)};k.prototype._projDbl=function(){var b=this.x.redAdd(this.y).redSqr(), +a=this.x.redSqr(),d=this.y.redSqr(),h;if(this.curve.twisted){h=this.curve._mulA(a);var f=h.redAdd(d);if(this.zOne)b=b.redSub(a).redSub(d).redMul(f.redSub(this.curve.two)),a=f.redMul(h.redSub(d)),h=f.redSqr().redSub(f).redSub(f);else{var m=this.z.redSqr(),m=f.redSub(m).redISub(m),b=b.redSub(a).redISub(d).redMul(m),a=f.redMul(h.redSub(d));h=f.redMul(m)}}else h=a.redAdd(d),m=this.curve._mulC(this.c.redMul(this.z)).redSqr(),m=h.redSub(m).redSub(m),b=this.curve._mulC(b.redISub(h)).redMul(m),a=this.curve._mulC(h).redMul(a.redISub(d)), +h=h.redMul(m);return this.curve.point(b,a,h)};k.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};k.prototype._extAdd=function(b){var c=this.y.redSub(this.x).redMul(b.y.redSub(b.x)),a=this.y.redAdd(this.x).redMul(b.y.redAdd(b.x)),d=this.t.redMul(this.curve.dd).redMul(b.t),h=this.z.redMul(b.z.redAdd(b.z)),f=a.redSub(c);b=h.redSub(d);d=h.redAdd(d);h=a.redAdd(c);c=f.redMul(b);a=d.redMul(h);f=f.redMul(h);b=b.redMul(d);return this.curve.point(c, +a,b,f)};k.prototype._projAdd=function(b){var c=this.z.redMul(b.z),a=c.redSqr(),d=this.x.redMul(b.x),h=this.y.redMul(b.y),f=this.curve.d.redMul(d).redMul(h),m=a.redSub(f),a=a.redAdd(f);b=this.x.redAdd(this.y).redMul(b.x.redAdd(b.y)).redISub(d).redISub(h);b=c.redMul(m).redMul(b);this.curve.twisted?(c=c.redMul(a).redMul(h.redSub(this.curve._mulA(d))),m=m.redMul(a)):(c=c.redMul(a).redMul(h.redSub(d)),m=this.curve._mulC(m).redMul(a));return this.curve.point(b,c,m)};k.prototype.add=function(b){return this.isInfinity()? +b:b.isInfinity()?this:this.curve.extended?this._extAdd(b):this._projAdd(b)};k.prototype.mul=function(b){return this._hasDoubles(b)?this.curve._fixedNafMul(this,b):this.curve._wnafMul(this,b)};k.prototype.mulAdd=function(b,a,d){return this.curve._wnafMulAdd(1,[this,a],[b,d],2,!1)};k.prototype.jmulAdd=function(b,a,d){return this.curve._wnafMulAdd(1,[this,a],[b,d],2,!0)};k.prototype.normalize=function(){if(this.zOne)return this;var b=this.z.redInvm();this.x=this.x.redMul(b);this.y=this.y.redMul(b);this.t&& +(this.t=this.t.redMul(b));this.z=this.curve.one;this.zOne=!0;return this};k.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};k.prototype.getX=function(){this.normalize();return this.x.fromRed()};k.prototype.getY=function(){this.normalize();return this.y.fromRed()};k.prototype.eq=function(b){return this===b||0===this.getX().cmp(b.getX())&&0===this.getY().cmp(b.getY())};k.prototype.eqXToP=function(b){var c=b.toRed(this.curve.red).redMul(this.z); +if(0===this.x.cmp(c))return!0;b=b.clone();for(var a=this.curve.redN.redMul(this.z);;){b.iadd(this.curve.n);if(0<=b.cmp(this.curve.p))break;c.redIAdd(a);if(0===this.x.cmp(c))return!0}return!1};k.prototype.toP=k.prototype.normalize;k.prototype.mixedAdd=k.prototype.add},{"../../elliptic":70,"../curve":73,"bn.js":18,inherits:98}],73:[function(a,l,g){g.base=a("./base");g["short"]=a("./short");g.mont=a("./mont");g.edwards=a("./edwards")},{"./base":71,"./edwards":72,"./mont":74,"./short":75}],74:[function(a, +l,g){function f(c){h.call(this,"mont",c);this.a=(new b(c.a,16)).toRed(this.red);this.b=(new b(c.b,16)).toRed(this.red);this.i4=(new b(4)).toRed(this.red).redInvm();this.two=(new b(2)).toRed(this.red);this.a24=this.i4.redMul(this.a.redAdd(this.two))}function k(c,a,d){h.BasePoint.call(this,c,"projective");null===a&&null===d?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new b(a,16),this.z=new b(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))} +g=a("../curve");var b=a("bn.js"),d=a("inherits"),h=g.base,m=a("../../elliptic").utils;d(f,h);l.exports=f;f.prototype.validate=function(b){b=b.normalize().x;var c=b.redSqr();b=c.redMul(b).redAdd(c.redMul(this.a)).redAdd(b);return 0===b.redSqrt().redSqr().cmp(b)};d(k,h.BasePoint);f.prototype.decodePoint=function(b,a){return this.point(m.toArray(b,a),1)};f.prototype.point=function(b,a){return new k(this,b,a)};f.prototype.pointFromJSON=function(b){return k.fromJSON(this,b)};k.prototype.precompute=function(){}; +k.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};k.fromJSON=function(b,a){return new k(b,a[0],a[1]||b.one)};k.prototype.inspect=function(){return this.isInfinity()?"":""};k.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};k.prototype.dbl=function(){var b=this.x.redAdd(this.z).redSqr(),a=this.x.redSub(this.z).redSqr(),d=b.redSub(a),b=b.redMul(a), +a=d.redMul(a.redAdd(this.curve.a24.redMul(d)));return this.curve.point(b,a)};k.prototype.add=function(){throw Error("Not supported on Montgomery curve");};k.prototype.diffAdd=function(b,a){var c=this.x.redAdd(this.z),e=this.x.redSub(this.z),d=b.x.redAdd(b.z),c=b.x.redSub(b.z).redMul(c),d=d.redMul(e),e=a.z.redMul(c.redAdd(d).redSqr()),c=a.x.redMul(c.redISub(d).redSqr());return this.curve.point(e,c)};k.prototype.mul=function(b){var c=b.clone();b=this;for(var a=this.curve.point(null,null),d=[];0!==c.cmpn(0);c.iushrn(1))d.push(c.andln(1)); +for(c=d.length-1;0<=c;c--)0===d[c]?(b=b.diffAdd(a,this),a=a.dbl()):(a=b.diffAdd(a,this),b=b.dbl());return a};k.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve");};k.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve");};k.prototype.eq=function(b){return 0===this.getX().cmp(b.getX())};k.prototype.normalize=function(){this.x=this.x.redMul(this.z.redInvm());this.z=this.curve.one;return this};k.prototype.getX=function(){this.normalize();return this.x.fromRed()}}, +{"../../elliptic":70,"../curve":73,"bn.js":18,inherits:98}],75:[function(a,l,g){function f(b){m.call(this,"short",b);this.a=(new h(b.a,16)).toRed(this.red);this.b=(new h(b.b,16)).toRed(this.red);this.tinv=this.two.redInvm();this.zeroA=0===this.a.fromRed().cmpn(0);this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3);this.endo=this._getEndomorphism(b);this._endoWnafT1=Array(4);this._endoWnafT2=Array(4)}function k(b,c,a,d){m.BasePoint.call(this,b,"affine");null===c&&null===a?(this.y=this.x=null,this.inf= +!0):(this.x=new h(c,16),this.y=new h(a,16),d&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function b(b,c,a,d){m.BasePoint.call(this,b,"jacobian");null===c&&null===a&&null===d?(this.y=this.x=this.curve.one,this.z=new h(0)):(this.x=new h(c,16),this.y=new h(a,16),this.z=new h(d,16));this.x.red||(this.x=this.x.toRed(this.curve.red));this.y.red||(this.y=this.y.toRed(this.curve.red)); +this.z.red||(this.z=this.z.toRed(this.curve.red));this.zOne=this.z===this.curve.one}g=a("../curve");var d=a("../../elliptic"),h=a("bn.js");a=a("inherits");var m=g.base,c=d.utils.assert;a(f,m);l.exports=f;f.prototype._getEndomorphism=function(b){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var a,e;b.beta?a=(new h(b.beta,16)).toRed(this.red):(a=this._getEndoRoots(this.p),a=0>a[0].cmp(a[1])?a[0]:a[1],a=a.toRed(this.red));b.lambda?e=new h(b.lambda,16):(e=this._getEndoRoots(this.n),0===this.g.mul(e[0]).x.cmp(this.g.x.redMul(a))? +e=e[0]:(e=e[1],c(0===this.g.mul(e).x.cmp(this.g.x.redMul(a)))));b=b.basis?b.basis.map(function(b){return{a:new h(b.a,16),b:new h(b.b,16)}}):this._getEndoBasis(e);return{beta:a,lambda:e,basis:b}}};f.prototype._getEndoRoots=function(b){var c=b===this.p?this.red:h.mont(b),a=(new h(2)).toRed(c).redInvm();b=a.redNeg();a=(new h(3)).toRed(c).redNeg().redSqrt().redMul(a);c=b.redAdd(a).fromRed();b=b.redSub(a).fromRed();return[c,b]};f.prototype._getEndoBasis=function(b){for(var c=this.n.ushrn(Math.floor(this.n.bitLength()/ +2)),a=this.n.clone(),e=new h(1),d=new h(0),f=new h(0),m=new h(1),k,g,v,w,l,A,z=0,G;0!==b.cmpn(0);){var F=a.div(b);G=a.sub(F.mul(b));l=f.sub(F.mul(e));F=m.sub(F.mul(d));if(!v&&0>G.cmp(c))k=A.neg(),g=e,v=G.neg(),w=l;else if(v&&2===++z)break;A=G;a=b;b=G;f=e;e=l;m=d;d=F}c=G.neg();A=v.sqr().add(w.sqr());0<=c.sqr().add(l.sqr()).cmp(A)&&(c=k,l=g);v.negative&&(v=v.neg(),w=w.neg());c.negative&&(c=c.neg(),l=l.neg());return[{a:v,b:w},{a:c,b:l}]};f.prototype._endoSplit=function(b){var c=this.endo.basis,a=c[0], +e=c[1],d=e.b.mul(b).divRound(this.n),h=a.b.neg().mul(b).divRound(this.n),c=d.mul(a.a),f=h.mul(e.a),a=d.mul(a.b),e=h.mul(e.b);b=b.sub(c).sub(f);c=a.add(e).neg();return{k1:b,k2:c}};f.prototype.pointFromX=function(b,c){b=new h(b,16);b.red||(b=b.toRed(this.red));var a=b.redSqr().redMul(b).redIAdd(b.redMul(this.a)).redIAdd(this.b),e=a.redSqrt();if(0!==e.redSqr().redSub(a).cmp(this.zero))throw Error("invalid point");a=e.fromRed().isOdd();if(c&&!a||!c&&a)e=e.redNeg();return this.point(b,e)};f.prototype.validate= +function(b){if(b.inf)return!0;var c=b.x;b=b.y;var a=this.a.redMul(c),c=c.redSqr().redMul(c).redIAdd(a).redIAdd(this.b);return 0===b.redSqr().redISub(c).cmpn(0)};f.prototype._endoWnafMulAdd=function(b,c,a){for(var e=this._endoWnafT1,d=this._endoWnafT2,h=0;h":""};k.prototype.isInfinity=function(){return this.inf};k.prototype.add=function(b){if(this.inf)return b; +if(b.inf)return this;if(this.eq(b))return this.dbl();if(this.neg().eq(b)||0===this.x.cmp(b.x))return this.curve.point(null,null);var c=this.y.redSub(b.y);0!==c.cmpn(0)&&(c=c.redMul(this.x.redSub(b.x).redInvm()));b=c.redSqr().redISub(this.x).redISub(b.x);c=c.redMul(this.x.redSub(b)).redISub(this.y);return this.curve.point(b,c)};k.prototype.dbl=function(){if(this.inf)return this;var b=this.y.redAdd(this.y);if(0===b.cmpn(0))return this.curve.point(null,null);var c=this.curve.a,a=this.x.redSqr(),b=b.redInvm(), +a=a.redAdd(a).redIAdd(a).redIAdd(c).redMul(b),c=a.redSqr().redISub(this.x.redAdd(this.x)),a=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,a)};k.prototype.getX=function(){return this.x.fromRed()};k.prototype.getY=function(){return this.y.fromRed()};k.prototype.mul=function(b){b=new h(b,16);return this._hasDoubles(b)?this.curve._fixedNafMul(this,b):this.curve.endo?this.curve._endoWnafMulAdd([this],[b]):this.curve._wnafMul(this,b)};k.prototype.mulAdd=function(b,c,a){c=[this,c]; +b=[b,a];return this.curve.endo?this.curve._endoWnafMulAdd(c,b):this.curve._wnafMulAdd(1,c,b,2)};k.prototype.jmulAdd=function(b,c,a){c=[this,c];b=[b,a];return this.curve.endo?this.curve._endoWnafMulAdd(c,b,!0):this.curve._wnafMulAdd(1,c,b,2,!0)};k.prototype.eq=function(b){return this===b||this.inf===b.inf&&(this.inf||0===this.x.cmp(b.x)&&0===this.y.cmp(b.y))};k.prototype.neg=function(b){if(this.inf)return this;var c=this.curve.point(this.x,this.y.redNeg());if(b&&this.precomputed){b=this.precomputed; +var a=function(b){return b.neg()};c.precomputed={naf:b.naf&&{wnd:b.naf.wnd,points:b.naf.points.map(a)},doubles:b.doubles&&{step:b.doubles.step,points:b.doubles.points.map(a)}}}return c};k.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)};a(b,m.BasePoint);f.prototype.jpoint=function(c,a,d){return new b(this,c,a,d)};b.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var b=this.z.redInvm(),c=b.redSqr(), +a=this.x.redMul(c),b=this.y.redMul(c).redMul(b);return this.curve.point(a,b)};b.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};b.prototype.add=function(b){if(this.isInfinity())return b;if(b.isInfinity())return this;var c=b.z.redSqr(),a=this.z.redSqr(),e=this.x.redMul(c),d=b.x.redMul(a),c=this.y.redMul(c.redMul(b.z)),a=b.y.redMul(a.redMul(this.z)),d=e.redSub(d),a=c.redSub(a);if(0===d.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h= +d.redSqr(),f=h.redMul(d),h=e.redMul(h),e=a.redSqr().redIAdd(f).redISub(h).redISub(h),c=a.redMul(h.redISub(e)).redISub(c.redMul(f));b=this.z.redMul(b.z).redMul(d);return this.curve.jpoint(e,c,b)};b.prototype.mixedAdd=function(b){if(this.isInfinity())return b.toJ();if(b.isInfinity())return this;var c=this.z.redSqr(),a=this.x,e=b.x.redMul(c),d=this.y;b=b.y.redMul(c).redMul(this.z);e=a.redSub(e);b=d.redSub(b);if(0===e.cmpn(0))return 0!==b.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=e.redSqr(), +c=h.redMul(e),h=a.redMul(h),a=b.redSqr().redIAdd(c).redISub(h).redISub(h),d=b.redMul(h.redISub(a)).redISub(d.redMul(c)),e=this.z.redMul(e);return this.curve.jpoint(a,d,e)};b.prototype.dblp=function(b){if(0===b||this.isInfinity())return this;if(!b)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var c=this,a=0;a":""};b.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":70,"../curve":73,"bn.js":18,inherits:98}],76:[function(a,l,g){function f(b){this.curve="short"===b.type?new d.curve["short"](b):"edwards"===b.type?new d.curve.edwards(b):new d.curve.mont(b);this.g=this.curve.g;this.n=this.curve.n;this.hash=b.hash;h(this.g.validate(), +"Invalid curve");h(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function k(c,a){Object.defineProperty(b,c,{configurable:!0,enumerable:!0,get:function(){var e=new f(a);Object.defineProperty(b,c,{configurable:!0,enumerable:!0,value:e});return e}})}var b=g;l=a("hash.js");var d=a("../elliptic"),h=d.utils.assert;b.PresetCurve=f;k("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1", +n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:l.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});k("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d", +hash:l.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});k("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:l.sha256, +gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});k("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef", +n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:l.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});k("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff", +a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:l.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", +"00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});k("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:l.sha256,gRed:!1,g:["9"]});k("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", +a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:l.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var m;try{m=a("./precomputed/secp256k1")}catch(c){m=void 0}k("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0", +b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:l.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", +m]})},{"../elliptic":70,"./precomputed/secp256k1":83,"hash.js":88}],77:[function(a,l,g){function f(b){if(!(this instanceof f))return new f(b);"string"===typeof b&&(h(d.curves.hasOwnProperty(b),"Unknown curve "+b),b=d.curves[b]);b instanceof d.curves.PresetCurve&&(b={curve:b});this.curve=b.curve.curve;this.n=this.curve.n;this.nh=this.n.ushrn(1);this.g=this.curve.g;this.g=b.curve.g;this.g.precompute(b.curve.n.bitLength()+1);this.hash=b.hash||b.curve.hash}var k=a("bn.js"),b=a("hmac-drbg"),d=a("../../elliptic"), +h=d.utils.assert,m=a("./key"),c=a("./signature");l.exports=f;f.prototype.keyPair=function(b){return new m(this,b)};f.prototype.keyFromPrivate=function(b,c){return m.fromPrivate(this,b,c)};f.prototype.keyFromPublic=function(b,c){return m.fromPublic(this,b,c)};f.prototype.genKeyPair=function(c){c||(c={});c=new b({hash:this.hash,pers:c.pers,persEnc:c.persEnc||"utf8",entropy:c.entropy||d.rand(this.hash.hmacStrength),entropyEnc:c.entropy&&c.entropyEnc||"utf8",nonce:this.n.toArray()});var a=this.n.byteLength(), +e=this.n.sub(new k(2));do{var h=new k(c.generate(a));if(!(0=g.cmpn(1)||0<=g.cmp(m))){var r=this.g.mul(g);if(!r.isInfinity()){var t=r.getX();h=t.umod(this.n);if(0!==h.cmpn(0)&&(g=g.invm(this.n).mul(h.mul(d.getPrivate()).iadd(a)),g=g.umod(this.n),0!==g.cmpn(0)))return a=(r.getY().isOdd()?1:0)|(0!==t.cmp(h)?2:0),f.canonical&&0h.cmpn(1)||0<=h.cmp(this.n)||0>a.cmpn(1)||0<=a.cmp(this.n))return!1;a=a.invm(this.n);b=a.mul(b).umod(this.n);a=a.mul(h).umod(this.n);if(!this.curve._maxwellTrick)return d=this.g.mulAdd(b,d.getPublic(),a),d.isInfinity()?!1:0===d.getX().umod(this.n).cmp(h);d=this.g.jmulAdd(b,d.getPublic(),a);return d.isInfinity()?!1:d.eqXToP(h)};f.prototype.recoverPubKey= +function(b,a,d,f){h((3&d)===d,"The recovery param is more than two bits");a=new c(a,f);f=this.n;var e=new k(b);b=a.r;var m=a.s,n=d&1;d>>=1;if(0<=b.cmp(this.curve.p.umod(this.curve.n))&&d)throw Error("Unable to find sencond key candinate");b=d?this.curve.pointFromX(b.add(this.curve.n),n):this.curve.pointFromX(b,n);a=a.r.invm(f);d=f.sub(e).mul(a).umod(f);f=m.mul(a).umod(f);return this.g.mulAdd(d,b,f)};f.prototype.getKeyRecoveryParam=function(b,a,d,h){a=new c(a,h);if(null!==a.recoveryParam)return a.recoveryParam; +for(h=0;4>h;h++){var e;try{e=this.recoverPubKey(b,a,h)}catch(B){continue}if(e.eq(d))return h}throw Error("Unable to find valid recovery factor");}},{"../../elliptic":70,"./key":78,"./signature":79,"bn.js":18,"hmac-drbg":94}],78:[function(a,l,g){function f(b,a){this.ec=b;this.pub=this.priv=null;a.priv&&this._importPrivate(a.priv,a.privEnc);a.pub&&this._importPublic(a.pub,a.pubEnc)}var k=a("bn.js"),b=a("../../elliptic").utils.assert;l.exports=f;f.fromPublic=function(b,a,m){return a instanceof f?a:new f(b, +{pub:a,pubEnc:m})};f.fromPrivate=function(b,a,m){return a instanceof f?a:new f(b,{priv:a,privEnc:m})};f.prototype.validate=function(){var b=this.getPublic();return b.isInfinity()?{result:!1,reason:"Invalid public key"}:b.validate()?b.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};f.prototype.getPublic=function(b,a){"string"===typeof b&&(a=b,b=null);this.pub||(this.pub=this.ec.g.mul(this.priv));return a? +this.pub.encode(a,b):this.pub};f.prototype.getPrivate=function(b){return"hex"===b?this.priv.toString(16,2):this.priv};f.prototype._importPrivate=function(b,a){this.priv=new k(b,a||16);this.priv=this.priv.umod(this.ec.curve.n)};f.prototype._importPublic=function(a,h){a.x||a.y?("mont"===this.ec.curve.type?b(a.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||b(a.x&&a.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(a.x,a.y)):this.pub=this.ec.curve.decodePoint(a, +h)};f.prototype.derive=function(b){return b.mul(this.priv).getX()};f.prototype.sign=function(b,a,f){return this.ec.sign(b,this,a,f)};f.prototype.verify=function(b,a){return this.ec.verify(b,a,this)};f.prototype.inspect=function(){return""}},{"../../elliptic":70,"bn.js":18}],79:[function(a,l,g){function f(b,c){if(b instanceof f)return b;this._importDER(b,c)||(e(b.r&&b.s,"Signature without r or s"),this.r= +new m(b.r,16),this.s=new m(b.s,16),this.recoveryParam=void 0===b.recoveryParam?null:b.recoveryParam)}function k(){this.place=0}function b(b,c){var a=b[c.place++];if(!(a&128))return a;for(var a=a&15,e=0,d=0,h=c.place;dc)){var a=1+(Math.log(c)/Math.LN2>>>3);for(b.push(a|128);--a;)b.push(c>>>(a<<3)&255)}b.push(c)}var m=a("bn.js"),c=a("../../elliptic").utils, +e=c.assert;l.exports=f;f.prototype._importDER=function(a,e){a=c.toArray(a,e);var d=new k;if(48!==a[d.place++]||b(a,d)+d.place!==a.length||2!==a[d.place++])return!1;var h=b(a,d),f=a.slice(d.place,h+d.place);d.place+=h;if(2!==a[d.place++])return!1;h=b(a,d);if(a.length!==h+d.place)return!1;d=a.slice(d.place,h+d.place);0===f[0]&&f[1]&128&&(f=f.slice(1));0===d[0]&&d[1]&128&&(d=d.slice(1));this.r=new m(f);this.s=new m(d);this.recoveryParam=null;return!0};f.prototype.toDER=function(b){var a=this.r.toArray(), +e=this.s.toArray();a[0]&128&&(a=[0].concat(a));e[0]&128&&(e=[0].concat(e));a=d(a);for(e=d(e);!(e[0]||e[1]&128);)e=e.slice(1);var f=[2];h(f,a.length);f=f.concat(a);f.push(2);h(f,e.length);a=f.concat(e);e=[48];h(e,a.length);e=e.concat(a);return c.encode(e,b)}},{"../../elliptic":70,"bn.js":18}],80:[function(a,l,g){function f(c){h("ed25519"===c,"only tested with ed25519 so far");if(!(this instanceof f))return new f(c);this.curve=c=b.curves[c].curve;this.g=c.g;this.g.precompute(c.n.bitLength()+1);this.pointClass= +c.point().constructor;this.encodingLength=Math.ceil(c.n.bitLength()/8);this.hash=k.sha512}var k=a("hash.js"),b=a("../../elliptic"),d=b.utils,h=d.assert,m=d.parseBytes,c=a("./key"),e=a("./signature");l.exports=f;f.prototype.sign=function(b,c){b=m(b);var a=this.keyFromSecret(c),e=this.hashInt(a.messagePrefix(),b),d=this.g.mul(e),h=this.encodePoint(d),a=this.hashInt(h,a.pubBytes(),b).mul(a.priv()),e=e.add(a).umod(this.curve.n);return this.makeSignature({R:d,S:e,Rencoded:h})};f.prototype.verify=function(b, +c,a){b=m(b);c=this.makeSignature(c);a=this.keyFromPublic(a);b=this.hashInt(c.Rencoded(),a.pubBytes(),b);var e=this.g.mul(c.S());return c.R().add(a.pub().mul(b)).eq(e)};f.prototype.hashInt=function(){for(var b=this.hash(),c=0;c(h>>1)-1?(h>>1)-c:c,f.isubn(c)):c=0;d.push(c);c=0!==f.cmpn(0)&&0===f.andln(h-1)?b+1:1;for(var e=1;e=6.0.0 <7.0.0",type:"range"},"/Users/v/.nvm/versions/node/v6.4.0/lib/node_modules/browserify/node_modules/browserify-sign"]],_from:"elliptic@>=6.0.0 <7.0.0",_id:"elliptic@6.4.0",_inCache:!0,_installable:!0,_location:"/browserify/elliptic",_nodeVersion:"7.0.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/elliptic-6.4.0.tgz_1487798866428_0.30510620190761983"}, +_npmUser:{name:"indutny",email:"fedor@indutny.com"},_npmVersion:"3.10.8",_phantomChildren:{},_requested:{raw:"elliptic@^6.0.0",scope:null,escapedName:"elliptic",name:"elliptic",rawSpec:"^6.0.0",spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify/browserify-sign","/browserify/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/Users/v/.nvm/versions/node/v6.4.0/lib/node_modules/browserify/node_modules/browserify-sign", +author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1", +"grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz"},files:["lib"],gitHead:"6b0d2b76caae91471649c8e21f0b1d3ba0f96090",homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}], +name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}}, +{}],86:[function(a,l,g){function f(){this._events=this._events||{};this._maxListeners=this._maxListeners||void 0}function k(b){return"function"===typeof b}function b(b){return"object"===typeof b&&null!==b}l.exports=f;f.EventEmitter=f;f.prototype._events=void 0;f.prototype._maxListeners=void 0;f.defaultMaxListeners=10;f.prototype.setMaxListeners=function(b){if("number"!==typeof b||0>b||isNaN(b))throw TypeError("n must be a positive number");this._maxListeners=b;return this};f.prototype.emit=function(a){var d, +f,c,e;this._events||(this._events={});if("error"===a&&(!this._events.error||b(this._events.error)&&!this._events.error.length)){d=arguments[1];if(d instanceof Error)throw d;f=Error('Uncaught, unspecified "error" event. ('+d+")");f.context=d;throw f;}f=this._events[a];if(void 0===f)return!1;if(k(f))switch(arguments.length){case 1:f.call(this);break;case 2:f.call(this,arguments[1]);break;case 3:f.call(this,arguments[1],arguments[2]);break;default:d=Array.prototype.slice.call(arguments,1),f.apply(this, +d)}else if(b(f))for(d=Array.prototype.slice.call(arguments,1),e=f.slice(),f=e.length,c=0;cd&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),"function"===typeof console.trace&&console.trace());return this};f.prototype.on=f.prototype.addListener;f.prototype.once=function(b,a){function d(){this.removeListener(b,d);c||(c=!0,a.apply(this,arguments))}if(!k(a))throw TypeError("listener must be a function"); +var c=!1;d.listener=a;this.on(b,d);return this};f.prototype.removeListener=function(a,h){var d,c,e;if(!k(h))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;d=this._events[a];e=d.length;c=-1;if(d===h||k(d.listener)&&d.listener===h)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,h);else if(b(d)){for(;0c)return this;1===d.length?(d.length=0,delete this._events[a]): +d.splice(c,1);this._events.removeListener&&this.emit("removeListener",a,h)}return this};f.prototype.removeAllListeners=function(b){var a;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[b]&&delete this._events[b],this;if(0===arguments.length){for(a in this._events)"removeListener"!==a&&this.removeAllListeners(a);this.removeAllListeners("removeListener");this._events={};return this}a=this._events[b];if(k(a))this.removeListener(b, +a);else if(a)for(;a.length;)this.removeListener(b,a[a.length-1]);delete this._events[b];return this};f.prototype.listeners=function(b){return this._events&&this._events[b]?k(this._events[b])?[this._events[b]]:this._events[b].slice():[]};f.prototype.listenerCount=function(b){if(this._events){b=this._events[b];if(k(b))return 1;if(b)return b.length}return 0};f.listenerCount=function(b,a){return b.listenerCount(a)}},{}],87:[function(a,l,g){(function(f){var k=a("create-hash/md5");l.exports=function(b, +a,h,m){f.isBuffer(b)||(b=new f(b,"binary"));a&&!f.isBuffer(a)&&(a=new f(a,"binary"));h/=8;m=m||0;for(var c=0,e=0,d=new f(h),g=new f(m),r=0,p,l,q=[];;){0=this._delta8){b=this.pending;var d=b.length%this._delta8;this.pending=b.slice(b.length-d,b.length);0===this.pending.length&&(this.pending= +null);b=k.join32(b,0,b.length-d,this.endian);for(d=0;d>>24& +255;a[c++]=b>>>16&255;a[c++]=b>>>8&255;a[c++]=b&255}else for(a[c++]=b&255,a[c++]=b>>>8&255,a[c++]=b>>>16&255,a[c++]=b>>>24&255,a[c++]=0,a[c++]=0,a[c++]=0,a[c++]=0,f=8;f +this.blockSize&&(a=(new this.Hash).update(a).digest());b(a.length<=this.blockSize);for(var d=a.length;d=b?c^a^e:31>=b?c&a|~c&e:47>=b?(c|~a)^e:63>=b?c&e|a&~e:c^(a|~e)}a=a("../hash");var b=a.utils,d=b.rotl32,h=b.sum32,m=b.sum32_3,c=b.sum32_4,e=a.common.BlockHash;b.inherits(f,e);g.ripemd160=f;f.blockSize=512;f.outSize=160;f.hmacStrength=192;f.padLength=64;f.prototype._update=function(b,a){for(var e=this.h[0],f=this.h[1],g=this.h[2],q=this.h[3],l=this.h[4],B=e, +z=f,G=g,F=q,E=l,J=0;80>J;J++)var x=h(d(c(e,k(J,f,g,q),b[n[J]+a],15>=J?0:31>=J?1518500249:47>=J?1859775393:63>=J?2400959708:2840853838),r[J]),l),e=l,l=q,q=d(g,10),g=f,f=x,x=h(d(c(B,k(79-J,z,G,F),b[t[J]+a],15>=J?1352829926:31>=J?1548603684:47>=J?1836072691:63>=J?2053994217:0),p[J]),E),B=E,E=F,F=d(G,10),G=z,z=x;x=m(this.h[1],g,F);this.h[1]=m(this.h[2],q,E);this.h[2]=m(this.h[3],l,B);this.h[3]=m(this.h[4],e,z);this.h[4]=m(this.h[0],f,G);this.h[0]=x};f.prototype._digest=function(c){return"hex"===c?b.toHex32(this.h, +"little"):b.split32(this.h,"little")};var n=[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],t=[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],r=[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],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"../hash":88}],92:[function(a,l,g){function f(){if(!(this instanceof f))return new f;E.call(this);this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924, +528734635,1541459225];this.k=J;this.W=Array(64)}function k(){if(!(this instanceof k))return new k;f.call(this);this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}function b(){if(!(this instanceof b))return new b;E.call(this);this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209];this.k=x;this.W=Array(160)}function d(){if(!(this instanceof +d))return new d;b.call(this);this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}function h(){if(!(this instanceof h))return new h;E.call(this);this.h=[1732584193,4023233417,2562383102,271733878,3285377520];this.W=Array(80)}a=a("../hash");var m=a.utils,c=m.assert,e=m.rotr32,n=m.rotl32,t=m.sum32,r=m.sum32_4,p=m.sum32_5,B=m.rotr64_hi,q=m.rotr64_lo,y=m.shr64_hi,u=m.shr64_lo, +v=m.sum64,w=m.sum64_hi,C=m.sum64_lo,A=m.sum64_4_hi,z=m.sum64_4_lo,G=m.sum64_5_hi,F=m.sum64_5_lo,E=a.common.BlockHash,J=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291, +1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],x=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394, +310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205, +1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899, +1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316, +1246189591],H=[1518500249,1859775393,2400959708,3395469782];m.inherits(f,E);g.sha256=f;f.blockSize=512;f.outSize=256;f.hmacStrength=192;f.padLength=64;f.prototype._update=function(b,a){for(var d=this.W,f=0;16>f;f++)d[f]=b[a+f];for(;f>>10;var k=d[f-7],g;g=d[f-15];g=e(g,7)^e(g,18)^g>>>3;d[h]=r(m,k,g,d[f-16])}h=this.h[0];m=this.h[1];k=this.h[2];g=this.h[3];var n=this.h[4],E=this.h[5],q=this.h[6],w=this.h[7];c(this.k.length===d.length);for(f=0;fe;e++)a[e]=b[c+e];for(;ed&&(d+=4294967296);var h=a[e-4],k=a[e-3],m=q(h,k,19),f=q(k,h,29),h=u(h,k,6), +m=m^f^h;0>m&&(m+=4294967296);var f=a[e-14],h=a[e-13],g=a[e-30],n=a[e-29],k=B(g,n,1),p=B(g,n,8),g=y(g,n,7),k=k^p^g;0>k&&(k+=4294967296);var n=a[e-30],E=a[e-29],p=q(n,E,1),g=q(n,E,8),n=u(n,E,7),p=p^g^n;0>p&&(p+=4294967296);g=a[e-32];n=a[e-31];a[e]=A(d,m,f,h,k,p,g,n);a[e+1]=z(d,m,f,h,k,p,g,n)}};b.prototype._update=function(b,a){this._prepareBlock(b,a);var e=this.W,d=this.h[0],f=this.h[1],h=this.h[2],m=this.h[3],k=this.h[4],g=this.h[5],n=this.h[6],p=this.h[7],E=this.h[8],t=this.h[9],r=this.h[10],l=this.h[11], +u=this.h[12],y=this.h[13],A=this.h[14],J=this.h[15];c(this.k.length===e.length);for(var z=0;zD&&(D+=4294967296);H=D;var x=E,P=t,D=q(x,P,14),K=q(x,P,18),x=q(P,x,9),D=D^K^x;0>D&&(D+=4294967296);x=D;D=E&r^~E&u;0>D&&(D+=4294967296);K=D;D=t&l^~t&y;0>D&&(D+=4294967296);var P=D,Q=this.k[z],W=this.k[z+1],R=e[z],O=e[z+1],D=G(A,J,H,x,K,P,Q,W,R,O),K=F(A,J,H,x,K,P,Q,W,R,O);H=d;x=f;A=B(H,x,28);J=B(x,H,2);H=B(x,H,7);A=A^J^H;0>A&&(A+= +4294967296);x=d;P=f;J=q(x,P,28);H=q(P,x,2);x=q(P,x,7);J=J^H^x;0>J&&(J+=4294967296);H=d&h^d&k^h&k;0>H&&(H+=4294967296);x=f&m^f&g^m&g;0>x&&(x+=4294967296);P=w(A,J,H,x);H=C(A,J,H,x);A=u;J=y;u=r;y=l;r=E;l=t;E=w(n,p,D,K);t=C(p,p,D,K);n=k;p=g;k=h;g=m;h=d;m=f;d=w(D,K,P,H);f=C(D,K,P,H)}v(this.h,0,d,f);v(this.h,2,h,m);v(this.h,4,k,g);v(this.h,6,n,p);v(this.h,8,E,t);v(this.h,10,r,l);v(this.h,12,u,y);v(this.h,14,A,J)};b.prototype._digest=function(b){return"hex"===b?m.toHex32(this.h,"big"):m.split32(this.h,"big")}; +m.inherits(d,b);g.sha384=d;d.blockSize=1024;d.outSize=384;d.hmacStrength=192;d.padLength=128;d.prototype._digest=function(b){return"hex"===b?m.toHex32(this.h.slice(0,12),"big"):m.split32(this.h.slice(0,12),"big")};m.inherits(h,E);g.sha1=h;h.blockSize=512;h.outSize=160;h.hmacStrength=80;h.padLength=64;h.prototype._update=function(b,c){for(var a=this.W,e=0;16>e;e++)a[e]=b[c+e];for(;e>>24|b>>>8&65280|b<<8&16711680|(b&255)<<24)>>> +0}function k(b){return 1===b.length?"0"+b:b}function b(b){return 7===b.length?"0"+b:6===b.length?"00"+b:5===b.length?"000"+b:4===b.length?"0000"+b:3===b.length?"00000"+b:2===b.length?"000000"+b:1===b.length?"0000000"+b:b}function d(b,a){if(!b)throw Error(a||"Assertion failed");}a=a("inherits");g.toArray=function(b,a){if(Array.isArray(b))return b.slice();if(!b)return[];var c=[];if("string"===typeof b)if(!a)for(var e=0;e>8,d=d&255;f?c.push(f,d):c.push(d)}else{if("hex"=== +a)for(b=b.replace(/[^a-z0-9]+/ig,""),0!==b.length%2&&(b="0"+b),e=0;e>>0;return c};g.split32=function(b,a){for(var c=Array(4*b.length),e=0,d=0;e>>24,c[d+1]=f>>>16&255,c[d+2]=f>>>8&255,c[d+3]=f&255):(c[d+3]=f>>>24,c[d+2]=f>>>16&255,c[d+1]=f>>>8&255,c[d]=f&255)}return c};g.rotr32=function(b,a){return b>>>a|b<<32-a};g.rotl32=function(b,a){return b<>>32-a};g.sum32=function(b,a){return b+a>>>0};g.sum32_3=function(b,a,c){return b+a+c>>>0};g.sum32_4= +function(b,a,c,e){return b+a+c+e>>>0};g.sum32_5=function(b,a,c,e,d){return b+a+c+e+d>>>0};g.assert=d;g.inherits=a;g.sum64=function(b,a,c,e){var d=e+b[a+1]>>>0;b[a]=(d>>0;b[a+1]=d};g.sum64_hi=function(b,a,c,e){return(a+e>>>0>>0};g.sum64_lo=function(b,a,c,e){return a+e>>>0};g.sum64_4_hi=function(b,a,c,e,d,f,k,g){e=a+e>>>0;a=0+(e>>0;a+=e>>0>>0};g.sum64_4_lo=function(b,a,c,e,d,f,k,g){return a+e+f+g>>>0};g.sum64_5_hi=function(b, +a,c,e,d,f,k,g,l,q){e=a+e>>>0;a=0+(e>>0;a+=e>>0;a+=e>>0>>0};g.sum64_5_lo=function(b,a,c,e,d,f,k,g,l,q){return a+e+f+g+q>>>0};g.rotr64_hi=function(b,a,c){return(a<<32-c|b>>>c)>>>0};g.rotr64_lo=function(b,a,c){return(b<<32-c|a>>>c)>>>0};g.shr64_hi=function(b,a,c){return b>>>c};g.shr64_lo=function(b,a,c){return(b<<32-c|a>>>c)>>>0}},{inherits:98}],94:[function(a,l,g){function f(a){if(!(this instanceof f))return new f(a);this.hash=a.hash; +this.predResist=!!a.predResist;this.outLen=this.hash.outSize;this.minEntropy=a.minEntropy||this.hash.hmacStrength;this.V=this.K=this.reseedInterval=this.reseed=null;var h=b.toArray(a.entropy,a.entropyEnc||"hex"),c=b.toArray(a.nonce,a.nonceEnc||"hex");a=b.toArray(a.pers,a.persEnc||"hex");d(h.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._init(h,c,a)}var k=a("hash.js"),b=a("minimalistic-crypto-utils"),d=a("minimalistic-assert");l.exports=f;f.prototype._init= +function(b,a,c){b=b.concat(a).concat(c);this.K=Array(this.outLen/8);this.V=Array(this.outLen/8);for(a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._update(a.concat(c||[]));this.reseed=1};f.prototype.generate=function(a,d,c,e){if(this.reseed>this.reseedInterval)throw Error("Reseed is required");"string"!==typeof d&&(e=c,c=d,d=null);c&&(c=b.toArray(c,e||"hex"),this._update(c));for(e=[];e.length>1,g=-7; +h=b?h-1:0;var t=b?-1:1,r=a[k+h];h+=t;b=r&(1<<-g)-1;r>>=-g;for(g+=f;0>=-g;for(g+=d;0>1,r=23===h?Math.pow(2,-24)-Math.pow(2,-77):0;m=d?0:m-1;var p=d?1:-1,l=0>k||0===k&&0>1/k?1:0;k=Math.abs(k);isNaN(k)||Infinity===k?(k=isNaN(k)?1:0,d=f):(d=Math.floor(Math.log(k)/ +Math.LN2),1>k*(c=Math.pow(2,-d))&&(d--,c*=2),k=1<=d+g?k+r/c:k+r*Math.pow(2,1-g),2<=k*c&&(d++,c/=2),d+g>=f?(k=0,d=f):1<=d+g?(k=(k*c-1)*Math.pow(2,h),d+=g):(k=k*Math.pow(2,g-1)*Math.pow(2,h),d=0));for(;8<=h;a[b+m]=k&255,m+=p,k/=256,h-=8);d=d<>=7-a);return new k(b)};f.prototype.test=function(b,a,f){var c=b.bitLength(),e=k.mont(b), +d=(new k(1)).toRed(e);a||(a=Math.max(1,c/48|0));for(var h=b.subn(1),c=h.subn(1),m=0;!h.testn(m);m++);b=b.shrn(m);for(h=h.toRed(e);0> +8,c=c&255;e?d.push(e,c):d.push(c)}return d};g.zero2=f;g.toHex=k;g.encode=function(b,a){return"hex"===a?k(b):b}},{}],104:[function(a,l,g){g.endianness=function(){return"LE"};g.hostname=function(){return"undefined"!==typeof location?location.hostname:""};g.loadavg=function(){return[]};g.uptime=function(){return 0};g.freemem=function(){return Number.MAX_VALUE};g.totalmem=function(){return Number.MAX_VALUE};g.cpus=function(){return[]};g.type=function(){return"Browser"};g.release=function(){return"undefined"!== +typeof navigator?navigator.appVersion:""};g.networkInterfaces=g.getNetworkInterfaces=function(){return{}};g.arch=function(){return"javascript"};g.platform=function(){return"browser"};g.tmpdir=g.tmpDir=function(){return"/tmp"};g.EOL="\n"},{}],105:[function(a,l,g){a="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;g.assign=function(b){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var f=a.shift();if(f){if("object"!==typeof f)throw new TypeError(f+ +"must be non-object");for(var k in f)f.hasOwnProperty(k)&&(b[k]=f[k])}}return b};g.shrinkBuf=function(b,a){if(b.length===a)return b;if(b.subarray)return b.subarray(0,a);b.length=a;return b};var f={arraySet:function(b,a,f,k,c){if(a.subarray&&b.subarray)b.set(a.subarray(f,f+k),c);else for(var e=0;e>>16&65535|0;for(var m;0!==b;){m=2E3d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>> +1:a>>>1;b[d]=a}return b}();l.exports=function(a,b,d,h){d=h+d;for(a^=-1;h>>8^f[(a^b[h])&255];return a^-1}},{}],109:[function(a,l,g){function f(b,c){b.msg=G[c];return c}function k(b){for(var c=b.length;0<=--c;)b[c]=0}function b(b){var c=b.state,a=c.pending;a>b.avail_out&&(a=b.avail_out);0!==a&&(w.arraySet(b.output,c.pending_buf,c.pending_out,a,b.next_out),b.next_out+=a,c.pending_out+=a,b.total_out+=a,b.avail_out-=a,c.pending-=a,0===c.pending&&(c.pending_out=0))}function d(c,a){C._tr_flush_block(c, +0<=c.block_start?c.block_start:-1,c.strstart-c.block_start,a);c.block_start=c.strstart;b(c.strm)}function h(b,c){b.pending_buf[b.pending++]=c}function m(b,c){b.pending_buf[b.pending++]=c>>>8&255;b.pending_buf[b.pending++]=c&255}function c(b,c){var a=b.max_chain_length,e=b.strstart,d,f=b.prev_length,h=b.nice_match,k=b.strstart>b.w_size-262?b.strstart-(b.w_size-262):0,m=b.window,g=b.w_mask,n=b.prev,p=b.strstart+258,q=m[e+f-1],E=m[e+f];b.prev_length>=b.good_match&&(a>>=2);h>b.lookahead&&(h=b.lookahead); +do if(d=c,m[d+f]===E&&m[d+f-1]===q&&m[d]===m[e]&&m[++d]===m[e+1]){e+=2;for(d++;m[++e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&ef){b.match_start=c;f=d;if(d>=h)break;q=m[e+f-1];E=m[e+f]}}while((c=n[c&g])>k&&0!==--a);return f<=b.lookahead?f:b.lookahead}function e(b){var c=b.w_size,a,e,d,f;do{f=b.window_size-b.lookahead-b.strstart;if(b.strstart>=c+(c-262)){w.arraySet(b.window,b.window, +c,c,0);b.match_start-=c;b.strstart-=c;b.block_start-=c;a=e=b.hash_size;do d=b.head[--a],b.head[a]=d>=c?d-c:0;while(--e);a=e=c;do d=b.prev[--a],b.prev[a]=d>=c?d-c:0;while(--e);f+=c}if(0===b.strm.avail_in)break;a=b.strm;e=b.window;d=b.strstart+b.lookahead;var h=a.avail_in;h>f&&(h=f);0===h?e=0:(a.avail_in-=h,w.arraySet(e,a.input,a.next_in,h,d),1===a.state.wrap?a.adler=A(a.adler,e,h,d):2===a.state.wrap&&(a.adler=z(a.adler,e,h,d)),a.next_in+=h,a.total_in+=h,e=h);b.lookahead+=e;if(3<=b.lookahead+b.insert)for(f= +b.strstart-b.insert,b.ins_h=b.window[f],b.ins_h=(b.ins_h<b.lookahead+b.insert););}while(262>b.lookahead&&0!==b.strm.avail_in)}function n(b,a){for(var f;;){if(262>b.lookahead){e(b);if(262>b.lookahead&&0===a)return 1;if(0===b.lookahead)break}f=0;3<=b.lookahead&&(b.ins_h=(b.ins_h<b.strstart?b.strstart:2;return 4===a?(d(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(d(b,!1),0===b.strm.avail_out)?1:2}function t(b,a){for(var f,h;;){if(262>b.lookahead){e(b);if(262>b.lookahead&&0===a)return 1;if(0=== +b.lookahead)break}f=0;3<=b.lookahead&&(b.ins_h=(b.ins_h<=b.match_length&&(1===b.strategy||3===b.match_length&&4096b.strstart?b.strstart:2;return 4===a?(d(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(d(b,!1),0===b.strm.avail_out)?1:2}function r(b,c){for(var a,f,h,k=b.window;;){if(258>=b.lookahead){e(b);if(258>=b.lookahead&&0===c)return 1;if(0===b.lookahead)break}b.match_length=0;if(3<=b.lookahead&&0b.lookahead&&(b.match_length=b.lookahead)}3<=b.match_length?(a=C._tr_tally(b,1,b.match_length-3),b.lookahead-=b.match_length,b.strstart+=b.match_length,b.match_length=0):(a=C._tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++);if(a&&(d(b,!1),0===b.strm.avail_out))return 1}b.insert= +0;return 4===c?(d(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(d(b,!1),0===b.strm.avail_out)?1:2}function p(b,c){for(var a;;){if(0===b.lookahead&&(e(b),0===b.lookahead)){if(0===c)return 1;break}b.match_length=0;a=C._tr_tally(b,0,b.window[b.strstart]);b.lookahead--;b.strstart++;if(a&&(d(b,!1),0===b.strm.avail_out))return 1}b.insert=0;return 4===c?(d(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(d(b,!1),0===b.strm.avail_out)?1:2}function B(b,c,a,e,d){this.good_length=b;this.max_lazy=c;this.nice_length= +a;this.max_chain=e;this.func=d}function q(){this.strm=null;this.status=0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex=0;this.method=8;this.last_flush=-1;this.w_mask=this.w_bits=this.w_size=0;this.window=null;this.window_size=0;this.head=this.prev=null;this.nice_match=this.good_match=this.strategy=this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=this.lookahead=this.match_start=this.strstart=this.match_available= +this.prev_match=this.match_length=this.block_start=this.hash_shift=this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new w.Buf16(1146);this.dyn_dtree=new w.Buf16(122);this.bl_tree=new w.Buf16(78);k(this.dyn_ltree);k(this.dyn_dtree);k(this.bl_tree);this.bl_desc=this.d_desc=this.l_desc=null;this.bl_count=new w.Buf16(16);this.heap=new w.Buf16(573);k(this.heap);this.heap_max=this.heap_len=0;this.depth=new w.Buf16(573);k(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches= +this.static_len=this.opt_len=this.d_buf=this.last_lit=this.lit_bufsize=this.l_buf=0}function y(b){var c;if(!b||!b.state)return f(b,-2);b.total_in=b.total_out=0;b.data_type=2;c=b.state;c.pending=0;c.pending_out=0;0>c.wrap&&(c.wrap=-c.wrap);c.status=c.wrap?42:113;b.adler=2===c.wrap?0:1;c.last_flush=0;C._tr_init(c);return 0}function u(b){var c=y(b);0===c&&(b=b.state,b.window_size=2*b.w_size,k(b.head),b.max_lazy_match=F[b.level].max_lazy,b.good_match=F[b.level].good_length,b.nice_match=F[b.level].nice_length, +b.max_chain_length=F[b.level].max_chain,b.strstart=0,b.block_start=0,b.lookahead=0,b.insert=0,b.match_length=b.prev_length=2,b.match_available=0,b.ins_h=0);return c}function v(b,c,a,e,d,h){if(!b)return-2;var k=1;-1===c&&(c=6);0>e?(k=0,e=-e):15d||9e||15c||9h||4b.pending_buf_size-5&&(a=b.pending_buf_size- +5);;){if(1>=b.lookahead){e(b);if(0===b.lookahead&&0===c)return 1;if(0===b.lookahead)break}b.strstart+=b.lookahead;b.lookahead=0;var f=b.block_start+a;if(0===b.strstart||b.strstart>=f)if(b.lookahead=b.strstart-f,b.strstart=f,d(b,!1),0===b.strm.avail_out)return 1;if(b.strstart-b.block_start>=b.w_size-262&&(d(b,!1),0===b.strm.avail_out))return 1}b.insert=0;if(4===c)return d(b,!0),0===b.strm.avail_out?3:4;b.strstart>b.block_start&&d(b,!1);return 1}),new B(4,4,8,4,n),new B(4,5,16,8,n),new B(4,6,32,32, +n),new B(4,4,16,16,t),new B(8,16,32,32,t),new B(8,16,128,128,t),new B(8,32,128,256,t),new B(32,128,258,1024,t),new B(32,258,258,4096,t)];g.deflateInit=function(b,c){return v(b,c,8,15,8,0)};g.deflateInit2=v;g.deflateReset=u;g.deflateResetKeep=y;g.deflateSetHeader=function(b,c){if(!b||!b.state||2!==b.state.wrap)return-2;b.state.gzhead=c;return 0};g.deflate=function(c,a){var e,d,g,n;if(!c||!c.state||5a)return c?f(c,-2):-2;d=c.state;if(!c.output||!c.input&&0!==c.avail_in||666===d.status&&4!==a)return f(c, +0===c.avail_out?-5:-2);d.strm=c;e=d.last_flush;d.last_flush=a;42===d.status&&(2===d.wrap?(c.adler=0,h(d,31),h(d,139),h(d,8),d.gzhead?(h(d,(d.gzhead.text?1:0)+(d.gzhead.hcrc?2:0)+(d.gzhead.extra?4:0)+(d.gzhead.name?8:0)+(d.gzhead.comment?16:0)),h(d,d.gzhead.time&255),h(d,d.gzhead.time>>8&255),h(d,d.gzhead.time>>16&255),h(d,d.gzhead.time>>24&255),h(d,9===d.level?2:2<=d.strategy||2>d.level?4:0),h(d,d.gzhead.os&255),d.gzhead.extra&&d.gzhead.extra.length&&(h(d,d.gzhead.extra.length&255),h(d,d.gzhead.extra.length>> +8&255)),d.gzhead.hcrc&&(c.adler=z(c.adler,d.pending_buf,d.pending,0)),d.gzindex=0,d.status=69):(h(d,0),h(d,0),h(d,0),h(d,0),h(d,0),h(d,9===d.level?2:2<=d.strategy||2>d.level?4:0),h(d,3),d.status=113)):(g=8+(d.w_bits-8<<4)<<8,g|=(2<=d.strategy||2>d.level?0:6>d.level?1:6===d.level?2:3)<<6,0!==d.strstart&&(g|=32),d.status=113,m(d,g+(31-g%31)),0!==d.strstart&&(m(d,c.adler>>>16),m(d,c.adler&65535)),c.adler=1));if(69===d.status)if(d.gzhead.extra){for(g=d.pending;d.gzindex<(d.gzhead.extra.length&65535)&& +(d.pending!==d.pending_buf_size||(d.gzhead.hcrc&&d.pending>g&&(c.adler=z(c.adler,d.pending_buf,d.pending-g,g)),b(c),g=d.pending,d.pending!==d.pending_buf_size));)h(d,d.gzhead.extra[d.gzindex]&255),d.gzindex++;d.gzhead.hcrc&&d.pending>g&&(c.adler=z(c.adler,d.pending_buf,d.pending-g,g));d.gzindex===d.gzhead.extra.length&&(d.gzindex=0,d.status=73)}else d.status=73;if(73===d.status)if(d.gzhead.name){g=d.pending;do{if(d.pending===d.pending_buf_size&&(d.gzhead.hcrc&&d.pending>g&&(c.adler=z(c.adler,d.pending_buf, +d.pending-g,g)),b(c),g=d.pending,d.pending===d.pending_buf_size)){n=1;break}n=d.gzindexg&&(c.adler=z(c.adler,d.pending_buf,d.pending-g,g));0===n&&(d.gzindex=0,d.status=91)}else d.status=91;if(91===d.status)if(d.gzhead.comment){g=d.pending;do{if(d.pending===d.pending_buf_size&&(d.gzhead.hcrc&&d.pending>g&&(c.adler=z(c.adler,d.pending_buf,d.pending-g,g)),b(c),g=d.pending,d.pending===d.pending_buf_size)){n= +1;break}n=d.gzindexg&&(c.adler=z(c.adler,d.pending_buf,d.pending-g,g));0===n&&(d.status=103)}else d.status=103;103===d.status&&(d.gzhead.hcrc?(d.pending+2>d.pending_buf_size&&b(c),d.pending+2<=d.pending_buf_size&&(h(d,c.adler&255),h(d,c.adler>>8&255),c.adler=0,d.status=113)):d.status=113);if(0!==d.pending){if(b(c),0===c.avail_out)return d.last_flush=-1,0}else if(0===c.avail_in&&(a<< +1)-(4=d.wrap)return 1;2===d.wrap?(h(d,c.adler&255),h(d,c.adler>>8&255),h(d,c.adler>>16&255),h(d,c.adler>>24&255),h(d,c.total_in&255),h(d,c.total_in>>8&255),h(d,c.total_in>>16&255),h(d,c.total_in>>24&255)):(m(d,c.adler>>>16),m(d,c.adler&65535));b(c);0=d.w_size&&(0===h&&(k(d.head),d.strstart=0,d.block_start=0,d.insert=0),m=new w.Buf8(d.w_size),w.arraySet(m,c,a-d.w_size,d.w_size,0),c=m,a=d.w_size);m=b.avail_in;g=b.next_in;n=b.input;b.avail_in=a;b.next_in=0;b.input=c;for(e(d);3<=d.lookahead;){a=d.strstart;f=d.lookahead-2;do d.ins_h= +(d.ins_h<y&&(q+=J[d++]<>>24;q>>>=z;y-=z;z=A>>>16&255;if(0===z)x[m++]=A&65535;else if(z&16){G=A&65535;if(z&=15)y>>=z,y-=z;15>y&&(q+=J[d++]<>>24;q>>>=z;y-=z;z=A>>>16&255;if(z&16){A&=65535;z&=15;yg){a.msg="invalid distance too far back";b.mode=30;break a}q>>>=z;y-=z;z=m-c;if(A>z){z=A-z;if(z>r&&b.sane){a.msg="invalid distance too far back";b.mode=30;break a}F=0;E=B;if(0===p){if(F+=l-z,z>3;d-=G;y-=G<<3;a.next_in=d;a.next_out=m;a.avail_in=d>>24&255)+(b>>>8&65280)+((b&65280)<<8)+((b&255)<<24)}function k(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext= +this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new e.Buf16(320);this.work=new e.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function b(b){var c;if(!b||!b.state)return-2;c=b.state;b.total_in=b.total_out=c.total=0;b.msg="";c.wrap&&(b.adler=c.wrap&1);c.mode=1;c.last=0;c.havedict=0;c.dmax= +32768;c.head=null;c.hold=0;c.bits=0;c.lencode=c.lendyn=new e.Buf32(852);c.distcode=c.distdyn=new e.Buf32(592);c.sane=1;c.back=-1;return 0}function d(c){var a;if(!c||!c.state)return-2;a=c.state;a.wsize=0;a.whave=0;a.wnext=0;return b(c)}function h(b,c){var a,e;if(!b||!b.state)return-2;e=b.state;0>c?(a=0,c=-c):(a=(c>>4)+1,48>c&&(c&=15));if(c&&(8>c||15=f.wsize?(e.arraySet(f.window,c,a-f.wsize,f.wsize,0),f.wnext=0,f.whave=f.wsize):(b=f.wsize-f.wnext,b>d&&(b=d),e.arraySet(f.window,c,a-d,b,f.wnext),(d-=b)?(e.arraySet(f.window,c,a-d,d,0),f.wnext=d,f.whave=f.wsize):(f.wnext+=b,f.wnext===f.wsize&&(f.wnext=0),f.whavex;){if(0===l)break a;l--;u+=h[m++]<>>8&255;d.check=t(d.check,T,2,0);x=u=0;d.mode=2;break}d.flags=0;d.head&&(d.head.done=!1);if(!(d.wrap&1)||(((u&255)<<8)+(u>>8))%31){b.msg="incorrect header check";d.mode=30;break}if(8!==(u&15)){b.msg="unknown compression method";d.mode=30;break}u>>>=4;x-=4;I=(u&15)+8;if(0===d.wbits)d.wbits=I;else if(I>d.wbits){b.msg="invalid window size"; +d.mode=30;break}d.dmax=1<x;){if(0===l)break a;l--;u+=h[m++]<>8&1);d.flags&512&&(T[0]=u&255,T[1]=u>>>8&255,d.check=t(d.check,T,2,0));x=u=0;d.mode=3;case 3:for(;32>x;){if(0===l)break a;l--;u+=h[m++]<>>8&255,T[2]=u>>>16&255,T[3]=u>>>24&255,d.check=t(d.check,T,4,0));x=u=0;d.mode=4;case 4:for(;16>x;){if(0===l)break a;l--;u+=h[m++]<>8);d.flags&512&&(T[0]=u&255,T[1]=u>>>8&255,d.check=t(d.check,T,2,0));x=u=0;d.mode=5;case 5:if(d.flags&1024){for(;16>x;){if(0===l)break a;l--;u+=h[m++]<>>8&255,d.check=t(d.check,T,2,0));x=u=0}else d.head&&(d.head.extra=null);d.mode=6; +case 6:if(d.flags&1024&&(D=d.length,D>l&&(D=l),D&&(d.head&&(I=d.head.extra_len-d.length,d.head.extra||(d.head.extra=Array(d.head.extra_len)),e.arraySet(d.head.extra,h,m,D,I)),d.flags&512&&(d.check=t(d.check,h,D,m)),l-=D,m+=D,d.length-=D),d.length))break a;d.length=0;d.mode=7;case 7:if(d.flags&2048){if(0===l)break a;D=0;do I=h[m+D++],d.head&&I&&65536>d.length&&(d.head.name+=String.fromCharCode(I));while(I&&Dd.length&&(d.head.comment+=String.fromCharCode(I));while(I&&Dx;){if(0===l)break a;l--;u+=h[m++]<>9&1,d.head.done=!0);b.adler=d.check=0;d.mode=12;break; +case 10:for(;32>x;){if(0===l)break a;l--;u+=h[m++]<>>=x&7;x-=x&7;d.mode=27;break}for(;3>x;){if(0===l)break a;l--;u+=h[m++]<>>=1;--x;switch(u&3){case 0:d.mode=14;break;case 1:I=d;if(B){q=new e.Buf32(512);y=new e.Buf32(32);for(D=0;144>D;)I.lens[D++]=8; +for(;256>D;)I.lens[D++]=9;for(;280>D;)I.lens[D++]=7;for(;288>D;)I.lens[D++]=8;p(1,I.lens,0,288,q,0,I.work,{bits:9});for(D=0;32>D;)I.lens[D++]=5;p(2,I.lens,0,32,y,0,I.work,{bits:5});B=!1}I.lencode=q;I.lenbits=9;I.distcode=y;I.distbits=5;d.mode=20;if(6===a){u>>>=2;x-=2;break a}break;case 2:d.mode=17;break;case 3:b.msg="invalid block type",d.mode=30}u>>>=2;x-=2;break;case 14:u>>>=x&7;for(x-=x&7;32>x;){if(0===l)break a;l--;u+=h[m++]<>>16^65535)){b.msg="invalid stored block lengths"; +d.mode=30;break}d.length=u&65535;x=u=0;d.mode=15;if(6===a)break a;case 15:d.mode=16;case 16:if(D=d.length){D>l&&(D=l);D>v&&(D=v);if(0===D)break a;e.arraySet(k,h,m,D,g);l-=D;m+=D;v-=D;g+=D;d.length-=D;break}d.mode=12;break;case 17:for(;14>x;){if(0===l)break a;l--;u+=h[m++]<>>=5;x-=5;d.ndist=(u&31)+1;u>>>=5;x-=5;d.ncode=(u&15)+4;u>>>=4;x-=4;if(286 +x;){if(0===l)break a;l--;u+=h[m++]<>>=3;x-=3}for(;19>d.have;)d.lens[ja[d.have++]]=0;d.lencode=d.lendyn;d.lenbits=7;D={bits:d.lenbits};S=p(0,d.lens,0,19,d.lencode,0,d.work,D);d.lenbits=D.bits;if(S){b.msg="invalid code lengths set";d.mode=30;break}d.have=0;d.mode=19;case 19:for(;d.have>>24;L&=65535;if(D<=x)break;if(0===l)break a;l--;u+=h[m++]<L)u>>>=D,x-=D,d.lens[d.have++]=L;else{if(16===L){for(I= +D+2;x>>=D;x-=D;if(0===d.have){b.msg="invalid bit length repeat";d.mode=30;break}I=d.lens[d.have-1];D=3+(u&3);u>>>=2;x-=2}else if(17===L){for(I=D+3;x>>=D;x-=D;I=0;D=3+(u&7);u>>>=3;x-=3}else{for(I=D+7;x>>=D;x-=D;I=0;D=11+(u&127);u>>>=7;x-=7}if(d.have+D>d.nlen+d.ndist){b.msg="invalid bit length repeat";d.mode=30;break}for(;D--;)d.lens[d.have++]=I}}if(30===d.mode)break; +if(0===d.lens[256]){b.msg="invalid code -- missing end-of-block";d.mode=30;break}d.lenbits=9;D={bits:d.lenbits};S=p(1,d.lens,0,d.nlen,d.lencode,0,d.work,D);d.lenbits=D.bits;if(S){b.msg="invalid literal/lengths set";d.mode=30;break}d.distbits=6;d.distcode=d.distdyn;D={bits:d.distbits};S=p(2,d.lens,d.nlen,d.ndist,d.distcode,0,d.work,D);d.distbits=D.bits;if(S){b.msg="invalid distances set";d.mode=30;break}d.mode=20;if(6===a)break a;case 20:d.mode=21;case 21:if(6<=l&&258<=v){b.next_out=g;b.avail_out= +v;b.next_in=m;b.avail_in=l;d.hold=u;d.bits=x;r(b,K);g=b.next_out;k=b.output;v=b.avail_out;m=b.next_in;h=b.input;l=b.avail_in;u=d.hold;x=d.bits;12===d.mode&&(d.back=-1);break}for(d.back=0;;){L=d.lencode[u&(1<>>24;I=L>>>16&255;L&=65535;if(D<=x)break;if(0===l)break a;l--;u+=h[m++]<>N)];D=L>>>24;I=L>>>16&255;L&=65535;if(N+D<=x)break;if(0===l)break a;l--;u+=h[m++]<>>=N;x-=N;d.back+=N}u>>>=D;x-=D;d.back+= +D;d.length=L;if(0===I){d.mode=26;break}if(I&32){d.back=-1;d.mode=12;break}if(I&64){b.msg="invalid literal/length code";d.mode=30;break}d.extra=I&15;d.mode=22;case 22:if(d.extra){for(I=d.extra;x>>=d.extra;x-=d.extra;d.back+=d.extra}d.was=d.length;d.mode=23;case 23:for(;;){L=d.distcode[u&(1<>>24;I=L>>>16&255;L&=65535;if(D<=x)break;if(0===l)break a;l--;u+=h[m++]<>N)];D=L>>>24;I=L>>>16&255;L&=65535;if(N+D<=x)break;if(0===l)break a;l--;u+=h[m++]<>>=N;x-=N;d.back+=N}u>>>=D;x-=D;d.back+=D;if(I&64){b.msg="invalid distance code";d.mode=30;break}d.offset=L;d.extra=I&15;d.mode=24;case 24:if(d.extra){for(I=d.extra;x>>=d.extra;x-=d.extra;d.back+=d.extra}if(d.offset>d.dmax){b.msg="invalid distance too far back";d.mode=30;break}d.mode=25;case 25:if(0===v)break a;D=K-v; +if(d.offset>D){D=d.offset-D;if(D>d.whave&&d.sane){b.msg="invalid distance too far back";d.mode=30;break}D>d.wnext?(D-=d.wnext,I=d.wsize-D):I=d.wnext-D;D>d.length&&(D=d.length);N=d.window}else N=k,I=g-d.offset,D=d.length;D>v&&(D=v);v-=D;d.length-=D;do k[g++]=N[I++];while(--D);0===d.length&&(d.mode=21);break;case 26:if(0===v)break a;k[g++]=d.length;v--;d.mode=21;break;case 27:if(d.wrap){for(;32>x;){if(0===l)break a;l--;u|=h[m++]<x;){if(0===l)break a;l--;u+=h[m++]<d.mode&&(27>d.mode||4!==a))&& +c(b,b.output,b.next_out,K-b.avail_out))return d.mode=31,-4;H-=b.avail_in;K-=b.avail_out;b.total_in+=H;b.total_out+=K;d.total+=K;d.wrap&&K&&(b.adler=d.check=d.flags?t(d.check,k,K,b.next_out-K):n(d.check,k,K,b.next_out-K));b.data_type=d.bits+(d.last?64:0)+(12===d.mode?128:0)+(20===d.mode||15===d.mode?256:0);(0===H&&0===K||4===a)&&0===S&&(S=-5);return S};g.inflateEnd=function(b){if(!b||!b.state)return-2;var c=b.state;c.window&&(c.window=null);b.state=null;return 0};g.inflateGetHeader=function(b,c){var a; +if(!b||!b.state)return-2;a=b.state;if(0===(a.wrap&2))return-2;a.head=c;c.done=!1;return 0};g.inflateSetDictionary=function(b,a){var d=a.length,e,f;if(!b||!b.state)return-2;e=b.state;if(0!==e.wrap&&11!==e.mode)return-2;if(11===e.mode&&(f=n(1,a,d,0),f!==e.check))return-3;if(c(b,a,d,d))return e.mode=31,-4;e.havedict=1;return 0};g.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":105,"./adler32":106,"./crc32":108,"./inffast":110,"./inftrees":112}],112:[function(a,l,g){var f=a("../utils/common"), +k=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],b=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],d=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],h=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];l.exports=function(a,c,e,g,l,r,p,B){var m=B.bits,n,t,v,w,C,A,z,G,F,E,J,x,H,K=0,D,I=new f.Buf16(16); +C=new f.Buf16(16);var N,L=0,M,Z,S;for(n=0;15>=n;n++)I[n]=0;for(t=0;tv&&(w=v);if(0===v)return l[r++]=20971520,l[r++]=20971520,B.bits=1,0;for(m=1;m=n;n++)if(A<<=1,A-=I[n],0>A)return-1;if(0n;n++)C[n+1]=C[n]+I[n];for(t=0;tD?(Z=N[L+p[t]],S=H[K+p[t]]):(Z=96,S=0);A=1<>C)+F]=M<<24|Z<<16|S|0;while(0!==F);for(A=1<>=1;0!==A?(G&=A-1,G+=A):G=0;t++;if(0===--I[n]){if(n===v)break;n=c[e+p[t]]}if(n>w&&(G&J)!==E){0===C&&(C=w);x+=m;g=n-C;for(A=1<=A)break;g++;A<<=1}z+=1<>>8&255}function h(b,c,a){b.bi_valid>16-a?(b.bi_buf|=c<>16-b.bi_valid,b.bi_valid+=a-16):(b.bi_buf|=c<>>=1,a<<=1;while(0<--c);return a>>>1}function e(b,a,d){var e=Array(16),f=0,h;for(h=1;15>=h;h++)e[h]=f=f+d[h-1]<<1;for(d=0;d<=a;d++)f=b[2*d+1],0!==f&&(b[2* +d]=c(e[f]++,f))}function n(b){var c;for(c=0;286>c;c++)b.dyn_ltree[2*c]=0;for(c=0;30>c;c++)b.dyn_dtree[2*c]=0;for(c=0;19>c;c++)b.bl_tree[2*c]=0;b.dyn_ltree[512]=1;b.opt_len=b.static_len=0;b.last_lit=b.matches=0}function t(b){8d?x[d]:x[256+(d>>>7)],m(b,k,a),g=z[k],0!==g&&(d-=D[k],h(b,d,g)));while(fb.heap_len;)g=b.heap[++b.heap_len]=2>m?++m:0,a[2*g]=1,b.depth[g]=0,b.opt_len--,f&&(b.static_len-=d[2*g+1]);c.max_code=m;for(k=b.heap_len>>1;1<=k;k--)p(b,a,k);g=h;do k=b.heap[1],b.heap[1]=b.heap[b.heap_len--],p(b,a,1),d=b.heap[1],b.heap[--b.heap_max]=k,b.heap[--b.heap_max]=d,a[2*g]=a[2*k]+a[2*d],b.depth[g]=(b.depth[k]>=b.depth[d]?b.depth[k]:b.depth[d])+1,a[2*k+1]=a[2*d+1]=g,b.heap[1]= +g++,p(b,a,1);while(2<=b.heap_len);b.heap[--b.heap_max]=b.heap[1];k=c.dyn_tree;g=c.max_code;for(var n=c.stat_desc.static_tree,q=c.stat_desc.has_stree,l=c.stat_desc.extra_bits,r=c.stat_desc.extra_base,v=c.stat_desc.max_length,t,u,y=0,h=0;15>=h;h++)b.bl_count[h]=0;k[2*b.heap[b.heap_max]+1]=0;for(d=b.heap_max+1;573>d;d++)f=b.heap[d],h=k[2*k[2*f+1]+1]+1,h>v&&(h=v,y++),k[2*f+1]=h,f>g||(b.bl_count[h]++,t=0,f>=r&&(t=l[f-r]),u=k[2*f],b.opt_len+=u*(h+t),q&&(b.static_len+=u*(n[2*f+1]+t)));if(0!==y){do{for(h= +v-1;0===b.bl_count[h];)h--;b.bl_count[h]--;b.bl_count[h+1]+=2;b.bl_count[v]--;y-=2}while(0g||(k[2*n+1]!==h&&(b.opt_len+=(h-k[2*n+1])*k[2*n],k[2*n+1]=h),f--)}e(a,m,b.bl_count)}function y(b,c,a){var d,e=-1,f,h=c[1],k=0,m=7,g=4;0===h&&(m=138,g=3);c[2*(a+1)+1]=65535;for(d=0;d<=a;d++)f=h,h=c[2*(d+1)+1],++k=k?b.bl_tree[34]++:b.bl_tree[36]++,k=0,e=f,0===h? +(m=138,g=3):f===h?(m=6,g=3):(m=7,g=4))}function u(b,c,a){var d,e=-1,f,k=c[1],g=0,n=7,p=4;0===k&&(n=138,p=3);for(d=0;d<=a;d++)if(f=k,k=c[2*(d+1)+1],!(++g=g?(m(b,17,b.bl_tree),h(b,g-3,3)):(m(b,18,b.bl_tree),h(b,g-11,7));g=0;e=f;0===k?(n=138,p=3):f===k?(n=6,p=3):(n=7,p=4)}}function v(b){var c=4093624447,a;for(a=0;31>=a;a++,c>>>=1)if(c&1&&0!==b.dyn_ltree[2*a])return 0;if(0!== +b.dyn_ltree[18]||0!==b.dyn_ltree[20]||0!==b.dyn_ltree[26])return 1;for(a=32;256>a;a++)if(0!==b.dyn_ltree[2*a])return 1;return 0}function w(b,c,a,e){h(b,0+(e?1:0),3);t(b);d(b,a);d(b,~a);C.arraySet(b.pending_buf,b.window,c,a,b.pending);b.pending+=a}var C=a("../utils/common"),A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],z=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],G=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15], +E=Array(576);f(E);var J=Array(60);f(J);var x=Array(512);f(x);var H=Array(256);f(H);var K=Array(29);f(K);var D=Array(30);f(D);var I,N,L,M=!1;g._tr_init=function(a){if(!M){var d,f,h,m=Array(16);for(h=f=0;28>h;h++)for(K[h]=f,d=0;d<1<h;h++)for(D[h]=f,d=0;d<1<>=7;30>h;h++)for(D[h]=f<<7,d=0;d<1<=d;d++)m[d]=0;for(d=0;143>=d;)E[2*d+1]=8,d++,m[8]++;for(;255>=d;)E[2*d+1]=9,d++,m[9]++;for(;279>=d;)E[2*d+1]= +7,d++,m[7]++;for(;287>=d;)E[2*d+1]=8,d++,m[8]++;e(E,287,m);for(d=0;30>d;d++)J[2*d+1]=5,J[2*d]=c(d,5);I=new k(E,A,257,286,15);N=new k(J,z,0,30,15);L=new k([],G,0,19,7);M=!0}a.l_desc=new b(a.dyn_ltree,I);a.d_desc=new b(a.dyn_dtree,N);a.bl_desc=new b(a.bl_tree,L);a.bi_buf=0;a.bi_valid=0;n(a)};g._tr_stored_block=w;g._tr_flush_block=function(b,c,a,d){var e,f,k=0;if(0>>3;f=b.static_len+3+7>>>3;f<=e&&(e=f)}else e=f=a+5;if(a+4<=e&&-1!==c)w(b,c,a,d);else if(4===b.strategy||f===e)h(b,2+(d?1:0),3),B(b,E,J);else{h(b,4+(d?1:0),3);c=b.l_desc.max_code+1;a=b.d_desc.max_code+1;k+=1;h(b,c-257,5);h(b,a-1,5);h(b,k-4,4);for(e=0;e>>8&255;b.pending_buf[b.d_buf+2*b.last_lit+1]=c&255;b.pending_buf[b.l_buf+b.last_lit]=a&255;b.last_lit++;0===c?b.dyn_ltree[2*a]++:(b.matches++,c--,b.dyn_ltree[2*(H[a]+256+1)]++,b.dyn_dtree[2*(256>c?x[c]:x[256+(c>>>7)])]++);return b.last_lit===b.lit_bufsize-1};g._tr_align=function(b){h(b,2,3);m(b,256,E);16===b.bi_valid?(d(b,b.bi_buf),b.bi_buf=0,b.bi_valid=0):8<=b.bi_valid&&(b.pending_buf[b.pending++]=b.bi_buf&255,b.bi_buf>>=8,b.bi_valid-=8)}},{"../utils/common":105}],115:[function(a, +l,g){l.exports=function(){this.input=null;this.total_in=this.avail_in=this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}},{}],116:[function(a,l,g){l.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb", +"2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],117:[function(a,l,g){a=a("asn1.js");l=a.define("RSAPrivateKey",function(){this.seq().obj(this.key("version")["int"](),this.key("modulus")["int"](),this.key("publicExponent")["int"](),this.key("privateExponent")["int"](),this.key("prime1")["int"](),this.key("prime2")["int"](),this.key("exponent1")["int"](), +this.key("exponent2")["int"](),this.key("coefficient")["int"]())});g.RSAPrivateKey=l;l=a.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus")["int"](),this.key("publicExponent")["int"]())});g.RSAPublicKey=l;l=a.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(f),this.key("subjectPublicKey").bitstr())});g.PublicKey=l;var f=a.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(), +this.key("params").seq().obj(this.key("p")["int"](),this.key("q")["int"](),this.key("g")["int"]()).optional())});l=a.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version")["int"](),this.key("algorithm").use(f),this.key("subjectPrivateKey").octstr())});g.PrivateKey=l;l=a.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(), +this.key("iters")["int"]())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});g.EncryptedPrivateKey=l;l=a.define("DSAPrivateKey",function(){this.seq().obj(this.key("version")["int"](),this.key("p")["int"](),this.key("q")["int"](),this.key("g")["int"](),this.key("pub_key")["int"](),this.key("priv_key")["int"]())});g.DSAPrivateKey=l;g.DSAparam=a.define("DSAparam",function(){this["int"]()});l=a.define("ECPrivateKey",function(){this.seq().obj(this.key("version")["int"](), +this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(k),this.key("publicKey").optional().explicit(1).bitstr())});g.ECPrivateKey=l;var k=a.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});g.signature=a.define("signature",function(){this.seq().obj(this.key("r")["int"](),this.key("s")["int"]())})},{"asn1.js":2}],118:[function(a,l,g){(function(f){var k=/Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m, +b=/^-----BEGIN (.*) KEY-----\r?\n/m,d=/^-----BEGIN (.*) KEY-----\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n-----END \1 KEY-----$/m,h=a("evp_bytestokey"),m=a("browserify-aes");l.exports=function(c,a){var e=c.toString(),g=e.match(k),l;if(g){var p="aes"+g[1],B=new f(g[2],"hex");l=new f(g[3].replace(/\r?\n/g,""),"base64");var q=h(a,B.slice(0,8),parseInt(g[1],10)).key,g=[],p=m.createDecipheriv(p,q,B);g.push(p.update(l));g.push(p["final"]());l=f.concat(g)}else l=e.match(d),l=new f(l[2].replace(/\r?\n/g,""),"base64"); +return{tag:e.match(b)[1]+" KEY",data:l}}}).call(this,a("buffer").Buffer)},{"browserify-aes":23,buffer:49,evp_bytestokey:87}],119:[function(a,l,g){(function(f){function k(a){var e;"object"!==typeof a||f.isBuffer(a)||(e=a.passphrase,a=a.key);"string"===typeof a&&(a=new f(a));var k=h(a,e);a=k.tag;k=k.data;switch(a){case "PUBLIC KEY":e=b.PublicKey.decode(k,"der");a=e.algorithm.algorithm.join(".");switch(a){case "1.2.840.113549.1.1.1":return b.RSAPublicKey.decode(e.subjectPublicKey.data,"der");case "1.2.840.10045.2.1":return e.subjectPrivateKey= +e.subjectPublicKey,{type:"ec",data:e};case "1.2.840.10040.4.1":return e.algorithm.params.pub_key=b.DSAparam.decode(e.subjectPublicKey.data,"der"),{type:"dsa",data:e.algorithm.params};default:throw Error("unknown key id "+a);}throw Error("unknown key type "+a);case "ENCRYPTED PRIVATE KEY":a=k=b.EncryptedPrivateKey.decode(k,"der");var g=e,p=a.algorithm.decrypt.kde.kdeparams.salt,l=parseInt(a.algorithm.decrypt.kde.kdeparams.iters.toString(),10);e=d[a.algorithm.decrypt.cipher.algo.join(".")];k=a.algorithm.decrypt.cipher.iv; +a=a.subjectPrivateKey;var q=parseInt(e.split("-")[1],10)/8,g=c.pbkdf2Sync(g,p,l,q);e=m.createDecipheriv(e,g,k);k=[];k.push(e.update(a));k.push(e["final"]());k=f.concat(k);case "PRIVATE KEY":e=b.PrivateKey.decode(k,"der");a=e.algorithm.algorithm.join(".");switch(a){case "1.2.840.113549.1.1.1":return b.RSAPrivateKey.decode(e.subjectPrivateKey,"der");case "1.2.840.10045.2.1":return{curve:e.algorithm.curve,privateKey:b.ECPrivateKey.decode(e.subjectPrivateKey,"der").privateKey};case "1.2.840.10040.4.1":return e.algorithm.params.priv_key= +b.DSAparam.decode(e.subjectPrivateKey,"der"),{type:"dsa",params:e.algorithm.params};default:throw Error("unknown key id "+a);}throw Error("unknown key type "+a);case "RSA PUBLIC KEY":return b.RSAPublicKey.decode(k,"der");case "RSA PRIVATE KEY":return b.RSAPrivateKey.decode(k,"der");case "DSA PRIVATE KEY":return{type:"dsa",params:b.DSAPrivateKey.decode(k,"der")};case "EC PRIVATE KEY":return k=b.ECPrivateKey.decode(k,"der"),{curve:k.parameters.value,privateKey:k.privateKey};default:throw Error("unknown key type "+ +a);}}var b=a("./asn1"),d=a("./aesid.json"),h=a("./fixProc"),m=a("browserify-aes"),c=a("pbkdf2");l.exports=k;k.signature=b.signature}).call(this,a("buffer").Buffer)},{"./aesid.json":116,"./asn1":117,"./fixProc":118,"browserify-aes":23,buffer:49,pbkdf2:121}],120:[function(a,l,g){(function(a){function f(b,c){for(var a=0,d=b.length-1;0<=d;d--){var f=b[d];"."===f?b.splice(d,1):".."===f?(b.splice(d,1),a++):a&&(b.splice(d,1),a--)}if(c)for(;a--;a)b.unshift("..");return b}function b(b,c){if(b.filter)return b.filter(c); +for(var a=[],d=0;d +a?[]:b.slice(c,a-c+1)}b=g.resolve(b).substr(1);c=g.resolve(c).substr(1);for(var d=a(b.split("/")),f=a(c.split("/")),h=Math.min(d.length,f.length),k=h,m=0;mc&&(c=b.length+c);return b.substr(c,a)}}).call(this,a("_process"))},{_process:124}],121:[function(a,l,g){(function(f,k){var b=a("create-hmac"),d=a("./precondition");g.pbkdf2=function(b,c,a,f,h,k){"function"===typeof h&&(k=h,h=void 0);d(a,f);if("function"!==typeof k)throw Error("No callback provided to pbkdf2");setTimeout(function(){k(null, +g.pbkdf2Sync(b,c,a,f,h))})};var h;h=f.browser?"utf-8":6<=parseInt(f.version.split(".")[0].slice(1),10)?"utf-8":"binary";g.pbkdf2Sync=function(a,c,e,f,g){k.isBuffer(a)||(a=new k(a,h));k.isBuffer(c)||(c=new k(c,h));d(e,f);g=g||"sha1";var m,n=1,l=new k(f),q=new k(c.length+4);c.copy(q,0,0,c.length);for(var t,u,v=1;v<=n;v++){q.writeUInt32BE(v,c.length);var w=b(g,a).update(q).digest();m||(m=w.length,u=new k(m),n=Math.ceil(f/m),t=f-(n-1)*m);w.copy(u,0,0,m);for(var C=1;Ca)throw new TypeError("Bad iterations");if("number"!==typeof b)throw new TypeError("Key length not a number");if(0>b||b>f||b!==b)throw new TypeError("Bad key length");}},{}],123:[function(a, +l,g){(function(a){function f(b,d,f,k){if("function"!==typeof b)throw new TypeError('"callback" argument must be a function');var c=arguments.length,e;switch(c){case 0:case 1:return a.nextTick(b);case 2:return a.nextTick(function(){b.call(null,d)});case 3:return a.nextTick(function(){b.call(null,d,f)});case 4:return a.nextTick(function(){b.call(null,d,f,k)});default:e=Array(c-1);for(c=0;cr||0<=(new h(g)).cmp(a.modulus))throw Error("decryption error");g=l?e(new h(g),a):m(g,a);var q=new f(r-g.length);q.fill(0);g=f.concat([q,g],r);if(4===n){r=g;n=a.modulus.byteLength();a=c("sha1").update(new f("")).digest();l=a.length;if(0!==r[0])throw Error("decryption error");g=r.slice(1,l+1);r=r.slice(l+1);g=d(g,b(r,l));n=d(r,b(g,n-l-1));r=n.slice(0,l);a=new f(a);r=new f(r);g=0;q=a.length;a.length!==r.length&&(g++,q=Math.min(a.length,r.length));for(var t=-1;++t=n.length){g++;break}q=n.slice(2,r-1);n.slice(r-1,r);("0002"!==a.toString("hex")&&!l||"0001"!==a.toString("hex")&&l)&&g++;8>q.length&&g++;if(g)throw Error("decryption error");return n.slice(r)}if(3===n)return g;throw Error("unknown padding");}}).call(this,a("buffer").Buffer)},{"./mgf":126,"./withPublic":129,"./xor":130,"bn.js":18,"browserify-rsa":39,buffer:49, +"create-hash":55,"parse-asn1":119}],128:[function(a,l,g){(function(f){var k=a("parse-asn1"),b=a("randombytes"),d=a("create-hash"),h=a("./mgf"),m=a("./xor"),c=a("bn.js"),e=a("./withPublic"),g=a("browserify-rsa");l.exports=function(a,n,p){var l;l=a.padding?a.padding:p?1:4;a=k(a);if(4===l){l=a.modulus.byteLength();var q=n.length,r=d("sha1").update(new f("")).digest(),t=r.length,v=2*t;if(q>l-v-2)throw Error("message too long");v=new f(l-q-v-2);v.fill(0);var w=l-t-1,q=b(t);n=m(f.concat([r,v,new f([1]), +n],w),h(q,w));t=m(q,h(n,t));n=new c(f.concat([new f([0]),t,n],l))}else if(1===l){t=n.length;l=a.modulus.byteLength();if(t>l-11)throw Error("message too long");if(p)t=new f(l-t-3),t.fill(255);else{for(var t=l-t-3,r=new f(t),q=0,v=b(2*t),w=0,C;q=e&&a>>10&1023|55296),b=56320|b&1023);return c+=z(b)}).join("")}function e(b,c){return b+22+75*(26>b)-((0!=c)<<5)}function n(b,c,a){var d=0;b=a?A(b/700):b>>1;for(b+=A(b/c);455g&&(g=0);for(p=0;p= +e&&b("invalid-input");q=a.charCodeAt(g++);q=10>q-48?q-22:26>q-65?q-65:26>q-97?q-97:36;(36<=q||q>A((2147483647-h)/f))&&b("overflow");h+=q*f;v=l<=m?1:l>=m+26?26:l-m;if(qA(2147483647/q)&&b("overflow");f*=q}f=d.length+1;m=n(h-p,f,0==p);A(h/f)>2147483647-k&&b("overflow");k+=A(h/f);h%=f;d.splice(h++,0,k)}return c(d)}function r(c){var a,d,f,h,m,g,p,l,q,v=[],r,t,u;c=k(c);r=c.length;a=128;d=0;m=72;for(g=0;gq&&v.push(z(q));for((f=h=v.length)&&v.push("-");f=a&&qA((2147483647-d)/t)&&b("overflow");d+=(p-a)*t;a=p;for(g=0;g=m+26?26:p-m;if(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=Math.floor,z=String.fromCharCode,G;y={version:"1.4.1",ucs2:{decode:k,encode:c},decode:t,encode:r,toASCII:function(b){return h(b,function(b){return v.test(b)?"xn--"+r(b):b})},toUnicode:function(b){return h(b,function(b){return u.test(b)?t(b.slice(4).toLowerCase()):b})}};if("function"==typeof define&& +"object"==typeof define.amd&&define.amd)define("punycode",function(){return y});else if(p&&B)if(l.exports==p)B.exports=y;else for(G in y)y.hasOwnProperty(G)&&(p[G]=y[G]);else f.punycode=y})(this)}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],132:[function(a,l,g){l.exports=function(a,b,d,h){d=d||"=";var k={};if("string"!==typeof a||0===a.length)return k;var c=/\+/g;a=a.split(b||"&");b=1E3;h&&"number"===typeof h.maxKeys&&(b= +h.maxKeys);h=a.length;0b&&(h=b);for(b=0;b=b||0===a.length&&a.ended)return 0;if(a.objectMode)return 1;if(b!==b)return a.flowing&&a.length?a.buffer.head.data.length:a.length;if(b>a.highWaterMark){var c=b;8388608<=c?c=8388608:(c--,c|=c>>>1,c|=c>>>2,c|=c>>>4,c|=c>>>8,c|=c>>>16,c++);a.highWaterMark=c}return b<=a.length?b:a.ended?a.length:(a.needReadable=!0,0)}function c(b){var a= +b._readableState;a.needReadable=!1;a.emittedReadable||(H("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?C(e,b):e(b))}function e(b){H("emit readable");b.emit("readable");B(b)}function g(b,a){for(var c=a.length;!a.reading&&!a.flowing&&!a.ended&&a.length=a.length)c=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length), +a.buffer.clear();else{c=a.buffer;var d=a.decoder;if(bk.length?k.length:d,h=m===k.length?h+k:h+k.slice(0,d),d=d-m;if(0===d){m===k.length?(++f,c.head=e.next?e.next:c.tail=null):(c.head=e,e.data=k.slice(m));break}++f}c.length-=f;c=h}else{d=b;e=E.allocUnsafe(d);f=c.head;h=1;f.data.copy(e);for(d-=f.data.length;f= +f.next;){k=f.data;m=d>k.length?k.length:d;k.copy(e,e.length-d,0,m);d-=m;if(0===d){m===k.length?(++h,c.head=f.next?f.next:c.tail=null):(c.head=f,f.data=k.slice(m));break}++h}c.length-=h;c=e}d=c}c=d}return c}function y(b){var a=b._readableState;if(0=a.highWaterMark||a.ended))return H("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?y(this):c(this),null;b=m(b,a);if(0===b&&a.ended)return 0===a.length&&y(this),null;var e=a.needReadable;H("need readable",e);if(0===a.length||a.length-b>>0);for(var a=this.head,f=0;a;)a.data.copy(b,f),f+=a.data.length,a=a.next;return b}},{buffer:49,"buffer-shims":47}],143:[function(a,l,g){l.exports=a("./lib/_stream_passthrough.js")}, +{"./lib/_stream_passthrough.js":138}],144:[function(a,l,g){var f=a("_process"),k;a:{try{k=a("stream");break a}catch(b){}k=void 0}g=l.exports=a("./lib/_stream_readable.js");g.Stream=k||g;g.Readable=g;g.Writable=a("./lib/_stream_writable.js");g.Duplex=a("./lib/_stream_duplex.js");g.Transform=a("./lib/_stream_transform.js");g.PassThrough=a("./lib/_stream_passthrough.js");!f.browser&&"disable"===f.env.READABLE_STREAM&&k&&(l.exports=k)},{"./lib/_stream_duplex.js":137,"./lib/_stream_passthrough.js":138, +"./lib/_stream_readable.js":139,"./lib/_stream_transform.js":140,"./lib/_stream_writable.js":141,_process:124}],145:[function(a,l,g){l.exports=a("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":140}],146:[function(a,l,g){l.exports=a("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":141}],147:[function(a,l,g){(function(a){function f(b,a){return b<>>32-a}var b=[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],d=[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],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7, +8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],c=[0,1518500249,1859775393,2400959708,2840853838],e=[1352829926,1548603684,1836072691,2053994217,0];l.exports=function(k){var g=[1732584193,4023233417,2562383102,271733878,3285377520];"string"===typeof k&&(k=new a(k,"utf8"));for(var n=k,p=[],l=0,q=0;l>>5]|=n[l]<<24-q%32;n=8*k.length;k=8*k.length;p[n>>> +5]|=128<<24-n%32;p[(n+64>>>9<<4)+14]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360;for(k=0;kx;x++)y=q+x,u=l[y],l[y]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360;A=J=n[0];C=E=n[1];w=F=n[2];v=G=n[3];u=z=n[4];for(x=0;80>x;x+=1)y=J+l[q+b[x]]|0,y=16>x?y+((E^F^G)+c[0]):32>x?y+((E&F|~E&G)+c[1]):48>x?y+(((E|~F)^G)+c[2]):64>x?y+((E&G|F&~G)+c[3]):y+((E^(F|~G))+c[4]),y|=0,y=f(y,h[x]),y=y+z|0,J=z,z=G,G=f(F,10),F=E,E=y,y=A+l[q+d[x]]|0,y=16> +x?y+((C^(w|~v))+e[0]):32>x?y+((C&v|w&~v)+e[1]):48>x?y+(((C|~w)^v)+e[2]):64>x?y+((C&w|~C&v)+e[3]):y+((C^w^v)+e[4]),y|=0,y=f(y,m[x]),y=y+u|0,A=u,u=v,v=f(w,10),w=C,C=y;y=n[1]+F+v|0;n[1]=n[2]+G+u|0;n[2]=n[3]+z+A|0;n[3]=n[4]+J+C|0;n[4]=n[0]+E+w|0;n[0]=y}for(k=0;5>k;k++)p=g[k],g[k]=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360;p=[];for(k=0;k<32*g.length;k+=8)p.push(g[k>>>5]>>>24-k%32&255);return new a(p)}}).call(this,a("buffer").Buffer)},{buffer:49}],148:[function(a,l,g){(function(a){function f(b,d){this._block= +new a(b);this._finalSize=d;this._blockSize=b;this._s=this._len=0}f.prototype.update=function(b,d){"string"===typeof b&&(b=new a(b,d||"utf8"));for(var f=this._len+=b.length,k=this._s||0,c=0,e=this._block;k=8*this._finalSize&&(this._update(this._block),this._block.fill(0));this._block.writeInt32BE(a,this._blockSize-4);a=this._update(this._block)||this._hash();return b?a.toString(b):a};f.prototype._update=function(){throw Error("_update must be implemented by subclass");};l.exports=f}).call(this,a("buffer").Buffer)},{buffer:49}],149:[function(a,l,g){g=l.exports=function(a){a=a.toLowerCase();var f=g[a];if(!f)throw Error(a+" is not supported (we accept pull requests)"); +return new f};g.sha=a("./sha");g.sha1=a("./sha1");g.sha224=a("./sha224");g.sha256=a("./sha256");g.sha384=a("./sha384");g.sha512=a("./sha512")},{"./sha":150,"./sha1":151,"./sha224":152,"./sha256":153,"./sha384":154,"./sha512":155}],150:[function(a,l,g){(function(f){function k(){this.init();this._w=m;d.call(this,64,56)}var b=a("inherits"),d=a("./hash"),h=[1518500249,1859775393,-1894007588,-899497514],m=Array(80);b(k,d);k.prototype.init=function(){this._a=1732584193;this._b=4023233417;this._c=2562383102; +this._d=271733878;this._e=3285377520;return this};k.prototype._update=function(b){for(var a=this._w,c=this._a|0,d=this._b|0,f=this._c|0,k=this._d|0,m=this._e|0,g=0;16>g;++g)a[g]=b.readInt32BE(4*g);for(;80>g;++g)a[g]=a[g-3]^a[g-8]^a[g-14]^a[g-16];for(b=0;80>b;++b){var g=~~(b/20),l=c<<5|c>>>27,u;u=0===g?d&f|~d&k:2===g?d&f|d&k|f&k:d^f^k;g=l+u+m+a[b]+h[g]|0;m=k;k=f;f=d<<30|d>>>2;d=c;c=g}this._a=c+this._a|0;this._b=d+this._b|0;this._c=f+this._c|0;this._d=k+this._d|0;this._e=m+this._e|0};k.prototype._hash= +function(){var b=new f(20);b.writeInt32BE(this._a|0,0);b.writeInt32BE(this._b|0,4);b.writeInt32BE(this._c|0,8);b.writeInt32BE(this._d|0,12);b.writeInt32BE(this._e|0,16);return b};l.exports=k}).call(this,a("buffer").Buffer)},{"./hash":148,buffer:49,inherits:98}],151:[function(a,l,g){(function(f){function k(){this.init();this._w=m;d.call(this,64,56)}var b=a("inherits"),d=a("./hash"),h=[1518500249,1859775393,-1894007588,-899497514],m=Array(80);b(k,d);k.prototype.init=function(){this._a=1732584193;this._b= +4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520;return this};k.prototype._update=function(b){for(var a=this._w,c=this._a|0,d=this._b|0,f=this._c|0,k=this._d|0,m=this._e|0,g=0;16>g;++g)a[g]=b.readInt32BE(4*g);for(;80>g;++g)b=a[g-3]^a[g-8]^a[g-14]^a[g-16],a[g]=b<<1|b>>>31;for(g=0;80>g;++g){b=~~(g/20);var l=c<<5|c>>>27,u;u=0===b?d&f|~d&k:2===b?d&f|d&k|f&k:d^f^k;b=l+u+m+a[g]+h[b]|0;m=k;k=f;f=d<<30|d>>>2;d=c;c=b}this._a=c+this._a|0;this._b=d+this._b|0;this._c=f+this._c|0;this._d=k+this._d| +0;this._e=m+this._e|0};k.prototype._hash=function(){var b=new f(20);b.writeInt32BE(this._a|0,0);b.writeInt32BE(this._b|0,4);b.writeInt32BE(this._c|0,8);b.writeInt32BE(this._d|0,12);b.writeInt32BE(this._e|0,16);return b};l.exports=k}).call(this,a("buffer").Buffer)},{"./hash":148,buffer:49,inherits:98}],152:[function(a,l,g){(function(f){function k(){this.init();this._w=m;h.call(this,64,56)}var b=a("inherits"),d=a("./sha256"),h=a("./hash"),m=Array(64);b(k,d);k.prototype.init=function(){this._a=3238371032; +this._b=914150663;this._c=812702999;this._d=4144912697;this._e=4290775857;this._f=1750603025;this._g=1694076839;this._h=3204075428;return this};k.prototype._hash=function(){var b=new f(28);b.writeInt32BE(this._a,0);b.writeInt32BE(this._b,4);b.writeInt32BE(this._c,8);b.writeInt32BE(this._d,12);b.writeInt32BE(this._e,16);b.writeInt32BE(this._f,20);b.writeInt32BE(this._g,24);return b};l.exports=k}).call(this,a("buffer").Buffer)},{"./hash":148,"./sha256":153,buffer:49,inherits:98}],153:[function(a,l, +g){(function(f){function k(){this.init();this._w=m;d.call(this,64,56)}var b=a("inherits"),d=a("./hash"),h=[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],m=Array(64);b(k,d);k.prototype.init=function(){this._a=1779033703;this._b=3144134277;this._c=1013904242;this._d=2773480762;this._e=1359893119;this._f=2600822924;this._g=528734635;this._h=1541459225;return this}; +k.prototype._update=function(b){for(var a=this._w,c=this._a|0,d=this._b|0,f=this._c|0,k=this._d|0,m=this._e|0,g=this._f|0,l=this._g|0,u=this._h|0,v=0;16>v;++v)a[v]=b.readInt32BE(4*v);for(;64>v;++v){b=a[v-2];var w=a[v-15];a[v]=((b>>>17|b<<15)^(b>>>19|b<<13)^b>>>10)+a[v-7]+((w>>>7|w<<25)^(w>>>18|w<<14)^w>>>3)+a[v-16]|0}for(v=0;64>v;++v)b=u+((m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(l^m&(g^l))+h[v]+a[v]|0,w=((c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10))+(c&d|f&(c|d))|0,u=l,l=g,g=m,m=k+b|0,k=f,f=d, +d=c,c=b+w|0;this._a=c+this._a|0;this._b=d+this._b|0;this._c=f+this._c|0;this._d=k+this._d|0;this._e=m+this._e|0;this._f=g+this._f|0;this._g=l+this._g|0;this._h=u+this._h|0};k.prototype._hash=function(){var b=new f(32);b.writeInt32BE(this._a,0);b.writeInt32BE(this._b,4);b.writeInt32BE(this._c,8);b.writeInt32BE(this._d,12);b.writeInt32BE(this._e,16);b.writeInt32BE(this._f,20);b.writeInt32BE(this._g,24);b.writeInt32BE(this._h,28);return b};l.exports=k}).call(this,a("buffer").Buffer)},{"./hash":148,buffer:49, +inherits:98}],154:[function(a,l,g){(function(f){function k(){this.init();this._w=m;h.call(this,128,112)}var b=a("inherits"),d=a("./sha512"),h=a("./hash"),m=Array(160);b(k,d);k.prototype.init=function(){this._ah=3418070365;this._bh=1654270250;this._ch=2438529370;this._dh=355462360;this._eh=1731405415;this._fh=2394180231;this._gh=3675008525;this._hh=1203062813;this._al=3238371032;this._bl=914150663;this._cl=812702999;this._dl=4144912697;this._el=4290775857;this._fl=1750603025;this._gl=1694076839;this._hl= +3204075428;return this};k.prototype._hash=function(){function b(b,c,d){a.writeInt32BE(b,d);a.writeInt32BE(c,d+4)}var a=new f(48);b(this._ah,this._al,0);b(this._bh,this._bl,8);b(this._ch,this._cl,16);b(this._dh,this._dl,24);b(this._eh,this._el,32);b(this._fh,this._fl,40);return a};l.exports=k}).call(this,a("buffer").Buffer)},{"./hash":148,"./sha512":155,buffer:49,inherits:98}],155:[function(a,l,g){(function(f){function k(){this.init();this._w=c;h.call(this,128,112)}function b(b,a){return b>>>0>> +0?1:0}var d=a("inherits"),h=a("./hash"),m=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122, +1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344, +3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474, +1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],c=Array(160);d(k,h);k.prototype.init=function(){this._ah=1779033703;this._bh=3144134277;this._ch=1013904242;this._dh=2773480762;this._eh=1359893119;this._fh=2600822924;this._gh=528734635;this._hh=1541459225;this._al=4089235720;this._bl=2227873595;this._cl= +4271175723;this._dl=1595750129;this._el=2917565137;this._fl=725511199;this._gl=4215389547;this._hl=327033209;return this};k.prototype._update=function(a){for(var c=this._w,d=this._ah|0,e=this._bh|0,f=this._ch|0,h=this._dh|0,k=this._eh|0,g=this._fh|0,l=this._gh|0,v=this._hh|0,w=this._al|0,C=this._bl|0,A=this._cl|0,z=this._dl|0,G=this._el|0,F=this._fl|0,E=this._gl|0,J=this._hl|0,x=0;32>x;x+=2)c[x]=a.readInt32BE(4*x),c[x+1]=a.readInt32BE(4*x+4);for(;160>x;x+=2){a=c[x-30];var H=c[x-30+1],K=(a>>>1|H<< +31)^(a>>>8|H<<24)^a>>>7,D=(H>>>1|a<<31)^(H>>>8|a<<24)^(H>>>7|a<<25);a=c[x-4];var H=c[x-4+1],I=(a>>>19|H<<13)^(H>>>29|a<<3)^a>>>6,H=(H>>>19|a<<13)^(a>>>29|H<<3)^(H>>>6|a<<26),N=c[x-32],L=c[x-32+1];a=D+c[x-14+1]|0;K=K+c[x-14]+b(a,D)|0;a=a+H|0;K=K+I+b(a,H)|0;a=a+L|0;K=K+N+b(a,L)|0;c[x]=K;c[x+1]=a}for(x=0;160>x;x+=2){K=c[x];a=c[x+1];var H=d&e|f&(d|e),M=w&C|A&(w|C),N=(d>>>28|w<<4)^(w>>>2|d<<30)^(w>>>7|d<<25),L=(w>>>28|d<<4)^(d>>>2|w<<30)^(d>>>7|w<<25),Z=m[x],S=m[x+1],T=l^k&(g^l),ja=E^G&(F^E),I=J+((G>>> +14|k<<18)^(G>>>18|k<<14)^(k>>>9|G<<23))|0,D=v+((k>>>14|G<<18)^(k>>>18|G<<14)^(G>>>9|k<<23))+b(I,J)|0,I=I+ja|0,D=D+T+b(I,ja)|0,I=I+S|0,D=D+Z+b(I,S)|0,I=I+a|0,D=D+K+b(I,a)|0;a=L+M|0;K=N+H+b(a,L)|0;v=l;J=E;l=g;E=F;g=k;F=G;G=z+I|0;k=h+D+b(G,z)|0;h=f;z=A;f=e;A=C;e=d;C=w;w=I+a|0;d=D+K+b(w,I)|0}this._al=this._al+w|0;this._bl=this._bl+C|0;this._cl=this._cl+A|0;this._dl=this._dl+z|0;this._el=this._el+G|0;this._fl=this._fl+F|0;this._gl=this._gl+E|0;this._hl=this._hl+J|0;this._ah=this._ah+d+b(this._al,w)|0; +this._bh=this._bh+e+b(this._bl,C)|0;this._ch=this._ch+f+b(this._cl,A)|0;this._dh=this._dh+h+b(this._dl,z)|0;this._eh=this._eh+k+b(this._el,G)|0;this._fh=this._fh+g+b(this._fl,F)|0;this._gh=this._gh+l+b(this._gl,E)|0;this._hh=this._hh+v+b(this._hl,J)|0};k.prototype._hash=function(){function b(b,c,d){a.writeInt32BE(b,d);a.writeInt32BE(c,d+4)}var a=new f(64);b(this._ah,this._al,0);b(this._bh,this._bl,8);b(this._ch,this._cl,16);b(this._dh,this._dl,24);b(this._eh,this._el,32);b(this._fh,this._fl,40);b(this._gh, +this._gl,48);b(this._hh,this._hl,56);return a};l.exports=k}).call(this,a("buffer").Buffer)},{"./hash":148,buffer:49,inherits:98}],156:[function(a,l,g){function f(){k.call(this)}l.exports=f;var k=a("events").EventEmitter;a("inherits")(f,k);f.Readable=a("readable-stream/readable.js");f.Writable=a("readable-stream/writable.js");f.Duplex=a("readable-stream/duplex.js");f.Transform=a("readable-stream/transform.js");f.PassThrough=a("readable-stream/passthrough.js");f.Stream=f;f.prototype.pipe=function(b, +a){function d(a){b.writable&&!1===b.write(a)&&r.pause&&r.pause()}function f(){r.readable&&r.resume&&r.resume()}function c(){p||(p=!0,b.end())}function e(){p||(p=!0,"function"===typeof b.destroy&&b.destroy())}function g(b){l();if(0===k.listenerCount(this,"error"))throw b;}function l(){r.removeListener("data",d);b.removeListener("drain",f);r.removeListener("end",c);r.removeListener("close",e);r.removeListener("error",g);b.removeListener("error",g);r.removeListener("end",l);r.removeListener("close", +l);b.removeListener("close",l)}var r=this;r.on("data",d);b.on("drain",f);b._isStdio||a&&!1===a.end||(r.on("end",c),r.on("close",e));var p=!1;r.on("error",g);b.on("error",g);r.on("end",l);r.on("close",l);b.on("close",l);b.emit("pipe",r);return b}},{events:86,inherits:98,"readable-stream/duplex.js":136,"readable-stream/passthrough.js":143,"readable-stream/readable.js":144,"readable-stream/transform.js":145,"readable-stream/writable.js":146}],157:[function(a,l,g){(function(f){var k=a("./lib/request"), +b=a("xtend"),d=a("builtin-status-codes"),h=a("url");g.request=function(a,c){a="string"===typeof a?h.parse(a):b(a);var d=-1===f.location.protocol.search(/^https?:$/)?"http:":"",d=a.protocol||d,m=a.hostname||a.host,g=a.port,l=a.path||"/";m&&-1!==m.indexOf(":")&&(m="["+m+"]");a.url=(m?d+"//"+m:"")+(g?":"+g:"")+l;a.method=(a.method||"GET").toUpperCase();a.headers=a.headers||{};d=new k(a);if(c)d.on("response",c);return d};g.get=function(b,a){var c=g.request(b,a);c.end();return c};g.Agent=function(){}; +g.Agent.defaultMaxSockets=4;g.STATUS_CODES=d;g.METHODS="CHECKOUT CONNECT COPY DELETE GET HEAD LOCK M-SEARCH MERGE MKACTIVITY MKCOL MOVE NOTIFY OPTIONS PATCH POST PROPFIND PROPPATCH PURGE PUT REPORT SEARCH SUBSCRIBE TRACE UNLOCK UNSUBSCRIBE".split(" ")}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"./lib/request":159,"builtin-status-codes":50,url:163,xtend:170}],158:[function(a,l,g){(function(a){function f(){if(void 0!==h)return h; +if(a.XMLHttpRequest){h=new a.XMLHttpRequest;try{h.open("GET",a.XDomainRequest?"/":"https://example.com")}catch(e){h=null}}else h=null;return h}function b(b){var a=f();if(!a)return!1;try{return a.responseType=b,a.responseType===b}catch(t){}return!1}function d(b){return"function"===typeof b}g.fetch=d(a.fetch)&&d(a.ReadableStream);g.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),g.blobConstructor=!0}catch(e){}var h,m="undefined"!==typeof a.ArrayBuffer,c=m&&d(a.ArrayBuffer.prototype.slice);g.arraybuffer= +g.fetch||m&&b("arraybuffer");g.msstream=!g.fetch&&c&&b("ms-stream");g.mozchunkedarraybuffer=!g.fetch&&m&&b("moz-chunked-arraybuffer");g.overrideMimeType=g.fetch||(f()?d(f().overrideMimeType):!1);g.vbArray=d(a.VBArray);h=null}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],159:[function(a,l,g){(function(f,k,b){var d=a("./capability"),h=a("inherits"),m=a("./response"),c=a("readable-stream"),e=a("to-arraybuffer"),g=m.IncomingMessage, +t=m.readyStates,m=l.exports=function(a){var e=this;c.Writable.call(e);e._opts=a;e._body=[];e._headers={};a.auth&&e.setHeader("Authorization","Basic "+(new b(a.auth)).toString("base64"));Object.keys(a.headers).forEach(function(b){e.setHeader(b,a.headers[b])});var f,h=!0;if("disable-fetch"===a.mode||"timeout"in a)h=!1,f=!0;else if("prefer-streaming"===a.mode)f=!1;else if("allow-wrong-content-type"===a.mode)f=!d.overrideMimeType;else{if(a.mode&&"default"!==a.mode&&"prefer-fast"!==a.mode)throw Error("Invalid value for opts.mode"); +f=!0}e._mode=d.fetch&&h?"fetch":d.mozchunkedarraybuffer?"moz-chunked-arraybuffer":d.msstream?"ms-stream":d.arraybuffer&&f?"arraybuffer":d.vbArray&&f?"text:vbarray":"text";e.on("finish",function(){e._onFinish()})};h(m,c.Writable);m.prototype.setHeader=function(b,a){var c=b.toLowerCase();-1===r.indexOf(c)&&(this._headers[c]={name:b,value:a})};m.prototype.getHeader=function(b){return this._headers[b.toLowerCase()].value};m.prototype.removeHeader=function(b){delete this._headers[b.toLowerCase()]};m.prototype._onFinish= +function(){var a=this;if(!a._destroyed){var c=a._opts,h=a._headers,m=null;if("POST"===c.method||"PUT"===c.method||"PATCH"===c.method||"MERGE"===c.method)m=d.blobConstructor?new k.Blob(a._body.map(function(b){return e(b)}),{type:(h["content-type"]||{}).value||""}):b.concat(a._body).toString();if("fetch"===a._mode){var g=Object.keys(h).map(function(b){return[h[b].name,h[b].value]});k.fetch(a._opts.url,{method:a._opts.method,headers:g,body:m||void 0,mode:"cors",credentials:c.withCredentials?"include": +"same-origin"}).then(function(b){a._fetchResponse=b;a._connect()},function(b){a.emit("error",b)})}else{var l=a._xhr=new k.XMLHttpRequest;try{l.open(a._opts.method,a._opts.url,!0)}catch(w){f.nextTick(function(){a.emit("error",w)});return}"responseType"in l&&(l.responseType=a._mode.split(":")[0]);"withCredentials"in l&&(l.withCredentials=!!c.withCredentials);"text"===a._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined");"timeout"in c&&(l.timeout=c.timeout,l.ontimeout= +function(){a.emit("timeout")});Object.keys(h).forEach(function(b){l.setRequestHeader(h[b].name,h[b].value)});a._response=null;l.onreadystatechange=function(){switch(l.readyState){case t.LOADING:case t.DONE:a._onXHRProgress()}};"moz-chunked-arraybuffer"===a._mode&&(l.onprogress=function(){a._onXHRProgress()});l.onerror=function(){a._destroyed||a.emit("error",Error("XHR error"))};try{l.send(m)}catch(w){f.nextTick(function(){a.emit("error",w)})}}}};m.prototype._onXHRProgress=function(){var b;try{var a= +this._xhr.status;b=null!==a&&0!==a}catch(q){b=!1}b&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())};m.prototype._connect=function(){var b=this;b._destroyed||(b._response=new g(b._xhr,b._fetchResponse,b._mode),b._response.on("error",function(a){b.emit("error",a)}),b.emit("response",b._response))};m.prototype._write=function(b,a,c){this._body.push(b);c()};m.prototype.abort=m.prototype.destroy=function(){this._destroyed=!0;this._response&&(this._response._destroyed= +!0);this._xhr&&this._xhr.abort()};m.prototype.end=function(b,a,d){"function"===typeof b&&(d=b,b=void 0);c.Writable.prototype.end.call(this,b,a,d)};m.prototype.flushHeaders=function(){};m.prototype.setTimeout=function(){};m.prototype.setNoDelay=function(){};m.prototype.setSocketKeepAlive=function(){};var r="accept-charset accept-encoding access-control-request-headers access-control-request-method connection content-length cookie cookie2 date dnt expect host keep-alive origin referer te trailer transfer-encoding upgrade user-agent via".split(" ")}).call(this, +a("_process"),"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},a("buffer").Buffer)},{"./capability":158,"./response":160,_process:124,buffer:49,inherits:98,"readable-stream":144,"to-arraybuffer":162}],160:[function(a,l,g){(function(f,k,b){var d=a("./capability"),h=a("inherits"),m=a("readable-stream"),c=g.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},e=g.IncomingMessage=function(a,c,e){var h=this;m.Readable.call(h);h._mode= +e;h.headers={};h.rawHeaders=[];h.trailers={};h.rawTrailers=[];h.on("end",function(){f.nextTick(function(){h.emit("close")})});if("fetch"===e){var k=function(){g.read().then(function(a){h._destroyed||(a.done?h.push(null):(h.push(new b(a.value)),k()))})["catch"](function(b){h.emit("error",b)})};h._fetchResponse=c;h.url=c.url;h.statusCode=c.status;h.statusMessage=c.statusText;c.headers.forEach(function(b,a){h.headers[a.toLowerCase()]=b;h.rawHeaders.push(a,b)});var g=c.body.getReader();k()}else if(h._xhr= +a,h._pos=0,h.url=a.responseURL,h.statusCode=a.status,h.statusMessage=a.statusText,a.getAllResponseHeaders().split(/\r?\n/).forEach(function(b){if(b=b.match(/^([^:]+):\s*(.*)/)){var a=b[1].toLowerCase();"set-cookie"===a?(void 0===h.headers[a]&&(h.headers[a]=[]),h.headers[a].push(b[2])):h.headers[a]=void 0!==h.headers[a]?h.headers[a]+(", "+b[2]):b[2];h.rawHeaders.push(b[1],b[2])}}),h._charset="x-user-defined",!d.overrideMimeType){if(a=h.rawHeaders["mime-type"])if(a=a.match(/;\s*charset=([^;])(;|$)/))h._charset= +a[1].toLowerCase();h._charset||(h._charset="utf-8")}};h(e,m.Readable);e.prototype._read=function(){};e.prototype._onXHRProgress=function(){var a=this,d=a._xhr,e=null;switch(a._mode){case "text:vbarray":if(d.readyState!==c.DONE)break;try{e=(new k.VBArray(d.responseBody)).toArray()}catch(y){}if(null!==e){a.push(new b(e));break}case "text":try{e=d.responseText}catch(y){a._mode="text:vbarray";break}if(e.length>a._pos){d=e.substr(a._pos);if("x-user-defined"===a._charset){for(var f=new b(d.length),h=0;h< +d.length;h++)f[h]=d.charCodeAt(h)&255;a.push(f)}else a.push(d,a._charset);a._pos=e.length}break;case "arraybuffer":if(d.readyState!==c.DONE||!d.response)break;e=d.response;a.push(new b(new Uint8Array(e)));break;case "moz-chunked-arraybuffer":e=d.response;if(d.readyState!==c.LOADING||!e)break;a.push(new b(new Uint8Array(e)));break;case "ms-stream":if(e=d.response,d.readyState===c.LOADING){var m=new k.MSStreamReader;m.onprogress=function(){m.result.byteLength>a._pos&&(a.push(new b(new Uint8Array(m.result.slice(a._pos)))), +a._pos=m.result.byteLength)};m.onload=function(){a.push(null)};m.readAsArrayBuffer(e)}}a._xhr.readyState===c.DONE&&"ms-stream"!==a._mode&&a.push(null)}}).call(this,a("_process"),"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},a("buffer").Buffer)},{"./capability":158,_process:124,buffer:49,inherits:98,"readable-stream":144}],161:[function(a,l,g){function f(b){return b.toString(this.encoding)}function k(b){this.charLength=(this.charReceived=b.length% +2)?2:0}function b(b){this.charLength=(this.charReceived=b.length%3)?3:0}var d=a("buffer").Buffer,h=d.isEncoding||function(b){switch(b&&b.toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":case "raw":return!0;default:return!1}};a=g.StringDecoder=function(a){this.encoding=(a||"utf8").toLowerCase().replace(/[-_]/,"");if(a&&!h(a))throw Error("Unknown encoding: "+a);switch(this.encoding){case "utf8":this.surrogateSize= +3;break;case "ucs2":case "utf16le":this.surrogateSize=2;this.detectIncompleteChar=k;break;case "base64":this.surrogateSize=3;this.detectIncompleteChar=b;break;default:this.write=f;return}this.charBuffer=new d(6);this.charLength=this.charReceived=0};a.prototype.write=function(b){for(var a="";this.charLength;){a=b.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:b.length;b.copy(this.charBuffer,this.charReceived,0,a);this.charReceived+=a;if(this.charReceived=d)this.charLength+=this.surrogateSize,a="";else{this.charReceived=this.charLength=0;if(0===b.length)return a;break}}this.detectIncompleteChar(b);var f=b.length;this.charLength&&(b.copy(this.charBuffer,0,b.length-this.charReceived,f),f-=this.charReceived);a+=b.toString(this.encoding,0,f);f=a.length-1;d=a.charCodeAt(f);return 55296<=d&&56319>=d?(d=this.surrogateSize, +this.charLength+=d,this.charReceived+=d,this.charBuffer.copy(this.charBuffer,d,0,d),b.copy(this.charBuffer,0,0,d),a.substring(0,f)):a};a.prototype.detectIncompleteChar=function(b){for(var a=3<=b.length?3:b.length;0>5){this.charLength=2;break}if(2>=a&&14==d>>4){this.charLength=3;break}if(3>=a&&30==d>>3){this.charLength=4;break}}this.charReceived=a};a.prototype.end=function(b){var a="";b&&b.length&&(a=this.write(b));this.charReceived&&(b=this.encoding,a+=this.charBuffer.slice(0, +this.charReceived).toString(b));return a}},{buffer:49}],162:[function(a,l,g){var f=a("buffer").Buffer;l.exports=function(a){if(a instanceof Uint8Array){if(0===a.byteOffset&&a.byteLength===a.buffer.byteLength)return a.buffer;if("function"===typeof a.buffer.slice)return a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)}if(f.isBuffer(a)){for(var b=new Uint8Array(a.length),d=a.length,h=0;h"` \r\n\t'.split(""));var e=["'"].concat(l),n=["%","/","?",";","#"].concat(e),t=["/","?","#"],r=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,B={javascript:!0,"javascript:":!0},q={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},u=a("querystring");f.prototype.parse= +function(a,f,k){if(!d.isString(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var m=a.indexOf("?"),m=-1!==m&&mk.length&&k.unshift("");a.pathname=k.join("/")}a.search=b.search;a.query=b.query;a.host=b.host||"";a.auth=b.auth;a.hostname=b.hostname||b.host;a.port=b.port;if(a.pathname|| +a.search)a.path=(a.pathname||"")+(a.search||"");a.slashes=a.slashes||b.slashes;a.href=a.format();return a}var c=a.pathname&&"/"===a.pathname.charAt(0),m=b.host||b.pathname&&"/"===b.pathname.charAt(0),g=c=m||c||a.host&&b.pathname,e=a.pathname&&a.pathname.split("/")||[],k=b.pathname&&b.pathname.split("/")||[];if(h=a.protocol&&!y[a.protocol])a.hostname="",a.port=null,a.host&&(""===e[0]?e[0]=a.host:e.unshift(a.host)),a.host="",b.protocol&&(b.hostname=null,b.port=null,b.host&&(""===k[0]?k[0]=b.host:k.unshift(b.host)), +b.host=null),c=c&&(""===k[0]||""===e[0]);if(m)a.host=b.host||""===b.host?b.host:a.host,a.hostname=b.hostname||""===b.hostname?b.hostname:a.hostname,a.search=b.search,a.query=b.query,e=k;else if(k.length)e||(e=[]),e.pop(),e=e.concat(k),a.search=b.search,a.query=b.query;else if(!d.isNullOrUndefined(b.search))return h&&(a.hostname=a.host=e.shift(),h=a.host&&0d)return w(a)?b.stylize(RegExp.prototype.toString.call(a),"regexp"):b.stylize("[Object]","special");b.seen.push(a);h=n?t(b,a,d,k,h):h.map(function(c){return r(b,a,d,k,c,n)});b.seen.pop();return p(h,f,q)}function e(b,a){if(v(a))return b.stylize("undefined","undefined");if(u(a)){var c="'"+JSON.stringify(a).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return b.stylize(c,"string")}if(y(a))return b.stylize(""+ +a,"number");if(q(a))return b.stylize(""+a,"boolean");if(null===a)return b.stylize("null","null")}function l(b){return"["+Error.prototype.toString.call(b)+"]"}function t(b,a,c,d,e){for(var f=[],h=0,k=a.length;hb.seen.indexOf(a.value)?(m=null===d?c(b,a.value,null):c(b,a.value,d-1),-1b?"0"+b.toString(10):b.toString(10)}function E(){var b= +new Date,a=[F(b.getHours()),F(b.getMinutes()),F(b.getSeconds())].join(":");return[b.getDate(),K[b.getMonth()],a].join(" ")}var J=/%[sdj%]/g;g.format=function(a){if(!u(a)){for(var c=[],d=0;d=f)return b;switch(b){case "%s":return String(e[d++]);case "%d":return Number(e[d++]);case "%j":try{return JSON.stringify(e[d++])}catch(T){return"[Circular]"}default:return b}}), +h=e[d];d=this._chunkSize){if(this._paused)return this._needDrain= +!0,!1;this._emitChunk()}return!0};b.prototype.pause=function(){this._paused=!0};b.prototype.resume=function(){this._paused=!1;return this._emitChunk()};b.prototype.end=function(b){"function"===typeof b&&(cb=b,b=null);b&&this.write(b);this._ended=!0;this.flush()};b.prototype.flush=function(){this._emitChunk(!0)};b.prototype._emitChunk=function(b){if(b&&this._zeroes){var a=this._bufferLength%this._chunkSize;0!==a&&(a=this._chunkSize-a);0=this._chunkSize&&(b||!this._paused);){for(var d,a=0,f=this._chunkSize;0f?(this._offset+=f,f=0):(f-=g,a+=g,c++,this._offset=0)}this._bufferLength-=this._chunkSize;m(d.length===this._chunkSize); +this.emit("data",d);d=null}this._buffer=this._buffer.slice(c);if(this._paused)this._needsDrain=!0;else{c=this._buffer.length;if(b&&!this._zeroes&&c){if(1===c)this._offset?this.emit("data",this._buffer[0].slice(this._offset)):this.emit("data",this._buffer[0]);else{f=this._bufferLength;d=new k(f);for(b=a=0;bc&&(c=Math.max(0,c+a.length));return a[c]}var h=a("./util"),k=h.canEvaluate;c.prototype.call=function(a){var c=[].slice.call(arguments,1);c.push(a);return this._then(d,void 0,void 0,c,void 0)};c.prototype.get=function(a){var c;"number"!==typeof a?k?(c=(void 0)(a),c=null!==c?c:e):c=e:c=f;return this._then(c,void 0,void 0,a,void 0)}}},{"./util":36}],6:[function(a,f,k){f.exports=function(c,d,f,h){var e=a("./util"),k=e.tryCatch,m=e.errorObj,g=c._async;c.prototype["break"]= +c.prototype.cancel=function(){if(!h.cancellation())return this._warn("cancellation is disabled");for(var a=this,c=a;a._isCancellable();){if(!a._cancelBy(c)){c._isFollowing()?c._followee().cancel():c._cancelBranched();break}var d=a._cancellationParent;if(null!=d&&d._isCancellable())a._isFollowing()&&a._followee().cancel(),a._setWillBeCancelled(),c=a,a=d;else{a._isFollowing()?a._followee().cancel():a._cancelBranched();break}}};c.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--}; +c.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||0>=this._branchesRemainingToCancel};c.prototype._cancelBy=function(a){if(a===this)return this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0;this._branchHasCancelled();return this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1};c.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()};c.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(), +g.invoke(this._cancelPromises,this,void 0))};c.prototype._cancelPromises=function(){0 +c.length?c:c.substr(0,38)+"...";return"(<"+a+">, no stack trace)"}function H(){return"function"===typeof R}function K(a){if(a=a.match(W))return{fileName:a[1],line:parseInt(a[2],10)}}function D(a){this._parent=a;this._promisesCreated=0;a=this._length=1+(void 0===a?0:a._length);R(this,D);32a)){for(var c=[],d={},e=0,a=this;void 0!==a;++e)c.push(a),a=a._parent;a=this._length=e;for(e=a-1;0<=e;--e){var f=c[e].stack; +void 0===d[f]&&(d[f]=e)}for(e=0;ef||0>h||!k||!m||k!==m||f>=h||(Q=function(a){return ja.test(a)?!0:(a=K(a))&&a.fileName===k&&f<=a.line&&a.line<=h?!0:!1})}},warn:A,deprecated:function(a,c){var d=a+" is deprecated and will be removed in a future version.";c&&(d+=" Use "+c+" instead.");return A(d)},CapturedTrace:D,fireDomEvent:Ca, +fireGlobalEvent:Da}}},{"./errors":12,"./util":36}],10:[function(a,f,k){f.exports=function(a){function c(){return this.value}function d(){throw this.reason;}a.prototype["return"]=a.prototype.thenReturn=function(d){d instanceof a&&d.suppressUnhandledRejections();return this._then(c,void 0,void 0,{value:d},void 0)};a.prototype["throw"]=a.prototype.thenThrow=function(a){return this._then(d,void 0,void 0,{reason:a},void 0)};a.prototype.catchThrow=function(a){if(1>=arguments.length)return this._then(void 0, +d,void 0,{reason:a},void 0);var c=arguments[1];return this.caught(a,function(){throw c;})};a.prototype.catchReturn=function(d){if(1>=arguments.length)return d instanceof a&&d.suppressUnhandledRejections(),this._then(void 0,c,void 0,{value:d},void 0);var e=arguments[1];e instanceof a&&e.suppressUnhandledRejections();return this.caught(d,function(){return e})}}},{}],11:[function(a,f,k){f.exports=function(a,d){function c(){return f(this)}var e=a.reduce,f=a.all;a.prototype.each=function(a){return e(this, +a,d,0)._then(c,void 0,void 0,this,void 0)};a.prototype.mapSeries=function(a){return e(this,a,d,d)};a.each=function(a,f){return e(a,f,d,0)._then(c,void 0,void 0,a,void 0)};a.mapSeries=function(a,c){return e(a,c,d,d)}}},{}],12:[function(a,f,k){function c(a,c){function d(e){if(!(this instanceof d))return new d(e);g(this,"message","string"===typeof e?e:c);g(this,"name",a);Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}m(d,Error);return d}function d(a){if(!(this instanceof +d))return new d(a);g(this,"name","OperationalError");g(this,"message",a);this.cause=a;this.isOperational=!0;a instanceof Error?(g(this,"message",a.message),g(this,"stack",a.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}k=a("./es5");var h=k.freeze;a=a("./util");var m=a.inherits,g=a.notEnumerableProp,l,B;a=c("Warning","warning");var q=c("CancellationError","cancellation error"),y=c("TimeoutError","timeout error"),u=c("AggregateError","aggregate error");try{l=TypeError, +B=RangeError}catch(A){l=c("TypeError","type error"),B=c("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),w=0;wd){if(e[-1*d-1]=a,1<=g&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(1<=g&&this._inFlight>=g)return e[d]=a,this._queue.push(d),!1;null!==k&&(k[d]=a);var l=this._promise,n=this._callback,q=l._boundValue();l._pushContext();n=p(n).call(q,a,d,f);q=l._popContext();m.checkForgottenReturns(n, +q,null!==k?"Promise.filter":"Promise.map",l);if(n===r)return this._reject(n.e),!0;l=h(n,this._promise);if(l instanceof c){l=l._target();n=l._bitField;if(0===(n&50397184))return 1<=g&&this._inFlight++,e[d]=l,l._proxy(this,-1*(d+1)),!1;if(0!==(n&33554432))n=l._value();else return 0!==(n&16777216)?this._reject(l._reason()):this._cancel(),!0}e[d]=n}return++this._totalResolved>=f?(null!==k?this._filter(e,k):this._resolve(e),!0):!1};e.prototype._drainQueue=function(){for(var a=this._queue,c=this._limit, +d=this._values;0>>16)){if(a=== +this)return a=g(),this._attachExtraTrace(a),this._reject(a);this._setFulfilled();this._rejectionHandler0=a;0<(c&65535)&&(0!==(c&134217728)?this._settlePromises():A.settlePromises(this))}};e.prototype._reject=function(a){var c=this._bitField;if(!((c&117506048)>>>16)){this._setRejected();this._fulfillmentHandler0=a;if(this._isFinal())return A.fatalError(a,u.isNode);0<(c&65535)?A.settlePromises(this):this._ensurePossibleRejectionHandled()}};e.prototype._fulfillPromises=function(a,c){for(var d=1;d=this._length?(this._resolve(this._values),!0):!1};m.prototype._promiseCancelled=function(){this._cancel();return!0};m.prototype._promiseRejected=function(a){this._totalResolved++;this._reject(a);return!0};m.prototype._resultCancelled=function(){if(!this._isResolved()){var a=this._values;this._cancel(); +if(a instanceof c)a.cancel();else for(var d=0;d=this._length){var d;if(this._isMap){d=this._values;for(var e=new n,f=d.length/2|0,h=0;h>1};c.prototype.props=function(){return k(this)};c.props=function(a){return k(a)}}}, +{"./es5":13,"./util":36}],26:[function(a,f,k){function c(a){this._capacity=a;this._front=this._length=0}c.prototype._willBeOverCapacity=function(a){return this._capacity=this._length?(this._resolve(this._values),!0):!1};e.prototype._promiseFulfilled=function(a,c){var d=new h;d._bitField=33554432;d._settledValueField=a;return this._promiseResolved(c,d)};e.prototype._promiseRejected=function(a,c){var d=new h;d._bitField= +16777216;d._settledValueField=a;return this._promiseResolved(c,d)};c.settle=function(a){f.deprecated(".settle()",".reflect()");return(new e(a)).promise()};c.prototype.settle=function(){return c.settle(this)}}},{"./util":36}],31:[function(a,f,k){f.exports=function(c,d,f){function e(a){this.constructor$(a);this._howMany=0;this._initialized=this._unwrap=!1}function h(a,c){if((c|0)!==c||0>c)return f("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var d=new e(a),h=d.promise();d.setHowMany(c); +d.init();return h}var k=a("./util"),m=a("./errors").RangeError,g=a("./errors").AggregateError,l=k.isArray,n={};k.inherits(e,d);e.prototype._init=function(){if(this._initialized)if(0===this._howMany)this._resolve([]);else{this._init$(void 0,-5);var a=l(this._values);!this._isResolved()&&a&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}};e.prototype.init=function(){this._initialized=!0;this._init()};e.prototype.setUnwrap=function(){this._unwrap=!0};e.prototype.howMany= +function(){return this._howMany};e.prototype.setHowMany=function(a){this._howMany=a};e.prototype._promiseFulfilled=function(a){this._addFulfilled(a);return this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1};e.prototype._promiseRejected=function(a){this._addRejected(a);return this._checkOutcome()};e.prototype._promiseCancelled=function(){if(this._values instanceof c||null==this._values)return this._cancel(); +this._addRejected(n);return this._checkOutcome()};e.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var a=new g,c=this.length();c=g)return l._fulfill();var k;k=a[m++];var n=f(k);n!==k&&"function"===typeof k._isDisposable&&"function"===typeof k._getDisposer&&k._isDisposable()&&n._setDisposable(k._getDisposer());k=n;if(k instanceof c&&k._isDisposable()){try{k= +f(k._getDisposer().tryDispose(d),a.promise)}catch(M){return e(M)}if(k instanceof c)return k._then(h,e,null,null,null)}h()}var m=0,g=a.length,l=new c(k);h();return l}function l(a,c,d){this._data=a;this._promise=c;this._context=d}function n(a,c,d){this.constructor$(a,c,d)}function p(a){return l.isDisposer(a)?(this.resources[this.index]._setDisposable(a),a.promise()):a}function r(a){this.length=a;this.promise=null;this[a-1]=null}var t=a("./util"),A=a("./errors").TypeError,z=a("./util").inherits,G=t.errorObj, +F=t.tryCatch,E={};l.prototype.data=function(){return this._data};l.prototype.promise=function(){return this._promise};l.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():E};l.prototype.tryDispose=function(a){var c=this.resource(),d=this._context;void 0!==d&&d._pushContext();a=c!==E?this.doDispose(c,a):null;void 0!==d&&d._popContext();this._promise._unsetDisposable();this._data=null;return a};l.isDisposer=function(a){return null!=a&&"function"===typeof a.resource&& +"function"===typeof a.tryDispose};z(n,l);n.prototype.doDispose=function(a,c){return this.data().call(a,a,c)};r.prototype._resultCancelled=function(){for(var a=this.length,d=0;da)return d("you must pass at least 2 arguments to Promise.using");var e=arguments[a-1];if("function"!==typeof e)return d("expecting a function but got "+t.classString(e));var h,k=!0;2===a&&Array.isArray(arguments[0])?(h=arguments[0], +a=h.length,k=!1):(h=arguments,a--);for(var n=new r(a),q=0;q=a}function e(a,k){var g=[], +l=t("{","}",a);if(!l||/\$$/.test(l.pre))return[a];var p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),q=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),p=p||q,r=/^(.*,)+(.+)?$/.test(l.body);if(!p&&!r)return l.post.match(/,.*\}/)?(a=l.pre+"{"+l.body+B+l.post,e(a)):[a];var v;if(p)v=l.body.split(/\.\./);else if(v=b(l.body),1===v.length&&(v=e(v[0],!1).map(d),1===v.length))return r=l.post.length?e(l.post,!1):[""],r.map(function(b){return l.pre+v[0]+b});var u=l.pre,r=l.post.length?e(l.post,!1):[""], +y;if(p){var x=f(v[0]),H=f(v[1]),K=Math.max(v[0].length,v[1].length),D=3==v.length?Math.abs(f(v[2])):1,I=m;Hx?"-"+M+L.slice(1):M+L)}y.push(L)}}else y=n(v,function(b){return e(b,!1)});for(q=0;q:"|?*]/;l.exports={getRootPath:f,invalidWin32Path:function(a){var d=f(a);a=a.replace(d,"");return b.test(a)}}},{path:120}],206:[function(a,l,g){function f(b,a,d,m){function g(){n(c.dirname(a),function(b){if(b)return m(b);l()})}function l(){p?h.rename(b,a,function(c){if(!c)return m();if("ENOTEMPTY"===c.code||"EEXIST"===c.code)e(a,function(c){if(c)return m(c);d.overwrite=!1;f(b,a,d,m)});else if("EPERM"===c.code)setTimeout(function(){e(a,function(c){if(c)return m(c); +d.overwrite=!1;f(b,a,d,m)})},200);else{if("EXDEV"!==c.code)return m(c);k(b,a,p,m)}}):h.link(b,a,function(c){c?"EXDEV"===c.code||"EISDIR"===c.code||"EPERM"===c.code?k(b,a,p,m):m(c):h.unlink(b,m)})}"function"===typeof d&&(m=d,d={});var p=d.overwrite||d.clobber||!1;("mkdirp"in d?d.mkdirp:1)?g():l()}function k(a,c,e,f){h.stat(a,function(h,k){h?f(h):k.isDirectory()?d(a,c,e,f):b(a,c,e,f)})}function b(b,a,c,e){function f(){h.unlink(b,e)}var k=c?"w":"wx",m=h.createReadStream(b),g=h.createWriteStream(a,{flags:k}); +m.on("error",function(k){m.destroy();g.destroy();g.removeListener("close",f);h.unlink(a,function(){"EISDIR"===k.code||"EPERM"===k.code?d(b,a,c,e):e(k)})});g.on("error",function(b){m.destroy();g.destroy();g.removeListener("close",f);e(b)});g.once("close",f);m.pipe(g)}function d(b,a,c,d){function f(){m(b,a,h,function(a){if(a)return d(a);e(b,d)})}var h={overwrite:!1};c?e(a,function(b){if(b)return d(b);f()}):f()}var h=a("graceful-fs"),m=a("../copy/ncp"),c=a("path"),e=a("../remove").remove,n=a("../mkdirs").mkdirs; +l.exports={move:f}},{"../copy/ncp":189,"../mkdirs":202,"../remove":208,"graceful-fs":238,path:120}],207:[function(a,l,g){var f=a("path"),k=a("graceful-fs"),b=a("../mkdirs");l.exports={outputFile:function(a,h,m,c){"function"===typeof m&&(c=m,m="utf8");var d=f.dirname(a);k.exists(d,function(e){if(e)return k.writeFile(a,h,m,c);b.mkdirs(d,function(b){if(b)return c(b);k.writeFile(a,h,m,c)})})},outputFileSync:function(a,h,m){var c=f.dirname(a);if(k.existsSync(c))return k.writeFileSync.apply(k,arguments); +b.mkdirsSync(c);k.writeFileSync.apply(k,arguments)}}},{"../mkdirs":202,"graceful-fs":238,path:120}],208:[function(a,l,g){var f=a("./rimraf");l.exports={remove:function(a,b){var d={disableGlob:!0};return b?f(a,d,b):f(a,d,function(){})},removeSync:function(a){return f.sync(a,{disableGlob:!0})}}},{"./rimraf":209}],209:[function(a,l,g){(function(f){function k(b){"unlink chmod stat lstat rmdir readdir".split(" ").forEach(function(a){b[a]=b[a]||q[a];a+="Sync";b[a]=b[a]||q[a]});b.maxBusyTries=b.maxBusyTries|| +3}function b(b,a,c){"function"===typeof a&&(c=a,a={});p(b,"rimraf: missing path");p.equal(typeof b,"string","rimraf: path should be a string");p.equal(typeof c,"function","rimraf: callback function required");p(a,"rimraf: invalid options argument provided");p.equal(typeof a,"object","rimraf: options should be object");k(a);var e=0;d(b,a,function z(f){if(f){if(y&&("EBUSY"===f.code||"ENOTEMPTY"===f.code||"EPERM"===f.code)&&e=a.length)return m&&(m[u]=a),g(null,a);c.lastIndex=C;var d=c.exec(a);G=A;A+=d[0];z=G+d[1];C=c.lastIndex;if(t[z]||m&&m[z]===z)return f.nextTick(n);if(m&&Object.prototype.hasOwnProperty.call(m,z))a=b.resolve(m[z],a.slice(C)),l();else return h.lstat(z,q)}function q(b,a){if(b)return g(b);if(!a.isSymbolicLink())return t[z]=!0,m&&(m[z]=z),f.nextTick(n); +if(!d){var c=a.dev.toString(32)+":"+a.ino.toString(32);if(v.hasOwnProperty(c))return r(null,v[c],z)}h.stat(z,function(b){if(b)return g(b);h.readlink(z,function(b,a){d||(v[c]=a);r(b,a)})})}function r(c,d,e){if(c)return g(c);c=b.resolve(G,d);m&&(m[e]=c);a=b.resolve(c,a.slice(C));l()}"function"!==typeof g&&(g="function"===typeof m?m:k(),m=null);a=b.resolve(a);if(m&&Object.prototype.hasOwnProperty.call(m,a))return f.nextTick(g.bind(null,null,m[a]));var u=a,v={},t={},C,A,z,G;l()}}).call(this,a("_process"))}, +{_process:124,fs:1,path:120}],215:[function(a,l,g){g.Abstract=a("./lib/abstract.js");g.Reader=a("./lib/reader.js");g.Writer=a("./lib/writer.js");g.File={Reader:a("./lib/file-reader.js"),Writer:a("./lib/file-writer.js")};g.Dir={Reader:a("./lib/dir-reader.js"),Writer:a("./lib/dir-writer.js")};g.Link={Reader:a("./lib/link-reader.js"),Writer:a("./lib/link-writer.js")};g.Proxy={Reader:a("./lib/proxy-reader.js"),Writer:a("./lib/proxy-writer.js")};g.Reader.Dir=g.DirReader=g.Dir.Reader;g.Reader.File=g.FileReader= +g.File.Reader;g.Reader.Link=g.LinkReader=g.Link.Reader;g.Reader.Proxy=g.ProxyReader=g.Proxy.Reader;g.Writer.Dir=g.DirWriter=g.Dir.Writer;g.Writer.File=g.FileWriter=g.File.Writer;g.Writer.Link=g.LinkWriter=g.Link.Writer;g.Writer.Proxy=g.ProxyWriter=g.Proxy.Writer;g.collect=a("./lib/collect.js")},{"./lib/abstract.js":216,"./lib/collect.js":217,"./lib/dir-reader.js":218,"./lib/dir-writer.js":219,"./lib/file-reader.js":220,"./lib/file-writer.js":221,"./lib/link-reader.js":223,"./lib/link-writer.js":224, +"./lib/proxy-reader.js":225,"./lib/proxy-writer.js":226,"./lib/reader.js":227,"./lib/writer.js":229}],216:[function(a,l,g){(function(f){function k(){d.call(this)}function b(b,a,c){b instanceof Error||(b=Error(b));b.code=b.code||a;b.path=b.path||c.path;b.fstream_type=b.fstream_type||c.type;b.fstream_path=b.fstream_path||c.path;c._path!==c.path&&(b.fstream_unc_path=b.fstream_unc_path||c._path);c.linkpath&&(b.fstream_linkpath=b.fstream_linkpath||c.linkpath);b.fstream_class=b.fstream_class||c.constructor.name; +b.fstream_stack=b.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(b){return b.replace(/^ {4}at /,"")});return b}l.exports=k;var d=a("stream").Stream;a("inherits")(k,d);k.prototype.on=function(b,a){"ready"===b&&this.ready?f.nextTick(a.bind(this)):d.prototype.on.call(this,b,a);return this};k.prototype.abort=function(){this._aborted=!0;this.emit("abort")};k.prototype.destroy=function(){};k.prototype.warn=function(a,d){var c=b(a,d,this);this.listeners("warn")?this.emit("warn",c):console.error("%s %s\npath = %s\nsyscall = %s\nfstream_type = %s\nfstream_path = %s\nfstream_unc_path = %s\nfstream_class = %s\nfstream_stack =\n%s\n", +d||"UNKNOWN",c.stack,c.path,c.syscall,c.fstream_type,c.fstream_path,c.fstream_unc_path,c.fstream_class,c.fstream_stack.join("\n"))};k.prototype.info=function(b,a){this.emit("info",b,a)};k.prototype.error=function(a,d,c){a=b(a,d,this);if(c)throw a;this.emit("error",a)}}).call(this,a("_process"))},{_process:124,inherits:243,stream:156}],217:[function(a,l,g){(function(a){function f(b){function d(b){"string"===typeof b&&(b=new a(b));a.isBuffer(b)&&!b.length||k.push(b)}function h(b){f(b);c.push(b)}if(!b._collected){if(b._paused)return b.on("resume", +f.bind(null,b));b._collected=!0;b.pause();b.on("data",d);b.on("end",d);var k=[];b.on("entry",h);var c=[];b.on("proxy",function(b){b.pause()});b.pipe=function(a){return function(e){function f(){b.removeListener("entry",h);b.removeListener("data",d);b.removeListener("end",d);b.pipe=a;e&&b.pipe(e);k.forEach(function(a){a?b.emit("data",a):b.emit("end")});b.resume()}var m=0;(function B(){var a=c[m++];if(!a)return f();a.on("end",B);e?e.add(a):b.emit("entry",a)})();return e}}(b.pipe)}}l.exports=f}).call(this, +a("buffer").Buffer)},{buffer:49}],218:[function(a,l,g){function f(b){if(!(this instanceof f))throw Error("DirReader must be called as constructor.");if("Directory"!==b.type||!b.Directory)throw Error("Non-directory type "+b.type);this.entries=null;this._index=-1;this._paused=!1;this._length=-1;b.sort&&(this.sort=b.sort);d.call(this,b)}l.exports=f;var k=a("graceful-fs");l=a("inherits");var b=a("path"),d=a("./reader.js"),h=a("assert").ok;l(f,d);f.prototype._getEntries=function(){var b=this;b._gotEntries|| +(b._gotEntries=!0,k.readdir(b._path,function(a,d){function c(){b._length=b.entries.length;"function"===typeof b.sort&&(b.entries=b.entries.sort(b.sort.bind(b)));b._read()}if(a)return b.error(a);b.entries=d;b.emit("entries",d);if(b._paused)b.once("resume",c);else c()}))};f.prototype._read=function(){var a=this;if(!a.entries)return a._getEntries();if(!(a._paused||a._currentEntry||a._aborted))if(a._index++,a._index>=a.entries.length)a._ended||(a._ended=!0,a.emit("end"),a.emit("close"));else{var c=b.resolve(a._path, +a.entries[a._index]);h(c!==a._path);h(a.entries[a._index]);a._currentEntry=c;k[a.props.follow?"stat":"lstat"](c,function(e,f){function h(){m||(m=!0,a.emit("childEnd",g),a.emit("entryEnd",g),a._currentEntry=null,a._paused||a._read())}if(e)return a.error(e);var k=a._proxy||a;f.path=c;f.basename=b.basename(c);f.dirname=b.dirname(c);k=a.getChildProps.call(k,f);k.path=c;k.basename=b.basename(c);k.dirname=b.dirname(c);var g=d(k,f);a._currentEntry=g;g.on("pause",function(b){a._paused||g._disowned||a.pause(b)}); +g.on("resume",function(b){a._paused&&!g._disowned&&a.resume(b)});g.on("stat",function(b){a.emit("_entryStat",g,b);if(!g._aborted)if(g._paused)g.once("resume",function(){a.emit("entryStat",g,b)});else a.emit("entryStat",g,b)});g.on("ready",function y(){if(a._paused)return g.pause(a),a.once("resume",y);"Socket"===g.type?a.emit("socket",g):a.emitEntry(g)});var m=!1;g.on("close",h);g.on("disown",h);g.on("error",function(b){g._swallowErrors?(a.warn(b),g.emit("end"),g.emit("close")):a.emit("error",b)}); +["child","childEnd","warn"].forEach(function(b){g.on(b,a.emit.bind(a,b))})})}};f.prototype.disown=function(b){b.emit("beforeDisown");b._disowned=!0;b.parent=b.root=null;b===this._currentEntry&&(this._currentEntry=null);b.emit("disown")};f.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};f.prototype.pause=function(b){this._paused||(b=b||this,this._paused=!0,this._currentEntry&& +this._currentEntry.pause&&this._currentEntry.pause(b),this.emit("pause",b))};f.prototype.resume=function(b){this._paused&&(b=b||this,this._paused=!1,this.emit("resume",b),this._paused||(this._currentEntry?this._currentEntry.resume&&this._currentEntry.resume(b):this._read()))};f.prototype.emitEntry=function(b){this.emit("entry",b);this.emit("child",b)}},{"./reader.js":227,assert:16,"graceful-fs":238,inherits:243,path:120}],219:[function(a,l,g){function f(b){this instanceof f||this.error("DirWriter must be called as constructor.", +null,!0);"Directory"===b.type&&b.Directory||this.error("Non-directory type "+b.type+" "+JSON.stringify(b),null,!0);k.call(this,b)}l.exports=f;var k=a("./writer.js");l=a("inherits");var b=a("mkdirp"),d=a("path"),h=a("./collect.js");l(f,k);f.prototype._create=function(){var a=this;b(a._path,k.dirmode,function(b){if(b)return a.error(b);a.ready=!0;a.emit("ready");a._process()})};f.prototype.write=function(){return!0};f.prototype.end=function(){this._ended=!0;this._process()};f.prototype.add=function(b){h(b); +if(!this.ready||this._currentEntry)return this._buffer.push(b),!1;if(this._ended)return this.error("add after end");this._buffer.push(b);this._process();return 0===this._buffer.length};f.prototype._process=function(){var b=this;if(!b._processing){var a=b._buffer.shift();if(a){b._processing=!0;b.emit("entry",a);var e=a,f;do{f=e._path||e.path;if(f===b.root._path||f===b._path||f&&0===f.indexOf(b._path))return b._processing=!1,a._collected&&a.pipe(),b._process();e=e.parent}while(e);var h={parent:b,root:b.root|| +b,type:a.type,depth:b.depth+1};f=a._path||a.path||a.props.path;a.parent&&(f=f.substr(a.parent._path.length+1));h.path=d.join(b.path,d.join("/",f));h.filter=b.filter;Object.keys(a.props).forEach(function(b){h.hasOwnProperty(b)||(h[b]=a.props[b])});var g=b._currentChild=new k(h);g.on("ready",function(){a.pipe(g);a.resume()});g.on("error",function(a){g._swallowErrors?(b.warn(a),g.emit("end"),g.emit("close")):b.emit("error",a)});g.on("close",function(){l||(l=!0,b._currentChild=null,b._processing=!1,b._process())}); +var l=!1}else b.emit("drain"),b._ended&&b._finish()}}},{"./collect.js":217,"./writer.js":229,inherits:243,mkdirp:252,path:120}],220:[function(a,l,g){function f(a){if(!(this instanceof f))throw Error("FileReader must be called as constructor.");if(!("Link"===a.type&&a.Link||"File"===a.type&&a.File))throw Error("Non-file type "+a.type);this._buffer=[];this._bytesEmitted=0;b.call(this,a)}l.exports=f;var k=a("graceful-fs");l=a("inherits");var b=a("./reader.js"),d={EOF:!0},h={CLOSE:!0};l(f,b);f.prototype._getStream= +function(){var b=this,a=b._stream=k.createReadStream(b._path,b.props);b.props.blksize&&(a.bufferSize=b.props.blksize);a.on("open",b.emit.bind(b,"open"));a.on("data",function(a){b._bytesEmitted+=a.length;a.length&&(b._paused||b._buffer.length?(b._buffer.push(a),b._read()):b.emit("data",a))});a.on("end",function(){b._paused||b._buffer.length?(b._buffer.push(d),b._read()):b.emit("end");b._bytesEmitted!==b.props.size&&b.error("Didn't get expected byte count\nexpect: "+b.props.size+"\nactual: "+b._bytesEmitted)}); +a.on("close",function(){b._paused||b._buffer.length?(b._buffer.push(h),b._read()):b.emit("close")});a.on("error",function(a){b.emit("error",a)});b._read()};f.prototype._read=function(){if(!this._paused){if(!this._stream)return this._getStream();if(this._buffer.length){for(var b=this._buffer,a=0,e=b.length;a=this._stream._queue.length:b};k.prototype.end=function(b){b&&this.write(b);return this.ready?this._stream.end():(this._buffer.push(h),!1)};k.prototype._finish= +function(){"number"===typeof this.size&&this._bytesWritten!==this.size&&this.error("Did not get expected byte count.\nexpect: "+this.size+"\nactual: "+this._bytesWritten);d.prototype._finish.call(this)}}).call(this,{isBuffer:a("../../../../../../.nvm/versions/node/v6.4.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")})},{"../../../../../../.nvm/versions/node/v6.4.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":99,"./writer.js":229,"graceful-fs":238,inherits:243}],222:[function(a, +l,g){l.exports=function(a){var f="Directory File SymbolicLink Link BlockDevice CharacterDevice FIFO Socket".split(" "),b;if(a.type&&-1!==f.indexOf(a.type))return a[a.type]=!0,a.type;for(var d=0,h=f.length;da.toLowerCase()?1:b.toLowerCase()a?1:-1}l.exports=k;var d=a("graceful-fs"),h=a("stream").Stream,g=a("inherits"),c=a("path"),e=a("./get-type.js"),n=k.hardLinks={},t=a("./abstract.js");g(k,t);var r=a("./link-reader.js");k.prototype._stat=function(b){function a(b,a){if(b)return c.error(b);Object.keys(a).forEach(function(b){h[b]= +a[b]});if(void 0!==c.size&&h.size!==c.size)return c.error("incorrect size");c.size=h.size;var d=e(h);if(!1!==h.hardlinks&&"Directory"!==d&&h.nlink&&1d&&h(Error("maxBuffer exceeded"))});f.once("error",g);f.on("end",e);c=function(){b.unpipe&&b.unpipe(f)}});e.then(c,c);return e.then(function(){return f.getBufferedValue()})}var k=a("./buffer-stream");l.exports= +f;l.exports.buffer=function(b,a){return f(b,Object.assign({},a,{encoding:"buffer"}))};l.exports.array=function(b,a){return f(b,Object.assign({},a,{array:!0}))}},{"./buffer-stream":230}],232:[function(a,l,g){(function(f){function k(b,a){return Object.prototype.hasOwnProperty.call(b,a)}function b(b,a){return b.toLowerCase().localeCompare(a.toLowerCase())}function d(b,a){return b.localeCompare(a)}function h(b){var a=null;"/**"===b.slice(-3)&&(a=b.replace(/(\/\*\*)+$/,""),a=new r(a,{dot:!0}));return{matcher:new r(b, +{dot:!0}),gmatcher:a}}function m(b,a){var c;c="/"===a.charAt(0)?e.join(b.root,a):t(a)||""===a?a:b.changedCwd?e.resolve(b.cwd,a):e.resolve(a);"win32"===f.platform&&(c=c.replace(/\\/g,"/"));return c}function c(b,a){return b.ignore.length?b.ignore.some(function(b){return b.matcher.match(a)||!(!b.gmatcher||!b.gmatcher.match(a))}):!1}g.alphasort=d;g.alphasorti=b;g.setopts=function(b,a,c){c||(c={});if(c.matchBase&&-1===a.indexOf("/")){if(c.noglobstar)throw Error("base matching requires globstar");a="**/"+ +a}b.silent=!!c.silent;b.pattern=a;b.strict=!1!==c.strict;b.realpath=!!c.realpath;b.realpathCache=c.realpathCache||Object.create(null);b.follow=!!c.follow;b.dot=!!c.dot;b.mark=!!c.mark;b.nodir=!!c.nodir;b.nodir&&(b.mark=!0);b.sync=!!c.sync;b.nounique=!!c.nounique;b.nonull=!!c.nonull;b.nosort=!!c.nosort;b.nocase=!!c.nocase;b.stat=!!c.stat;b.noprocess=!!c.noprocess;b.absolute=!!c.absolute;b.maxLength=c.maxLength||Infinity;b.cache=c.cache||Object.create(null);b.statCache=c.statCache||Object.create(null); +b.symlinks=c.symlinks||Object.create(null);b.ignore=c.ignore||[];Array.isArray(b.ignore)||(b.ignore=[b.ignore]);b.ignore.length&&(b.ignore=b.ignore.map(h));b.changedCwd=!1;var d=f.cwd();k(c,"cwd")?(b.cwd=e.resolve(c.cwd),b.changedCwd=b.cwd!==d):b.cwd=d;b.root=c.root||e.resolve(b.cwd,"/");b.root=e.resolve(b.root);"win32"===f.platform&&(b.root=b.root.replace(/\\/g,"/"));b.cwdAbs=t(b.cwd)?b.cwd:m(b,b.cwd);"win32"===f.platform&&(b.cwdAbs=b.cwdAbs.replace(/\\/g,"/"));b.nomount=!!c.nomount;c.nonegate=!0; +c.nocomment=!0;b.minimatch=new r(a,c);b.options=b.minimatch.options};g.ownProp=k;g.makeAbs=m;g.finish=function(a){for(var e=a.nounique,f=e?[]:Object.create(null),h=0,k=a.matches.length;h=h._processing&&(k?f.nextTick(function(){h._finish()}):h._finish())} +"function"===typeof c&&(d=c,c=null);if(c&&c.sync){if(d)throw new TypeError("callback provided to sync glob");return new z(a,c)}if(!(this instanceof b))return new b(a,c,d);y(this,a,c);this._didRealPath=!1;a=this.minimatch.set.length;this.matches=Array(a);"function"===typeof d&&(d=A(d),this.on("error",d),this.on("end",function(b){d(null,b)}));var h=this;a=this.minimatch.set.length;this._processing=0;this.matches=Array(a);this._emitQueue=[];this._processQueue=[];this.paused=!1;if(this.noprocess)return this; +if(0===a)return e();var k=!0;for(c=0;cthis.maxLength)return a();if(!this.stat&&u(this.cache,c)){var e=this.cache[c];Array.isArray(e)&&(e="DIR");if(!d||"DIR"===e)return a(null,e);if(d&&"FILE"===e)return a()}e=this.statCache[c];if(void 0!==e){if(!1===e)return a(null,e);var f=e.isDirectory()?"DIR":"FILE";return d&&"FILE"===f?a():a(null,f,e)}var k=this;(d=v("stat\x00"+c,function(d,e){if(e&&e.isSymbolicLink())return h.stat(c,function(d, +f){d?k._stat2(b,c,null,e,a):k._stat2(b,c,d,f,a)});k._stat2(b,c,d,e,a)}))&&h.lstat(c,d)};b.prototype._stat2=function(b,a,c,d,e){if(c&&("ENOENT"===c.code||"ENOTDIR"===c.code))return this.statCache[a]=!1,e();b="/"===b.slice(-1);this.statCache[a]=d;if("/"===a.slice(-1)&&d&&!d.isDirectory())return e(null,!1,d);c=!0;d&&(c=d.isDirectory()?"DIR":"FILE");this.cache[a]=this.cache[a]||c;return b&&"FILE"===c?e():e(null,c,d)}}).call(this,a("_process"))},{"./common.js":232,"./sync.js":234,_process:124,assert:16, +events:86,fs:1,"fs.realpath":213,inflight:242,inherits:243,minimatch:250,once:522,path:120,"path-is-absolute":523,util:168}],234:[function(a,l,g){(function(f){function k(a,c){if("function"===typeof c||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return(new b(a,c)).found}function b(a,c){if(!a)throw Error("must provide pattern");if("function"===typeof c||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); +if(!(this instanceof b))return new b(a,c);r(this,a,c);if(this.noprocess)return this;var d=this.minimatch.set.length;this.matches=Array(d);for(var e=0;ethis.maxLength)return!1;if(!this.stat&&p(this.cache,a)){b=this.cache[a];Array.isArray(b)&&(b="DIR");if(!c||"DIR"===b)return b;if(c&&"FILE"===b)return!1}var e=this.statCache[a];if(!e){var f; +try{f=d.lstatSync(a)}catch(A){if(A&&("ENOENT"===A.code||"ENOTDIR"===A.code))return this.statCache[a]=!1}if(f&&f.isSymbolicLink())try{e=d.statSync(a)}catch(A){e=f}else e=f}this.statCache[a]=e;b=!0;e&&(b=e.isDirectory()?"DIR":"FILE");this.cache[a]=this.cache[a]||b;return c&&"FILE"===b?!1:b};b.prototype._mark=function(b){return t.mark(this,b)};b.prototype._makeAbs=function(b){return t.makeAbs(this,b)}}).call(this,a("_process"))},{"./common.js":232,"./glob.js":233,_process:124,assert:16,fs:1,"fs.realpath":213, +minimatch:250,path:120,"path-is-absolute":523,util:168}],235:[function(a,l,g){function f(b){b=b||{};var a=new c,d=b.href||r.resolve(r.format(b),b.path),f=0,k=0,g,m=function(b){var c=("https:"===b.protocol?n:e).request(b,function(e){var k=e.statusCode;C(k)&&b.followRedirect&&"location"in e.headers&&("GET"===b.method||"HEAD"===b.method)?(e.resume(),10<++f?a.emit("error",new h.MaxRedirectsError(k,b),null,e):(k=G.from(e.headers.location,"binary").toString(),g=r.resolve(r.format(b),k),k=Object.assign({}, +b,r.parse(g)),a.emit("redirect",e,k),m(k))):setImmediate(function(){var b="function"===typeof A&&"HEAD"!==c.method?A(e):e;b.url=g||d;b.requestUrl=d;a.emit("response",b)})});c.once("error",function(c){var d=b.retries(++k,c);d?setTimeout(m,d,b):a.emit("error",new h.RequestError(c,b))});b.gotTimeout&&u(c,b.gotTimeout);setImmediate(function(){a.emit("request",c)})};m(b);return a}function k(b){return new Promise(function(a,c){var d=f(b);d.on("request",function(a){q(b.body)?(b.body.pipe(a),b.body=void 0): +a.end(b.body)});d.on("response",function(d){(null===b.encoding?y.buffer(d):y(d,b))["catch"](function(a){return c(new h.ReadError(a,b))}).then(function(c){var e=d.statusCode,f=b.followRedirect?299:399;d.body=c;if(b.json&&d.body)try{d.body=JSON.parse(d.body)}catch(Z){throw new h.ParseError(Z,e,b,c);}if(200>e||e>f)throw new h.HTTPError(e,b);a(d)})["catch"](function(b){Object.defineProperty(b,"response",{value:d});c(b)})});d.on("error",c)})}function b(b){var a=new t,c=new t,d=B(a,c);if(b.json)throw Error("got can not be used as stream when options.json is used"); +b.body&&(d.write=function(){throw Error("got's stream is not writable when options.body is used");});var e=f(b);e.on("request",function(c){d.emit("request",c);q(b.body)?b.body.pipe(c):b.body?c.end(b.body):"POST"===b.method||"PUT"===b.method||"PATCH"===b.method?a.pipe(c):c.end()});e.on("response",function(a){var e=a.statusCode;a.pipe(c);200>e||299d||!z(a)?0:1E3*(1<=4"},files:["index.js"],gitHead:"52da6067ddac5250d6c2e76af9a150b9cf4ba025",homepage:"https://github.com/sindresorhus/got#readme",keywords:"http https get got url uri request util utility simple curl wget fetch".split(" "),license:"MIT",maintainers:[{name:"sindresorhus",email:"sindresorhus@gmail.com"},{name:"floatdrop",email:"floatdrop@gmail.com"},{name:"kevva",email:"kevinmartensson@gmail.com"}],name:"got",optionalDependencies:{}, +readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/sindresorhus/got.git"},scripts:{coveralls:"nyc report --reporter=text-lcov | coveralls",test:"xo && nyc ava"},version:"6.7.1",xo:{esnext:!0}}},{}],237:[function(a,l,g){a=a("fs");l.exports=function(a){if(null===a||"object"!==typeof a)return a;var f=a instanceof Object?{__proto__:a.__proto__}:Object.create(null);Object.getOwnPropertyNames(a).forEach(function(b){Object.defineProperty(f,b,Object.getOwnPropertyDescriptor(a, +b))});return f}(a)},{fs:1}],238:[function(a,l,g){(function(f){function k(a){function e(a,c,e,f){function h(a,c,e,f){return C(a,c,e,function(k){!k||"EMFILE"!==k.code&&"ENFILE"!==k.code?("function"===typeof f&&f.apply(this,arguments),d()):b([h,[a,c,e,f]])})}"function"===typeof e&&(f=e,e=null);return h(a,c,e,f)}function h(b){return A.apply(a,b)}function m(b,a){return this instanceof m?(G.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}function l(b,a){return this instanceof l? +(F.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}function n(a,c,e,f){function h(a,c,e,f){return E(a,c,e,function(k,g){!k||"EMFILE"!==k.code&&"ENFILE"!==k.code?("function"===typeof f&&f.apply(this,arguments),d()):b([h,[a,c,e,f]])})}"function"===typeof e&&(f=e,e=null);return h(a,c,e,f)}g(a);a.gracefulify=k;a.FileReadStream=m;a.FileWriteStream=l;a.createReadStream=function(b,a){return new m(b,a)};a.createWriteStream=function(b,a){return new l(b,a)};var r=a.readFile;a.readFile= +function(a,c,e){function f(a,c,e){return r(a,c,function(h){!h||"EMFILE"!==h.code&&"ENFILE"!==h.code?("function"===typeof e&&e.apply(this,arguments),d()):b([f,[a,c,e]])})}"function"===typeof c&&(e=c,c=null);return f(a,c,e)};var t=a.writeFile;a.writeFile=function(a,c,e,f){function h(a,c,e,f){return t(a,c,e,function(k){!k||"EMFILE"!==k.code&&"ENFILE"!==k.code?("function"===typeof f&&f.apply(this,arguments),d()):b([h,[a,c,e,f]])})}"function"===typeof e&&(f=e,e=null);return h(a,c,e,f)};var C=a.appendFile; +C&&(a.appendFile=e);var A=a.readdir;a.readdir=function(a,c,e){var f=[a];"function"!==typeof c?f.push(c):e=c;f.push(function(a,c){c&&c.sort&&c.sort();!a||"EMFILE"!==a.code&&"ENFILE"!==a.code?("function"===typeof e&&e.apply(this,arguments),d()):b([h,[f]])});return h(f)};if("v0.8"===f.version.substr(0,4))var z=c(a),m=z.ReadStream,l=z.WriteStream;var G=a.ReadStream;m.prototype=Object.create(G.prototype);m.prototype.open=function(){var b=this;n(b.path,b.flags,b.mode,function(a,c){a?(b.autoClose&&b.destroy(), +b.emit("error",a)):(b.fd=c,b.emit("open",c),b.read())})};var F=a.WriteStream;l.prototype=Object.create(F.prototype);l.prototype.open=function(){var b=this;n(b.path,b.flags,b.mode,function(a,c){a?(b.destroy(),b.emit("error",a)):(b.fd=c,b.emit("open",c))})};a.ReadStream=m;a.WriteStream=l;var E=a.open;a.open=n;return a}function b(b){t("ENQUEUE",b[0].name,b[1]);e.push(b)}function d(){var b=e.shift();b&&(t("RETRY",b[0].name,b[1]),b[0].apply(null,b[1]))}var h=a("fs"),g=a("./polyfills.js"),c=a("./legacy-streams.js"), +e=[],n=a("util"),t=function(){};n.debuglog?t=n.debuglog("gfs4"):/\bgfs4\b/i.test(f.env.NODE_DEBUG||"")&&(t=function(){var b=n.format.apply(n,arguments),b="GFS4: "+b.split(/\n/).join("\nGFS4: ");console.error(b)});if(/\bgfs4\b/i.test(f.env.NODE_DEBUG||""))f.on("exit",function(){t(e);a("assert").equal(e.length,0)});l.exports=k(a("./fs.js"));f.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&(l.exports=k(h));l.exports.close=h.close=function(b){return function(a,c){return b.call(h,a,function(b){b||d();"function"=== +typeof c&&c.apply(this,arguments)})}}(h.close);l.exports.closeSync=h.closeSync=function(b){return function(a){var c=b.apply(h,arguments);d();return c}}(h.closeSync)}).call(this,a("_process"))},{"./fs.js":237,"./legacy-streams.js":239,"./polyfills.js":240,_process:124,assert:16,fs:1,util:168}],239:[function(a,l,g){(function(f){var k=a("stream").Stream;l.exports=function(b){function a(d,c){if(!(this instanceof a))return new a(d,c);k.call(this);var e=this;this.path=d;this.fd=null;this.readable=!0;this.paused= +!1;this.flags="r";this.mode=438;this.bufferSize=65536;c=c||{};for(var h=Object.keys(c),g=0,m=h.length;gthis.end)throw Error("start must be <= end");this.pos=this.start}null!==this.fd?f.nextTick(function(){e._read()}): +b.open(this.path,this.flags,this.mode,function(b,a){b?(e.emit("error",b),e.readable=!1):(e.fd=a,e.emit("open",a),e._read())})}function h(a,c){if(!(this instanceof h))return new h(a,c);k.call(this);this.path=a;this.fd=null;this.writable=!0;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;c=c||{};for(var d=Object.keys(c),f=0,g=d.length;fthis.start)throw Error("start must be >= zero"); +this.pos=this.start}this.busy=!1;this._queue=[];null===this.fd&&(this._open=b.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}return{ReadStream:a,WriteStream:h}}}).call(this,a("_process"))},{_process:124,stream:156}],240:[function(a,l,g){(function(f){function k(b){b.lchmod=function(a,c,d){b.open(a,p.O_WRONLY|p.O_SYMLINK,c,function(a,e){a?d&&d(a):b.fchmod(e,c,function(a){b.close(e,function(b){d&&d(a||b)})})})};b.lchmodSync=function(a,c){var d=b.openSync(a,p.O_WRONLY| +p.O_SYMLINK,c),e=!0,f;try{f=b.fchmodSync(d,c),e=!1}finally{if(e)try{b.closeSync(d)}catch(F){}else b.closeSync(d)}return f}}function b(b){p.hasOwnProperty("O_SYMLINK")?(b.lutimes=function(a,c,d,e){b.open(a,p.O_SYMLINK,function(a,f){a?e&&e(a):b.futimes(f,c,d,function(a){b.close(f,function(b){e&&e(a||b)})})})},b.lutimesSync=function(a,c,d){a=b.openSync(a,p.O_SYMLINK);var e,f=!0;try{e=b.futimesSync(a,c,d),f=!1}finally{if(f)try{b.closeSync(a)}catch(F){}else b.closeSync(a)}return e}):(b.lutimes=function(b, +a,c,d){d&&f.nextTick(d)},b.lutimesSync=function(){})}function d(b){return b?function(a,c,d){return b.call(r,a,c,function(b){t(b)&&(b=null);d&&d.apply(this,arguments)})}:b}function h(b){return b?function(a,c){try{return b.call(r,a,c)}catch(A){if(!t(A))throw A;}}:b}function g(b){return b?function(a,c,d,e){return b.call(r,a,c,d,function(b){t(b)&&(b=null);e&&e.apply(this,arguments)})}:b}function c(b){return b?function(a,c,d){try{return b.call(r,a,c,d)}catch(z){if(!t(z))throw z;}}:b}function e(b){return b? +function(a,c){return b.call(r,a,function(b,a){if(!a)return c.apply(this,arguments);0>a.uid&&(a.uid+=4294967296);0>a.gid&&(a.gid+=4294967296);c&&c.apply(this,arguments)})}:b}function n(b){return b?function(a){a=b.call(r,a);0>a.uid&&(a.uid+=4294967296);0>a.gid&&(a.gid+=4294967296);return a}:b}function t(b){if(!b||"ENOSYS"===b.code)return!0;if(!f.getuid||0!==f.getuid())if("EINVAL"===b.code||"EPERM"===b.code)return!0;return!1}var r=a("./fs.js"),p=a("constants"),B=f.cwd,q=null,y=f.env.GRACEFUL_FS_PLATFORM|| +f.platform;f.cwd=function(){q||(q=B.call(f));return q};try{f.cwd()}catch(v){}var u=f.chdir;f.chdir=function(b){q=null;u.call(f,b)};l.exports=function(a){p.hasOwnProperty("O_SYMLINK")&&f.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&k(a);a.lutimes||b(a);a.chown=g(a.chown);a.fchown=g(a.fchown);a.lchown=g(a.lchown);a.chmod=d(a.chmod);a.fchmod=d(a.fchmod);a.lchmod=d(a.lchmod);a.chownSync=c(a.chownSync);a.fchownSync=c(a.fchownSync);a.lchownSync=c(a.lchownSync);a.chmodSync=h(a.chmodSync);a.fchmodSync=h(a.fchmodSync); +a.lchmodSync=h(a.lchmodSync);a.stat=e(a.stat);a.fstat=e(a.fstat);a.lstat=e(a.lstat);a.statSync=n(a.statSync);a.fstatSync=n(a.fstatSync);a.lstatSync=n(a.lstatSync);a.lchmod||(a.lchmod=function(b,a,c){c&&f.nextTick(c)},a.lchmodSync=function(){});a.lchown||(a.lchown=function(b,a,c,d){d&&f.nextTick(d)},a.lchownSync=function(){});"win32"===y&&(a.rename=function(b){return function(c,d,e){var f=Date.now(),h=0;b(c,d,function J(k){k&&("EACCES"===k.code||"EPERM"===k.code)&&6E4>Date.now()-f?(setTimeout(function(){a.stat(d, +function(a,f){a&&"ENOENT"===a.code?b(c,d,J):e(k)})},h),100>h&&(h+=10)):e&&e(k)})}}(a.rename));a.read=function(b){return function(c,d,e,f,h,k){var g;if(k&&"function"===typeof k){var m=0;g=function(l,n,q){if(l&&"EAGAIN"===l.code&&10>m)return m++,b.call(a,c,d,e,f,h,g);k.apply(this,arguments)}}return b.call(a,c,d,e,f,h,g)}}(a.read);a.readSync=function(b){return function(c,d,e,f,h){for(var k=0;;)try{return b.call(a,c,d,e,f,h)}catch(J){if("EAGAIN"===J.code&&10>k)k++;else throw J;}}}(a.readSync)}}).call(this, +a("_process"))},{"./fs.js":237,_process:124,constants:52}],241:[function(a,l,g){arguments[4][96][0].apply(g,arguments)},{dup:96}],242:[function(a,l,g){(function(f){function k(a){return g(function n(){var c=h[a],d=c.length,k=b(arguments);try{for(var g=0;gd?(c.splice(0,d),f.nextTick(function(){n.apply(null,k)})):delete h[a]}})}function b(b){for(var a=b.length,c=[],d=0;dthis.catalog[c].indexOf("charset")?this.catalog[c]+"; charset="+d:this.catalog[c]:void 0!==f?!0===a&&0===f.indexOf("text/")?f+"; charset="+d:f:!1},set:function(b,a){var d=!0,c=this;-1>> no match, partial?",b,g,a,f),g===h)?!0:!1}var n;"string"===typeof g?(n=d.nocase?l.toLowerCase()===g.toLowerCase():l===g,this.debug("string match",g,l,n)):(n=l.match(g),this.debug("pattern match",g,l,n));if(!n)return!1}if(e=== +h&&f===k)return!0;if(e===h)return c;if(f===k)return e===h-1&&""===b[e];throw Error("wtf?");}},{"brace-expansion":178,path:120}],251:[function(a,l,g){var f=a("mkdirp");l.exports=function(a,b){return new Promise(function(d,h){f(a,b,function(b,a){return null===b?d(a):h(b)})})}},{mkdirp:252}],252:[function(a,l,g){(function(f){function k(a,g,c,e){"function"===typeof g?(c=g,g={}):g&&"object"===typeof g||(g={mode:g});var h=g.mode,m=g.fs||d;void 0===h&&(h=511&~f.umask());e||(e=null);var l=c||function(){}; +a=b.resolve(a);m.mkdir(a,h,function(c){if(!c)return e=e||a,l(null,e);switch(c.code){case "ENOENT":k(b.dirname(a),g,function(b,c){b?l(b,c):k(a,g,l,c)});break;default:m.stat(a,function(b,a){b||!a.isDirectory()?l(c,e):l(null,e)})}})}var b=a("path"),d=a("fs");l.exports=k.mkdirp=k.mkdirP=k;k.sync=function m(a,e,k){e&&"object"===typeof e||(e={mode:e});var c=e.mode,g=e.fs||d;void 0===c&&(c=511&~f.umask());k||(k=null);a=b.resolve(a);try{g.mkdirSync(a,c),k=k||a}catch(B){switch(B.code){case "ENOENT":k=m(b.dirname(a), +e,k);m(a,e,k);break;default:var l;try{l=g.statSync(a)}catch(q){throw B;}if(!l.isDirectory())throw B;}}return k}}).call(this,a("_process"))},{_process:124,fs:1,path:120}],253:[function(a,l,g){(function(f,k){function b(b,a,c){if(b){var d=null,e;try{e=c.call(a)}catch(C){d=C}b.oncomplete&&(b=b.oncomplete.bind(b));f.nextTick(function(){void 0===e?b(d):b(d,e)})}else return c.call(a)}function d(b){for(var a in b)this[a]=b[a]}function h(b){this._system=b;this.Stats=d;this._openFiles={};this._counter=0}var g= +a("path"),c=a("./file"),e=a("./descriptor"),n=a("./directory"),t=a("./symlink"),r=a("./error"),p=a("constants"),B=a("./filesystem").getPathParts;d.prototype._checkModeProperty=function(b){return(this.mode&p.S_IFMT)===b};d.prototype.isDirectory=function(){return this._checkModeProperty(p.S_IFDIR)};d.prototype.isFile=function(){return this._checkModeProperty(p.S_IFREG)};d.prototype.isBlockDevice=function(){return this._checkModeProperty(p.S_IFBLK)};d.prototype.isCharacterDevice=function(){return this._checkModeProperty(p.S_IFCHR)}; +d.prototype.isSymbolicLink=function(){return this._checkModeProperty(p.S_IFLNK)};d.prototype.isFIFO=function(){return this._checkModeProperty(p.S_IFIFO)};d.prototype.isSocket=function(){return this._checkModeProperty(p.S_IFSOCK)};h.prototype.getSystem=function(){return this._system};h.prototype.setSystem=function(b){this._system=b};h.prototype._getDescriptorById=function(b){if(!this._openFiles.hasOwnProperty(b))throw new r("EBADF");return this._openFiles[b]};h.prototype._trackDescriptor=function(b){var a= +++this._counter;this._openFiles[a]=b;return a};h.prototype._untrackDescriptorById=function(b){if(!this._openFiles.hasOwnProperty(b))throw new r("EBADF");delete this._openFiles[b]};h.prototype.realpath=function(a,c,d){return b(d,this,function(){var b;k.isBuffer(a)&&(a=a.toString());b=g.resolve(a);b=B(b);var d=this._system.getRoot(),e="/",f,h,m;h=0;for(m=b.length;hh)h=b.getPosition();var k=k.getContent(),g=Math.min(h,k.length),m=Math.min(h+f,k.length),k=ge)e=b.getPosition();var h=f.getContent(),g=k.concat(d), +m=e+g.length;if(h.lengthh)h=b.getPosition();var m=g.getContent(),l=h+f;if(m.lengthb?d+b:b;ba.length))return a[a.length-1]}},{}],285:[function(a,l,g){l.exports=function(a,k,b){if(null==a)return-1;var d=a.length;b=null==b||b>=d?d-1:b;for(b=0>b?d+b:b;0<=b;){if(a[b]===k)return b;b--}return-1}},{}],286:[function(a,l,g){var f=a("../function/makeIterator_");l.exports=function(a,b,d){b=f(b,d);d=[];if(null==a)return d;for(var h=-1,k=a.length;++hd&&(d=c,h=k);return h}return Infinity}},{"../function/makeIterator_":349}],288:[function(a,l,g){var f=a("../function/makeIterator_");l.exports=function(a,b,d){if(null!=a&&a.length){if(a.length&&!b)return Math.min.apply(Math,a);b=f(b,d);var h;d=Infinity;for(var k,c,e=-1,g=a.length;++e< +g;)k=a[e],c=b(k,e,a),cb.length?b.length:a;a--;)d.push(f(b));return d}return b&&b.length?f(b):void 0}},{"../random/randInt":473}],290:[function(a,l,g){var f=a("./map");l.exports=function(a,b){return f(a,b)}},{"./map":286}],291:[function(a,l,g){var f= +a("../math/countSteps");l.exports=function(a,b,d){null==b&&(b=a,a=0);d=d||1;var h=[];for(f(b-a,d);a<=b;)h.push(a),a+=d;return h}},{"../math/countSteps":394}],292:[function(a,l,g){l.exports=function(a,k,b){var d=2k?Math.max(d+ +k,0):Math.min(k,d);b=null==b?d:0>b?Math.max(d+b,0):Math.min(b,d);for(d=[];kb.length)return b;null==a&&(a=k);var d,g;d=~~(b.length/2);g=f(b.slice(0,d),a);d=f(b.slice(d,b.length),a);for(var c= +a,e=[];g.length&&d.length;)0>=c(g[0],d[0])?e.push(g.shift()):e.push(d.shift());g.length&&e.push.apply(e,g);d.length&&e.push.apply(e,d);return e}function k(b,a){return ba?1:0}l.exports=f},{}],302:[function(a,l,g){var f=a("./sort"),k=a("../function/makeIterator_");l.exports=function(b,a,h){a=k(a,h);return f(b,function(b,c){b=a(b);c=a(c);return bc?1:0})}},{"../function/makeIterator_":349,"./sort":301}],303:[function(a,l,g){l.exports=function(a,k){k=k||2;var b=[];if(null==a)return b;for(var d= +Math.floor(a.length/k),f=a.length%k,g=0,c=a.length,e=0,l;ge){var c=a;a=e;e=c}if("month"===g){var c=a,l=e;e=l.getMonth()-c.getMonth();0>e&&(e+=12);c.getDate()>l.getDate()&&--e;e+=12*b(c,l);var n=0;a=c.getDate();g=l.getDate();a!==g&&(n=d(c),c=d(l),a>g?(l=n-a,g+=l,a=a>c?c+l+1:a+l):(g-=a,a=c),n=g/a);e+= +n}else"year"===g?(g=e,a=(e=b(a,g))?new Date(g.getFullYear(),a.getMonth(),a.getDate()):a,a=f(a,g,"day")/h(g),e+=a):null!=g?("day"===g&&(a=k(a),e=k(e)),e=m(e-a,"ms",g)):e-=a;return e}function k(b){return Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate(),b.getHours(),b.getMinutes(),b.getSeconds(),b.getMilliseconds())}function b(b,a){var c=a.getFullYear()-b.getFullYear();b.getMonth()>a.getMonth()&&--c;return c}var d=a("./totalDaysInMonth"),h=a("./totalDaysInYear"),m=a("../time/convert");l.exports= +f},{"../time/convert":517,"./totalDaysInMonth":338,"./totalDaysInYear":339}],328:[function(a,l,g){l.exports={am:"AM",pm:"PM",x:"%m/%d/%y",X:"%H:%M:%S",c:"%a %d %b %Y %I:%M:%S %p %Z",months:"January February March April May June July August September October November December".split(" "),months_abbr:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),days_abbr:"Sun Mon Tue Wed Thu Fri Sat".split(" ")}},{}],329:[function(a, +l,g){var f=a("../object/mixIn");a=a("./i18n/en-US");var k=f({},a,{set:function(b){f(k,b)}});l.exports=k},{"../object/mixIn":445,"./i18n/en-US":328}],330:[function(a,l,g){var f=a("../lang/isDate");l.exports=function(a){f(a)&&(a=a.getFullYear());return 0===a%400||0!==a%100&&0===a%4}},{"../lang/isDate":371}],331:[function(a,l,g){var f=a("./startOf");l.exports=function(a,b,d){d&&(a=f(a,d),b=f(b,d));return Number(a)===Number(b)}},{"./startOf":334}],332:[function(a,l,g){function f(b,a){var c;return d(a, +function(a){return!!(c=a.exec(b))})?c:null}function k(b){var a,c;a=f(b,h);if(null===a){a:{if(c=m.exec(b))if(b=+c[1],c=new Date(Date.UTC(b,0,+c[2])),c.getUTCFullYear()===b){b=+c;break a}b=NaN}return b}b=void 0===a[1]?0:+a[1];c=void 0===a[2]?0:+a[2]-1;a=void 0===a[3]?1:+a[3];var d=new Date(Date.UTC(b,c,a));d.setUTCFullYear(b);return d.getUTCFullYear()===b&&d.getUTCMonth()===c&&d.getUTCDate()===a?+d:NaN}function b(b,a,c){return 24>b&&0<=b&&60>a&&0<=a&&60>c&&0<=a||24===b&&0===a&&0===c?1E3*(60*(60*b+a)+ +c):NaN}var d=a("../array/some"),h=[/^([0-9]{4})$/,/^([0-9]{4})-([0-9]{2})$/,/^([0-9]{4})-?([0-9]{2})-?([0-9]{2})$/],m=/^([0-9]{4})-?([0-9]{3})$/,c=[/^([0-9]{2}(?:\.[0-9]*)?)$/,/^([0-9]{2}):?([0-9]{2}(?:\.[0-9]*)?)$/,/^([0-9]{2}):?([0-9]{2}):?([0-9]{2}(\.[0-9]*)?)$/],e=/^(.+)T(.+)$/,n=/^(.+)([+\-])([0-9]{2}):?([0-9]{2})$/;l.exports=function(a){var d=e.exec(a);if(d){a=k(d[1]);var h=d[2];b:{if("Z"===h.charAt(h.length-1))h=h.substring(0,h.length-1);else if(d=n.exec(h)){h=b(+d[3],void 0===d[4]?0:+d[4], +0);"-"===d[2]&&(h*=-1);d={offset:h,time:d[1]};break b}d={offset:0,time:h}}h=d.time;d=d.offset;isNaN(d)?d=NaN:(h=f(h,c),d=null===h?NaN:b(void 0===h[1]?0:+h[1],void 0===h[2]?0:+h[2],void 0===h[3]?0:+h[3])-d);a+=d}else a=k(a);return a}},{"../array/some":300}],333:[function(a,l,g){l.exports=function(a){a=a.getMonth();return 3>a?1:6>a?2:9>a?3:4}},{}],334:[function(a,l,g){var f=a("../lang/clone");l.exports=function(a,b){a=f(a);switch(b){case "year":a.setMonth(0);case "month":a.setDate(1);case "week":case "day":a.setHours(0); +case "hour":a.setMinutes(0);case "minute":a.setSeconds(0);case "second":a.setMilliseconds(0);break;default:throw Error('"'+b+'" is not a valid period');}if("week"===b){var d=a.getDay(),h=a.getDate();d&&(d>=h&&a.setDate(0),a.setDate(a.getDate()-a.getDay()))}return a}},{"../lang/clone":360}],335:[function(a,l,g){function f(b,a,c){return a in t?(b=t[a],"locale"===b?c[a]:b):"%"+a}function k(a,f,h){switch(f){case "a":return h.days_abbr[a.getDay()];case "A":return h.days[a.getDay()];case "h":case "b":return h.months_abbr[a.getMonth()]; +case "B":return h.months[a.getMonth()];case "C":return b(Math.floor(a.getFullYear()/100),2);case "d":return b(a.getDate(),2);case "e":return b(a.getDate(),2," ");case "H":return b(a.getHours(),2);case "I":return b(a.getHours()%12,2);case "j":return b(m(a),3);case "l":return d(a.getHours()%12,2);case "L":return b(a.getMilliseconds(),3);case "m":return b(a.getMonth()+1,2);case "M":return b(a.getMinutes(),2);case "n":return"\n";case "p":return 12<=a.getHours()?h.pm:h.am;case "P":return k(a,"p",h).toLowerCase(); +case "s":return a.getTime()/1E3;case "S":return b(a.getSeconds(),2);case "t":return"\t";case "u":return a=a.getDay(),0===a?7:a;case "U":return b(n(a),2);case "w":return a.getDay();case "W":return b(n(a,1),2);case "y":return b(a.getFullYear()%100,2);case "Y":return b(a.getFullYear(),4);case "z":return c(a);case "Z":return e(a);case "%":return"%";default:return"%"+f}}var b=a("../number/pad"),d=a("../string/lpad"),h=a("./i18n_"),m=a("./dayOfTheYear"),c=a("./timezoneOffset"),e=a("./timezoneAbbr"),n=a("./weekOfTheYear"), +t={D:"%m/%d/%y",F:"%Y-%m-%d",r:"%I:%M:%S %p",R:"%H:%M",T:"%H:%M:%S",x:"locale",X:"locale",c:"locale"};l.exports=function(b,a,c){function d(a){return function(d,e){return a(b,e,c)}}c=c||h;var e=/%([a-z%])/gi;return a.replace(e,d(f)).replace(e,d(k))}},{"../number/pad":414,"../string/lpad":490,"./dayOfTheYear":326,"./i18n_":329,"./timezoneAbbr":336,"./timezoneOffset":337,"./weekOfTheYear":340}],336:[function(a,l,g){var f=a("./timezoneOffset");l.exports=function(a){var b=/\(([A-Z]{3,4})\)/.exec(a.toString()); +return b?b[1]:f(a)}},{"./timezoneOffset":337}],337:[function(a,l,g){var f=a("../number/pad");l.exports=function(a){a=a.getTimezoneOffset();var b=Math.abs(a),d=f(Math.floor(b/60),2),b=f(b%60,2);return(0=l?(clearTimeout(c),d()):c||(c=setTimeout(d,l));return e}var k,c,e,g,l,r=0;h.cancel=function(){clearTimeout(c)};return h}},{"../time/now":518}],354:[function(a,l,g){var f=a("../array/slice");l.exports=function(a,b,d){var h=f(arguments,3);return setTimeout(function(){a.apply(d,h)},b)}},{"../array/slice":299}],355:[function(a,l,g){l.exports=function(a,k,b){for(var d=-1;++db?b:a}},{}],394:[function(a,l,g){l.exports=function(a,k,b){a=Math.floor(a/k);return b?a%b:a}},{}],395:[function(a,l,g){l.exports=function(a, +k){k=Math.abs(k||1);return Math.floor(a/k)*k}},{}],396:[function(a,l,g){l.exports=function(a,k,b,d){d=d||0;return a+d>=k&&a-d<=b}},{}],397:[function(a,l,g){l.exports=function(a,k,b){return Math.abs(a-k)<=b}},{}],398:[function(a,l,g){l.exports=function(a,k,b){return k+(b-k)*a}},{}],399:[function(a,l,g){l.exports=function(a,k,b){return ab?k:a}},{}],400:[function(a,l,g){var f=a("./lerp"),k=a("./norm");l.exports=function(b,a,h,g,c){return f(k(b,a,h),g,c)}},{"./lerp":398,"./norm":401}],401:[function(a, +l,g){l.exports=function(a,k,b){if(ab)throw new RangeError("value ("+a+") must be between "+k+" and "+b);return a===b?1:(a-k)/(b-k)}},{}],402:[function(a,l,g){l.exports=function(a,k){k=k||1;return Math.round(a/k)*k}},{}],403:[function(a,l,g){l.exports={MAX_INT:a("./number/MAX_INT"),MAX_SAFE_INTEGER:a("./number/MAX_SAFE_INTEGER"),MAX_UINT:a("./number/MAX_UINT"),MIN_INT:a("./number/MIN_INT"),abbreviate:a("./number/abbreviate"),currencyFormat:a("./number/currencyFormat"),enforcePrecision:a("./number/enforcePrecision"), +isNaN:a("./number/isNaN"),nth:a("./number/nth"),ordinal:a("./number/ordinal"),pad:a("./number/pad"),rol:a("./number/rol"),ror:a("./number/ror"),sign:a("./number/sign"),toInt:a("./number/toInt"),toUInt:a("./number/toUInt"),toUInt31:a("./number/toUInt31")}},{"./number/MAX_INT":404,"./number/MAX_SAFE_INTEGER":405,"./number/MAX_UINT":406,"./number/MIN_INT":407,"./number/abbreviate":408,"./number/currencyFormat":409,"./number/enforcePrecision":410,"./number/isNaN":411,"./number/nth":412,"./number/ordinal":413, +"./number/pad":414,"./number/rol":415,"./number/ror":416,"./number/sign":417,"./number/toInt":418,"./number/toUInt":419,"./number/toUInt31":420}],404:[function(a,l,g){l.exports=2147483647},{}],405:[function(a,l,g){l.exports=9007199254740991},{}],406:[function(a,l,g){l.exports=4294967295},{}],407:[function(a,l,g){l.exports=-2147483648},{}],408:[function(a,l,g){var f=a("./enforcePrecision"),k={thousand:"K",million:"M",billion:"B"};l.exports=function(b,a,h){a=null!=a?a:1;h=h||k;b=f(b,a);1E6>b?(b=f(b/ +1E3,a),h=1E3>b?b+h.thousand:1+h.million):1E9>b?(b=f(b/1E6,a),h=1E3>b?b+h.million:1+h.billion):h=f(b/1E9,a)+h.billion;return h}},{"./enforcePrecision":410}],409:[function(a,l,g){var f=a("../lang/toNumber");l.exports=function(a,b,d,h){a=f(a);b=null==b?2:b;d=null==d?".":d;h=null==h?",":h;a=a.toFixed(b);return(b=(new RegExp("^(-?\\d{1,3})((?:\\d{3})+)(\\.(\\d{"+b+"}))?$")).exec(a))?b[1]+b[2].replace(/\d{3}/g,h+"$&")+(b[4]?d+b[4]:""):a.replace(".",d)}},{"../lang/toNumber":389}],410:[function(a,l,g){var f= +a("../lang/toNumber");l.exports=function(a,b){a=f(a);var d=Math.pow(10,b);return+(Math.round(a*d)/d).toFixed(b)}},{"../lang/toNumber":389}],411:[function(a,l,g){l.exports=function(a){return"number"===typeof a&&a!=a}},{}],412:[function(a,l,g){l.exports=function(a){var f=a%100;if(10<=f&&20>=f)return"th";switch(a%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}},{}],413:[function(a,l,g){var f=a("./toInt"),k=a("./nth");l.exports=function(b){b=f(b);return b+k(b)}},{"./nth":412, +"./toInt":418}],414:[function(a,l,g){var f=a("../string/lpad"),k=a("../lang/toNumber");l.exports=function(b,a,h){b=k(b);return f(""+b,a,h||"0")}},{"../lang/toNumber":389,"../string/lpad":490}],415:[function(a,l,g){l.exports=function(a,k){return a<>32-k}},{}],416:[function(a,l,g){l.exports=function(a,k){return a>>k|a<<32-k}},{}],417:[function(a,l,g){var f=a("../lang/toNumber");l.exports=function(a){a=f(a);return 0===a||isNaN(a)?a:0>a?-1:1}},{"../lang/toNumber":389}],418:[function(a,l,g){l.exports= +function(a){return~~a}},{}],419:[function(a,l,g){l.exports=function(a){return a>>>0}},{}],420:[function(a,l,g){var f=a("./MAX_INT");l.exports=function(a){return 0>=a?0:a>f?~~(a%(f+1)):~~a}},{"./MAX_INT":404}],421:[function(a,l,g){l.exports={bindAll:a("./object/bindAll"),contains:a("./object/contains"),deepFillIn:a("./object/deepFillIn"),deepMatches:a("./object/deepMatches"),deepMixIn:a("./object/deepMixIn"),equals:a("./object/equals"),every:a("./object/every"),fillIn:a("./object/fillIn"),filter:a("./object/filter"), +find:a("./object/find"),flatten:a("./object/flatten"),forIn:a("./object/forIn"),forOwn:a("./object/forOwn"),functions:a("./object/functions"),get:a("./object/get"),has:a("./object/has"),hasOwn:a("./object/hasOwn"),keys:a("./object/keys"),map:a("./object/map"),matches:a("./object/matches"),max:a("./object/max"),merge:a("./object/merge"),min:a("./object/min"),mixIn:a("./object/mixIn"),namespace:a("./object/namespace"),omit:a("./object/omit"),pick:a("./object/pick"),pluck:a("./object/pluck"),reduce:a("./object/reduce"), +reject:a("./object/reject"),result:a("./object/result"),set:a("./object/set"),size:a("./object/size"),some:a("./object/some"),unset:a("./object/unset"),values:a("./object/values")}},{"./object/bindAll":422,"./object/contains":423,"./object/deepFillIn":424,"./object/deepMatches":425,"./object/deepMixIn":426,"./object/equals":427,"./object/every":428,"./object/fillIn":429,"./object/filter":430,"./object/find":431,"./object/flatten":432,"./object/forIn":433,"./object/forOwn":434,"./object/functions":435, +"./object/get":436,"./object/has":437,"./object/hasOwn":438,"./object/keys":439,"./object/map":440,"./object/matches":441,"./object/max":442,"./object/merge":443,"./object/min":444,"./object/mixIn":445,"./object/namespace":446,"./object/omit":447,"./object/pick":448,"./object/pluck":449,"./object/reduce":450,"./object/reject":451,"./object/result":452,"./object/set":453,"./object/size":454,"./object/some":455,"./object/unset":456,"./object/values":457}],422:[function(a,l,g){var f=a("./functions"), +k=a("../function/bind"),b=a("../array/forEach"),d=a("../array/slice");l.exports=function(a,g){var c=1=a)a=8;if(!k(h)||1>h.length)h="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var d="",c=h.length-1;a--;)d+=h[b(0,c)];return d}},{"../lang/isNumber":379,"../lang/isString":384,"./randInt":473}],476:[function(a,l,g){function f(){return f.get()}f.get=Math.random;l.exports=f},{}],477:[function(a,l,g){l.exports={WHITE_SPACES:a("./string/WHITE_SPACES"),camelCase:a("./string/camelCase"), +contains:a("./string/contains"),crop:a("./string/crop"),endsWith:a("./string/endsWith"),escapeHtml:a("./string/escapeHtml"),escapeRegExp:a("./string/escapeRegExp"),escapeUnicode:a("./string/escapeUnicode"),hyphenate:a("./string/hyphenate"),insert:a("./string/insert"),interpolate:a("./string/interpolate"),lowerCase:a("./string/lowerCase"),lpad:a("./string/lpad"),ltrim:a("./string/ltrim"),makePath:a("./string/makePath"),normalizeLineBreaks:a("./string/normalizeLineBreaks"),pascalCase:a("./string/pascalCase"), +properCase:a("./string/properCase"),removeNonASCII:a("./string/removeNonASCII"),removeNonWord:a("./string/removeNonWord"),repeat:a("./string/repeat"),replace:a("./string/replace"),replaceAccents:a("./string/replaceAccents"),rpad:a("./string/rpad"),rtrim:a("./string/rtrim"),sentenceCase:a("./string/sentenceCase"),slugify:a("./string/slugify"),startsWith:a("./string/startsWith"),stripHtmlTags:a("./string/stripHtmlTags"),trim:a("./string/trim"),truncate:a("./string/truncate"),typecast:a("./string/typecast"), +unCamelCase:a("./string/unCamelCase"),underscore:a("./string/underscore"),unescapeHtml:a("./string/unescapeHtml"),unescapeUnicode:a("./string/unescapeUnicode"),unhyphenate:a("./string/unhyphenate"),upperCase:a("./string/upperCase")}},{"./string/WHITE_SPACES":478,"./string/camelCase":479,"./string/contains":480,"./string/crop":481,"./string/endsWith":482,"./string/escapeHtml":483,"./string/escapeRegExp":484,"./string/escapeUnicode":485,"./string/hyphenate":486,"./string/insert":487,"./string/interpolate":488, +"./string/lowerCase":489,"./string/lpad":490,"./string/ltrim":491,"./string/makePath":492,"./string/normalizeLineBreaks":493,"./string/pascalCase":494,"./string/properCase":495,"./string/removeNonASCII":496,"./string/removeNonWord":497,"./string/repeat":498,"./string/replace":499,"./string/replaceAccents":500,"./string/rpad":501,"./string/rtrim":502,"./string/sentenceCase":503,"./string/slugify":504,"./string/startsWith":505,"./string/stripHtmlTags":506,"./string/trim":507,"./string/truncate":508, +"./string/typecast":509,"./string/unCamelCase":510,"./string/underscore":511,"./string/unescapeHtml":512,"./string/unescapeUnicode":513,"./string/unhyphenate":514,"./string/upperCase":515}],478:[function(a,l,g){l.exports=" \n\r\t\f\x0B\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000".split("")},{}],479:[function(a,l,g){var f=a("../lang/toString"),k=a("./replaceAccents"),b=a("./removeNonWord"),d=a("./upperCase"),h=a("./lowerCase");l.exports= +function(a){a=f(a);a=k(a);return a=b(a).replace(/[\-_]/g," ").replace(/\s[a-z]/g,d).replace(/\s+/g,"").replace(/^[A-Z]/g,h)}},{"../lang/toString":390,"./lowerCase":489,"./removeNonWord":497,"./replaceAccents":500,"./upperCase":515}],480:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a,b,d){a=f(a);b=f(b);return-1!==a.indexOf(b,d)}},{"../lang/toString":390}],481:[function(a,l,g){var f=a("../lang/toString"),k=a("./truncate");l.exports=function(b,a,h){b=f(b);return k(b,a,h,!0)}},{"../lang/toString":390, +"./truncate":508}],482:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a,b){a=f(a);b=f(b);return-1!==a.indexOf(b,a.length-b.length)}},{"../lang/toString":390}],483:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a){return a=f(a).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")}},{"../lang/toString":390}],484:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a){return f(a).replace(/\W/g,"\\$&")}}, +{"../lang/toString":390}],485:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a,b){a=f(a);return a.replace(/[\s\S]/g,function(a){return!b&&/[\x20-\x7E]/.test(a)?a:"\\u"+("000"+a.charCodeAt(0).toString(16)).slice(-4)})}},{"../lang/toString":390}],486:[function(a,l,g){var f=a("../lang/toString"),k=a("./slugify"),b=a("./unCamelCase");l.exports=function(a){a=f(a);a=b(a);return k(a,"-")}},{"../lang/toString":390,"./slugify":504,"./unCamelCase":510}],487:[function(a,l,g){var f=a("../math/clamp"), +k=a("../lang/toString");l.exports=function(b,a,h){b=k(b);0>a&&(a=b.length+a);a=f(a,0,b.length);return b.substr(0,a)+h+b.substr(a)}},{"../lang/toString":390,"../math/clamp":393}],488:[function(a,l,g){var f=a("../lang/toString"),k=a("../object/get"),b=/\{\{([^\}]+)\}\}/g;l.exports=function(a,h,g){a=f(a);return a.replace(g||b,function(b,a){return f(k(h,a))})}},{"../lang/toString":390,"../object/get":436}],489:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a){a=f(a);return a.toLowerCase()}}, +{"../lang/toString":390}],490:[function(a,l,g){var f=a("../lang/toString"),k=a("./repeat");l.exports=function(b,a,h){b=f(b);return b.length=g?"":b.substr(d,g)}},{"../lang/toString":390,"./WHITE_SPACES":478}], +492:[function(a,l,g){var f=a("../array/join"),k=a("../array/slice");l.exports=function(b){return f(k(arguments),"/").replace(/([^:\/]|^)\/{2,}/g,"$1/")}},{"../array/join":283,"../array/slice":299}],493:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a,b){a=f(a);b=b||"\n";return a.replace(/\r\n/g,b).replace(/\r/g,b).replace(/\n/g,b)}},{"../lang/toString":390}],494:[function(a,l,g){var f=a("../lang/toString"),k=a("./camelCase"),b=a("./upperCase");l.exports=function(a){a=f(a);return k(a).replace(/^[a-z]/, +b)}},{"../lang/toString":390,"./camelCase":479,"./upperCase":515}],495:[function(a,l,g){var f=a("../lang/toString"),k=a("./lowerCase"),b=a("./upperCase");l.exports=function(a){a=f(a);return k(a).replace(/^\w|\s\w/g,b)}},{"../lang/toString":390,"./lowerCase":489,"./upperCase":515}],496:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a){a=f(a);return a.replace(/[^\x20-\x7E]/g,"")}},{"../lang/toString":390}],497:[function(a,l,g){var f=a("../lang/toString"),k=/[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g; +l.exports=function(b){b=f(b);return b.replace(k,"")}},{"../lang/toString":390}],498:[function(a,l,g){var f=a("../lang/toString"),k=a("../number/toInt");l.exports=function(b,a){var d="";b=f(b);a=k(a);if(1>a)return"";for(;0]*>/g, +"")}},{"../lang/toString":390}],507:[function(a,l,g){var f=a("../lang/toString"),k=a("./WHITE_SPACES"),b=a("./ltrim"),d=a("./rtrim");l.exports=function(a,g){a=f(a);g=g||k;return b(d(a,g),g)}},{"../lang/toString":390,"./WHITE_SPACES":478,"./ltrim":491,"./rtrim":502}],508:[function(a,l,g){var f=a("../lang/toString"),k=a("./trim");l.exports=function(b,a,h,g){b=f(b);h=h||"...";a=g?a+1:a;b=k(b);if(b.length<=a)return b;b=b.substr(0,a-h.length);b=g?b.substr(0,b.lastIndexOf(" ")):k(b);return b+h}},{"../lang/toString":390, +"./trim":507}],509:[function(a,l,g){l.exports=function(a){return null===a||"null"===a?null:"true"===a?!0:"false"===a?!1:void 0===a||"undefined"===a?void 0:""===a||isNaN(a)?a:parseFloat(a)}},{}],510:[function(a,l,g){var f=a("../lang/toString"),k=/([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g;l.exports=function(b,a){null==a&&(a=" ");b=f(b);b=b.replace(k,function(b,d,c){return d+a+c});return b=b.toLowerCase()}},{"../lang/toString":390}],511:[function(a,l,g){var f=a("../lang/toString"),k=a("./slugify"),b=a("./unCamelCase"); +l.exports=function(a){a=f(a);a=b(a);return k(a,"_")}},{"../lang/toString":390,"./slugify":504,"./unCamelCase":510}],512:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a){return a=f(a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/�*39;/g,"'").replace(/"/g,'"')}},{"../lang/toString":390}],513:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a){a=f(a);return a.replace(/\\u[0-9a-f]{4}/g,function(b){b=parseInt(b.slice(2),16);return String.fromCharCode(b)})}}, +{"../lang/toString":390}],514:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a){a=f(a);return a.replace(/(\w)(-)(\w)/g,"$1 $3")}},{"../lang/toString":390}],515:[function(a,l,g){var f=a("../lang/toString");l.exports=function(a){a=f(a);return a.toUpperCase()}},{"../lang/toString":390}],516:[function(a,l,g){l.exports={convert:a("./time/convert"),now:a("./time/now"),parseMs:a("./time/parseMs"),toTimeString:a("./time/toTimeString")}},{"./time/convert":517,"./time/now":518,"./time/parseMs":519, +"./time/toTimeString":520}],517:[function(a,l,g){function f(a){switch(a){case "ms":case "millisecond":return 1;case "s":case "second":return 1E3;case "m":case "minute":return 6E4;case "h":case "hour":return 36E5;case "d":case "day":return 864E5;case "w":case "week":return 6048E5;default:throw Error('"'+a+'" is not a valid unit');}}l.exports=function(a,b,d){d=d||"ms";return a*f(b)/f(d)}},{}],518:[function(a,l,g){function f(){return f.get()}f.get="function"===typeof Date.now?Date.now:function(){return+new Date}; +l.exports=f},{}],519:[function(a,l,g){var f=a("../math/countSteps");l.exports=function(a){return{milliseconds:f(a,1,1E3),seconds:f(a,1E3,60),minutes:f(a,6E4,60),hours:f(a,36E5,24),days:f(a,864E5)}}},{"../math/countSteps":394}],520:[function(a,l,g){var f=a("../math/countSteps"),k=a("../number/pad");l.exports=function(a){var b=36E5>a?0:f(a,36E5),h=6E4>a?0:f(a,6E4,60);a=1E3>a?0:f(a,1E3,60);b=""+(b?b+":":"")+(k(h,2)+":");return b+=k(a,2)}},{"../math/countSteps":394,"../number/pad":414}],521:[function(a, +l,g){var f=a("any-promise"),k;try{k=a("graceful-fs")}catch(b){k=a("fs")}l="rename ftruncate chown fchown lchown chmod fchmod stat lstat fstat link symlink readlink realpath unlink rmdir mkdir readdir close open utimes futimes fsync fdatasync write read readFile writeFile appendFile truncate".split(" ");"function"===typeof k.access&&l.push("access");"function"===typeof k.mkdtemp&&l.push("mkdtemp");a("thenify-all").withCallback(k,g,l);g.exists=function(a,d){return"function"===typeof d?k.stat(a,function(a){d(null, +!a)}):new f(function(b){k.stat(a,function(a){b(!a)})})}},{"any-promise":171,fs:1,"graceful-fs":238,"thenify-all":541}],522:[function(a,l,g){function f(a){var b=function(){if(b.called)return b.value;b.called=!0;return b.value=a.apply(this,arguments)};b.called=!1;return b}function k(a){var b=function(){if(b.called)throw Error(b.onceError);b.called=!0;return b.value=a.apply(this,arguments)};b.onceError=(a.name||"Function wrapped with `once`")+" shouldn't be called more than once";b.called=!1;return b} +a=a("wrappy");l.exports=a(f);l.exports.strict=a(k);f.proto=f(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return f(this)},configurable:!0});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return k(this)},configurable:!0})})},{wrappy:545}],523:[function(a,l,g){(function(a){function f(a){return"/"===a.charAt(0)}function b(a){a=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(a);var b=a[1]||"",b=!(!b||":"===b.charAt(1)); +return!(!a[2]&&!b)}l.exports="win32"===a.platform?b:f;l.exports.posix=f;l.exports.win32=b}).call(this,a("_process"))},{_process:124}],524:[function(a,l,g){l.exports=function(a){if("string"!==typeof a)throw new TypeError("Expected a string, got "+typeof a);a=a.trim();return/^\.*\/|^(?!localhost)\w+:/.test(a)?a:a.replace(/^(?!(?:\w+:)?\/\/)/,"http://")}},{}],525:[function(a,l,g){(function(f){function g(a){"unlink chmod stat lstat rmdir readdir".split(" ").forEach(function(b){a[b]=a[b]||q[b];b+="Sync"; +a[b]=a[b]||q[b]});a.maxBusyTries=a.maxBusyTries||3;a.emfileWait=a.emfileWait||1E3;!1===a.glob&&(a.disableGlob=!0);a.disableGlob=a.disableGlob||!1;a.glob=a.glob||u}function b(a,b,c){function e(a,e){if(a)return c(a);k=e.length;if(0===k)return c();e.forEach(function(a){d(a,b,function I(e){if(e){if(("EBUSY"===e.code||"ENOTEMPTY"===e.code||"EPERM"===e.code)&&fc&&(c=Math.max(0,c+a.length));return a[c]}var h=a("./util.js"),g=h.canEvaluate;c.prototype.call=function(a){for(var c=arguments.length,e=Array(c-1),f=1;fc.length?c:c.substr(0,38)+"...";return"(<"+a+">, no stack trace)"}function g(a){if(a=a.match(A))return{fileName:a[1],line:parseInt(a[2],10)}}var k=d("./async.js"),l=d("./util.js"),m=/[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/,y=null,u=null,v=!1,w;l.inherits(c,Error);c.prototype.uncycle=function(){var a=this._length;if(!(2>a)){for(var c=[],d={},e=0,a=this;void 0!==a;++e)c.push(a),a=a._parent;a=this._length=e;for(e=a-1;0<=e;--e){var f=c[e].stack;void 0===d[f]&& +(d[f]=e)}for(e=0;eh||0>k||!l||!n||l!==n||h>=k||(C=function(a){return m.test(a)?!0:(a=g(a))&&a.fileName===l&&h<=a.line&&a.line<=k?!0:!1})}};var z=function(){var a=/^\s*at\s*/,c=function(a, +c){return"string"===typeof a?a:void 0!==c.name&&void 0!==c.message?c.toString():h(c)};if("number"===typeof Error.stackTraceLimit&&"function"===typeof Error.captureStackTrace){Error.stackTraceLimit+=6;y=a;u=c;var d=Error.captureStackTrace;C=function(a){return m.test(a)};return function(a,c){Error.stackTraceLimit+=6;d(a,c);Error.stackTraceLimit-=6}}var e=Error();if("string"===typeof e.stack&&0<=e.stack.split("\n")[0].indexOf("stackDetection@"))return y=/@/,u=c,v=!0,function(a){a.stack=Error().stack}; +var f;try{throw Error();}catch(D){f="stack"in D}if(!("stack"in e)&&f&&"number"===typeof Error.stackTraceLimit)return y=a,u=c,function(a){Error.stackTraceLimit+=6;try{throw Error();}catch(I){a.stack=I.stack}Error.stackTraceLimit-=6};u=function(a,c){return"string"===typeof a?a:"object"!==typeof c&&"function"!==typeof c||void 0===c.name||void 0===c.message?h(c):c.toString()};return null}([]),G,F=function(){if(l.isNode)return function(c,d,e){return"rejectionHandled"===c?a.emit(c,e):a.emit(c,d,e)};var c= +!1,d=!0;try{c=new self.CustomEvent("test")instanceof CustomEvent}catch(K){}if(!c)try{var e=document.createEvent("CustomEvent");e.initCustomEvent("testingtheevent",!1,!0,{});self.dispatchEvent(e)}catch(K){d=!1}d&&(G=function(a,d){var e;c?e=new self.CustomEvent(a,{detail:d,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(e=document.createEvent("CustomEvent"),e.initCustomEvent(a,!1,!0,d));return e?!self.dispatchEvent(e):!1});var f={unhandledRejection:"onunhandledrejection",rejectionHandled:"onrejectionhandled"}; +return function(a,c,d){var e=self[f[a]];if(!e)return!1;"rejectionHandled"===a?e.call(self,d):e.call(self,c,d);return!0}}();"undefined"!==typeof console&&"undefined"!==typeof console.warn&&(w=function(a){console.warn(a)},l.isNode&&a.stderr.isTTY?w=function(c){a.stderr.write("\u001b[31m"+c+"\u001b[39m\n")}:l.isNode||"string"!==typeof Error().stack||(w=function(a){console.warn("%c"+a,"color: red")}));return c}},{"./async.js":2,"./util.js":38}],8:[function(a,f,g){f.exports=function(c){function d(a,c, +d){this._instances=a;this._callback=c;this._promise=d}var f=a("./util.js"),h=a("./errors.js"),g=f.tryCatch,k=f.errorObj,l=a("./es5.js").keys,m=h.TypeError;d.prototype.doFilter=function(a){for(var d=this._callback,e=this._promise._boundValue(),f=0,h=this._instances.length;f=k){e[d]=a;this._queue.push(d);return}null!==g&&(g[d]=a);var l=this._callback,m=this._promise._boundValue();this._promise._pushContext();l=t(l).call(m,a,d,f);this._promise._popContext();if(l===C)return this._reject(l.e);m=h(l,this._promise);if(m instanceof +c){m=m._target();if(m._isPending())return 1<=k&&this._inFlight++,e[d]=A,m._proxyPromiseArray(this,d);if(m._isFulfilled())l=m._value();else return this._reject(m._reason())}e[d]=l}++this._totalResolved>=f&&(null!==g?this._filter(e,g):this._resolve(e))};e.prototype._drainQueue=function(){for(var a=this._queue,c=this._limit,d=this._values;0=this._length&&this._resolve(this._values)};g.prototype._promiseRejected=function(a,c){this._totalResolved++;this._reject(a)};g.prototype.shouldCopyValues=function(){return!0};g.prototype.getActualLength=function(a){return a};return g}},{"./util.js":38}],25:[function(a,f,g){function c(a){return function(c,e){if(null!==a){if(c){var f;f=h(c);var g;if(f instanceof +Error&&m.getPrototypeOf(f)===Error.prototype){g=new l(f);g.name=f.name;g.message=f.message;g.stack=f.stack;for(var k=m.keys(f),n=0;narguments.length?l:c,void 0,a);m.copyDescriptors(a,d,e);return d};c.promisifyAll=function(a,c){if("function"!==typeof a&&"object"!==typeof a)throw new A("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");c=Object(c);var d=c.suffix;"string"!==typeof d&&(d="Async");var e=c.filter;"function"!==typeof e&&(e=F);var f=c.promisifier;"function"!==typeof f&&(f=E);if(!m.isIdentifier(d))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n"); +for(var h=m.inheritedDataKeys(a),g=0;g=this._length){for(var d={},e=this.length(),f=0,h=this.length();f>1};c.prototype.props=function(){return g(this)};c.props=function(a){return g(a)}}},{"./es5.js":14,"./util.js":38}],28:[function(a,f,g){function c(a){this._capacity=a;this._front=this._length=0}c.prototype._willBeOverCapacity=function(a){return this._capacity=this._length&&this._resolve(this._values)};e.prototype._promiseFulfilled=function(a,c){var d=new f;d._bitField=268435456;d._settledValue=a;this._promiseResolved(c,d)};e.prototype._promiseRejected=function(a,c){var d=new f;d._bitField=134217728;d._settledValue=a;this._promiseResolved(c,d)};c.settle=function(a){return(new e(a)).promise()};c.prototype.settle=function(){return(new e(this)).promise()}}},{"./util.js":38}], +33:[function(a,f,g){f.exports=function(c,d,f){function e(a){this.constructor$(a);this._howMany=0;this._initialized=this._unwrap=!1}function h(a,c){if((c|0)!==c||0>c)return f("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var d=new e(a),h=d.promise();d.setHowMany(c);d.init();return h}var g=a("./util.js"),k=a("./errors.js").RangeError,l=a("./errors.js").AggregateError,m=g.isArray;g.inherits(e,d);e.prototype._init=function(){if(this._initialized)if(0===this._howMany)this._resolve([]); +else{this._init$(void 0,-5);var a=m(this._values);!this._isResolved()&&a&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}};e.prototype.init=function(){this._initialized=!0;this._init()};e.prototype.setUnwrap=function(){this._unwrap=!0};e.prototype.howMany=function(){return this._howMany};e.prototype.setHowMany=function(a){this._howMany=a};e.prototype._promiseFulfilled=function(a){this._addFulfilled(a);this._fulfilled()===this.howMany()&&(this._values.length= +this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values))};e.prototype._promiseRejected=function(a){this._addRejected(a);if(this.howMany()>this._canPossiblyFulfill()){a=new l;for(var c=this.length();c=k)return l.resolve();var m;m=a[h++];var n=f(m);n!==m&&"function"===typeof m._isDisposable&&"function"===typeof m._getDisposer&&m._isDisposable()&&n._setDisposable(m._getDisposer());m=n;if(m instanceof c&&m._isDisposable()){try{m=f(m._getDisposer().tryDispose(d), +a.promise)}catch(I){return g(I)}if(m instanceof c)return m._then(e,g,null,null,null)}e()}var h=0,k=a.length,l=c.defer();e();return l.promise}function l(a){var c=new z;c._settledValue=a;c._bitField=268435456;return k(this,c).thenReturn(a)}function m(a){var c=new z;c._settledValue=a;c._bitField=134217728;return k(this,c).thenThrow(a)}function n(a,c,d){this._data=a;this._promise=c;this._context=d}function t(a,c,d){this.constructor$(a,c,d)}function w(a){return n.isDisposer(a)?(this.resources[this.index]._setDisposable(a), +a.promise()):a}var C=a("./errors.js").TypeError,A=a("./util.js").inherits,z=c.PromiseInspection;n.prototype.data=function(){return this._data};n.prototype.promise=function(){return this._promise};n.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null};n.prototype.tryDispose=function(a){var c=this.resource(),d=this._context;void 0!==d&&d._pushContext();a=null!==c?this.doDispose(c,a):null;void 0!==d&&d._popContext();this._promise._unsetDisposable();this._data= +null;return a};n.isDisposer=function(a){return null!=a&&"function"===typeof a.resource&&"function"===typeof a.tryDispose};A(t,n);t.prototype.doDispose=function(a,c){return this.data().call(a,a,c)};c.using=function(){var a=arguments.length;if(2>a)return d("you must pass at least 2 arguments to Promise.using");var h=arguments[a-1];if("function"!==typeof h)return d("fn must be a function\n\n See http://goo.gl/916lJJ\n");var g,k=!0;2===a&&Array.isArray(arguments[0])?(g=arguments[0],a=g.length,k=!1): +(g=arguments,a--);for(var p=Array(a),q=0;qthis._remaining&&(a=a.slice(0,this._remaining));this._remaining-=a.length;var b=this._queueLen;this._queue.push(a);this._queueLen++;this._read();return this._paused||0=this._queueLen&&(this._queue.length= +this._queueLen=this._index=0,this._needDrain&&(this._needDrain=!1,this.emit("drain")),this._ending&&(this._ended=!0,this.emit("end")));a=this._maxQueueLen;this._queueLen>a&&0=Math.pow(10,b)&&(b+=1);d=b+a.length;e=new f(""+d);if(e.length+a.length!==d)throw Error("Bad length calculation\nlen="+d+"\nlenBuf="+JSON.stringify(e.toString())+"\nlenBuf.length="+e.length+"\ndigits="+ +b+"\ns="+JSON.stringify(a.toString())+"\ns.length="+a.length);return[e,a]}l.exports=g;var h=a("inherits"),m=a("./entry-writer.js");h(g,m);var c=a("../tar.js"),e=a("path"),n=a("./header.js");g.prototype.end=function(){var a=this;a._ended||(a._ended=!0,a._encodeFields(),0===a.props.size?(a._ready=!0,a._stream.end()):(a._stream.write(n.encode(a.props)),a.body.forEach(function(b){a._stream.write(b)}),a._ready=!0,this._stream.end()))};g.prototype._encodeFields=function(){this.body=[];this.fields.prefix&& +(this.fields.path=this.fields.prefix+"/"+this.fields.path,this.fields.prefix="");b(this.fields,"",this.body,this.fields.noProprietary);var a=this;this.body.forEach(function(b){a.props.size+=b.length})}}).call(this,a("buffer").Buffer)},{"../tar.js":540,"./entry-writer.js":531,"./header.js":537,buffer:49,inherits:243,path:120}],534:[function(a,l,g){(function(f){function g(){d.apply(this,arguments);this.on("data",this._parse);this.fields={};this._fieldPos=this._position=0;this._state=n;this._sizeBuf= +[];this._keyBuf=[];this._valBuf=[];this._size=-1;this._key=""}function b(a,b){b="invalid header: "+b+"\nposition="+a._position+"\nfield position="+a._fieldPos;a.error(b);a.state=p}l.exports=g;var d=a("./entry.js"),h=a("inherits"),m=a("../tar.js").numeric,c={"SCHILY.dev":"dev","SCHILY.ino":"ino","SCHILY.nlink":"nlink"};h(g,d);g.prototype._parse=function(a){if(this._state!==p)for(var d=0,e=a.length;dthis._size){b(this, +"field exceeds length="+this._size);break}switch(this._state){case p:return;case n:if(h===y){this._state=t;this._size=parseInt((new f(this._sizeBuf)).toString(),10);this._sizeBuf.length=0;continue}if(hq){b(this,"expected ["+B+".."+q+"], got "+h);return}this._sizeBuf.push(h);continue;case t:if(h===u){this._state=r;this._key=(new f(this._keyBuf)).toString();c[this._key]&&(this._key=c[this._key]);this._keyBuf.length=0;continue}this._keyBuf.push(h);continue;case r:if(this._fieldPos===this._size- +1){if(h!==v){b(this,"expected \\n at end of field");return}h=(new f(this._valBuf)).toString();m[this._key]&&(h=parseFloat(h));this.fields[this._key]=h;this._valBuf.length=0;this._state=n;this._fieldPos=this._size=-1}else this._valBuf.push(h)}}};var h=0,e=g.states={},n=e.SIZE=h++,t=e.KEY=h++,r=e.VAL=h++,p=e.ERR=h++;Object.keys(e).forEach(function(a){e[e[a]]=e[a]});e[h]=null;var B=48,q=57,y=32,u=61,v=10}).call(this,a("buffer").Buffer)},{"../tar.js":540,"./entry.js":532,buffer:49,inherits:243}],535:[function(a, +l,g){function f(a){if(!(this instanceof f))return new f(a);k.Parse.apply(this);"object"!==typeof a&&(a={path:a});a.path=a.path||d.resolve("node-tar-extract");a.type="Directory";a.Directory=!0;a.strip=+a.strip;if(!a.strip||0>=a.strip)a.strip=0;this._fst=b.Writer(a);this.pause();var h=this;h.on("entry",function(b){if(a.strip){var c=b.path.split("/").slice(a.strip).join("/");b.path=b.props.path=c;b.linkpath&&(c=b.linkpath.split("/").slice(a.strip).join("/"),b.linkpath=b.props.linkpath=c)}"Link"===b.type&& +(b.linkpath=b.props.linkpath=d.join(a.path,d.join("/",b.props.linkpath)));if("SymbolicLink"===b.type){var c=d.dirname(b.path)||"",f=b.props.linkpath;0!==d.resolve(a.path,c,f).indexOf(a.path)&&(f=d.join(a.path,d.join("/",f)));b.linkpath=b.props.linkpath=f}});this._fst.on("ready",function(){h.pipe(h._fst,{end:!1});h.resume()});this._fst.on("error",function(a){h.emit("error",a)});this._fst.on("drain",function(){h.emit("drain")});this._fst.on("close",function(){h.emit("finish");h.emit("end");h.emit("close")})} +l.exports=f;var k=a("../tar.js"),b=a("fstream");l=a("inherits");var d=a("path");l(f,k.Parse);f.prototype._streamEnd=function(){this._ended&&!this._entry||this.error("unexpected eof");this._fst.end()}},{"../tar.js":540,fstream:215,inherits:243,path:120}],536:[function(a,l,g){function f(a){if(!(this instanceof f))return new f(a);k.call(this,a);this.props.type="g"}l.exports=f;var k=a("./extended-header-writer.js");a("inherits")(f,k)},{"./extended-header-writer.js":533,inherits:243}],537:[function(a, +l,g){(function(f,g){function b(a){if(!(this instanceof b))return new b(a);a&&this.decode(a)}function d(a){if(!(a||this instanceof b))throw Error("encode must be called on a TarHeader, or supplied an object");a=a||this;var d=a.block=new g(512);a.prefix&&(a.path=a.prefix+"/"+a.path,a.prefix="");a.needExtended=!1;a.mode&&("string"===typeof a.mode&&(a.mode=parseInt(a.mode,8)),a.mode&=511);for(var e=0;null!==r[e];e++){var f=r[e],l=p[e],m=B[e],n;switch(f){case "cksum":break;case "prefix":break;case "type":f= +a.type||"0";1u&&n<=u+w){n=n-1-u;for(var u=!1,C=new g(a.path);n<=w;n++)if(47===C[n]||C[n]===v){u=n;break}if(!1!==u){prefix=C.slice(0,u).toString("utf8");path=C.slice(u+1).toString("utf8");n=k(d,l,m,path);l=p[r.prefix];m=B[r.prefix];n=k(d,l,m,prefix)||n;break}}k(d,p[r.prefix],B[r.prefix],"");default:n=y[f]?h(d,l,m,a[f]):k(d,l,m,a[f]||"")}a.needExtended=a.needExtended||n}l= +p[r.cksum];m=B[r.cksum];h(d,l,m,c.call(this,d));return d}function h(a,b,c,d){var e=c-b,f=w[e]||0;d=d||0;if(d instanceof Date||"[object Date]"===Object.prototype.toString.call(d))d=d.getTime()/1E3;if(d>f||0>d){a=a.slice(b,c);b=0<=d;a[0]=b?128:255;b||(d*=-1);c=[];do e=d%256,c.push(e),d=(d-e)/256;while(d);d=c.length;e=a.length-d;for(f=1;ff;0e;e++)b+=a[e];return b}function e(a){a=a||this.block;u(g.isBuffer(a)&&512===a.length);this.block=a;this.cksumValid=this.checkSum();for(var b=null,c=0;null!==r[c];c++){var d=r[c],e=a.slice(p[c],B[c]);switch(d){case "ustar":if("ustar\x00"!==e.toString()){this.ustar=!1;return}this.ustar=e.toString();break;case "prefix":b=n(e.slice(131,143));d=n(e.slice(143,155));0!==e[130]&&32!==e[130]||"number"!==typeof b||"number"!==typeof d||32!==e[143]||32!==e[155]||(this.atime=b,this.ctime=d,e=e.slice(0, +130));b=e.toString("utf8").replace(/\0+$/,"");break;default:this[d]=y[d]?n(e):e.toString("utf8").replace(/\0+$/,"")}}b&&(this.path=b+"/"+this.path)}function n(a){if(a[0]&128){var b;a:{if(128===a[0])b=!0;else if(255===a[0])b=!1;else{b=null;break a}for(var c=!1,d=[],e=a.length-1;0r;r++)t[r]=0;c(b,h);b.prototype.addGlobal=function(a){if(!this._didGlobal){this._didGlobal=!0;var b=this;e(a).on("data",function(a){b.emit("data",a)}).end()}};b.prototype.add=function(a){this._global&&!this._didGlobal&&this.addGlobal(this._global);if(this._ended)return this.emit("error",Error("add after end"));n(a);this._buffer.push(a);this._process();this._needDrain=0c;b++){if(0!==a[b])return this.error("write() after end()")}else return this._stream.write(a)};f.prototype.end=function(a){this._ended=!0;return this._stream.end(a)};f.prototype._read=function(){};f.prototype._process=function(a){n(a&&512===a.length,"block size should be 512");if(this._entry){var b=this._entry;b._abort?(b._remaining-=a.length,0>b._remaining&&(b._remaining=0)):b.write(a);0===b._remaining&&(b.end(),this._entry=null)}else{for(var b= +!0,c=0;512>c&&b;c++)b=0===a[c];b?(this._eofStarted&&(this._ended=!0),this._eofStarted=!0):(this._eofStarted=!1,this._startEntry(a))}this.position+=512};f.prototype._startEntry=function(a){a=new h(a);var b=this,f,g,k,l,n=!1;if(null===a.size||!a.cksumValid)return l=Error("invalid tar file"),l.header=a,l.tar_file_offset=this.position,l.tar_block=this.position/512,this.emit("error",l);switch(d.types[a.type]){case "File":case "OldFile":case "Link":case "SymbolicLink":case "CharacterDevice":case "BlockDevice":case "Directory":case "FIFO":case "ContiguousFile":case "GNUDumpDir":k= +m;g="entry";break;case "GlobalExtendedHeader":k=e;l=function(){b._global=b._global||{};Object.keys(f.fields).forEach(function(a){b._global[a]=f.fields[a]})};g="globalExtendedHeader";n=!0;break;case "ExtendedHeader":case "OldExtendedHeader":k=e;l=function(){b._extended=f.fields};g="extendedHeader";n=!0;break;case "NextFileHasLongLinkpath":k=c;l=function(){b._extended=b._extended||{};b._extended.linkpath=f.body};g="longLinkpath";n=!0;break;case "NextFileHasLongPath":case "OldGnuLongPath":k=c;l=function(){b._extended= +b._extended||{};b._extended.path=f.body};g="longPath";n=!0;break;default:k=m,g="ignoredEntry"}var t,w;n?t=w=null:(t=this._global,w=this._extended,this._extended=null);f=new k(a,w,t);f.meta=n;if(!n)f.on("data",function(a){C.emit("data",a)});if(l)f.on("end",l);this._entry=f;var C=this;f.on("pause",function(){C.pause()});f.on("resume",function(){C.resume()});this.listeners("*").length&&this.emit("*",g,f);this.emit(g,f);0===f.props.size&&(f.end(),this._entry=null)}},{"../tar.js":540,"./buffer-entry.js":530, +"./entry.js":532,"./extended-header.js":534,"./header.js":537,assert:16,"block-stream":176,fstream:215,inherits:243,stream:156}],540:[function(a,l,g){l=0;var f={},k=f.path=l++,b=f.mode=l++,d=f.uid=l++,h=f.gid=l++,m=f.size=l++,c=f.mtime=l++,e=f.cksum=l++,n=f.type=l++,t=f.linkpath=l++,r=[];r[k]=100;r[b]=8;r[d]=8;r[h]=8;r[m]=12;r[c]=12;r[e]=8;r[n]=1;r[t]=100;k=f.ustar=l++;b=f.ustarver=l++;d=f.uname=l++;h=f.gname=l++;m=f.devmaj=l++;c=f.devmin=l++;e=f.prefix=l++;n=f.fill=l++;f[l]=null;r[k]=6;r[b]=2;r[d]= +32;r[h]=32;r[m]=8;r[c]=8;r[e]=155;r[n]=12;k={};b={};for(h=d=0;ht`(Nw7(SP%&fkG$>CY5IWclmGi-|WBe zf6@OE|JD9m)SxKvU19pu;=jdzbD#nd5d5aP3`N0wm)v%X^_EZt5^D@weEd)pOcm-o z*Sp3q#Qc-!FWm&ojiwKRgwdQi$)o3g|ErdC$7r+X#{XR%uz9q;=YRKKBcLa3i?9Y1 zFsS!~0?K@^Cl?L{(^Na(8hvv$z#$C+O$D~$s3HKrMQ!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP(nJu zC&cyt|NrJ@=1UnEF3KzXpIA`E!0`X~|E`WMpnT7&XcT0wO64OpdCm3TIcm$yuUx;6TQt zq%|rB6jI*gtPwe(kdvdqvV^7gC|4+} examples/example_dapp_uploader/swarm.min.js", + "minify": "ccjs examples/example_dapp_uploader/swarm.min.js > examples/example_dapp_uploader/swarm.min.js_; mv examples/example_dapp_uploader/swarm.min.js_ examples/example_dapp_uploader/swarm.min.js", + "build": "npm run bundle; npm run minify", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "MaiaVictor", "license": "MIT", "dependencies": { "bluebird": "^3.4.7", + "buffer": "^5.0.5", "fs-promise": "^2.0.0", "got": "^6.7.1", "mimetype": "0.0.8", "mkdirp-promise": "^5.0.1", + "mock-fs": "^4.1.0", + "setimmediate": "^1.0.5", "tar.gz": "^1.0.5" } } diff --git a/files.js b/src/files.js similarity index 100% rename from files.js rename to src/files.js diff --git a/src/pick.js b/src/pick.js new file mode 100644 index 0000000..ba6a5a7 --- /dev/null +++ b/src/pick.js @@ -0,0 +1,50 @@ +picker = pickDirectory => () => new Promise((resolve, reject) => { + const fileLoader = e => { + const directory = {}; + const totalFiles = e.target.files.length; + let loadedFiles = 0; + [].map.call(e.target.files, file => { + const reader = new FileReader(); + reader.onload = e => { + const data = new Buffer(e.target.result); + if (pickDirectory) { + const path = file.webkitRelativePath; + directory[path.slice(path.indexOf("/")+1)] = { + type: "text/plain", + data: data + }; + if (++loadedFiles === totalFiles) + resolve(directory); + } else { + resolve(data); + } + }; + reader.readAsArrayBuffer(file); + }); + }; + + let fileInput; + if (pickDirectory) { + fileInput = document.createElement("input"); + fileInput.addEventListener("change", fileLoader); + fileInput.type = "file"; + fileInput.webkitdirectory = true; + fileInput.mozdirectory = true; + fileInput.msdirectory = true; + fileInput.odirectory = true; + fileInput.directory = true; + } else { + fileInput = document.createElement("input"); + fileInput.addEventListener("change", fileLoader); + fileInput.type = "file"; + }; + + const mouseEvent = document.createEvent("MouseEvents"); + mouseEvent.initEvent("click", true, false); + fileInput.dispatchEvent(mouseEvent); +}); + +module.exports = { + file: picker(false), + directory: picker(true) +} diff --git a/swarm.js b/src/swarm.js similarity index 94% rename from swarm.js rename to src/swarm.js index 48ba058..7b8f6e1 100644 --- a/swarm.js +++ b/src/swarm.js @@ -6,6 +6,7 @@ const got = require("got"); const mimetype = require('mimetype'); const path = require("path"); const {spawn} = require("child_process"); +const pick = require("./pick.js"); // ∀ a . String -> JSON -> Map String a -o Map String a // Inserts a key/val pair in an object impurely. @@ -131,7 +132,8 @@ const uploadData = swarmUrl => data => // error 404 (bad request), so we retry up to 3 times. Why? const uploadToManifest = swarmUrl => hash => route => file => { const attempt = n => { - const url = `${swarmUrl}/bzz:/${hash}${route}`; + const slashRoute = route[0] === "/" ? route : "/" + route; + const url = `${swarmUrl}/bzz:/${hash}${slashRoute}`; const opt = { "headers": {"content-type": file.type}, "body": file.data}; @@ -170,12 +172,20 @@ const uploadDirectoryFromDisk = swarmUrl => defaultPath => dirPath => .then(directory => merge (defaultPath ? {"": directory[defaultPath]} : {}) (directory)) .then(uploadDirectory(swarmUrl)); -// String -> Buffer | Map String Buffer | String -> Nullable String -> Promise String -// Simplified multi-type upload which calls the correct one based on the -// type of the argument given. +// String -> Buffer | Bool | Map String Buffer | String -> Nullable String -> Promise String +// Simplified multi-type upload which calls the correct +// one based on the type of the argument given. const upload = swarmUrl => pathOrContents => defaultFile => { + // Upload a file from browser + if (!pathOrContents) { + return pick.file().then(uploadData(swarmUrl)); + + // Upload a directory from browser + } else if (pathOrContents === true) { + return pick.directory().then(uploadDirectory(swarmUrl)); + // Upload raw data (buffer) - if (pathOrContents instanceof Buffer) { + } else if (pathOrContents.length) { return uploadData(swarmUrl)(pathOrContents); // Upload directory with JSON @@ -355,8 +365,8 @@ const at = swarmUrl => ({ downloadDataToDisk: uncurry(downloadDataToDisk(swarmUrl)), downloadDirectory: uncurry(downloadDirectory(swarmUrl)), downloadDirectoryToDisk: uncurry(downloadDirectoryToDisk(swarmUrl)), - downloadRoutes: uncurry(downloadRoutes(swarmUrl)), downloadEntries: uncurry(downloadEntries(swarmUrl)), + downloadRoutes: uncurry(downloadRoutes(swarmUrl)), isAvailable: () => isAvailable(swarmUrl), upload: (pathOrContents,defaultFile) => upload(swarmUrl)(pathOrContents)(defaultFile), uploadData: uncurry(uploadData(swarmUrl)), @@ -364,20 +374,21 @@ const at = swarmUrl => ({ uploadDirectory: uncurry(uploadDirectory(swarmUrl)), uploadDirectoryFromDisk: uncurry(uploadDirectoryFromDisk(swarmUrl)), uploadToManifest: uncurry(uploadToManifest(swarmUrl)), + pick: pick, }); module.exports = { at, + local, download, downloadBinary, downloadData, downloadDataToDisk, downloadDirectory, downloadDirectoryToDisk, - downloadRoutes, downloadEntries, + downloadRoutes, isAvailable, - local, startProcess, stopProcess, upload, @@ -386,4 +397,16 @@ module.exports = { uploadDirectory, uploadDirectoryFromDisk, uploadToManifest, + pick, +}; + +if (typeof window !== "undefined") { + const loadLibs = () => { + Swarm = module.exports; + require("setimmediate"); + window.Buffer = require("buffer/").Buffer + window.pick = pick; + }; + loadLibs(); + setTimeout(loadLibs, 0); };