tool-db 2.5.4 → 2.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/messageHandlers/handleFunction.d.ts +2 -0
- package/dist/messageHandlers/handleFunction.js +56 -0
- package/dist/messageHandlers/handleFunction.js.map +1 -0
- package/dist/toolDbClientOnMessage.js +3 -0
- package/dist/toolDbClientOnMessage.js.map +1 -1
- package/dist/toolDbFunction.d.ts +9 -0
- package/dist/toolDbFunction.js +38 -0
- package/dist/toolDbFunction.js.map +1 -0
- package/dist/tooldb.d.ts +16 -1
- package/dist/tooldb.js +24 -0
- package/dist/tooldb.js.map +1 -1
- package/dist/types/message.d.ts +13 -3
- package/dist/types/message.js.map +1 -1
- package/dist/types/tooldb.d.ts +26 -0
- package/lib/index.ts +1 -0
- package/lib/messageHandlers/handleFunction.ts +59 -0
- package/lib/toolDbClientOnMessage.ts +4 -0
- package/lib/toolDbFunction.ts +49 -0
- package/lib/tooldb.ts +30 -3
- package/lib/types/message.ts +22 -1
- package/lib/types/tooldb.ts +43 -1
- package/package.json +2 -2
package/bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).tooldb=e()}(function(){return function i(n,o,s){function a(t,e){if(!o[t]){if(!n[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(f)return f(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=o[t]={exports:{}},n[t][0].call(r.exports,function(e){return a(n[t][1][e]||e)},r,r.exports,i,n,o,s)}return o[t].exports}for(var f="function"==typeof require&&require,e=0;e<s.length;e++)a(s[e]);return a}({1:[function(e,t,r){"use strict";const i=r;i.bignum=e("bn.js"),i.define=e("./asn1/api").define,i.base=e("./asn1/base"),i.constants=e("./asn1/constants"),i.decoders=e("./asn1/decoders"),i.encoders=e("./asn1/encoders")},{"./asn1/api":2,"./asn1/base":4,"./asn1/constants":8,"./asn1/decoders":10,"./asn1/encoders":13,"bn.js":16}],2:[function(e,t,r){"use strict";const i=e("./encoders"),n=e("./decoders"),o=e("inherits"),s=r;function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}s.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(r){const t=this.name;function e(e){this._initNamed(e,t)}return o(e,r),e.prototype._initNamed=function(e,t){r.call(this,e,t)},new e(this)},a.prototype._getDecoder=function(e){return this.decoders.hasOwnProperty(e=e||"der")||(this.decoders[e]=this._createNamed(n[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return this.encoders.hasOwnProperty(e=e||"der")||(this.encoders[e]=this._createNamed(i[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},{"./decoders":10,"./encoders":13,inherits:102}],3:[function(e,t,r){"use strict";const i=e("inherits"),n=e("../base/reporter").Reporter,o=e("safer-buffer").Buffer;function s(e,t){n.call(this,t),o.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function a(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return a.isEncoderBuffer(e)||(e=new a(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}i(s,n),(r.DecoderBuffer=s).isDecoderBuffer=function(e){return e instanceof s||"object"==typeof e&&o.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},s.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},s.prototype.restore=function(e){const t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,n.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},s.prototype.raw=function(e){return this.base.slice((e||this).offset,this.length)},(r.EncoderBuffer=a).isEncoderBuffer=function(e){return e instanceof a||"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},a.prototype.join=function(t,r){return t=t||o.alloc(this.length),r=r||0,0!==this.length&&(Array.isArray(this.value)?this.value.forEach(function(e){e.join(t,r),r+=e.length}):("number"==typeof this.value?t[r]=this.value:"string"==typeof this.value?t.write(this.value,r):o.isBuffer(this.value)&&this.value.copy(t,r),r+=this.length)),t}},{"../base/reporter":6,inherits:102,"safer-buffer":144}],4:[function(e,t,r){"use strict";const i=r;i.Reporter=e("./reporter").Reporter,i.DecoderBuffer=e("./buffer").DecoderBuffer,i.EncoderBuffer=e("./buffer").EncoderBuffer,i.Node=e("./node")},{"./buffer":3,"./node":5,"./reporter":6}],5:[function(e,t,r){"use strict";const h=e("../base/reporter").Reporter,i=e("../base/buffer").EncoderBuffer,u=e("../base/buffer").DecoderBuffer,n=e("minimalistic-assert"),o=["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"],s=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);function a(e,t,r){const i={};(this._baseState=i).name=r,i.enc=e,i.parent=t||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}t.exports=a;const f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];a.prototype.clone=function(){const t=this._baseState,r={},e=(f.forEach(function(e){r[e]=t[e]}),new this.constructor(r.parent));return e._baseState=r,e},a.prototype._wrap=function(){const r=this._baseState;s.forEach(function(t){this[t]=function(){const e=new this.constructor(this);return r.children.push(e),e[t].apply(e,arguments)}},this)},a.prototype._init=function(e){const t=this._baseState;n(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),n.equal(t.children.length,1,"Root node can have only one child")},a.prototype._useArgs=function(e){const t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(n(null===t.children),(t.children=r).forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(n(null===t.args),t.args=e,t.reverseArgs=e.map(function(r){if("object"!=typeof r||r.constructor!==Object)return r;const i={};return Object.keys(r).forEach(function(e){e==(0|e)&&(e|=0);var t=r[e];i[t]=e}),i}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(t){a.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}}),o.forEach(function(r){a.prototype[r]=function(){const e=this._baseState;var t=Array.prototype.slice.call(arguments);return n(null===e.tag),e.tag=r,this._useArgs(t),this}}),a.prototype.use=function(e){n(e);const t=this._baseState;return n(null===t.use),t.use=e,this},a.prototype.optional=function(){const e=this._baseState;return e.optional=!0,this},a.prototype.def=function(e){const t=this._baseState;return n(null===t.default),t.default=e,t.optional=!0,this},a.prototype.explicit=function(e){const t=this._baseState;return n(null===t.explicit&&null===t.implicit),t.explicit=e,this},a.prototype.implicit=function(e){const t=this._baseState;return n(null===t.explicit&&null===t.implicit),t.implicit=e,this},a.prototype.obj=function(){const e=this._baseState;var t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},a.prototype.key=function(e){const t=this._baseState;return n(null===t.key),t.key=e,this},a.prototype.any=function(){const e=this._baseState;return e.any=!0,this},a.prototype.choice=function(t){const e=this._baseState;return n(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map(function(e){return t[e]})),this},a.prototype.contains=function(e){const t=this._baseState;return n(null===t.use),t.contains=e,this},a.prototype._decode=function(t,r){const i=this._baseState;if(null===i.parent)return t.wrapResult(i.children[0]._decode(t,r));let n=i.default,o=!0,e=null;if(null!==i.key&&(e=t.enterKey(i.key)),i.optional){let e=null;if(null!==i.explicit?e=i.explicit:null!==i.implicit?e=i.implicit:null!==i.tag&&(e=i.tag),null!==e||i.any){if(o=this._peekTag(t,e,i.any),t.isError(o))return o}else{var s=t.save();try{null===i.choice?this._decodeGeneric(i.tag,t,r):this._decodeChoice(t,r),o=!0}catch(e){o=!1}t.restore(s)}}let a;if(i.obj&&o&&(a=t.enterObject()),o){if(null!==i.explicit){s=this._decodeTag(t,i.explicit);if(t.isError(s))return s;t=s}s=t.offset;if(null===i.use&&null===i.choice){let e;i.any&&(e=t.save());var f=this._decodeTag(t,null!==i.implicit?i.implicit:i.tag,i.any);if(t.isError(f))return f;i.any?n=t.raw(e):t=f}if(r&&r.track&&null!==i.tag&&r.track(t.path(),s,t.length,"tagged"),r&&r.track&&null!==i.tag&&r.track(t.path(),t.offset,t.length,"content"),i.any||(n=null===i.choice?this._decodeGeneric(i.tag,t,r):this._decodeChoice(t,r)),t.isError(n))return n;i.any||null!==i.choice||null===i.children||i.children.forEach(function(e){e._decode(t,r)}),!i.contains||"octstr"!==i.tag&&"bitstr"!==i.tag||(f=new u(n),n=this._getUse(i.contains,t._reporterState.obj)._decode(f,r))}return i.obj&&o&&(n=t.leaveObject(a)),null===i.key||null===n&&!0!==o?null!==e&&t.exitKey(e):t.leaveKey(e,i.key,n),n},a.prototype._decodeGeneric=function(e,t,r){var i=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,i.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&i.args?this._decodeObjid(t,i.args[0],i.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},a.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),n(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},a.prototype._decodeChoice=function(n,o){const s=this._baseState;let a=null,f=!1;return Object.keys(s.choice).some(function(e){var t=n.save();const r=s.choice[e];try{var i=r._decode(n,o);if(n.isError(i))return!1;a={type:e,value:i},f=!0}catch(e){return n.restore(t),!1}return!0},this),f?a:n.error("Choice not matched")},a.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},a.prototype._encode=function(e,t,r){var i=this._baseState;if(null===i.default||i.default!==e){i=this._encodeValue(e,t,r);if(void 0!==i&&!this._skipDefault(i,t,r))return i}},a.prototype._encodeValue=function(r,i,e){const t=this._baseState;if(null===t.parent)return t.children[0]._encode(r,i||new h);let n=null;if(this.reporter=i,t.optional&&void 0===r){if(null===t.default)return;r=t.default}let o=null,s=!1;if(t.any)n=this._createEncoderBuffer(r);else if(t.choice)n=this._encodeChoice(r,i);else if(t.contains)o=this._getUse(t.contains,e)._encode(r,i),s=!0;else if(t.children)o=t.children.map(function(e){if("null_"===e._baseState.tag)return e._encode(null,i,r);if(null===e._baseState.key)return i.error("Child should have a key");var t=i.enterKey(e._baseState.key);if("object"!=typeof r)return i.error("Child expected, but input is not object");e=e._encode(r[e._baseState.key],i,r);return i.leaveKey(t),e},this).filter(function(e){return e}),o=this._createEncoderBuffer(o);else if("seqof"===t.tag||"setof"===t.tag){if(!t.args||1!==t.args.length)return i.error("Too many args for : "+t.tag);if(!Array.isArray(r))return i.error("seqof/setof, but data is not Array");const f=this.clone();f._baseState.implicit=null,o=this._createEncoderBuffer(r.map(function(e){var t=this._baseState;return this._getUse(t.args[0],r)._encode(e,i)},f))}else null!==t.use?n=this._getUse(t.use,e)._encode(r,i):(o=this._encodePrimitive(t.tag,r),s=!0);var a;return t.any||null!==t.choice||(e=null!==t.implicit?t.implicit:t.tag,a=null===t.implicit?"universal":"context",null===e?null===t.use&&i.error("Tag could be omitted only for .use()"):null===t.use&&(n=this._encodeComposite(e,s,a,o))),n=null!==t.explicit?this._encodeComposite(t.explicit,!1,"context",n):n},a.prototype._encodeChoice=function(e,t){var r=this._baseState;const i=r.choice[e.type];return i||n(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(e.value,t)},a.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},a.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},a.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},{"../base/buffer":3,"../base/reporter":6,"minimalistic-assert":105}],6:[function(e,t,r){"use strict";const i=e("inherits");function n(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}(r.Reporter=n).prototype.isError=function(e){return e instanceof o},n.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},n.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},n.prototype.enterKey=function(e){return this._reporterState.path.push(e)},n.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},n.prototype.leaveKey=function(e,t,r){const i=this._reporterState;this.exitKey(e),null!==i.obj&&(i.obj[t]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){const e=this._reporterState;var t=e.obj;return e.obj={},t},n.prototype.leaveObject=function(e){const t=this._reporterState;var r=t.obj;return t.obj=e,r},n.prototype.error=function(e){let t;const r=this._reporterState;var i=e instanceof o;if(t=i?e:new o(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),r.options.partial)return i||r.errors.push(t),t;throw t},n.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},i(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:102}],7:[function(e,t,r){"use strict";function i(r){const i={};return Object.keys(r).forEach(function(e){(0|e)==e&&(e|=0);var t=r[e];i[t]=e}),i}r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=i(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=i(r.tag)},{}],8:[function(e,t,r){"use strict";const i=r;i._reverse=function(r){const i={};return Object.keys(r).forEach(function(e){(0|e)==e&&(e|=0);var t=r[e];i[t]=e}),i},i.der=e("./der")},{"./der":7}],9:[function(e,t,r){"use strict";const i=e("inherits"),n=e("bn.js"),o=e("../base/buffer").DecoderBuffer,s=e("../base/node"),a=e("../constants/der");function f(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new h,this.tree._init(e.body)}function h(e){s.call(this,"der",e)}function u(t,r){let i=t.readUInt8(r);if(t.isError(i))return i;var e=a.tagClass[i>>6],n=0==(32&i);if(31==(31&i)){let e=i;for(i=0;128==(128&e);){if(e=t.readUInt8(r),t.isError(e))return e;i=(i<<=7)|127&e}}else i&=31;var o=a.tag[i];return{cls:e,primitive:n,tag:i,tagStr:o}}function c(t,e,r){let i=t.readUInt8(r);if(!t.isError(i)){if(!e&&128===i)return null;if(0!=(128&i)){var n=127&i;if(4<n)return t.error("length octect is too long");for(let e=i=0;e<n;e++){i<<=8;var o=t.readUInt8(r);if(t.isError(o))return o;i|=o}}}return i}(t.exports=f).prototype.decode=function(e,t){return o.isDecoderBuffer(e)||(e=new o(e,t)),this.tree._decode(e,t)},i(h,s),h.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;var i=e.save(),n=u(e,'Failed to peek tag: "'+t+'"');return e.isError(n)?n:(e.restore(i),n.tag===t||n.tagStr===t||n.tagStr+"of"===t||r)},h.prototype._decodeTag=function(e,t,r){var i=u(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;let n=c(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(n))return n;if(!r&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(!i.primitive&&null===n){r=e.save(),i=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');if(e.isError(i))return i;n=e.offset-r.offset,e.restore(r)}return e.skip(n,'Failed to match body of: "'+t+'"')},h.prototype._skipUntilEnd=function(t,r){for(;;){var i=u(t,r);if(t.isError(i))return i;var n=c(t,i.primitive,r);if(t.isError(n))return n;let e;if(e=i.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,r),t.isError(e))return e;if("end"===i.tagStr)break}},h.prototype._decodeList=function(e,t,r,i){const n=[];for(;!e.isEmpty();){var o=this._peekTag(e,"end");if(e.isError(o))return o;var s=r.decode(e,"der",i);if(e.isError(s)&&o)break;n.push(s)}return n},h.prototype._decodeStr=function(e,t){var r;if("bitstr"===t)return r=e.readUInt8(),e.isError(r)?r:{unused:r,data:e.raw()};if("bmpstr"!==t)return"numstr"===t?(r=e.raw().toString("ascii"),this._isNumstr(r)?r:e.error("Decoding of string type: numstr unsupported characters")):"octstr"===t||"objDesc"===t?e.raw():"printstr"===t?(r=e.raw().toString("ascii"),this._isPrintstr(r)?r:e.error("Decoding of string type: printstr unsupported characters")):/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported");{const i=e.raw();if(i.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let t="";for(let e=0;e<i.length/2;e++)t+=String.fromCharCode(i.readUInt16BE(2*e));return t}},h.prototype._decodeObjid=function(e,t,r){let i;const n=[];let o=0,s=0;for(;!e.isEmpty();)s=e.readUInt8(),o=(o<<=7)|127&s,0==(128&s)&&(n.push(o),o=0);128&s&&n.push(o);const a=n[0]/40|0,f=n[0]%40;if(i=r?n:[a,f].concat(n.slice(1)),t){let e=t[i.join(" ")];void 0!==(e=void 0===e?t[i.join(".")]:e)&&(i=e)}return i},h.prototype._decodeTime=function(e,t){const r=e.raw().toString();let i,n,o,s,a,f;if("gentime"===t)i=0|r.slice(0,4),n=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),f=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");i=0|r.slice(0,2),n=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),f=0|r.slice(10,12),i=i<70?2e3+i:1900+i}return Date.UTC(i,n-1,o,s,a,f,0)},h.prototype._decodeNull=function(){return null},h.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},h.prototype._decodeInt=function(e,t){e=e.raw();let r=new n(e);return r=t?t[r.toString(10)]||r:r},h.prototype._use=function(e,t){return(e="function"==typeof e?e(t):e)._getDecoder("der").tree}},{"../base/buffer":3,"../base/node":5,"../constants/der":7,"bn.js":16,inherits:102}],10:[function(e,t,r){"use strict";const i=r;i.der=e("./der"),i.pem=e("./pem")},{"./der":9,"./pem":11}],11:[function(e,t,r){"use strict";const i=e("inherits"),h=e("safer-buffer").Buffer,u=e("./der");function n(e){u.call(this,e),this.enc="pem"}i(n,u),(t.exports=n).prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g);var i=t.label.toUpperCase(),n=/^-----(BEGIN|END) ([^-]+)-----$/;let o=-1,s=-1;for(let e=0;e<r.length;e++){var a=r[e].match(n);if(null!==a&&a[2]===i){if(-1!==o){if("END"!==a[1])break;s=e;break}if("BEGIN"!==a[1])break;o=e}}if(-1===o||-1===s)throw new Error("PEM section not found for: "+i);const f=r.slice(o+1,s).join("");f.replace(/[^a-z0-9+/=]+/gi,"");e=h.from(f,"base64");return u.prototype.decode.call(this,e,t)}},{"./der":9,inherits:102,"safer-buffer":144}],12:[function(e,t,r){"use strict";const i=e("inherits"),s=e("safer-buffer").Buffer,n=e("../base/node"),a=e("../constants/der");function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new f,this.tree._init(e.body)}function f(e){n.call(this,"der",e)}function h(e){return e<10?"0"+e:e}(t.exports=o).prototype.encode=function(e,t){return this.tree._encode(e,t).join()},i(f,n),f.prototype._encodeComposite=function(e,t,r,i){e=function(e,t,r,i){let n;"seqof"===e?e="seq":"setof"===e&&(e="set");if(a.tagByName.hasOwnProperty(e))n=a.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return i.error("Unknown tag: "+e);n=e}if(31<=n)return i.error("Multi-octet tag encoding unsupported");t||(n|=32);return n|=a.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(i.length<128){const o=s.alloc(2);return o[0]=e,o[1]=i.length,this._createEncoderBuffer([o,i])}let n=1;for(let e=i.length;256<=e;e>>=8)n++;const o=s.alloc(2+n);o[0]=e,o[1]=128|n;for(let e=1+n,t=i.length;0<t;e--,t>>=8)o[e]=255&t;return this._createEncoderBuffer([o,i])},f.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"!==e)return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported");{const r=s.alloc(2*t.length);for(let e=0;e<t.length;e++)r.writeUInt16BE(t.charCodeAt(e),2*e);return this._createEncoderBuffer(r)}},f.prototype._encodeObjid=function(r,e,t){if("string"==typeof r){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(r))return this.reporter.error("objid not found in values map");r=e[r].split(/[\s.]+/g);for(let e=0;e<r.length;e++)r[e]|=0}else if(Array.isArray(r)){r=r.slice();for(let e=0;e<r.length;e++)r[e]|=0}if(!Array.isArray(r))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(r));if(!t){if(40<=r[1])return this.reporter.error("Second objid identifier OOB");r.splice(0,2,40*r[0]+r[1])}let i=0;for(let t=0;t<r.length;t++){let e=r[t];for(i++;128<=e;e>>=7)i++}const n=s.alloc(i);let o=n.length-1;for(let t=r.length-1;0<=t;t--){let e=r[t];for(n[o--]=127&e;0<(e>>=7);)n[o--]=128|127&e}return this._createEncoderBuffer(n)},f.prototype._encodeTime=function(e,t){let r;const i=new Date(e);return"gentime"===t?r=[h(i.getUTCFullYear()),h(i.getUTCMonth()+1),h(i.getUTCDate()),h(i.getUTCHours()),h(i.getUTCMinutes()),h(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[h(i.getUTCFullYear()%100),h(i.getUTCMonth()+1),h(i.getUTCDate()),h(i.getUTCHours()),h(i.getUTCMinutes()),h(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},f.prototype._encodeNull=function(){return this._createEncoderBuffer("")},f.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!s.isBuffer(t)){const n=t.toArray();!t.sign&&128&n[0]&&n.unshift(0),t=s.from(n)}if(s.isBuffer(t)){let e=t.length;0===t.length&&e++;const i=s.alloc(e);return t.copy(i),0===t.length&&(i[0]=0),this._createEncoderBuffer(i)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let r=1;for(let e=t;256<=e;e>>=8)r++;const i=new Array(r);for(let e=i.length-1;0<=e;e--)i[e]=255&t,t>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(s.from(i))},f.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},f.prototype._use=function(e,t){return(e="function"==typeof e?e(t):e)._getEncoder("der").tree},f.prototype._skipDefault=function(e,t,r){const i=this._baseState;let n;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return!1;return!0}},{"../base/node":5,"../constants/der":7,inherits:102,"safer-buffer":144}],13:[function(e,t,r){"use strict";const i=r;i.der=e("./der"),i.pem=e("./pem")},{"./der":12,"./pem":14}],14:[function(e,t,r){"use strict";const i=e("inherits"),o=e("./der");function n(e){o.call(this,e),this.enc="pem"}i(n,o),(t.exports=n).prototype.encode=function(e,t){const r=o.prototype.encode.call(this,e),i=r.toString("base64"),n=["-----BEGIN "+t.label+"-----"];for(let e=0;e<i.length;e+=64)n.push(i.slice(e,e+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},{"./der":12,inherits:102}],15:[function(e,t,r){"use strict";r.byteLength=function(e){var e=u(e),t=e[0],e=e[1];return 3*(t+e)/4-e},r.toByteArray=function(e){var t,r,i=u(e),n=i[0],i=i[1],o=new h(function(e,t){return 3*(e+t)/4-t}(n,i)),s=0,a=0<i?n-4:n;for(r=0;r<a;r+=4)t=f[e.charCodeAt(r)]<<18|f[e.charCodeAt(r+1)]<<12|f[e.charCodeAt(r+2)]<<6|f[e.charCodeAt(r+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=255&t;2===i&&(t=f[e.charCodeAt(r)]<<2|f[e.charCodeAt(r+1)]>>4,o[s++]=255&t);1===i&&(t=f[e.charCodeAt(r)]<<10|f[e.charCodeAt(r+1)]<<4|f[e.charCodeAt(r+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t);return o},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,s=r-i;o<s;o+=16383)n.push(function(e,t,r){for(var i,n=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),n.push(function(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(i));return n.join("")}(e,o,s<o+16383?s:o+16383));1==i?(t=e[r-1],n.push(a[t>>2]+a[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return n.join("")};for(var a=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n<o;++n)a[n]=i[n],f[i.charCodeAt(n)]=n;function u(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("="),t=(e=-1===e?t:e)===t?0:4-e%4;return[e,t]}f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},{}],16:[function(A,e,t){!function(e,t){"use strict";function b(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;function r(){}r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function m(e,t,r){if(m.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=m:t.BN=m,(m.BN=m).wordSize=26;try{i=("undefined"!=typeof window&&void 0!==window.Buffer?window:A("buffer")).Buffer}catch(e){}function n(e,t){e=e.charCodeAt(t);return 65<=e&&e<=70?e-55:97<=e&&e<=102?e-87:e-48&15}function a(e,t,r){var i=n(e,r);return t<=r-1&&(i|=n(e,r-1)<<4),i}function c(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++)var a=e.charCodeAt(s)-48,n=n*i+(49<=a?a-49+10:17<=a?a-17+10:a);return n}m.isBN=function(e){return e instanceof m||null!==e&&"object"==typeof e&&e.constructor.wordSize===m.wordSize&&Array.isArray(e.words)},m.max=function(e,t){return 0<e.cmp(t)?e:t},m.min=function(e,t){return e.cmp(t)<0?e:t},m.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);b((t="hex"===t?16:t)===(0|t)&&2<=t&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},m.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(b(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},m.prototype._initArray=function(e,t,r){if(b("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i,n,o=0;o<this.length;o++)this.words[o]=0;var s=0;if("be"===r)for(o=e.length-1,i=0;0<=o;o-=3)n=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=n<<s&67108863,this.words[i+1]=n>>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);else if("le"===r)for(i=o=0;o<e.length;o+=3)n=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=n<<s&67108863,this.words[i+1]=n>>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);return this.strip()},m.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;t<=i;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,18<=o?(o-=18,this.words[s+=1]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,18<=o?(o-=18,this.words[s+=1]|=n>>>26):o+=8;this.strip()},m.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;for(var n=n/t|0,o=e.length-r,s=o%--i,a=Math.min(o,o-s)+r,f=0,h=r;h<a;h+=i)f=c(e,h,h+i,t),this.imuln(n),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!=s){for(var u=1,f=c(e,h,e.length,t),h=0;h<s;h++)u*=t;this.imuln(u),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this.strip()},m.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},m.prototype.clone=function(){var e=new m(null);return this.copy(e),e},m.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},m.prototype.strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},m.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},m.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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"],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],p=[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];function o(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0,i=(r.length=i)-1|0,n=(s=(0|e.words[0])*(0|t.words[0]))/67108864|0;r.words[0]=67108863&s;for(var o=1;o<i;o++){for(var s,a=n>>>26,f=67108863&n,h=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=h;u++)a+=(s=(0|e.words[o-u|0])*(0|t.words[u])+f)/67108864|0,f=67108863&s;r.words[o]=0|f,n=0|a}return 0!==n?r.words[o]=0|n:r.length--,r.strip()}m.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var r=0,i=0,n=0;n<this.length;n++){var o=this.words[n],s=(16777215&(o<<r|i)).toString(16),a=0!==(i=o>>>24-r&16777215)||n!==this.length-1?d[6-s.length]+s+a:s+a;26<=(r+=2)&&(r-=26,n--)}for(0!==i&&(a=i.toString(16)+a);a.length%t!=0;)a="0"+a;return a=0!==this.negative?"-"+a:a}if(e===(0|e)&&2<=e&&e<=36){var f=l[e],h=p[e];for(a="",(u=this.clone()).negative=0;!u.isZero();){var u,c=u.modn(h).toString(e);a=(u=u.idivn(h)).isZero()?c+a:d[f-c.length]+c+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return a=0!==this.negative?"-"+a:a}b(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2<this.length&&b(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},m.prototype.toJSON=function(){return this.toString(16)},m.prototype.toBuffer=function(e,t){return b(void 0!==i),this.toArrayLike(i,e,t)},m.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},m.prototype.toArrayLike=function(e,t,r){var i,n,o=this.byteLength(),s=r||Math.max(1,o),r=(b(o<=s,"byte array longer than desired length"),b(0<s,"Requested array length <= 0"),this.strip(),"le"===t),a=new e(s),f=this.clone();if(r){for(n=0;!f.isZero();n++)i=f.andln(255),f.iushrn(8),a[n]=i;for(;n<s;n++)a[n]=0}else{for(n=0;n<s-o;n++)a[n]=0;for(n=0;!f.isZero();n++)i=f.andln(255),f.iushrn(8),a[s-n-1]=i}return a},Math.clz32?m.prototype._countBits=function(e){return 32-Math.clz32(e)}:m.prototype._countBits=function(e){var t=0;return 4096<=e&&(t+=13,e>>>=13),64<=e&&(t+=7,e>>>=7),8<=e&&(t+=4,e>>>=4),2<=e&&(t+=2,e>>>=2),t+e},m.prototype._zeroBits=function(e){if(0===e)return 26;var t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},m.prototype.bitLength=function(){var e=this.words[this.length-1],e=this._countBits(e);return 26*(this.length-1)+e},m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},m.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},m.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},m.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},m.prototype.isNeg=function(){return 0!==this.negative},m.prototype.neg=function(){return this.clone().ineg()},m.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},m.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},m.prototype.ior=function(e){return b(0==(this.negative|e.negative)),this.iuor(e)},m.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},m.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},m.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},m.prototype.iand=function(e){return b(0==(this.negative|e.negative)),this.iuand(e)},m.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},m.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},m.prototype.iuxor=function(e){for(var t,r=this.length>e.length?(t=this,e):(t=e,this),i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},m.prototype.ixor=function(e){return b(0==(this.negative|e.negative)),this.iuxor(e)},m.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},m.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},m.prototype.inotn=function(e){b("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),e=e%26;this._expand(t),0<e&&t--;for(var r=0;r<t;r++)this.words[r]=67108863&~this.words[r];return 0<e&&(this.words[r]=~this.words[r]&67108863>>26-e),this.strip()},m.prototype.notn=function(e){return this.clone().inotn(e)},m.prototype.setn=function(e,t){b("number"==typeof e&&0<=e);var r=e/26|0,e=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<<e:this.words[r]&~(1<<e),this.strip()},m.prototype.iadd=function(e){var t,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();for(var i=this.length>e.length?(r=this,e):(r=e,this),n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},m.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},m.prototype.isub=function(e){var t;if(0!==e.negative)return e.negative=0,t=this.iadd(e),e.negative=1,t._normSign();if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;for(var n=0<i?(r=this,e):(r=e,this),o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},m.prototype.sub=function(e){return this.clone().isub(e)};var s=function(e,L,D){var t,r=e.words,i=L.words,n=D.words,o=0|r[0],s=8191&o,o=o>>>13,a=0|r[1],f=8191&a,a=a>>>13,h=0|r[2],u=8191&h,h=h>>>13,c=0|r[3],d=8191&c,c=c>>>13,l=0|r[4],p=8191&l,l=l>>>13,b=0|r[5],m=8191&b,b=b>>>13,y=0|r[6],g=8191&y,y=y>>>13,v=0|r[7],_=8191&v,v=v>>>13,w=0|r[8],N=8191&w,w=w>>>13,r=0|r[9],U=8191&r,r=r>>>13,M=0|i[0],S=8191&M,M=M>>>13,A=0|i[1],k=8191&A,A=A>>>13,E=0|i[2],x=8191&E,E=E>>>13,P=0|i[3],q=8191&P,P=P>>>13,I=0|i[4],z=8191&I,I=I>>>13,R=0|i[5],H=8191&R,R=R>>>13,j=0|i[6],K=8191&j,j=j>>>13,B=0|i[7],F=8191&B,B=B>>>13,C=0|i[8],V=8191&C,C=C>>>13,i=0|i[9],W=8191&i,i=i>>>13,L=(D.negative=e.negative^L.negative,D.length=19,(0+Math.imul(s,S)|0)+((8191&(e=Math.imul(s,M)+Math.imul(o,S)|0))<<13)|0),T=(Math.imul(o,M)+(e>>>13)|0)+(L>>>26)|0;L&=67108863,t=Math.imul(f,S),e=Math.imul(f,M)+Math.imul(a,S)|0,O=Math.imul(a,M);var O,G=(T+(t+Math.imul(s,k)|0)|0)+((8191&(e=(e+Math.imul(s,A)|0)+Math.imul(o,k)|0))<<13)|0,J=(T=((O+Math.imul(o,A)|0)+(e>>>13)|0)+(G>>>26)|0,G&=67108863,t=Math.imul(u,S),e=Math.imul(u,M)+Math.imul(h,S)|0,O=Math.imul(h,M),t=t+Math.imul(f,k)|0,e=(e+Math.imul(f,A)|0)+Math.imul(a,k)|0,O=O+Math.imul(a,A)|0,(T+(t+Math.imul(s,x)|0)|0)+((8191&(e=(e+Math.imul(s,E)|0)+Math.imul(o,x)|0))<<13)|0),Z=(T=((O+Math.imul(o,E)|0)+(e>>>13)|0)+(J>>>26)|0,J&=67108863,t=Math.imul(d,S),e=Math.imul(d,M)+Math.imul(c,S)|0,O=Math.imul(c,M),t=t+Math.imul(u,k)|0,e=(e+Math.imul(u,A)|0)+Math.imul(h,k)|0,O=O+Math.imul(h,A)|0,t=t+Math.imul(f,x)|0,e=(e+Math.imul(f,E)|0)+Math.imul(a,x)|0,O=O+Math.imul(a,E)|0,(T+(t+Math.imul(s,q)|0)|0)+((8191&(e=(e+Math.imul(s,P)|0)+Math.imul(o,q)|0))<<13)|0),X=(T=((O+Math.imul(o,P)|0)+(e>>>13)|0)+(Z>>>26)|0,Z&=67108863,t=Math.imul(p,S),e=Math.imul(p,M)+Math.imul(l,S)|0,O=Math.imul(l,M),t=t+Math.imul(d,k)|0,e=(e+Math.imul(d,A)|0)+Math.imul(c,k)|0,O=O+Math.imul(c,A)|0,t=t+Math.imul(u,x)|0,e=(e+Math.imul(u,E)|0)+Math.imul(h,x)|0,O=O+Math.imul(h,E)|0,t=t+Math.imul(f,q)|0,e=(e+Math.imul(f,P)|0)+Math.imul(a,q)|0,O=O+Math.imul(a,P)|0,(T+(t+Math.imul(s,z)|0)|0)+((8191&(e=(e+Math.imul(s,I)|0)+Math.imul(o,z)|0))<<13)|0),Y=(T=((O+Math.imul(o,I)|0)+(e>>>13)|0)+(X>>>26)|0,X&=67108863,t=Math.imul(m,S),e=Math.imul(m,M)+Math.imul(b,S)|0,O=Math.imul(b,M),t=t+Math.imul(p,k)|0,e=(e+Math.imul(p,A)|0)+Math.imul(l,k)|0,O=O+Math.imul(l,A)|0,t=t+Math.imul(d,x)|0,e=(e+Math.imul(d,E)|0)+Math.imul(c,x)|0,O=O+Math.imul(c,E)|0,t=t+Math.imul(u,q)|0,e=(e+Math.imul(u,P)|0)+Math.imul(h,q)|0,O=O+Math.imul(h,P)|0,t=t+Math.imul(f,z)|0,e=(e+Math.imul(f,I)|0)+Math.imul(a,z)|0,O=O+Math.imul(a,I)|0,(T+(t+Math.imul(s,H)|0)|0)+((8191&(e=(e+Math.imul(s,R)|0)+Math.imul(o,H)|0))<<13)|0),Q=(T=((O+Math.imul(o,R)|0)+(e>>>13)|0)+(Y>>>26)|0,Y&=67108863,t=Math.imul(g,S),e=Math.imul(g,M)+Math.imul(y,S)|0,O=Math.imul(y,M),t=t+Math.imul(m,k)|0,e=(e+Math.imul(m,A)|0)+Math.imul(b,k)|0,O=O+Math.imul(b,A)|0,t=t+Math.imul(p,x)|0,e=(e+Math.imul(p,E)|0)+Math.imul(l,x)|0,O=O+Math.imul(l,E)|0,t=t+Math.imul(d,q)|0,e=(e+Math.imul(d,P)|0)+Math.imul(c,q)|0,O=O+Math.imul(c,P)|0,t=t+Math.imul(u,z)|0,e=(e+Math.imul(u,I)|0)+Math.imul(h,z)|0,O=O+Math.imul(h,I)|0,t=t+Math.imul(f,H)|0,e=(e+Math.imul(f,R)|0)+Math.imul(a,H)|0,O=O+Math.imul(a,R)|0,(T+(t+Math.imul(s,K)|0)|0)+((8191&(e=(e+Math.imul(s,j)|0)+Math.imul(o,K)|0))<<13)|0),$=(T=((O+Math.imul(o,j)|0)+(e>>>13)|0)+(Q>>>26)|0,Q&=67108863,t=Math.imul(_,S),e=Math.imul(_,M)+Math.imul(v,S)|0,O=Math.imul(v,M),t=t+Math.imul(g,k)|0,e=(e+Math.imul(g,A)|0)+Math.imul(y,k)|0,O=O+Math.imul(y,A)|0,t=t+Math.imul(m,x)|0,e=(e+Math.imul(m,E)|0)+Math.imul(b,x)|0,O=O+Math.imul(b,E)|0,t=t+Math.imul(p,q)|0,e=(e+Math.imul(p,P)|0)+Math.imul(l,q)|0,O=O+Math.imul(l,P)|0,t=t+Math.imul(d,z)|0,e=(e+Math.imul(d,I)|0)+Math.imul(c,z)|0,O=O+Math.imul(c,I)|0,t=t+Math.imul(u,H)|0,e=(e+Math.imul(u,R)|0)+Math.imul(h,H)|0,O=O+Math.imul(h,R)|0,t=t+Math.imul(f,K)|0,e=(e+Math.imul(f,j)|0)+Math.imul(a,K)|0,O=O+Math.imul(a,j)|0,(T+(t+Math.imul(s,F)|0)|0)+((8191&(e=(e+Math.imul(s,B)|0)+Math.imul(o,F)|0))<<13)|0),ee=(T=((O+Math.imul(o,B)|0)+(e>>>13)|0)+($>>>26)|0,$&=67108863,t=Math.imul(N,S),e=Math.imul(N,M)+Math.imul(w,S)|0,O=Math.imul(w,M),t=t+Math.imul(_,k)|0,e=(e+Math.imul(_,A)|0)+Math.imul(v,k)|0,O=O+Math.imul(v,A)|0,t=t+Math.imul(g,x)|0,e=(e+Math.imul(g,E)|0)+Math.imul(y,x)|0,O=O+Math.imul(y,E)|0,t=t+Math.imul(m,q)|0,e=(e+Math.imul(m,P)|0)+Math.imul(b,q)|0,O=O+Math.imul(b,P)|0,t=t+Math.imul(p,z)|0,e=(e+Math.imul(p,I)|0)+Math.imul(l,z)|0,O=O+Math.imul(l,I)|0,t=t+Math.imul(d,H)|0,e=(e+Math.imul(d,R)|0)+Math.imul(c,H)|0,O=O+Math.imul(c,R)|0,t=t+Math.imul(u,K)|0,e=(e+Math.imul(u,j)|0)+Math.imul(h,K)|0,O=O+Math.imul(h,j)|0,t=t+Math.imul(f,F)|0,e=(e+Math.imul(f,B)|0)+Math.imul(a,F)|0,O=O+Math.imul(a,B)|0,(T+(t+Math.imul(s,V)|0)|0)+((8191&(e=(e+Math.imul(s,C)|0)+Math.imul(o,V)|0))<<13)|0),S=(T=((O+Math.imul(o,C)|0)+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,t=Math.imul(U,S),e=Math.imul(U,M)+Math.imul(r,S)|0,O=Math.imul(r,M),t=t+Math.imul(N,k)|0,e=(e+Math.imul(N,A)|0)+Math.imul(w,k)|0,O=O+Math.imul(w,A)|0,t=t+Math.imul(_,x)|0,e=(e+Math.imul(_,E)|0)+Math.imul(v,x)|0,O=O+Math.imul(v,E)|0,t=t+Math.imul(g,q)|0,e=(e+Math.imul(g,P)|0)+Math.imul(y,q)|0,O=O+Math.imul(y,P)|0,t=t+Math.imul(m,z)|0,e=(e+Math.imul(m,I)|0)+Math.imul(b,z)|0,O=O+Math.imul(b,I)|0,t=t+Math.imul(p,H)|0,e=(e+Math.imul(p,R)|0)+Math.imul(l,H)|0,O=O+Math.imul(l,R)|0,t=t+Math.imul(d,K)|0,e=(e+Math.imul(d,j)|0)+Math.imul(c,K)|0,O=O+Math.imul(c,j)|0,t=t+Math.imul(u,F)|0,e=(e+Math.imul(u,B)|0)+Math.imul(h,F)|0,O=O+Math.imul(h,B)|0,t=t+Math.imul(f,V)|0,e=(e+Math.imul(f,C)|0)+Math.imul(a,V)|0,O=O+Math.imul(a,C)|0,(T+(t+Math.imul(s,W)|0)|0)+((8191&(e=(e+Math.imul(s,i)|0)+Math.imul(o,W)|0))<<13)|0),M=(T=((O+Math.imul(o,i)|0)+(e>>>13)|0)+(S>>>26)|0,S&=67108863,t=Math.imul(U,k),e=Math.imul(U,A)+Math.imul(r,k)|0,O=Math.imul(r,A),t=t+Math.imul(N,x)|0,e=(e+Math.imul(N,E)|0)+Math.imul(w,x)|0,O=O+Math.imul(w,E)|0,t=t+Math.imul(_,q)|0,e=(e+Math.imul(_,P)|0)+Math.imul(v,q)|0,O=O+Math.imul(v,P)|0,t=t+Math.imul(g,z)|0,e=(e+Math.imul(g,I)|0)+Math.imul(y,z)|0,O=O+Math.imul(y,I)|0,t=t+Math.imul(m,H)|0,e=(e+Math.imul(m,R)|0)+Math.imul(b,H)|0,O=O+Math.imul(b,R)|0,t=t+Math.imul(p,K)|0,e=(e+Math.imul(p,j)|0)+Math.imul(l,K)|0,O=O+Math.imul(l,j)|0,t=t+Math.imul(d,F)|0,e=(e+Math.imul(d,B)|0)+Math.imul(c,F)|0,O=O+Math.imul(c,B)|0,t=t+Math.imul(u,V)|0,e=(e+Math.imul(u,C)|0)+Math.imul(h,V)|0,O=O+Math.imul(h,C)|0,(T+(t+Math.imul(f,W)|0)|0)+((8191&(e=(e+Math.imul(f,i)|0)+Math.imul(a,W)|0))<<13)|0),s=(T=((O+Math.imul(a,i)|0)+(e>>>13)|0)+(M>>>26)|0,M&=67108863,t=Math.imul(U,x),e=Math.imul(U,E)+Math.imul(r,x)|0,O=Math.imul(r,E),t=t+Math.imul(N,q)|0,e=(e+Math.imul(N,P)|0)+Math.imul(w,q)|0,O=O+Math.imul(w,P)|0,t=t+Math.imul(_,z)|0,e=(e+Math.imul(_,I)|0)+Math.imul(v,z)|0,O=O+Math.imul(v,I)|0,t=t+Math.imul(g,H)|0,e=(e+Math.imul(g,R)|0)+Math.imul(y,H)|0,O=O+Math.imul(y,R)|0,t=t+Math.imul(m,K)|0,e=(e+Math.imul(m,j)|0)+Math.imul(b,K)|0,O=O+Math.imul(b,j)|0,t=t+Math.imul(p,F)|0,e=(e+Math.imul(p,B)|0)+Math.imul(l,F)|0,O=O+Math.imul(l,B)|0,t=t+Math.imul(d,V)|0,e=(e+Math.imul(d,C)|0)+Math.imul(c,V)|0,O=O+Math.imul(c,C)|0,(T+(t+Math.imul(u,W)|0)|0)+((8191&(e=(e+Math.imul(u,i)|0)+Math.imul(h,W)|0))<<13)|0),o=(T=((O+Math.imul(h,i)|0)+(e>>>13)|0)+(s>>>26)|0,s&=67108863,t=Math.imul(U,q),e=Math.imul(U,P)+Math.imul(r,q)|0,O=Math.imul(r,P),t=t+Math.imul(N,z)|0,e=(e+Math.imul(N,I)|0)+Math.imul(w,z)|0,O=O+Math.imul(w,I)|0,t=t+Math.imul(_,H)|0,e=(e+Math.imul(_,R)|0)+Math.imul(v,H)|0,O=O+Math.imul(v,R)|0,t=t+Math.imul(g,K)|0,e=(e+Math.imul(g,j)|0)+Math.imul(y,K)|0,O=O+Math.imul(y,j)|0,t=t+Math.imul(m,F)|0,e=(e+Math.imul(m,B)|0)+Math.imul(b,F)|0,O=O+Math.imul(b,B)|0,t=t+Math.imul(p,V)|0,e=(e+Math.imul(p,C)|0)+Math.imul(l,V)|0,O=O+Math.imul(l,C)|0,(T+(t+Math.imul(d,W)|0)|0)+((8191&(e=(e+Math.imul(d,i)|0)+Math.imul(c,W)|0))<<13)|0),k=(T=((O+Math.imul(c,i)|0)+(e>>>13)|0)+(o>>>26)|0,o&=67108863,t=Math.imul(U,z),e=Math.imul(U,I)+Math.imul(r,z)|0,O=Math.imul(r,I),t=t+Math.imul(N,H)|0,e=(e+Math.imul(N,R)|0)+Math.imul(w,H)|0,O=O+Math.imul(w,R)|0,t=t+Math.imul(_,K)|0,e=(e+Math.imul(_,j)|0)+Math.imul(v,K)|0,O=O+Math.imul(v,j)|0,t=t+Math.imul(g,F)|0,e=(e+Math.imul(g,B)|0)+Math.imul(y,F)|0,O=O+Math.imul(y,B)|0,t=t+Math.imul(m,V)|0,e=(e+Math.imul(m,C)|0)+Math.imul(b,V)|0,O=O+Math.imul(b,C)|0,(T+(t+Math.imul(p,W)|0)|0)+((8191&(e=(e+Math.imul(p,i)|0)+Math.imul(l,W)|0))<<13)|0),A=(T=((O+Math.imul(l,i)|0)+(e>>>13)|0)+(k>>>26)|0,k&=67108863,t=Math.imul(U,H),e=Math.imul(U,R)+Math.imul(r,H)|0,O=Math.imul(r,R),t=t+Math.imul(N,K)|0,e=(e+Math.imul(N,j)|0)+Math.imul(w,K)|0,O=O+Math.imul(w,j)|0,t=t+Math.imul(_,F)|0,e=(e+Math.imul(_,B)|0)+Math.imul(v,F)|0,O=O+Math.imul(v,B)|0,t=t+Math.imul(g,V)|0,e=(e+Math.imul(g,C)|0)+Math.imul(y,V)|0,O=O+Math.imul(y,C)|0,(T+(t+Math.imul(m,W)|0)|0)+((8191&(e=(e+Math.imul(m,i)|0)+Math.imul(b,W)|0))<<13)|0),f=(T=((O+Math.imul(b,i)|0)+(e>>>13)|0)+(A>>>26)|0,A&=67108863,t=Math.imul(U,K),e=Math.imul(U,j)+Math.imul(r,K)|0,O=Math.imul(r,j),t=t+Math.imul(N,F)|0,e=(e+Math.imul(N,B)|0)+Math.imul(w,F)|0,O=O+Math.imul(w,B)|0,t=t+Math.imul(_,V)|0,e=(e+Math.imul(_,C)|0)+Math.imul(v,V)|0,O=O+Math.imul(v,C)|0,(T+(t+Math.imul(g,W)|0)|0)+((8191&(e=(e+Math.imul(g,i)|0)+Math.imul(y,W)|0))<<13)|0),a=(T=((O+Math.imul(y,i)|0)+(e>>>13)|0)+(f>>>26)|0,f&=67108863,t=Math.imul(U,F),e=Math.imul(U,B)+Math.imul(r,F)|0,O=Math.imul(r,B),t=t+Math.imul(N,V)|0,e=(e+Math.imul(N,C)|0)+Math.imul(w,V)|0,O=O+Math.imul(w,C)|0,(T+(t+Math.imul(_,W)|0)|0)+((8191&(e=(e+Math.imul(_,i)|0)+Math.imul(v,W)|0))<<13)|0),x=(T=((O+Math.imul(v,i)|0)+(e>>>13)|0)+(a>>>26)|0,a&=67108863,t=Math.imul(U,V),e=Math.imul(U,C)+Math.imul(r,V)|0,O=Math.imul(r,C),(T+(t+Math.imul(N,W)|0)|0)+((8191&(e=(e+Math.imul(N,i)|0)+Math.imul(w,W)|0))<<13)|0),E=(T=((O+Math.imul(w,i)|0)+(e>>>13)|0)+(x>>>26)|0,x&=67108863,(T+Math.imul(U,W)|0)+((8191&(e=Math.imul(U,i)+Math.imul(r,W)|0))<<13)|0);return T=(Math.imul(r,i)+(e>>>13)|0)+(E>>>26)|0,E&=67108863,n[0]=L,n[1]=G,n[2]=J,n[3]=Z,n[4]=X,n[5]=Y,n[6]=Q,n[7]=$,n[8]=ee,n[9]=S,n[10]=M,n[11]=s,n[12]=o,n[13]=k,n[14]=A,n[15]=f,n[16]=a,n[17]=x,n[18]=E,0!=T&&(n[19]=T,D.length++),D};function f(e,t,r){return(new h).mulp(e,t,r)}function h(e,t){this.x=e,this.y=t}Math.imul||(s=o),m.prototype.mulTo=function(e,t){var r=this.length+e.length,r=(10===this.length&&10===e.length?s:r<63?o:r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){for(var s=n,n=0,a=67108863&i,f=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=f;h++){var u,c=(0|e.words[o-h])*(0|t.words[h]),a=67108863&(u=(67108863&c)+a|0);n+=(s=(s=s+(c/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}:f)(this,e,t);return r},h.prototype.makeRBT=function(e){for(var t=new Array(e),r=m.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},h.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},h.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},h.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,f=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),u=0;u<n;u+=a)for(var c=f,d=h,l=0;l<s;l++){var p=r[u+l],b=i[u+l],m=r[u+l+s],y=c*m-d*(g=i[u+l+s]),g=c*g+d*m;r[u+l]=p+(m=y),i[u+l]=b+g,r[u+l+s]=p-m,i[u+l+s]=b-g,l!==a&&(y=f*c-h*d,d=f*d+h*c,c=y)}},h.prototype.guessLen13b=function(e,t){for(var t=1&(i=1|Math.max(t,e)),r=0,i=i/2|0;i;i>>>=1)r++;return 1<<r+1+t},h.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},h.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},h.prototype.convert13b=function(e,t,r,i){for(var n=0,o=0;o<t;o++)n+=0|e[o],r[2*o]=8191&n,r[2*o+1]=8191&(n>>>=13),n>>>=13;for(o=2*t;o<i;++o)r[o]=0;b(0===n),b(0==(-8192&n))},h.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},h.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),f=new Array(i),h=new Array(i),u=new Array(i),c=new Array(i),d=r.words;d.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,f,i,n),this.transform(h,o,u,c,i,n);for(var l=0;l<i;l++){var p=a[l]*u[l]-f[l]*c[l];f[l]=a[l]*c[l]+f[l]*u[l],a[l]=p}return this.conjugate(a,f,i),this.transform(a,f,d,o,i,n),this.conjugate(d,o,i),this.normalize13b(d,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},m.prototype.mul=function(e){var t=new m(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},m.prototype.mulf=function(e){var t=new m(null);return t.words=new Array(this.length+e.length),f(this,e,t)},m.prototype.imul=function(e){return this.clone().mulTo(e,this)},m.prototype.imuln=function(e){b("number"==typeof e),b(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,n=(67108863&i)+(67108863&t),t=(t>>=26)+(i/67108864|0)+(n>>>26);this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},m.prototype.muln=function(e){return this.clone().imuln(e)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r%26;t[r]=(e.words[r/26|0]&1<<i)>>>i}return t}(e);if(0===t.length)return new m(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},m.prototype.iushln=function(e){b("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!=t){for(var n=0,o=0;o<this.length;o++){var s=this.words[o]&i,a=(0|this.words[o])-s<<t;this.words[o]=a|n,n=s>>>26-t}n&&(this.words[o]=n,this.length++)}if(0!=r){for(o=this.length-1;0<=o;o--)this.words[o+r]=this.words[o];for(o=0;o<r;o++)this.words[o]=0;this.length+=r}return this.strip()},m.prototype.ishln=function(e){return b(0===this.negative),this.iushln(e)},m.prototype.iushrn=function(e,t,r){b("number"==typeof e&&0<=e),i=t?(t-t%26)/26:0;var i,n=e%26,o=Math.min((e-n)/26,this.length),s=67108863^67108863>>>n<<n,a=r;if(i-=o,i=Math.max(0,i),a){for(var f=0;f<o;f++)a.words[f]=this.words[f];a.length=o}if(0!==o)if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;for(var h=0,f=this.length-1;0<=f&&(0!==h||i<=f);f--){var u=0|this.words[f];this.words[f]=h<<26-n|u>>>n,h=u&s}return a&&0!==h&&(a.words[a.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},m.prototype.ishrn=function(e,t,r){return b(0===this.negative),this.iushrn(e,t,r)},m.prototype.shln=function(e){return this.clone().ishln(e)},m.prototype.ushln=function(e){return this.clone().iushln(e)},m.prototype.shrn=function(e){return this.clone().ishrn(e)},m.prototype.ushrn=function(e){return this.clone().iushrn(e)},m.prototype.testn=function(e){b("number"==typeof e&&0<=e);var t=e%26,e=(e-t)/26;return!(this.length<=e)&&!!(this.words[e]&1<<t)},m.prototype.imaskn=function(e){b("number"==typeof e&&0<=e);var t=e%26,e=(e-t)/26;return b(0===this.negative,"imaskn works only with positive numbers"),this.length<=e?this:(0!=t&&e++,this.length=Math.min(e,this.length),0!=t&&(this.words[this.length-1]&=67108863^67108863>>>t<<t),this.strip())},m.prototype.maskn=function(e){return this.clone().imaskn(e)},m.prototype.iaddn=function(e){return b("number"==typeof e),b(e<67108864),e<0?this.isubn(-e):0!==this.negative?(1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(e),this.negative=1),this):this._iaddn(e)},m.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&67108864<=this.words[t];t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},m.prototype.isubn=function(e){if(b("number"==typeof e),b(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,--this.words[t+1];return this.strip()},m.prototype.addn=function(e){return this.clone().iaddn(e)},m.prototype.subn=function(e){return this.clone().isubn(e)},m.prototype.iabs=function(){return this.negative=0,this},m.prototype.abs=function(){return this.clone().iabs()},m.prototype._ishlnsubmul=function(e,t,r){for(var i=e.length+r,n=(this._expand(i),0),o=0;o<e.length;o++){var s=(0|this.words[o+r])+n,a=(0|e.words[o])*t,n=((s-=67108863&a)>>26)-(a/67108864|0);this.words[o+r]=67108863&s}for(;o<this.length-r;o++)n=(s=(0|this.words[o+r])+n)>>26,this.words[o+r]=67108863&s;if(0!==n){for(b(-1===n),o=n=0;o<this.length;o++)n=(s=-(0|this.words[o])+n)>>26,this.words[o]=67108863&s;this.negative=1}return this.strip()},m.prototype._wordDiv=function(e,t){this.length,e.length;var r,i=this.clone(),n=e,o=0|n.words[n.length-1],s=(0!=(e=26-this._countBits(o))&&(n=n.ushln(e),i.iushln(e),o=0|n.words[n.length-1]),i.length-n.length);if("mod"!==t){(r=new m(null)).length=1+s,r.words=new Array(r.length);for(var a=0;a<r.length;a++)r.words[a]=0}var f=i.clone()._ishlnsubmul(n,1,s);0===f.negative&&(i=f,r&&(r.words[s]=1));for(var h=s-1;0<=h;h--){var u=67108864*(0|i.words[n.length+h])+(0|i.words[n.length+h-1]),u=Math.min(u/o|0,67108863);for(i._ishlnsubmul(n,u,h);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(n,1,h),i.isZero()||(i.negative^=1);r&&(r.words[h]=u)}return r&&r.strip(),i.strip(),"div"!==t&&0!=e&&i.iushrn(e),{div:r||null,mod:i}},m.prototype.divmod=function(e,t,r){return b(!e.isZero()),this.isZero()?{div:new m(0),mod:new m(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.iadd(e)),{div:i,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),{div:i="mod"!==t?o.div.neg():i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new m(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new m(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new m(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,o},m.prototype.div=function(e){return this.divmod(e,"div",!1).div},m.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},m.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},m.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),e=e.andln(1),r=r.cmp(i);return r<0||1===e&&0===r?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},m.prototype.modn=function(e){b(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},m.prototype.idivn=function(e){b(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},m.prototype.divn=function(e){return this.clone().idivn(e)},m.prototype.egcd=function(e){b(0===e.negative),b(!e.isZero());for(var t=this,r=e.clone(),t=0!==t.negative?t.umod(e):t.clone(),i=new m(1),n=new m(0),o=new m(0),s=new m(1),a=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++a;for(var f=r.clone(),h=t.clone();!t.isZero();){for(var u=0,c=1;0==(t.words[0]&c)&&u<26;++u,c<<=1);if(0<u)for(t.iushrn(u);0<u--;)(i.isOdd()||n.isOdd())&&(i.iadd(f),n.isub(h)),i.iushrn(1),n.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(0<d)for(r.iushrn(d);0<d--;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(h)),o.iushrn(1),s.iushrn(1);0<=t.cmp(r)?(t.isub(r),i.isub(o),n.isub(s)):(r.isub(t),o.isub(i),s.isub(n))}return{a:o,b:s,gcd:r.iushln(a)}},m.prototype._invmp=function(e){b(0===e.negative),b(!e.isZero());for(var t,r=this,i=e.clone(),r=0!==r.negative?r.umod(e):r.clone(),n=new m(1),o=new m(0),s=i.clone();0<r.cmpn(1)&&0<i.cmpn(1);){for(var a=0,f=1;0==(r.words[0]&f)&&a<26;++a,f<<=1);if(0<a)for(r.iushrn(a);0<a--;)n.isOdd()&&n.iadd(s),n.iushrn(1);for(var h=0,u=1;0==(i.words[0]&u)&&h<26;++h,u<<=1);if(0<h)for(i.iushrn(h);0<h--;)o.isOdd()&&o.iadd(s),o.iushrn(1);0<=r.cmp(i)?(r.isub(i),n.isub(o)):(i.isub(r),o.isub(n))}return(t=0===r.cmpn(1)?n:o).cmpn(0)<0&&t.iadd(e),t},m.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0;for(var i=r.negative=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0)var o=t,t=r,r=o;else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},m.prototype.invm=function(e){return this.egcd(e).a.umod(e)},m.prototype.isEven=function(){return 0==(1&this.words[0])},m.prototype.isOdd=function(){return 1==(1&this.words[0])},m.prototype.andln=function(e){return this.words[0]&e},m.prototype.bincn=function(e){b("number"==typeof e);var t=e%26,e=(e-t)/26,t=1<<t;if(this.length<=e)return this._expand(1+e),this.words[e]|=t,this;for(var r=t,i=e;0!==r&&i<this.length;i++){var n=0|this.words[i],r=(n+=r)>>>26;n&=67108863,this.words[i]=n}return 0!==r&&(this.words[i]=r,this.length++),this},m.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},m.prototype.cmpn=function(e){var t=e<0;return 0===this.negative||t?0===this.negative&&t?1:(this.strip(),t=1<this.length?1:(b((e=t?-e:e)<=67108863,"Number is too big"),(t=0|this.words[0])===e?0:t<e?-1:1),0!==this.negative?0|-t:t):-1},m.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;e=this.ucmp(e);return 0!==this.negative?0|-e:e},m.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;0<=r;r--){var i=0|this.words[r],n=0|e.words[r];if(i!=n){i<n?t=-1:n<i&&(t=1);break}}return t},m.prototype.gtn=function(e){return 1===this.cmpn(e)},m.prototype.gt=function(e){return 1===this.cmp(e)},m.prototype.gten=function(e){return 0<=this.cmpn(e)},m.prototype.gte=function(e){return 0<=this.cmp(e)},m.prototype.ltn=function(e){return-1===this.cmpn(e)},m.prototype.lt=function(e){return-1===this.cmp(e)},m.prototype.lten=function(e){return this.cmpn(e)<=0},m.prototype.lte=function(e){return this.cmp(e)<=0},m.prototype.eqn=function(e){return 0===this.cmpn(e)},m.prototype.eq=function(e){return 0===this.cmp(e)},m.red=function(e){return new M(e)},m.prototype.toRed=function(e){return b(!this.red,"Already a number in reduction context"),b(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},m.prototype.fromRed=function(){return b(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},m.prototype._forceRed=function(e){return this.red=e,this},m.prototype.forceRed=function(e){return b(!this.red,"Already a number in reduction context"),this._forceRed(e)},m.prototype.redAdd=function(e){return b(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},m.prototype.redIAdd=function(e){return b(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},m.prototype.redSub=function(e){return b(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},m.prototype.redISub=function(e){return b(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},m.prototype.redShl=function(e){return b(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},m.prototype.redMul=function(e){return b(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},m.prototype.redIMul=function(e){return b(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},m.prototype.redSqr=function(){return b(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},m.prototype.redISqr=function(){return b(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},m.prototype.redSqrt=function(){return b(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},m.prototype.redInvm=function(){return b(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},m.prototype.redNeg=function(){return b(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},m.prototype.redPow=function(e){return b(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var u={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new m(t,16),this.n=this.p.bitLength(),this.k=new m(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){var t;"string"==typeof e?(t=m._prime(e),this.m=t.p,this.prime=t):(b(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null)}function S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new m(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)}y.prototype._tmp=function(){var e=new m(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){for(var t,r=e;this.split(r,this.tmp),(t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength())>this.n;);e=t<this.n?-1:r.ucmp(this.p);return 0===e?(r.words[0]=0,r.length=1):0<e?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},r(g,y),g.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=4194303&n,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(4194303&o)<<4|n>>>22,n=o}0===(e.words[i-10]=n>>>=22)&&10<e.length?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(v,y),r(_,y),r(w,y),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},m._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new v;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return u[e]=t},M.prototype._verify1=function(e){b(0===e.negative,"red works only with positives"),b(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){b(0==(e.negative|t.negative),"red works only with positives"),b(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return(this.prime?this.prime.ireduce(e):e.umod(this.m))._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);e=e.add(t);return 0<=e.cmp(this.m)&&e.isub(this.m),e._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);e=e.iadd(t);return 0<=e.cmp(this.m)&&e.isub(this.m),e},M.prototype.sub=function(e,t){this._verify2(e,t);e=e.sub(t);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);e=e.isub(t);return e.cmpn(0)<0&&e.iadd(this.m),e},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(b(t%2==1),3===t)return t=this.m.add(new m(1)).iushrn(2),this.pow(e,t);for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);b(!r.isZero());for(var n=new m(1).toRed(this),o=n.redNeg(),s=this.m.subn(1).iushrn(1),a=new m(2*(a=this.m.bitLength())*a).toRed(this);0!==this.pow(a,s).cmp(o);)a.redIAdd(o);for(var f=this.pow(a,r),h=this.pow(e,r.addn(1).iushrn(1)),u=this.pow(e,r),c=i;0!==u.cmp(n);){for(var d=u,l=0;0!==d.cmp(n);l++)d=d.redSqr();b(l<c);var p=this.pow(f,new m(1).iushln(c-l-1)),h=h.redMul(p),f=p.redSqr(),u=u.redMul(f),c=l}return h},M.prototype.invm=function(e){e=e._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(e,t){if(t.isZero())return new m(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new m(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,s=0,a=t.bitLength()%26;for(0===a&&(a=26),i=t.length-1;0<=i;i--){for(var f=t.words[i],h=a-1;0<=h;h--){var u=f>>h&1;n!==r[0]&&(n=this.sqr(n)),0==u&&0===o?s=0:(o=o<<1|u,(4===++s||0===i&&0===h)&&(n=this.mul(n,r[o]),o=s=0))}a=26}return n},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){e=e.clone();return e.red=null,e},m.mont=function(e){return new S(e)},r(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){e=this.imod(e.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;e=e.imul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new m(0)._forceRed(this);e=e.mul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:18}],17:[function(e,t,r){var i;function n(e){this.rand=e}if(t.exports=function(e){return(i=i||new n(null)).generate(e)},(t.exports.Rand=n).prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(e){e=new Uint8Array(e);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(e){e=new Uint8Array(e);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=e("crypto");if("function"!=typeof o.randomBytes)throw new Error("Not supported");n.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},{crypto:18}],18:[function(e,t,r){},{}],19:[function(e,t,r){var n=e("safe-buffer").Buffer;function i(e){for(var t=(e=n.isBuffer(e)?e:n.from(e)).length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function o(e){for(;0<e.length;e++)e[0]=0}function s(e,t,r,i,n){for(var o,s,a,f,h=r[0],u=r[1],c=r[2],d=r[3],l=e[0]^t[0],p=e[1]^t[1],b=e[2]^t[2],m=e[3]^t[3],y=4,g=1;g<n;g++)o=h[l>>>24]^u[p>>>16&255]^c[b>>>8&255]^d[255&m]^t[y++],s=h[p>>>24]^u[b>>>16&255]^c[m>>>8&255]^d[255&l]^t[y++],a=h[b>>>24]^u[m>>>16&255]^c[l>>>8&255]^d[255&p]^t[y++],f=h[m>>>24]^u[l>>>16&255]^c[p>>>8&255]^d[255&b]^t[y++],l=o,p=s,b=a,m=f;return o=(i[l>>>24]<<24|i[p>>>16&255]<<16|i[b>>>8&255]<<8|i[255&m])^t[y++],s=(i[p>>>24]<<24|i[b>>>16&255]<<16|i[m>>>8&255]<<8|i[255&l])^t[y++],a=(i[b>>>24]<<24|i[m>>>16&255]<<16|i[l>>>8&255]<<8|i[255&p])^t[y++],f=(i[m>>>24]<<24|i[l>>>16&255]<<16|i[p>>>8&255]<<8|i[255&b])^t[y++],[o>>>=0,s>>>=0,a>>>=0,f>>>=0]}var c=[0,1,2,4,8,16,32,64,128,27,54],d=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,f=0;f<256;++f){var h=a^a<<1^a<<2^a<<3^a<<4,u=(r[s]=h=h>>>8^255&h^99,e[i[h]=s]),c=e[u],d=e[c],l=257*e[h]^16843008*h;n[0][s]=l<<24|l>>>8,n[1][s]=l<<16|l>>>16,n[2][s]=l<<8|l>>>24,n[3][s]=l,o[0][h]=(l=16843009*d^65537*c^257*u^16843008*s)<<24|l>>>8,o[1][h]=l<<16|l>>>16,o[2][h]=l<<8|l>>>24,o[3][h]=l,0===s?s=a=1:(s=u^e[e[e[d^u]]],a^=e[e[a]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function a(e){this._key=i(e),this._reset()}a.blockSize=16,a.keySize=32,a.prototype.blockSize=a.blockSize,a.prototype.keySize=a.keySize,a.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o<t;o++)n[o]=e[o];for(o=t;o<i;o++){var s=n[o-1];o%t==0?(s=d.SBOX[(s=s<<8|s>>>24)>>>24]<<24|d.SBOX[s>>>16&255]<<16|d.SBOX[s>>>8&255]<<8|d.SBOX[255&s],s^=c[o/t|0]<<24):6<t&&o%t==4&&(s=d.SBOX[s>>>24]<<24|d.SBOX[s>>>16&255]<<16|d.SBOX[s>>>8&255]<<8|d.SBOX[255&s]),n[o]=n[o-t]^s}for(var a=[],f=0;f<i;f++){var h=i-f,u=n[h-(f%4?0:4)];a[f]=f<4||h<=4?u:d.INV_SUB_MIX[0][d.SBOX[u>>>24]]^d.INV_SUB_MIX[1][d.SBOX[u>>>16&255]]^d.INV_SUB_MIX[2][d.SBOX[u>>>8&255]]^d.INV_SUB_MIX[3][d.SBOX[255&u]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=a},a.prototype.encryptBlockRaw=function(e){return s(e=i(e),this._keySchedule,d.SUB_MIX,d.SBOX,this._nRounds)},a.prototype.encryptBlock=function(e){var e=this.encryptBlockRaw(e),t=n.allocUnsafe(16);return t.writeUInt32BE(e[0],0),t.writeUInt32BE(e[1],4),t.writeUInt32BE(e[2],8),t.writeUInt32BE(e[3],12),t},a.prototype.decryptBlock=function(e){var t=(e=i(e))[1],t=(e[1]=e[3],e[3]=t,s(e,this._invKeySchedule,d.INV_SUB_MIX,d.INV_SBOX,this._nRounds)),e=n.allocUnsafe(16);return e.writeUInt32BE(t[0],0),e.writeUInt32BE(t[3],4),e.writeUInt32BE(t[2],8),e.writeUInt32BE(t[1],12),e},a.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=a},{"safe-buffer":143}],20:[function(e,t,r){var o=e("./aes"),s=e("safe-buffer").Buffer,a=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),h=e("./incr32");function u(e,t,r,i){a.call(this);var n=s.alloc(4,0),t=(this._cipher=new o.AES(t),this._cipher.encryptBlock(n));this._ghash=new f(t),r=function(e,t,r){if(12===t.length)return e._finID=s.concat([t,s.from([0,0,0,1])]),s.concat([t,s.from([0,0,0,2])]);var r=new f(r),i=(n=t.length)%16,t=(r.update(t),i&&r.update(s.alloc(16-i,0)),r.update(s.alloc(8,0)),8*n),n=((i=s.alloc(8)).writeUIntBE(t,0,8),r.update(i),e._finID=r.state,s.from(e._finID));return h(n),n}(this,r,t),this._prev=s.from(r),this._cache=s.allocUnsafe(0),this._secCache=s.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(u,a),u.prototype._update=function(e){!this._called&&this._alen&&(t=16-this._alen%16)<16&&(t=s.alloc(t,0),this._ghash.update(t)),this._called=!0;var t=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(t),this._len+=e.length,t},u.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){for(var r=0,i=(e.length!==t.length&&r++,Math.min(e.length,t.length)),n=0;n<i;++n)r+=e[n]^t[n];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},u.prototype.getAuthTag=function(){if(this._decrypt||!s.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},u.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},u.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},t.exports=u},{"./aes":19,"./ghash":24,"./incr32":25,"buffer-xor":50,"cipher-base":51,inherits:102,"safe-buffer":143}],21:[function(e,t,r){var i=e("./encrypter"),n=e("./decrypter"),o=e("./modes/list.json");r.createCipher=r.Cipher=i.createCipher,r.createCipheriv=r.Cipheriv=i.createCipheriv,r.createDecipher=r.Decipher=n.createDecipher,r.createDecipheriv=r.Decipheriv=n.createDecipheriv,r.listCiphers=r.getCiphers=function(){return Object.keys(o)}},{"./decrypter":22,"./encrypter":23,"./modes/list.json":33}],22:[function(e,t,r){var i=e("./authCipher"),n=e("safe-buffer").Buffer,o=e("./modes"),s=e("./streamCipher"),a=e("cipher-base"),f=e("./aes"),h=e("evp_bytestokey");function u(e,t,r){a.call(this),this._cache=new c,this._last=void 0,this._cipher=new f.AES(t),this._prev=n.from(r),this._mode=e,this._autopadding=!0}function c(){this.cache=n.allocUnsafe(0)}function d(e,t,r){e=o[e.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=n.from(r)),"GCM"!==e.mode&&r.length!==e.iv)throw new TypeError("invalid iv length "+r.length);if((t="string"==typeof t?n.from(t):t).length!==e.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===e.type?new s(e.module,t,r,!0):"auth"===e.type?new i(e.module,t,r,!0):new u(e.module,t,r)}e("inherits")(u,a),u.prototype._update=function(e){this._cache.add(e);for(var t,r=[];t=this._cache.get(this._autopadding);)t=this._mode.decrypt(this,t),r.push(t);return n.concat(r)},u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding){var t=this._mode.decrypt(this,e),r=t[15];if(r<1||16<r)throw new Error("unable to decrypt data");for(var i=-1;++i<r;)if(t[i+(16-r)]!==r)throw new Error("unable to decrypt data");if(16!==r)return t.slice(0,16-r)}else if(e)throw new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},c.prototype.add=function(e){this.cache=n.concat([this.cache,e])},c.prototype.get=function(e){var t;if(e){if(16<this.cache.length)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(16<=this.cache.length)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(r)return t=h(t,!1,r.key,r.iv),d(e,t.key,t.iv);throw new TypeError("invalid suite type")},r.createDecipheriv=d},{"./aes":19,"./authCipher":20,"./modes":32,"./streamCipher":35,"cipher-base":51,evp_bytestokey:85,inherits:102,"safe-buffer":143}],23:[function(e,t,r){var i=e("./modes"),n=e("./authCipher"),o=e("safe-buffer").Buffer,s=e("./streamCipher"),a=e("cipher-base"),f=e("./aes"),h=e("evp_bytestokey");function u(e,t,r){a.call(this),this._cache=new d,this._cipher=new f.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}e("inherits")(u,a),u.prototype._update=function(e){this._cache.add(e);for(var t,r=[];t=this._cache.get();)t=this._mode.encrypt(this,t),r.push(t);return o.concat(r)};var c=o.alloc(16,16);function d(){this.cache=o.allocUnsafe(0)}function l(e,t,r){e=i[e.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if((t="string"==typeof t?o.from(t):t).length!==e.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==e.mode&&r.length!==e.iv)throw new TypeError("invalid iv length "+r.length);return new("stream"===e.type?s:"auth"===e.type?n:u)(e.module,t,r)}u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(c))throw this._cipher.scrub(),new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=o.concat([this.cache,e])},d.prototype.get=function(){var e;return 15<this.cache.length?(e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e):null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return o.concat([this.cache,t])},r.createCipheriv=l,r.createCipher=function(e,t){var r=i[e.toLowerCase()];if(r)return t=h(t,!1,r.key,r.iv),l(e,t.key,t.iv);throw new TypeError("invalid suite type")}},{"./aes":19,"./authCipher":20,"./modes":32,"./streamCipher":35,"cipher-base":51,evp_bytestokey:85,inherits:102,"safe-buffer":143}],24:[function(e,t,r){var i=e("safe-buffer").Buffer,n=i.alloc(16,0);function s(e){var t=i.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},o.prototype._multiply=function(){for(var e,t,r,i=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],n=[0,0,0,0],o=-1;++o<128;){for(0!=(this.state[~~(o/8)]&1<<7-o%8)&&(n[0]^=i[0],n[1]^=i[1],n[2]^=i[2],n[3]^=i[3]),r=0!=(1&i[3]),t=3;0<t;t--)i[t]=i[t]>>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=s(n)},o.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(s([0,e,0,t])),this.state},t.exports=o},{"safe-buffer":143}],25:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],26:[function(e,t,r){var i=e("buffer-xor");r.encrypt=function(e,t){t=i(t,e._prev);return e._prev=e._cipher.encryptBlock(t),e._prev},r.decrypt=function(e,t){var r=e._prev,e=(e._prev=t,e._cipher.decryptBlock(t));return i(e,r)}},{"buffer-xor":50}],27:[function(e,t,r){var o=e("safe-buffer").Buffer,s=e("buffer-xor");function a(e,t,r){var i=t.length,n=s(t,e._cache);return e._cache=e._cache.slice(i),e._prev=o.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=o.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=o.allocUnsafe(0)),!(e._cache.length<=t.length)){n=o.concat([n,a(e,t,r)]);break}i=e._cache.length,n=o.concat([n,a(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":50,"safe-buffer":143}],28:[function(e,t,r){var a=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,o=-1,s=0;++o<8;)s+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^(i=t&1<<7-o?128:0)))>>o%8,e._prev=function(e,t){var r=e.length,i=-1,n=a.allocUnsafe(e.length);e=a.concat([e,a.from([t])]);for(;++i<r;)n[i]=e[i]<<1|e[i+1]>>7;return n}(e._prev,r?i:n);return s}r.encrypt=function(e,t,r){for(var i=t.length,n=a.allocUnsafe(i),o=-1;++o<i;)n[o]=s(e,t[o],r);return n}},{"safe-buffer":143}],29:[function(e,t,r){var u=e("safe-buffer").Buffer;r.encrypt=function(e,t,r){for(var i,n,o,s,a=t.length,f=u.allocUnsafe(a),h=-1;++h<a;)f[h]=(i=e,n=t[h],o=r,s=void 0,s=i._cipher.encryptBlock(i._prev)[0]^n,i._prev=u.concat([i._prev.slice(1),u.from([o?n:s])]),s);return f}},{"safe-buffer":143}],30:[function(e,t,r){var f=e("buffer-xor"),h=e("safe-buffer").Buffer,u=e("../incr32");r.encrypt=function(e,t){var r=Math.ceil(t.length/16),i=e._cache.length;e._cache=h.concat([e._cache,h.allocUnsafe(16*r)]);for(var n=0;n<r;n++){s=void 0,s=(o=e)._cipher.encryptBlockRaw(o._prev),u(o._prev);var o=s,s=i+16*n;e._cache.writeUInt32BE(o[0],s+0),e._cache.writeUInt32BE(o[1],s+4),e._cache.writeUInt32BE(o[2],s+8),e._cache.writeUInt32BE(o[3],s+12)}var a=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),f(t,a)}},{"../incr32":25,"buffer-xor":50,"safe-buffer":143}],31:[function(e,t,r){r.encrypt=function(e,t){return e._cipher.encryptBlock(t)},r.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},{}],32:[function(e,t,r){var i,n={ECB:e("./ecb"),CBC:e("./cbc"),CFB:e("./cfb"),CFB8:e("./cfb8"),CFB1:e("./cfb1"),OFB:e("./ofb"),CTR:e("./ctr"),GCM:e("./ctr")},o=e("./list.json");for(i in o)o[i].module=n[o[i].mode];t.exports=o},{"./cbc":26,"./cfb":27,"./cfb1":28,"./cfb8":29,"./ctr":30,"./ecb":31,"./list.json":33,"./ofb":34}],33:[function(e,t,r){t.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},{}],34:[function(e,t,r){!function(o){!function(){var n=e("buffer-xor");r.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=o.concat([e._cache,((r=e)._prev=r._cipher.encryptBlock(r._prev),r._prev)]);var r,i=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,i)}}.call(this)}.call(this,e("buffer").Buffer)},{buffer:49,"buffer-xor":50}],35:[function(e,t,r){var n=e("./aes"),o=e("safe-buffer").Buffer,s=e("cipher-base");function i(e,t,r,i){s.call(this),this._cipher=new n.AES(t),this._prev=o.from(r),this._cache=o.allocUnsafe(0),this._secCache=o.allocUnsafe(0),this._decrypt=i,this._mode=e}e("inherits")(i,s),i.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},i.prototype._final=function(){this._cipher.scrub()},t.exports=i},{"./aes":19,"cipher-base":51,inherits:102,"safe-buffer":143}],36:[function(e,t,r){var i=e("browserify-des"),n=e("browserify-aes/browser"),o=e("browserify-aes/modes"),s=e("browserify-des/modes"),a=e("evp_bytestokey");function f(e,t,r){if(e=e.toLowerCase(),o[e])return n.createCipheriv(e,t,r);if(s[e])return new i({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function h(e,t,r){if(e=e.toLowerCase(),o[e])return n.createDecipheriv(e,t,r);if(s[e])return new i({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}r.createCipher=r.Cipher=function(e,t){var r,i;if(e=e.toLowerCase(),o[e])r=o[e].key,i=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,i=s[e].iv}return t=a(t,!1,r,i),f(e,t.key,t.iv)},r.createCipheriv=r.Cipheriv=f,r.createDecipher=r.Decipher=function(e,t){var r,i;if(e=e.toLowerCase(),o[e])r=o[e].key,i=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,i=s[e].iv}return t=a(t,!1,r,i),h(e,t.key,t.iv)},r.createDecipheriv=r.Decipheriv=h,r.listCiphers=r.getCiphers=function(){return Object.keys(s).concat(n.getCiphers())}},{"browserify-aes/browser":21,"browserify-aes/modes":32,"browserify-des":37,"browserify-des/modes":38,evp_bytestokey:85}],37:[function(e,t,r){var o=e("cipher-base"),i=e("des.js"),n=e("inherits"),s=e("safe-buffer").Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function f(e){o.call(this);var t=e.mode.toLowerCase(),r=a[t],i=e.decrypt?"decrypt":"encrypt",n=e.key,t=(s.isBuffer(n)||(n=s.from(n)),"des-ede"!==t&&"des-ede-cbc"!==t||(n=s.concat([n,n.slice(0,8)])),e.iv);s.isBuffer(t)||(t=s.from(t)),this._des=r.create({key:n,iv:t,type:i})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],n(t.exports=f,o),f.prototype._update=function(e){return s.from(this._des.update(e))},f.prototype._final=function(){return s.from(this._des.final())}},{"cipher-base":51,"des.js":58,inherits:102,"safe-buffer":143}],38:[function(e,t,r){r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}},{}],39:[function(t,r,e){!function(u){!function(){var f=t("bn.js"),i=t("randombytes");function h(e){for(var t,r=e.modulus.byteLength();0<=(t=new f(i(r))).cmp(e.modulus)||!t.umod(e.prime1)||!t.umod(e.prime2););return t}function e(e,t){var r={blinder:(r=h(i=t)).toRed(f.mont(i.modulus)).redPow(new f(i.publicExponent)).fromRed(),unblinder:r.invm(i.modulus)},i=t.modulus.byteLength(),e=new f(e).mul(r.blinder).umod(t.modulus),n=e.toRed(f.mont(t.prime1)),e=e.toRed(f.mont(t.prime2)),o=t.coefficient,s=t.prime1,a=t.prime2,n=n.redPow(t.exponent1).fromRed(),e=e.redPow(t.exponent2).fromRed(),n=n.isub(e).imul(o).umod(s).imul(a);return e.iadd(n).imul(r.unblinder).umod(t.modulus).toArrayLike(u,"be",i)}e.getr=h,r.exports=e}.call(this)}.call(this,t("buffer").Buffer)},{"bn.js":40,buffer:49,randombytes:125}],40:[function(E,e,t){!function(e,t){"use strict";function b(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;function r(){}r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function m(e,t,r){if(m.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=m:t.BN=m,(m.BN=m).wordSize=26;try{i=("undefined"!=typeof window&&void 0!==window.Buffer?window:E("buffer")).Buffer}catch(e){}function n(e,t){t=e.charCodeAt(t);return 48<=t&&t<=57?t-48:65<=t&&t<=70?t-55:97<=t&&t<=102?t-87:void b(!1,"Invalid character in "+e)}function a(e,t,r){var i=n(e,r);return t<=r-1&&(i|=n(e,r-1)<<4),i}function c(e,t,r,i){for(var n=0,o=0,s=Math.min(e.length,r),a=t;a<s;a++){var f=e.charCodeAt(a)-48;n*=i,o=49<=f?f-49+10:17<=f?f-17+10:f,b(0<=f&&o<i,"Invalid character"),n+=o}return n}function o(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(m.isBN=function(e){return e instanceof m||null!==e&&"object"==typeof e&&e.constructor.wordSize===m.wordSize&&Array.isArray(e.words)},m.max=function(e,t){return 0<e.cmp(t)?e:t},m.min=function(e,t){return e.cmp(t)<0?e:t},m.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);b((t="hex"===t?16:t)===(0|t)&&2<=t&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},m.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(b(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},m.prototype._initArray=function(e,t,r){if(b("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i,n,o=0;o<this.length;o++)this.words[o]=0;var s=0;if("be"===r)for(o=e.length-1,i=0;0<=o;o-=3)n=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=n<<s&67108863,this.words[i+1]=n>>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);else if("le"===r)for(i=o=0;o<e.length;o+=3)n=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=n<<s&67108863,this.words[i+1]=n>>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);return this._strip()},m.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;t<=i;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,18<=o?(o-=18,this.words[s+=1]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,18<=o?(o-=18,this.words[s+=1]|=n>>>26):o+=8;this._strip()},m.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;for(var n=n/t|0,o=e.length-r,s=o%--i,a=Math.min(o,o-s)+r,f=0,h=r;h<a;h+=i)f=c(e,h,h+i,t),this.imuln(n),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!=s){for(var u=1,f=c(e,h,e.length,t),h=0;h<s;h++)u*=t;this.imuln(u),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this._strip()},m.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},m.prototype._move=function(e){o(e,this)},m.prototype.clone=function(){var e=new m(null);return this.copy(e),e},m.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},m.prototype._strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},m.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{m.prototype[Symbol.for("nodejs.util.inspect.custom")]=s}catch(e){m.prototype.inspect=s}else m.prototype.inspect=s;function s(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],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],p=[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];m.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){for(var r="",i=0,n=0,o=0;o<this.length;o++){var s=this.words[o],a=(16777215&(s<<i|n)).toString(16),n=s>>>24-i&16777215;26<=(i+=2)&&(i-=26,o--),r=0!==n||o!==this.length-1?d[6-a.length]+a+r:a+r}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return r=0!==this.negative?"-"+r:r}if(e===(0|e)&&2<=e&&e<=36){var f=l[e],h=p[e];for(r="",(u=this.clone()).negative=0;!u.isZero();){var u,c=u.modrn(h).toString(e);r=(u=u.idivn(h)).isZero()?c+r:d[f-c.length]+c+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return r=0!==this.negative?"-"+r:r}b(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2<this.length&&b(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},m.prototype.toJSON=function(){return this.toString(16,2)},i&&(m.prototype.toBuffer=function(e,t){return this.toArrayLike(i,e,t)}),m.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function f(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0,i=(r.length=i)-1|0,n=(s=(0|e.words[0])*(0|t.words[0]))/67108864|0;r.words[0]=67108863&s;for(var o=1;o<i;o++){for(var s,a=n>>>26,f=67108863&n,h=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=h;u++)a+=(s=(0|e.words[o-u|0])*(0|t.words[u])+f)/67108864|0,f=67108863&s;r.words[o]=0|f,n=0|a}return 0!==n?r.words[o]=0|n:r.length--,r._strip()}m.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),r=r||Math.max(1,i),e=(b(i<=r,"byte array longer than desired length"),b(0<r,"Requested array length <= 0"),r=r,(e=e).allocUnsafe?e.allocUnsafe(r):new e(r));return this["_toArrayLike"+("le"===t?"LE":"BE")](e,i),e},m.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),o=i=0):(i=s>>>24,o+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},m.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r--]=255&s,0<=r&&(e[r--]=s>>8&255),0<=r&&(e[r--]=s>>16&255),6===o?(0<=r&&(e[r--]=s>>24&255),o=i=0):(i=s>>>24,o+=2)}if(0<=r)for(e[r--]=i;0<=r;)e[r--]=0},Math.clz32?m.prototype._countBits=function(e){return 32-Math.clz32(e)}:m.prototype._countBits=function(e){var t=0;return 4096<=e&&(t+=13,e>>>=13),64<=e&&(t+=7,e>>>=7),8<=e&&(t+=4,e>>>=4),2<=e&&(t+=2,e>>>=2),t+e},m.prototype._zeroBits=function(e){if(0===e)return 26;var t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},m.prototype.bitLength=function(){var e=this.words[this.length-1],e=this._countBits(e);return 26*(this.length-1)+e},m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},m.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},m.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},m.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},m.prototype.isNeg=function(){return 0!==this.negative},m.prototype.neg=function(){return this.clone().ineg()},m.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},m.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},m.prototype.ior=function(e){return b(0==(this.negative|e.negative)),this.iuor(e)},m.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},m.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},m.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},m.prototype.iand=function(e){return b(0==(this.negative|e.negative)),this.iuand(e)},m.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},m.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},m.prototype.iuxor=function(e){for(var t,r=this.length>e.length?(t=this,e):(t=e,this),i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},m.prototype.ixor=function(e){return b(0==(this.negative|e.negative)),this.iuxor(e)},m.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},m.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},m.prototype.inotn=function(e){b("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),e=e%26;this._expand(t),0<e&&t--;for(var r=0;r<t;r++)this.words[r]=67108863&~this.words[r];return 0<e&&(this.words[r]=~this.words[r]&67108863>>26-e),this._strip()},m.prototype.notn=function(e){return this.clone().inotn(e)},m.prototype.setn=function(e,t){b("number"==typeof e&&0<=e);var r=e/26|0,e=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<<e:this.words[r]&~(1<<e),this._strip()},m.prototype.iadd=function(e){var t,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();for(var i=this.length>e.length?(r=this,e):(r=e,this),n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},m.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},m.prototype.isub=function(e){var t;if(0!==e.negative)return e.negative=0,t=this.iadd(e),e.negative=1,t._normSign();if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;for(var n=0<i?(r=this,e):(r=e,this),o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},m.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,L,D){var t,r=e.words,i=L.words,n=D.words,o=0|r[0],s=8191&o,o=o>>>13,a=0|r[1],f=8191&a,a=a>>>13,h=0|r[2],u=8191&h,h=h>>>13,c=0|r[3],d=8191&c,c=c>>>13,l=0|r[4],p=8191&l,l=l>>>13,b=0|r[5],m=8191&b,b=b>>>13,y=0|r[6],g=8191&y,y=y>>>13,v=0|r[7],_=8191&v,v=v>>>13,w=0|r[8],N=8191&w,w=w>>>13,r=0|r[9],U=8191&r,r=r>>>13,M=0|i[0],S=8191&M,M=M>>>13,A=0|i[1],k=8191&A,A=A>>>13,E=0|i[2],x=8191&E,E=E>>>13,P=0|i[3],q=8191&P,P=P>>>13,I=0|i[4],z=8191&I,I=I>>>13,R=0|i[5],H=8191&R,R=R>>>13,j=0|i[6],K=8191&j,j=j>>>13,B=0|i[7],F=8191&B,B=B>>>13,C=0|i[8],V=8191&C,C=C>>>13,i=0|i[9],W=8191&i,i=i>>>13,L=(D.negative=e.negative^L.negative,D.length=19,(0+Math.imul(s,S)|0)+((8191&(e=Math.imul(s,M)+Math.imul(o,S)|0))<<13)|0),T=(Math.imul(o,M)+(e>>>13)|0)+(L>>>26)|0;L&=67108863,t=Math.imul(f,S),e=Math.imul(f,M)+Math.imul(a,S)|0,O=Math.imul(a,M);var O,G=(T+(t+Math.imul(s,k)|0)|0)+((8191&(e=(e+Math.imul(s,A)|0)+Math.imul(o,k)|0))<<13)|0,J=(T=((O+Math.imul(o,A)|0)+(e>>>13)|0)+(G>>>26)|0,G&=67108863,t=Math.imul(u,S),e=Math.imul(u,M)+Math.imul(h,S)|0,O=Math.imul(h,M),t=t+Math.imul(f,k)|0,e=(e+Math.imul(f,A)|0)+Math.imul(a,k)|0,O=O+Math.imul(a,A)|0,(T+(t+Math.imul(s,x)|0)|0)+((8191&(e=(e+Math.imul(s,E)|0)+Math.imul(o,x)|0))<<13)|0),Z=(T=((O+Math.imul(o,E)|0)+(e>>>13)|0)+(J>>>26)|0,J&=67108863,t=Math.imul(d,S),e=Math.imul(d,M)+Math.imul(c,S)|0,O=Math.imul(c,M),t=t+Math.imul(u,k)|0,e=(e+Math.imul(u,A)|0)+Math.imul(h,k)|0,O=O+Math.imul(h,A)|0,t=t+Math.imul(f,x)|0,e=(e+Math.imul(f,E)|0)+Math.imul(a,x)|0,O=O+Math.imul(a,E)|0,(T+(t+Math.imul(s,q)|0)|0)+((8191&(e=(e+Math.imul(s,P)|0)+Math.imul(o,q)|0))<<13)|0),X=(T=((O+Math.imul(o,P)|0)+(e>>>13)|0)+(Z>>>26)|0,Z&=67108863,t=Math.imul(p,S),e=Math.imul(p,M)+Math.imul(l,S)|0,O=Math.imul(l,M),t=t+Math.imul(d,k)|0,e=(e+Math.imul(d,A)|0)+Math.imul(c,k)|0,O=O+Math.imul(c,A)|0,t=t+Math.imul(u,x)|0,e=(e+Math.imul(u,E)|0)+Math.imul(h,x)|0,O=O+Math.imul(h,E)|0,t=t+Math.imul(f,q)|0,e=(e+Math.imul(f,P)|0)+Math.imul(a,q)|0,O=O+Math.imul(a,P)|0,(T+(t+Math.imul(s,z)|0)|0)+((8191&(e=(e+Math.imul(s,I)|0)+Math.imul(o,z)|0))<<13)|0),Y=(T=((O+Math.imul(o,I)|0)+(e>>>13)|0)+(X>>>26)|0,X&=67108863,t=Math.imul(m,S),e=Math.imul(m,M)+Math.imul(b,S)|0,O=Math.imul(b,M),t=t+Math.imul(p,k)|0,e=(e+Math.imul(p,A)|0)+Math.imul(l,k)|0,O=O+Math.imul(l,A)|0,t=t+Math.imul(d,x)|0,e=(e+Math.imul(d,E)|0)+Math.imul(c,x)|0,O=O+Math.imul(c,E)|0,t=t+Math.imul(u,q)|0,e=(e+Math.imul(u,P)|0)+Math.imul(h,q)|0,O=O+Math.imul(h,P)|0,t=t+Math.imul(f,z)|0,e=(e+Math.imul(f,I)|0)+Math.imul(a,z)|0,O=O+Math.imul(a,I)|0,(T+(t+Math.imul(s,H)|0)|0)+((8191&(e=(e+Math.imul(s,R)|0)+Math.imul(o,H)|0))<<13)|0),Q=(T=((O+Math.imul(o,R)|0)+(e>>>13)|0)+(Y>>>26)|0,Y&=67108863,t=Math.imul(g,S),e=Math.imul(g,M)+Math.imul(y,S)|0,O=Math.imul(y,M),t=t+Math.imul(m,k)|0,e=(e+Math.imul(m,A)|0)+Math.imul(b,k)|0,O=O+Math.imul(b,A)|0,t=t+Math.imul(p,x)|0,e=(e+Math.imul(p,E)|0)+Math.imul(l,x)|0,O=O+Math.imul(l,E)|0,t=t+Math.imul(d,q)|0,e=(e+Math.imul(d,P)|0)+Math.imul(c,q)|0,O=O+Math.imul(c,P)|0,t=t+Math.imul(u,z)|0,e=(e+Math.imul(u,I)|0)+Math.imul(h,z)|0,O=O+Math.imul(h,I)|0,t=t+Math.imul(f,H)|0,e=(e+Math.imul(f,R)|0)+Math.imul(a,H)|0,O=O+Math.imul(a,R)|0,(T+(t+Math.imul(s,K)|0)|0)+((8191&(e=(e+Math.imul(s,j)|0)+Math.imul(o,K)|0))<<13)|0),$=(T=((O+Math.imul(o,j)|0)+(e>>>13)|0)+(Q>>>26)|0,Q&=67108863,t=Math.imul(_,S),e=Math.imul(_,M)+Math.imul(v,S)|0,O=Math.imul(v,M),t=t+Math.imul(g,k)|0,e=(e+Math.imul(g,A)|0)+Math.imul(y,k)|0,O=O+Math.imul(y,A)|0,t=t+Math.imul(m,x)|0,e=(e+Math.imul(m,E)|0)+Math.imul(b,x)|0,O=O+Math.imul(b,E)|0,t=t+Math.imul(p,q)|0,e=(e+Math.imul(p,P)|0)+Math.imul(l,q)|0,O=O+Math.imul(l,P)|0,t=t+Math.imul(d,z)|0,e=(e+Math.imul(d,I)|0)+Math.imul(c,z)|0,O=O+Math.imul(c,I)|0,t=t+Math.imul(u,H)|0,e=(e+Math.imul(u,R)|0)+Math.imul(h,H)|0,O=O+Math.imul(h,R)|0,t=t+Math.imul(f,K)|0,e=(e+Math.imul(f,j)|0)+Math.imul(a,K)|0,O=O+Math.imul(a,j)|0,(T+(t+Math.imul(s,F)|0)|0)+((8191&(e=(e+Math.imul(s,B)|0)+Math.imul(o,F)|0))<<13)|0),ee=(T=((O+Math.imul(o,B)|0)+(e>>>13)|0)+($>>>26)|0,$&=67108863,t=Math.imul(N,S),e=Math.imul(N,M)+Math.imul(w,S)|0,O=Math.imul(w,M),t=t+Math.imul(_,k)|0,e=(e+Math.imul(_,A)|0)+Math.imul(v,k)|0,O=O+Math.imul(v,A)|0,t=t+Math.imul(g,x)|0,e=(e+Math.imul(g,E)|0)+Math.imul(y,x)|0,O=O+Math.imul(y,E)|0,t=t+Math.imul(m,q)|0,e=(e+Math.imul(m,P)|0)+Math.imul(b,q)|0,O=O+Math.imul(b,P)|0,t=t+Math.imul(p,z)|0,e=(e+Math.imul(p,I)|0)+Math.imul(l,z)|0,O=O+Math.imul(l,I)|0,t=t+Math.imul(d,H)|0,e=(e+Math.imul(d,R)|0)+Math.imul(c,H)|0,O=O+Math.imul(c,R)|0,t=t+Math.imul(u,K)|0,e=(e+Math.imul(u,j)|0)+Math.imul(h,K)|0,O=O+Math.imul(h,j)|0,t=t+Math.imul(f,F)|0,e=(e+Math.imul(f,B)|0)+Math.imul(a,F)|0,O=O+Math.imul(a,B)|0,(T+(t+Math.imul(s,V)|0)|0)+((8191&(e=(e+Math.imul(s,C)|0)+Math.imul(o,V)|0))<<13)|0),S=(T=((O+Math.imul(o,C)|0)+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,t=Math.imul(U,S),e=Math.imul(U,M)+Math.imul(r,S)|0,O=Math.imul(r,M),t=t+Math.imul(N,k)|0,e=(e+Math.imul(N,A)|0)+Math.imul(w,k)|0,O=O+Math.imul(w,A)|0,t=t+Math.imul(_,x)|0,e=(e+Math.imul(_,E)|0)+Math.imul(v,x)|0,O=O+Math.imul(v,E)|0,t=t+Math.imul(g,q)|0,e=(e+Math.imul(g,P)|0)+Math.imul(y,q)|0,O=O+Math.imul(y,P)|0,t=t+Math.imul(m,z)|0,e=(e+Math.imul(m,I)|0)+Math.imul(b,z)|0,O=O+Math.imul(b,I)|0,t=t+Math.imul(p,H)|0,e=(e+Math.imul(p,R)|0)+Math.imul(l,H)|0,O=O+Math.imul(l,R)|0,t=t+Math.imul(d,K)|0,e=(e+Math.imul(d,j)|0)+Math.imul(c,K)|0,O=O+Math.imul(c,j)|0,t=t+Math.imul(u,F)|0,e=(e+Math.imul(u,B)|0)+Math.imul(h,F)|0,O=O+Math.imul(h,B)|0,t=t+Math.imul(f,V)|0,e=(e+Math.imul(f,C)|0)+Math.imul(a,V)|0,O=O+Math.imul(a,C)|0,(T+(t+Math.imul(s,W)|0)|0)+((8191&(e=(e+Math.imul(s,i)|0)+Math.imul(o,W)|0))<<13)|0),M=(T=((O+Math.imul(o,i)|0)+(e>>>13)|0)+(S>>>26)|0,S&=67108863,t=Math.imul(U,k),e=Math.imul(U,A)+Math.imul(r,k)|0,O=Math.imul(r,A),t=t+Math.imul(N,x)|0,e=(e+Math.imul(N,E)|0)+Math.imul(w,x)|0,O=O+Math.imul(w,E)|0,t=t+Math.imul(_,q)|0,e=(e+Math.imul(_,P)|0)+Math.imul(v,q)|0,O=O+Math.imul(v,P)|0,t=t+Math.imul(g,z)|0,e=(e+Math.imul(g,I)|0)+Math.imul(y,z)|0,O=O+Math.imul(y,I)|0,t=t+Math.imul(m,H)|0,e=(e+Math.imul(m,R)|0)+Math.imul(b,H)|0,O=O+Math.imul(b,R)|0,t=t+Math.imul(p,K)|0,e=(e+Math.imul(p,j)|0)+Math.imul(l,K)|0,O=O+Math.imul(l,j)|0,t=t+Math.imul(d,F)|0,e=(e+Math.imul(d,B)|0)+Math.imul(c,F)|0,O=O+Math.imul(c,B)|0,t=t+Math.imul(u,V)|0,e=(e+Math.imul(u,C)|0)+Math.imul(h,V)|0,O=O+Math.imul(h,C)|0,(T+(t+Math.imul(f,W)|0)|0)+((8191&(e=(e+Math.imul(f,i)|0)+Math.imul(a,W)|0))<<13)|0),s=(T=((O+Math.imul(a,i)|0)+(e>>>13)|0)+(M>>>26)|0,M&=67108863,t=Math.imul(U,x),e=Math.imul(U,E)+Math.imul(r,x)|0,O=Math.imul(r,E),t=t+Math.imul(N,q)|0,e=(e+Math.imul(N,P)|0)+Math.imul(w,q)|0,O=O+Math.imul(w,P)|0,t=t+Math.imul(_,z)|0,e=(e+Math.imul(_,I)|0)+Math.imul(v,z)|0,O=O+Math.imul(v,I)|0,t=t+Math.imul(g,H)|0,e=(e+Math.imul(g,R)|0)+Math.imul(y,H)|0,O=O+Math.imul(y,R)|0,t=t+Math.imul(m,K)|0,e=(e+Math.imul(m,j)|0)+Math.imul(b,K)|0,O=O+Math.imul(b,j)|0,t=t+Math.imul(p,F)|0,e=(e+Math.imul(p,B)|0)+Math.imul(l,F)|0,O=O+Math.imul(l,B)|0,t=t+Math.imul(d,V)|0,e=(e+Math.imul(d,C)|0)+Math.imul(c,V)|0,O=O+Math.imul(c,C)|0,(T+(t+Math.imul(u,W)|0)|0)+((8191&(e=(e+Math.imul(u,i)|0)+Math.imul(h,W)|0))<<13)|0),o=(T=((O+Math.imul(h,i)|0)+(e>>>13)|0)+(s>>>26)|0,s&=67108863,t=Math.imul(U,q),e=Math.imul(U,P)+Math.imul(r,q)|0,O=Math.imul(r,P),t=t+Math.imul(N,z)|0,e=(e+Math.imul(N,I)|0)+Math.imul(w,z)|0,O=O+Math.imul(w,I)|0,t=t+Math.imul(_,H)|0,e=(e+Math.imul(_,R)|0)+Math.imul(v,H)|0,O=O+Math.imul(v,R)|0,t=t+Math.imul(g,K)|0,e=(e+Math.imul(g,j)|0)+Math.imul(y,K)|0,O=O+Math.imul(y,j)|0,t=t+Math.imul(m,F)|0,e=(e+Math.imul(m,B)|0)+Math.imul(b,F)|0,O=O+Math.imul(b,B)|0,t=t+Math.imul(p,V)|0,e=(e+Math.imul(p,C)|0)+Math.imul(l,V)|0,O=O+Math.imul(l,C)|0,(T+(t+Math.imul(d,W)|0)|0)+((8191&(e=(e+Math.imul(d,i)|0)+Math.imul(c,W)|0))<<13)|0),k=(T=((O+Math.imul(c,i)|0)+(e>>>13)|0)+(o>>>26)|0,o&=67108863,t=Math.imul(U,z),e=Math.imul(U,I)+Math.imul(r,z)|0,O=Math.imul(r,I),t=t+Math.imul(N,H)|0,e=(e+Math.imul(N,R)|0)+Math.imul(w,H)|0,O=O+Math.imul(w,R)|0,t=t+Math.imul(_,K)|0,e=(e+Math.imul(_,j)|0)+Math.imul(v,K)|0,O=O+Math.imul(v,j)|0,t=t+Math.imul(g,F)|0,e=(e+Math.imul(g,B)|0)+Math.imul(y,F)|0,O=O+Math.imul(y,B)|0,t=t+Math.imul(m,V)|0,e=(e+Math.imul(m,C)|0)+Math.imul(b,V)|0,O=O+Math.imul(b,C)|0,(T+(t+Math.imul(p,W)|0)|0)+((8191&(e=(e+Math.imul(p,i)|0)+Math.imul(l,W)|0))<<13)|0),A=(T=((O+Math.imul(l,i)|0)+(e>>>13)|0)+(k>>>26)|0,k&=67108863,t=Math.imul(U,H),e=Math.imul(U,R)+Math.imul(r,H)|0,O=Math.imul(r,R),t=t+Math.imul(N,K)|0,e=(e+Math.imul(N,j)|0)+Math.imul(w,K)|0,O=O+Math.imul(w,j)|0,t=t+Math.imul(_,F)|0,e=(e+Math.imul(_,B)|0)+Math.imul(v,F)|0,O=O+Math.imul(v,B)|0,t=t+Math.imul(g,V)|0,e=(e+Math.imul(g,C)|0)+Math.imul(y,V)|0,O=O+Math.imul(y,C)|0,(T+(t+Math.imul(m,W)|0)|0)+((8191&(e=(e+Math.imul(m,i)|0)+Math.imul(b,W)|0))<<13)|0),f=(T=((O+Math.imul(b,i)|0)+(e>>>13)|0)+(A>>>26)|0,A&=67108863,t=Math.imul(U,K),e=Math.imul(U,j)+Math.imul(r,K)|0,O=Math.imul(r,j),t=t+Math.imul(N,F)|0,e=(e+Math.imul(N,B)|0)+Math.imul(w,F)|0,O=O+Math.imul(w,B)|0,t=t+Math.imul(_,V)|0,e=(e+Math.imul(_,C)|0)+Math.imul(v,V)|0,O=O+Math.imul(v,C)|0,(T+(t+Math.imul(g,W)|0)|0)+((8191&(e=(e+Math.imul(g,i)|0)+Math.imul(y,W)|0))<<13)|0),a=(T=((O+Math.imul(y,i)|0)+(e>>>13)|0)+(f>>>26)|0,f&=67108863,t=Math.imul(U,F),e=Math.imul(U,B)+Math.imul(r,F)|0,O=Math.imul(r,B),t=t+Math.imul(N,V)|0,e=(e+Math.imul(N,C)|0)+Math.imul(w,V)|0,O=O+Math.imul(w,C)|0,(T+(t+Math.imul(_,W)|0)|0)+((8191&(e=(e+Math.imul(_,i)|0)+Math.imul(v,W)|0))<<13)|0),x=(T=((O+Math.imul(v,i)|0)+(e>>>13)|0)+(a>>>26)|0,a&=67108863,t=Math.imul(U,V),e=Math.imul(U,C)+Math.imul(r,V)|0,O=Math.imul(r,C),(T+(t+Math.imul(N,W)|0)|0)+((8191&(e=(e+Math.imul(N,i)|0)+Math.imul(w,W)|0))<<13)|0),E=(T=((O+Math.imul(w,i)|0)+(e>>>13)|0)+(x>>>26)|0,x&=67108863,(T+Math.imul(U,W)|0)+((8191&(e=Math.imul(U,i)+Math.imul(r,W)|0))<<13)|0);return T=(Math.imul(r,i)+(e>>>13)|0)+(E>>>26)|0,E&=67108863,n[0]=L,n[1]=G,n[2]=J,n[3]=Z,n[4]=X,n[5]=Y,n[6]=Q,n[7]=$,n[8]=ee,n[9]=S,n[10]=M,n[11]=s,n[12]=o,n[13]=k,n[14]=A,n[15]=f,n[16]=a,n[17]=x,n[18]=E,0!=T&&(n[19]=T,D.length++),D};function u(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){for(var s=n,n=0,a=67108863&i,f=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=f;h++){var u,c=(0|e.words[o-h])*(0|t.words[h]),a=67108863&(u=(67108863&c)+a|0);n+=(s=(s=s+(c/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(e,t,r){return u(e,t,r)}Math.imul||(h=f),m.prototype.mulTo=function(e,t){var r=this.length+e.length,r=(10===this.length&&10===e.length?h:r<63?f:r<1024?u:y)(this,e,t);return r},m.prototype.mul=function(e){var t=new m(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},m.prototype.mulf=function(e){var t=new m(null);return t.words=new Array(this.length+e.length),y(this,e,t)},m.prototype.imul=function(e){return this.clone().mulTo(e,this)},m.prototype.imuln=function(e){for(var t=e<0,r=(b("number"==typeof(e=t?-e:e)),b(e<67108864),0),i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&r),r=(r>>=26)+(n/67108864|0)+(o>>>26);this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},m.prototype.muln=function(e){return this.clone().imuln(e)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++)t[r]=e.words[r/26|0]>>>r%26&1;return t}(e);if(0===t.length)return new m(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},m.prototype.iushln=function(e){b("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!=t){for(var n=0,o=0;o<this.length;o++){var s=this.words[o]&i,a=(0|this.words[o])-s<<t;this.words[o]=a|n,n=s>>>26-t}n&&(this.words[o]=n,this.length++)}if(0!=r){for(o=this.length-1;0<=o;o--)this.words[o+r]=this.words[o];for(o=0;o<r;o++)this.words[o]=0;this.length+=r}return this._strip()},m.prototype.ishln=function(e){return b(0===this.negative),this.iushln(e)},m.prototype.iushrn=function(e,t,r){b("number"==typeof e&&0<=e),i=t?(t-t%26)/26:0;var i,n=e%26,o=Math.min((e-n)/26,this.length),s=67108863^67108863>>>n<<n,a=r;if(i-=o,i=Math.max(0,i),a){for(var f=0;f<o;f++)a.words[f]=this.words[f];a.length=o}if(0!==o)if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;for(var h=0,f=this.length-1;0<=f&&(0!==h||i<=f);f--){var u=0|this.words[f];this.words[f]=h<<26-n|u>>>n,h=u&s}return a&&0!==h&&(a.words[a.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},m.prototype.ishrn=function(e,t,r){return b(0===this.negative),this.iushrn(e,t,r)},m.prototype.shln=function(e){return this.clone().ishln(e)},m.prototype.ushln=function(e){return this.clone().iushln(e)},m.prototype.shrn=function(e){return this.clone().ishrn(e)},m.prototype.ushrn=function(e){return this.clone().iushrn(e)},m.prototype.testn=function(e){b("number"==typeof e&&0<=e);var t=e%26,e=(e-t)/26;return!(this.length<=e)&&!!(this.words[e]&1<<t)},m.prototype.imaskn=function(e){b("number"==typeof e&&0<=e);var t=e%26,e=(e-t)/26;return b(0===this.negative,"imaskn works only with positive numbers"),this.length<=e?this:(0!=t&&e++,this.length=Math.min(e,this.length),0!=t&&(this.words[this.length-1]&=67108863^67108863>>>t<<t),this._strip())},m.prototype.maskn=function(e){return this.clone().imaskn(e)},m.prototype.iaddn=function(e){return b("number"==typeof e),b(e<67108864),e<0?this.isubn(-e):0!==this.negative?(1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(e),this.negative=1),this):this._iaddn(e)},m.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&67108864<=this.words[t];t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},m.prototype.isubn=function(e){if(b("number"==typeof e),b(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,--this.words[t+1];return this._strip()},m.prototype.addn=function(e){return this.clone().iaddn(e)},m.prototype.subn=function(e){return this.clone().isubn(e)},m.prototype.iabs=function(){return this.negative=0,this},m.prototype.abs=function(){return this.clone().iabs()},m.prototype._ishlnsubmul=function(e,t,r){for(var i=e.length+r,n=(this._expand(i),0),o=0;o<e.length;o++){var s=(0|this.words[o+r])+n,a=(0|e.words[o])*t,n=((s-=67108863&a)>>26)-(a/67108864|0);this.words[o+r]=67108863&s}for(;o<this.length-r;o++)n=(s=(0|this.words[o+r])+n)>>26,this.words[o+r]=67108863&s;if(0!==n){for(b(-1===n),o=n=0;o<this.length;o++)n=(s=-(0|this.words[o])+n)>>26,this.words[o]=67108863&s;this.negative=1}return this._strip()},m.prototype._wordDiv=function(e,t){this.length,e.length;var r,i=this.clone(),n=e,o=0|n.words[n.length-1],s=(0!=(e=26-this._countBits(o))&&(n=n.ushln(e),i.iushln(e),o=0|n.words[n.length-1]),i.length-n.length);if("mod"!==t){(r=new m(null)).length=1+s,r.words=new Array(r.length);for(var a=0;a<r.length;a++)r.words[a]=0}var f=i.clone()._ishlnsubmul(n,1,s);0===f.negative&&(i=f,r&&(r.words[s]=1));for(var h=s-1;0<=h;h--){var u=67108864*(0|i.words[n.length+h])+(0|i.words[n.length+h-1]),u=Math.min(u/o|0,67108863);for(i._ishlnsubmul(n,u,h);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(n,1,h),i.isZero()||(i.negative^=1);r&&(r.words[h]=u)}return r&&r._strip(),i._strip(),"div"!==t&&0!=e&&i.iushrn(e),{div:r||null,mod:i}},m.prototype.divmod=function(e,t,r){return b(!e.isZero()),this.isZero()?{div:new m(0),mod:new m(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.iadd(e)),{div:i,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),{div:i="mod"!==t?o.div.neg():i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new m(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new m(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new m(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,n,o},m.prototype.div=function(e){return this.divmod(e,"div",!1).div},m.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},m.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},m.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),e=e.andln(1),r=r.cmp(i);return r<0||1===e&&0===r?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},m.prototype.modrn=function(e){for(var t=e<0,r=(b((e=t?-e:e)<=67108863),(1<<26)%e),i=0,n=this.length-1;0<=n;n--)i=(r*i+(0|this.words[n]))%e;return t?-i:i},m.prototype.modn=function(e){return this.modrn(e)},m.prototype.idivn=function(e){for(var t=e<0,r=(b((e=t?-e:e)<=67108863),0),i=this.length-1;0<=i;i--){var n=(0|this.words[i])+67108864*r;this.words[i]=n/e|0,r=n%e}return this._strip(),t?this.ineg():this},m.prototype.divn=function(e){return this.clone().idivn(e)},m.prototype.egcd=function(e){b(0===e.negative),b(!e.isZero());for(var t=this,r=e.clone(),t=0!==t.negative?t.umod(e):t.clone(),i=new m(1),n=new m(0),o=new m(0),s=new m(1),a=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++a;for(var f=r.clone(),h=t.clone();!t.isZero();){for(var u=0,c=1;0==(t.words[0]&c)&&u<26;++u,c<<=1);if(0<u)for(t.iushrn(u);0<u--;)(i.isOdd()||n.isOdd())&&(i.iadd(f),n.isub(h)),i.iushrn(1),n.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(0<d)for(r.iushrn(d);0<d--;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(h)),o.iushrn(1),s.iushrn(1);0<=t.cmp(r)?(t.isub(r),i.isub(o),n.isub(s)):(r.isub(t),o.isub(i),s.isub(n))}return{a:o,b:s,gcd:r.iushln(a)}},m.prototype._invmp=function(e){b(0===e.negative),b(!e.isZero());for(var t,r=this,i=e.clone(),r=0!==r.negative?r.umod(e):r.clone(),n=new m(1),o=new m(0),s=i.clone();0<r.cmpn(1)&&0<i.cmpn(1);){for(var a=0,f=1;0==(r.words[0]&f)&&a<26;++a,f<<=1);if(0<a)for(r.iushrn(a);0<a--;)n.isOdd()&&n.iadd(s),n.iushrn(1);for(var h=0,u=1;0==(i.words[0]&u)&&h<26;++h,u<<=1);if(0<h)for(i.iushrn(h);0<h--;)o.isOdd()&&o.iadd(s),o.iushrn(1);0<=r.cmp(i)?(r.isub(i),n.isub(o)):(i.isub(r),o.isub(n))}return(t=0===r.cmpn(1)?n:o).cmpn(0)<0&&t.iadd(e),t},m.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0;for(var i=r.negative=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0)var o=t,t=r,r=o;else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},m.prototype.invm=function(e){return this.egcd(e).a.umod(e)},m.prototype.isEven=function(){return 0==(1&this.words[0])},m.prototype.isOdd=function(){return 1==(1&this.words[0])},m.prototype.andln=function(e){return this.words[0]&e},m.prototype.bincn=function(e){b("number"==typeof e);var t=e%26,e=(e-t)/26,t=1<<t;if(this.length<=e)return this._expand(1+e),this.words[e]|=t,this;for(var r=t,i=e;0!==r&&i<this.length;i++){var n=0|this.words[i],r=(n+=r)>>>26;n&=67108863,this.words[i]=n}return 0!==r&&(this.words[i]=r,this.length++),this},m.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},m.prototype.cmpn=function(e){var t=e<0;return 0===this.negative||t?0===this.negative&&t?1:(this._strip(),t=1<this.length?1:(b((e=t?-e:e)<=67108863,"Number is too big"),(t=0|this.words[0])===e?0:t<e?-1:1),0!==this.negative?0|-t:t):-1},m.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;e=this.ucmp(e);return 0!==this.negative?0|-e:e},m.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;0<=r;r--){var i=0|this.words[r],n=0|e.words[r];if(i!=n){i<n?t=-1:n<i&&(t=1);break}}return t},m.prototype.gtn=function(e){return 1===this.cmpn(e)},m.prototype.gt=function(e){return 1===this.cmp(e)},m.prototype.gten=function(e){return 0<=this.cmpn(e)},m.prototype.gte=function(e){return 0<=this.cmp(e)},m.prototype.ltn=function(e){return-1===this.cmpn(e)},m.prototype.lt=function(e){return-1===this.cmp(e)},m.prototype.lten=function(e){return this.cmpn(e)<=0},m.prototype.lte=function(e){return this.cmp(e)<=0},m.prototype.eqn=function(e){return 0===this.cmpn(e)},m.prototype.eq=function(e){return 0===this.cmp(e)},m.red=function(e){return new A(e)},m.prototype.toRed=function(e){return b(!this.red,"Already a number in reduction context"),b(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},m.prototype.fromRed=function(){return b(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},m.prototype._forceRed=function(e){return this.red=e,this},m.prototype.forceRed=function(e){return b(!this.red,"Already a number in reduction context"),this._forceRed(e)},m.prototype.redAdd=function(e){return b(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},m.prototype.redIAdd=function(e){return b(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},m.prototype.redSub=function(e){return b(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},m.prototype.redISub=function(e){return b(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},m.prototype.redShl=function(e){return b(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},m.prototype.redMul=function(e){return b(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},m.prototype.redIMul=function(e){return b(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},m.prototype.redSqr=function(){return b(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},m.prototype.redISqr=function(){return b(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},m.prototype.redSqrt=function(){return b(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},m.prototype.redInvm=function(){return b(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},m.prototype.redNeg=function(){return b(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},m.prototype.redPow=function(e){return b(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new m(t,16),this.n=this.p.bitLength(),this.k=new m(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){var t;"string"==typeof e?(t=m._prime(e),this.m=t.p,this.prime=t):(b(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null)}function k(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new m(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)}v.prototype._tmp=function(){var e=new m(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){for(var t,r=e;this.split(r,this.tmp),(t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength())>this.n;);e=t<this.n?-1:r.ucmp(this.p);return 0===e?(r.words[0]=0,r.length=1):0<e?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},r(_,v),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=4194303&n,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(4194303&o)<<4|n>>>22,n=o}0===(e.words[i-10]=n>>>=22)&&10<e.length?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(w,v),r(M,v),r(S,v),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},m._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new w;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return g[e]=t},A.prototype._verify1=function(e){b(0===e.negative,"red works only with positives"),b(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){b(0==(e.negative|t.negative),"red works only with positives"),b(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(o(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);e=e.add(t);return 0<=e.cmp(this.m)&&e.isub(this.m),e._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);e=e.iadd(t);return 0<=e.cmp(this.m)&&e.isub(this.m),e},A.prototype.sub=function(e,t){this._verify2(e,t);e=e.sub(t);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);e=e.isub(t);return e.cmpn(0)<0&&e.iadd(this.m),e},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(b(t%2==1),3===t)return t=this.m.add(new m(1)).iushrn(2),this.pow(e,t);for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);b(!r.isZero());for(var n=new m(1).toRed(this),o=n.redNeg(),s=this.m.subn(1).iushrn(1),a=new m(2*(a=this.m.bitLength())*a).toRed(this);0!==this.pow(a,s).cmp(o);)a.redIAdd(o);for(var f=this.pow(a,r),h=this.pow(e,r.addn(1).iushrn(1)),u=this.pow(e,r),c=i;0!==u.cmp(n);){for(var d=u,l=0;0!==d.cmp(n);l++)d=d.redSqr();b(l<c);var p=this.pow(f,new m(1).iushln(c-l-1)),h=h.redMul(p),f=p.redSqr(),u=u.redMul(f),c=l}return h},A.prototype.invm=function(e){e=e._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},A.prototype.pow=function(e,t){if(t.isZero())return new m(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new m(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,s=0,a=t.bitLength()%26;for(0===a&&(a=26),i=t.length-1;0<=i;i--){for(var f=t.words[i],h=a-1;0<=h;h--){var u=f>>h&1;n!==r[0]&&(n=this.sqr(n)),0==u&&0===o?s=0:(o=o<<1|u,(4===++s||0===i&&0===h)&&(n=this.mul(n,r[o]),o=s=0))}a=26}return n},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){e=e.clone();return e.red=null,e},m.mont=function(e){return new k(e)},r(k,A),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){e=this.imod(e.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;e=e.imul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new m(0)._forceRed(this);e=e.mul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:18}],41:[function(e,t,r){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":42}],42:[function(e,t,r){t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],43:[function(e,t,r){t.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],44:[function(e,t,r){var i=e("safe-buffer").Buffer,n=e("create-hash"),o=e("readable-stream"),s=e("inherits"),a=e("./sign"),f=e("./verify"),h=e("./algorithms.json");function u(e){o.Writable.call(this);e=h[e];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function c(e){o.Writable.call(this);e=h[e];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function d(e){return new u(e)}function l(e){return new c(e)}Object.keys(h).forEach(function(e){h[e].id=i.from(h[e].id,"hex"),h[e.toLowerCase()]=h[e]}),s(u,o.Writable),u.prototype._write=function(e,t,r){this._hash.update(e),r()},u.prototype.update=function(e,t){return"string"==typeof e&&(e=i.from(e,t)),this._hash.update(e),this},u.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),r=a(r,e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},s(c,o.Writable),c.prototype._write=function(e,t,r){this._hash.update(e),r()},c.prototype.update=function(e,t){return"string"==typeof e&&(e=i.from(e,t)),this._hash.update(e),this},c.prototype.verify=function(e,t,r){"string"==typeof t&&(t=i.from(t,r)),this.end();r=this._hash.digest();return f(t,r,e,this._signType,this._tag)},t.exports={Sign:d,Verify:l,createSign:d,createVerify:l}},{"./algorithms.json":42,"./sign":45,"./verify":46,"create-hash":53,inherits:102,"readable-stream":141,"safe-buffer":48}],45:[function(e,t,r){var M=e("safe-buffer").Buffer,o=e("create-hmac"),S=e("browserify-rsa"),A=e("elliptic").ec,k=e("bn.js"),E=e("parse-asn1"),x=e("./curves.json");function P(e,t,r,i){(e=M.from(e.toArray())).length<t.byteLength()&&(n=M.alloc(t.byteLength()-e.length),e=M.concat([n,e]));var n=r.length,r=function(e,t){e=(e=I(e,t)).mod(t);e=M.from(e.toArray());e.length<t.byteLength()&&(t=M.alloc(t.byteLength()-e.length),e=M.concat([t,e]));return e}(r,t),n=((t=M.alloc(n)).fill(1),M.alloc(n)),n=o(i,n).update(t).update(M.from([0])).update(e).update(r).digest(),t=o(i,n).update(t).digest();return{k:n=o(i,n).update(t).update(M.from([1])).update(e).update(r).digest(),v:t=o(i,n).update(t).digest()}}function I(e,t){var r=new k(e),e=(e.length<<3)-t.bitLength();return 0<e&&r.ishrn(e),r}function R(e,t,r){var i,n;do{for(i=M.alloc(0);8*i.length<e.bitLength();)t.v=o(r,t.k).update(t.v).digest(),i=M.concat([i,t.v])}while(n=I(i,e),t.k=o(r,t.k).update(t.v).update(M.from([0])).digest(),t.v=o(r,t.k).update(t.v).digest(),-1!==n.cmp(e));return n}t.exports=function(e,t,r,i,n){if((t=E(t)).curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");var o=e,s=t,a=x[s.curve.join(".")];if(a)return a=new A(a).keyFromPrivate(s.privateKey).sign(o),M.from(a.toDER());throw new Error("unknown curve "+s.curve.join("."))}if("dsa"===t.type){if("dsa"!==i)throw new Error("wrong private key type");for(var f,o=e,a=t,h=r,u=a.params.priv_key,c=a.params.p,d=a.params.q,l=a.params.g,p=new k(0),b=I(o,d).mod(d),m=!1,y=P(u,d,o,h);!1===m;)f=R(d,y,h),p=function(e,t,r,i){return e.toRed(k.mont(r)).redPow(t).fromRed().mod(i)}(l,f,c,d),0===(m=f.invm(d).imul(b.add(u.mul(p))).mod(d)).cmpn(0)&&(m=!1,p=new k(0));var s=p,r=m,g=(s=s.toArray(),r=r.toArray(),128&s[0]&&(s=[0].concat(s)),128&r[0]&&(r=[0].concat(r)),[48,s.length+r.length+4,2,s.length]);return g=g.concat(s,[2,r.length],r),M.from(g)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");e=M.concat([n,e]);for(var v=t.modulus.byteLength(),_=[0,1];e.length+_.length+1<v;)_.push(255);_.push(0);for(var w=-1;++w<e.length;)_.push(e[w]);return S(_,t)},t.exports.getKey=P,t.exports.makeKey=R},{"./curves.json":43,"bn.js":47,"browserify-rsa":39,"create-hmac":55,elliptic:68,"parse-asn1":111,"safe-buffer":48}],46:[function(e,t,r){var g=e("safe-buffer").Buffer,v=e("bn.js"),_=e("elliptic").ec,w=e("parse-asn1"),M=e("./curves.json");function S(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var o,s,a;if("ec"===(r=w(r)).type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");var f=e,h=t,u=r,c=M[u.data.algorithm.curve.join(".")];if(c)return c=new _(c),u=u.data.subjectPrivateKey.data,c.verify(h,f,u);throw new Error("unknown curve "+u.data.algorithm.curve.join("."))}if("dsa"===r.type){if("dsa"!==i)throw new Error("wrong public key type");return c=e,h=t,u=(f=r).data.p,o=r.data.q,m=r.data.g,f=r.data.pub_key,c=w.signature.decode(c,"der"),s=c.s,c=c.r,S(s,o),S(c,o),a=v.mont(u),s=s.invm(o),0===m.toRed(a).redPow(new v(h).mul(s).mod(o)).fromRed().mul(f.toRed(a).redPow(c.mul(s).mod(o)).fromRed()).mod(u).mod(o).cmp(c)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=g.concat([n,t]);for(var d=r.modulus.byteLength(),l=[1],p=0;t.length+l.length+2<d;)l.push(255),p++;l.push(0);for(var b=-1;++b<t.length;)l.push(t[b]);var l=g.from(l),m=v.mont(r.modulus),y=(e=(e=new v(e).toRed(m)).redPow(new v(r.publicExponent)),e=g.from(e.fromRed().toArray()),p<8?1:0),d=Math.min(e.length,l.length);for(e.length!==l.length&&(y=1),b=-1;++b<d;)y|=e[b]^l[b];return 0===y}},{"./curves.json":43,"bn.js":47,elliptic:68,"parse-asn1":111,"safe-buffer":48}],47:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{buffer:18,dup:40}],48:[function(e,t,r){var i=e("buffer"),n=i.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,r),r.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=n(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:49}],49:[function(j,e,B){!function(e){!function(){"use strict";var A=j("base64-js"),o=j("ieee754"),t=(B.Buffer=c,B.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},B.INSPECT_MAX_BYTES=50,2147483647);function f(e){if(t<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return e.__proto__=c.prototype,e}function c(e,t,r){if("number"!=typeof e)return i(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}function i(e,t,r){if("string"==typeof e){var i=e,n=t;if(!c.isEncoding(n="string"==typeof n&&""!==n?n:"utf8"))throw new TypeError("Unknown encoding: "+n);var o=0|d(i,n),s=f(o);return s=(i=s.write(i,n))!==o?s.slice(0,i):s}if(ArrayBuffer.isView(e))return h(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(I(e,ArrayBuffer)||e&&I(e.buffer,ArrayBuffer)){n=e,o=t,i=r;if(o<0||n.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(n.byteLength<o+(i||0))throw new RangeError('"length" is outside of buffer bounds');return(n=void 0===o&&void 0===i?new Uint8Array(n):void 0===i?new Uint8Array(n,o):new Uint8Array(n,o,i)).__proto__=c.prototype,n}if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');s=e.valueOf&&e.valueOf();if(null!=s&&s!==e)return c.from(s,t,r);var a=function(e){{var t,r;if(c.isBuffer(e))return t=0|u(e.length),0!==(r=f(t)).length&&e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||R(e.length)?f(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function n(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return n(e),f(e<0?0:0|u(e))}function h(e){for(var t=e.length<0?0:0|u(e.length),r=f(t),i=0;i<t;i+=1)r[i]=255&e[i];return r}function u(e){if(t<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function d(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||I(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=2<arguments.length&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return E(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return x(e).length;default:if(n)return i?-1:E(e).length;t=(""+t).toLowerCase(),n=!0}}function r(e,t,r){var i,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var o=this,s=t,a=r,f=o.length;(!a||a<0||f<a)&&(a=f);for(var h="",u=s=!s||s<0?0:s;u<a;++u)h+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(o[u]);return h;case"utf8":case"utf-8":return k(this,t,r);case"ascii":var c=this,f=t,d=r,l="";d=Math.min(c.length,d);for(var p=f;p<d;++p)l+=String.fromCharCode(127&c[p]);return l;case"latin1":case"binary":var b=this,s=t,m=r,y="";m=Math.min(b.length,m);for(var g=s;g<m;++g)y+=String.fromCharCode(b[g]);return y;case"base64":return v=this,i=r,0===(_=t)&&i===v.length?A.fromByteArray(v):A.fromByteArray(v.slice(_,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var v=t,_=r,w=this.slice(v,_),M="",S=0;S<w.length;S+=2)M+=String.fromCharCode(w[S]+256*w[S+1]);return M;default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function a(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function l(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=R(r=+r)?n?0:e.length-1:r)<0?e.length+r:r)>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:p(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):p(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function p(e,t,r,i,n){var o=1,s=e.length,a=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=o=2,a/=2,r/=2}function f(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n)for(var h=-1,u=r;u<s;u++)if(f(e,u)===f(t,-1===h?0:u-h)){if(u-(h=-1===h?u:h)+1===a)return h*o}else-1!==h&&(u-=u-h),h=-1;else for(u=r=s<r+a?s-a:r;0<=u;u--){for(var c=!0,d=0;d<a;d++)if(f(e,u+d)!==f(t,d)){c=!1;break}if(c)return u}return-1}function m(e,t,r,i){return P(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function y(e,t,r,i){return P(function(e,t){for(var r,i,n=[],o=0;o<e.length&&!((t-=2)<0);++o)i=e.charCodeAt(o),r=i>>8,i=i%256,n.push(i),n.push(r);return n}(t,e.length-r),e,r,i)}function k(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n<r;){var o,s,a,f,h=e[n],u=null,c=239<h?4:223<h?3:191<h?2:1;if(n+c<=r)switch(c){case 1:h<128&&(u=h);break;case 2:128==(192&(o=e[n+1]))&&127<(f=(31&h)<<6|63&o)&&(u=f);break;case 3:o=e[n+1],s=e[n+2],128==(192&o)&&128==(192&s)&&2047<(f=(15&h)<<12|(63&o)<<6|63&s)&&(f<55296||57343<f)&&(u=f);break;case 4:o=e[n+1],s=e[n+2],a=e[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(f=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)&&f<1114112&&(u=f)}null===u?(u=65533,c=1):65535<u&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),n+=c}var d=i,l=d.length;if(l<=g)return String.fromCharCode.apply(String,d);for(var p="",b=0;b<l;)p+=String.fromCharCode.apply(String,d.slice(b,b+=g));return p}B.kMaxLength=t,(c.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}())||"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."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),c.poolSize=8192,c.from=i,c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,c.alloc=function(e,t,r){return t=t,r=r,n(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?f(e).fill(t,r):f(e).fill(t):f(e)},c.allocUnsafe=s,c.allocUnsafeSlow=s,c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(I(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),I(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,i=t.length,n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);if(void 0===t)for(n=t=0;n<e.length;++n)t+=e[n].length;for(var r=c.allocUnsafe(t),i=0,n=0;n<e.length;++n){var o=e[n];if(I(o,Uint8Array)&&(o=c.from(o)),!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)a(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)a(this,t,t+3),a(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)a(this,t,t+7),a(this,t+1,t+6),a(this,t+2,t+5),a(this,t+3,t+4);return this},c.prototype.toLocaleString=c.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?k(this,0,e):r.apply(this,arguments)},c.prototype.equals=function(e){if(c.isBuffer(e))return this===e||0===c.compare(this,e);throw new TypeError("Argument must be a Buffer")},c.prototype.inspect=function(){var e="",t=B.INSPECT_MAX_BYTES,e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim();return this.length>t&&(e+=" ... "),"<Buffer "+e+">"},c.prototype.compare=function(e,t,r,i,n){if(I(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),(t=void 0===t?0:t)<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),f=this.slice(i,n),h=e.slice(t,r),u=0;u<a;++u)if(f[u]!==h[u]){o=f[u],s=h[u];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return l(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return l(this,e,t,r,!1)},c.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||n<r)&&(r=n),0<e.length&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,s,a,f=!1;;)switch(i){case"hex":var h=this,u=e,c=t,d=r,l=(c=Number(c)||0,h.length-c);(!d||l<(d=Number(d)))&&(d=l),(l=u.length)/2<d&&(d=l/2);for(var p=0;p<d;++p){var b=parseInt(u.substr(2*p,2),16);if(R(b))return p;h[c+p]=b}return p;case"utf8":case"utf-8":return l=t,a=r,P(E(e,(s=this).length-l),s,l,a);case"ascii":return m(this,e,t,r);case"latin1":case"binary":return m(this,e,t,r);case"base64":return s=this,a=t,o=r,P(x(e),s,a,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(f)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var g=4096;function b(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function v(e,t,r,i,n,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n<t||t<o)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function _(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function w(e,t,r,i,n){return t=+t,r>>>=0,n||_(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function M(e,t,r,i,n){return t=+t,r>>>=0,n||_(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),t<e&&(t=e),this.subarray(e,t));return r.__proto__=c.prototype,r},c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var i=this[e],n=1,o=0;++o<t&&(n*=256);)i+=this[e+o]*n;return i},c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var i=this[e+--t],n=1;0<t&&(n*=256);)i+=this[e+--t]*n;return i},c.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var i=this[e],n=1,o=0;++o<t&&(n*=256);)i+=this[e+o]*n;return(n*=128)<=i&&(i-=Math.pow(2,8*t)),i},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0<i&&(n*=256);)o+=this[e+--i]*n;return(n*=128)<=o&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},c.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||v(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o<r&&(n*=256);)this[t+o]=e/n&255;return t+r},c.prototype.writeUIntBE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||v(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){e=+e,t>>>=0,i||v(this,e,t,r,(i=Math.pow(2,8*r-1))-1,-i);var n=0,o=1,s=0;for(this[t]=255&e;++n<r&&(o*=256);)e<0&&0===s&&0!==this[t+n-1]&&(s=1),this[t+n]=(e/o>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){e=+e,t>>>=0,i||v(this,e,t,r,(i=Math.pow(2,8*r-1))-1,-i);var n=r-1,o=1,s=0;for(this[t+n]=255&e;0<=--n&&(o*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return w(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return w(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),(i=0<i&&i<r?r:i)===r)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length);var n=(i=e.length-t<i-r?e.length-t+r:i)-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,i);else if(this===e&&r<t&&t<i)for(var o=n-1;0<=o;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return n},c.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);var n;1===e.length&&(n=e.charCodeAt(0),("utf8"===i&&n<128||"latin1"===i)&&(e=n))}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");var o;if(!(r<=t))if(t>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o<r;++o)this[o]=e;else{var s=c.isBuffer(e)?e:c.from(e,i),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var S=/[^+/0-9A-Za-z-_]/g;function E(e,t){t=t||1/0;for(var r,i=e.length,n=null,o=[],s=0;s<i;++s){if(55295<(r=e.charCodeAt(s))&&r<57344){if(!n){if(56319<r){-1<(t-=3)&&o.push(239,191,189);continue}if(s+1===i){-1<(t-=3)&&o.push(239,191,189);continue}n=r;continue}if(r<56320){-1<(t-=3)&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&-1<(t-=3)&&o.push(239,191,189);if(n=null,r<128){if(--t<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function x(e){return A.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function P(e,t,r,i){for(var n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function I(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function R(e){return e!=e}}.call(this)}.call(this,j("buffer").Buffer)},{"base64-js":15,buffer:49,ieee754:101}],50:[function(e,t,r){!function(o){!function(){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new o(r),n=0;n<r;++n)i[n]=e[n]^t[n];return i}}.call(this)}.call(this,e("buffer").Buffer)},{buffer:49}],51:[function(e,t,r){var i=e("safe-buffer").Buffer,n=e("stream").Transform,o=e("string_decoder").StringDecoder;function s(e){n.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(s,n),s.prototype.update=function(e,t,r){"string"==typeof e&&(e=i.from(e,t));t=this._update(e);return this.hashMode?this:r?this._toString(t,r):t},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||i.alloc(0);return t=e?this._toString(t,e,!0):t},s.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");t=this._decoder.write(e);return r&&(t+=this._decoder.end()),t},t.exports=s},{inherits:102,"safe-buffer":143,stream:153,string_decoder:154}],52:[function(e,a,t){!function(s){!function(){var t=e("elliptic"),r=e("bn.js"),i=(a.exports=function(e){return new n(e)},{secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}});function n(e){this.curveType=i[e],this.curveType||(this.curveType={name:e}),this.curve=new t.ec(this.curveType.name),this.keys=void 0}function o(e,t,r){Array.isArray(e)||(e=e.toArray());e=new s(e);return r&&e.length<r&&((r=new s(r-e.length)).fill(0),e=s.concat([r,e])),t?e.toString(t):e}i.p224=i.secp224r1,i.p256=i.secp256r1=i.prime256v1,i.p192=i.secp192r1=i.prime192v1,i.p384=i.secp384r1,i.p521=i.secp521r1,n.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},n.prototype.computeSecret=function(e,t,r){return t=t||"utf8",s.isBuffer(e)||(e=new s(e,t)),o(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},n.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),o(r,e)},n.prototype.getPrivateKey=function(e){return o(this.keys.getPrivate(),e)},n.prototype.setPublicKey=function(e,t){return t=t||"utf8",s.isBuffer(e)||(e=new s(e,t)),this.keys._importPublic(e),this},n.prototype.setPrivateKey=function(e,t){t=t||"utf8",s.isBuffer(e)||(e=new s(e,t));t=(t=new r(e)).toString(16);return this.keys=this.curve.genKeyPair(),this.keys._importPrivate(t),this}}.call(this)}.call(this,e("buffer").Buffer)},{"bn.js":16,buffer:49,elliptic:68}],53:[function(e,t,r){"use strict";var i=e("inherits"),n=e("md5.js"),o=e("ripemd160"),s=e("sha.js"),a=e("cipher-base");function f(e){a.call(this,"digest"),this._hash=e}i(f,a),f.prototype._update=function(e){this._hash.update(e)},f.prototype._final=function(){return this._hash.digest()},t.exports=function(e){return"md5"===(e=e.toLowerCase())?new n:"rmd160"===e||"ripemd160"===e?new o:new f(s(e))}},{"cipher-base":51,inherits:102,"md5.js":103,ripemd160:142,"sha.js":146}],54:[function(e,t,r){var i=e("md5.js");t.exports=function(e){return(new i).update(e).digest()}},{"md5.js":103}],55:[function(e,t,r){"use strict";var i=e("inherits"),n=e("./legacy"),s=e("cipher-base"),a=e("safe-buffer").Buffer,o=e("create-hash/md5"),f=e("ripemd160"),h=e("sha.js"),u=a.alloc(128);function c(e,t){s.call(this,"digest"),"string"==typeof t&&(t=a.from(t));for(var r="sha512"===e||"sha384"===e?128:64,i=(this._alg=e,(this._key=t).length>r?t=("rmd160"===e?new f:h(e)).update(t).digest():t.length<r&&(t=a.concat([t,u],r)),this._ipad=a.allocUnsafe(r)),n=this._opad=a.allocUnsafe(r),o=0;o<r;o++)i[o]=54^t[o],n[o]=92^t[o];this._hash="rmd160"===e?new f:h(e),this._hash.update(i)}i(c,s),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new f:h(this._alg)).update(this._opad).update(e).digest()},t.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new c("rmd160",t):"md5"===e?new n(o,t):new c(e,t)}},{"./legacy":56,"cipher-base":51,"create-hash/md5":54,inherits:102,ripemd160:142,"safe-buffer":143,"sha.js":146}],56:[function(e,t,r){"use strict";var i=e("inherits"),o=e("safe-buffer").Buffer,s=e("cipher-base"),a=o.alloc(128);function n(e,t){s.call(this,"digest"),"string"==typeof t&&(t=o.from(t)),this._alg=e,64<(this._key=t).length?t=e(t):t.length<64&&(t=o.concat([t,a],64));for(var r=this._ipad=o.allocUnsafe(64),i=this._opad=o.allocUnsafe(64),n=0;n<64;n++)r[n]=54^t[n],i[n]=92^t[n];this._hash=[r]}i(n,s),n.prototype._update=function(e){this._hash.push(e)},n.prototype._final=function(){var e=this._alg(o.concat(this._hash));return this._alg(o.concat([this._opad,e]))},t.exports=n},{"cipher-base":51,inherits:102,"safe-buffer":143}],57:[function(e,t,r){"use strict";r.randomBytes=r.rng=r.pseudoRandomBytes=r.prng=e("randombytes"),r.createHash=r.Hash=e("create-hash"),r.createHmac=r.Hmac=e("create-hmac");var i=e("browserify-sign/algos"),i=Object.keys(i),n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i),i=(r.getHashes=function(){return n},e("pbkdf2")),i=(r.pbkdf2=i.pbkdf2,r.pbkdf2Sync=i.pbkdf2Sync,e("browserify-cipher")),i=(r.Cipher=i.Cipher,r.createCipher=i.createCipher,r.Cipheriv=i.Cipheriv,r.createCipheriv=i.createCipheriv,r.Decipher=i.Decipher,r.createDecipher=i.createDecipher,r.Decipheriv=i.Decipheriv,r.createDecipheriv=i.createDecipheriv,r.getCiphers=i.getCiphers,r.listCiphers=i.listCiphers,e("diffie-hellman")),i=(r.DiffieHellmanGroup=i.DiffieHellmanGroup,r.createDiffieHellmanGroup=i.createDiffieHellmanGroup,r.getDiffieHellman=i.getDiffieHellman,r.createDiffieHellman=i.createDiffieHellman,r.DiffieHellman=i.DiffieHellman,e("browserify-sign")),i=(r.createSign=i.createSign,r.Sign=i.Sign,r.createVerify=i.createVerify,r.Verify=i.Verify,r.createECDH=e("create-ecdh"),e("public-encrypt")),i=(r.publicEncrypt=i.publicEncrypt,r.privateEncrypt=i.privateEncrypt,r.publicDecrypt=i.publicDecrypt,r.privateDecrypt=i.privateDecrypt,e("randomfill"));r.randomFill=i.randomFill,r.randomFillSync=i.randomFillSync,r.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},r.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":36,"browserify-sign":44,"browserify-sign/algos":41,"create-ecdh":52,"create-hash":53,"create-hmac":55,"diffie-hellman":64,pbkdf2:112,"public-encrypt":119,randombytes:125,randomfill:126}],58:[function(e,t,r){"use strict";r.utils=e("./des/utils"),r.Cipher=e("./des/cipher"),r.DES=e("./des/des"),r.CBC=e("./des/cbc"),r.EDE=e("./des/ede")},{"./des/cbc":59,"./des/cipher":60,"./des/des":61,"./des/ede":62,"./des/utils":63}],59:[function(e,t,r){"use strict";var i=e("minimalistic-assert"),o=e("inherits"),s={};function n(e){i.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}r.instantiate=function(t){function r(e){t.call(this,e),this._cbcInit()}o(r,t);for(var e=Object.keys(s),i=0;i<e.length;i++){var n=e[i];r.prototype[n]=s[n]}return r.create=function(e){return new r(e)},r},s._cbcInit=function(){var e=new n(this.options.iv);this._cbcState=e},s._update=function(e,t,r,i){var n=this._cbcState,o=this.constructor.super_.prototype,s=n.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=e[t+a];o._update.call(this,s,0,r,i);for(a=0;a<this.blockSize;a++)s[a]=r[i+a]}else{o._update.call(this,e,t,r,i);for(a=0;a<this.blockSize;a++)r[i+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=e[t+a]}}},{inherits:102,"minimalistic-assert":105}],60:[function(e,t,r){"use strict";var i=e("minimalistic-assert");function n(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}(t.exports=n).prototype._init=function(){},n.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},n.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),i=0;i<r;i++)this.buffer[this.bufferOff+i]=e[t+i];return this.bufferOff+=r,r},n.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},n.prototype._updateEncrypt=function(e){for(var t=0,r=0,i=(this.bufferOff+e.length)/this.blockSize|0,n=new Array(i*this.blockSize),o=(0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(n,r))),e.length-(e.length-t)%this.blockSize);t<o;t+=this.blockSize)this._update(e,t,n,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return n},n.prototype._updateDecrypt=function(e){for(var t=0,r=0,i=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,n=new Array(i*this.blockSize);0<i;i--)t+=this._buffer(e,t),r+=this._flushBuffer(n,r);return t+=this._buffer(e,t),n},n.prototype.final=function(e){var t;return e&&(t=this.update(e)),e="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(e):e},n.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},n.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},n.prototype._unpad=function(e){return e},n.prototype._finalDecrypt=function(){i.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},{"minimalistic-assert":105}],61:[function(e,t,r){"use strict";var s=e("minimalistic-assert"),i=e("inherits"),u=e("./utils"),n=e("./cipher");function o(){this.tmp=new Array(2),this.keys=null}function a(e){n.call(this,e);var t=new o;this._desState=t,this.deriveKeys(t,e.key)}i(a,n),(t.exports=a).create=function(e){return new a(e)};var f=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];a.prototype.deriveKeys=function(e,t){e.keys=new Array(32),s.equal(t.length,this.blockSize,"Invalid key length");var r=u.readUInt32BE(t,0),i=u.readUInt32BE(t,4);u.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var n=0;n<e.keys.length;n+=2){var o=f[n>>>1],r=u.r28shl(r,o),i=u.r28shl(i,o);u.pc2(r,i,e.keys,n)}},a.prototype._update=function(e,t,r,i){var n=this._desState,o=u.readUInt32BE(e,t),e=u.readUInt32BE(e,t+4);u.ip(o,e,n.tmp,0),o=n.tmp[0],e=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,e,n.tmp,0):this._decrypt(n,o,e,n.tmp,0),o=n.tmp[0],e=n.tmp[1],u.writeUInt32BE(r,o,i),u.writeUInt32BE(r,e,i+4)},a.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i<e.length;i++)e[i]=r;return!0},a.prototype._unpad=function(e){for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)s.equal(e[r],t);return e.slice(0,e.length-t)},a.prototype._encrypt=function(e,t,r,i,n){for(var o=t,s=r,a=0;a<e.keys.length;a+=2)var f=e.keys[a],h=e.keys[a+1],f=(u.expand(s,e.tmp,0),f^=e.tmp[0],h^=e.tmp[1],u.substitute(f,h)),h=s,s=(o^u.permute(f))>>>0,o=h;u.rip(s,o,i,n)},a.prototype._decrypt=function(e,t,r,i,n){for(var o=r,s=t,a=e.keys.length-2;0<=a;a-=2)var f=e.keys[a],h=e.keys[a+1],f=(u.expand(o,e.tmp,0),f^=e.tmp[0],h^=e.tmp[1],u.substitute(f,h)),h=o,o=(s^u.permute(f))>>>0,s=h;u.rip(o,s,i,n)}},{"./cipher":60,"./utils":63,inherits:102,"minimalistic-assert":105}],62:[function(e,t,r){"use strict";var n=e("minimalistic-assert"),i=e("inherits"),o=e("./cipher"),s=e("./des");function a(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),t=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:t})]:[s.create({type:"decrypt",key:t}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function f(e){o.call(this,e);e=new a(this.type,this.options.key);this._edeState=e}i(f,o),(t.exports=f).create=function(e){return new f(e)},f.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},f.prototype._pad=s.prototype._pad,f.prototype._unpad=s.prototype._unpad},{"./cipher":60,"./des":61,inherits:102,"minimalistic-assert":105}],63:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var n=0,o=0,s=6;0<=s;s-=2){for(var a=0;a<=24;a+=8)n=n<<1|t>>>a+s&1;for(a=0;a<=24;a+=8)n=n<<1|e>>>a+s&1}for(s=6;0<=s;s-=2){for(a=1;a<=25;a+=8)o=o<<1|t>>>a+s&1;for(a=1;a<=25;a+=8)o=o<<1|e>>>a+s&1}r[i+0]=n>>>0,r[i+1]=o>>>0},r.rip=function(e,t,r,i){for(var n=0,o=0,s=0;s<4;s++)for(var a=24;0<=a;a-=8)n=(n=n<<1|t>>>a+s&1)<<1|e>>>a+s&1;for(s=4;s<8;s++)for(a=24;0<=a;a-=8)o=(o=o<<1|t>>>a+s&1)<<1|e>>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.pc1=function(e,t,r,i){for(var n=0,o=0,s=7;5<=s;s--){for(var a=0;a<=24;a+=8)n=n<<1|t>>a+s&1;for(a=0;a<=24;a+=8)n=n<<1|e>>a+s&1}for(a=0;a<=24;a+=8)n=n<<1|t>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o=o<<1|t>>a+s&1;for(a=0;a<=24;a+=8)o=o<<1|e>>a+s&1}for(a=0;a<=24;a+=8)o=o<<1|e>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};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],n=(r.pc2=function(e,t,r,i){for(var n=0,o=0,s=f.length>>>1,a=0;a<s;a++)n=n<<1|e>>>f[a]&1;for(a=s;a<f.length;a++)o=o<<1|t>>>f[a]&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.expand=function(e,t,r){for(var i=0,n=0,i=(1&e)<<5|e>>>27,o=23;15<=o;o-=4)i=i<<6|e>>>o&63;for(o=11;3<=o;o-=4)n=(n|e>>>o&63)<<6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0},[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]),i=(r.substitute=function(e,t){for(var r=0,i=0;i<4;i++)r=r<<4|n[64*i+(e>>>18-6*i&63)];for(i=0;i<4;i++)r=r<<4|n[256+64*i+(t>>>18-6*i&63)];return r>>>0},[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7]);r.permute=function(e){for(var t=0,r=0;r<i.length;r++)t=t<<1|e>>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.length<t;)i="0"+i;for(var n=[],o=0;o<t;o+=r)n.push(i.slice(o,o+r));return n.join(" ")}},{}],64:[function(e,t,i){!function(f){!function(){var o=e("./lib/generatePrime"),r=e("./lib/primes.json"),s=e("./lib/dh");var a={binary:!0,hex:!0,base64:!0};i.DiffieHellmanGroup=i.createDiffieHellmanGroup=i.getDiffieHellman=function(e){var t=new f(r[e].prime,"hex"),e=new f(r[e].gen,"hex");return new s(t,e)},i.createDiffieHellman=i.DiffieHellman=function e(t,r,i,n){return f.isBuffer(r)||void 0===a[r]?e(t,"binary",r,i):(r=r||"binary",n=n||"binary",i=i||new f([2]),f.isBuffer(i)||(i=new f(i,n)),"number"==typeof t?new s(o(t,i),i,!0):(f.isBuffer(t)||(t=new f(t,r)),new s(t,i,!0)))}}.call(this)}.call(this,e("buffer").Buffer)},{"./lib/dh":65,"./lib/generatePrime":66,"./lib/primes.json":67,buffer:49}],65:[function(b,m,e){!function(p){!function(){var i=b("bn.js"),o=new(b("miller-rabin")),s=new i(24),a=new i(11),f=new i(10),h=new i(3),u=new i(7),c=b("./generatePrime"),e=b("randombytes");function n(e,t){return t=t||"utf8",p.isBuffer(e)||(e=new p(e,t)),this._pub=new i(e),this}function d(e,t){return t=t||"utf8",p.isBuffer(e)||(e=new p(e,t)),this._priv=new i(e),this}m.exports=t;var l={};function t(e,t,r){this.setGenerator(t),this.__prime=new i(e),this._prime=i.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=n,this.setPrivateKey=d):this._primeCode=8}function r(e,t){e=new p(e.toArray());return t?e.toString(t):e}Object.defineProperty(t.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=[t=t.toString("hex"),e.toString(16)].join("_");if(r in l)return l[r];var i,n=0;if(e.isEven()||!c.simpleSieve||!c.fermatTest(e)||!o.test(e))return l[r]=n=n+1+("02"===t||"05"===t?8:4);switch(o.test(e.shrn(1))||(n+=2),t){case"02":e.mod(s).cmp(a)&&(n+=8);break;case"05":(i=e.mod(f)).cmp(h)&&i.cmp(u)&&(n+=8);break;default:n+=4}return l[r]=n}(this.__prime,this.__gen)),this._primeCode}}),t.prototype.generateKeys=function(){return this._priv||(this._priv=new i(e(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},t.prototype.computeSecret=function(e){var e=(e=(e=new i(e)).toRed(this._prime)).redPow(this._priv).fromRed(),e=new p(e.toArray()),t=this.getPrime();return e.length<t.length&&((t=new p(t.length-e.length)).fill(0),e=p.concat([t,e])),e},t.prototype.getPublicKey=function(e){return r(this._pub,e)},t.prototype.getPrivateKey=function(e){return r(this._priv,e)},t.prototype.getPrime=function(e){return r(this.__prime,e)},t.prototype.getGenerator=function(e){return r(this._gen,e)},t.prototype.setGenerator=function(e,t){return t=t||"utf8",p.isBuffer(e)||(e=new p(e,t)),this.__gen=e,this._gen=new i(e),this}}.call(this)}.call(this,b("buffer").Buffer)},{"./generatePrime":66,"bn.js":16,buffer:49,"miller-rabin":104,randombytes:125}],66:[function(e,t,r){var n=e("randombytes"),o=((t.exports=i).simpleSieve=m,i.fermatTest=y,e("bn.js")),s=new o(24),a=new(e("miller-rabin")),f=new o(1),h=new o(2),u=new o(5),c=(new o(16),new o(8),new o(10)),d=new o(3),l=(new o(7),new o(11)),p=new o(4),b=(new o(12),null);function m(e){for(var t=function(){if(null!==b)return b;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var i=Math.ceil(Math.sqrt(r)),n=0;n<t&&e[n]<=i&&r%e[n]!=0;n++);t!==n&&e[n]<=i||(e[t++]=r)}return b=e}(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function y(e){var t=o.mont(e);return 0===h.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function i(e,t){if(e<16)return new o(2===t||5===t?[140,123]:[140,39]);var r,i;for(t=new o(t);;){for(r=new o(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(f),r.testn(1)||r.iadd(h),t.cmp(h)){if(!t.cmp(u))for(;r.mod(c).cmp(d);)r.iadd(p)}else for(;r.mod(s).cmp(l);)r.iadd(p);if(m(i=r.shrn(1))&&m(r)&&y(i)&&y(r)&&a.test(i)&&a.test(r))return r}}},{"bn.js":16,"miller-rabin":104,randombytes:125}],67:[function(e,t,r){t.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"}}},{}],68:[function(e,t,r){"use strict";r.version=e("../package.json").version,r.utils=e("./elliptic/utils"),r.rand=e("brorand"),r.curve=e("./elliptic/curve"),r.curves=e("./elliptic/curves"),r.ec=e("./elliptic/ec"),r.eddsa=e("./elliptic/eddsa")},{"../package.json":83,"./elliptic/curve":71,"./elliptic/curves":74,"./elliptic/ec":75,"./elliptic/eddsa":78,"./elliptic/utils":82,brorand:17}],69:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../utils"),k=n.getNAF,E=n.getJSF,c=n.assert;function o(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;e=this.n&&this.p.div(this.n);!e||0<e.cmpn(100)?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function s(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=o).prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){c(e.precomputed);for(var r=e._getDoubles(),i=k(t,1,this._bitLength),e=(1<<r.step+1)-(r.step%2==0?2:1),n=(e/=3,[]),o=0;o<i.length;o+=r.step){for(var s=0,a=o+r.step-1;o<=a;a--)s=(s<<1)+i[a];n.push(s)}for(var f=this.jpoint(null,null,null),h=this.jpoint(null,null,null),u=e;0<u;u--){for(o=0;o<n.length;o++)(s=n[o])===u?h=h.mixedAdd(r.points[o]):s===-u&&(h=h.mixedAdd(r.points[o].neg()));f=f.add(h)}return f.toP()},o.prototype._wnafMul=function(e,t){for(var r=e._getNAFPoints(4),i=r.wnd,n=r.points,o=k(t,i,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;0<=a;a--){for(var f=0;0<=a&&0===o[a];a--)f++;if(0<=a&&f++,s=s.dblp(f),a<0)break;var h=o[a];c(0!==h),s="affine"===e.type?0<h?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):0<h?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===e.type?s.toP():s},o.prototype._wnafMulAdd=function(e,t,r,i,n){for(var o=this._wnafT1,s=this._wnafT2,a=this._wnafT3,f=0,h=0;h<i;h++){var u,c=(u=t[h])._getNAFPoints(e);o[h]=c.wnd,s[h]=c.points}for(h=i-1;1<=h;h-=2){var d=h-1,l=h;if(1!==o[d]||1!==o[l])a[d]=k(r[d],o[d],this._bitLength),a[l]=k(r[l],o[l],this._bitLength),f=Math.max(a[d].length,f),f=Math.max(a[l].length,f);else{var p=[t[d],null,null,t[l]],b=(0===t[d].y.cmp(t[l].y)?(p[1]=t[d].add(t[l]),p[2]=t[d].toJ().mixedAdd(t[l].neg())):0===t[d].y.cmp(t[l].y.redNeg())?(p[1]=t[d].toJ().mixedAdd(t[l]),p[2]=t[d].add(t[l].neg())):(p[1]=t[d].toJ().mixedAdd(t[l]),p[2]=t[d].toJ().mixedAdd(t[l].neg())),[-3,-1,-5,-7,0,7,5,1,3]),m=E(r[d],r[l]),f=Math.max(m[0].length,f);for(a[d]=new Array(f),a[l]=new Array(f),S=0;S<f;S++){var y=0|m[0][S],g=0|m[1][S];a[d][S]=b[3*(1+y)+(1+g)],a[l][S]=0,s[d]=p}}}var v=this.jpoint(null,null,null),_=this._wnafT4;for(h=f;0<=h;h--){for(var w=0;0<=h;){for(var M=!0,S=0;S<i;S++)_[S]=0|a[S][h],0!==_[S]&&(M=!1);if(!M)break;w++,h--}if(0<=h&&w++,v=v.dblp(w),h<0)break;for(S=0;S<i;S++){var A=_[S];0!==A&&(0<A?u=s[S][A-1>>1]:A<0&&(u=s[S][-A-1>>1].neg()),v="affine"===u.type?v.mixedAdd(u):v.add(u))}}for(h=0;h<i;h++)s[h]=null;return n?v:v.toP()},(o.BasePoint=s).prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(e,t){e=n.toArray(e,t);t=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*t)return 6===e[0]?c(e[e.length-1]%2==0):7===e[0]&&c(e[e.length-1]%2==1),this.point(e.slice(1,1+t),e.slice(1+t,1+2*t));if(2!==e[0]&&3!==e[0]||e.length-1!==t)throw new Error("Unknown point format");return this.pointFromX(e.slice(1,1+t),3===e[0])},s.prototype.encodeCompressed=function(e){return this.encode(e,!0)},s.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},s.prototype.encode=function(e,t){return n.encode(this._encode(t),e)},s.prototype.precompute=function(e){var t;return this.precomputed||((t={doubles:null,naf:null,beta:null}).naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t),this},s.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},s.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var o=0;o<e;o++)i=i.dbl();r.push(i)}return{step:e,points:r}},s.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1==r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},{"../utils":82,"bn.js":16}],70:[function(e,t,r){"use strict";var i=e("../utils"),o=e("bn.js"),n=e("inherits"),s=e("./base"),a=i.assert;function f(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function h(e,t,r,i,n){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(t,16),this.y=new o(r,16),this.z=i?new o(i,16):this.curve.one,this.t=n&&new o(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}n(f,s),(t.exports=f).prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},f.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},f.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},f.prototype.pointFromX=function(e,t){var r=(e=(e=new o(e,16)).red?e:e.toRed(this.red)).redSqr(),i=this.c2.redSub(this.a.redMul(r)),r=this.one.redSub(this.c2.redMul(this.d).redMul(r)),i=i.redMul(r.redInvm()),r=i.redSqrt();if(0!==r.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},f.prototype.pointFromY=function(e,t){var r=(e=(e=new o(e,16)).red?e:e.toRed(this.red)).redSqr(),i=r.redSub(this.c2),r=r.redMul(this.d).redMul(this.c2).redSub(this.a),i=i.redMul(r.redInvm());if(0===i.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}r=i.redSqrt();if(0!==r.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");return r.fromRed().isOdd()!==t&&(r=r.redNeg()),this.point(r,e)},f.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),e=e.y.redSqr(),r=t.redMul(this.a).redAdd(e),t=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(e)));return 0===r.cmp(t)},n(h,s.BasePoint),f.prototype.pointFromJSON=function(e){return h.fromJSON(this,e)},f.prototype.point=function(e,t,r,i){return new h(this,e,t,r,i)},h.fromJSON=function(e,t){return new h(e,t[0],t[1],t[2])},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},h.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=(r=this.z.redSqr()).redIAdd(r),i=this.curve._mulA(e),e=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),n=i.redAdd(t),r=n.redSub(r),i=i.redSub(t),t=e.redMul(r),o=n.redMul(i),e=e.redMul(i),i=r.redMul(n);return this.curve.point(t,o,i,e)},h.prototype._projDbl=function(){var e,t,r,i,n,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),f=this.y.redSqr();return o=this.curve.twisted?(o=(n=this.curve._mulA(a)).redAdd(f),this.zOne?(e=s.redSub(a).redSub(f).redMul(o.redSub(this.curve.two)),t=o.redMul(n.redSub(f)),o.redSqr().redSub(o).redSub(o)):(r=this.z.redSqr(),i=o.redSub(r).redISub(r),e=s.redSub(a).redISub(f).redMul(i),t=o.redMul(n.redSub(f)),o.redMul(i))):(n=a.redAdd(f),r=this.curve._mulC(this.z).redSqr(),i=n.redSub(r).redSub(r),e=this.curve._mulC(s.redISub(n)).redMul(i),t=this.curve._mulC(n).redMul(a.redISub(f)),n.redMul(i)),this.curve.point(e,t,o)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},h.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),e=this.z.redMul(e.z.redAdd(e.z)),n=r.redSub(t),o=e.redSub(i),e=e.redAdd(i),i=r.redAdd(t),r=n.redMul(o),t=e.redMul(i),n=n.redMul(i),i=o.redMul(e);return this.curve.point(r,t,i,n)},h.prototype._projAdd=function(e){var t,r=this.z.redMul(e.z),i=r.redSqr(),n=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(n).redMul(o),a=i.redSub(s),i=i.redAdd(s),s=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(o),e=r.redMul(a).redMul(s),s=this.curve.twisted?(t=r.redMul(i).redMul(o.redSub(this.curve._mulA(n))),a.redMul(i)):(t=r.redMul(i).redMul(o.redSub(n)),this.curve._mulC(a).redMul(i));return this.curve.point(e,t,s)},h.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},h.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},h.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},h.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},h.prototype.normalize=function(){var e;return this.zOne||(e=this.z.redInvm(),this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0),this},h.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()},h.prototype.getY=function(){return this.normalize(),this.y.fromRed()},h.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},h.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},h.prototype.toP=h.prototype.normalize,h.prototype.mixedAdd=h.prototype.add},{"../utils":82,"./base":69,"bn.js":16,inherits:102}],71:[function(e,t,r){"use strict";r.base=e("./base"),r.short=e("./short"),r.mont=e("./mont"),r.edwards=e("./edwards")},{"./base":69,"./edwards":70,"./mont":72,"./short":73}],72:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("inherits"),o=e("./base"),s=e("../utils");function a(e){o.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,o),(t.exports=a).prototype.validate=function(e){var e=e.normalize().x,t=e.redSqr(),t=t.redMul(e).redAdd(t.redMul(this.a)).redAdd(e);return 0===t.redSqrt().redSqr().cmp(t)},n(f,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new f(this,e,t)},a.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(e,t){return new f(e,t[0],t[1]||e.one)},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),e=e.redMul(t),t=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(e,t)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),e=e.x.redSub(e.z).redMul(r),r=n.redMul(i),n=t.z.redMul(e.redAdd(r).redSqr()),i=t.x.redMul(e.redISub(r).redSqr());return this.curve.point(n,i)},f.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;0<=o;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":82,"./base":69,"bn.js":16,inherits:102}],73:[function(e,t,r){"use strict";var i=e("../utils"),v=e("bn.js"),n=e("inherits"),o=e("./base"),s=i.assert;function a(e){o.call(this,"short",e),this.a=new v(e.a,16).toRed(this.red),this.b=new v(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function f(e,t,r,i){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new v(t,16),this.y=new v(r,16),i&&(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 h(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new v(0)):(this.x=new v(t,16),this.y=new v(r,16),this.z=new v(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}n(a,o),(t.exports=a).prototype._getEndomorphism=function(e){var t,r,i;if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3))return r=(e.beta?new v(e.beta,16):r=(r=this._getEndoRoots(this.p))[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red),e.lambda?t=new v(e.lambda,16):(i=this._getEndoRoots(this.n),0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(r))?t=i[0]:(t=i[1],s(0===this.g.mul(t).x.cmp(this.g.x.redMul(r))))),{beta:r,lambda:t,basis:e.basis?e.basis.map(function(e){return{a:new v(e.a,16),b:new v(e.b,16)}}):this._getEndoBasis(t)}},a.prototype._getEndoRoots=function(e){var e=e===this.p?this.red:v.mont(e),t=new v(2).toRed(e).redInvm(),r=t.redNeg(),e=new v(3).toRed(e).redNeg().redSqrt().redMul(t);return[r.redAdd(e).fromRed(),r.redSub(e).fromRed()]},a.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),a=e,f=this.n.clone(),h=new v(1),u=new v(0),c=new v(0),d=new v(1),l=0;0!==a.cmpn(0);){var p=f.div(a),b=f.sub(p.mul(a)),m=c.sub(p.mul(h)),p=d.sub(p.mul(u));if(!i&&b.cmp(s)<0)t=o.neg(),r=h,i=b.neg(),n=m;else if(i&&2==++l)break;f=a,a=o=b,c=h,h=m,d=u,u=p}var e=b.neg(),y=m,g=i.sqr().add(n.sqr());return 0<=e.sqr().add(y.sqr()).cmp(g)&&(e=t,y=r),i.negative&&(i=i.neg(),n=n.neg()),e.negative&&(e=e.neg(),y=y.neg()),[{a:i,b:n},{a:e,b:y}]},a.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],t=t[1],i=t.b.mul(e).divRound(this.n),n=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),s=n.mul(t.a),i=i.mul(r.b),r=n.mul(t.b);return{k1:e.sub(o).sub(s),k2:i.add(r).neg()}},a.prototype.pointFromX=function(e,t){var r=(e=(e=new v(e,16)).red?e:e.toRed(this.red)).redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");r=i.fromRed().isOdd();return(t&&!r||!t&&r)&&(i=i.redNeg()),this.point(e,i)},a.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,e=e.y,r=this.a.redMul(t),t=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===e.redSqr().redISub(t).cmpn(0)},a.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],f=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),i[2*o]=a,i[2*o+1]=f,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var r=this._wnafMulAdd(1,i,n,2*o,r),h=0;h<2*o;h++)i[h]=null,n[h]=null;return r},n(f,o.BasePoint),a.prototype.point=function(e,t,r){return new f(this,e,t,r)},a.prototype.pointFromJSON=function(e,t){return f.fromJSON(this,e,t)},f.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t,r,i=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);return e&&(t=this.curve,r=function(e){return t.point(e.x.redMul(t.endo.beta),e.y)},(e.beta=i).precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}),i}},f.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},f.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);return e[2]&&(e=e[2],i.precomputed={beta:null,doubles:e.doubles&&{step:e.doubles.step,points:[i].concat(e.doubles.points.map(n))},naf:e.naf&&{wnd:e.naf.wnd,points:[i].concat(e.naf.points.map(n))}}),i;function n(e){return t.point(e[0],e[1],r)}},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y),e=(t=0!==t.cmpn(0)?t.redMul(this.x.redSub(e.x).redInvm()):t).redSqr().redISub(this.x).redISub(e.x),t=t.redMul(this.x.redSub(e)).redISub(this.y);return this.curve.point(e,t)},f.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),e=e.redInvm(),r=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(e),t=r.redSqr().redISub(this.x.redAdd(this.x)),e=r.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,e)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(e){return e=new v(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){t=[this,t],e=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(t,e):this.curve._wnafMulAdd(1,t,e,2)},f.prototype.jmulAdd=function(e,t,r){t=[this,t],e=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(t,e,!0):this.curve._wnafMulAdd(1,t,e,2,!0)},f.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},f.prototype.neg=function(e){if(this.inf)return this;var t,r=this.curve.point(this.x,this.y.redNeg());return e&&this.precomputed&&(e=this.precomputed,t=function(e){return e.neg()},r.precomputed={naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(t)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(t)}}),r},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},n(h,o.BasePoint),a.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),t=this.y.redMul(t).redMul(e);return this.curve.point(r,t)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),t=this.y.redMul(t.redMul(e.z)),r=e.y.redMul(r.redMul(this.z)),n=i.redSub(n),r=t.redSub(r);if(0===n.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=n.redSqr(),s=o.redMul(n),i=i.redMul(o),o=r.redSqr().redIAdd(s).redISub(i).redISub(i),r=r.redMul(i.redISub(o)).redISub(t.redMul(s)),i=this.z.redMul(e.z).redMul(n);return this.curve.jpoint(o,r,i)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,e=e.y.redMul(t).redMul(this.z),t=r.redSub(i),i=n.redSub(e);if(0===t.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var e=t.redSqr(),o=e.redMul(t),r=r.redMul(e),e=i.redSqr().redIAdd(o).redISub(r).redISub(r),i=i.redMul(r.redISub(e)).redISub(n.redMul(o)),r=this.z.redMul(t);return this.curve.jpoint(e,i,r)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}var i=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,f=a.redSqr().redSqr(),h=s.redAdd(s);for(r=0;r<e;r++){var u=o.redSqr(),c=h.redSqr(),d=c.redSqr(),u=u.redAdd(u).redIAdd(u).redIAdd(i.redMul(f)),c=o.redMul(c),l=u.redSqr().redISub(c.redAdd(c)),c=c.redISub(l),u=(u=u.redMul(c)).redIAdd(u).redISub(d),c=h.redMul(a);r+1<e&&(f=f.redMul(d)),o=l,a=c,h=u}return this.curve.jpoint(o,h.redMul(n),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var e,t,r,i,n,o=this.zOne?(t=this.x.redSqr(),r=(e=this.y.redSqr()).redSqr(),e=(e=this.x.redAdd(e).redSqr().redISub(t).redISub(r)).redIAdd(e),i=(t=t.redAdd(t).redIAdd(t)).redSqr().redISub(e).redISub(e),r=(r=(r=r.redIAdd(r)).redIAdd(r)).redIAdd(r),e=t.redMul(e.redISub(t=i)).redISub(r),this.y.redAdd(this.y)):(i=this.x.redSqr(),n=(r=this.y.redSqr()).redSqr(),r=(r=this.x.redAdd(r).redSqr().redISub(i).redISub(n)).redIAdd(r),o=(i=i.redAdd(i).redIAdd(i)).redSqr(),n=(n=(n=n.redIAdd(n)).redIAdd(n)).redIAdd(n),t=o.redISub(r).redISub(r),e=i.redMul(r.redISub(t)).redISub(n),(o=this.y.redMul(this.z)).redIAdd(o));return this.curve.jpoint(t,e,o)},h.prototype._threeDbl=function(){var e,t,r,i,n,o,s,a;return this.zOne?(t=this.x.redSqr(),n=(e=this.y.redSqr()).redSqr(),e=(e=this.x.redAdd(e).redSqr().redISub(t).redISub(n)).redIAdd(e),r=i=(t=t.redAdd(t).redIAdd(t).redIAdd(this.curve.a)).redSqr().redISub(e).redISub(e),n=(n=(n=n.redIAdd(n)).redIAdd(n)).redIAdd(n),t=t.redMul(e.redISub(i)).redISub(n),e=this.y.redAdd(this.y)):(i=this.z.redSqr(),n=this.y.redSqr(),s=this.x.redMul(n),o=(o=this.x.redSub(i).redMul(this.x.redAdd(i))).redAdd(o).redIAdd(o),a=(s=(s=s.redIAdd(s)).redIAdd(s)).redAdd(s),r=o.redSqr().redISub(a),e=this.y.redAdd(this.z).redSqr().redISub(n).redISub(i),a=(a=(a=(a=n.redSqr()).redIAdd(a)).redIAdd(a)).redIAdd(a),t=o.redMul(s.redISub(r)).redISub(a)),this.curve.jpoint(r,t,e)},h.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),o=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(n)),e=t.redAdd(t),n=(e=e.redIAdd(e)).redMul(s),t=o.redSqr().redISub(n.redAdd(n)),e=n.redISub(t),n=s.redSqr(),s=(n=(n=(n=n.redIAdd(n)).redIAdd(n)).redIAdd(n),o.redMul(e).redISub(n)),o=r.redAdd(r).redMul(i);return this.curve.jpoint(t,s,o)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),o=n.redSqr(),e=this.x.redAdd(t).redSqr().redISub(e).redISub(i),s=(e=(e=(e=e.redIAdd(e)).redAdd(e).redIAdd(e)).redISub(o)).redSqr(),i=i.redIAdd(i),n=(i=(i=(i=i.redIAdd(i)).redIAdd(i)).redIAdd(i),n.redIAdd(e).redSqr().redISub(o).redISub(s).redISub(i)),o=t.redMul(n),t=(o=(o=o.redIAdd(o)).redIAdd(o),this.x.redMul(s).redISub(o)),o=(t=(t=t.redIAdd(t)).redIAdd(t),this.y.redMul(n.redMul(i.redISub(n)).redISub(e.redMul(s)))),i=(o=(o=(o=o.redIAdd(o)).redIAdd(o)).redIAdd(o),this.z.redAdd(e).redSqr().redISub(r).redISub(s));return this.curve.jpoint(t,o,i)},h.prototype.mul=function(e,t){return e=new v(e,t),this.curve._wnafMul(this,e)},h.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;t=t.redMul(this.z),r=r.redMul(e.z);return 0===this.y.redMul(r).redISub(e.y.redMul(t)).cmpn(0)},h.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),0<=i.cmp(this.curve.p))return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":82,"./base":69,"bn.js":16,inherits:102}],74:[function(e,t,r){"use strict";var i,n=r,r=e("hash.js"),o=e("./curve"),s=e("./utils").assert;function a(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new a(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=a,f("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:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:r.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"]}),f("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:r.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),f("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:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}f("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:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"./curve":71,"./precomputed/secp256k1":81,"./utils":82,"hash.js":88}],75:[function(e,t,r){"use strict";var d=e("bn.js"),l=e("hmac-drbg"),i=e("../utils"),n=e("../curves"),o=e("brorand"),a=i.assert,s=e("./key"),p=e("./signature");function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(a(Object.prototype.hasOwnProperty.call(n,e),"Unknown curve "+e),e=n[e]),e instanceof n.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=f).prototype.keyPair=function(e){return new s(this,e)},f.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){for(var t=new l({hash:this.hash,pers:(e=e||{}).pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0<n.cmp(i)))return n.iaddn(1),this.keyFromPrivate(n)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return 0<r&&(e=e.ushrn(r)),!t&&0<=e.cmp(this.n)?e.sub(this.n):e},f.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i=i||{},t=this.keyFromPrivate(t,r),e=this._truncateToN(new d(e,16));for(var r=this.n.byteLength(),n=t.getPrivate().toArray("be",r),r=e.toArray("be",r),o=new l({hash:this.hash,entropy:n,nonce:r,pers:i.pers,persEnc:i.persEnc||"utf8"}),s=this.n.sub(new d(1)),a=0;;a++){var f=i.k?i.k(a):new d(o.generate(this.n.byteLength())),f=this._truncateToN(f,!0);if(!(f.cmpn(1)<=0||0<=f.cmp(s))){var h=this.g.mul(f);if(!h.isInfinity()){var u=h.getX(),c=u.umod(this.n);if(0!==c.cmpn(0)){f=(f=f.invm(this.n).mul(c.mul(t.getPrivate()).iadd(e))).umod(this.n);if(0!==f.cmpn(0))return h=(h.getY().isOdd()?1:0)|(0!==u.cmp(c)?2:0),i.canonical&&0<f.cmp(this.nh)&&(f=this.n.sub(f),h^=1),new p({r:c,s:f,recoveryParam:h})}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new d(e,16)),r=this.keyFromPublic(r,i);i=(t=new p(t,"hex")).r,t=t.s;if(i.cmpn(1)<0||0<=i.cmp(this.n))return!1;if(t.cmpn(1)<0||0<=t.cmp(this.n))return!1;var n,t=t.invm(this.n),e=t.mul(e).umod(this.n),t=t.mul(i).umod(this.n);return this.curve._maxwellTrick?!(n=this.g.jmulAdd(e,r.getPublic(),t)).isInfinity()&&n.eqXToP(i):!(n=this.g.mulAdd(e,r.getPublic(),t)).isInfinity()&&0===n.getX().umod(this.n).cmp(i)},f.prototype.recoverPubKey=function(e,t,r,i){a((3&r)===r,"The recovery param is more than two bits"),t=new p(t,i);var i=this.n,e=new d(e),n=t.r,o=t.s,s=1&r,r=r>>1;if(0<=n.cmp(this.curve.p.umod(this.curve.n))&&r)throw new Error("Unable to find sencond key candinate");n=r?this.curve.pointFromX(n.add(this.curve.n),s):this.curve.pointFromX(n,s),r=t.r.invm(i),s=i.sub(e).mul(r).umod(i),t=o.mul(r).umod(i);return this.g.mulAdd(s,n,t)},f.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new p(t,i)).recoveryParam)return t.recoveryParam;for(var n,o=0;o<4;o++){try{n=this.recoverPubKey(e,t,o)}catch(e){continue}if(n.eq(r))return o}throw new Error("Unable to find valid recovery factor")}},{"../curves":74,"../utils":82,"./key":76,"./signature":77,"bn.js":16,brorand:17,"hmac-drbg":100}],76:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../utils").assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=o).fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":82,"bn.js":16}],77:[function(e,t,r){"use strict";var n=e("bn.js"),o=e("../utils"),i=o.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0==i||4<i)return!1;for(var n=0,o=0,s=t.place;o<i;o++,s++)n=((n<<=8)|e[s])>>>0;return!(n<=127)&&(t.place=s,n)}function h(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function u(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=s).prototype._importDER=function(e,t){e=o.toArray(e,t);t=new a;if(48!==e[t.place++])return!1;var r=f(e,t);if(!1===r)return!1;if(r+t.place!==e.length)return!1;if(2!==e[t.place++])return!1;r=f(e,t);if(!1===r)return!1;var i=e.slice(t.place,r+t.place);if(t.place+=r,2!==e[t.place++])return!1;r=f(e,t);if(!1===r)return!1;if(e.length!==r+t.place)return!1;e=e.slice(t.place,r+t.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===e[0]){if(!(128&e[1]))return!1;e=e.slice(1)}return this.r=new n(i),this.s=new n(e),!(this.recoveryParam=null)},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=h(t),r=h(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2],t=(u(i,t.length),(i=i.concat(t)).push(2),u(i,r.length),i.concat(r)),i=[48];return u(i,t.length),i=i.concat(t),o.encode(i,e)}},{"../utils":82,"bn.js":16}],78:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../curves"),o=e("../utils"),s=o.assert,a=o.parseBytes,f=e("./key"),h=e("./signature");function u(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof u))return new u(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=u).prototype.sign=function(e,t){e=a(e);var t=this.keyFromSecret(t),r=this.hashInt(t.messagePrefix(),e),i=this.g.mul(r),n=this.encodePoint(i),e=this.hashInt(n,t.pubBytes(),e).mul(t.priv()),t=r.add(e).umod(this.curve.n);return this.makeSignature({R:i,S:t,Rencoded:n})},u.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var r=this.keyFromPublic(r),e=this.hashInt(t.Rencoded(),r.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(r.pub().mul(e)).eq(i)},u.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},u.prototype.keyFromPublic=function(e){return f.fromPublic(this,e)},u.prototype.keyFromSecret=function(e){return f.fromSecret(this,e)},u.prototype.makeSignature=function(e){return e instanceof h?e:new h(this,e)},u.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},u.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),e=0!=(128&e[t]),t=o.intFromLE(r);return this.curve.pointFromY(t,e)},u.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},u.prototype.decodeInt=function(e){return o.intFromLE(e)},u.prototype.isPoint=function(e){return e instanceof this.pointClass}},{"../curves":74,"../utils":82,"./key":79,"./signature":80,"hash.js":88}],79:[function(e,t,r){"use strict";var i=e("../utils"),n=i.assert,o=i.parseBytes,e=i.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},e(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),e(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),e(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,t=t.slice(0,e.encodingLength);return t[0]&=248,t[r]&=127,t[r]|=64,t}),e(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),e(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),e(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),e)},s.prototype.getPublic=function(e){return i.encode(this.pubBytes(),e)},t.exports=s},{"../utils":82}],80:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../utils"),o=n.assert,e=n.cachedProperty,s=n.parseBytes;function a(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}e(a,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),e(a,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),e(a,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),e(a,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),a.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},a.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=a},{"../utils":82,"bn.js":16}],81:[function(e,t,r){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],82:[function(e,t,r){"use strict";var i=r,n=e("bn.js"),r=e("minimalistic-assert"),e=e("minimalistic-crypto-utils");i.assert=r,i.toArray=e.toArray,i.zero2=e.zero2,i.toHex=e.toHex,i.encode=e.encode,i.getNAF=function(e,t,r){for(var i=new Array(Math.max(e.bitLength(),r)+1),n=(i.fill(0),1<<t+1),o=e.clone(),s=0;s<i.length;s++){var a,f=o.andln(n-1);o.isOdd()?o.isubn(a=(n>>1)-1<f?(n>>1)-f:f):a=0,i[s]=a,o.iushrn(1)}return i},i.getJSF=function(e,t){for(var r,i=[[],[]],n=(e=e.clone(),t=t.clone(),0),o=0;0<e.cmpn(-n)||0<t.cmpn(-o);){var s,a=e.andln(3)+n&3,f=t.andln(3)+o&3;3===f&&(f=-1),s=0==(1&(a=3===a?-1:a))?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==f?a:-a,i[0].push(s),a=0==(1&f)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==a?f:-f,i[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return i},i.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(e){return"string"==typeof e?i.toArray(e,"hex"):e},i.intFromLE=function(e){return new n(e,"hex","le")}},{"bn.js":16,"minimalistic-assert":105,"minimalistic-crypto-utils":106}],83:[function(e,t,r){t.exports={_args:[["elliptic@6.5.4","C:\\Users\\manue\\Documents\\GitHub\\tool-chain"]],_from:"elliptic@6.5.4",_id:"elliptic@6.5.4",_inBundle:!1,_integrity:"sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.5.4",name:"elliptic",escapedName:"elliptic",rawSpec:"6.5.4",saveSpec:null,fetchSpec:"6.5.4"},_requiredBy:["/@ethersproject/signing-key","/browserify-sign","/create-ecdh","/eth-lib","/secp256k1","/web3-eth-accounts/eth-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",_spec:"6.5.4",_where:"C:\\Users\\manue\\Documents\\GitHub\\tool-chain",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},description:"EC cryptography",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.5.4"}},{}],84:[function(e,t,r){"use strict";var i="object"==typeof Reflect?Reflect:null,f=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};var n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(a,f){return new Promise(function(e,t){function r(e){a.removeListener(f,i),t(e)}function i(){"function"==typeof a.removeListener&&a.removeListener("error",r),e([].slice.call(arguments))}var n,o,s;m(a,f,i,{once:!0}),"error"!==f&&(o=r,s={once:!0},"function"==typeof(n=a).on&&m(n,"error",o,s))})},(s.EventEmitter=s).prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function h(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,r,i){var n,o;return h(r),void 0===(n=e._events)?(n=e._events=Object.create(null),e._eventsCount=0):(void 0!==n.newListener&&(e.emit("newListener",t,r.listener||r),n=e._events),o=n[t]),void 0===o?(o=n[t]=r,++e._eventsCount):("function"==typeof o?o=n[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),0<(n=u(e))&&o.length>n&&!o.warned&&(o.warned=!0,(i=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",i.emitter=e,i.type=t,i.count=o.length,r=i,console&&console.warn&&console.warn(r))),e}function d(e,t,r){e={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},t=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(e);return t.listener=r,e.wrapFn=t}function l(e,t,r){e=e._events;if(void 0===e)return[];e=e[t];{if(void 0===e)return[];if("function"==typeof e)return r?[e.listener||e]:[e];if(r){for(var i=e,n=new Array(i.length),o=0;o<n.length;++o)n[o]=i[o].listener||i[o];return n}return b(e,e.length)}}function p(e){var t=this._events;if(void 0!==t){t=t[e];if("function"==typeof t)return 1;if(void 0!==t)return t.length}return 0}function b(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function m(r,i,n,o){if("function"==typeof r.on)o.once?r.once(i,n):r.on(i,n);else{if("function"!=typeof r.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r);r.addEventListener(i,function e(t){o.once&&r.removeEventListener(i,e),n(t)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){if((o=0<t.length?t[0]:o)instanceof Error)throw o;i=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw i.context=o,i}var o=n[e];if(void 0===o)return!1;if("function"==typeof o)f(o,this,t);else for(var s=o.length,a=b(o,s),r=0;r<s;++r)f(a[r],this,t);return!0},s.prototype.on=s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return h(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return h(t),this.prependListener(e,d(this,e,t)),this},s.prototype.off=s.prototype.removeListener=function(e,t){var r,i,n,o,s;if(h(t),void 0!==(i=this._events)&&void 0!==(r=i[e]))if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,o=r.length-1;0<=o;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,n=o;break}if(n<0)return this;if(0===n)r.shift();else{for(var a=r,f=n;f+1<a.length;f++)a[f]=a[f+1];a.pop()}1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,s||t)}return this},s.prototype.removeAllListeners=function(e){var t,r=this._events;if(void 0!==r){if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){for(var i,n=Object.keys(r),o=0;o<n.length;++o)"removeListener"!==(i=n[o])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(o=t.length-1;0<=o;o--)this.removeListener(e,t[o])}return this},s.prototype.listeners=function(e){return l(this,e,!0)},s.prototype.rawListeners=function(e){return l(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return 0<this._eventsCount?n(this._events):[]}},{}],85:[function(e,t,r){var c=e("safe-buffer").Buffer,d=e("md5.js");t.exports=function(e,t,r,i){if(c.isBuffer(e)||(e=c.from(e,"binary")),t&&8!==(t=c.isBuffer(t)?t:c.from(t,"binary")).length)throw new RangeError("salt should be Buffer with 8 byte length");for(var n=r/8,o=c.alloc(n),s=c.alloc(i||0),a=c.alloc(0);0<n||0<i;){var f,h,u=new d,u=(u.update(a),u.update(e),t&&u.update(t),a=u.digest(),0);0<n&&(f=o.length-n,u=Math.min(n,a.length),a.copy(o,f,0,u),n-=u),u<a.length&&0<i&&(f=s.length-i,h=Math.min(i,a.length-u),a.copy(s,f,u,u+h),i-=h)}return a.fill(0),{key:o,iv:s}}},{"md5.js":103,"safe-buffer":143}],86:[function(e,t,r){"use strict";var h=e("safe-buffer").Buffer,i=e("readable-stream").Transform;function n(e){i.call(this),this._block=h.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(n,i),n.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},n.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},n.prototype.update=function(e,t){var r=e,i="Data";if(!h.isBuffer(r)&&"string"!=typeof r)throw new TypeError(i+" must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");h.isBuffer(e)||(e=h.from(e,t));for(var n=this._block,o=0;this._blockOffset+e.length-o>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)n[s++]=e[o++];this._update(),this._blockOffset=0}for(;o<e.length;)n[this._blockOffset++]=e[o++];for(var a=0,f=8*e.length;0<f;++a)this._length[a]+=f,0<(f=this._length[a]/4294967296|0)&&(this._length[a]-=4294967296*f);return this},n.prototype._update=function(){throw new Error("_update is not implemented")},n.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0);for(var r=this._blockOffset=0;r<4;++r)this._length[r]=0;return t},n.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=n},{inherits:102,"readable-stream":141,"safe-buffer":87}],87:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:49,dup:48}],88:[function(e,t,r){r.utils=e("./hash/utils"),r.common=e("./hash/common"),r.sha=e("./hash/sha"),r.ripemd=e("./hash/ripemd"),r.hmac=e("./hash/hmac"),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},{"./hash/common":89,"./hash/hmac":90,"./hash/ripemd":91,"./hash/sha":92,"./hash/utils":99}],89:[function(e,t,r){"use strict";var i=e("./utils"),n=e("minimalistic-assert");function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}(r.BlockHash=o).prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){t=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-t,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-t,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),n(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i}},{"./utils":99,"minimalistic-assert":105}],90:[function(e,t,r){"use strict";var i=e("./utils"),n=e("minimalistic-assert");function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(t,r))}(t.exports=o).prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},{"./utils":99,"minimalistic-assert":105}],91:[function(e,t,r){"use strict";var i=e("./utils"),e=e("./common"),b=i.rotl32,m=i.sum32,y=i.sum32_3,g=i.sum32_4,n=e.BlockHash;function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function v(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}i.inherits(o,n),(r.ripemd160=o).blockSize=512,o.outSize=160,o.hmacStrength=192,o.padLength=64,o.prototype._update=function(e,t){for(var r,i=u=this.h[0],n=p=this.h[1],o=l=this.h[2],s=d=this.h[3],a=c=this.h[4],f=0;f<80;f++)var h=m(b(g(u,v(f,p,l,d),e[_[f]+t],(r=f)<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838),M[f]),c),u=c,c=d,d=b(l,10),l=p,p=h,h=m(b(g(i,v(79-f,n,o,s),e[w[f]+t],(r=f)<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0),S[f]),a),i=a,a=s,s=b(o,10),o=n,n=h;h=y(this.h[1],l,s),this.h[1]=y(this.h[2],d,a),this.h[2]=y(this.h[3],c,i),this.h[3]=y(this.h[4],u,n),this.h[4]=y(this.h[0],p,o),this.h[0]=h},o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var _=[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],w=[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],M=[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],S=[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]},{"./common":89,"./utils":99}],92:[function(e,t,r){"use strict";r.sha1=e("./sha/1"),r.sha224=e("./sha/224"),r.sha256=e("./sha/256"),r.sha384=e("./sha/384"),r.sha512=e("./sha/512")},{"./sha/1":93,"./sha/224":94,"./sha/256":95,"./sha/384":96,"./sha/512":97}],93:[function(e,t,r){"use strict";var i=e("../utils"),n=e("../common"),e=e("./common"),u=i.rotl32,c=i.sum32,d=i.sum32_5,l=e.ft_1,o=n.BlockHash,p=[1518500249,1859775393,2400959708,3395469782];function s(){if(!(this instanceof s))return new s;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(s,o),(t.exports=s).blockSize=512,s.outSize=160,s.hmacStrength=80,s.padLength=64,s.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=u(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);for(var n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],i=0;i<r.length;i++)var h=~~(i/20),h=d(u(n,5),l(h,o,s,a),f,r[i],p[h]),f=a,a=s,s=u(o,30),o=n,n=h;this.h[0]=c(this.h[0],n),this.h[1]=c(this.h[1],o),this.h[2]=c(this.h[2],s),this.h[3]=c(this.h[3],a),this.h[4]=c(this.h[4],f)},s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},{"../common":89,"../utils":99,"./common":98}],94:[function(e,t,r){"use strict";var i=e("../utils"),n=e("./256");function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(o,n),(t.exports=o).blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},{"../utils":99,"./256":95}],95:[function(e,t,r){"use strict";var i=e("../utils"),n=e("../common"),o=e("./common"),p=e("minimalistic-assert"),b=i.sum32,m=i.sum32_4,y=i.sum32_5,g=o.ch32,v=o.maj32,_=o.s0_256,w=o.s1_256,M=o.g0_256,S=o.g1_256,s=n.BlockHash,a=[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];function f(){if(!(this instanceof f))return new f;s.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=a,this.W=new Array(64)}i.inherits(f,s),(t.exports=f).blockSize=512,f.outSize=256,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=m(S(r[i-2]),r[i-7],M(r[i-15]),r[i-16]);var n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],h=this.h[5],u=this.h[6],c=this.h[7];for(p(this.k.length===r.length),i=0;i<r.length;i++)var d=y(c,w(f),g(f,h,u),this.k[i],r[i]),l=b(_(n),v(n,o,s)),c=u,u=h,h=f,f=b(a,d),a=s,s=o,o=n,n=b(d,l);this.h[0]=b(this.h[0],n),this.h[1]=b(this.h[1],o),this.h[2]=b(this.h[2],s),this.h[3]=b(this.h[3],a),this.h[4]=b(this.h[4],f),this.h[5]=b(this.h[5],h),this.h[6]=b(this.h[6],u),this.h[7]=b(this.h[7],c)},f.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},{"../common":89,"../utils":99,"./common":98,"minimalistic-assert":105}],96:[function(e,t,r){"use strict";var i=e("../utils"),n=e("./512");function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(o,n),(t.exports=o).blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},{"../utils":99,"./512":97}],97:[function(e,t,r){"use strict";var i=e("../utils"),n=e("../common"),j=e("minimalistic-assert"),B=i.rotr64_hi,C=i.rotr64_lo,d=i.shr64_hi,l=i.shr64_lo,T=i.sum64,O=i.sum64_hi,L=i.sum64_lo,p=i.sum64_4_hi,b=i.sum64_4_lo,D=i.sum64_5_hi,N=i.sum64_5_lo,o=n.BlockHash,s=[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];function a(){if(!(this instanceof a))return new a;o.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=s,this.W=new Array(160)}i.inherits(a,o),(t.exports=a).blockSize=1024,a.outSize=512,a.hmacStrength=192,a.padLength=128,a.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=function(e,t){var r=B(e,t,19),i=B(t,e,29),e=d(e,t,6),t=r^i^e;t<0&&(t+=4294967296);return t}(r[i-4],r[i-3]),o=function(e,t){var r=C(e,t,19),i=C(t,e,29),e=l(e,t,6),t=r^i^e;t<0&&(t+=4294967296);return t}(r[i-4],r[i-3]),s=r[i-14],a=r[i-13],f=function(e,t){var r=B(e,t,1),i=B(e,t,8),e=d(e,t,7),t=r^i^e;t<0&&(t+=4294967296);return t}(r[i-30],r[i-29]),h=function(e,t){var r=C(e,t,1),i=C(e,t,8),e=l(e,t,7),t=r^i^e;t<0&&(t+=4294967296);return t}(r[i-30],r[i-29]),u=r[i-32],c=r[i-31];r[i]=p(n,o,s,a,f,h,u,c),r[i+1]=b(n,o,s,a,f,h,u,c)}},a.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],n=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],f=this.h[5],h=this.h[6],u=this.h[7],c=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],b=this.h[12],m=this.h[13],y=this.h[14],g=this.h[15];j(this.k.length===r.length);for(var v=0;v<r.length;v+=2)var _=y,w=g,M=function(e,t){var r=B(e,t,14),i=B(e,t,18),t=B(t,e,9),e=r^i^t;e<0&&(e+=4294967296);return e}(c,d),S=function(e,t){var r=C(e,t,14),i=C(e,t,18),t=C(t,e,9),e=r^i^t;e<0&&(e+=4294967296);return e}(c,d),A=function(e,t,r){t=e&t^~e&r;t<0&&(t+=4294967296);return t}(c,l,b),k=function(e,t,r){t=e&t^~e&r;t<0&&(t+=4294967296);return t}(d,p,m),E=this.k[v],x=this.k[v+1],P=r[v],I=r[v+1],R=D(_,w,M,S,A,k,E,x,P,I),A=N(_,w,M,S,A,k,E,x,P,I),_=function(e,t){var r=B(e,t,28),i=B(t,e,2),t=B(t,e,7),e=r^i^t;e<0&&(e+=4294967296);return e}(i,n),w=function(e,t){var r=C(e,t,28),i=C(t,e,2),t=C(t,e,7),e=r^i^t;e<0&&(e+=4294967296);return e}(i,n),M=function(e,t,r){e=e&t^e&r^t&r;e<0&&(e+=4294967296);return e}(i,o,a),S=function(e,t,r){e=e&t^e&r^t&r;e<0&&(e+=4294967296);return e}(n,s,f),k=O(_,w,M,S),E=L(_,w,M,S),y=b,g=m,b=l,m=p,l=c,p=d,c=O(h,u,R,A),d=L(u,u,R,A),h=a,u=f,a=o,f=s,o=i,s=n,i=O(R,A,k,E),n=L(R,A,k,E);T(this.h,0,i,n),T(this.h,2,o,s),T(this.h,4,a,f),T(this.h,6,h,u),T(this.h,8,c,d),T(this.h,10,l,p),T(this.h,12,b,m),T(this.h,14,y,g)},a.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},{"../common":89,"../utils":99,"minimalistic-assert":105}],98:[function(e,t,r){"use strict";var i=e("../utils").rotr32;function n(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}r.ft_1=function(e,t,r,i){return 0===e?n(t,r,i):1===e||3===e?t^r^i:2===e?o(t,r,i):void 0},r.ch32=n,r.maj32=o,r.p32=s,r.s0_256=function(e){return i(e,2)^i(e,13)^i(e,22)},r.s1_256=function(e){return i(e,6)^i(e,11)^i(e,25)},r.g0_256=function(e){return i(e,7)^i(e,18)^e>>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":99}],99:[function(e,t,r){"use strict";var f=e("minimalistic-assert"),e=e("inherits");function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=e,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r,i,n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),s=0;s<e.length;s+=2)n.push(parseInt(e[s]+e[s+1],16))}else for(var o=0,s=0;s<e.length;s++){var a=e.charCodeAt(s);a<128?n[o++]=a:a<2048?(n[o++]=a>>6|192,n[o++]=63&a|128):(i=s,55296!=(64512&(r=e).charCodeAt(i))||i<0||i+1>=r.length||56320!=(64512&r.charCodeAt(i+1))?n[o++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++s)),n[o++]=a>>18|240,n[o++]=a>>12&63|128),n[o++]=a>>6&63|128,n[o++]=63&a|128)}else for(s=0;s<e.length;s++)n[s]=0|e[s];return n},r.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t},r.htonl=o,r.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];r+=s((n="little"===t?o(n):n).toString(16))}return r},r.zero2=i,r.zero8=s,r.join32=function(e,t,r,i){f((r=r-t)%4==0);for(var n=new Array(r/4),o=0,s=t;o<n.length;o++,s+=4){var a="big"===i?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s];n[o]=a>>>0}return n},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];"big"===t?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<<t|e>>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0;e[t]=(o<i?1:0)+r+n>>>0,e[t+1]=o},r.sum64_hi=function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,o,s,a){var f=0;return e+r+n+s+((f+=(e=t+i>>>0)<t?1:0)+((e=e+o>>>0)<o?1:0)+(e+a>>>0<a?1:0))>>>0},r.sum64_4_lo=function(e,t,r,i,n,o,s,a){return t+i+o+a>>>0},r.sum64_5_hi=function(e,t,r,i,n,o,s,a,f,h){var u=0;return e+r+n+s+f+(u+((e=t+i>>>0)<t?1:0)+((e=e+o>>>0)<o?1:0)+((e=e+a>>>0)<a?1:0)+(e+h>>>0<h?1:0))>>>0},r.sum64_5_lo=function(e,t,r,i,n,o,s,a,f,h){return t+i+o+a+h>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:102,"minimalistic-assert":105}],100:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),e=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,e)}(t.exports=s).prototype._init=function(e,t,r){e=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(e),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=o.toArray(e,t),r=o.toArray(r,i),n(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<e;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);i=n.slice(0,e);return this._update(r),this._reseed++,o.encode(i,t)}},{"hash.js":88,"minimalistic-assert":105,"minimalistic-crypto-utils":106}],101:[function(e,t,r){r.read=function(e,t,r,i,n){var o,s,a=8*n-i-1,f=(1<<a)-1,h=f>>1,u=-7,c=r?n-1:0,d=r?-1:1,n=e[t+c];for(c+=d,o=n&(1<<-u)-1,n>>=-u,u+=a;0<u;o=256*o+e[t+c],c+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;0<u;s=256*s+e[t+c],c+=d,u-=8);if(0===o)o=1-h;else{if(o===f)return s?NaN:1/0*(n?-1:1);s+=Math.pow(2,i),o-=h}return(n?-1:1)*s*Math.pow(2,o-i)},r.write=function(e,t,r,i,n,o){var s,a,f=8*o-n-1,h=(1<<f)-1,u=h>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,l=i?1:-1,o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(i=Math.pow(2,-s))<1&&(s--,i*=2),2<=(t+=1<=s+u?c/i:c*Math.pow(2,1-u))*i&&(s++,i/=2),h<=s+u?(a=0,s=h):1<=s+u?(a=(t*i-1)*Math.pow(2,n),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,n),s=0));8<=n;e[r+d]=255&a,d+=l,a/=256,n-=8);for(s=s<<n|a,f+=n;0<f;e[r+d]=255&s,d+=l,s/=256,f-=8);e[r+d-l]|=128*o}},{}],102:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){var r;t&&(e.super_=t,(r=function(){}).prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e)}},{}],103:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),o=e("safe-buffer").Buffer,s=new Array(16);function a(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function f(e,t){return e<<t|e>>>32-t}function h(e,t,r,i,n,o,s){return f(e+(t&r|~t&i)+n+o|0,s)+t|0}function u(e,t,r,i,n,o,s){return f(e+(t&i|r&~i)+n+o|0,s)+t|0}function c(e,t,r,i,n,o,s){return f(e+(t^r^i)+n+o|0,s)+t|0}function d(e,t,r,i,n,o,s){return f(e+(r^(t|~i))+n+o|0,s)+t|0}i(a,n),a.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=h(this._a,o=this._b,n=this._c,i=this._d,e[0],3614090360,7),i=h(i,r,o,n,e[1],3905402710,12),n=h(n,i,r,o,e[2],606105819,17),o=h(o,n,i,r,e[3],3250441966,22);r=h(r,o,n,i,e[4],4118548399,7),i=h(i,r,o,n,e[5],1200080426,12),n=h(n,i,r,o,e[6],2821735955,17),o=h(o,n,i,r,e[7],4249261313,22),r=h(r,o,n,i,e[8],1770035416,7),i=h(i,r,o,n,e[9],2336552879,12),n=h(n,i,r,o,e[10],4294925233,17),o=h(o,n,i,r,e[11],2304563134,22),r=h(r,o,n,i,e[12],1804603682,7),i=h(i,r,o,n,e[13],4254626195,12),n=h(n,i,r,o,e[14],2792965006,17),r=u(r,o=h(o,n,i,r,e[15],1236535329,22),n,i,e[1],4129170786,5),i=u(i,r,o,n,e[6],3225465664,9),n=u(n,i,r,o,e[11],643717713,14),o=u(o,n,i,r,e[0],3921069994,20),r=u(r,o,n,i,e[5],3593408605,5),i=u(i,r,o,n,e[10],38016083,9),n=u(n,i,r,o,e[15],3634488961,14),o=u(o,n,i,r,e[4],3889429448,20),r=u(r,o,n,i,e[9],568446438,5),i=u(i,r,o,n,e[14],3275163606,9),n=u(n,i,r,o,e[3],4107603335,14),o=u(o,n,i,r,e[8],1163531501,20),r=u(r,o,n,i,e[13],2850285829,5),i=u(i,r,o,n,e[2],4243563512,9),n=u(n,i,r,o,e[7],1735328473,14),r=c(r,o=u(o,n,i,r,e[12],2368359562,20),n,i,e[5],4294588738,4),i=c(i,r,o,n,e[8],2272392833,11),n=c(n,i,r,o,e[11],1839030562,16),o=c(o,n,i,r,e[14],4259657740,23),r=c(r,o,n,i,e[1],2763975236,4),i=c(i,r,o,n,e[4],1272893353,11),n=c(n,i,r,o,e[7],4139469664,16),o=c(o,n,i,r,e[10],3200236656,23),r=c(r,o,n,i,e[13],681279174,4),i=c(i,r,o,n,e[0],3936430074,11),n=c(n,i,r,o,e[3],3572445317,16),o=c(o,n,i,r,e[6],76029189,23),r=c(r,o,n,i,e[9],3654602809,4),i=c(i,r,o,n,e[12],3873151461,11),n=c(n,i,r,o,e[15],530742520,16),r=d(r,o=c(o,n,i,r,e[2],3299628645,23),n,i,e[0],4096336452,6),i=d(i,r,o,n,e[7],1126891415,10),n=d(n,i,r,o,e[14],2878612391,15),o=d(o,n,i,r,e[5],4237533241,21),r=d(r,o,n,i,e[12],1700485571,6),i=d(i,r,o,n,e[3],2399980690,10),n=d(n,i,r,o,e[10],4293915773,15),o=d(o,n,i,r,e[1],2240044497,21),r=d(r,o,n,i,e[8],1873313359,6),i=d(i,r,o,n,e[15],4264355552,10),n=d(n,i,r,o,e[6],2734768916,15),o=d(o,n,i,r,e[13],1309151649,21),r=d(r,o,n,i,e[4],4149444226,6),i=d(i,r,o,n,e[11],3174756917,10),n=d(n,i,r,o,e[2],718787259,15),o=d(o,n,i,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+o|0,this._c=this._c+n|0,this._d=this._d+i|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,56<this._blockOffset&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},t.exports=a},{"hash-base":86,inherits:102,"safe-buffer":143}],104:[function(e,t,r){var l=e("bn.js"),i=e("brorand");function n(e){this.rand=e||new i.Rand}(t.exports=n).create=function(e){return new n(e)},n.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new l(this.rand.generate(r))}while(0<=i.cmp(e));return i},n.prototype._randrange=function(e,t){t=t.sub(e);return e.add(this._randbelow(t))},n.prototype.test=function(e,t,r){for(var i=e.bitLength(),n=l.mont(e),o=new l(1).toRed(n),s=(t=t||Math.max(1,i/48|0),e.subn(1)),a=0;!s.testn(a);a++);for(var f=e.shrn(a),h=s.toRed(n);0<t;t--){var u=this._randrange(new l(2),s),c=(r&&r(u),u.toRed(n).redPow(f));if(0!==c.cmp(o)&&0!==c.cmp(h)){for(var d=1;d<a;d++){if(0===(c=c.redSqr()).cmp(o))return!1;if(0===c.cmp(h))break}if(d===a)return!1}}return!0},n.prototype.getDivisor=function(e,t){for(var r=e.bitLength(),i=l.mont(e),n=new l(1).toRed(i),o=(t=t||Math.max(1,r/48|0),e.subn(1)),s=0;!o.testn(s);s++);for(var a=e.shrn(s),f=o.toRed(i);0<t;t--){var h=this._randrange(new l(2),o),u=e.gcd(h);if(0!==u.cmpn(1))return u;var c=h.toRed(i).redPow(a);if(0!==c.cmp(n)&&0!==c.cmp(f)){for(var d=1;d<s;d++){if(0===(c=c.redSqr()).cmp(n))return c.fromRed().subn(1).gcd(e);if(0===c.cmp(f))break}if(d===s)return(c=c.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},{"bn.js":16,brorand:17}],105:[function(e,t,r){function i(e,t){if(!e)throw new Error(t||"Assertion failed")}(t.exports=i).equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},{}],106:[function(e,t,r){"use strict";function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e)for(var i=0;i<e.length;i++)r[i]=0|e[i];else if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,n=255&n;o?r.push(o,n):r.push(n)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}},{}],107:[function(e,t,r){t.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"}},{}],108:[function(e,t,r){"use strict";var i=e("asn1.js"),e=(r.certificate=e("./certificate"),i.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())})),e=(r.RSAPrivateKey=e,i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())})),e=(r.RSAPublicKey=e,i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(n),this.key("subjectPublicKey").bitstr())})),n=(r.PublicKey=e,i.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())})),e=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(n),this.key("subjectPrivateKey").octstr())}),e=(r.PrivateKey=e,i.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())})),e=(r.EncryptedPrivateKey=e,i.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())})),e=(r.DSAPrivateKey=e,r.DSAparam=i.define("DSAparam",function(){this.int()}),i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(o),this.key("publicKey").optional().explicit(1).bitstr())})),o=(r.ECPrivateKey=e,i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}));r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":109,"asn1.js":1}],109:[function(e,t,r){"use strict";var e=e("asn1.js"),i=e.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),n=e.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=e.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=e.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),a=e.define("RelativeDistinguishedName",function(){this.setof(n)}),f=e.define("RDNSequence",function(){this.seqof(a)}),h=e.define("Name",function(){this.choice({rdnSequence:this.use(f)})}),u=e.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),c=e.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=e.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(h),this.key("validity").use(u),this.key("subject").use(h),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(c).optional())}),e=e.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=e},{"asn1.js":1}],110:[function(e,t,r){var s=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,a=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,f=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,h=e("evp_bytestokey"),u=e("browserify-aes"),c=e("safe-buffer").Buffer;t.exports=function(e,t){var r,i,n,e=e.toString(),o=e.match(s);return n=o?(i="aes"+o[1],n=c.from(o[2],"hex"),r=c.from(o[3].replace(/[\r\n]/g,""),"base64"),t=h(t,n.slice(0,8),parseInt(o[1],10)).key,o=[],i=u.createDecipheriv(i,t,n),o.push(i.update(r)),o.push(i.final()),c.concat(o)):(t=e.match(f),c.from(t[2].replace(/[\r\n]/g,""),"base64")),{tag:e.match(a)[1],data:n}}},{"browserify-aes":21,evp_bytestokey:85,"safe-buffer":143}],111:[function(e,t,r){var l=e("./asn1"),p=e("./aesid.json"),b=e("./fixProc"),m=e("browserify-aes"),y=e("pbkdf2"),g=e("safe-buffer").Buffer;function i(e){"object"!=typeof e||g.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=g.from(e));var t,r,i,n,o,s,a,f,h,u,e=b(e,t),c=e.tag,d=e.data;switch(c){case"CERTIFICATE":i=l.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(r=(i=i||l.PublicKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return l.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=l.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":d=l.EncryptedPrivateKey.decode(d,"der"),o=t,s=(n=d).algorithm.decrypt.kde.kdeparams.salt,a=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),f=p[n.algorithm.decrypt.cipher.algo.join(".")],h=n.algorithm.decrypt.cipher.iv,n=n.subjectPrivateKey,u=parseInt(f.split("-")[1],10)/8,o=y.pbkdf2Sync(o,s,a,u,"sha1"),s=m.createDecipheriv(f,o,h),(a=[]).push(s.update(n)),a.push(s.final()),d=g.concat(a);case"PRIVATE KEY":switch(r=(i=l.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return l.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:l.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=l.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return l.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return l.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:l.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=l.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+c)}}(t.exports=i).signature=l.signature},{"./aesid.json":107,"./asn1":108,"./fixProc":110,"browserify-aes":21,pbkdf2:112,"safe-buffer":143}],112:[function(e,t,r){r.pbkdf2=e("./lib/async"),r.pbkdf2Sync=e("./lib/sync")},{"./lib/async":113,"./lib/sync":116}],113:[function(t,r,e){!function(_){!function(){var h,e,u=t("safe-buffer").Buffer,c=t("./precondition"),d=t("./default-encoding"),l=t("./sync"),p=t("./to-buffer"),b=_.crypto&&_.crypto.subtle,m={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},y=[];function g(){return e=e||(_.process&&_.process.nextTick?_.process.nextTick:_.queueMicrotask||_.setImmediate||_.setTimeout)}function v(e,t,r,i,n){return b.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return b.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:n}},e,i<<3)}).then(function(e){return u.from(e)})}r.exports=function(t,r,i,n,o,s){"function"==typeof o&&(s=o,o=void 0);var e,a,f=m[(o=o||"sha1").toLowerCase()];if(f&&"function"==typeof _.Promise){if(c(i,n),t=p(t,d,"Password"),r=p(r,d,"Salt"),"function"!=typeof s)throw new Error("No callback provided to pbkdf2");e=function(e){if(_.process&&!_.process.browser)return Promise.resolve(!1);if(!b||!b.importKey||!b.deriveBits)return Promise.resolve(!1);if(void 0!==y[e])return y[e];var t=v(h=h||u.alloc(8),h,10,128,e).then(function(){return!0}).catch(function(){return!1});return y[e]=t}(f).then(function(e){return e?v(t,r,i,n,f):l(t,r,i,n,o)}),a=s,e.then(function(e){g()(function(){a(null,e)})},function(e){g()(function(){a(e)})})}else g()(function(){var e;try{e=l(t,r,i,n,o)}catch(e){return s(e)}s(null,e)})}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":114,"./precondition":115,"./sync":116,"./to-buffer":117,"safe-buffer":143}],114:[function(e,i,t){!function(t,r){!function(){var e;e=r.process&&r.process.browser||!r.process||!r.process.version||6<=parseInt(t.version.split(".")[0].slice(1),10)?"utf-8":"binary",i.exports=e}.call(this)}.call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:118}],115:[function(e,t,r){var i=Math.pow(2,30)-1;t.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||i<t||t!=t)throw new TypeError("Bad key length")}},{}],116:[function(e,t,r){var h=e("create-hash/md5"),u=e("ripemd160"),c=e("sha.js"),m=e("safe-buffer").Buffer,y=e("./precondition"),g=e("./default-encoding"),v=e("./to-buffer"),d=m.alloc(128),_={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function w(e,t,r){for(var i,n="rmd160"===(i=e)||"ripemd160"===i?function(e){return(new u).update(e).digest()}:"md5"===i?h:function(e){return c(i).update(e).digest()},o="sha512"===e||"sha384"===e?128:64,s=(t.length>o?t=n(t):t.length<o&&(t=m.concat([t,d],o)),m.allocUnsafe(o+_[e])),a=m.allocUnsafe(o+_[e]),f=0;f<o;f++)s[f]=54^t[f],a[f]=92^t[f];r=m.allocUnsafe(o+r+4);s.copy(r,0,0,o),this.ipad1=r,this.ipad2=s,this.opad=a,this.alg=e,this.blocksize=o,this.hash=n,this.size=_[e]}w.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(e,t,r,i,n){y(r,i);for(var o=new w(n=n||"sha1",e=v(e,g,"Password"),(t=v(t,g,"Salt")).length),s=m.allocUnsafe(i),a=m.allocUnsafe(t.length+4),f=(t.copy(a,0,0,t.length),0),h=_[n],u=Math.ceil(i/h),c=1;c<=u;c++){a.writeUInt32BE(c,t.length);for(var d=o.run(a,o.ipad1),l=d,p=1;p<r;p++)for(var l=o.run(l,o.ipad2),b=0;b<h;b++)d[b]^=l[b];d.copy(s,f),f+=h}return s}},{"./default-encoding":114,"./precondition":115,"./to-buffer":117,"create-hash/md5":54,ripemd160:142,"safe-buffer":143,"sha.js":146}],117:[function(e,t,r){var i=e("safe-buffer").Buffer;t.exports=function(e,t,r){if(i.isBuffer(e))return e;if("string"==typeof e)return i.from(e,t);if(ArrayBuffer.isView(e))return i.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},{"safe-buffer":143}],118:[function(e,t,r){var i,n,t=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}try{i="function"==typeof setTimeout?setTimeout:o}catch(e){i=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===o||!i)&&setTimeout)return(i=setTimeout)(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}var f,h=[],u=!1,c=-1;function d(){u&&f&&(u=!1,f.length?h=f.concat(h):c=-1,h.length&&l())}function l(){if(!u){for(var e=a(d),t=(u=!0,h.length);t;){for(f=h,h=[];++c<t;)f&&f[c].run();c=-1,t=h.length}f=null,u=!1,!function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return(n=clearTimeout)(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function b(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];h.push(new p(e,t)),1!==h.length||u||a(l)},p.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=b,t.addListener=b,t.once=b,t.off=b,t.removeListener=b,t.removeAllListeners=b,t.emit=b,t.prependListener=b,t.prependOnceListener=b,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],119:[function(e,t,r){r.publicEncrypt=e("./publicEncrypt"),r.privateDecrypt=e("./privateDecrypt"),r.privateEncrypt=function(e,t){return r.publicEncrypt(e,t,!0)},r.publicDecrypt=function(e,t){return r.privateDecrypt(e,t,!0)}},{"./privateDecrypt":121,"./publicEncrypt":122}],120:[function(e,t,r){var s=e("create-hash"),a=e("safe-buffer").Buffer;t.exports=function(e,t){for(var r,i,n=a.alloc(0),o=0;n.length<t;)r=o++,i=void 0,(i=a.allocUnsafe(4)).writeUInt32BE(r,0),r=i,n=a.concat([n,s("sha1").update(e).update(r).digest()]);return n.slice(0,t)}},{"create-hash":53,"safe-buffer":143}],121:[function(e,t,r){var l=e("parse-asn1"),p=e("./mgf"),b=e("./xor"),m=e("bn.js"),y=e("browserify-rsa"),g=e("create-hash"),v=e("./withPublic"),_=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i=e.padding||(r?1:4),e=l(e),n=e.modulus.byteLength();if(t.length>n||0<=new m(t).cmp(e.modulus))throw new Error("decryption error");var t=r?v(new m(t),e):y(t,e),o=_.alloc(n-t.length);if(t=_.concat([o,t],n),4===i){var o=t,n=(n=e).modulus.byteLength(),e=g("sha1").update(_.alloc(0)).digest(),s=e.length;if(0===o[0]){var a=o.slice(1,s+1),o=o.slice(s+1),a=b(a,p(o,s)),f=b(o,p(a,n-s-1));if(!function(e,t){e=_.from(e),t=_.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n<i;)r+=e[n]^t[n];return r}(e,f.slice(0,s))){for(var h=s;0===f[h];)h++;if(1===f[h++])return f.slice(h)}}throw new Error("decryption error")}if(1===i){for(var u=t,o=r,a=u.slice(0,2),c=2,d=0;0!==u[c++];)if(c>=u.length){d++;break}n=u.slice(2,c-1);if(("0002"!==a.toString("hex")&&!o||"0001"!==a.toString("hex")&&o)&&d++,n.length<8&&d++,d)throw new Error("decryption error");return u.slice(c)}if(3===i)return t;throw new Error("unknown padding")}},{"./mgf":120,"./withPublic":123,"./xor":124,"bn.js":16,"browserify-rsa":39,"create-hash":53,"parse-asn1":111,"safe-buffer":143}],122:[function(e,t,r){var o=e("parse-asn1"),a=e("randombytes"),f=e("create-hash"),h=e("./mgf"),u=e("./xor"),c=e("bn.js"),s=e("./withPublic"),d=e("browserify-rsa"),l=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i,n=e.padding||(r?1:4),e=o(e);if(4===n)i=function(e,t){var e=e.modulus.byteLength(),r=t.length,i=f("sha1").update(l.alloc(0)).digest(),n=i.length,o=2*n;if(e-o-2<r)throw new Error("message too long");var r=l.alloc(e-r-o-2),o=e-n-1,s=a(n),i=u(l.concat([i,r,l.alloc(1,1),t],o),h(s,o)),r=u(s,h(i,n));return new c(l.concat([l.alloc(1),r,i],e))}(e,t);else if(1===n)i=function(e,t,r){var i=t.length,e=e.modulus.byteLength();if(e-11<i)throw new Error("message too long");i=r?l.alloc(e-i-3,255):function(e){var t,r=l.allocUnsafe(e),i=0,n=a(2*e),o=0;for(;i<e;)o===n.length&&(n=a(2*e),o=0),(t=n[o++])&&(r[i++]=t);return r}(e-i-3);return new c(l.concat([l.from([0,r?1:2]),i,l.alloc(1),t],e))}(e,t,r);else{if(3!==n)throw new Error("unknown padding");if(0<=(i=new c(t)).cmp(e.modulus))throw new Error("data too long for modulus")}return(r?d:s)(i,e)}},{"./mgf":120,"./withPublic":123,"./xor":124,"bn.js":16,"browserify-rsa":39,"create-hash":53,"parse-asn1":111,randombytes:125,"safe-buffer":143}],123:[function(e,t,r){var i=e("bn.js"),n=e("safe-buffer").Buffer;t.exports=function(e,t){return n.from(e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed().toArray())}},{"bn.js":16,"safe-buffer":143}],124:[function(e,t,r){t.exports=function(e,t){for(var r=e.length,i=-1;++i<r;)e[i]^=t[i];return e}},{}],125:[function(t,r,e){!function(s,e){!function(){"use strict";var n=t("safe-buffer").Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?r.exports=function(e,t){if(4294967295<e)throw new RangeError("requested too many random bytes");var r=n.allocUnsafe(e);if(0<e)if(65536<e)for(var i=0;i<e;i+=65536)o.getRandomValues(r.slice(i,i+65536));else o.getRandomValues(r);return"function"!=typeof t?r:s.nextTick(function(){t(null,r)})}:r.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}.call(this)}.call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:118,"safe-buffer":143}],126:[function(r,e,l){!function(c,d){!function(){"use strict";function e(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var t=r("safe-buffer"),o=r("randombytes"),n=t.Buffer,i=t.kMaxLength,s=d.crypto||d.msCrypto,a=Math.pow(2,32)-1;function f(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(a<e||e<0)throw new TypeError("offset must be a uint32");if(i<e||t<e)throw new RangeError("offset out of range")}function h(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(a<e||e<0)throw new TypeError("size must be a uint32");if(r<e+t||i<e)throw new RangeError("buffer too small")}function u(r,i,e,n){var t;if(c.browser)return t=r.buffer,t=new Uint8Array(t,i,e),s.getRandomValues(t),n?void c.nextTick(function(){n(null,r)}):r;{if(!n)return o(e).copy(r,i),r;o(e,function(e,t){if(e)return n(e);t.copy(r,i),n(null,r)})}}s&&s.getRandomValues||!c.browser?(l.randomFill=function(e,t,r,i){if(!(n.isBuffer(e)||e instanceof d.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)i=t,t=0,r=e.length;else if("function"==typeof r)i=r,r=e.length-t;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return f(t,e.length),h(r,t,e.length),u(e,t,r,i)},l.randomFillSync=function(e,t,r){void 0===t&&(t=0);if(!(n.isBuffer(e)||e instanceof d.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');f(t,e.length),void 0===r&&(r=e.length-t);return h(r,t,e.length),u(e,t,r)}):(l.randomFill=e,l.randomFillSync=e)}.call(this)}.call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:118,randombytes:125,"safe-buffer":143}],127:[function(e,t,r){"use strict";var i={};function n(e,n,t){var r=function(i){var e,t;function r(e,t,r){return i.call(this,(e=e,t=t,r=r,"string"==typeof n?n:n(e,t,r)))||this}return t=i,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t,r}(t=t||Error);r.prototype.name=t.name,r.prototype.code=e,i[e]=r}function f(e,t){var r;return Array.isArray(e)?(r=e.length,e=e.map(function(e){return String(e)}),2<r?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])):"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,n,o,s,a;return"string"==typeof t&&(s="not ",t.substr(!o||o<0?0:+o,s.length)===s)?(i="must not be",t=t.replace(/^not /,"")):i="must be",o=e,s=" argument",(void 0===a||a>o.length)&&(a=o.length),o=o.substring(a-s.length,a)===s?"The ".concat(e," ").concat(i," ").concat(f(t,"type")):(a=(n="number"!=typeof n?0:n)+(o=".").length>(a=e).length||-1===a.indexOf(o,n)?"argument":"property",'The "'.concat(e,'" ').concat(a," ").concat(i," ").concat(f(t,"type"))),o+=". Received type ".concat(typeof r)},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},{}],128:[function(u,c,e){!function(h){!function(){"use strict";var e=Object.keys||function(e){var t,r=[];for(t in e)r.push(t);return r},t=(c.exports=s,u("./_stream_readable")),r=u("./_stream_writable");u("inherits")(s,t);for(var i=e(r.prototype),n=0;n<i.length;n++){var o=i[n];s.prototype[o]||(s.prototype[o]=r.prototype[o])}function s(e){if(!(this instanceof s))return new s(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||h.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}.call(this)}.call(this,u("_process"))},{"./_stream_readable":130,"./_stream_writable":132,_process:118,inherits:102}],129:[function(e,t,r){"use strict";t.exports=n;var i=e("./_stream_transform");function n(e){if(!(this instanceof n))return new n(e);i.call(this,e)}e("inherits")(n,i),n.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":131,inherits:102}],130:[function(U,q,e){!function(D,N){!function(){"use strict";function p(e,t){return e.listeners(t).length}(q.exports=_).ReadableState=v,U("events").EventEmitter;var i,n=U("./internal/streams/stream"),u=U("buffer").Buffer,c=N.Uint8Array||function(){};var o,e,r,t=U("util"),b=t&&t.debuglog?t.debuglog("stream"):function(){},s=U("./internal/streams/buffer_list"),t=U("./internal/streams/destroy"),a=U("./internal/streams/state").getHighWaterMark,f=U("../errors").codes,d=f.ERR_INVALID_ARG_TYPE,l=f.ERR_STREAM_PUSH_AFTER_EOF,h=f.ERR_METHOD_NOT_IMPLEMENTED,m=f.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,y=(U("inherits")(_,n),t.errorOrDestroy),g=["error","close","destroy","pause","resume"];function v(e,t,r){i=i||U("./_stream_duplex"),e=e||{},"boolean"!=typeof r&&(r=t instanceof i),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=a(this,e,"readableHighWaterMark",r),this.buffer=new s,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o=o||U("string_decoder/").StringDecoder,this.decoder=new o(e.encoding),this.encoding=e.encoding)}function _(e){if(i=i||U("./_stream_duplex"),!(this instanceof _))return new _(e);var t=this instanceof i;this._readableState=new v(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),n.call(this)}function w(e,t,r,i,n){b("readableAddChunk",t);var o,s,a,f,h=e._readableState;if(null===t)h.reading=!1,s=e,a=h,b("onEofChunk"),a.ended||(a.decoder&&(f=a.decoder.end())&&f.length&&(a.buffer.push(f),a.length+=a.objectMode?1:f.length),a.ended=!0,a.sync?k(s):(a.needReadable=!1,a.emittedReadable||(a.emittedReadable=!0,E(s))));else if(o=n?o:function(e,t){var r;!function(e){return u.isBuffer(e)||e instanceof c}(t)&&"string"!=typeof t&&void 0!==t&&!e.objectMode&&(r=new d("chunk",["string","Buffer","Uint8Array"],t));return r}(h,t))y(e,o);else if(h.objectMode||t&&0<t.length)if("string"==typeof t||h.objectMode||Object.getPrototypeOf(t)===u.prototype||(f=t,t=u.from(f)),i)h.endEmitted?y(e,new m):M(e,h,t,!0);else if(h.ended)y(e,new l);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(t=h.decoder.write(t),h.objectMode||0!==t.length?M(e,h,t,!1):x(e,h)):M(e,h,t,!1)}else i||(h.reading=!1,x(e,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function M(e,t,r,i){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),x(e,t)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=t.destroy,_.prototype._undestroy=t.undestroy,_.prototype._destroy=function(e,t){t(e)},_.prototype.push=function(e,t){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof e&&((t=t||i.defaultEncoding)!==i.encoding&&(e=u.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},_.prototype.unshift=function(e){return w(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){for(var t=new(o=o||U("string_decoder/").StringDecoder)(e),r=(this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding,this._readableState.buffer.head),i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var S=1073741824;function A(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?(t.flowing&&t.length?t.buffer.head.data:t).length:(e>t.highWaterMark&&(t.highWaterMark=(S<=(r=e)?r=S:(r--,r=(r=(r=(r=(r|=r>>>1)|r>>>2)|r>>>4)|r>>>8)|r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;b("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(b("emitReadable",t.flowing),t.emittedReadable=!0,D.nextTick(E,e))}function E(e){var t=e._readableState;b("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function x(e,t){t.readingMore||(t.readingMore=!0,D.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(b("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=0<e.listenerCount("readable"),t.resumeScheduled&&!t.paused?t.flowing=!0:0<e.listenerCount("data")&&e.resume()}function R(e){b("readable nexttick read 0"),e.read(0)}function j(e,t){b("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(b("flow",t.flowing);t.flowing&&null!==e.read(););}function C(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function T(e){var t=e._readableState;b("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,D.nextTick(L,t,e))}function L(e,t){b("endReadableNT",e.endEmitted,e.length),e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy&&(!(e=t._writableState)||e.autoDestroy&&e.finished)&&t.destroy())}function O(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}_.prototype.read=function(e){b("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:0<t.length)||t.ended))return b("read: emitReadable",t.length,t.ended),(0===t.length&&t.ended?T:k)(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&T(this),null;var i=t.needReadable;return b("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&b("length less than watermark",i=!0),t.ended||t.reading?b("reading or ended",i=!1):i&&(b("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=A(r,t))),null===(i=0<e?C(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&T(this)),null!==i&&this.emit("data",i),i},_.prototype._read=function(e){y(this,new h("_read()"))},_.prototype.pipe=function(r,e){var i=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=r;break;case 1:n.pipes=[n.pipes,r];break;default:n.pipes.push(r)}n.pipesCount+=1,b("pipe count=%d opts=%j",n.pipesCount,e);e=(!e||!1!==e.end)&&r!==D.stdout&&r!==D.stderr?s:l;function o(e,t){b("onunpipe"),e===i&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,b("cleanup"),r.removeListener("close",c),r.removeListener("finish",d),r.removeListener("drain",a),r.removeListener("error",u),r.removeListener("unpipe",o),i.removeListener("end",s),i.removeListener("end",l),i.removeListener("data",h),f=!0,!n.awaitDrain||r._writableState&&!r._writableState.needDrain||a())}function s(){b("onend"),r.end()}n.endEmitted?D.nextTick(e):i.once("end",e),r.on("unpipe",o);t=i;var t,a=function(){var e=t._readableState;b("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&p(t,"data")&&(e.flowing=!0,B(t))},f=(r.on("drain",a),!1);function h(e){b("ondata");e=r.write(e);b("dest.write",e),!1===e&&((1===n.pipesCount&&n.pipes===r||1<n.pipesCount&&-1!==O(n.pipes,r))&&!f&&(b("false write response, pause",n.awaitDrain),n.awaitDrain++),i.pause())}function u(e){b("onerror",e),l(),r.removeListener("error",u),0===p(r,"error")&&y(r,e)}function c(){r.removeListener("finish",d),l()}function d(){b("onfinish"),r.removeListener("close",c),l()}function l(){b("unpipe"),i.unpipe(r)}return i.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(r,"error",u),r.once("close",c),r.once("finish",d),r.emit("pipe",i),n.flowing||(b("pipe resume"),i.resume()),r},_.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0!==t.pipesCount){if(1===t.pipesCount)return e&&e!==t.pipes||(e=e||t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(e){var i=O(t.pipes,e);-1!==i&&(t.pipes.splice(i,1),--t.pipesCount,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r))}else{var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<o;s++)n[s].emit("unpipe",this,{hasUnpiped:!1})}}return this},_.prototype.addListener=_.prototype.on=function(e,t){var t=n.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=0<this.listenerCount("readable"),!1!==r.flowing&&this.resume()):"readable"!==e||r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,b("on readable",r.length,r.reading),r.length?k(this):r.reading||D.nextTick(R,this)),t},_.prototype.removeListener=function(e,t){t=n.prototype.removeListener.call(this,e,t);return"readable"===e&&D.nextTick(I,this),t},_.prototype.removeAllListeners=function(e){var t=n.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||D.nextTick(I,this),t},_.prototype.resume=function(){var e,t,r=this._readableState;return r.flowing||(b("resume"),r.flowing=!r.readableListening,e=this,(t=r).resumeScheduled||(t.resumeScheduled=!0,D.nextTick(j,e,t))),r.paused=!1,this},_.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(t){var e,r=this,i=this._readableState,n=!1;for(e in t.on("end",function(){var e;b("wrapped end"),i.decoder&&!i.ended&&(e=i.decoder.end())&&e.length&&r.push(e),r.push(null)}),t.on("data",function(e){b("wrapped data"),i.decoder&&(e=i.decoder.write(e)),i.objectMode&&null==e||(i.objectMode||e&&e.length)&&!r.push(e)&&(n=!0,t.pause())}),t)void 0===this[e]&&"function"==typeof t[e]&&(this[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e));for(var o=0;o<g.length;o++)t.on(g[o],this.emit.bind(this,g[o]));return this._read=function(e){b("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(_.prototype[Symbol.asyncIterator]=function(){return(e=void 0===e?U("./internal/streams/async_iterator"):e)(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),_._fromList=C,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(_.from=function(e,t){return(r=void 0===r?U("./internal/streams/from"):r)(_,e,t)})}.call(this)}.call(this,U("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":127,"./_stream_duplex":128,"./internal/streams/async_iterator":133,"./internal/streams/buffer_list":134,"./internal/streams/destroy":135,"./internal/streams/from":137,"./internal/streams/state":139,"./internal/streams/stream":140,_process:118,buffer:49,events:84,inherits:102,"string_decoder/":154,util:18}],131:[function(e,t,r){"use strict";t.exports=f;var t=e("../errors").codes,i=t.ERR_METHOD_NOT_IMPLEMENTED,n=t.ERR_MULTIPLE_CALLBACK,o=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=t.ERR_TRANSFORM_WITH_LENGTH_0,a=e("./_stream_duplex");function f(e){if(!(this instanceof f))return new f(e);a.call(this,e),this._transformState={afterTransform:function(e,t){var r=this._transformState,i=(r.transforming=!1,r.writecb);if(null===i)return this.emit("error",new n);r.writechunk=null,(r.writecb=null)!=t&&this.push(t),i(e),(r=this._readableState).reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",h)}function h(){var r=this;"function"!=typeof this._flush||this._readableState.destroyed?u(this,null,null):this._flush(function(e,t){u(r,e,t)})}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new o;e.push(null)}e("inherits")(f,a),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new i("_transform()"))},f.prototype._write=function(e,t,r){var i=this._transformState;i.writecb=r,i.writechunk=e,i.writeencoding=t,i.transforming||(r=this._readableState,(i.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark))},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){a.prototype._destroy.call(this,e,function(e){t(e)})}},{"../errors":127,"./_stream_duplex":128,inherits:102}],132:[function(R,j,e){!function(P,I){!function(){"use strict";function c(o){var s=this;this.next=null,this.entry=null,this.finish=function(){var e=s,t=o,r=void 0,i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}}(j.exports=w).WritableState=_;var r,e={deprecate:R("util-deprecate")},i=R("./internal/streams/stream"),d=R("buffer").Buffer,l=I.Uint8Array||function(){};var n,t=R("./internal/streams/destroy"),o=R("./internal/streams/state").getHighWaterMark,s=R("../errors").codes,p=s.ERR_INVALID_ARG_TYPE,a=s.ERR_METHOD_NOT_IMPLEMENTED,b=s.ERR_MULTIPLE_CALLBACK,f=s.ERR_STREAM_CANNOT_PIPE,h=s.ERR_STREAM_DESTROYED,m=s.ERR_STREAM_NULL_VALUES,y=s.ERR_STREAM_WRITE_AFTER_END,u=s.ERR_UNKNOWN_ENCODING,g=t.errorOrDestroy;function v(){}function _(e,u,t){r=r||R("./_stream_duplex"),e=e||{},"boolean"!=typeof t&&(t=u instanceof r),this.objectMode=!!e.objectMode,t&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=o(this,e,"writableHighWaterMark",t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;t=(this.destroyed=!1)===e.decodeStrings;this.decodeStrings=!t,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){var t=u,r=t._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new b;var o,s,a,f,h=r;h.writing=!1,h.writecb=null,h.length-=h.writelen,h.writelen=0,e?(h=t,s=i,a=e,f=n,--(o=r).pendingcb,s?(P.nextTick(f,a),P.nextTick(x,h,o),h._writableState.errorEmitted=!0,g(h,a)):(f(a),h._writableState.errorEmitted=!0,g(h,a),x(h,o))):((e=k(r)||t.destroyed)||r.corked||r.bufferProcessing||!r.bufferedRequest||A(t,r),i?P.nextTick(S,t,r,e,n):S(t,r,e,n))},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}R("inherits")(w,i),_.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};try{Object.defineProperty(_.prototype,"buffer",{get:e.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}function w(e){var t=this instanceof(r=r||R("./_stream_duplex"));if(!t&&!n.call(w,this))return new w(e);this._writableState=new _(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),i.call(this)}function M(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new h("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function S(e,t,r,i){var n;r||(r=e,0===(n=t).length&&n.needDrain&&(n.needDrain=!1,r.emit("drain"))),t.pendingcb--,i(),x(e,t)}function A(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){for(var i=t.bufferedRequestCount,n=new Array(i),i=t.corkedRequestsFree,o=(i.entry=r,0),s=!0;r;)(n[o]=r).isBuf||(s=!1),r=r.next,o+=1;n.allBuffers=s,M(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new c(t),t.bufferedRequestCount=0}else{for(;r;){var a=r.chunk,f=r.encoding,h=r.callback;if(M(e,t,!1,t.objectMode?1:a.length,a,f,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(t,r){t._final(function(e){r.pendingcb--,e&&g(t,e),r.prefinished=!0,t.emit("prefinish"),x(t,r)})}function x(e,t){var r,i,n=k(t);return n&&(r=e,(i=t).prefinished||i.finalCalled||("function"!=typeof r._final||i.destroyed?(i.prefinished=!0,r.emit("prefinish")):(i.pendingcb++,i.finalCalled=!0,P.nextTick(E,r,i))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy&&(!(r=e._readableState)||r.autoDestroy&&r.endEmitted)&&e.destroy())),n}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(n=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(e){return!!n.call(this,e)||this===w&&(e&&e._writableState instanceof _)}})):n=function(e){return e instanceof this},w.prototype.pipe=function(){g(this,new f)},w.prototype.write=function(e,t,r){var i,n,o,s,a,f,h=this._writableState,u=!1,c=!h.objectMode&&(c=e,d.isBuffer(c)||c instanceof l);return c&&!d.isBuffer(e)&&(s=e,e=d.from(s)),"function"==typeof t&&(r=t,t=null),t=c?"buffer":t||h.defaultEncoding,"function"!=typeof r&&(r=v),h.ending?(s=this,a=r,f=new y,g(s,f),P.nextTick(a,f)):!c&&(a=this,f=h,n=r,null===(i=e)?o=new m:"string"==typeof i||f.objectMode||(o=new p("chunk",["string","Buffer"],i)),o&&(g(a,o),!void P.nextTick(n,o)))||(h.pendingcb++,u=function(e,t,r,i,n,o){r||(s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,i,n),i!==s&&(r=!0,n="buffer",i=s));var s=t.objectMode?1:i.length,a=(t.length+=s,t.length<t.highWaterMark);a||(t.needDrain=!0);{var f;t.writing||t.corked?(f=t.lastBufferedRequest,t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1):M(e,t,!1,s,i,n,o)}return a}(this,h,c,e,t,r)),u},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},w.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase()))return this._writableState.defaultEncoding=e,this;throw new u(e)},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(e,t,r){r(new a("_write()"))},w.prototype._writev=null,w.prototype.end=function(e,t,r){var i=this._writableState;if("function"==typeof e?(r=e,t=e=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),!i.ending){e=this,t=i,i=r;t.ending=!0,x(e,t),i&&(t.finished?P.nextTick(i):e.once("finish",i)),t.ended=!0,e.writable=!1}return this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),w.prototype.destroy=t.destroy,w.prototype._undestroy=t.undestroy,w.prototype._destroy=function(e,t){t(e)}}.call(this)}.call(this,R("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":127,"./_stream_duplex":128,"./internal/streams/destroy":135,"./internal/streams/state":139,"./internal/streams/stream":140,_process:118,buffer:49,inherits:102,"util-deprecate":156}],133:[function(i,m,e){!function(b){!function(){"use strict";var e;function r(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}var n=i("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),f=Symbol("ended"),h=Symbol("lastPromise"),u=Symbol("handlePromise"),c=Symbol("stream");function d(e,t){return{value:e,done:t}}function l(e){var t,r=e[o];null!==r&&null!==(t=e[c].read())&&(e[h]=null,e[o]=null,e[s]=null,r(d(t,!1)))}var t=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((r(e={get stream(){return this[c]},next:function(){var r=this,e=this[a];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(d(void 0,!0));if(this[c].destroyed)return new Promise(function(e,t){b.nextTick(function(){r[a]?t(r[a]):e(d(void 0,!0))})});var t,i,n,e=this[h];if(e)t=new Promise((i=e,n=this,function(e,t){i.then(function(){n[f]?e(d(void 0,!0)):n[u](e,t)},t)}));else{e=this[c].read();if(null!==e)return Promise.resolve(d(e,!1));t=new Promise(this[u])}return this[h]=t}},Symbol.asyncIterator,function(){return this}),r(e,"return",function(){var e=this;return new Promise(function(t,r){e[c].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),e),t);m.exports=function(e){var t,i=Object.create(p,(r(t={},c,{value:e,writable:!0}),r(t,o,{value:null,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,f,{value:e._readableState.endEmitted,writable:!0}),r(t,u,{value:function(e,t){var r=i[c].read();r?(i[h]=null,i[o]=null,i[s]=null,e(d(r,!1))):(i[o]=e,i[s]=t)},writable:!0}),t));return i[h]=null,n(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code)return null!==(t=i[s])&&(i[h]=null,i[o]=null,i[s]=null,t(e)),void(i[a]=e);var t=i[o];null!==t&&(i[h]=null,i[o]=null,t(d(void 0,!(i[s]=null)))),i[f]=!0}),e.on("readable",function(e){b.nextTick(l,e)}.bind(null,i)),i}}.call(this)}.call(this,i("_process"))},{"./end-of-stream":136,_process:118}],134:[function(e,t,r){"use strict";function o(t,e){var r,i=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)),i}function n(i){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach(function(e){var t,r;t=i,r=n[e=e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))})}return i}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=e("buffer").Buffer,f=e("util").inspect,h=f&&f.custom||"inspect";t.exports=function(){function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}var t,r,i;return t=e,(r=[{key:"push",value:function(e){e={data:e,next:null};0<this.length?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(e){e={data:e,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){var e;if(0!==this.length)return e=this.head.data,1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,i=a.allocUnsafe(e>>>0),n=this.head,o=0;n;)t=n.data,r=o,a.prototype.copy.call(t,i,r),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,i=t.data;for(e-=i.length;t=t.next;){var n=t.data,o=e>n.length?n.length:e;if(o===n.length?i+=n:i+=n.slice(0,e),0===(e-=o)){o===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t).data=n.slice(o);break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,o=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,o),0===(e-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r).data=n.slice(o);break}++i}return this.length-=i,t}},{key:h,value:function(e,t){return f(this,n({},t,{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),i&&s(t,i),e}()},{buffer:49,util:18}],135:[function(e,t,r){!function(f){!function(){"use strict";function o(e,t){a(e,t),s(e)}function s(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,f.nextTick(a,this,e)):f.nextTick(a,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?f.nextTick(s,r):(r._writableState.errorEmitted=!0,f.nextTick(o,r,e)):f.nextTick(o,r,e):t?(f.nextTick(s,r),t(e)):f.nextTick(s,r)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}}}.call(this)}.call(this,e("_process"))},{_process:118}],136:[function(e,t,r){"use strict";var y=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function g(){}t.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);function n(){t.writable||o()}function o(){b=!(p=!1),l||i.call(t)}function s(){m=!(l=!1),p||i.call(t)}function a(e){i.call(t,e)}function f(){var e;return l&&!m?(t._readableState&&t._readableState.ended||(e=new y),i.call(t,e)):p&&!b?(t._writableState&&t._writableState.ended||(e=new y),i.call(t,e)):void 0}function h(){t.req.on("finish",o)}u=i||g,c=!1,i=function(){if(!c){c=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u.apply(this,t)}};var u,c,d,l=(r=r||{}).readable||!1!==r.readable&&t.readable,p=r.writable||!1!==r.writable&&t.writable,b=t._writableState&&t._writableState.finished,m=t._readableState&&t._readableState.endEmitted;return(d=t).setHeader&&"function"==typeof d.abort?(t.on("complete",o),t.on("abort",f),t.req?h():t.on("request",h)):p&&!t._writableState&&(t.on("end",n),t.on("close",n)),t.on("end",s),t.on("finish",o),!1!==r.error&&t.on("error",a),t.on("close",f),function(){t.removeListener("complete",o),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",o),t.removeListener("end",n),t.removeListener("close",n),t.removeListener("finish",o),t.removeListener("end",s),t.removeListener("error",a),t.removeListener("close",f)}}},{"../../../errors":127}],137:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],138:[function(f,e,t){"use strict";var h;var r=f("../../../errors").codes,a=r.ERR_MISSING_ARGS,u=r.ERR_STREAM_DESTROYED;function c(e){if(e)throw e}function d(r,e,t,i){n=i,o=!1;var n,o,s=!(i=function(){o||(o=!0,n.apply(void 0,arguments))}),a=(r.on("close",function(){s=!0}),(h=void 0===h?f("./end-of-stream"):h)(r,{readable:e,writable:t},function(e){if(e)return i(e);s=!0,i()}),!1);return function(e){var t;if(!s&&!a)return a=!0,(t=r).setHeader&&"function"==typeof t.abort?r.abort():"function"==typeof r.destroy?r.destroy():void i(e||new u("pipe"))}}function l(e){e()}function p(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,i=new Array(e),t=0;t<e;t++)i[t]=arguments[t];var r,n,o=!(r=i).length||"function"!=typeof r[r.length-1]?c:r.pop();if((i=Array.isArray(i[0])?i[0]:i).length<2)throw new a("streams");var s=i.map(function(e,t){var r=t<i.length-1;return d(e,r,0<t,function(e){n=n||e,e&&s.forEach(l),r||(s.forEach(l),o(n))})});return i.reduce(p)}},{"../../../errors":127,"./end-of-stream":136}],139:[function(e,t,r){"use strict";var s=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){o=i,n=r;var n,o=null!=(t=t).highWaterMark?t.highWaterMark:o?t[n]:null;if(null==o)return e.objectMode?16:16384;if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new s(i?r:"highWaterMark",o);return Math.floor(o)}}},{"../../../errors":127}],140:[function(e,t,r){t.exports=e("events").EventEmitter},{events:84}],141:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":128,"./lib/_stream_passthrough.js":129,"./lib/_stream_readable.js":130,"./lib/_stream_transform.js":131,"./lib/_stream_writable.js":132,"./lib/internal/streams/end-of-stream.js":136,"./lib/internal/streams/pipeline.js":138}],142:[function(e,t,r){"use strict";var i=e("buffer").Buffer,n=e("inherits"),o=e("hash-base"),m=new Array(16),y=[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],g=[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],v=[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],_=[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],w=[0,1518500249,1859775393,2400959708,2840853838],M=[1352829926,1548603684,1836072691,2053994217,0];function s(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function S(e,t){return e<<t|e>>>32-t}function A(e,t,r,i,n,o,s,a){return S(e+(t^r^i)+o+s|0,a)+n|0}function k(e,t,r,i,n,o,s,a){return S(e+(t&r|~t&i)+o+s|0,a)+n|0}function E(e,t,r,i,n,o,s,a){return S(e+((t|~r)^i)+o+s|0,a)+n|0}function x(e,t,r,i,n,o,s,a){return S(e+(t&i|r&~i)+o+s|0,a)+n|0}function P(e,t,r,i,n,o,s,a){return S(e+(t^(r|~i))+o+s|0,a)+n|0}n(s,o),s.prototype._update=function(){for(var e=m,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,s=0|this._e,a=0|this._a,f=0|this._b,h=0|this._c,u=0|this._d,c=0|this._e,d=0;d<80;d+=1)var l,p=d<16?(l=A(r,i,n,o,s,e[y[d]],w[0],v[d]),P(a,f,h,u,c,e[g[d]],M[0],_[d])):d<32?(l=k(r,i,n,o,s,e[y[d]],w[1],v[d]),x(a,f,h,u,c,e[g[d]],M[1],_[d])):d<48?(l=E(r,i,n,o,s,e[y[d]],w[2],v[d]),E(a,f,h,u,c,e[g[d]],M[2],_[d])):d<64?(l=x(r,i,n,o,s,e[y[d]],w[3],v[d]),k(a,f,h,u,c,e[g[d]],M[3],_[d])):(l=P(r,i,n,o,s,e[y[d]],w[4],v[d]),A(a,f,h,u,c,e[g[d]],M[4],_[d])),r=s,s=o,o=S(n,10),n=i,i=l,a=c,c=u,u=S(h,10),h=f,f=p;var b=this._b+n+u|0;this._b=this._c+o+c|0,this._c=this._d+s+a|0,this._d=this._e+r+f|0,this._e=this._a+i+h|0,this._a=b},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56<this._blockOffset&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=i.alloc?i.alloc(20):new i(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},t.exports=s},{buffer:49,"hash-base":86,inherits:102}],143:[function(e,t,r){var i=e("buffer"),n=i.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,r),r.Buffer=s),o(n,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=n(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:49}],144:[function(s,a,e){!function(o){!function(){"use strict";var e,t=s("buffer"),i=t.Buffer,r={};for(e in t)t.hasOwnProperty(e)&&"SlowBuffer"!==e&&"Buffer"!==e&&(r[e]=t[e]);var n=r.Buffer={};for(e in i)i.hasOwnProperty(e)&&"allocUnsafe"!==e&&"allocUnsafeSlow"!==e&&(n[e]=i[e]);if(r.Buffer.prototype=i.prototype,n.from&&n.from!==Uint8Array.from||(n.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return i(e,t,r)}),n.alloc||(n.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||2*(1<<30)<=e)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=i(e);return t&&0!==t.length?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e}),!r.kStringMaxLength)try{r.kStringMaxLength=o.binding("buffer").kStringMaxLength}catch(e){}r.constants||(r.constants={MAX_LENGTH:r.kMaxLength},r.kStringMaxLength&&(r.constants.MAX_STRING_LENGTH=r.kStringMaxLength)),a.exports=r}.call(this)}.call(this,s("_process"))},{_process:118,buffer:49}],145:[function(e,t,r){var u=e("safe-buffer").Buffer;function i(e,t){this._block=u.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(e=u.from(e,t=t||"utf8"));for(var r=this._block,i=this._blockSize,n=e.length,o=this._len,s=0;s<n;){for(var a=o%i,f=Math.min(n-s,i-a),h=0;h<f;h++)r[a+h]=e[s+h];s+=f,(o+=f)%i==0&&this._update(r)}return this._len+=n,this},i.prototype.digest=function(e){var t=this._len%this._blockSize,t=(this._block[t]=128,this._block.fill(0,1+t),t>=this._finalSize&&(this._update(this._block),this._block.fill(0)),8*this._len),t=(t<=4294967295?this._block.writeUInt32BE(t,this._blockSize-4):(this._block.writeUInt32BE((t-(t=(4294967295&t)>>>0))/4294967296,this._blockSize-8),this._block.writeUInt32BE(t,this._blockSize-4)),this._update(this._block),this._hash());return e?t.toString(e):t},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":143}],146:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(t)return new t;throw new Error(e+" is not supported (we accept pull requests)")}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":147,"./sha1":148,"./sha224":149,"./sha256":150,"./sha384":151,"./sha512":152}],147:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,p=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,n.call(this,64,56)}i(a,n),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(e){for(var t=this._w,r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,s=0|this._e,a=0;a<16;++a)t[a]=e.readInt32BE(4*a);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var f,h,u,c=0;c<80;++c)var d=~~(c/20),l=0|(r<<5|r>>>27)+(f=i,h=n,u=o,0===(l=d)?f&h|~f&u:2===l?f&h|f&u|h&u:f^h^u)+s+t[c]+p[d],s=o,o=n,n=i<<30|i>>>2,i=r,r=l;this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},a.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=a},{"./hash":145,inherits:102,"safe-buffer":143}],148:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,n.call(this,64,56)}i(a,n),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=(t=r[f-3]^r[f-8]^r[f-14]^r[f-16])<<1|t>>>31;for(var h,u,c,d=0;d<80;++d)var l=~~(d/20),p=0|(i<<5|i>>>27)+(h=n,u=o,c=s,0===(p=l)?h&u|~h&c:2===p?h&u|h&c|u&c:h^u^c)+a+r[d]+b[l],a=s,s=o,o=n<<30|n>>>2,n=i,i=p;this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},a.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=a},{"./hash":145,inherits:102,"safe-buffer":143}],149:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),o=e("./hash"),s=e("safe-buffer").Buffer,a=new Array(64);function f(){this.init(),this._w=a,o.call(this,64,56)}i(f,n),f.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},f.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=f},{"./hash":145,"./sha256":150,inherits:102,"safe-buffer":143}],150:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,b=[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],s=new Array(64);function a(){this.init(),this._w=s,n.call(this,64,56)}i(a,n),a.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},a.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,f=0|this._f,h=0|this._g,u=0|this._h,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<64;++c)r[c]=0|(((t=r[c-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[c-7]+(((t=r[c-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+r[c-16];for(var d=0;d<64;++d)var l=u+((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(h^a&(f^h))+b[d]+r[d]|0,p=0|((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&n|o&(i|n)),u=h,h=f,f=a,a=s+l|0,s=o,o=n,n=i,i=l+p|0;this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=f+this._f|0,this._g=h+this._g|0,this._h=u+this._h|0},a.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=a},{"./hash":145,inherits:102,"safe-buffer":143}],151:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),o=e("./hash"),s=e("safe-buffer").Buffer,a=new Array(160);function f(){this.init(),this._w=a,o.call(this,128,112)}i(f,n),f.prototype.init=function(){return 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,this},f.prototype._hash=function(){var i=s.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=f},{"./hash":145,"./sha512":152,inherits:102,"safe-buffer":143}],152:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,q=[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],s=new Array(160);function a(){this.init(),this._w=s,n.call(this,128,112)}function z(e,t,r){return r^e&(t^r)}function H(e,t,r){return e&t|r&(e|t)}function K(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function F(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function V(e,t){return e>>>0<t>>>0?1:0}i(a,n),a.prototype.init=function(){return 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,this},a.prototype._update=function(e){for(var t=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,f=0|this._gh,h=0|this._hh,u=0|this._al,c=0|this._bl,d=0|this._cl,l=0|this._dl,p=0|this._el,b=0|this._fl,m=0|this._gl,y=0|this._hl,g=0;g<32;g+=2)t[g]=e.readInt32BE(4*g),t[g+1]=e.readInt32BE(4*g+4);for(;g<160;g+=2){var v=t[g-30],_=t[g-30+1],w=(v>>>1|_<<31)^(v>>>8|_<<24)^v>>>7,M=(_>>>1|v<<31)^(_>>>8|v<<24)^(_>>>7|v<<25),v=t[g-4],S=((_=t[g-4+1])>>>19|v<<13)^(v>>>29|_<<3)^(_>>>6|v<<26),A=t[g-14],k=t[g-14+1],L=t[g-32],E=t[g-32+1],x=M+k|0,P=w+A+V(x,M)|0;P=(P=P+((v>>>19|_<<13)^(_>>>29|v<<3)^v>>>6)+V(x=x+S|0,S)|0)+L+V(x=x+E|0,E)|0,t[g]=P,t[g+1]=x}for(var I=0;I<160;I+=2){P=t[I],x=t[I+1];var D=H(r,i,n),N=H(u,c,d),U=K(r,u),R=K(u,r),j=F(s,p),B=F(p,s),C=q[I+1],T=z(s,a,f),O=z(p,b,m),B=y+B|0,T=(j=(((h+j+V(B,y)|0)+T+V(B=B+O|0,O)|0)+q[I]+V(B=B+C|0,C)|0)+P+V(B=B+x|0,x)|0,R+N|0),O=U+D+V(T,R)|0,h=f,y=m,f=a,m=b,a=s,b=p,s=o+j+V(p=l+B|0,l)|0,o=n,l=d,n=i,d=c,i=r,c=u,r=j+O+V(u=B+T|0,B)|0}this._al=this._al+u|0,this._bl=this._bl+c|0,this._cl=this._cl+d|0,this._dl=this._dl+l|0,this._el=this._el+p|0,this._fl=this._fl+b|0,this._gl=this._gl+m|0,this._hl=this._hl+y|0,this._ah=this._ah+r+V(this._al,u)|0,this._bh=this._bh+i+V(this._bl,c)|0,this._ch=this._ch+n+V(this._cl,d)|0,this._dh=this._dh+o+V(this._dl,l)|0,this._eh=this._eh+s+V(this._el,p)|0,this._fh=this._fh+a+V(this._fl,b)|0,this._gh=this._gh+f+V(this._gl,m)|0,this._hh=this._hh+h+V(this._hl,y)|0},a.prototype._hash=function(){var i=o.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=a},{"./hash":145,inherits:102,"safe-buffer":143}],153:[function(e,t,r){t.exports=i;var u=e("events").EventEmitter;function i(){u.call(this)}e("inherits")(i,u),i.Readable=e("readable-stream/lib/_stream_readable.js"),i.Writable=e("readable-stream/lib/_stream_writable.js"),i.Duplex=e("readable-stream/lib/_stream_duplex.js"),i.Transform=e("readable-stream/lib/_stream_transform.js"),i.PassThrough=e("readable-stream/lib/_stream_passthrough.js"),i.finished=e("readable-stream/lib/internal/streams/end-of-stream.js"),i.pipeline=e("readable-stream/lib/internal/streams/pipeline.js"),(i.Stream=i).prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",n),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",a));var o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function f(e){if(h(),0===u.listenerCount(this,"error"))throw e}function h(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("error",f),t.on("error",f),r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t}},{events:84,inherits:102,"readable-stream/lib/_stream_duplex.js":128,"readable-stream/lib/_stream_passthrough.js":129,"readable-stream/lib/_stream_readable.js":130,"readable-stream/lib/_stream_transform.js":131,"readable-stream/lib/_stream_writable.js":132,"readable-stream/lib/internal/streams/end-of-stream.js":136,"readable-stream/lib/internal/streams/pipeline.js":138}],154:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.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}};function o(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"==typeof t||i.isEncoding!==n&&n(e))return t||e;throw new Error("Unknown encoding: "+e)}function s(e){var t;switch(this.encoding=o(e),this.encoding){case"utf16le":this.text=h,this.end=u,t=4;break;case"utf8":this.fillLast=f,t=4;break;case"base64":this.text=c,this.end=d,t=3;break;default:return this.write=l,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function f(e){var t,r=this.lastTotal-this.lastNeed,i=(t=this,128!=(192&(i=e)[0])?(t.lastNeed=0,"�"):1<t.lastNeed&&1<i.length?128!=(192&i[1])?(t.lastNeed=1,"�"):2<t.lastNeed&&2<i.length&&128!=(192&i[2])?(t.lastNeed=2,"�"):void 0:void 0);return void 0!==i?i:this.lastNeed<=e.length?(e.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,r,0,e.length),void(this.lastNeed-=e.length))}function h(e,t){if((e.length-t)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1);t=e.toString("utf16le",t);if(t){var r=t.charCodeAt(t.length-1);if(55296<=r&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}function u(e){var t,e=e&&e.length?this.write(e):"";return this.lastNeed?(t=this.lastTotal-this.lastNeed,e+this.lastChar.toString("utf16le",0,t)):e}function c(e,t){var r=(e.length-t)%3;return 0==r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function d(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}(r.StringDecoder=s).prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=function(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+"�":e},s.prototype.text=function(e,t){var r=function(e,t,r){var i=t.length-1;if(!(i<r)){var n=a(t[i]);if(0<=n)return 0<n&&(e.lastNeed=n-1),n;if(!(--i<r||-2===n)){if(0<=(n=a(t[i])))return 0<n&&(e.lastNeed=n-2),n;if(!(--i<r||-2===n)&&0<=(n=a(t[i])))return 0<n&&(2===n?n=0:e.lastNeed=n-3),n}}return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;r=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":155}],155:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:49,dup:48}],156:[function(e,r,t){!function(t){!function(){function i(e){try{if(!t.localStorage)return}catch(e){return}e=t.localStorage[e];return null!=e&&"true"===String(e).toLowerCase()}r.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],157:[function(e,t,r){"use strict";var s=this&&this.__assign||function(){return(s=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},f=(Object.defineProperty(r,"__esModule",{value:!0}),e(".."));function i(e){var t=this;this._clientToSend={},this._isClientConnected={},this._clientIsServer={},this._tooldb=e,setTimeout(function(){t.tooldb.options.server&&t.getMeAsPeer().then(function(e){t.tooldb.serverPeers.push(e)})},100)}Object.defineProperty(i.prototype,"clientToSend",{get:function(){return this._clientToSend},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isClientConnected",{get:function(){return this._isClientConnected},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"tooldb",{get:function(){return this._tooldb},enumerable:!1,configurable:!0}),i.prototype.getMeAsPeer=function(){var t=this,r=(new Date).getTime();return(0,f.getPeerSignature)(this.tooldb.peerAccount,this.tooldb.options.topic,r,this.tooldb.options.host,this.tooldb.options.port).then(function(e){return{topic:t.tooldb.options.topic,timestamp:r,host:t.tooldb.options.host,port:t.tooldb.options.port,address:t.tooldb.peerAccount.getAddress()||"",sig:e}})},i.prototype.isConnected=function(e){return!!this._isClientConnected[e]&&this._isClientConnected[e]()},i.prototype.isServer=function(e){return this._clientIsServer[e]||!1},i.prototype.craftPingMessage=function(){var t=this;return this.getMeAsPeer().then(function(e){return JSON.stringify({type:"ping",clientId:t.getClientAddress(),to:[t.getClientAddress()],isServer:t.tooldb.options.server,id:(0,f.textRandom)(10),peer:e})})},i.prototype.executeSendToClient=function(e,t){this._clientToSend[e]&&this._clientToSend[e](t)},i.prototype.getClientAddress=function(){return(this.tooldb.peerAccount.getAddress()||"").slice(-20)},i.prototype.onClientDisconnect=function(e){delete this._clientToSend[e],delete this._clientIsServer[e]},i.prototype.onClientMessage=function(t,e,r){e&&!this.tooldb.processedOutHashes[e]&&(this.tooldb.processedOutHashes[e]=[]);try{var i,n=JSON.parse(t);"ping"===n.type||"pong"===n.type?(r(i=n.clientId),this.tooldb.onPeerConnect(i),this._clientIsServer[i]=n.isServer,this.tooldb.processedOutHashes[i]=[],this.tooldb.clientOnMessage(n,i)):e&&this.tooldb.clientOnMessage(n,e)}catch(e){this.tooldb.logger("Got message ERR",t),this.tooldb.logger(e)}},i.prototype.sendToAll=function(t,r){var i=this,n=(void 0===r&&(r=!1),(0,f.uniq)(a(a([],t.to,!0),[this.getClientAddress()],!1))),o=JSON.stringify(s(s({},t),{to:n}));Object.keys(this.clientToSend).filter(function(e){return!n.includes(e)}).filter(function(e){return i.isConnected(e)}).forEach(function(e){(r&&i.isServer(e)||!r)&&(i.tooldb.logger(n,"Sent out to:",e),"put"===t.type||"crdtPut"===t.type?i.tooldb.processedOutHashes[e].includes(t.data.h)||(i.executeSendToClient(e,o),i.tooldb.processedOutHashes[e].push(t.data.h)):i.executeSendToClient(e,o))})},i.prototype.sendToClientId=function(e,t){var r=(0,f.uniq)(a(a([],t.to,!0),[this.getClientAddress()],!1)),r=JSON.stringify(s(s({},t),{to:r}));"put"===t.type||"crdtPut"===t.type?e&&!this.tooldb.processedOutHashes[e].includes(t.data.h)&&(this.executeSendToClient(e,r),this.tooldb.processedOutHashes[e].push(t.data.h)):this.executeSendToClient(e,r)},r.default=i},{"..":164}],158:[function(e,t,r){"use strict";function i(e,t){this._tooldb=e,t&&(this._forceStorageName=t)}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(i.prototype,"tooldb",{get:function(){return this._tooldb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"storageName",{get:function(){return this._forceStorageName||this._tooldb.options.storageName},enumerable:!1,configurable:!0}),i.prototype.put=function(e,t){return Promise.resolve()},i.prototype.get=function(e){return Promise.resolve("")},i.prototype.query=function(e){return Promise.resolve([])},r.default=i},{}],159:[function(e,t,r){"use strict";function i(e){this._tooldb=e}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(i.prototype,"tooldb",{get:function(){return this._tooldb},enumerable:!1,configurable:!0}),i.prototype.anonUser=function(){},i.prototype.setUser=function(e,t){},i.prototype.signData=function(e){return Promise.resolve("")},i.prototype.verifySignature=function(e){return Promise.resolve(!1)},i.prototype.getAccountFromPrivate=function(e){return Promise.resolve(void 0)},i.prototype.encryptAccount=function(e){return Promise.resolve(void 0)},i.prototype.decryptAccount=function(e,t){return Promise.resolve(void 0)},i.prototype.getAddress=function(){return""},i.prototype.getUsername=function(){return""},r.default=i},{}],160:[function(e,t,r){"use strict";function i(){this.type=""}Object.defineProperty(r,"__esModule",{value:!0}),r.BaseCrdt=r.CRDT_COUNTER=r.CRDT_LIST=r.CRDT_MAP=void 0,r.CRDT_MAP="MAP",r.CRDT_LIST="LIST",r.CRDT_COUNTER="COUNTER",i.prototype.mergeChanges=function(e){},i.prototype.getChanges=function(){return[]},Object.defineProperty(i.prototype,"value",{get:function(){return""},enumerable:!1,configurable:!0}),r.BaseCrdt=i},{}],161:[function(e,t,r){"use strict";var i,n,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=(Object.defineProperty(r,"__esModule",{value:!0}),r.CounterCrdt=void 0,e("..")),e=(n=s.BaseCrdt,o(a,n),a.prototype.changesSort=function(e,t){return e.i>t.i?1:e.i<t.i?-1:0},a.prototype.calculate=function(){var t=0;Object.values(this._changes).length!==this._lastUpdateSize&&(this._changes.sort(this.changesSort).forEach(function(e){"ADD"===e.t?t+=e.v:"SUB"===e.t&&(t-=e.v)}),this._value=t)},Object.defineProperty(a.prototype,"value",{get:function(){return this.calculate(),this._value},enumerable:!1,configurable:!0}),a.prototype.mergeChanges=function(e){var r=this;e.forEach(function(t){0===r._changes.filter(function(e){return e.i===t.i&&e.a===t.a&&e.t===t.t}).length&&r._changes.push(t)}),this.calculate()},a.prototype.getChanges=function(){return this._changes},a.prototype.ADD=function(e){var t=this,r=this._changes.filter(function(e){return e.a===t._author});this._changes.push({t:"ADD",v:e,a:this._author,i:r.length}),this.calculate()},a.prototype.SUB=function(e){var t=this,r=this._changes.filter(function(e){return e.a===t._author});this._changes.push({t:"SUB",v:e,a:this._author,i:r.length}),this.calculate()},a);function a(e,t){var r=n.call(this)||this;return r.type=s.CRDT_LIST,r._changes=[],r._author="",r._value=0,r._lastUpdateSize=0,r._author=e,t&&r.mergeChanges(t),r.calculate(),r}r.CounterCrdt=e},{"..":164}],162:[function(e,t,r){"use strict";var i,n,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=(Object.defineProperty(r,"__esModule",{value:!0}),r.ListCrdt=void 0,e("..")),e=(n=s.BaseCrdt,o(a,n),a.prototype.changesSort=function(e,t){return e.i>t.i?1:e.i<t.i?-1:0},a.prototype.calculate=function(){var i=[];Object.values(this._changes).length!==this._lastUpdateSize&&(this._changes.sort(this.changesSort).forEach(function(t){var e,r;"INS"===t.t?(r=0,t.p?r=i.findIndex(function(e){return e.index===t.p})+1:t.n&&(r=i.findIndex(function(e){return e.index===t.n})),e={value:t.v,index:t.i,tomb:!1,prev:t.p,next:t.n},i.splice(r,0,e)):"DEL"===t.t&&(r=i.findIndex(function(e){return e.index===t.v}),i[r].tomb=!0)}),this._lastUpdateSize=Object.values(i).length,this._tempValues=i,this._value=i.filter(function(e){return!e.tomb}).map(function(e){return e.value}))},Object.defineProperty(a.prototype,"value",{get:function(){return this.calculate(),this._value},enumerable:!1,configurable:!0}),a.prototype.mergeChanges=function(e){var r=this;e.forEach(function(t){0===r._changes.filter(function(e){return e.i===t.i&&e.t===t.t&&e.v===t.v}).length&&r._changes.push(t)}),this.calculate()},a.prototype.getChanges=function(){return this._changes},a.prototype.INS=function(e,t){var r,i=this,n=this._tempValues.filter(function(e){return!e.tomb}),o=void 0,s=void 0,t=(0!==n.length&&(r=n[t].index,n=this._tempValues.findIndex(function(e){return e.index===r}),o=this._tempValues[n-1],s=this._tempValues[n]),this._changes.filter(function(e){return e.i.startsWith(i._author)}));this._changes.push({t:"INS",p:null==o?void 0:o.index,n:null==s?void 0:s.index,v:e,i:this._author+"-"+"".concat(t.length).padStart(8,"0")}),this.calculate()},a.prototype.PUSH=function(e){var t=this,r=this._tempValues.filter(function(e){return!e.tomb}),i=null==(r=r[r.length-1])?void 0:r.index,r=this._tempValues.findIndex(function(e){return e.index===i}),r=this._tempValues[r],n=this._changes.filter(function(e){return e.i.startsWith(t._author)});this._changes.push({t:"INS",p:null==r?void 0:r.index,n:void 0,v:e,i:this._author+"-"+"".concat(n.length).padStart(8,"0")}),this.calculate()},a.prototype.DEL=function(e){var t=this,r=this._tempValues.filter(function(e){return!e.tomb})[e].index,e=this._tempValues.findIndex(function(e){return e.index===r}),e=this._tempValues[e],i=this._changes.filter(function(e){return e.i.startsWith(t._author)});this._changes.push({t:"DEL",v:e.index,i:this._author+"-"+"".concat(i.length).padStart(8,"0")}),this.calculate()},a);function a(e,t){var r=n.call(this)||this;return r.type=s.CRDT_LIST,r._changes=[],r._author="",r._value=[],r._tempValues=[],r._lastUpdateSize=0,r._author=e,t&&r.mergeChanges(t),r.calculate(),r}r.ListCrdt=e},{"..":164}],163:[function(e,t,r){"use strict";var i,n,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=(Object.defineProperty(r,"__esModule",{value:!0}),r.MapCrdt=void 0,e("..")),e=(n=s.BaseCrdt,o(a,n),a.prototype.changesSort=function(e,t){return e.i<t.i?-1:e.i>t.i?1:"SET"===e.t&&"DEL"===t.t?-1:"DEL"===e.t&&"SET"===t.t?1:e.a<t.a?-1:e.a>t.a?1:0},a.prototype.calculate=function(){var t=this,r={};Object.values(this._changes).length!==this._lastUpdateSize&&(this._changes.sort(this.changesSort).forEach(function(e){"SET"===e.t?r[e.k]=e.v:"DEL"===e.t&&delete r[e.k],t._keyIndex[e.k]=e.i}),this._lastUpdateSize=Object.values(r).length,this._value=r)},Object.defineProperty(a.prototype,"value",{get:function(){return this.calculate(),this._value},enumerable:!1,configurable:!0}),a.prototype.mergeChanges=function(e){var r=this;e.forEach(function(t){0===r._changes.filter(function(e){return e.i===t.i&&e.a===t.a&&e.t===t.t}).length&&r._changes.push(t)}),this.calculate()},a.prototype.getChanges=function(){return this._changes},a.prototype.SET=function(e,t){this._keyIndex[e]=(this._keyIndex[e]||0)+1,this._changes.push({t:"SET",k:e,a:this._author,v:t,i:this._keyIndex[e]})},a.prototype.DEL=function(e){this._keyIndex[e]=(this._keyIndex[e]||0)+1,this._changes.push({t:"DEL",k:e,a:this._author,i:this._keyIndex[e]})},a);function a(e,t){var r=n.call(this)||this;return r.type=s.CRDT_MAP,r._changes=[],r._author="",r._value={},r._keyIndex={},r._lastUpdateSize=0,r._author=e,t&&r.mergeChanges(t),r.calculate(),r}r.MapCrdt=e},{"..":164}],164:[function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&("get"in n?t.__esModule:!n.writable&&!n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){e[i=void 0===i?r:i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=(Object.defineProperty(r,"__esModule",{value:!0}),r.ToolDb=r.handlePut=r.handleGet=r.handlePong=r.handlePing=r.handleQuery=r.handleCrdtPut=r.handleCrdtGet=r.handleSubscribe=r.ToolDbUserAdapter=r.ToolDbStorageAdapter=r.ToolDbNetworkAdapter=r.hexToUint8=r.hexToString=r.hexToArrayBuffer=r.arrayBufferToHex=r.arrayBufferToString=r.stringToArrayBuffer=r.catchReturn=r.textRandom=r.verifyPeer=r.getPeerSignature=r.verifyMessage=r.randomAnimal=r.uniq=r.sha256=r.sha1=r.proofOfWork=void 0,e("./utils/proofOfWork")),a=(Object.defineProperty(r,"proofOfWork",{enumerable:!0,get:function(){return o(s).default}}),e("./utils/sha1")),f=(Object.defineProperty(r,"sha1",{enumerable:!0,get:function(){return o(a).default}}),e("./utils/sha256")),h=(Object.defineProperty(r,"sha256",{enumerable:!0,get:function(){return o(f).default}}),e("./utils/uniq")),u=(Object.defineProperty(r,"uniq",{enumerable:!0,get:function(){return o(h).default}}),e("./utils/randomAnimal")),c=(Object.defineProperty(r,"randomAnimal",{enumerable:!0,get:function(){return o(u).default}}),e("./utils/verifyMessage")),d=(Object.defineProperty(r,"verifyMessage",{enumerable:!0,get:function(){return o(c).default}}),e("./utils/getPeerSignature")),l=(Object.defineProperty(r,"getPeerSignature",{enumerable:!0,get:function(){return o(d).default}}),e("./utils/verifyPeer")),p=(Object.defineProperty(r,"verifyPeer",{enumerable:!0,get:function(){return o(l).default}}),e("./utils/textRandom")),b=(Object.defineProperty(r,"textRandom",{enumerable:!0,get:function(){return o(p).default}}),e("./utils/catchReturn")),m=(Object.defineProperty(r,"catchReturn",{enumerable:!0,get:function(){return o(b).default}}),e("./utils/encoding/stringToArrayBuffer")),y=(Object.defineProperty(r,"stringToArrayBuffer",{enumerable:!0,get:function(){return o(m).default}}),e("./utils/encoding/arrayBufferToString")),g=(Object.defineProperty(r,"arrayBufferToString",{enumerable:!0,get:function(){return o(y).default}}),e("./utils/encoding/arrayBufferToHex")),v=(Object.defineProperty(r,"arrayBufferToHex",{enumerable:!0,get:function(){return o(g).default}}),e("./utils/encoding/hexToArrayBuffer")),_=(Object.defineProperty(r,"hexToArrayBuffer",{enumerable:!0,get:function(){return o(v).default}}),e("./utils/encoding/hexToString")),w=(Object.defineProperty(r,"hexToString",{enumerable:!0,get:function(){return o(_).default}}),e("./utils/encoding/hexToUint8")),M=(Object.defineProperty(r,"hexToUint8",{enumerable:!0,get:function(){return o(w).default}}),e("./adapters-base/networkAdapter")),S=(Object.defineProperty(r,"ToolDbNetworkAdapter",{enumerable:!0,get:function(){return o(M).default}}),e("./adapters-base/storageAdapter")),A=(Object.defineProperty(r,"ToolDbStorageAdapter",{enumerable:!0,get:function(){return o(S).default}}),e("./adapters-base/userAdapter")),k=(Object.defineProperty(r,"ToolDbUserAdapter",{enumerable:!0,get:function(){return o(A).default}}),n(e("./types/tooldb"),r),n(e("./types/message"),r),n(e("./crdt/baseCrdt"),r),n(e("./crdt/counterCrdt"),r),n(e("./crdt/listCrdt"),r),n(e("./crdt/mapCrdt"),r),e("./messageHandlers/handleSubscribe")),E=(Object.defineProperty(r,"handleSubscribe",{enumerable:!0,get:function(){return o(k).default}}),e("./messageHandlers/handleCrdtGet")),x=(Object.defineProperty(r,"handleCrdtGet",{enumerable:!0,get:function(){return o(E).default}}),e("./messageHandlers/handleCrdtPut")),P=(Object.defineProperty(r,"handleCrdtPut",{enumerable:!0,get:function(){return o(x).default}}),e("./messageHandlers/handleQuery")),I=(Object.defineProperty(r,"handleQuery",{enumerable:!0,get:function(){return o(P).default}}),e("./messageHandlers/handlePing")),R=(Object.defineProperty(r,"handlePing",{enumerable:!0,get:function(){return o(I).default}}),e("./messageHandlers/handlePong")),j=(Object.defineProperty(r,"handlePong",{enumerable:!0,get:function(){return o(R).default}}),e("./messageHandlers/handleGet")),B=(Object.defineProperty(r,"handleGet",{enumerable:!0,get:function(){return o(j).default}}),e("./messageHandlers/handlePut")),C=(Object.defineProperty(r,"handlePut",{enumerable:!0,get:function(){return o(B).default}}),e("./tooldb"));Object.defineProperty(r,"ToolDb",{enumerable:!0,get:function(){return o(C).default}})},{"./adapters-base/networkAdapter":157,"./adapters-base/storageAdapter":158,"./adapters-base/userAdapter":159,"./crdt/baseCrdt":160,"./crdt/counterCrdt":161,"./crdt/listCrdt":162,"./crdt/mapCrdt":163,"./messageHandlers/handleCrdtGet":166,"./messageHandlers/handleCrdtPut":167,"./messageHandlers/handleGet":168,"./messageHandlers/handlePing":169,"./messageHandlers/handlePong":170,"./messageHandlers/handlePut":171,"./messageHandlers/handleQuery":172,"./messageHandlers/handleSubscribe":173,"./tooldb":186,"./types/message":187,"./types/tooldb":188,"./utils/catchReturn":189,"./utils/encoding/arrayBufferToHex":190,"./utils/encoding/arrayBufferToString":191,"./utils/encoding/hexToArrayBuffer":192,"./utils/encoding/hexToString":193,"./utils/encoding/hexToUint8":194,"./utils/encoding/stringToArrayBuffer":195,"./utils/getPeerSignature":196,"./utils/proofOfWork":197,"./utils/randomAnimal":198,"./utils/sha1":199,"./utils/sha256":200,"./utils/textRandom":201,"./utils/uniq":202,"./utils/verifyMessage":203,"./utils/verifyPeer":204}],165:[function(e,t,r){"use strict";var f=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},h=(Object.defineProperty(r,"__esModule",{value:!0}),e("."));r.default=function(e,t,r,i,n,o){var s,a;this.options.debug&&(s=(a="undefined"==typeof window)?this.options.storageName:"%c"+this.options.storageName,a=a?"":"background: #"+(0,h.sha1)(this.options.storageName).slice(-6)+"; padding: 2px; color: black",console.log.apply(console,f([s,a],[e,t,r,i,n,n,o].slice(0,arguments.length),!1)))}},{".":164}],166:[function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},s=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(r,i){var n=this;this.store.get(r.key).then(function(e){try{var t={type:"crdtPut",data:JSON.parse(e),to:[],id:r.id};n.network.sendToClientId(i,t)}catch(e){}}).catch(function(e){var t=o(o({},r),{to:s(s([],r.to,!0),[i],!1)});n.logger("Local key not found, relay",JSON.stringify(t)),n.network.sendToAll(t,!1)})}},{}],167:[function(e,t,r){"use strict";var h=this&&this.__assign||function(){return(h=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},u=(Object.defineProperty(r,"__esModule",{value:!0}),e("..")),o=n(e("../toolDbVerificationWrapper"));r.default=function(a,t){var f=this;o.default.call(this,a.data).then(function(e){var s;e===u.VerifyResult.Verified?(s=h(h({},a),{to:i(i([],a.to,!0),[t],!1)}),f.emit("crdtput",s),f.emit("data",s.data),f.emit("verified",s),f.network.sendToAll(s,!0),f.store.get(s.data.k).then(function(t){try{var e,r=JSON.parse(t),i=s,n=void 0,o=(r.c===u.CRDT_MAP&&(n=new u.MapCrdt(f.userAccount.getAddress()||"",r.v)),r.c===u.CRDT_LIST&&(n=new u.ListCrdt(f.userAccount.getAddress()||"",r.v)),r.c===u.CRDT_COUNTER&&(n=new u.CounterCrdt(f.userAccount.getAddress()||"",r.v)),[]);n&&(n.mergeChanges(s.data.v),o=n.getChanges()),(i=h({},s)).data.v=o,r.t<s.data.t?(e=i.data.k,f.triggerKeyListener(e,i.data),f.store.put(i.data.k,JSON.stringify(i.data)).catch(function(e){})):(e=a.data.k,f.triggerKeyListener(e,r))}catch(e){f.logger("Couldnt parse crdt data",t,e)}}).catch(function(e){var t=s.data.k;f.triggerKeyListener(t,s.data),f.store.put(s.data.k,JSON.stringify(s.data)).catch(function(e){})})):f.logger("unverified message: ",e,a)})}},{"..":164,"../toolDbVerificationWrapper":185}],168:[function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},s=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(r,i){var n=this;this.store.get(r.key).then(function(e){try{var t={type:"put",data:JSON.parse(e),to:[],id:r.id};n.network.sendToClientId(i,t)}catch(e){}}).catch(function(e){var t=o(o({},r),{to:s(s([],r.to,!0),[i],!1)});n.logger("Local key not found, relay",JSON.stringify(t)),n.network.sendToAll(t,!1)})}},{}],169:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("..");r.default=function(t,r){var i=this;this.isConnected||(this.isConnected=!0,this.onConnect()),(0,n.verifyPeer)(this,t.peer).then(function(e){e&&t.peer.topic===i.options.topic?(0===i.serverPeers.filter(function(e){return e.address===t.peer.address}).length&&t.isServer&&i.serverPeers.push(t.peer),i.network.sendToClientId(r,{type:"pong",isServer:i.options.server,clientId:i.network.getClientAddress(),to:[],servers:i.serverPeers,id:t.id}),i.onPeerConnect(i.peerAccount.getAddress()||"")):i.logger("Blocked a remote peer from joining; ",e,t)})}},{"..":164}],170:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e("..");r.default=function(e,t){var r=this;this.isConnected||(this.isConnected=!0,this.onConnect()),e.servers.forEach(function(t){(0,i.verifyPeer)(r,t).then(function(e){e&&t.topic===r.options.topic&&0===r.serverPeers.filter(function(e){return e.address===t.address}).length&&t.host&&t.port&&r.serverPeers.push(t)})}),this.onPeerConnect(this.peerAccount.getAddress()||"")}},{"..":164}],171:[function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},s=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},a=(Object.defineProperty(r,"__esModule",{value:!0}),e("..")),f=i(e("../toolDbVerificationWrapper"));r.default=function(i,t){var n=this;f.default.call(this,i.data).then(function(e){var r;e===a.VerifyResult.Verified?(n.emit("put",i),n.emit("data",i.data),n.emit("verified",i),r=o(o({},i),{to:s(s([],i.to,!0),[t],!1)}),n.network.sendToAll(r,!0),n.store.get(r.data.k).then(function(e){var t,e=JSON.parse(e);e.t<r.data.t?(t=r.data.k,n.triggerKeyListener(t,r.data),n.store.put(r.data.k,JSON.stringify(r.data)).catch(function(e){})):(t=r.data.k,n.triggerKeyListener(t,e))}).catch(function(e){var t=i.data.k;n.triggerKeyListener(t,i.data),n.store.put(i.data.k,JSON.stringify(i.data)).catch(function(e){})})):n.logger("unverified message: ",e,i)})}},{"..":164,"../toolDbVerificationWrapper":185}],172:[function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,r){var e,i=this;this.store.query(t.key).then(function(e){i.network.sendToClientId(r,{type:"queryAck",id:t.id,to:[],keys:e})}).catch(function(e){}),this.options.server&&(e=n(n({},t),{to:o(o([],t.to,!0),[r],!1)}),this.network.sendToAll(e,!0))}},{}],173:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(r,i){var n=this,e=i+"-"+r.key;this.subscriptions.includes(e)||(this.subscriptions.push(e),this.addKeyListener(r.key,function(e){i&&(e={data:e,id:r.id,type:"put",to:[]},n.network.sendToClientId(i,e))})),this.store.get(r.key).then(function(e){try{var t={data:JSON.parse(e),id:r.id,type:"put",to:[]};n.network.sendToClientId(i,t)}catch(e){}}).catch(function(e){})}},{}],174:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){this.userAccount.anonUser()}},{}],175:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){var r;if(this.processedIds[e.type]||(this.processedIds[e.type]=[]),!this.processedIds[e.type].includes(e.id))if(this.emit("message",e,t),this.processedIds[e.type].push(e.id),this.logger("Got message ".concat(e.type," from ").concat(t)),this.logger(e),e.id&&(r=e.id,this._idListeners[r]&&(this._idListeners[r](e),this.removeIdListener(r))),void 0===e||void 0===e.type)this.logger("Message is invalid!",e,typeof e);else switch(e.type){case"ping":this.handlePing(e,t);break;case"pong":this.handlePong(e,t);break;case"subscribe":this.handleSubscribe(e,t);break;case"get":this.handleGet(e,t);break;case"put":this.handlePut(e,t);break;case"crdtPut":this.handleCrdtPut(e,t);break;case"crdtGet":this.handleCrdtGet(e,t);break;case"query":this.handleQuery(e,t)}}},{}],176:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var c=e(".");r.default=function(e,s,a,f,h){var u=this;return void 0===a&&(a=!1),void 0===f&&(f=1e3),new Promise(function(r,t){var i,n,o;a&&void 0===u.userAccount.getAddress()?t(new Error("You are not authorized yet!")):(i=a?":".concat(u.userAccount.getAddress(),".").concat(e):e,u.logger("CRDT GET",i),n=(0,c.textRandom)(10),o=setTimeout(function(){u.store.get(i).then(function(e){try{var t=JSON.parse(e);s.mergeChanges(t.v),u.emit("data",t),r(t)}catch(e){r(null)}}).catch(function(e){return t(null)})},f),u.addIdListener(n,function(e){u.logger("GET RECV",i),clearTimeout(o),"crdtPut"===e.type&&(s.mergeChanges(e.data.v),r(e))}),u.store.get(i).then(function(e){try{var t=JSON.parse(e);clearTimeout(o),u.removeIdListener(n),s.mergeChanges(t.v),u.emit("data",t),r(t)}catch(e){}}).catch(function(){}),u.network.sendToAll({type:"crdtGet",to:h||[],key:i,id:n}))})}},{".":164}],177:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var c=e(".");r.default=function(s,a,f,h){var u=this;return void 0===f&&(f=!1),new Promise(function(i,e){var n,o,t;s.includes(".")?e(new Error("Key cannot include dots!; ".concat(s))):u.userAccount.getAddress()?(n=(new Date).getTime(),o=a.getChanges(),t=JSON.stringify(o),t="".concat(t).concat(u.userAccount.getAddress()).concat(n),(0,c.proofOfWork)(t,u.options.pow).then(function(e){var t=e.hash,r=e.nonce;u.userAccount.signData(t).then(function(e){e&&u.userAccount.getAddress()&&(e={k:f?":".concat(u.userAccount.getAddress(),".").concat(s):s,a:u.userAccount.getAddress()||"",n:r,t:n,h:t,s:e,v:o,c:a.type},u.logger("PUT CRDT",s,e),e={type:"crdtPut",id:(0,c.textRandom)(10),to:h||[],data:e},u.network.sendToAll(e),i(e))})}).catch(e)):e(new Error("You need to log in before you can PUT."))})}},{".":164}],178:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var u=e(".");r.default=function(r,s,a,f){var h=this;return void 0===s&&(s=!1),void 0===a&&(a=1e3),new Promise(function(i,e){var t,n,o;s&&void 0===h.userAccount.getAddress()?e(new Error("You are not authorized yet!")):(t=s?":".concat(h.userAccount.getAddress(),".").concat(r):r,h.logger("GET",t),n=(0,u.textRandom)(10),o=setTimeout(function(){h.store.get(t).then(function(e){try{var t=JSON.parse(e);h.emit("data",t),i(t.v)}catch(e){i(null)}}).catch(function(e){i(null)})},a),h.addIdListener(n,function(e){h.logger("GET RECV",t),clearTimeout(o),"put"===e.type&&i(e.data.v)}),h.store.get(t).then(function(e){try{var t=JSON.parse(e),r=t.v;clearTimeout(o),h.removeIdListener(n),h.emit("data",t),i(r)}catch(e){}}).catch(function(e){}),h.network.sendToAll({type:"get",to:f||[],key:t,id:n}))})}},{".":164}],179:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e(".");r.default=function(e,t){var r=this;return this.userAccount?this.userAccount.getAccountFromPrivate(e).then(function(e){return r.userAccount.setUser(e,t||(0,i.randomAnimal)()),e}):Promise.resolve(void 0)}},{".":164}],180:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var d=e(".");r.default=function(a,f,h,u){var c=this;return void 0===h&&(h=!1),new Promise(function(o,e){var s,t;a.includes(".")?e(new Error("Key cannot include dots!; ".concat(a))):c.userAccount&&c.userAccount.getAddress()?(s=(new Date).getTime(),t="".concat(JSON.stringify(f)).concat(c.userAccount.getAddress()).concat(s),(0,d.proofOfWork)(t,c.options.pow).then(function(e){var i=e.hash,n=e.nonce;c.userAccount.signData(i).then(function(e){var t,r;e&&c.userAccount.getAddress()&&(e={k:t=h?":".concat(c.userAccount.getAddress(),".").concat(a):a,a:c.userAccount.getAddress()||"",n:n,t:s,h:i,s:e,v:f,c:null},c.logger("PUT",a,e),r={type:"put",id:(0,d.textRandom)(10),to:u||[],data:e},c.network.sendToAll(r),c.store.put(t,JSON.stringify(e)).catch(function(e){}).finally(function(){o(r)}))})}).catch(e)):e(new Error("You need to log in before you can PUT."))})}},{".":164}],181:[function(e,t,r){"use strict";var d=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},l=(Object.defineProperty(r,"__esModule",{value:!0}),e("."));r.default=function(s,a,f,h){var u=this,c=(void 0===a&&(a=!1),void 0===f&&(f=1e3),this.userAccount);return new Promise(function(e,t){var r,i,n,o;a&&void 0===c.getAddress()?t(new Error("You are not authorized yet!")):(r=a?":".concat(c.getAddress(),".").concat(s):s,u.logger("QUERY",r),t=(0,l.textRandom)(10),i=[],u.store.query(r).then(function(e){i=d(d([],i,!0),e,!0),n=setTimeout(o,f)}).catch(function(e){}),o=function(){e((0,l.uniq)(i))},u.addIdListener(t,function(e){u.logger("QUERY RECV",r),"queryAck"===e.type&&(i=d(d([],i,!0),e.keys,!0),n&&clearTimeout(n),n=setTimeout(o,f))}),u.network.sendToAll({type:"query",to:h||[],key:r,id:t}))})}},{".":164}],182:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s=e(".");r.default=function(n,e,t){var o=this;return new Promise(function(r,i){o.getData("==".concat(n),!1,5e3,t).then(function(t){if(t)try{o.userAccount.decryptAccount(t,(0,s.sha256)(e)).then(function(e){o.userAccount.setUser(e,n||"Anonymous ".concat((0,s.randomAnimal)())),r(t)})}catch(e){i(e)}else i("Could not find user")})})}},{".":164}],183:[function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,s,a,f){return new(a=a||Promise)(function(r,t){function i(e){try{o(f.next(e))}catch(e){t(e)}}function n(e){try{o(f.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(i,n)}o((f=f.apply(e,s||[])).next())})},n=this&&this.__generator||function(i,n){var o,s,a,f={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;f;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return f.label++,{value:t[1],done:!1};case 5:f.label++,s=t[1],t=[0];continue;case 7:t=f.ops.pop(),f.trys.pop();continue;default:if(!(a=0<(a=f.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){f=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){f.label=t[1];break}if(6===t[0]&&f.label<a[1]){f.label=a[1],a=t;break}if(a&&f.label<a[2]){f.label=a[2],f.ops.push(t);break}a[2]&&f.ops.pop(),f.trys.pop();continue}t=n.call(i,f)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},c=(Object.defineProperty(r,"__esModule",{value:!0}),e("."));r.default=function(t,r,u){return i(this,void 0,void 0,function(){var f,h=this;return n(this,function(e){return f="==".concat(t),[2,new Promise(function(a,t){h.getData(f,!1,3e3,u).then(function(e){var s;null===e?(s=new h.options.userAdapter(h)).encryptAccount((0,c.sha256)(r)).then(function(n){var o=(new Date).getTime(),e="".concat(JSON.stringify(n)).concat(s.getAddress()).concat(o);(0,c.proofOfWork)(e,0).then(function(e){var r=e.hash,i=e.nonce;s.signData(r).then(function(e){var e={k:f,a:s.getAddress()||"",n:i,t:o,h:r,s:e,v:n,c:null},t=(h.logger("SIGNUP PUT",f,e),{type:"put",id:(0,c.textRandom)(10),to:u||[],data:e});h.network.sendToAll(t),h.store.put(f,JSON.stringify(e)).catch(function(e){}).finally(function(){a(t)})})}).catch(t)}):t(new Error("User already exists!"))}).catch(function(){t(new Error("Could not fetch user"))})})]})})}},{".":164}],184:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e(".");r.default=function(i,n,o){var s=this;return void 0===n&&(n=!1),new Promise(function(e,t){var r;n&&void 0===s.userAccount.getAddress()?t(new Error("You are not authorized yet!")):(r=n?":".concat(s.userAccount.getAddress(),".").concat(i):i,s.logger("SUBSCRIBE",r),t=(0,a.textRandom)(10),s.network.sendToAll({type:"subscribe",key:r,to:o||[],id:t}),s.store.get(r).then(function(e){try{var t=JSON.parse(e);s.triggerKeyListener(r,t)}catch(e){}}).catch(function(e){}).finally(function(){e()}))})}},{".":164}],185:[function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,s,a,f){return new(a=a||Promise)(function(r,t){function i(e){try{o(f.next(e))}catch(e){t(e)}}function n(e){try{o(f.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(i,n)}o((f=f.apply(e,s||[])).next())})},s=this&&this.__generator||function(i,n){var o,s,a,f={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;f;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return f.label++,{value:t[1],done:!1};case 5:f.label++,s=t[1],t=[0];continue;case 7:t=f.ops.pop(),f.trys.pop();continue;default:if(!(a=0<(a=f.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){f=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){f.label=t[1];break}if(6===t[0]&&f.label<a[1]){f.label=a[1],a=t;break}if(a&&f.label<a[2]){f.label=a[2],f.ops.push(t);break}a[2]&&f.ops.pop(),f.trys.pop();continue}t=n.call(i,f)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},a=(Object.defineProperty(r,"__esModule",{value:!0}),e("."));r.default=function(o){var e=this;return new Promise(function(n){e.verifyMessage(o,e.options.pow).then(function(t){return i(e,void 0,void 0,function(){var r,i=this;return s(this,function(e){return t?(r=!0,this._customVerificator.forEach(function(e){var t;e&&o.k&&o.k.startsWith(e.key)&&(r=!1,t=void 0,i.store.get(o.k).then(function(e){try{t=JSON.parse(e)}catch(e){}}).catch(function(e){}).finally(function(){e.fn(o,t).then(function(e){n(e?a.VerifyResult.Verified:a.VerifyResult.CustomVerificationFailed)}).catch(function(e){n(a.VerifyResult.CustomVerificationFailed)})}))}),r&&n(t)):n(a.VerifyResult.InvalidVerification),[2]})})})})}},{".":164}],186:[function(e,t,r){"use strict";var i,n,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__assign||function(){return(s=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},f=(Object.defineProperty(r,"__esModule",{value:!0}),a(e("events"))),h=e("."),u=a(e("./toolDbGet")),c=a(e("./toolDbPut")),d=a(e("./toolDbSignIn")),l=a(e("./toolDbSignUp")),p=a(e("./toolDbCrdtGet")),b=a(e("./toolDbCrdtPut")),m=a(e("./toolDbAnonSignIn")),y=a(e("./toolDbClientOnMessage")),g=a(e("./toolDbVerificationWrapper")),v=a(e("./toolDbQueryKeys")),_=a(e("./toolDbKeysSignIn")),w=a(e("./toolDbSubscribe")),M=a(e("./messageHandlers/handleGet")),S=a(e("./messageHandlers/handlePut")),A=a(e("./messageHandlers/handlePing")),k=a(e("./messageHandlers/handlePong")),E=a(e("./messageHandlers/handleQuery")),x=a(e("./messageHandlers/handleCrdtGet")),P=a(e("./messageHandlers/handleCrdtPut")),I=a(e("./messageHandlers/handleSubscribe")),R=a(e("./logger")),a=(n=f.default,o(j,n),Object.defineProperty(j.prototype,"subscriptions",{get:function(){return this._subscriptions},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"processedIds",{get:function(){return this._processedIds},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"processedOutHashes",{get:function(){return this._processedOutHashes},enumerable:!1,configurable:!0}),j.prototype.getUserNamespacedKey=function(e){var t;return":"+((null==(t=this.userAccount)?void 0:t.getAddress())||"")+"."+e},Object.defineProperty(j.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"network",{get:function(){return this._network},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"serverPeers",{get:function(){return this._serverPeers},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"store",{get:function(){return this._store},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"userAccount",{get:function(){return this._userAccount},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"peerAccount",{get:function(){return this._peerAccount},enumerable:!1,configurable:!0}),j);function j(e){void 0===e&&(e={});var i=n.call(this)||this,t=(i._serverPeers=[],i.logger=R.default,i.clientOnMessage=y.default,i.verifyMessage=h.verifyMessage,i._subscriptions=[],i._processedIds={},i._processedOutHashes={},i.subscribeData=w.default,i.isConnected=!1,i.onDisconnect=function(){},i.onConnect=function(){},i.onPeerDisconnect=function(e){},i.onPeerConnect=function(e){},i.getData=u.default,i.putData=c.default,i.putCrdt=b.default,i.getCrdt=p.default,i.queryKeys=v.default,i.signIn=d.default,i.anonSignIn=m.default,i.keysSignIn=_.default,i.signUp=l.default,i.verify=g.default,i.handlePing=A.default,i.handlePong=k.default,i.handleCrdtGet=x.default,i.handleCrdtPut=P.default,i.handleGet=M.default,i.handlePut=S.default,i.handleQuery=E.default,i.handleSubscribe=I.default,i._idListeners={},i.addIdListener=function(e,t){i._idListeners[e]=t},i.removeIdListener=function(e){delete i._idListeners[e]},i._keyListeners=[],i.addKeyListener=function(e,t){return i.logger("Add key listener: ".concat(e)),i._keyListeners.push({key:e,timeout:null,fn:t}),i._keyListeners.length-1},i.removeKeyListener=function(e){var t;null!=(t=i._keyListeners[e])&&t.timeout&&clearTimeout((null==(t=i._keyListeners[e])?void 0:t.timeout)||void 0),i._keyListeners[e]=null},i.triggerKeyListener=function(t,r){i._keyListeners.forEach(function(e){(null==e?void 0:e.key)===t&&(i.logger("Trigger key listener: ".concat(t)),e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(function(){return e.fn(r)},i.options.triggerDebouce))})},i._customVerificator=[],i.addCustomVerification=function(e,t){return i._customVerificator.push({key:e,fn:t}),i._customVerificator.length},i.removeCustomVerification=function(e){i._customVerificator[e]=null},i._options={peers:[],maxRetries:5,triggerDebouce:100,wait:2e3,pow:0,server:!1,host:"127.0.0.1",port:8080,debug:!1,httpServer:void 0,networkAdapter:h.ToolDbNetworkAdapter,storageAdapter:h.ToolDbStorageAdapter,userAdapter:h.ToolDbUserAdapter,storageName:"tooldb",topic:"tool-db-default",serverName:void 0,ssl:!1},i._options=s(s({},i.options),e),i._store=new i.options.storageAdapter(i),i._peerAccount=new i.options.userAdapter(i),i._userAccount=new i.options.userAdapter(i),i._network=new i.options.networkAdapter(i),"%default-peer%"),r=new i.options.storageAdapter(i,"_____peer_"+i.options.storageName);return r.get(t).then(function(e){i.peerAccount.decryptAccount(JSON.parse(e),t).then(function(e){i.peerAccount.setUser(e,(0,h.randomAnimal)())}).finally(function(){i.emit("init",i.userAccount.getAddress())})}).catch(function(e){i.peerAccount.encryptAccount(t).then(function(e){r.put(t,JSON.stringify(e)).catch(function(){}).finally(function(){i.emit("init",i.userAccount.getAddress())})})}),i}r.default=a},{".":164,"./logger":165,"./messageHandlers/handleCrdtGet":166,"./messageHandlers/handleCrdtPut":167,"./messageHandlers/handleGet":168,"./messageHandlers/handlePing":169,"./messageHandlers/handlePong":170,"./messageHandlers/handlePut":171,"./messageHandlers/handleQuery":172,"./messageHandlers/handleSubscribe":173,"./toolDbAnonSignIn":174,"./toolDbClientOnMessage":175,"./toolDbCrdtGet":176,"./toolDbCrdtPut":177,"./toolDbGet":178,"./toolDbKeysSignIn":179,"./toolDbPut":180,"./toolDbQueryKeys":181,"./toolDbSignIn":182,"./toolDbSignUp":183,"./toolDbSubscribe":184,"./toolDbVerificationWrapper":185,events:84}],187:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.VerifyResult=void 0,(r=r.VerifyResult||(r.VerifyResult={})).CustomVerificationFailed="CustomVerificationFailed",r.InvalidData="InvalidData",r.InvalidVerification="InvalidVerification",r.CantOverwrite="CantOverwrite",r.InvalidTimestamp="InvalidTimestamp",r.AddressMismatch="AddressMismatch",r.NoProofOfWork="NoProofOfWork",r.InvalidHashNonce="InvalidHashNonce",r.InvalidSignature="InvalidSignature",r.Verified="Verified"},{}],188:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},{}],189:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){}},{}],190:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){for(var t,r=new DataView(e),i="",n=0,o=r.byteLength;n<o;n+=1)i+=t=(t=r.getUint8(n).toString(16)).length<2?"0"+t:t;return i.toLowerCase()}},{}],191:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){for(var t=new Uint8Array(e),r="",i=0;i<t.byteLength;i+=1)r+=String.fromCodePoint(t[i]);return r}},{}],192:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return(e=e.toUpperCase().match(/[\dA-F]{2}/gi))?(e=e.map(function(e){return parseInt(e,16)}),new Uint8Array(e).buffer):new Uint8Array}},{}],193:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){for(var t=e.toString(),r="",i=0;i<t.length;i+=2)r+=String.fromCharCode(parseInt(t.substr(i,2),16));return r}},{}],194:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e("../..");r.default=function(e){return new Uint8Array((0,i.hexToArrayBuffer)(e))}},{"../..":164}],195:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),i=0,n=e.length;i<n;i+=1)r[i]=e.charCodeAt(i);return t}},{}],196:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=e("..");r.default=function(e,t,r,i,n){return t=(0,o.sha256)("".concat(t,"-").concat(r,"-").concat(i,":").concat(n)),e.signData(t)}},{"..":164}],197:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=e("..");r.default=function(i,n){return new Promise(function(e){for(var t=0,r=(0,o.sha256)("".concat(i).concat(t));r.substring(0,n)!==Array(n+1).join("0");)t+=1,r=(0,o.sha256)("".concat(i).concat(t));e({nonce:t,hash:r})})}},{"..":164}],198:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=["Fast","Slow","Cute","Evil","Anxious","Cursed","Average","Zombie","Smart","Small","Tall","Amazing","Splendid","Fat","Invisible","Regular","Domestic","Unique","Soft","Lazy","Angry","Relaxed","Huge","Shy","Playful","Creepy","Ancient","Beautiful"],n=["Snake","Monkey","Platypus","Fox","Lynx","Pug","Chicken","Slug","Snail","Pig","Cow","Sheep","Horse","Squirrel","Turtle","Unicorn","Dragon","Dolphin","Cat","Chow Chow","Elephant","Meerkat","Polar Bear","Bear","Rabbit","Koala","Parrot","Raven","Frog","Rat","Mouse","Bee","Tiger","Lion","Giraffe","Ant","Spider","Zebra"];r.default=function(){return"".concat(i[Math.floor(Math.random()*i.length)]," ").concat(n[Math.floor(Math.random()*n.length)])}},{}],199:[function(e,t,r){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=(Object.defineProperty(r,"__esModule",{value:!0}),i(e("crypto")));r.default=function(e){var t=n.default.createHash("sha1");return t.update(e),t.digest("hex")}},{crypto:57}],200:[function(e,t,r){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=(Object.defineProperty(r,"__esModule",{value:!0}),i(e("crypto")));r.default=function(e){var t=n.default.createHash("sha256");return t.update(e),t.digest("hex")}},{crypto:57}],201:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){for(var r=e=void 0===e?24:e,i="",n=t||"0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz";0<r;)i+=n.charAt(Math.floor(Math.random()*n.length)),--r;return i}},{}],202:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return Array.from(new Set(e))}},{}],203:[function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,s,a,f){return new(a=a||Promise)(function(r,t){function i(e){try{o(f.next(e))}catch(e){t(e)}}function n(e){try{o(f.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(i,n)}o((f=f.apply(e,s||[])).next())})},a=this&&this.__generator||function(i,n){var o,s,a,f={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;f;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return f.label++,{value:t[1],done:!1};case 5:f.label++,s=t[1],t=[0];continue;case 7:t=f.ops.pop(),f.trys.pop();continue;default:if(!(a=0<(a=f.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){f=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){f.label=t[1];break}if(6===t[0]&&f.label<a[1]){f.label=a[1],a=t;break}if(a&&f.label<a[2]){f.label=a[2],f.ops.push(t);break}a[2]&&f.ops.pop(),f.trys.pop();continue}t=n.call(i,f)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},f=(Object.defineProperty(r,"__esModule",{value:!0}),e(".."));r.default=function(o,s){return void 0===s&&(s=0),i(this,void 0,void 0,function(){var t,r,i,n;return a(this,function(e){switch(e.label){case 0:return(t=JSON.stringify(o.v),void 0===o.t||void 0===o.k||void 0===o.h||void 0===o.a||void 0===o.s||void 0===o.c)?[2,f.VerifyResult.InvalidData]:o.t>(new Date).getTime()+3e4?[2,f.VerifyResult.InvalidTimestamp]:(r=!1,":"==o.k.slice(0,1)&&(r=o.k.split(".")[0].slice(1)),"=="!=o.k.slice(0,2)?[3,2]:(i=o.k,[4,this.store.get(i).then(function(e){try{return JSON.parse(e)}catch(e){return null}}).catch(function(){return null})]));case 1:if((i=e.sent())&&i.a!==o.a)return[2,f.VerifyResult.CantOverwrite];e.label=2;case 2:if(r&&r!==o.a)return[2,f.VerifyResult.AddressMismatch];if(0<s){if(o.h.slice(0,s)!==new Array(s).fill("0").join(""))return[2,f.VerifyResult.NoProofOfWork];if((0,f.sha256)("".concat(t).concat(o.a).concat(o.t).concat(o.n))!==o.h)return[2,f.VerifyResult.InvalidHashNonce]}return this.userAccount?[4,this.userAccount.verifySignature(o)]:[3,4];case 3:return n=e.sent(),[3,5];case 4:n=!1,e.label=5;case 5:return[2,n?f.VerifyResult.Verified:f.VerifyResult.InvalidSignature]}})})}},{"..":164}],204:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e("..");r.default=function(e,t){var r=(0,i.sha256)("".concat(t.topic,"-").concat(t.timestamp,"-").concat(t.host,":").concat(t.port));return e.verifyMessage({h:r,a:t.address,s:t.sig})}},{"..":164}]},{},[164])(164)});
|
|
1
|
+
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).tooldb=e()}(function(){return function i(n,o,s){function a(t,e){if(!o[t]){if(!n[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(f)return f(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=o[t]={exports:{}},n[t][0].call(r.exports,function(e){return a(n[t][1][e]||e)},r,r.exports,i,n,o,s)}return o[t].exports}for(var f="function"==typeof require&&require,e=0;e<s.length;e++)a(s[e]);return a}({1:[function(e,t,r){"use strict";const i=r;i.bignum=e("bn.js"),i.define=e("./asn1/api").define,i.base=e("./asn1/base"),i.constants=e("./asn1/constants"),i.decoders=e("./asn1/decoders"),i.encoders=e("./asn1/encoders")},{"./asn1/api":2,"./asn1/base":4,"./asn1/constants":8,"./asn1/decoders":10,"./asn1/encoders":13,"bn.js":16}],2:[function(e,t,r){"use strict";const i=e("./encoders"),n=e("./decoders"),o=e("inherits"),s=r;function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}s.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(r){const t=this.name;function e(e){this._initNamed(e,t)}return o(e,r),e.prototype._initNamed=function(e,t){r.call(this,e,t)},new e(this)},a.prototype._getDecoder=function(e){return this.decoders.hasOwnProperty(e=e||"der")||(this.decoders[e]=this._createNamed(n[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return this.encoders.hasOwnProperty(e=e||"der")||(this.encoders[e]=this._createNamed(i[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},{"./decoders":10,"./encoders":13,inherits:102}],3:[function(e,t,r){"use strict";const i=e("inherits"),n=e("../base/reporter").Reporter,o=e("safer-buffer").Buffer;function s(e,t){n.call(this,t),o.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function a(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return a.isEncoderBuffer(e)||(e=new a(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}i(s,n),(r.DecoderBuffer=s).isDecoderBuffer=function(e){return e instanceof s||"object"==typeof e&&o.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},s.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},s.prototype.restore=function(e){const t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,n.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},s.prototype.raw=function(e){return this.base.slice((e||this).offset,this.length)},(r.EncoderBuffer=a).isEncoderBuffer=function(e){return e instanceof a||"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},a.prototype.join=function(t,r){return t=t||o.alloc(this.length),r=r||0,0!==this.length&&(Array.isArray(this.value)?this.value.forEach(function(e){e.join(t,r),r+=e.length}):("number"==typeof this.value?t[r]=this.value:"string"==typeof this.value?t.write(this.value,r):o.isBuffer(this.value)&&this.value.copy(t,r),r+=this.length)),t}},{"../base/reporter":6,inherits:102,"safer-buffer":144}],4:[function(e,t,r){"use strict";const i=r;i.Reporter=e("./reporter").Reporter,i.DecoderBuffer=e("./buffer").DecoderBuffer,i.EncoderBuffer=e("./buffer").EncoderBuffer,i.Node=e("./node")},{"./buffer":3,"./node":5,"./reporter":6}],5:[function(e,t,r){"use strict";const u=e("../base/reporter").Reporter,i=e("../base/buffer").EncoderBuffer,c=e("../base/buffer").DecoderBuffer,n=e("minimalistic-assert"),o=["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"],s=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);function a(e,t,r){const i={};(this._baseState=i).name=r,i.enc=e,i.parent=t||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}t.exports=a;const f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];a.prototype.clone=function(){const t=this._baseState,r={},e=(f.forEach(function(e){r[e]=t[e]}),new this.constructor(r.parent));return e._baseState=r,e},a.prototype._wrap=function(){const r=this._baseState;s.forEach(function(t){this[t]=function(){const e=new this.constructor(this);return r.children.push(e),e[t].apply(e,arguments)}},this)},a.prototype._init=function(e){const t=this._baseState;n(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),n.equal(t.children.length,1,"Root node can have only one child")},a.prototype._useArgs=function(e){const t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(n(null===t.children),(t.children=r).forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(n(null===t.args),t.args=e,t.reverseArgs=e.map(function(r){if("object"!=typeof r||r.constructor!==Object)return r;const i={};return Object.keys(r).forEach(function(e){e==(0|e)&&(e|=0);var t=r[e];i[t]=e}),i}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(t){a.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}}),o.forEach(function(r){a.prototype[r]=function(){const e=this._baseState;var t=Array.prototype.slice.call(arguments);return n(null===e.tag),e.tag=r,this._useArgs(t),this}}),a.prototype.use=function(e){n(e);const t=this._baseState;return n(null===t.use),t.use=e,this},a.prototype.optional=function(){const e=this._baseState;return e.optional=!0,this},a.prototype.def=function(e){const t=this._baseState;return n(null===t.default),t.default=e,t.optional=!0,this},a.prototype.explicit=function(e){const t=this._baseState;return n(null===t.explicit&&null===t.implicit),t.explicit=e,this},a.prototype.implicit=function(e){const t=this._baseState;return n(null===t.explicit&&null===t.implicit),t.implicit=e,this},a.prototype.obj=function(){const e=this._baseState;var t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},a.prototype.key=function(e){const t=this._baseState;return n(null===t.key),t.key=e,this},a.prototype.any=function(){const e=this._baseState;return e.any=!0,this},a.prototype.choice=function(t){const e=this._baseState;return n(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map(function(e){return t[e]})),this},a.prototype.contains=function(e){const t=this._baseState;return n(null===t.use),t.contains=e,this},a.prototype._decode=function(t,r){const i=this._baseState;if(null===i.parent)return t.wrapResult(i.children[0]._decode(t,r));let n=i.default,o=!0,e=null;if(null!==i.key&&(e=t.enterKey(i.key)),i.optional){let e=null;if(null!==i.explicit?e=i.explicit:null!==i.implicit?e=i.implicit:null!==i.tag&&(e=i.tag),null!==e||i.any){if(o=this._peekTag(t,e,i.any),t.isError(o))return o}else{var s=t.save();try{null===i.choice?this._decodeGeneric(i.tag,t,r):this._decodeChoice(t,r),o=!0}catch(e){o=!1}t.restore(s)}}let a;if(i.obj&&o&&(a=t.enterObject()),o){if(null!==i.explicit){s=this._decodeTag(t,i.explicit);if(t.isError(s))return s;t=s}s=t.offset;if(null===i.use&&null===i.choice){let e;i.any&&(e=t.save());var f=this._decodeTag(t,null!==i.implicit?i.implicit:i.tag,i.any);if(t.isError(f))return f;i.any?n=t.raw(e):t=f}if(r&&r.track&&null!==i.tag&&r.track(t.path(),s,t.length,"tagged"),r&&r.track&&null!==i.tag&&r.track(t.path(),t.offset,t.length,"content"),i.any||(n=null===i.choice?this._decodeGeneric(i.tag,t,r):this._decodeChoice(t,r)),t.isError(n))return n;i.any||null!==i.choice||null===i.children||i.children.forEach(function(e){e._decode(t,r)}),!i.contains||"octstr"!==i.tag&&"bitstr"!==i.tag||(f=new c(n),n=this._getUse(i.contains,t._reporterState.obj)._decode(f,r))}return i.obj&&o&&(n=t.leaveObject(a)),null===i.key||null===n&&!0!==o?null!==e&&t.exitKey(e):t.leaveKey(e,i.key,n),n},a.prototype._decodeGeneric=function(e,t,r){var i=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,i.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&i.args?this._decodeObjid(t,i.args[0],i.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},a.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),n(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},a.prototype._decodeChoice=function(n,o){const s=this._baseState;let a=null,f=!1;return Object.keys(s.choice).some(function(e){var t=n.save();const r=s.choice[e];try{var i=r._decode(n,o);if(n.isError(i))return!1;a={type:e,value:i},f=!0}catch(e){return n.restore(t),!1}return!0},this),f?a:n.error("Choice not matched")},a.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},a.prototype._encode=function(e,t,r){var i=this._baseState;if(null===i.default||i.default!==e){i=this._encodeValue(e,t,r);if(void 0!==i&&!this._skipDefault(i,t,r))return i}},a.prototype._encodeValue=function(r,i,e){const t=this._baseState;if(null===t.parent)return t.children[0]._encode(r,i||new u);let n=null;if(this.reporter=i,t.optional&&void 0===r){if(null===t.default)return;r=t.default}let o=null,s=!1;if(t.any)n=this._createEncoderBuffer(r);else if(t.choice)n=this._encodeChoice(r,i);else if(t.contains)o=this._getUse(t.contains,e)._encode(r,i),s=!0;else if(t.children)o=t.children.map(function(e){if("null_"===e._baseState.tag)return e._encode(null,i,r);if(null===e._baseState.key)return i.error("Child should have a key");var t=i.enterKey(e._baseState.key);if("object"!=typeof r)return i.error("Child expected, but input is not object");e=e._encode(r[e._baseState.key],i,r);return i.leaveKey(t),e},this).filter(function(e){return e}),o=this._createEncoderBuffer(o);else if("seqof"===t.tag||"setof"===t.tag){if(!t.args||1!==t.args.length)return i.error("Too many args for : "+t.tag);if(!Array.isArray(r))return i.error("seqof/setof, but data is not Array");const f=this.clone();f._baseState.implicit=null,o=this._createEncoderBuffer(r.map(function(e){var t=this._baseState;return this._getUse(t.args[0],r)._encode(e,i)},f))}else null!==t.use?n=this._getUse(t.use,e)._encode(r,i):(o=this._encodePrimitive(t.tag,r),s=!0);var a;return t.any||null!==t.choice||(e=null!==t.implicit?t.implicit:t.tag,a=null===t.implicit?"universal":"context",null===e?null===t.use&&i.error("Tag could be omitted only for .use()"):null===t.use&&(n=this._encodeComposite(e,s,a,o))),n=null!==t.explicit?this._encodeComposite(t.explicit,!1,"context",n):n},a.prototype._encodeChoice=function(e,t){var r=this._baseState;const i=r.choice[e.type];return i||n(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(e.value,t)},a.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},a.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},a.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},{"../base/buffer":3,"../base/reporter":6,"minimalistic-assert":105}],6:[function(e,t,r){"use strict";const i=e("inherits");function n(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}(r.Reporter=n).prototype.isError=function(e){return e instanceof o},n.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},n.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},n.prototype.enterKey=function(e){return this._reporterState.path.push(e)},n.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},n.prototype.leaveKey=function(e,t,r){const i=this._reporterState;this.exitKey(e),null!==i.obj&&(i.obj[t]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){const e=this._reporterState;var t=e.obj;return e.obj={},t},n.prototype.leaveObject=function(e){const t=this._reporterState;var r=t.obj;return t.obj=e,r},n.prototype.error=function(e){let t;const r=this._reporterState;var i=e instanceof o;if(t=i?e:new o(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),r.options.partial)return i||r.errors.push(t),t;throw t},n.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},i(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:102}],7:[function(e,t,r){"use strict";function i(r){const i={};return Object.keys(r).forEach(function(e){(0|e)==e&&(e|=0);var t=r[e];i[t]=e}),i}r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=i(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=i(r.tag)},{}],8:[function(e,t,r){"use strict";const i=r;i._reverse=function(r){const i={};return Object.keys(r).forEach(function(e){(0|e)==e&&(e|=0);var t=r[e];i[t]=e}),i},i.der=e("./der")},{"./der":7}],9:[function(e,t,r){"use strict";const i=e("inherits"),n=e("bn.js"),o=e("../base/buffer").DecoderBuffer,s=e("../base/node"),a=e("../constants/der");function f(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){s.call(this,"der",e)}function c(t,r){let i=t.readUInt8(r);if(t.isError(i))return i;var e=a.tagClass[i>>6],n=0==(32&i);if(31==(31&i)){let e=i;for(i=0;128==(128&e);){if(e=t.readUInt8(r),t.isError(e))return e;i=(i<<=7)|127&e}}else i&=31;var o=a.tag[i];return{cls:e,primitive:n,tag:i,tagStr:o}}function h(t,e,r){let i=t.readUInt8(r);if(!t.isError(i)){if(!e&&128===i)return null;if(0!=(128&i)){var n=127&i;if(4<n)return t.error("length octect is too long");for(let e=i=0;e<n;e++){i<<=8;var o=t.readUInt8(r);if(t.isError(o))return o;i|=o}}}return i}(t.exports=f).prototype.decode=function(e,t){return o.isDecoderBuffer(e)||(e=new o(e,t)),this.tree._decode(e,t)},i(u,s),u.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;var i=e.save(),n=c(e,'Failed to peek tag: "'+t+'"');return e.isError(n)?n:(e.restore(i),n.tag===t||n.tagStr===t||n.tagStr+"of"===t||r)},u.prototype._decodeTag=function(e,t,r){var i=c(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;let n=h(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(n))return n;if(!r&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(!i.primitive&&null===n){r=e.save(),i=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');if(e.isError(i))return i;n=e.offset-r.offset,e.restore(r)}return e.skip(n,'Failed to match body of: "'+t+'"')},u.prototype._skipUntilEnd=function(t,r){for(;;){var i=c(t,r);if(t.isError(i))return i;var n=h(t,i.primitive,r);if(t.isError(n))return n;let e;if(e=i.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,r),t.isError(e))return e;if("end"===i.tagStr)break}},u.prototype._decodeList=function(e,t,r,i){const n=[];for(;!e.isEmpty();){var o=this._peekTag(e,"end");if(e.isError(o))return o;var s=r.decode(e,"der",i);if(e.isError(s)&&o)break;n.push(s)}return n},u.prototype._decodeStr=function(e,t){var r;if("bitstr"===t)return r=e.readUInt8(),e.isError(r)?r:{unused:r,data:e.raw()};if("bmpstr"!==t)return"numstr"===t?(r=e.raw().toString("ascii"),this._isNumstr(r)?r:e.error("Decoding of string type: numstr unsupported characters")):"octstr"===t||"objDesc"===t?e.raw():"printstr"===t?(r=e.raw().toString("ascii"),this._isPrintstr(r)?r:e.error("Decoding of string type: printstr unsupported characters")):/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported");{const i=e.raw();if(i.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let t="";for(let e=0;e<i.length/2;e++)t+=String.fromCharCode(i.readUInt16BE(2*e));return t}},u.prototype._decodeObjid=function(e,t,r){let i;const n=[];let o=0,s=0;for(;!e.isEmpty();)s=e.readUInt8(),o=(o<<=7)|127&s,0==(128&s)&&(n.push(o),o=0);128&s&&n.push(o);const a=n[0]/40|0,f=n[0]%40;if(i=r?n:[a,f].concat(n.slice(1)),t){let e=t[i.join(" ")];void 0!==(e=void 0===e?t[i.join(".")]:e)&&(i=e)}return i},u.prototype._decodeTime=function(e,t){const r=e.raw().toString();let i,n,o,s,a,f;if("gentime"===t)i=0|r.slice(0,4),n=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),f=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");i=0|r.slice(0,2),n=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),f=0|r.slice(10,12),i=i<70?2e3+i:1900+i}return Date.UTC(i,n-1,o,s,a,f,0)},u.prototype._decodeNull=function(){return null},u.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},u.prototype._decodeInt=function(e,t){e=e.raw();let r=new n(e);return r=t?t[r.toString(10)]||r:r},u.prototype._use=function(e,t){return(e="function"==typeof e?e(t):e)._getDecoder("der").tree}},{"../base/buffer":3,"../base/node":5,"../constants/der":7,"bn.js":16,inherits:102}],10:[function(e,t,r){"use strict";const i=r;i.der=e("./der"),i.pem=e("./pem")},{"./der":9,"./pem":11}],11:[function(e,t,r){"use strict";const i=e("inherits"),u=e("safer-buffer").Buffer,c=e("./der");function n(e){c.call(this,e),this.enc="pem"}i(n,c),(t.exports=n).prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g);var i=t.label.toUpperCase(),n=/^-----(BEGIN|END) ([^-]+)-----$/;let o=-1,s=-1;for(let e=0;e<r.length;e++){var a=r[e].match(n);if(null!==a&&a[2]===i){if(-1!==o){if("END"!==a[1])break;s=e;break}if("BEGIN"!==a[1])break;o=e}}if(-1===o||-1===s)throw new Error("PEM section not found for: "+i);const f=r.slice(o+1,s).join("");f.replace(/[^a-z0-9+/=]+/gi,"");e=u.from(f,"base64");return c.prototype.decode.call(this,e,t)}},{"./der":9,inherits:102,"safer-buffer":144}],12:[function(e,t,r){"use strict";const i=e("inherits"),s=e("safer-buffer").Buffer,n=e("../base/node"),a=e("../constants/der");function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new f,this.tree._init(e.body)}function f(e){n.call(this,"der",e)}function u(e){return e<10?"0"+e:e}(t.exports=o).prototype.encode=function(e,t){return this.tree._encode(e,t).join()},i(f,n),f.prototype._encodeComposite=function(e,t,r,i){e=function(e,t,r,i){let n;"seqof"===e?e="seq":"setof"===e&&(e="set");if(a.tagByName.hasOwnProperty(e))n=a.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return i.error("Unknown tag: "+e);n=e}if(31<=n)return i.error("Multi-octet tag encoding unsupported");t||(n|=32);return n|=a.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(i.length<128){const o=s.alloc(2);return o[0]=e,o[1]=i.length,this._createEncoderBuffer([o,i])}let n=1;for(let e=i.length;256<=e;e>>=8)n++;const o=s.alloc(2+n);o[0]=e,o[1]=128|n;for(let e=1+n,t=i.length;0<t;e--,t>>=8)o[e]=255&t;return this._createEncoderBuffer([o,i])},f.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"!==e)return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported");{const r=s.alloc(2*t.length);for(let e=0;e<t.length;e++)r.writeUInt16BE(t.charCodeAt(e),2*e);return this._createEncoderBuffer(r)}},f.prototype._encodeObjid=function(r,e,t){if("string"==typeof r){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(r))return this.reporter.error("objid not found in values map");r=e[r].split(/[\s.]+/g);for(let e=0;e<r.length;e++)r[e]|=0}else if(Array.isArray(r)){r=r.slice();for(let e=0;e<r.length;e++)r[e]|=0}if(!Array.isArray(r))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(r));if(!t){if(40<=r[1])return this.reporter.error("Second objid identifier OOB");r.splice(0,2,40*r[0]+r[1])}let i=0;for(let t=0;t<r.length;t++){let e=r[t];for(i++;128<=e;e>>=7)i++}const n=s.alloc(i);let o=n.length-1;for(let t=r.length-1;0<=t;t--){let e=r[t];for(n[o--]=127&e;0<(e>>=7);)n[o--]=128|127&e}return this._createEncoderBuffer(n)},f.prototype._encodeTime=function(e,t){let r;const i=new Date(e);return"gentime"===t?r=[u(i.getUTCFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(i.getUTCFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},f.prototype._encodeNull=function(){return this._createEncoderBuffer("")},f.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!s.isBuffer(t)){const n=t.toArray();!t.sign&&128&n[0]&&n.unshift(0),t=s.from(n)}if(s.isBuffer(t)){let e=t.length;0===t.length&&e++;const i=s.alloc(e);return t.copy(i),0===t.length&&(i[0]=0),this._createEncoderBuffer(i)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let r=1;for(let e=t;256<=e;e>>=8)r++;const i=new Array(r);for(let e=i.length-1;0<=e;e--)i[e]=255&t,t>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(s.from(i))},f.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},f.prototype._use=function(e,t){return(e="function"==typeof e?e(t):e)._getEncoder("der").tree},f.prototype._skipDefault=function(e,t,r){const i=this._baseState;let n;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return!1;return!0}},{"../base/node":5,"../constants/der":7,inherits:102,"safer-buffer":144}],13:[function(e,t,r){"use strict";const i=r;i.der=e("./der"),i.pem=e("./pem")},{"./der":12,"./pem":14}],14:[function(e,t,r){"use strict";const i=e("inherits"),o=e("./der");function n(e){o.call(this,e),this.enc="pem"}i(n,o),(t.exports=n).prototype.encode=function(e,t){const r=o.prototype.encode.call(this,e),i=r.toString("base64"),n=["-----BEGIN "+t.label+"-----"];for(let e=0;e<i.length;e+=64)n.push(i.slice(e,e+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},{"./der":12,inherits:102}],15:[function(e,t,r){"use strict";r.byteLength=function(e){var e=c(e),t=e[0],e=e[1];return 3*(t+e)/4-e},r.toByteArray=function(e){var t,r,i=c(e),n=i[0],i=i[1],o=new u(function(e,t){return 3*(e+t)/4-t}(n,i)),s=0,a=0<i?n-4:n;for(r=0;r<a;r+=4)t=f[e.charCodeAt(r)]<<18|f[e.charCodeAt(r+1)]<<12|f[e.charCodeAt(r+2)]<<6|f[e.charCodeAt(r+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=255&t;2===i&&(t=f[e.charCodeAt(r)]<<2|f[e.charCodeAt(r+1)]>>4,o[s++]=255&t);1===i&&(t=f[e.charCodeAt(r)]<<10|f[e.charCodeAt(r+1)]<<4|f[e.charCodeAt(r+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t);return o},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,s=r-i;o<s;o+=16383)n.push(function(e,t,r){for(var i,n=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),n.push(function(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(i));return n.join("")}(e,o,s<o+16383?s:o+16383));1==i?(t=e[r-1],n.push(a[t>>2]+a[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return n.join("")};for(var a=[],f=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n<o;++n)a[n]=i[n],f[i.charCodeAt(n)]=n;function c(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("="),t=(e=-1===e?t:e)===t?0:4-e%4;return[e,t]}f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},{}],16:[function(A,e,t){!function(e,t){"use strict";function b(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;function r(){}r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function m(e,t,r){if(m.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=m:t.BN=m,(m.BN=m).wordSize=26;try{i=("undefined"!=typeof window&&void 0!==window.Buffer?window:A("buffer")).Buffer}catch(e){}function n(e,t){e=e.charCodeAt(t);return 65<=e&&e<=70?e-55:97<=e&&e<=102?e-87:e-48&15}function a(e,t,r){var i=n(e,r);return t<=r-1&&(i|=n(e,r-1)<<4),i}function h(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++)var a=e.charCodeAt(s)-48,n=n*i+(49<=a?a-49+10:17<=a?a-17+10:a);return n}m.isBN=function(e){return e instanceof m||null!==e&&"object"==typeof e&&e.constructor.wordSize===m.wordSize&&Array.isArray(e.words)},m.max=function(e,t){return 0<e.cmp(t)?e:t},m.min=function(e,t){return e.cmp(t)<0?e:t},m.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);b((t="hex"===t?16:t)===(0|t)&&2<=t&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},m.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(b(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},m.prototype._initArray=function(e,t,r){if(b("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i,n,o=0;o<this.length;o++)this.words[o]=0;var s=0;if("be"===r)for(o=e.length-1,i=0;0<=o;o-=3)n=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=n<<s&67108863,this.words[i+1]=n>>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);else if("le"===r)for(i=o=0;o<e.length;o+=3)n=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=n<<s&67108863,this.words[i+1]=n>>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);return this.strip()},m.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;t<=i;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,18<=o?(o-=18,this.words[s+=1]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,18<=o?(o-=18,this.words[s+=1]|=n>>>26):o+=8;this.strip()},m.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;for(var n=n/t|0,o=e.length-r,s=o%--i,a=Math.min(o,o-s)+r,f=0,u=r;u<a;u+=i)f=h(e,u,u+i,t),this.imuln(n),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!=s){for(var c=1,f=h(e,u,e.length,t),u=0;u<s;u++)c*=t;this.imuln(c),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this.strip()},m.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},m.prototype.clone=function(){var e=new m(null);return this.copy(e),e},m.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},m.prototype.strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},m.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},m.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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"],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],p=[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];function o(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0,i=(r.length=i)-1|0,n=(s=(0|e.words[0])*(0|t.words[0]))/67108864|0;r.words[0]=67108863&s;for(var o=1;o<i;o++){for(var s,a=n>>>26,f=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++)a+=(s=(0|e.words[o-c|0])*(0|t.words[c])+f)/67108864|0,f=67108863&s;r.words[o]=0|f,n=0|a}return 0!==n?r.words[o]=0|n:r.length--,r.strip()}m.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var r=0,i=0,n=0;n<this.length;n++){var o=this.words[n],s=(16777215&(o<<r|i)).toString(16),a=0!==(i=o>>>24-r&16777215)||n!==this.length-1?d[6-s.length]+s+a:s+a;26<=(r+=2)&&(r-=26,n--)}for(0!==i&&(a=i.toString(16)+a);a.length%t!=0;)a="0"+a;return a=0!==this.negative?"-"+a:a}if(e===(0|e)&&2<=e&&e<=36){var f=l[e],u=p[e];for(a="",(c=this.clone()).negative=0;!c.isZero();){var c,h=c.modn(u).toString(e);a=(c=c.idivn(u)).isZero()?h+a:d[f-h.length]+h+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return a=0!==this.negative?"-"+a:a}b(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2<this.length&&b(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},m.prototype.toJSON=function(){return this.toString(16)},m.prototype.toBuffer=function(e,t){return b(void 0!==i),this.toArrayLike(i,e,t)},m.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},m.prototype.toArrayLike=function(e,t,r){var i,n,o=this.byteLength(),s=r||Math.max(1,o),r=(b(o<=s,"byte array longer than desired length"),b(0<s,"Requested array length <= 0"),this.strip(),"le"===t),a=new e(s),f=this.clone();if(r){for(n=0;!f.isZero();n++)i=f.andln(255),f.iushrn(8),a[n]=i;for(;n<s;n++)a[n]=0}else{for(n=0;n<s-o;n++)a[n]=0;for(n=0;!f.isZero();n++)i=f.andln(255),f.iushrn(8),a[s-n-1]=i}return a},Math.clz32?m.prototype._countBits=function(e){return 32-Math.clz32(e)}:m.prototype._countBits=function(e){var t=0;return 4096<=e&&(t+=13,e>>>=13),64<=e&&(t+=7,e>>>=7),8<=e&&(t+=4,e>>>=4),2<=e&&(t+=2,e>>>=2),t+e},m.prototype._zeroBits=function(e){if(0===e)return 26;var t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},m.prototype.bitLength=function(){var e=this.words[this.length-1],e=this._countBits(e);return 26*(this.length-1)+e},m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},m.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},m.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},m.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},m.prototype.isNeg=function(){return 0!==this.negative},m.prototype.neg=function(){return this.clone().ineg()},m.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},m.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},m.prototype.ior=function(e){return b(0==(this.negative|e.negative)),this.iuor(e)},m.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},m.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},m.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},m.prototype.iand=function(e){return b(0==(this.negative|e.negative)),this.iuand(e)},m.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},m.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},m.prototype.iuxor=function(e){for(var t,r=this.length>e.length?(t=this,e):(t=e,this),i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},m.prototype.ixor=function(e){return b(0==(this.negative|e.negative)),this.iuxor(e)},m.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},m.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},m.prototype.inotn=function(e){b("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),e=e%26;this._expand(t),0<e&&t--;for(var r=0;r<t;r++)this.words[r]=67108863&~this.words[r];return 0<e&&(this.words[r]=~this.words[r]&67108863>>26-e),this.strip()},m.prototype.notn=function(e){return this.clone().inotn(e)},m.prototype.setn=function(e,t){b("number"==typeof e&&0<=e);var r=e/26|0,e=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<<e:this.words[r]&~(1<<e),this.strip()},m.prototype.iadd=function(e){var t,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();for(var i=this.length>e.length?(r=this,e):(r=e,this),n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},m.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},m.prototype.isub=function(e){var t;if(0!==e.negative)return e.negative=0,t=this.iadd(e),e.negative=1,t._normSign();if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;for(var n=0<i?(r=this,e):(r=e,this),o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},m.prototype.sub=function(e){return this.clone().isub(e)};var s=function(e,L,D){var t,r=e.words,i=L.words,n=D.words,o=0|r[0],s=8191&o,o=o>>>13,a=0|r[1],f=8191&a,a=a>>>13,u=0|r[2],c=8191&u,u=u>>>13,h=0|r[3],d=8191&h,h=h>>>13,l=0|r[4],p=8191&l,l=l>>>13,b=0|r[5],m=8191&b,b=b>>>13,y=0|r[6],g=8191&y,y=y>>>13,v=0|r[7],_=8191&v,v=v>>>13,w=0|r[8],N=8191&w,w=w>>>13,r=0|r[9],U=8191&r,r=r>>>13,M=0|i[0],S=8191&M,M=M>>>13,A=0|i[1],k=8191&A,A=A>>>13,E=0|i[2],x=8191&E,E=E>>>13,I=0|i[3],q=8191&I,I=I>>>13,P=0|i[4],z=8191&P,P=P>>>13,R=0|i[5],H=8191&R,R=R>>>13,j=0|i[6],K=8191&j,j=j>>>13,B=0|i[7],F=8191&B,B=B>>>13,C=0|i[8],V=8191&C,C=C>>>13,i=0|i[9],W=8191&i,i=i>>>13,L=(D.negative=e.negative^L.negative,D.length=19,(0+Math.imul(s,S)|0)+((8191&(e=Math.imul(s,M)+Math.imul(o,S)|0))<<13)|0),T=(Math.imul(o,M)+(e>>>13)|0)+(L>>>26)|0;L&=67108863,t=Math.imul(f,S),e=Math.imul(f,M)+Math.imul(a,S)|0,O=Math.imul(a,M);var O,G=(T+(t+Math.imul(s,k)|0)|0)+((8191&(e=(e+Math.imul(s,A)|0)+Math.imul(o,k)|0))<<13)|0,J=(T=((O+Math.imul(o,A)|0)+(e>>>13)|0)+(G>>>26)|0,G&=67108863,t=Math.imul(c,S),e=Math.imul(c,M)+Math.imul(u,S)|0,O=Math.imul(u,M),t=t+Math.imul(f,k)|0,e=(e+Math.imul(f,A)|0)+Math.imul(a,k)|0,O=O+Math.imul(a,A)|0,(T+(t+Math.imul(s,x)|0)|0)+((8191&(e=(e+Math.imul(s,E)|0)+Math.imul(o,x)|0))<<13)|0),Z=(T=((O+Math.imul(o,E)|0)+(e>>>13)|0)+(J>>>26)|0,J&=67108863,t=Math.imul(d,S),e=Math.imul(d,M)+Math.imul(h,S)|0,O=Math.imul(h,M),t=t+Math.imul(c,k)|0,e=(e+Math.imul(c,A)|0)+Math.imul(u,k)|0,O=O+Math.imul(u,A)|0,t=t+Math.imul(f,x)|0,e=(e+Math.imul(f,E)|0)+Math.imul(a,x)|0,O=O+Math.imul(a,E)|0,(T+(t+Math.imul(s,q)|0)|0)+((8191&(e=(e+Math.imul(s,I)|0)+Math.imul(o,q)|0))<<13)|0),X=(T=((O+Math.imul(o,I)|0)+(e>>>13)|0)+(Z>>>26)|0,Z&=67108863,t=Math.imul(p,S),e=Math.imul(p,M)+Math.imul(l,S)|0,O=Math.imul(l,M),t=t+Math.imul(d,k)|0,e=(e+Math.imul(d,A)|0)+Math.imul(h,k)|0,O=O+Math.imul(h,A)|0,t=t+Math.imul(c,x)|0,e=(e+Math.imul(c,E)|0)+Math.imul(u,x)|0,O=O+Math.imul(u,E)|0,t=t+Math.imul(f,q)|0,e=(e+Math.imul(f,I)|0)+Math.imul(a,q)|0,O=O+Math.imul(a,I)|0,(T+(t+Math.imul(s,z)|0)|0)+((8191&(e=(e+Math.imul(s,P)|0)+Math.imul(o,z)|0))<<13)|0),Y=(T=((O+Math.imul(o,P)|0)+(e>>>13)|0)+(X>>>26)|0,X&=67108863,t=Math.imul(m,S),e=Math.imul(m,M)+Math.imul(b,S)|0,O=Math.imul(b,M),t=t+Math.imul(p,k)|0,e=(e+Math.imul(p,A)|0)+Math.imul(l,k)|0,O=O+Math.imul(l,A)|0,t=t+Math.imul(d,x)|0,e=(e+Math.imul(d,E)|0)+Math.imul(h,x)|0,O=O+Math.imul(h,E)|0,t=t+Math.imul(c,q)|0,e=(e+Math.imul(c,I)|0)+Math.imul(u,q)|0,O=O+Math.imul(u,I)|0,t=t+Math.imul(f,z)|0,e=(e+Math.imul(f,P)|0)+Math.imul(a,z)|0,O=O+Math.imul(a,P)|0,(T+(t+Math.imul(s,H)|0)|0)+((8191&(e=(e+Math.imul(s,R)|0)+Math.imul(o,H)|0))<<13)|0),Q=(T=((O+Math.imul(o,R)|0)+(e>>>13)|0)+(Y>>>26)|0,Y&=67108863,t=Math.imul(g,S),e=Math.imul(g,M)+Math.imul(y,S)|0,O=Math.imul(y,M),t=t+Math.imul(m,k)|0,e=(e+Math.imul(m,A)|0)+Math.imul(b,k)|0,O=O+Math.imul(b,A)|0,t=t+Math.imul(p,x)|0,e=(e+Math.imul(p,E)|0)+Math.imul(l,x)|0,O=O+Math.imul(l,E)|0,t=t+Math.imul(d,q)|0,e=(e+Math.imul(d,I)|0)+Math.imul(h,q)|0,O=O+Math.imul(h,I)|0,t=t+Math.imul(c,z)|0,e=(e+Math.imul(c,P)|0)+Math.imul(u,z)|0,O=O+Math.imul(u,P)|0,t=t+Math.imul(f,H)|0,e=(e+Math.imul(f,R)|0)+Math.imul(a,H)|0,O=O+Math.imul(a,R)|0,(T+(t+Math.imul(s,K)|0)|0)+((8191&(e=(e+Math.imul(s,j)|0)+Math.imul(o,K)|0))<<13)|0),$=(T=((O+Math.imul(o,j)|0)+(e>>>13)|0)+(Q>>>26)|0,Q&=67108863,t=Math.imul(_,S),e=Math.imul(_,M)+Math.imul(v,S)|0,O=Math.imul(v,M),t=t+Math.imul(g,k)|0,e=(e+Math.imul(g,A)|0)+Math.imul(y,k)|0,O=O+Math.imul(y,A)|0,t=t+Math.imul(m,x)|0,e=(e+Math.imul(m,E)|0)+Math.imul(b,x)|0,O=O+Math.imul(b,E)|0,t=t+Math.imul(p,q)|0,e=(e+Math.imul(p,I)|0)+Math.imul(l,q)|0,O=O+Math.imul(l,I)|0,t=t+Math.imul(d,z)|0,e=(e+Math.imul(d,P)|0)+Math.imul(h,z)|0,O=O+Math.imul(h,P)|0,t=t+Math.imul(c,H)|0,e=(e+Math.imul(c,R)|0)+Math.imul(u,H)|0,O=O+Math.imul(u,R)|0,t=t+Math.imul(f,K)|0,e=(e+Math.imul(f,j)|0)+Math.imul(a,K)|0,O=O+Math.imul(a,j)|0,(T+(t+Math.imul(s,F)|0)|0)+((8191&(e=(e+Math.imul(s,B)|0)+Math.imul(o,F)|0))<<13)|0),ee=(T=((O+Math.imul(o,B)|0)+(e>>>13)|0)+($>>>26)|0,$&=67108863,t=Math.imul(N,S),e=Math.imul(N,M)+Math.imul(w,S)|0,O=Math.imul(w,M),t=t+Math.imul(_,k)|0,e=(e+Math.imul(_,A)|0)+Math.imul(v,k)|0,O=O+Math.imul(v,A)|0,t=t+Math.imul(g,x)|0,e=(e+Math.imul(g,E)|0)+Math.imul(y,x)|0,O=O+Math.imul(y,E)|0,t=t+Math.imul(m,q)|0,e=(e+Math.imul(m,I)|0)+Math.imul(b,q)|0,O=O+Math.imul(b,I)|0,t=t+Math.imul(p,z)|0,e=(e+Math.imul(p,P)|0)+Math.imul(l,z)|0,O=O+Math.imul(l,P)|0,t=t+Math.imul(d,H)|0,e=(e+Math.imul(d,R)|0)+Math.imul(h,H)|0,O=O+Math.imul(h,R)|0,t=t+Math.imul(c,K)|0,e=(e+Math.imul(c,j)|0)+Math.imul(u,K)|0,O=O+Math.imul(u,j)|0,t=t+Math.imul(f,F)|0,e=(e+Math.imul(f,B)|0)+Math.imul(a,F)|0,O=O+Math.imul(a,B)|0,(T+(t+Math.imul(s,V)|0)|0)+((8191&(e=(e+Math.imul(s,C)|0)+Math.imul(o,V)|0))<<13)|0),S=(T=((O+Math.imul(o,C)|0)+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,t=Math.imul(U,S),e=Math.imul(U,M)+Math.imul(r,S)|0,O=Math.imul(r,M),t=t+Math.imul(N,k)|0,e=(e+Math.imul(N,A)|0)+Math.imul(w,k)|0,O=O+Math.imul(w,A)|0,t=t+Math.imul(_,x)|0,e=(e+Math.imul(_,E)|0)+Math.imul(v,x)|0,O=O+Math.imul(v,E)|0,t=t+Math.imul(g,q)|0,e=(e+Math.imul(g,I)|0)+Math.imul(y,q)|0,O=O+Math.imul(y,I)|0,t=t+Math.imul(m,z)|0,e=(e+Math.imul(m,P)|0)+Math.imul(b,z)|0,O=O+Math.imul(b,P)|0,t=t+Math.imul(p,H)|0,e=(e+Math.imul(p,R)|0)+Math.imul(l,H)|0,O=O+Math.imul(l,R)|0,t=t+Math.imul(d,K)|0,e=(e+Math.imul(d,j)|0)+Math.imul(h,K)|0,O=O+Math.imul(h,j)|0,t=t+Math.imul(c,F)|0,e=(e+Math.imul(c,B)|0)+Math.imul(u,F)|0,O=O+Math.imul(u,B)|0,t=t+Math.imul(f,V)|0,e=(e+Math.imul(f,C)|0)+Math.imul(a,V)|0,O=O+Math.imul(a,C)|0,(T+(t+Math.imul(s,W)|0)|0)+((8191&(e=(e+Math.imul(s,i)|0)+Math.imul(o,W)|0))<<13)|0),M=(T=((O+Math.imul(o,i)|0)+(e>>>13)|0)+(S>>>26)|0,S&=67108863,t=Math.imul(U,k),e=Math.imul(U,A)+Math.imul(r,k)|0,O=Math.imul(r,A),t=t+Math.imul(N,x)|0,e=(e+Math.imul(N,E)|0)+Math.imul(w,x)|0,O=O+Math.imul(w,E)|0,t=t+Math.imul(_,q)|0,e=(e+Math.imul(_,I)|0)+Math.imul(v,q)|0,O=O+Math.imul(v,I)|0,t=t+Math.imul(g,z)|0,e=(e+Math.imul(g,P)|0)+Math.imul(y,z)|0,O=O+Math.imul(y,P)|0,t=t+Math.imul(m,H)|0,e=(e+Math.imul(m,R)|0)+Math.imul(b,H)|0,O=O+Math.imul(b,R)|0,t=t+Math.imul(p,K)|0,e=(e+Math.imul(p,j)|0)+Math.imul(l,K)|0,O=O+Math.imul(l,j)|0,t=t+Math.imul(d,F)|0,e=(e+Math.imul(d,B)|0)+Math.imul(h,F)|0,O=O+Math.imul(h,B)|0,t=t+Math.imul(c,V)|0,e=(e+Math.imul(c,C)|0)+Math.imul(u,V)|0,O=O+Math.imul(u,C)|0,(T+(t+Math.imul(f,W)|0)|0)+((8191&(e=(e+Math.imul(f,i)|0)+Math.imul(a,W)|0))<<13)|0),s=(T=((O+Math.imul(a,i)|0)+(e>>>13)|0)+(M>>>26)|0,M&=67108863,t=Math.imul(U,x),e=Math.imul(U,E)+Math.imul(r,x)|0,O=Math.imul(r,E),t=t+Math.imul(N,q)|0,e=(e+Math.imul(N,I)|0)+Math.imul(w,q)|0,O=O+Math.imul(w,I)|0,t=t+Math.imul(_,z)|0,e=(e+Math.imul(_,P)|0)+Math.imul(v,z)|0,O=O+Math.imul(v,P)|0,t=t+Math.imul(g,H)|0,e=(e+Math.imul(g,R)|0)+Math.imul(y,H)|0,O=O+Math.imul(y,R)|0,t=t+Math.imul(m,K)|0,e=(e+Math.imul(m,j)|0)+Math.imul(b,K)|0,O=O+Math.imul(b,j)|0,t=t+Math.imul(p,F)|0,e=(e+Math.imul(p,B)|0)+Math.imul(l,F)|0,O=O+Math.imul(l,B)|0,t=t+Math.imul(d,V)|0,e=(e+Math.imul(d,C)|0)+Math.imul(h,V)|0,O=O+Math.imul(h,C)|0,(T+(t+Math.imul(c,W)|0)|0)+((8191&(e=(e+Math.imul(c,i)|0)+Math.imul(u,W)|0))<<13)|0),o=(T=((O+Math.imul(u,i)|0)+(e>>>13)|0)+(s>>>26)|0,s&=67108863,t=Math.imul(U,q),e=Math.imul(U,I)+Math.imul(r,q)|0,O=Math.imul(r,I),t=t+Math.imul(N,z)|0,e=(e+Math.imul(N,P)|0)+Math.imul(w,z)|0,O=O+Math.imul(w,P)|0,t=t+Math.imul(_,H)|0,e=(e+Math.imul(_,R)|0)+Math.imul(v,H)|0,O=O+Math.imul(v,R)|0,t=t+Math.imul(g,K)|0,e=(e+Math.imul(g,j)|0)+Math.imul(y,K)|0,O=O+Math.imul(y,j)|0,t=t+Math.imul(m,F)|0,e=(e+Math.imul(m,B)|0)+Math.imul(b,F)|0,O=O+Math.imul(b,B)|0,t=t+Math.imul(p,V)|0,e=(e+Math.imul(p,C)|0)+Math.imul(l,V)|0,O=O+Math.imul(l,C)|0,(T+(t+Math.imul(d,W)|0)|0)+((8191&(e=(e+Math.imul(d,i)|0)+Math.imul(h,W)|0))<<13)|0),k=(T=((O+Math.imul(h,i)|0)+(e>>>13)|0)+(o>>>26)|0,o&=67108863,t=Math.imul(U,z),e=Math.imul(U,P)+Math.imul(r,z)|0,O=Math.imul(r,P),t=t+Math.imul(N,H)|0,e=(e+Math.imul(N,R)|0)+Math.imul(w,H)|0,O=O+Math.imul(w,R)|0,t=t+Math.imul(_,K)|0,e=(e+Math.imul(_,j)|0)+Math.imul(v,K)|0,O=O+Math.imul(v,j)|0,t=t+Math.imul(g,F)|0,e=(e+Math.imul(g,B)|0)+Math.imul(y,F)|0,O=O+Math.imul(y,B)|0,t=t+Math.imul(m,V)|0,e=(e+Math.imul(m,C)|0)+Math.imul(b,V)|0,O=O+Math.imul(b,C)|0,(T+(t+Math.imul(p,W)|0)|0)+((8191&(e=(e+Math.imul(p,i)|0)+Math.imul(l,W)|0))<<13)|0),A=(T=((O+Math.imul(l,i)|0)+(e>>>13)|0)+(k>>>26)|0,k&=67108863,t=Math.imul(U,H),e=Math.imul(U,R)+Math.imul(r,H)|0,O=Math.imul(r,R),t=t+Math.imul(N,K)|0,e=(e+Math.imul(N,j)|0)+Math.imul(w,K)|0,O=O+Math.imul(w,j)|0,t=t+Math.imul(_,F)|0,e=(e+Math.imul(_,B)|0)+Math.imul(v,F)|0,O=O+Math.imul(v,B)|0,t=t+Math.imul(g,V)|0,e=(e+Math.imul(g,C)|0)+Math.imul(y,V)|0,O=O+Math.imul(y,C)|0,(T+(t+Math.imul(m,W)|0)|0)+((8191&(e=(e+Math.imul(m,i)|0)+Math.imul(b,W)|0))<<13)|0),f=(T=((O+Math.imul(b,i)|0)+(e>>>13)|0)+(A>>>26)|0,A&=67108863,t=Math.imul(U,K),e=Math.imul(U,j)+Math.imul(r,K)|0,O=Math.imul(r,j),t=t+Math.imul(N,F)|0,e=(e+Math.imul(N,B)|0)+Math.imul(w,F)|0,O=O+Math.imul(w,B)|0,t=t+Math.imul(_,V)|0,e=(e+Math.imul(_,C)|0)+Math.imul(v,V)|0,O=O+Math.imul(v,C)|0,(T+(t+Math.imul(g,W)|0)|0)+((8191&(e=(e+Math.imul(g,i)|0)+Math.imul(y,W)|0))<<13)|0),a=(T=((O+Math.imul(y,i)|0)+(e>>>13)|0)+(f>>>26)|0,f&=67108863,t=Math.imul(U,F),e=Math.imul(U,B)+Math.imul(r,F)|0,O=Math.imul(r,B),t=t+Math.imul(N,V)|0,e=(e+Math.imul(N,C)|0)+Math.imul(w,V)|0,O=O+Math.imul(w,C)|0,(T+(t+Math.imul(_,W)|0)|0)+((8191&(e=(e+Math.imul(_,i)|0)+Math.imul(v,W)|0))<<13)|0),x=(T=((O+Math.imul(v,i)|0)+(e>>>13)|0)+(a>>>26)|0,a&=67108863,t=Math.imul(U,V),e=Math.imul(U,C)+Math.imul(r,V)|0,O=Math.imul(r,C),(T+(t+Math.imul(N,W)|0)|0)+((8191&(e=(e+Math.imul(N,i)|0)+Math.imul(w,W)|0))<<13)|0),E=(T=((O+Math.imul(w,i)|0)+(e>>>13)|0)+(x>>>26)|0,x&=67108863,(T+Math.imul(U,W)|0)+((8191&(e=Math.imul(U,i)+Math.imul(r,W)|0))<<13)|0);return T=(Math.imul(r,i)+(e>>>13)|0)+(E>>>26)|0,E&=67108863,n[0]=L,n[1]=G,n[2]=J,n[3]=Z,n[4]=X,n[5]=Y,n[6]=Q,n[7]=$,n[8]=ee,n[9]=S,n[10]=M,n[11]=s,n[12]=o,n[13]=k,n[14]=A,n[15]=f,n[16]=a,n[17]=x,n[18]=E,0!=T&&(n[19]=T,D.length++),D};function f(e,t,r){return(new u).mulp(e,t,r)}function u(e,t){this.x=e,this.y=t}Math.imul||(s=o),m.prototype.mulTo=function(e,t){var r=this.length+e.length,r=(10===this.length&&10===e.length?s:r<63?o:r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){for(var s=n,n=0,a=67108863&i,f=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=f;u++){var c,h=(0|e.words[o-u])*(0|t.words[u]),a=67108863&(c=(67108863&h)+a|0);n+=(s=(s=s+(h/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}:f)(this,e,t);return r},u.prototype.makeRBT=function(e){for(var t=new Array(e),r=m.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},u.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},u.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},u.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,f=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var h=f,d=u,l=0;l<s;l++){var p=r[c+l],b=i[c+l],m=r[c+l+s],y=h*m-d*(g=i[c+l+s]),g=h*g+d*m;r[c+l]=p+(m=y),i[c+l]=b+g,r[c+l+s]=p-m,i[c+l+s]=b-g,l!==a&&(y=f*h-u*d,d=f*d+u*h,h=y)}},u.prototype.guessLen13b=function(e,t){for(var t=1&(i=1|Math.max(t,e)),r=0,i=i/2|0;i;i>>>=1)r++;return 1<<r+1+t},u.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},u.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},u.prototype.convert13b=function(e,t,r,i){for(var n=0,o=0;o<t;o++)n+=0|e[o],r[2*o]=8191&n,r[2*o+1]=8191&(n>>>=13),n>>>=13;for(o=2*t;o<i;++o)r[o]=0;b(0===n),b(0==(-8192&n))},u.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},u.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),f=new Array(i),u=new Array(i),c=new Array(i),h=new Array(i),d=r.words;d.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,u,i),this.transform(s,o,a,f,i,n),this.transform(u,o,c,h,i,n);for(var l=0;l<i;l++){var p=a[l]*c[l]-f[l]*h[l];f[l]=a[l]*h[l]+f[l]*c[l],a[l]=p}return this.conjugate(a,f,i),this.transform(a,f,d,o,i,n),this.conjugate(d,o,i),this.normalize13b(d,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},m.prototype.mul=function(e){var t=new m(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},m.prototype.mulf=function(e){var t=new m(null);return t.words=new Array(this.length+e.length),f(this,e,t)},m.prototype.imul=function(e){return this.clone().mulTo(e,this)},m.prototype.imuln=function(e){b("number"==typeof e),b(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,n=(67108863&i)+(67108863&t),t=(t>>=26)+(i/67108864|0)+(n>>>26);this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},m.prototype.muln=function(e){return this.clone().imuln(e)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r%26;t[r]=(e.words[r/26|0]&1<<i)>>>i}return t}(e);if(0===t.length)return new m(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},m.prototype.iushln=function(e){b("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!=t){for(var n=0,o=0;o<this.length;o++){var s=this.words[o]&i,a=(0|this.words[o])-s<<t;this.words[o]=a|n,n=s>>>26-t}n&&(this.words[o]=n,this.length++)}if(0!=r){for(o=this.length-1;0<=o;o--)this.words[o+r]=this.words[o];for(o=0;o<r;o++)this.words[o]=0;this.length+=r}return this.strip()},m.prototype.ishln=function(e){return b(0===this.negative),this.iushln(e)},m.prototype.iushrn=function(e,t,r){b("number"==typeof e&&0<=e),i=t?(t-t%26)/26:0;var i,n=e%26,o=Math.min((e-n)/26,this.length),s=67108863^67108863>>>n<<n,a=r;if(i-=o,i=Math.max(0,i),a){for(var f=0;f<o;f++)a.words[f]=this.words[f];a.length=o}if(0!==o)if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;for(var u=0,f=this.length-1;0<=f&&(0!==u||i<=f);f--){var c=0|this.words[f];this.words[f]=u<<26-n|c>>>n,u=c&s}return a&&0!==u&&(a.words[a.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},m.prototype.ishrn=function(e,t,r){return b(0===this.negative),this.iushrn(e,t,r)},m.prototype.shln=function(e){return this.clone().ishln(e)},m.prototype.ushln=function(e){return this.clone().iushln(e)},m.prototype.shrn=function(e){return this.clone().ishrn(e)},m.prototype.ushrn=function(e){return this.clone().iushrn(e)},m.prototype.testn=function(e){b("number"==typeof e&&0<=e);var t=e%26,e=(e-t)/26;return!(this.length<=e)&&!!(this.words[e]&1<<t)},m.prototype.imaskn=function(e){b("number"==typeof e&&0<=e);var t=e%26,e=(e-t)/26;return b(0===this.negative,"imaskn works only with positive numbers"),this.length<=e?this:(0!=t&&e++,this.length=Math.min(e,this.length),0!=t&&(this.words[this.length-1]&=67108863^67108863>>>t<<t),this.strip())},m.prototype.maskn=function(e){return this.clone().imaskn(e)},m.prototype.iaddn=function(e){return b("number"==typeof e),b(e<67108864),e<0?this.isubn(-e):0!==this.negative?(1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(e),this.negative=1),this):this._iaddn(e)},m.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&67108864<=this.words[t];t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},m.prototype.isubn=function(e){if(b("number"==typeof e),b(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,--this.words[t+1];return this.strip()},m.prototype.addn=function(e){return this.clone().iaddn(e)},m.prototype.subn=function(e){return this.clone().isubn(e)},m.prototype.iabs=function(){return this.negative=0,this},m.prototype.abs=function(){return this.clone().iabs()},m.prototype._ishlnsubmul=function(e,t,r){for(var i=e.length+r,n=(this._expand(i),0),o=0;o<e.length;o++){var s=(0|this.words[o+r])+n,a=(0|e.words[o])*t,n=((s-=67108863&a)>>26)-(a/67108864|0);this.words[o+r]=67108863&s}for(;o<this.length-r;o++)n=(s=(0|this.words[o+r])+n)>>26,this.words[o+r]=67108863&s;if(0!==n){for(b(-1===n),o=n=0;o<this.length;o++)n=(s=-(0|this.words[o])+n)>>26,this.words[o]=67108863&s;this.negative=1}return this.strip()},m.prototype._wordDiv=function(e,t){this.length,e.length;var r,i=this.clone(),n=e,o=0|n.words[n.length-1],s=(0!=(e=26-this._countBits(o))&&(n=n.ushln(e),i.iushln(e),o=0|n.words[n.length-1]),i.length-n.length);if("mod"!==t){(r=new m(null)).length=1+s,r.words=new Array(r.length);for(var a=0;a<r.length;a++)r.words[a]=0}var f=i.clone()._ishlnsubmul(n,1,s);0===f.negative&&(i=f,r&&(r.words[s]=1));for(var u=s-1;0<=u;u--){var c=67108864*(0|i.words[n.length+u])+(0|i.words[n.length+u-1]),c=Math.min(c/o|0,67108863);for(i._ishlnsubmul(n,c,u);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,u),i.isZero()||(i.negative^=1);r&&(r.words[u]=c)}return r&&r.strip(),i.strip(),"div"!==t&&0!=e&&i.iushrn(e),{div:r||null,mod:i}},m.prototype.divmod=function(e,t,r){return b(!e.isZero()),this.isZero()?{div:new m(0),mod:new m(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.iadd(e)),{div:i,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),{div:i="mod"!==t?o.div.neg():i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new m(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new m(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new m(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,o},m.prototype.div=function(e){return this.divmod(e,"div",!1).div},m.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},m.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},m.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),e=e.andln(1),r=r.cmp(i);return r<0||1===e&&0===r?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},m.prototype.modn=function(e){b(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},m.prototype.idivn=function(e){b(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},m.prototype.divn=function(e){return this.clone().idivn(e)},m.prototype.egcd=function(e){b(0===e.negative),b(!e.isZero());for(var t=this,r=e.clone(),t=0!==t.negative?t.umod(e):t.clone(),i=new m(1),n=new m(0),o=new m(0),s=new m(1),a=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++a;for(var f=r.clone(),u=t.clone();!t.isZero();){for(var c=0,h=1;0==(t.words[0]&h)&&c<26;++c,h<<=1);if(0<c)for(t.iushrn(c);0<c--;)(i.isOdd()||n.isOdd())&&(i.iadd(f),n.isub(u)),i.iushrn(1),n.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(0<d)for(r.iushrn(d);0<d--;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(u)),o.iushrn(1),s.iushrn(1);0<=t.cmp(r)?(t.isub(r),i.isub(o),n.isub(s)):(r.isub(t),o.isub(i),s.isub(n))}return{a:o,b:s,gcd:r.iushln(a)}},m.prototype._invmp=function(e){b(0===e.negative),b(!e.isZero());for(var t,r=this,i=e.clone(),r=0!==r.negative?r.umod(e):r.clone(),n=new m(1),o=new m(0),s=i.clone();0<r.cmpn(1)&&0<i.cmpn(1);){for(var a=0,f=1;0==(r.words[0]&f)&&a<26;++a,f<<=1);if(0<a)for(r.iushrn(a);0<a--;)n.isOdd()&&n.iadd(s),n.iushrn(1);for(var u=0,c=1;0==(i.words[0]&c)&&u<26;++u,c<<=1);if(0<u)for(i.iushrn(u);0<u--;)o.isOdd()&&o.iadd(s),o.iushrn(1);0<=r.cmp(i)?(r.isub(i),n.isub(o)):(i.isub(r),o.isub(n))}return(t=0===r.cmpn(1)?n:o).cmpn(0)<0&&t.iadd(e),t},m.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0;for(var i=r.negative=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0)var o=t,t=r,r=o;else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},m.prototype.invm=function(e){return this.egcd(e).a.umod(e)},m.prototype.isEven=function(){return 0==(1&this.words[0])},m.prototype.isOdd=function(){return 1==(1&this.words[0])},m.prototype.andln=function(e){return this.words[0]&e},m.prototype.bincn=function(e){b("number"==typeof e);var t=e%26,e=(e-t)/26,t=1<<t;if(this.length<=e)return this._expand(1+e),this.words[e]|=t,this;for(var r=t,i=e;0!==r&&i<this.length;i++){var n=0|this.words[i],r=(n+=r)>>>26;n&=67108863,this.words[i]=n}return 0!==r&&(this.words[i]=r,this.length++),this},m.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},m.prototype.cmpn=function(e){var t=e<0;return 0===this.negative||t?0===this.negative&&t?1:(this.strip(),t=1<this.length?1:(b((e=t?-e:e)<=67108863,"Number is too big"),(t=0|this.words[0])===e?0:t<e?-1:1),0!==this.negative?0|-t:t):-1},m.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;e=this.ucmp(e);return 0!==this.negative?0|-e:e},m.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;0<=r;r--){var i=0|this.words[r],n=0|e.words[r];if(i!=n){i<n?t=-1:n<i&&(t=1);break}}return t},m.prototype.gtn=function(e){return 1===this.cmpn(e)},m.prototype.gt=function(e){return 1===this.cmp(e)},m.prototype.gten=function(e){return 0<=this.cmpn(e)},m.prototype.gte=function(e){return 0<=this.cmp(e)},m.prototype.ltn=function(e){return-1===this.cmpn(e)},m.prototype.lt=function(e){return-1===this.cmp(e)},m.prototype.lten=function(e){return this.cmpn(e)<=0},m.prototype.lte=function(e){return this.cmp(e)<=0},m.prototype.eqn=function(e){return 0===this.cmpn(e)},m.prototype.eq=function(e){return 0===this.cmp(e)},m.red=function(e){return new M(e)},m.prototype.toRed=function(e){return b(!this.red,"Already a number in reduction context"),b(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},m.prototype.fromRed=function(){return b(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},m.prototype._forceRed=function(e){return this.red=e,this},m.prototype.forceRed=function(e){return b(!this.red,"Already a number in reduction context"),this._forceRed(e)},m.prototype.redAdd=function(e){return b(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},m.prototype.redIAdd=function(e){return b(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},m.prototype.redSub=function(e){return b(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},m.prototype.redISub=function(e){return b(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},m.prototype.redShl=function(e){return b(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},m.prototype.redMul=function(e){return b(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},m.prototype.redIMul=function(e){return b(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},m.prototype.redSqr=function(){return b(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},m.prototype.redISqr=function(){return b(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},m.prototype.redSqrt=function(){return b(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},m.prototype.redInvm=function(){return b(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},m.prototype.redNeg=function(){return b(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},m.prototype.redPow=function(e){return b(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var c={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new m(t,16),this.n=this.p.bitLength(),this.k=new m(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){var t;"string"==typeof e?(t=m._prime(e),this.m=t.p,this.prime=t):(b(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null)}function S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new m(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)}y.prototype._tmp=function(){var e=new m(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){for(var t,r=e;this.split(r,this.tmp),(t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength())>this.n;);e=t<this.n?-1:r.ucmp(this.p);return 0===e?(r.words[0]=0,r.length=1):0<e?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},r(g,y),g.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=4194303&n,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(4194303&o)<<4|n>>>22,n=o}0===(e.words[i-10]=n>>>=22)&&10<e.length?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(v,y),r(_,y),r(w,y),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},m._prime=function(e){if(c[e])return c[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new v;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return c[e]=t},M.prototype._verify1=function(e){b(0===e.negative,"red works only with positives"),b(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){b(0==(e.negative|t.negative),"red works only with positives"),b(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return(this.prime?this.prime.ireduce(e):e.umod(this.m))._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);e=e.add(t);return 0<=e.cmp(this.m)&&e.isub(this.m),e._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);e=e.iadd(t);return 0<=e.cmp(this.m)&&e.isub(this.m),e},M.prototype.sub=function(e,t){this._verify2(e,t);e=e.sub(t);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);e=e.isub(t);return e.cmpn(0)<0&&e.iadd(this.m),e},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(b(t%2==1),3===t)return t=this.m.add(new m(1)).iushrn(2),this.pow(e,t);for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);b(!r.isZero());for(var n=new m(1).toRed(this),o=n.redNeg(),s=this.m.subn(1).iushrn(1),a=new m(2*(a=this.m.bitLength())*a).toRed(this);0!==this.pow(a,s).cmp(o);)a.redIAdd(o);for(var f=this.pow(a,r),u=this.pow(e,r.addn(1).iushrn(1)),c=this.pow(e,r),h=i;0!==c.cmp(n);){for(var d=c,l=0;0!==d.cmp(n);l++)d=d.redSqr();b(l<h);var p=this.pow(f,new m(1).iushln(h-l-1)),u=u.redMul(p),f=p.redSqr(),c=c.redMul(f),h=l}return u},M.prototype.invm=function(e){e=e._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(e,t){if(t.isZero())return new m(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new m(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,s=0,a=t.bitLength()%26;for(0===a&&(a=26),i=t.length-1;0<=i;i--){for(var f=t.words[i],u=a-1;0<=u;u--){var c=f>>u&1;n!==r[0]&&(n=this.sqr(n)),0==c&&0===o?s=0:(o=o<<1|c,(4===++s||0===i&&0===u)&&(n=this.mul(n,r[o]),o=s=0))}a=26}return n},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){e=e.clone();return e.red=null,e},m.mont=function(e){return new S(e)},r(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){e=this.imod(e.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;e=e.imul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new m(0)._forceRed(this);e=e.mul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:18}],17:[function(e,t,r){var i;function n(e){this.rand=e}if(t.exports=function(e){return(i=i||new n(null)).generate(e)},(t.exports.Rand=n).prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(e){e=new Uint8Array(e);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(e){e=new Uint8Array(e);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=e("crypto");if("function"!=typeof o.randomBytes)throw new Error("Not supported");n.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},{crypto:18}],18:[function(e,t,r){},{}],19:[function(e,t,r){var n=e("safe-buffer").Buffer;function i(e){for(var t=(e=n.isBuffer(e)?e:n.from(e)).length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function o(e){for(;0<e.length;e++)e[0]=0}function s(e,t,r,i,n){for(var o,s,a,f,u=r[0],c=r[1],h=r[2],d=r[3],l=e[0]^t[0],p=e[1]^t[1],b=e[2]^t[2],m=e[3]^t[3],y=4,g=1;g<n;g++)o=u[l>>>24]^c[p>>>16&255]^h[b>>>8&255]^d[255&m]^t[y++],s=u[p>>>24]^c[b>>>16&255]^h[m>>>8&255]^d[255&l]^t[y++],a=u[b>>>24]^c[m>>>16&255]^h[l>>>8&255]^d[255&p]^t[y++],f=u[m>>>24]^c[l>>>16&255]^h[p>>>8&255]^d[255&b]^t[y++],l=o,p=s,b=a,m=f;return o=(i[l>>>24]<<24|i[p>>>16&255]<<16|i[b>>>8&255]<<8|i[255&m])^t[y++],s=(i[p>>>24]<<24|i[b>>>16&255]<<16|i[m>>>8&255]<<8|i[255&l])^t[y++],a=(i[b>>>24]<<24|i[m>>>16&255]<<16|i[l>>>8&255]<<8|i[255&p])^t[y++],f=(i[m>>>24]<<24|i[l>>>16&255]<<16|i[p>>>8&255]<<8|i[255&b])^t[y++],[o>>>=0,s>>>=0,a>>>=0,f>>>=0]}var h=[0,1,2,4,8,16,32,64,128,27,54],d=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,f=0;f<256;++f){var u=a^a<<1^a<<2^a<<3^a<<4,c=(r[s]=u=u>>>8^255&u^99,e[i[u]=s]),h=e[c],d=e[h],l=257*e[u]^16843008*u;n[0][s]=l<<24|l>>>8,n[1][s]=l<<16|l>>>16,n[2][s]=l<<8|l>>>24,n[3][s]=l,o[0][u]=(l=16843009*d^65537*h^257*c^16843008*s)<<24|l>>>8,o[1][u]=l<<16|l>>>16,o[2][u]=l<<8|l>>>24,o[3][u]=l,0===s?s=a=1:(s=c^e[e[e[d^c]]],a^=e[e[a]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function a(e){this._key=i(e),this._reset()}a.blockSize=16,a.keySize=32,a.prototype.blockSize=a.blockSize,a.prototype.keySize=a.keySize,a.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o<t;o++)n[o]=e[o];for(o=t;o<i;o++){var s=n[o-1];o%t==0?(s=d.SBOX[(s=s<<8|s>>>24)>>>24]<<24|d.SBOX[s>>>16&255]<<16|d.SBOX[s>>>8&255]<<8|d.SBOX[255&s],s^=h[o/t|0]<<24):6<t&&o%t==4&&(s=d.SBOX[s>>>24]<<24|d.SBOX[s>>>16&255]<<16|d.SBOX[s>>>8&255]<<8|d.SBOX[255&s]),n[o]=n[o-t]^s}for(var a=[],f=0;f<i;f++){var u=i-f,c=n[u-(f%4?0:4)];a[f]=f<4||u<=4?c:d.INV_SUB_MIX[0][d.SBOX[c>>>24]]^d.INV_SUB_MIX[1][d.SBOX[c>>>16&255]]^d.INV_SUB_MIX[2][d.SBOX[c>>>8&255]]^d.INV_SUB_MIX[3][d.SBOX[255&c]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=a},a.prototype.encryptBlockRaw=function(e){return s(e=i(e),this._keySchedule,d.SUB_MIX,d.SBOX,this._nRounds)},a.prototype.encryptBlock=function(e){var e=this.encryptBlockRaw(e),t=n.allocUnsafe(16);return t.writeUInt32BE(e[0],0),t.writeUInt32BE(e[1],4),t.writeUInt32BE(e[2],8),t.writeUInt32BE(e[3],12),t},a.prototype.decryptBlock=function(e){var t=(e=i(e))[1],t=(e[1]=e[3],e[3]=t,s(e,this._invKeySchedule,d.INV_SUB_MIX,d.INV_SBOX,this._nRounds)),e=n.allocUnsafe(16);return e.writeUInt32BE(t[0],0),e.writeUInt32BE(t[3],4),e.writeUInt32BE(t[2],8),e.writeUInt32BE(t[1],12),e},a.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=a},{"safe-buffer":143}],20:[function(e,t,r){var o=e("./aes"),s=e("safe-buffer").Buffer,a=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),u=e("./incr32");function c(e,t,r,i){a.call(this);var n=s.alloc(4,0),t=(this._cipher=new o.AES(t),this._cipher.encryptBlock(n));this._ghash=new f(t),r=function(e,t,r){if(12===t.length)return e._finID=s.concat([t,s.from([0,0,0,1])]),s.concat([t,s.from([0,0,0,2])]);var r=new f(r),i=(n=t.length)%16,t=(r.update(t),i&&r.update(s.alloc(16-i,0)),r.update(s.alloc(8,0)),8*n),n=((i=s.alloc(8)).writeUIntBE(t,0,8),r.update(i),e._finID=r.state,s.from(e._finID));return u(n),n}(this,r,t),this._prev=s.from(r),this._cache=s.allocUnsafe(0),this._secCache=s.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(c,a),c.prototype._update=function(e){!this._called&&this._alen&&(t=16-this._alen%16)<16&&(t=s.alloc(t,0),this._ghash.update(t)),this._called=!0;var t=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(t),this._len+=e.length,t},c.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){for(var r=0,i=(e.length!==t.length&&r++,Math.min(e.length,t.length)),n=0;n<i;++n)r+=e[n]^t[n];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},c.prototype.getAuthTag=function(){if(this._decrypt||!s.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},c.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},c.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},t.exports=c},{"./aes":19,"./ghash":24,"./incr32":25,"buffer-xor":50,"cipher-base":51,inherits:102,"safe-buffer":143}],21:[function(e,t,r){var i=e("./encrypter"),n=e("./decrypter"),o=e("./modes/list.json");r.createCipher=r.Cipher=i.createCipher,r.createCipheriv=r.Cipheriv=i.createCipheriv,r.createDecipher=r.Decipher=n.createDecipher,r.createDecipheriv=r.Decipheriv=n.createDecipheriv,r.listCiphers=r.getCiphers=function(){return Object.keys(o)}},{"./decrypter":22,"./encrypter":23,"./modes/list.json":33}],22:[function(e,t,r){var i=e("./authCipher"),n=e("safe-buffer").Buffer,o=e("./modes"),s=e("./streamCipher"),a=e("cipher-base"),f=e("./aes"),u=e("evp_bytestokey");function c(e,t,r){a.call(this),this._cache=new h,this._last=void 0,this._cipher=new f.AES(t),this._prev=n.from(r),this._mode=e,this._autopadding=!0}function h(){this.cache=n.allocUnsafe(0)}function d(e,t,r){e=o[e.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=n.from(r)),"GCM"!==e.mode&&r.length!==e.iv)throw new TypeError("invalid iv length "+r.length);if((t="string"==typeof t?n.from(t):t).length!==e.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===e.type?new s(e.module,t,r,!0):"auth"===e.type?new i(e.module,t,r,!0):new c(e.module,t,r)}e("inherits")(c,a),c.prototype._update=function(e){this._cache.add(e);for(var t,r=[];t=this._cache.get(this._autopadding);)t=this._mode.decrypt(this,t),r.push(t);return n.concat(r)},c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding){var t=this._mode.decrypt(this,e),r=t[15];if(r<1||16<r)throw new Error("unable to decrypt data");for(var i=-1;++i<r;)if(t[i+(16-r)]!==r)throw new Error("unable to decrypt data");if(16!==r)return t.slice(0,16-r)}else if(e)throw new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=n.concat([this.cache,e])},h.prototype.get=function(e){var t;if(e){if(16<this.cache.length)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(16<=this.cache.length)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(r)return t=u(t,!1,r.key,r.iv),d(e,t.key,t.iv);throw new TypeError("invalid suite type")},r.createDecipheriv=d},{"./aes":19,"./authCipher":20,"./modes":32,"./streamCipher":35,"cipher-base":51,evp_bytestokey:85,inherits:102,"safe-buffer":143}],23:[function(e,t,r){var i=e("./modes"),n=e("./authCipher"),o=e("safe-buffer").Buffer,s=e("./streamCipher"),a=e("cipher-base"),f=e("./aes"),u=e("evp_bytestokey");function c(e,t,r){a.call(this),this._cache=new d,this._cipher=new f.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}e("inherits")(c,a),c.prototype._update=function(e){this._cache.add(e);for(var t,r=[];t=this._cache.get();)t=this._mode.encrypt(this,t),r.push(t);return o.concat(r)};var h=o.alloc(16,16);function d(){this.cache=o.allocUnsafe(0)}function l(e,t,r){e=i[e.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if((t="string"==typeof t?o.from(t):t).length!==e.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==e.mode&&r.length!==e.iv)throw new TypeError("invalid iv length "+r.length);return new("stream"===e.type?s:"auth"===e.type?n:c)(e.module,t,r)}c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(h))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=o.concat([this.cache,e])},d.prototype.get=function(){var e;return 15<this.cache.length?(e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e):null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return o.concat([this.cache,t])},r.createCipheriv=l,r.createCipher=function(e,t){var r=i[e.toLowerCase()];if(r)return t=u(t,!1,r.key,r.iv),l(e,t.key,t.iv);throw new TypeError("invalid suite type")}},{"./aes":19,"./authCipher":20,"./modes":32,"./streamCipher":35,"cipher-base":51,evp_bytestokey:85,inherits:102,"safe-buffer":143}],24:[function(e,t,r){var i=e("safe-buffer").Buffer,n=i.alloc(16,0);function s(e){var t=i.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},o.prototype._multiply=function(){for(var e,t,r,i=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],n=[0,0,0,0],o=-1;++o<128;){for(0!=(this.state[~~(o/8)]&1<<7-o%8)&&(n[0]^=i[0],n[1]^=i[1],n[2]^=i[2],n[3]^=i[3]),r=0!=(1&i[3]),t=3;0<t;t--)i[t]=i[t]>>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=s(n)},o.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(s([0,e,0,t])),this.state},t.exports=o},{"safe-buffer":143}],25:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],26:[function(e,t,r){var i=e("buffer-xor");r.encrypt=function(e,t){t=i(t,e._prev);return e._prev=e._cipher.encryptBlock(t),e._prev},r.decrypt=function(e,t){var r=e._prev,e=(e._prev=t,e._cipher.decryptBlock(t));return i(e,r)}},{"buffer-xor":50}],27:[function(e,t,r){var o=e("safe-buffer").Buffer,s=e("buffer-xor");function a(e,t,r){var i=t.length,n=s(t,e._cache);return e._cache=e._cache.slice(i),e._prev=o.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=o.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=o.allocUnsafe(0)),!(e._cache.length<=t.length)){n=o.concat([n,a(e,t,r)]);break}i=e._cache.length,n=o.concat([n,a(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":50,"safe-buffer":143}],28:[function(e,t,r){var a=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,o=-1,s=0;++o<8;)s+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^(i=t&1<<7-o?128:0)))>>o%8,e._prev=function(e,t){var r=e.length,i=-1,n=a.allocUnsafe(e.length);e=a.concat([e,a.from([t])]);for(;++i<r;)n[i]=e[i]<<1|e[i+1]>>7;return n}(e._prev,r?i:n);return s}r.encrypt=function(e,t,r){for(var i=t.length,n=a.allocUnsafe(i),o=-1;++o<i;)n[o]=s(e,t[o],r);return n}},{"safe-buffer":143}],29:[function(e,t,r){var c=e("safe-buffer").Buffer;r.encrypt=function(e,t,r){for(var i,n,o,s,a=t.length,f=c.allocUnsafe(a),u=-1;++u<a;)f[u]=(i=e,n=t[u],o=r,s=void 0,s=i._cipher.encryptBlock(i._prev)[0]^n,i._prev=c.concat([i._prev.slice(1),c.from([o?n:s])]),s);return f}},{"safe-buffer":143}],30:[function(e,t,r){var f=e("buffer-xor"),u=e("safe-buffer").Buffer,c=e("../incr32");r.encrypt=function(e,t){var r=Math.ceil(t.length/16),i=e._cache.length;e._cache=u.concat([e._cache,u.allocUnsafe(16*r)]);for(var n=0;n<r;n++){s=void 0,s=(o=e)._cipher.encryptBlockRaw(o._prev),c(o._prev);var o=s,s=i+16*n;e._cache.writeUInt32BE(o[0],s+0),e._cache.writeUInt32BE(o[1],s+4),e._cache.writeUInt32BE(o[2],s+8),e._cache.writeUInt32BE(o[3],s+12)}var a=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),f(t,a)}},{"../incr32":25,"buffer-xor":50,"safe-buffer":143}],31:[function(e,t,r){r.encrypt=function(e,t){return e._cipher.encryptBlock(t)},r.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},{}],32:[function(e,t,r){var i,n={ECB:e("./ecb"),CBC:e("./cbc"),CFB:e("./cfb"),CFB8:e("./cfb8"),CFB1:e("./cfb1"),OFB:e("./ofb"),CTR:e("./ctr"),GCM:e("./ctr")},o=e("./list.json");for(i in o)o[i].module=n[o[i].mode];t.exports=o},{"./cbc":26,"./cfb":27,"./cfb1":28,"./cfb8":29,"./ctr":30,"./ecb":31,"./list.json":33,"./ofb":34}],33:[function(e,t,r){t.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},{}],34:[function(e,t,r){!function(o){!function(){var n=e("buffer-xor");r.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=o.concat([e._cache,((r=e)._prev=r._cipher.encryptBlock(r._prev),r._prev)]);var r,i=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,i)}}.call(this)}.call(this,e("buffer").Buffer)},{buffer:49,"buffer-xor":50}],35:[function(e,t,r){var n=e("./aes"),o=e("safe-buffer").Buffer,s=e("cipher-base");function i(e,t,r,i){s.call(this),this._cipher=new n.AES(t),this._prev=o.from(r),this._cache=o.allocUnsafe(0),this._secCache=o.allocUnsafe(0),this._decrypt=i,this._mode=e}e("inherits")(i,s),i.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},i.prototype._final=function(){this._cipher.scrub()},t.exports=i},{"./aes":19,"cipher-base":51,inherits:102,"safe-buffer":143}],36:[function(e,t,r){var i=e("browserify-des"),n=e("browserify-aes/browser"),o=e("browserify-aes/modes"),s=e("browserify-des/modes"),a=e("evp_bytestokey");function f(e,t,r){if(e=e.toLowerCase(),o[e])return n.createCipheriv(e,t,r);if(s[e])return new i({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function u(e,t,r){if(e=e.toLowerCase(),o[e])return n.createDecipheriv(e,t,r);if(s[e])return new i({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}r.createCipher=r.Cipher=function(e,t){var r,i;if(e=e.toLowerCase(),o[e])r=o[e].key,i=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,i=s[e].iv}return t=a(t,!1,r,i),f(e,t.key,t.iv)},r.createCipheriv=r.Cipheriv=f,r.createDecipher=r.Decipher=function(e,t){var r,i;if(e=e.toLowerCase(),o[e])r=o[e].key,i=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,i=s[e].iv}return t=a(t,!1,r,i),u(e,t.key,t.iv)},r.createDecipheriv=r.Decipheriv=u,r.listCiphers=r.getCiphers=function(){return Object.keys(s).concat(n.getCiphers())}},{"browserify-aes/browser":21,"browserify-aes/modes":32,"browserify-des":37,"browserify-des/modes":38,evp_bytestokey:85}],37:[function(e,t,r){var o=e("cipher-base"),i=e("des.js"),n=e("inherits"),s=e("safe-buffer").Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function f(e){o.call(this);var t=e.mode.toLowerCase(),r=a[t],i=e.decrypt?"decrypt":"encrypt",n=e.key,t=(s.isBuffer(n)||(n=s.from(n)),"des-ede"!==t&&"des-ede-cbc"!==t||(n=s.concat([n,n.slice(0,8)])),e.iv);s.isBuffer(t)||(t=s.from(t)),this._des=r.create({key:n,iv:t,type:i})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],n(t.exports=f,o),f.prototype._update=function(e){return s.from(this._des.update(e))},f.prototype._final=function(){return s.from(this._des.final())}},{"cipher-base":51,"des.js":58,inherits:102,"safe-buffer":143}],38:[function(e,t,r){r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}},{}],39:[function(t,r,e){!function(c){!function(){var f=t("bn.js"),i=t("randombytes");function u(e){for(var t,r=e.modulus.byteLength();0<=(t=new f(i(r))).cmp(e.modulus)||!t.umod(e.prime1)||!t.umod(e.prime2););return t}function e(e,t){var r={blinder:(r=u(i=t)).toRed(f.mont(i.modulus)).redPow(new f(i.publicExponent)).fromRed(),unblinder:r.invm(i.modulus)},i=t.modulus.byteLength(),e=new f(e).mul(r.blinder).umod(t.modulus),n=e.toRed(f.mont(t.prime1)),e=e.toRed(f.mont(t.prime2)),o=t.coefficient,s=t.prime1,a=t.prime2,n=n.redPow(t.exponent1).fromRed(),e=e.redPow(t.exponent2).fromRed(),n=n.isub(e).imul(o).umod(s).imul(a);return e.iadd(n).imul(r.unblinder).umod(t.modulus).toArrayLike(c,"be",i)}e.getr=u,r.exports=e}.call(this)}.call(this,t("buffer").Buffer)},{"bn.js":40,buffer:49,randombytes:125}],40:[function(E,e,t){!function(e,t){"use strict";function b(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;function r(){}r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function m(e,t,r){if(m.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=m:t.BN=m,(m.BN=m).wordSize=26;try{i=("undefined"!=typeof window&&void 0!==window.Buffer?window:E("buffer")).Buffer}catch(e){}function n(e,t){t=e.charCodeAt(t);return 48<=t&&t<=57?t-48:65<=t&&t<=70?t-55:97<=t&&t<=102?t-87:void b(!1,"Invalid character in "+e)}function a(e,t,r){var i=n(e,r);return t<=r-1&&(i|=n(e,r-1)<<4),i}function h(e,t,r,i){for(var n=0,o=0,s=Math.min(e.length,r),a=t;a<s;a++){var f=e.charCodeAt(a)-48;n*=i,o=49<=f?f-49+10:17<=f?f-17+10:f,b(0<=f&&o<i,"Invalid character"),n+=o}return n}function o(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(m.isBN=function(e){return e instanceof m||null!==e&&"object"==typeof e&&e.constructor.wordSize===m.wordSize&&Array.isArray(e.words)},m.max=function(e,t){return 0<e.cmp(t)?e:t},m.min=function(e,t){return e.cmp(t)<0?e:t},m.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);b((t="hex"===t?16:t)===(0|t)&&2<=t&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},m.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(b(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},m.prototype._initArray=function(e,t,r){if(b("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i,n,o=0;o<this.length;o++)this.words[o]=0;var s=0;if("be"===r)for(o=e.length-1,i=0;0<=o;o-=3)n=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=n<<s&67108863,this.words[i+1]=n>>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);else if("le"===r)for(i=o=0;o<e.length;o+=3)n=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=n<<s&67108863,this.words[i+1]=n>>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);return this._strip()},m.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;t<=i;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,18<=o?(o-=18,this.words[s+=1]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,18<=o?(o-=18,this.words[s+=1]|=n>>>26):o+=8;this._strip()},m.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;for(var n=n/t|0,o=e.length-r,s=o%--i,a=Math.min(o,o-s)+r,f=0,u=r;u<a;u+=i)f=h(e,u,u+i,t),this.imuln(n),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!=s){for(var c=1,f=h(e,u,e.length,t),u=0;u<s;u++)c*=t;this.imuln(c),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this._strip()},m.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},m.prototype._move=function(e){o(e,this)},m.prototype.clone=function(){var e=new m(null);return this.copy(e),e},m.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},m.prototype._strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},m.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{m.prototype[Symbol.for("nodejs.util.inspect.custom")]=s}catch(e){m.prototype.inspect=s}else m.prototype.inspect=s;function s(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],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],p=[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];m.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){for(var r="",i=0,n=0,o=0;o<this.length;o++){var s=this.words[o],a=(16777215&(s<<i|n)).toString(16),n=s>>>24-i&16777215;26<=(i+=2)&&(i-=26,o--),r=0!==n||o!==this.length-1?d[6-a.length]+a+r:a+r}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return r=0!==this.negative?"-"+r:r}if(e===(0|e)&&2<=e&&e<=36){var f=l[e],u=p[e];for(r="",(c=this.clone()).negative=0;!c.isZero();){var c,h=c.modrn(u).toString(e);r=(c=c.idivn(u)).isZero()?h+r:d[f-h.length]+h+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return r=0!==this.negative?"-"+r:r}b(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2<this.length&&b(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},m.prototype.toJSON=function(){return this.toString(16,2)},i&&(m.prototype.toBuffer=function(e,t){return this.toArrayLike(i,e,t)}),m.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function f(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0,i=(r.length=i)-1|0,n=(s=(0|e.words[0])*(0|t.words[0]))/67108864|0;r.words[0]=67108863&s;for(var o=1;o<i;o++){for(var s,a=n>>>26,f=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++)a+=(s=(0|e.words[o-c|0])*(0|t.words[c])+f)/67108864|0,f=67108863&s;r.words[o]=0|f,n=0|a}return 0!==n?r.words[o]=0|n:r.length--,r._strip()}m.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),r=r||Math.max(1,i),e=(b(i<=r,"byte array longer than desired length"),b(0<r,"Requested array length <= 0"),r=r,(e=e).allocUnsafe?e.allocUnsafe(r):new e(r));return this["_toArrayLike"+("le"===t?"LE":"BE")](e,i),e},m.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),o=i=0):(i=s>>>24,o+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},m.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r--]=255&s,0<=r&&(e[r--]=s>>8&255),0<=r&&(e[r--]=s>>16&255),6===o?(0<=r&&(e[r--]=s>>24&255),o=i=0):(i=s>>>24,o+=2)}if(0<=r)for(e[r--]=i;0<=r;)e[r--]=0},Math.clz32?m.prototype._countBits=function(e){return 32-Math.clz32(e)}:m.prototype._countBits=function(e){var t=0;return 4096<=e&&(t+=13,e>>>=13),64<=e&&(t+=7,e>>>=7),8<=e&&(t+=4,e>>>=4),2<=e&&(t+=2,e>>>=2),t+e},m.prototype._zeroBits=function(e){if(0===e)return 26;var t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},m.prototype.bitLength=function(){var e=this.words[this.length-1],e=this._countBits(e);return 26*(this.length-1)+e},m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},m.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},m.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},m.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},m.prototype.isNeg=function(){return 0!==this.negative},m.prototype.neg=function(){return this.clone().ineg()},m.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},m.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},m.prototype.ior=function(e){return b(0==(this.negative|e.negative)),this.iuor(e)},m.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},m.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},m.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},m.prototype.iand=function(e){return b(0==(this.negative|e.negative)),this.iuand(e)},m.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},m.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},m.prototype.iuxor=function(e){for(var t,r=this.length>e.length?(t=this,e):(t=e,this),i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},m.prototype.ixor=function(e){return b(0==(this.negative|e.negative)),this.iuxor(e)},m.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},m.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},m.prototype.inotn=function(e){b("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),e=e%26;this._expand(t),0<e&&t--;for(var r=0;r<t;r++)this.words[r]=67108863&~this.words[r];return 0<e&&(this.words[r]=~this.words[r]&67108863>>26-e),this._strip()},m.prototype.notn=function(e){return this.clone().inotn(e)},m.prototype.setn=function(e,t){b("number"==typeof e&&0<=e);var r=e/26|0,e=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<<e:this.words[r]&~(1<<e),this._strip()},m.prototype.iadd=function(e){var t,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();for(var i=this.length>e.length?(r=this,e):(r=e,this),n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},m.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},m.prototype.isub=function(e){var t;if(0!==e.negative)return e.negative=0,t=this.iadd(e),e.negative=1,t._normSign();if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;for(var n=0<i?(r=this,e):(r=e,this),o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},m.prototype.sub=function(e){return this.clone().isub(e)};var u=function(e,L,D){var t,r=e.words,i=L.words,n=D.words,o=0|r[0],s=8191&o,o=o>>>13,a=0|r[1],f=8191&a,a=a>>>13,u=0|r[2],c=8191&u,u=u>>>13,h=0|r[3],d=8191&h,h=h>>>13,l=0|r[4],p=8191&l,l=l>>>13,b=0|r[5],m=8191&b,b=b>>>13,y=0|r[6],g=8191&y,y=y>>>13,v=0|r[7],_=8191&v,v=v>>>13,w=0|r[8],N=8191&w,w=w>>>13,r=0|r[9],U=8191&r,r=r>>>13,M=0|i[0],S=8191&M,M=M>>>13,A=0|i[1],k=8191&A,A=A>>>13,E=0|i[2],x=8191&E,E=E>>>13,I=0|i[3],q=8191&I,I=I>>>13,P=0|i[4],z=8191&P,P=P>>>13,R=0|i[5],H=8191&R,R=R>>>13,j=0|i[6],K=8191&j,j=j>>>13,B=0|i[7],F=8191&B,B=B>>>13,C=0|i[8],V=8191&C,C=C>>>13,i=0|i[9],W=8191&i,i=i>>>13,L=(D.negative=e.negative^L.negative,D.length=19,(0+Math.imul(s,S)|0)+((8191&(e=Math.imul(s,M)+Math.imul(o,S)|0))<<13)|0),T=(Math.imul(o,M)+(e>>>13)|0)+(L>>>26)|0;L&=67108863,t=Math.imul(f,S),e=Math.imul(f,M)+Math.imul(a,S)|0,O=Math.imul(a,M);var O,G=(T+(t+Math.imul(s,k)|0)|0)+((8191&(e=(e+Math.imul(s,A)|0)+Math.imul(o,k)|0))<<13)|0,J=(T=((O+Math.imul(o,A)|0)+(e>>>13)|0)+(G>>>26)|0,G&=67108863,t=Math.imul(c,S),e=Math.imul(c,M)+Math.imul(u,S)|0,O=Math.imul(u,M),t=t+Math.imul(f,k)|0,e=(e+Math.imul(f,A)|0)+Math.imul(a,k)|0,O=O+Math.imul(a,A)|0,(T+(t+Math.imul(s,x)|0)|0)+((8191&(e=(e+Math.imul(s,E)|0)+Math.imul(o,x)|0))<<13)|0),Z=(T=((O+Math.imul(o,E)|0)+(e>>>13)|0)+(J>>>26)|0,J&=67108863,t=Math.imul(d,S),e=Math.imul(d,M)+Math.imul(h,S)|0,O=Math.imul(h,M),t=t+Math.imul(c,k)|0,e=(e+Math.imul(c,A)|0)+Math.imul(u,k)|0,O=O+Math.imul(u,A)|0,t=t+Math.imul(f,x)|0,e=(e+Math.imul(f,E)|0)+Math.imul(a,x)|0,O=O+Math.imul(a,E)|0,(T+(t+Math.imul(s,q)|0)|0)+((8191&(e=(e+Math.imul(s,I)|0)+Math.imul(o,q)|0))<<13)|0),X=(T=((O+Math.imul(o,I)|0)+(e>>>13)|0)+(Z>>>26)|0,Z&=67108863,t=Math.imul(p,S),e=Math.imul(p,M)+Math.imul(l,S)|0,O=Math.imul(l,M),t=t+Math.imul(d,k)|0,e=(e+Math.imul(d,A)|0)+Math.imul(h,k)|0,O=O+Math.imul(h,A)|0,t=t+Math.imul(c,x)|0,e=(e+Math.imul(c,E)|0)+Math.imul(u,x)|0,O=O+Math.imul(u,E)|0,t=t+Math.imul(f,q)|0,e=(e+Math.imul(f,I)|0)+Math.imul(a,q)|0,O=O+Math.imul(a,I)|0,(T+(t+Math.imul(s,z)|0)|0)+((8191&(e=(e+Math.imul(s,P)|0)+Math.imul(o,z)|0))<<13)|0),Y=(T=((O+Math.imul(o,P)|0)+(e>>>13)|0)+(X>>>26)|0,X&=67108863,t=Math.imul(m,S),e=Math.imul(m,M)+Math.imul(b,S)|0,O=Math.imul(b,M),t=t+Math.imul(p,k)|0,e=(e+Math.imul(p,A)|0)+Math.imul(l,k)|0,O=O+Math.imul(l,A)|0,t=t+Math.imul(d,x)|0,e=(e+Math.imul(d,E)|0)+Math.imul(h,x)|0,O=O+Math.imul(h,E)|0,t=t+Math.imul(c,q)|0,e=(e+Math.imul(c,I)|0)+Math.imul(u,q)|0,O=O+Math.imul(u,I)|0,t=t+Math.imul(f,z)|0,e=(e+Math.imul(f,P)|0)+Math.imul(a,z)|0,O=O+Math.imul(a,P)|0,(T+(t+Math.imul(s,H)|0)|0)+((8191&(e=(e+Math.imul(s,R)|0)+Math.imul(o,H)|0))<<13)|0),Q=(T=((O+Math.imul(o,R)|0)+(e>>>13)|0)+(Y>>>26)|0,Y&=67108863,t=Math.imul(g,S),e=Math.imul(g,M)+Math.imul(y,S)|0,O=Math.imul(y,M),t=t+Math.imul(m,k)|0,e=(e+Math.imul(m,A)|0)+Math.imul(b,k)|0,O=O+Math.imul(b,A)|0,t=t+Math.imul(p,x)|0,e=(e+Math.imul(p,E)|0)+Math.imul(l,x)|0,O=O+Math.imul(l,E)|0,t=t+Math.imul(d,q)|0,e=(e+Math.imul(d,I)|0)+Math.imul(h,q)|0,O=O+Math.imul(h,I)|0,t=t+Math.imul(c,z)|0,e=(e+Math.imul(c,P)|0)+Math.imul(u,z)|0,O=O+Math.imul(u,P)|0,t=t+Math.imul(f,H)|0,e=(e+Math.imul(f,R)|0)+Math.imul(a,H)|0,O=O+Math.imul(a,R)|0,(T+(t+Math.imul(s,K)|0)|0)+((8191&(e=(e+Math.imul(s,j)|0)+Math.imul(o,K)|0))<<13)|0),$=(T=((O+Math.imul(o,j)|0)+(e>>>13)|0)+(Q>>>26)|0,Q&=67108863,t=Math.imul(_,S),e=Math.imul(_,M)+Math.imul(v,S)|0,O=Math.imul(v,M),t=t+Math.imul(g,k)|0,e=(e+Math.imul(g,A)|0)+Math.imul(y,k)|0,O=O+Math.imul(y,A)|0,t=t+Math.imul(m,x)|0,e=(e+Math.imul(m,E)|0)+Math.imul(b,x)|0,O=O+Math.imul(b,E)|0,t=t+Math.imul(p,q)|0,e=(e+Math.imul(p,I)|0)+Math.imul(l,q)|0,O=O+Math.imul(l,I)|0,t=t+Math.imul(d,z)|0,e=(e+Math.imul(d,P)|0)+Math.imul(h,z)|0,O=O+Math.imul(h,P)|0,t=t+Math.imul(c,H)|0,e=(e+Math.imul(c,R)|0)+Math.imul(u,H)|0,O=O+Math.imul(u,R)|0,t=t+Math.imul(f,K)|0,e=(e+Math.imul(f,j)|0)+Math.imul(a,K)|0,O=O+Math.imul(a,j)|0,(T+(t+Math.imul(s,F)|0)|0)+((8191&(e=(e+Math.imul(s,B)|0)+Math.imul(o,F)|0))<<13)|0),ee=(T=((O+Math.imul(o,B)|0)+(e>>>13)|0)+($>>>26)|0,$&=67108863,t=Math.imul(N,S),e=Math.imul(N,M)+Math.imul(w,S)|0,O=Math.imul(w,M),t=t+Math.imul(_,k)|0,e=(e+Math.imul(_,A)|0)+Math.imul(v,k)|0,O=O+Math.imul(v,A)|0,t=t+Math.imul(g,x)|0,e=(e+Math.imul(g,E)|0)+Math.imul(y,x)|0,O=O+Math.imul(y,E)|0,t=t+Math.imul(m,q)|0,e=(e+Math.imul(m,I)|0)+Math.imul(b,q)|0,O=O+Math.imul(b,I)|0,t=t+Math.imul(p,z)|0,e=(e+Math.imul(p,P)|0)+Math.imul(l,z)|0,O=O+Math.imul(l,P)|0,t=t+Math.imul(d,H)|0,e=(e+Math.imul(d,R)|0)+Math.imul(h,H)|0,O=O+Math.imul(h,R)|0,t=t+Math.imul(c,K)|0,e=(e+Math.imul(c,j)|0)+Math.imul(u,K)|0,O=O+Math.imul(u,j)|0,t=t+Math.imul(f,F)|0,e=(e+Math.imul(f,B)|0)+Math.imul(a,F)|0,O=O+Math.imul(a,B)|0,(T+(t+Math.imul(s,V)|0)|0)+((8191&(e=(e+Math.imul(s,C)|0)+Math.imul(o,V)|0))<<13)|0),S=(T=((O+Math.imul(o,C)|0)+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,t=Math.imul(U,S),e=Math.imul(U,M)+Math.imul(r,S)|0,O=Math.imul(r,M),t=t+Math.imul(N,k)|0,e=(e+Math.imul(N,A)|0)+Math.imul(w,k)|0,O=O+Math.imul(w,A)|0,t=t+Math.imul(_,x)|0,e=(e+Math.imul(_,E)|0)+Math.imul(v,x)|0,O=O+Math.imul(v,E)|0,t=t+Math.imul(g,q)|0,e=(e+Math.imul(g,I)|0)+Math.imul(y,q)|0,O=O+Math.imul(y,I)|0,t=t+Math.imul(m,z)|0,e=(e+Math.imul(m,P)|0)+Math.imul(b,z)|0,O=O+Math.imul(b,P)|0,t=t+Math.imul(p,H)|0,e=(e+Math.imul(p,R)|0)+Math.imul(l,H)|0,O=O+Math.imul(l,R)|0,t=t+Math.imul(d,K)|0,e=(e+Math.imul(d,j)|0)+Math.imul(h,K)|0,O=O+Math.imul(h,j)|0,t=t+Math.imul(c,F)|0,e=(e+Math.imul(c,B)|0)+Math.imul(u,F)|0,O=O+Math.imul(u,B)|0,t=t+Math.imul(f,V)|0,e=(e+Math.imul(f,C)|0)+Math.imul(a,V)|0,O=O+Math.imul(a,C)|0,(T+(t+Math.imul(s,W)|0)|0)+((8191&(e=(e+Math.imul(s,i)|0)+Math.imul(o,W)|0))<<13)|0),M=(T=((O+Math.imul(o,i)|0)+(e>>>13)|0)+(S>>>26)|0,S&=67108863,t=Math.imul(U,k),e=Math.imul(U,A)+Math.imul(r,k)|0,O=Math.imul(r,A),t=t+Math.imul(N,x)|0,e=(e+Math.imul(N,E)|0)+Math.imul(w,x)|0,O=O+Math.imul(w,E)|0,t=t+Math.imul(_,q)|0,e=(e+Math.imul(_,I)|0)+Math.imul(v,q)|0,O=O+Math.imul(v,I)|0,t=t+Math.imul(g,z)|0,e=(e+Math.imul(g,P)|0)+Math.imul(y,z)|0,O=O+Math.imul(y,P)|0,t=t+Math.imul(m,H)|0,e=(e+Math.imul(m,R)|0)+Math.imul(b,H)|0,O=O+Math.imul(b,R)|0,t=t+Math.imul(p,K)|0,e=(e+Math.imul(p,j)|0)+Math.imul(l,K)|0,O=O+Math.imul(l,j)|0,t=t+Math.imul(d,F)|0,e=(e+Math.imul(d,B)|0)+Math.imul(h,F)|0,O=O+Math.imul(h,B)|0,t=t+Math.imul(c,V)|0,e=(e+Math.imul(c,C)|0)+Math.imul(u,V)|0,O=O+Math.imul(u,C)|0,(T+(t+Math.imul(f,W)|0)|0)+((8191&(e=(e+Math.imul(f,i)|0)+Math.imul(a,W)|0))<<13)|0),s=(T=((O+Math.imul(a,i)|0)+(e>>>13)|0)+(M>>>26)|0,M&=67108863,t=Math.imul(U,x),e=Math.imul(U,E)+Math.imul(r,x)|0,O=Math.imul(r,E),t=t+Math.imul(N,q)|0,e=(e+Math.imul(N,I)|0)+Math.imul(w,q)|0,O=O+Math.imul(w,I)|0,t=t+Math.imul(_,z)|0,e=(e+Math.imul(_,P)|0)+Math.imul(v,z)|0,O=O+Math.imul(v,P)|0,t=t+Math.imul(g,H)|0,e=(e+Math.imul(g,R)|0)+Math.imul(y,H)|0,O=O+Math.imul(y,R)|0,t=t+Math.imul(m,K)|0,e=(e+Math.imul(m,j)|0)+Math.imul(b,K)|0,O=O+Math.imul(b,j)|0,t=t+Math.imul(p,F)|0,e=(e+Math.imul(p,B)|0)+Math.imul(l,F)|0,O=O+Math.imul(l,B)|0,t=t+Math.imul(d,V)|0,e=(e+Math.imul(d,C)|0)+Math.imul(h,V)|0,O=O+Math.imul(h,C)|0,(T+(t+Math.imul(c,W)|0)|0)+((8191&(e=(e+Math.imul(c,i)|0)+Math.imul(u,W)|0))<<13)|0),o=(T=((O+Math.imul(u,i)|0)+(e>>>13)|0)+(s>>>26)|0,s&=67108863,t=Math.imul(U,q),e=Math.imul(U,I)+Math.imul(r,q)|0,O=Math.imul(r,I),t=t+Math.imul(N,z)|0,e=(e+Math.imul(N,P)|0)+Math.imul(w,z)|0,O=O+Math.imul(w,P)|0,t=t+Math.imul(_,H)|0,e=(e+Math.imul(_,R)|0)+Math.imul(v,H)|0,O=O+Math.imul(v,R)|0,t=t+Math.imul(g,K)|0,e=(e+Math.imul(g,j)|0)+Math.imul(y,K)|0,O=O+Math.imul(y,j)|0,t=t+Math.imul(m,F)|0,e=(e+Math.imul(m,B)|0)+Math.imul(b,F)|0,O=O+Math.imul(b,B)|0,t=t+Math.imul(p,V)|0,e=(e+Math.imul(p,C)|0)+Math.imul(l,V)|0,O=O+Math.imul(l,C)|0,(T+(t+Math.imul(d,W)|0)|0)+((8191&(e=(e+Math.imul(d,i)|0)+Math.imul(h,W)|0))<<13)|0),k=(T=((O+Math.imul(h,i)|0)+(e>>>13)|0)+(o>>>26)|0,o&=67108863,t=Math.imul(U,z),e=Math.imul(U,P)+Math.imul(r,z)|0,O=Math.imul(r,P),t=t+Math.imul(N,H)|0,e=(e+Math.imul(N,R)|0)+Math.imul(w,H)|0,O=O+Math.imul(w,R)|0,t=t+Math.imul(_,K)|0,e=(e+Math.imul(_,j)|0)+Math.imul(v,K)|0,O=O+Math.imul(v,j)|0,t=t+Math.imul(g,F)|0,e=(e+Math.imul(g,B)|0)+Math.imul(y,F)|0,O=O+Math.imul(y,B)|0,t=t+Math.imul(m,V)|0,e=(e+Math.imul(m,C)|0)+Math.imul(b,V)|0,O=O+Math.imul(b,C)|0,(T+(t+Math.imul(p,W)|0)|0)+((8191&(e=(e+Math.imul(p,i)|0)+Math.imul(l,W)|0))<<13)|0),A=(T=((O+Math.imul(l,i)|0)+(e>>>13)|0)+(k>>>26)|0,k&=67108863,t=Math.imul(U,H),e=Math.imul(U,R)+Math.imul(r,H)|0,O=Math.imul(r,R),t=t+Math.imul(N,K)|0,e=(e+Math.imul(N,j)|0)+Math.imul(w,K)|0,O=O+Math.imul(w,j)|0,t=t+Math.imul(_,F)|0,e=(e+Math.imul(_,B)|0)+Math.imul(v,F)|0,O=O+Math.imul(v,B)|0,t=t+Math.imul(g,V)|0,e=(e+Math.imul(g,C)|0)+Math.imul(y,V)|0,O=O+Math.imul(y,C)|0,(T+(t+Math.imul(m,W)|0)|0)+((8191&(e=(e+Math.imul(m,i)|0)+Math.imul(b,W)|0))<<13)|0),f=(T=((O+Math.imul(b,i)|0)+(e>>>13)|0)+(A>>>26)|0,A&=67108863,t=Math.imul(U,K),e=Math.imul(U,j)+Math.imul(r,K)|0,O=Math.imul(r,j),t=t+Math.imul(N,F)|0,e=(e+Math.imul(N,B)|0)+Math.imul(w,F)|0,O=O+Math.imul(w,B)|0,t=t+Math.imul(_,V)|0,e=(e+Math.imul(_,C)|0)+Math.imul(v,V)|0,O=O+Math.imul(v,C)|0,(T+(t+Math.imul(g,W)|0)|0)+((8191&(e=(e+Math.imul(g,i)|0)+Math.imul(y,W)|0))<<13)|0),a=(T=((O+Math.imul(y,i)|0)+(e>>>13)|0)+(f>>>26)|0,f&=67108863,t=Math.imul(U,F),e=Math.imul(U,B)+Math.imul(r,F)|0,O=Math.imul(r,B),t=t+Math.imul(N,V)|0,e=(e+Math.imul(N,C)|0)+Math.imul(w,V)|0,O=O+Math.imul(w,C)|0,(T+(t+Math.imul(_,W)|0)|0)+((8191&(e=(e+Math.imul(_,i)|0)+Math.imul(v,W)|0))<<13)|0),x=(T=((O+Math.imul(v,i)|0)+(e>>>13)|0)+(a>>>26)|0,a&=67108863,t=Math.imul(U,V),e=Math.imul(U,C)+Math.imul(r,V)|0,O=Math.imul(r,C),(T+(t+Math.imul(N,W)|0)|0)+((8191&(e=(e+Math.imul(N,i)|0)+Math.imul(w,W)|0))<<13)|0),E=(T=((O+Math.imul(w,i)|0)+(e>>>13)|0)+(x>>>26)|0,x&=67108863,(T+Math.imul(U,W)|0)+((8191&(e=Math.imul(U,i)+Math.imul(r,W)|0))<<13)|0);return T=(Math.imul(r,i)+(e>>>13)|0)+(E>>>26)|0,E&=67108863,n[0]=L,n[1]=G,n[2]=J,n[3]=Z,n[4]=X,n[5]=Y,n[6]=Q,n[7]=$,n[8]=ee,n[9]=S,n[10]=M,n[11]=s,n[12]=o,n[13]=k,n[14]=A,n[15]=f,n[16]=a,n[17]=x,n[18]=E,0!=T&&(n[19]=T,D.length++),D};function c(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){for(var s=n,n=0,a=67108863&i,f=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=f;u++){var c,h=(0|e.words[o-u])*(0|t.words[u]),a=67108863&(c=(67108863&h)+a|0);n+=(s=(s=s+(h/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(e,t,r){return c(e,t,r)}Math.imul||(u=f),m.prototype.mulTo=function(e,t){var r=this.length+e.length,r=(10===this.length&&10===e.length?u:r<63?f:r<1024?c:y)(this,e,t);return r},m.prototype.mul=function(e){var t=new m(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},m.prototype.mulf=function(e){var t=new m(null);return t.words=new Array(this.length+e.length),y(this,e,t)},m.prototype.imul=function(e){return this.clone().mulTo(e,this)},m.prototype.imuln=function(e){for(var t=e<0,r=(b("number"==typeof(e=t?-e:e)),b(e<67108864),0),i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&r),r=(r>>=26)+(n/67108864|0)+(o>>>26);this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},m.prototype.muln=function(e){return this.clone().imuln(e)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++)t[r]=e.words[r/26|0]>>>r%26&1;return t}(e);if(0===t.length)return new m(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},m.prototype.iushln=function(e){b("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!=t){for(var n=0,o=0;o<this.length;o++){var s=this.words[o]&i,a=(0|this.words[o])-s<<t;this.words[o]=a|n,n=s>>>26-t}n&&(this.words[o]=n,this.length++)}if(0!=r){for(o=this.length-1;0<=o;o--)this.words[o+r]=this.words[o];for(o=0;o<r;o++)this.words[o]=0;this.length+=r}return this._strip()},m.prototype.ishln=function(e){return b(0===this.negative),this.iushln(e)},m.prototype.iushrn=function(e,t,r){b("number"==typeof e&&0<=e),i=t?(t-t%26)/26:0;var i,n=e%26,o=Math.min((e-n)/26,this.length),s=67108863^67108863>>>n<<n,a=r;if(i-=o,i=Math.max(0,i),a){for(var f=0;f<o;f++)a.words[f]=this.words[f];a.length=o}if(0!==o)if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;for(var u=0,f=this.length-1;0<=f&&(0!==u||i<=f);f--){var c=0|this.words[f];this.words[f]=u<<26-n|c>>>n,u=c&s}return a&&0!==u&&(a.words[a.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},m.prototype.ishrn=function(e,t,r){return b(0===this.negative),this.iushrn(e,t,r)},m.prototype.shln=function(e){return this.clone().ishln(e)},m.prototype.ushln=function(e){return this.clone().iushln(e)},m.prototype.shrn=function(e){return this.clone().ishrn(e)},m.prototype.ushrn=function(e){return this.clone().iushrn(e)},m.prototype.testn=function(e){b("number"==typeof e&&0<=e);var t=e%26,e=(e-t)/26;return!(this.length<=e)&&!!(this.words[e]&1<<t)},m.prototype.imaskn=function(e){b("number"==typeof e&&0<=e);var t=e%26,e=(e-t)/26;return b(0===this.negative,"imaskn works only with positive numbers"),this.length<=e?this:(0!=t&&e++,this.length=Math.min(e,this.length),0!=t&&(this.words[this.length-1]&=67108863^67108863>>>t<<t),this._strip())},m.prototype.maskn=function(e){return this.clone().imaskn(e)},m.prototype.iaddn=function(e){return b("number"==typeof e),b(e<67108864),e<0?this.isubn(-e):0!==this.negative?(1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(e),this.negative=1),this):this._iaddn(e)},m.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&67108864<=this.words[t];t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},m.prototype.isubn=function(e){if(b("number"==typeof e),b(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,--this.words[t+1];return this._strip()},m.prototype.addn=function(e){return this.clone().iaddn(e)},m.prototype.subn=function(e){return this.clone().isubn(e)},m.prototype.iabs=function(){return this.negative=0,this},m.prototype.abs=function(){return this.clone().iabs()},m.prototype._ishlnsubmul=function(e,t,r){for(var i=e.length+r,n=(this._expand(i),0),o=0;o<e.length;o++){var s=(0|this.words[o+r])+n,a=(0|e.words[o])*t,n=((s-=67108863&a)>>26)-(a/67108864|0);this.words[o+r]=67108863&s}for(;o<this.length-r;o++)n=(s=(0|this.words[o+r])+n)>>26,this.words[o+r]=67108863&s;if(0!==n){for(b(-1===n),o=n=0;o<this.length;o++)n=(s=-(0|this.words[o])+n)>>26,this.words[o]=67108863&s;this.negative=1}return this._strip()},m.prototype._wordDiv=function(e,t){this.length,e.length;var r,i=this.clone(),n=e,o=0|n.words[n.length-1],s=(0!=(e=26-this._countBits(o))&&(n=n.ushln(e),i.iushln(e),o=0|n.words[n.length-1]),i.length-n.length);if("mod"!==t){(r=new m(null)).length=1+s,r.words=new Array(r.length);for(var a=0;a<r.length;a++)r.words[a]=0}var f=i.clone()._ishlnsubmul(n,1,s);0===f.negative&&(i=f,r&&(r.words[s]=1));for(var u=s-1;0<=u;u--){var c=67108864*(0|i.words[n.length+u])+(0|i.words[n.length+u-1]),c=Math.min(c/o|0,67108863);for(i._ishlnsubmul(n,c,u);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,u),i.isZero()||(i.negative^=1);r&&(r.words[u]=c)}return r&&r._strip(),i._strip(),"div"!==t&&0!=e&&i.iushrn(e),{div:r||null,mod:i}},m.prototype.divmod=function(e,t,r){return b(!e.isZero()),this.isZero()?{div:new m(0),mod:new m(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.iadd(e)),{div:i,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),{div:i="mod"!==t?o.div.neg():i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new m(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new m(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new m(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,n,o},m.prototype.div=function(e){return this.divmod(e,"div",!1).div},m.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},m.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},m.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),e=e.andln(1),r=r.cmp(i);return r<0||1===e&&0===r?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},m.prototype.modrn=function(e){for(var t=e<0,r=(b((e=t?-e:e)<=67108863),(1<<26)%e),i=0,n=this.length-1;0<=n;n--)i=(r*i+(0|this.words[n]))%e;return t?-i:i},m.prototype.modn=function(e){return this.modrn(e)},m.prototype.idivn=function(e){for(var t=e<0,r=(b((e=t?-e:e)<=67108863),0),i=this.length-1;0<=i;i--){var n=(0|this.words[i])+67108864*r;this.words[i]=n/e|0,r=n%e}return this._strip(),t?this.ineg():this},m.prototype.divn=function(e){return this.clone().idivn(e)},m.prototype.egcd=function(e){b(0===e.negative),b(!e.isZero());for(var t=this,r=e.clone(),t=0!==t.negative?t.umod(e):t.clone(),i=new m(1),n=new m(0),o=new m(0),s=new m(1),a=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++a;for(var f=r.clone(),u=t.clone();!t.isZero();){for(var c=0,h=1;0==(t.words[0]&h)&&c<26;++c,h<<=1);if(0<c)for(t.iushrn(c);0<c--;)(i.isOdd()||n.isOdd())&&(i.iadd(f),n.isub(u)),i.iushrn(1),n.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(0<d)for(r.iushrn(d);0<d--;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(u)),o.iushrn(1),s.iushrn(1);0<=t.cmp(r)?(t.isub(r),i.isub(o),n.isub(s)):(r.isub(t),o.isub(i),s.isub(n))}return{a:o,b:s,gcd:r.iushln(a)}},m.prototype._invmp=function(e){b(0===e.negative),b(!e.isZero());for(var t,r=this,i=e.clone(),r=0!==r.negative?r.umod(e):r.clone(),n=new m(1),o=new m(0),s=i.clone();0<r.cmpn(1)&&0<i.cmpn(1);){for(var a=0,f=1;0==(r.words[0]&f)&&a<26;++a,f<<=1);if(0<a)for(r.iushrn(a);0<a--;)n.isOdd()&&n.iadd(s),n.iushrn(1);for(var u=0,c=1;0==(i.words[0]&c)&&u<26;++u,c<<=1);if(0<u)for(i.iushrn(u);0<u--;)o.isOdd()&&o.iadd(s),o.iushrn(1);0<=r.cmp(i)?(r.isub(i),n.isub(o)):(i.isub(r),o.isub(n))}return(t=0===r.cmpn(1)?n:o).cmpn(0)<0&&t.iadd(e),t},m.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0;for(var i=r.negative=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0)var o=t,t=r,r=o;else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},m.prototype.invm=function(e){return this.egcd(e).a.umod(e)},m.prototype.isEven=function(){return 0==(1&this.words[0])},m.prototype.isOdd=function(){return 1==(1&this.words[0])},m.prototype.andln=function(e){return this.words[0]&e},m.prototype.bincn=function(e){b("number"==typeof e);var t=e%26,e=(e-t)/26,t=1<<t;if(this.length<=e)return this._expand(1+e),this.words[e]|=t,this;for(var r=t,i=e;0!==r&&i<this.length;i++){var n=0|this.words[i],r=(n+=r)>>>26;n&=67108863,this.words[i]=n}return 0!==r&&(this.words[i]=r,this.length++),this},m.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},m.prototype.cmpn=function(e){var t=e<0;return 0===this.negative||t?0===this.negative&&t?1:(this._strip(),t=1<this.length?1:(b((e=t?-e:e)<=67108863,"Number is too big"),(t=0|this.words[0])===e?0:t<e?-1:1),0!==this.negative?0|-t:t):-1},m.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;e=this.ucmp(e);return 0!==this.negative?0|-e:e},m.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;0<=r;r--){var i=0|this.words[r],n=0|e.words[r];if(i!=n){i<n?t=-1:n<i&&(t=1);break}}return t},m.prototype.gtn=function(e){return 1===this.cmpn(e)},m.prototype.gt=function(e){return 1===this.cmp(e)},m.prototype.gten=function(e){return 0<=this.cmpn(e)},m.prototype.gte=function(e){return 0<=this.cmp(e)},m.prototype.ltn=function(e){return-1===this.cmpn(e)},m.prototype.lt=function(e){return-1===this.cmp(e)},m.prototype.lten=function(e){return this.cmpn(e)<=0},m.prototype.lte=function(e){return this.cmp(e)<=0},m.prototype.eqn=function(e){return 0===this.cmpn(e)},m.prototype.eq=function(e){return 0===this.cmp(e)},m.red=function(e){return new A(e)},m.prototype.toRed=function(e){return b(!this.red,"Already a number in reduction context"),b(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},m.prototype.fromRed=function(){return b(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},m.prototype._forceRed=function(e){return this.red=e,this},m.prototype.forceRed=function(e){return b(!this.red,"Already a number in reduction context"),this._forceRed(e)},m.prototype.redAdd=function(e){return b(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},m.prototype.redIAdd=function(e){return b(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},m.prototype.redSub=function(e){return b(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},m.prototype.redISub=function(e){return b(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},m.prototype.redShl=function(e){return b(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},m.prototype.redMul=function(e){return b(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},m.prototype.redIMul=function(e){return b(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},m.prototype.redSqr=function(){return b(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},m.prototype.redISqr=function(){return b(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},m.prototype.redSqrt=function(){return b(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},m.prototype.redInvm=function(){return b(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},m.prototype.redNeg=function(){return b(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},m.prototype.redPow=function(e){return b(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new m(t,16),this.n=this.p.bitLength(),this.k=new m(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){var t;"string"==typeof e?(t=m._prime(e),this.m=t.p,this.prime=t):(b(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null)}function k(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new m(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)}v.prototype._tmp=function(){var e=new m(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){for(var t,r=e;this.split(r,this.tmp),(t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength())>this.n;);e=t<this.n?-1:r.ucmp(this.p);return 0===e?(r.words[0]=0,r.length=1):0<e?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},r(_,v),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=4194303&n,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(4194303&o)<<4|n>>>22,n=o}0===(e.words[i-10]=n>>>=22)&&10<e.length?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(w,v),r(M,v),r(S,v),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},m._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new w;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return g[e]=t},A.prototype._verify1=function(e){b(0===e.negative,"red works only with positives"),b(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){b(0==(e.negative|t.negative),"red works only with positives"),b(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(o(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);e=e.add(t);return 0<=e.cmp(this.m)&&e.isub(this.m),e._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);e=e.iadd(t);return 0<=e.cmp(this.m)&&e.isub(this.m),e},A.prototype.sub=function(e,t){this._verify2(e,t);e=e.sub(t);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);e=e.isub(t);return e.cmpn(0)<0&&e.iadd(this.m),e},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(b(t%2==1),3===t)return t=this.m.add(new m(1)).iushrn(2),this.pow(e,t);for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);b(!r.isZero());for(var n=new m(1).toRed(this),o=n.redNeg(),s=this.m.subn(1).iushrn(1),a=new m(2*(a=this.m.bitLength())*a).toRed(this);0!==this.pow(a,s).cmp(o);)a.redIAdd(o);for(var f=this.pow(a,r),u=this.pow(e,r.addn(1).iushrn(1)),c=this.pow(e,r),h=i;0!==c.cmp(n);){for(var d=c,l=0;0!==d.cmp(n);l++)d=d.redSqr();b(l<h);var p=this.pow(f,new m(1).iushln(h-l-1)),u=u.redMul(p),f=p.redSqr(),c=c.redMul(f),h=l}return u},A.prototype.invm=function(e){e=e._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},A.prototype.pow=function(e,t){if(t.isZero())return new m(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new m(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,s=0,a=t.bitLength()%26;for(0===a&&(a=26),i=t.length-1;0<=i;i--){for(var f=t.words[i],u=a-1;0<=u;u--){var c=f>>u&1;n!==r[0]&&(n=this.sqr(n)),0==c&&0===o?s=0:(o=o<<1|c,(4===++s||0===i&&0===u)&&(n=this.mul(n,r[o]),o=s=0))}a=26}return n},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){e=e.clone();return e.red=null,e},m.mont=function(e){return new k(e)},r(k,A),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){e=this.imod(e.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;e=e.imul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new m(0)._forceRed(this);e=e.mul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:18}],41:[function(e,t,r){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":42}],42:[function(e,t,r){t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],43:[function(e,t,r){t.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],44:[function(e,t,r){var i=e("safe-buffer").Buffer,n=e("create-hash"),o=e("readable-stream"),s=e("inherits"),a=e("./sign"),f=e("./verify"),u=e("./algorithms.json");function c(e){o.Writable.call(this);e=u[e];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function h(e){o.Writable.call(this);e=u[e];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function d(e){return new c(e)}function l(e){return new h(e)}Object.keys(u).forEach(function(e){u[e].id=i.from(u[e].id,"hex"),u[e.toLowerCase()]=u[e]}),s(c,o.Writable),c.prototype._write=function(e,t,r){this._hash.update(e),r()},c.prototype.update=function(e,t){return"string"==typeof e&&(e=i.from(e,t)),this._hash.update(e),this},c.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),r=a(r,e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},s(h,o.Writable),h.prototype._write=function(e,t,r){this._hash.update(e),r()},h.prototype.update=function(e,t){return"string"==typeof e&&(e=i.from(e,t)),this._hash.update(e),this},h.prototype.verify=function(e,t,r){"string"==typeof t&&(t=i.from(t,r)),this.end();r=this._hash.digest();return f(t,r,e,this._signType,this._tag)},t.exports={Sign:d,Verify:l,createSign:d,createVerify:l}},{"./algorithms.json":42,"./sign":45,"./verify":46,"create-hash":53,inherits:102,"readable-stream":141,"safe-buffer":48}],45:[function(e,t,r){var M=e("safe-buffer").Buffer,o=e("create-hmac"),S=e("browserify-rsa"),A=e("elliptic").ec,k=e("bn.js"),E=e("parse-asn1"),x=e("./curves.json");function I(e,t,r,i){(e=M.from(e.toArray())).length<t.byteLength()&&(n=M.alloc(t.byteLength()-e.length),e=M.concat([n,e]));var n=r.length,r=function(e,t){e=(e=P(e,t)).mod(t);e=M.from(e.toArray());e.length<t.byteLength()&&(t=M.alloc(t.byteLength()-e.length),e=M.concat([t,e]));return e}(r,t),n=((t=M.alloc(n)).fill(1),M.alloc(n)),n=o(i,n).update(t).update(M.from([0])).update(e).update(r).digest(),t=o(i,n).update(t).digest();return{k:n=o(i,n).update(t).update(M.from([1])).update(e).update(r).digest(),v:t=o(i,n).update(t).digest()}}function P(e,t){var r=new k(e),e=(e.length<<3)-t.bitLength();return 0<e&&r.ishrn(e),r}function R(e,t,r){var i,n;do{for(i=M.alloc(0);8*i.length<e.bitLength();)t.v=o(r,t.k).update(t.v).digest(),i=M.concat([i,t.v])}while(n=P(i,e),t.k=o(r,t.k).update(t.v).update(M.from([0])).digest(),t.v=o(r,t.k).update(t.v).digest(),-1!==n.cmp(e));return n}t.exports=function(e,t,r,i,n){if((t=E(t)).curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");var o=e,s=t,a=x[s.curve.join(".")];if(a)return a=new A(a).keyFromPrivate(s.privateKey).sign(o),M.from(a.toDER());throw new Error("unknown curve "+s.curve.join("."))}if("dsa"===t.type){if("dsa"!==i)throw new Error("wrong private key type");for(var f,o=e,a=t,u=r,c=a.params.priv_key,h=a.params.p,d=a.params.q,l=a.params.g,p=new k(0),b=P(o,d).mod(d),m=!1,y=I(c,d,o,u);!1===m;)f=R(d,y,u),p=function(e,t,r,i){return e.toRed(k.mont(r)).redPow(t).fromRed().mod(i)}(l,f,h,d),0===(m=f.invm(d).imul(b.add(c.mul(p))).mod(d)).cmpn(0)&&(m=!1,p=new k(0));var s=p,r=m,g=(s=s.toArray(),r=r.toArray(),128&s[0]&&(s=[0].concat(s)),128&r[0]&&(r=[0].concat(r)),[48,s.length+r.length+4,2,s.length]);return g=g.concat(s,[2,r.length],r),M.from(g)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");e=M.concat([n,e]);for(var v=t.modulus.byteLength(),_=[0,1];e.length+_.length+1<v;)_.push(255);_.push(0);for(var w=-1;++w<e.length;)_.push(e[w]);return S(_,t)},t.exports.getKey=I,t.exports.makeKey=R},{"./curves.json":43,"bn.js":47,"browserify-rsa":39,"create-hmac":55,elliptic:68,"parse-asn1":111,"safe-buffer":48}],46:[function(e,t,r){var g=e("safe-buffer").Buffer,v=e("bn.js"),_=e("elliptic").ec,w=e("parse-asn1"),M=e("./curves.json");function S(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var o,s,a;if("ec"===(r=w(r)).type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");var f=e,u=t,c=r,h=M[c.data.algorithm.curve.join(".")];if(h)return h=new _(h),c=c.data.subjectPrivateKey.data,h.verify(u,f,c);throw new Error("unknown curve "+c.data.algorithm.curve.join("."))}if("dsa"===r.type){if("dsa"!==i)throw new Error("wrong public key type");return h=e,u=t,c=(f=r).data.p,o=r.data.q,m=r.data.g,f=r.data.pub_key,h=w.signature.decode(h,"der"),s=h.s,h=h.r,S(s,o),S(h,o),a=v.mont(c),s=s.invm(o),0===m.toRed(a).redPow(new v(u).mul(s).mod(o)).fromRed().mul(f.toRed(a).redPow(h.mul(s).mod(o)).fromRed()).mod(c).mod(o).cmp(h)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=g.concat([n,t]);for(var d=r.modulus.byteLength(),l=[1],p=0;t.length+l.length+2<d;)l.push(255),p++;l.push(0);for(var b=-1;++b<t.length;)l.push(t[b]);var l=g.from(l),m=v.mont(r.modulus),y=(e=(e=new v(e).toRed(m)).redPow(new v(r.publicExponent)),e=g.from(e.fromRed().toArray()),p<8?1:0),d=Math.min(e.length,l.length);for(e.length!==l.length&&(y=1),b=-1;++b<d;)y|=e[b]^l[b];return 0===y}},{"./curves.json":43,"bn.js":47,elliptic:68,"parse-asn1":111,"safe-buffer":48}],47:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{buffer:18,dup:40}],48:[function(e,t,r){var i=e("buffer"),n=i.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,r),r.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=n(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:49}],49:[function(j,e,B){!function(e){!function(){"use strict";var A=j("base64-js"),o=j("ieee754"),t=(B.Buffer=h,B.SlowBuffer=function(e){+e!=e&&(e=0);return h.alloc(+e)},B.INSPECT_MAX_BYTES=50,2147483647);function f(e){if(t<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return e.__proto__=h.prototype,e}function h(e,t,r){if("number"!=typeof e)return i(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}function i(e,t,r){if("string"==typeof e){var i=e,n=t;if(!h.isEncoding(n="string"==typeof n&&""!==n?n:"utf8"))throw new TypeError("Unknown encoding: "+n);var o=0|d(i,n),s=f(o);return s=(i=s.write(i,n))!==o?s.slice(0,i):s}if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer)){n=e,o=t,i=r;if(o<0||n.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(n.byteLength<o+(i||0))throw new RangeError('"length" is outside of buffer bounds');return(n=void 0===o&&void 0===i?new Uint8Array(n):void 0===i?new Uint8Array(n,o):new Uint8Array(n,o,i)).__proto__=h.prototype,n}if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');s=e.valueOf&&e.valueOf();if(null!=s&&s!==e)return h.from(s,t,r);var a=function(e){{var t,r;if(h.isBuffer(e))return t=0|c(e.length),0!==(r=f(t)).length&&e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||R(e.length)?f(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return h.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function n(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return n(e),f(e<0?0:0|c(e))}function u(e){for(var t=e.length<0?0:0|c(e.length),r=f(t),i=0;i<t;i+=1)r[i]=255&e[i];return r}function c(e){if(t<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function d(e,t){if(h.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=2<arguments.length&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return E(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return x(e).length;default:if(n)return i?-1:E(e).length;t=(""+t).toLowerCase(),n=!0}}function r(e,t,r){var i,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var o=this,s=t,a=r,f=o.length;(!a||a<0||f<a)&&(a=f);for(var u="",c=s=!s||s<0?0:s;c<a;++c)u+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(o[c]);return u;case"utf8":case"utf-8":return k(this,t,r);case"ascii":var h=this,f=t,d=r,l="";d=Math.min(h.length,d);for(var p=f;p<d;++p)l+=String.fromCharCode(127&h[p]);return l;case"latin1":case"binary":var b=this,s=t,m=r,y="";m=Math.min(b.length,m);for(var g=s;g<m;++g)y+=String.fromCharCode(b[g]);return y;case"base64":return v=this,i=r,0===(_=t)&&i===v.length?A.fromByteArray(v):A.fromByteArray(v.slice(_,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var v=t,_=r,w=this.slice(v,_),M="",S=0;S<w.length;S+=2)M+=String.fromCharCode(w[S]+256*w[S+1]);return M;default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function a(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function l(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=R(r=+r)?n?0:e.length-1:r)<0?e.length+r:r)>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=h.from(t,i)),h.isBuffer(t))return 0===t.length?-1:p(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):p(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function p(e,t,r,i,n){var o=1,s=e.length,a=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=o=2,a/=2,r/=2}function f(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n)for(var u=-1,c=r;c<s;c++)if(f(e,c)===f(t,-1===u?0:c-u)){if(c-(u=-1===u?c:u)+1===a)return u*o}else-1!==u&&(c-=c-u),u=-1;else for(c=r=s<r+a?s-a:r;0<=c;c--){for(var h=!0,d=0;d<a;d++)if(f(e,c+d)!==f(t,d)){h=!1;break}if(h)return c}return-1}function m(e,t,r,i){return I(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function y(e,t,r,i){return I(function(e,t){for(var r,i,n=[],o=0;o<e.length&&!((t-=2)<0);++o)i=e.charCodeAt(o),r=i>>8,i=i%256,n.push(i),n.push(r);return n}(t,e.length-r),e,r,i)}function k(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n<r;){var o,s,a,f,u=e[n],c=null,h=239<u?4:223<u?3:191<u?2:1;if(n+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[n+1]))&&127<(f=(31&u)<<6|63&o)&&(c=f);break;case 3:o=e[n+1],s=e[n+2],128==(192&o)&&128==(192&s)&&2047<(f=(15&u)<<12|(63&o)<<6|63&s)&&(f<55296||57343<f)&&(c=f);break;case 4:o=e[n+1],s=e[n+2],a=e[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(f=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)&&f<1114112&&(c=f)}null===c?(c=65533,h=1):65535<c&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),n+=h}var d=i,l=d.length;if(l<=g)return String.fromCharCode.apply(String,d);for(var p="",b=0;b<l;)p+=String.fromCharCode.apply(String,d.slice(b,b+=g));return p}B.kMaxLength=t,(h.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}())||"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."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),h.poolSize=8192,h.from=i,h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,h.alloc=function(e,t,r){return t=t,r=r,n(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?f(e).fill(t,r):f(e).fill(t):f(e)},h.allocUnsafe=s,h.allocUnsafeSlow=s,h.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==h.prototype},h.compare=function(e,t){if(P(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),P(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(e)||!h.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,i=t.length,n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},h.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return h.alloc(0);if(void 0===t)for(n=t=0;n<e.length;++n)t+=e[n].length;for(var r=h.allocUnsafe(t),i=0,n=0;n<e.length;++n){var o=e[n];if(P(o,Uint8Array)&&(o=h.from(o)),!h.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},h.byteLength=d,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)a(this,t,t+1);return this},h.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)a(this,t,t+3),a(this,t+1,t+2);return this},h.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)a(this,t,t+7),a(this,t+1,t+6),a(this,t+2,t+5),a(this,t+3,t+4);return this},h.prototype.toLocaleString=h.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?k(this,0,e):r.apply(this,arguments)},h.prototype.equals=function(e){if(h.isBuffer(e))return this===e||0===h.compare(this,e);throw new TypeError("Argument must be a Buffer")},h.prototype.inspect=function(){var e="",t=B.INSPECT_MAX_BYTES,e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim();return this.length>t&&(e+=" ... "),"<Buffer "+e+">"},h.prototype.compare=function(e,t,r,i,n){if(P(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),(t=void 0===t?0:t)<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),f=this.slice(i,n),u=e.slice(t,r),c=0;c<a;++c)if(f[c]!==u[c]){o=f[c],s=u[c];break}return o<s?-1:s<o?1:0},h.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},h.prototype.indexOf=function(e,t,r){return l(this,e,t,r,!0)},h.prototype.lastIndexOf=function(e,t,r){return l(this,e,t,r,!1)},h.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||n<r)&&(r=n),0<e.length&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,s,a,f=!1;;)switch(i){case"hex":var u=this,c=e,h=t,d=r,l=(h=Number(h)||0,u.length-h);(!d||l<(d=Number(d)))&&(d=l),(l=c.length)/2<d&&(d=l/2);for(var p=0;p<d;++p){var b=parseInt(c.substr(2*p,2),16);if(R(b))return p;u[h+p]=b}return p;case"utf8":case"utf-8":return l=t,a=r,I(E(e,(s=this).length-l),s,l,a);case"ascii":return m(this,e,t,r);case"latin1":case"binary":return m(this,e,t,r);case"base64":return s=this,a=t,o=r,I(x(e),s,a,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(f)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var g=4096;function b(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function v(e,t,r,i,n,o){if(!h.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n<t||t<o)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function _(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function w(e,t,r,i,n){return t=+t,r>>>=0,n||_(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function M(e,t,r,i,n){return t=+t,r>>>=0,n||_(e,0,r,8),o.write(e,t,r,i,52,8),r+8}h.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),t<e&&(t=e),this.subarray(e,t));return r.__proto__=h.prototype,r},h.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var i=this[e],n=1,o=0;++o<t&&(n*=256);)i+=this[e+o]*n;return i},h.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var i=this[e+--t],n=1;0<t&&(n*=256);)i+=this[e+--t]*n;return i},h.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},h.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},h.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var i=this[e],n=1,o=0;++o<t&&(n*=256);)i+=this[e+o]*n;return(n*=128)<=i&&(i-=Math.pow(2,8*t)),i},h.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0<i&&(n*=256);)o+=this[e+--i]*n;return(n*=128)<=o&&(o-=Math.pow(2,8*t)),o},h.prototype.readInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},h.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},h.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),o.read(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),o.read(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),o.read(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),o.read(this,e,!1,52,8)},h.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||v(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o<r&&(n*=256);)this[t+o]=e/n&255;return t+r},h.prototype.writeUIntBE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||v(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},h.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,1,255,0),this[t]=255&e,t+1},h.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},h.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeIntLE=function(e,t,r,i){e=+e,t>>>=0,i||v(this,e,t,r,(i=Math.pow(2,8*r-1))-1,-i);var n=0,o=1,s=0;for(this[t]=255&e;++n<r&&(o*=256);)e<0&&0===s&&0!==this[t+n-1]&&(s=1),this[t+n]=(e/o>>0)-s&255;return t+r},h.prototype.writeIntBE=function(e,t,r,i){e=+e,t>>>=0,i||v(this,e,t,r,(i=Math.pow(2,8*r-1))-1,-i);var n=r-1,o=1,s=0;for(this[t+n]=255&e;0<=--n&&(o*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/o>>0)-s&255;return t+r},h.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},h.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},h.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeFloatLE=function(e,t,r){return w(this,e,t,!0,r)},h.prototype.writeFloatBE=function(e,t,r){return w(this,e,t,!1,r)},h.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},h.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},h.prototype.copy=function(e,t,r,i){if(!h.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),(i=0<i&&i<r?r:i)===r)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length);var n=(i=e.length-t<i-r?e.length-t+r:i)-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,i);else if(this===e&&r<t&&t<i)for(var o=n-1;0<=o;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return n},h.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!h.isEncoding(i))throw new TypeError("Unknown encoding: "+i);var n;1===e.length&&(n=e.charCodeAt(0),("utf8"===i&&n<128||"latin1"===i)&&(e=n))}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");var o;if(!(r<=t))if(t>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o<r;++o)this[o]=e;else{var s=h.isBuffer(e)?e:h.from(e,i),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var S=/[^+/0-9A-Za-z-_]/g;function E(e,t){t=t||1/0;for(var r,i=e.length,n=null,o=[],s=0;s<i;++s){if(55295<(r=e.charCodeAt(s))&&r<57344){if(!n){if(56319<r){-1<(t-=3)&&o.push(239,191,189);continue}if(s+1===i){-1<(t-=3)&&o.push(239,191,189);continue}n=r;continue}if(r<56320){-1<(t-=3)&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&-1<(t-=3)&&o.push(239,191,189);if(n=null,r<128){if(--t<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function x(e){return A.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function I(e,t,r,i){for(var n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function R(e){return e!=e}}.call(this)}.call(this,j("buffer").Buffer)},{"base64-js":15,buffer:49,ieee754:101}],50:[function(e,t,r){!function(o){!function(){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new o(r),n=0;n<r;++n)i[n]=e[n]^t[n];return i}}.call(this)}.call(this,e("buffer").Buffer)},{buffer:49}],51:[function(e,t,r){var i=e("safe-buffer").Buffer,n=e("stream").Transform,o=e("string_decoder").StringDecoder;function s(e){n.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(s,n),s.prototype.update=function(e,t,r){"string"==typeof e&&(e=i.from(e,t));t=this._update(e);return this.hashMode?this:r?this._toString(t,r):t},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||i.alloc(0);return t=e?this._toString(t,e,!0):t},s.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");t=this._decoder.write(e);return r&&(t+=this._decoder.end()),t},t.exports=s},{inherits:102,"safe-buffer":143,stream:153,string_decoder:154}],52:[function(e,a,t){!function(s){!function(){var t=e("elliptic"),r=e("bn.js"),i=(a.exports=function(e){return new n(e)},{secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}});function n(e){this.curveType=i[e],this.curveType||(this.curveType={name:e}),this.curve=new t.ec(this.curveType.name),this.keys=void 0}function o(e,t,r){Array.isArray(e)||(e=e.toArray());e=new s(e);return r&&e.length<r&&((r=new s(r-e.length)).fill(0),e=s.concat([r,e])),t?e.toString(t):e}i.p224=i.secp224r1,i.p256=i.secp256r1=i.prime256v1,i.p192=i.secp192r1=i.prime192v1,i.p384=i.secp384r1,i.p521=i.secp521r1,n.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},n.prototype.computeSecret=function(e,t,r){return t=t||"utf8",s.isBuffer(e)||(e=new s(e,t)),o(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},n.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),o(r,e)},n.prototype.getPrivateKey=function(e){return o(this.keys.getPrivate(),e)},n.prototype.setPublicKey=function(e,t){return t=t||"utf8",s.isBuffer(e)||(e=new s(e,t)),this.keys._importPublic(e),this},n.prototype.setPrivateKey=function(e,t){t=t||"utf8",s.isBuffer(e)||(e=new s(e,t));t=(t=new r(e)).toString(16);return this.keys=this.curve.genKeyPair(),this.keys._importPrivate(t),this}}.call(this)}.call(this,e("buffer").Buffer)},{"bn.js":16,buffer:49,elliptic:68}],53:[function(e,t,r){"use strict";var i=e("inherits"),n=e("md5.js"),o=e("ripemd160"),s=e("sha.js"),a=e("cipher-base");function f(e){a.call(this,"digest"),this._hash=e}i(f,a),f.prototype._update=function(e){this._hash.update(e)},f.prototype._final=function(){return this._hash.digest()},t.exports=function(e){return"md5"===(e=e.toLowerCase())?new n:"rmd160"===e||"ripemd160"===e?new o:new f(s(e))}},{"cipher-base":51,inherits:102,"md5.js":103,ripemd160:142,"sha.js":146}],54:[function(e,t,r){var i=e("md5.js");t.exports=function(e){return(new i).update(e).digest()}},{"md5.js":103}],55:[function(e,t,r){"use strict";var i=e("inherits"),n=e("./legacy"),s=e("cipher-base"),a=e("safe-buffer").Buffer,o=e("create-hash/md5"),f=e("ripemd160"),u=e("sha.js"),c=a.alloc(128);function h(e,t){s.call(this,"digest"),"string"==typeof t&&(t=a.from(t));for(var r="sha512"===e||"sha384"===e?128:64,i=(this._alg=e,(this._key=t).length>r?t=("rmd160"===e?new f:u(e)).update(t).digest():t.length<r&&(t=a.concat([t,c],r)),this._ipad=a.allocUnsafe(r)),n=this._opad=a.allocUnsafe(r),o=0;o<r;o++)i[o]=54^t[o],n[o]=92^t[o];this._hash="rmd160"===e?new f:u(e),this._hash.update(i)}i(h,s),h.prototype._update=function(e){this._hash.update(e)},h.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new f:u(this._alg)).update(this._opad).update(e).digest()},t.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new h("rmd160",t):"md5"===e?new n(o,t):new h(e,t)}},{"./legacy":56,"cipher-base":51,"create-hash/md5":54,inherits:102,ripemd160:142,"safe-buffer":143,"sha.js":146}],56:[function(e,t,r){"use strict";var i=e("inherits"),o=e("safe-buffer").Buffer,s=e("cipher-base"),a=o.alloc(128);function n(e,t){s.call(this,"digest"),"string"==typeof t&&(t=o.from(t)),this._alg=e,64<(this._key=t).length?t=e(t):t.length<64&&(t=o.concat([t,a],64));for(var r=this._ipad=o.allocUnsafe(64),i=this._opad=o.allocUnsafe(64),n=0;n<64;n++)r[n]=54^t[n],i[n]=92^t[n];this._hash=[r]}i(n,s),n.prototype._update=function(e){this._hash.push(e)},n.prototype._final=function(){var e=this._alg(o.concat(this._hash));return this._alg(o.concat([this._opad,e]))},t.exports=n},{"cipher-base":51,inherits:102,"safe-buffer":143}],57:[function(e,t,r){"use strict";r.randomBytes=r.rng=r.pseudoRandomBytes=r.prng=e("randombytes"),r.createHash=r.Hash=e("create-hash"),r.createHmac=r.Hmac=e("create-hmac");var i=e("browserify-sign/algos"),i=Object.keys(i),n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i),i=(r.getHashes=function(){return n},e("pbkdf2")),i=(r.pbkdf2=i.pbkdf2,r.pbkdf2Sync=i.pbkdf2Sync,e("browserify-cipher")),i=(r.Cipher=i.Cipher,r.createCipher=i.createCipher,r.Cipheriv=i.Cipheriv,r.createCipheriv=i.createCipheriv,r.Decipher=i.Decipher,r.createDecipher=i.createDecipher,r.Decipheriv=i.Decipheriv,r.createDecipheriv=i.createDecipheriv,r.getCiphers=i.getCiphers,r.listCiphers=i.listCiphers,e("diffie-hellman")),i=(r.DiffieHellmanGroup=i.DiffieHellmanGroup,r.createDiffieHellmanGroup=i.createDiffieHellmanGroup,r.getDiffieHellman=i.getDiffieHellman,r.createDiffieHellman=i.createDiffieHellman,r.DiffieHellman=i.DiffieHellman,e("browserify-sign")),i=(r.createSign=i.createSign,r.Sign=i.Sign,r.createVerify=i.createVerify,r.Verify=i.Verify,r.createECDH=e("create-ecdh"),e("public-encrypt")),i=(r.publicEncrypt=i.publicEncrypt,r.privateEncrypt=i.privateEncrypt,r.publicDecrypt=i.publicDecrypt,r.privateDecrypt=i.privateDecrypt,e("randomfill"));r.randomFill=i.randomFill,r.randomFillSync=i.randomFillSync,r.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},r.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":36,"browserify-sign":44,"browserify-sign/algos":41,"create-ecdh":52,"create-hash":53,"create-hmac":55,"diffie-hellman":64,pbkdf2:112,"public-encrypt":119,randombytes:125,randomfill:126}],58:[function(e,t,r){"use strict";r.utils=e("./des/utils"),r.Cipher=e("./des/cipher"),r.DES=e("./des/des"),r.CBC=e("./des/cbc"),r.EDE=e("./des/ede")},{"./des/cbc":59,"./des/cipher":60,"./des/des":61,"./des/ede":62,"./des/utils":63}],59:[function(e,t,r){"use strict";var i=e("minimalistic-assert"),o=e("inherits"),s={};function n(e){i.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}r.instantiate=function(t){function r(e){t.call(this,e),this._cbcInit()}o(r,t);for(var e=Object.keys(s),i=0;i<e.length;i++){var n=e[i];r.prototype[n]=s[n]}return r.create=function(e){return new r(e)},r},s._cbcInit=function(){var e=new n(this.options.iv);this._cbcState=e},s._update=function(e,t,r,i){var n=this._cbcState,o=this.constructor.super_.prototype,s=n.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=e[t+a];o._update.call(this,s,0,r,i);for(a=0;a<this.blockSize;a++)s[a]=r[i+a]}else{o._update.call(this,e,t,r,i);for(a=0;a<this.blockSize;a++)r[i+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=e[t+a]}}},{inherits:102,"minimalistic-assert":105}],60:[function(e,t,r){"use strict";var i=e("minimalistic-assert");function n(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}(t.exports=n).prototype._init=function(){},n.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},n.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),i=0;i<r;i++)this.buffer[this.bufferOff+i]=e[t+i];return this.bufferOff+=r,r},n.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},n.prototype._updateEncrypt=function(e){for(var t=0,r=0,i=(this.bufferOff+e.length)/this.blockSize|0,n=new Array(i*this.blockSize),o=(0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(n,r))),e.length-(e.length-t)%this.blockSize);t<o;t+=this.blockSize)this._update(e,t,n,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return n},n.prototype._updateDecrypt=function(e){for(var t=0,r=0,i=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,n=new Array(i*this.blockSize);0<i;i--)t+=this._buffer(e,t),r+=this._flushBuffer(n,r);return t+=this._buffer(e,t),n},n.prototype.final=function(e){var t;return e&&(t=this.update(e)),e="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(e):e},n.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},n.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},n.prototype._unpad=function(e){return e},n.prototype._finalDecrypt=function(){i.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},{"minimalistic-assert":105}],61:[function(e,t,r){"use strict";var s=e("minimalistic-assert"),i=e("inherits"),c=e("./utils"),n=e("./cipher");function o(){this.tmp=new Array(2),this.keys=null}function a(e){n.call(this,e);var t=new o;this._desState=t,this.deriveKeys(t,e.key)}i(a,n),(t.exports=a).create=function(e){return new a(e)};var f=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];a.prototype.deriveKeys=function(e,t){e.keys=new Array(32),s.equal(t.length,this.blockSize,"Invalid key length");var r=c.readUInt32BE(t,0),i=c.readUInt32BE(t,4);c.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var n=0;n<e.keys.length;n+=2){var o=f[n>>>1],r=c.r28shl(r,o),i=c.r28shl(i,o);c.pc2(r,i,e.keys,n)}},a.prototype._update=function(e,t,r,i){var n=this._desState,o=c.readUInt32BE(e,t),e=c.readUInt32BE(e,t+4);c.ip(o,e,n.tmp,0),o=n.tmp[0],e=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,e,n.tmp,0):this._decrypt(n,o,e,n.tmp,0),o=n.tmp[0],e=n.tmp[1],c.writeUInt32BE(r,o,i),c.writeUInt32BE(r,e,i+4)},a.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i<e.length;i++)e[i]=r;return!0},a.prototype._unpad=function(e){for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)s.equal(e[r],t);return e.slice(0,e.length-t)},a.prototype._encrypt=function(e,t,r,i,n){for(var o=t,s=r,a=0;a<e.keys.length;a+=2)var f=e.keys[a],u=e.keys[a+1],f=(c.expand(s,e.tmp,0),f^=e.tmp[0],u^=e.tmp[1],c.substitute(f,u)),u=s,s=(o^c.permute(f))>>>0,o=u;c.rip(s,o,i,n)},a.prototype._decrypt=function(e,t,r,i,n){for(var o=r,s=t,a=e.keys.length-2;0<=a;a-=2)var f=e.keys[a],u=e.keys[a+1],f=(c.expand(o,e.tmp,0),f^=e.tmp[0],u^=e.tmp[1],c.substitute(f,u)),u=o,o=(s^c.permute(f))>>>0,s=u;c.rip(o,s,i,n)}},{"./cipher":60,"./utils":63,inherits:102,"minimalistic-assert":105}],62:[function(e,t,r){"use strict";var n=e("minimalistic-assert"),i=e("inherits"),o=e("./cipher"),s=e("./des");function a(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),t=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:t})]:[s.create({type:"decrypt",key:t}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function f(e){o.call(this,e);e=new a(this.type,this.options.key);this._edeState=e}i(f,o),(t.exports=f).create=function(e){return new f(e)},f.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},f.prototype._pad=s.prototype._pad,f.prototype._unpad=s.prototype._unpad},{"./cipher":60,"./des":61,inherits:102,"minimalistic-assert":105}],63:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var n=0,o=0,s=6;0<=s;s-=2){for(var a=0;a<=24;a+=8)n=n<<1|t>>>a+s&1;for(a=0;a<=24;a+=8)n=n<<1|e>>>a+s&1}for(s=6;0<=s;s-=2){for(a=1;a<=25;a+=8)o=o<<1|t>>>a+s&1;for(a=1;a<=25;a+=8)o=o<<1|e>>>a+s&1}r[i+0]=n>>>0,r[i+1]=o>>>0},r.rip=function(e,t,r,i){for(var n=0,o=0,s=0;s<4;s++)for(var a=24;0<=a;a-=8)n=(n=n<<1|t>>>a+s&1)<<1|e>>>a+s&1;for(s=4;s<8;s++)for(a=24;0<=a;a-=8)o=(o=o<<1|t>>>a+s&1)<<1|e>>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.pc1=function(e,t,r,i){for(var n=0,o=0,s=7;5<=s;s--){for(var a=0;a<=24;a+=8)n=n<<1|t>>a+s&1;for(a=0;a<=24;a+=8)n=n<<1|e>>a+s&1}for(a=0;a<=24;a+=8)n=n<<1|t>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o=o<<1|t>>a+s&1;for(a=0;a<=24;a+=8)o=o<<1|e>>a+s&1}for(a=0;a<=24;a+=8)o=o<<1|e>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};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],n=(r.pc2=function(e,t,r,i){for(var n=0,o=0,s=f.length>>>1,a=0;a<s;a++)n=n<<1|e>>>f[a]&1;for(a=s;a<f.length;a++)o=o<<1|t>>>f[a]&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.expand=function(e,t,r){for(var i=0,n=0,i=(1&e)<<5|e>>>27,o=23;15<=o;o-=4)i=i<<6|e>>>o&63;for(o=11;3<=o;o-=4)n=(n|e>>>o&63)<<6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0},[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]),i=(r.substitute=function(e,t){for(var r=0,i=0;i<4;i++)r=r<<4|n[64*i+(e>>>18-6*i&63)];for(i=0;i<4;i++)r=r<<4|n[256+64*i+(t>>>18-6*i&63)];return r>>>0},[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7]);r.permute=function(e){for(var t=0,r=0;r<i.length;r++)t=t<<1|e>>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.length<t;)i="0"+i;for(var n=[],o=0;o<t;o+=r)n.push(i.slice(o,o+r));return n.join(" ")}},{}],64:[function(e,t,i){!function(f){!function(){var o=e("./lib/generatePrime"),r=e("./lib/primes.json"),s=e("./lib/dh");var a={binary:!0,hex:!0,base64:!0};i.DiffieHellmanGroup=i.createDiffieHellmanGroup=i.getDiffieHellman=function(e){var t=new f(r[e].prime,"hex"),e=new f(r[e].gen,"hex");return new s(t,e)},i.createDiffieHellman=i.DiffieHellman=function e(t,r,i,n){return f.isBuffer(r)||void 0===a[r]?e(t,"binary",r,i):(r=r||"binary",n=n||"binary",i=i||new f([2]),f.isBuffer(i)||(i=new f(i,n)),"number"==typeof t?new s(o(t,i),i,!0):(f.isBuffer(t)||(t=new f(t,r)),new s(t,i,!0)))}}.call(this)}.call(this,e("buffer").Buffer)},{"./lib/dh":65,"./lib/generatePrime":66,"./lib/primes.json":67,buffer:49}],65:[function(b,m,e){!function(p){!function(){var i=b("bn.js"),o=new(b("miller-rabin")),s=new i(24),a=new i(11),f=new i(10),u=new i(3),c=new i(7),h=b("./generatePrime"),e=b("randombytes");function n(e,t){return t=t||"utf8",p.isBuffer(e)||(e=new p(e,t)),this._pub=new i(e),this}function d(e,t){return t=t||"utf8",p.isBuffer(e)||(e=new p(e,t)),this._priv=new i(e),this}m.exports=t;var l={};function t(e,t,r){this.setGenerator(t),this.__prime=new i(e),this._prime=i.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=n,this.setPrivateKey=d):this._primeCode=8}function r(e,t){e=new p(e.toArray());return t?e.toString(t):e}Object.defineProperty(t.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=[t=t.toString("hex"),e.toString(16)].join("_");if(r in l)return l[r];var i,n=0;if(e.isEven()||!h.simpleSieve||!h.fermatTest(e)||!o.test(e))return l[r]=n=n+1+("02"===t||"05"===t?8:4);switch(o.test(e.shrn(1))||(n+=2),t){case"02":e.mod(s).cmp(a)&&(n+=8);break;case"05":(i=e.mod(f)).cmp(u)&&i.cmp(c)&&(n+=8);break;default:n+=4}return l[r]=n}(this.__prime,this.__gen)),this._primeCode}}),t.prototype.generateKeys=function(){return this._priv||(this._priv=new i(e(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},t.prototype.computeSecret=function(e){var e=(e=(e=new i(e)).toRed(this._prime)).redPow(this._priv).fromRed(),e=new p(e.toArray()),t=this.getPrime();return e.length<t.length&&((t=new p(t.length-e.length)).fill(0),e=p.concat([t,e])),e},t.prototype.getPublicKey=function(e){return r(this._pub,e)},t.prototype.getPrivateKey=function(e){return r(this._priv,e)},t.prototype.getPrime=function(e){return r(this.__prime,e)},t.prototype.getGenerator=function(e){return r(this._gen,e)},t.prototype.setGenerator=function(e,t){return t=t||"utf8",p.isBuffer(e)||(e=new p(e,t)),this.__gen=e,this._gen=new i(e),this}}.call(this)}.call(this,b("buffer").Buffer)},{"./generatePrime":66,"bn.js":16,buffer:49,"miller-rabin":104,randombytes:125}],66:[function(e,t,r){var n=e("randombytes"),o=((t.exports=i).simpleSieve=m,i.fermatTest=y,e("bn.js")),s=new o(24),a=new(e("miller-rabin")),f=new o(1),u=new o(2),c=new o(5),h=(new o(16),new o(8),new o(10)),d=new o(3),l=(new o(7),new o(11)),p=new o(4),b=(new o(12),null);function m(e){for(var t=function(){if(null!==b)return b;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var i=Math.ceil(Math.sqrt(r)),n=0;n<t&&e[n]<=i&&r%e[n]!=0;n++);t!==n&&e[n]<=i||(e[t++]=r)}return b=e}(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function y(e){var t=o.mont(e);return 0===u.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function i(e,t){if(e<16)return new o(2===t||5===t?[140,123]:[140,39]);var r,i;for(t=new o(t);;){for(r=new o(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(f),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;r.mod(h).cmp(d);)r.iadd(p)}else for(;r.mod(s).cmp(l);)r.iadd(p);if(m(i=r.shrn(1))&&m(r)&&y(i)&&y(r)&&a.test(i)&&a.test(r))return r}}},{"bn.js":16,"miller-rabin":104,randombytes:125}],67:[function(e,t,r){t.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"}}},{}],68:[function(e,t,r){"use strict";r.version=e("../package.json").version,r.utils=e("./elliptic/utils"),r.rand=e("brorand"),r.curve=e("./elliptic/curve"),r.curves=e("./elliptic/curves"),r.ec=e("./elliptic/ec"),r.eddsa=e("./elliptic/eddsa")},{"../package.json":83,"./elliptic/curve":71,"./elliptic/curves":74,"./elliptic/ec":75,"./elliptic/eddsa":78,"./elliptic/utils":82,brorand:17}],69:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../utils"),k=n.getNAF,E=n.getJSF,h=n.assert;function o(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;e=this.n&&this.p.div(this.n);!e||0<e.cmpn(100)?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function s(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=o).prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){h(e.precomputed);for(var r=e._getDoubles(),i=k(t,1,this._bitLength),e=(1<<r.step+1)-(r.step%2==0?2:1),n=(e/=3,[]),o=0;o<i.length;o+=r.step){for(var s=0,a=o+r.step-1;o<=a;a--)s=(s<<1)+i[a];n.push(s)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),c=e;0<c;c--){for(o=0;o<n.length;o++)(s=n[o])===c?u=u.mixedAdd(r.points[o]):s===-c&&(u=u.mixedAdd(r.points[o].neg()));f=f.add(u)}return f.toP()},o.prototype._wnafMul=function(e,t){for(var r=e._getNAFPoints(4),i=r.wnd,n=r.points,o=k(t,i,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;0<=a;a--){for(var f=0;0<=a&&0===o[a];a--)f++;if(0<=a&&f++,s=s.dblp(f),a<0)break;var u=o[a];h(0!==u),s="affine"===e.type?0<u?s.mixedAdd(n[u-1>>1]):s.mixedAdd(n[-u-1>>1].neg()):0<u?s.add(n[u-1>>1]):s.add(n[-u-1>>1].neg())}return"affine"===e.type?s.toP():s},o.prototype._wnafMulAdd=function(e,t,r,i,n){for(var o=this._wnafT1,s=this._wnafT2,a=this._wnafT3,f=0,u=0;u<i;u++){var c,h=(c=t[u])._getNAFPoints(e);o[u]=h.wnd,s[u]=h.points}for(u=i-1;1<=u;u-=2){var d=u-1,l=u;if(1!==o[d]||1!==o[l])a[d]=k(r[d],o[d],this._bitLength),a[l]=k(r[l],o[l],this._bitLength),f=Math.max(a[d].length,f),f=Math.max(a[l].length,f);else{var p=[t[d],null,null,t[l]],b=(0===t[d].y.cmp(t[l].y)?(p[1]=t[d].add(t[l]),p[2]=t[d].toJ().mixedAdd(t[l].neg())):0===t[d].y.cmp(t[l].y.redNeg())?(p[1]=t[d].toJ().mixedAdd(t[l]),p[2]=t[d].add(t[l].neg())):(p[1]=t[d].toJ().mixedAdd(t[l]),p[2]=t[d].toJ().mixedAdd(t[l].neg())),[-3,-1,-5,-7,0,7,5,1,3]),m=E(r[d],r[l]),f=Math.max(m[0].length,f);for(a[d]=new Array(f),a[l]=new Array(f),S=0;S<f;S++){var y=0|m[0][S],g=0|m[1][S];a[d][S]=b[3*(1+y)+(1+g)],a[l][S]=0,s[d]=p}}}var v=this.jpoint(null,null,null),_=this._wnafT4;for(u=f;0<=u;u--){for(var w=0;0<=u;){for(var M=!0,S=0;S<i;S++)_[S]=0|a[S][u],0!==_[S]&&(M=!1);if(!M)break;w++,u--}if(0<=u&&w++,v=v.dblp(w),u<0)break;for(S=0;S<i;S++){var A=_[S];0!==A&&(0<A?c=s[S][A-1>>1]:A<0&&(c=s[S][-A-1>>1].neg()),v="affine"===c.type?v.mixedAdd(c):v.add(c))}}for(u=0;u<i;u++)s[u]=null;return n?v:v.toP()},(o.BasePoint=s).prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(e,t){e=n.toArray(e,t);t=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*t)return 6===e[0]?h(e[e.length-1]%2==0):7===e[0]&&h(e[e.length-1]%2==1),this.point(e.slice(1,1+t),e.slice(1+t,1+2*t));if(2!==e[0]&&3!==e[0]||e.length-1!==t)throw new Error("Unknown point format");return this.pointFromX(e.slice(1,1+t),3===e[0])},s.prototype.encodeCompressed=function(e){return this.encode(e,!0)},s.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},s.prototype.encode=function(e,t){return n.encode(this._encode(t),e)},s.prototype.precompute=function(e){var t;return this.precomputed||((t={doubles:null,naf:null,beta:null}).naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t),this},s.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},s.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var o=0;o<e;o++)i=i.dbl();r.push(i)}return{step:e,points:r}},s.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1==r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},{"../utils":82,"bn.js":16}],70:[function(e,t,r){"use strict";var i=e("../utils"),o=e("bn.js"),n=e("inherits"),s=e("./base"),a=i.assert;function f(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function u(e,t,r,i,n){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(t,16),this.y=new o(r,16),this.z=i?new o(i,16):this.curve.one,this.t=n&&new o(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}n(f,s),(t.exports=f).prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},f.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},f.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},f.prototype.pointFromX=function(e,t){var r=(e=(e=new o(e,16)).red?e:e.toRed(this.red)).redSqr(),i=this.c2.redSub(this.a.redMul(r)),r=this.one.redSub(this.c2.redMul(this.d).redMul(r)),i=i.redMul(r.redInvm()),r=i.redSqrt();if(0!==r.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},f.prototype.pointFromY=function(e,t){var r=(e=(e=new o(e,16)).red?e:e.toRed(this.red)).redSqr(),i=r.redSub(this.c2),r=r.redMul(this.d).redMul(this.c2).redSub(this.a),i=i.redMul(r.redInvm());if(0===i.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}r=i.redSqrt();if(0!==r.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");return r.fromRed().isOdd()!==t&&(r=r.redNeg()),this.point(r,e)},f.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),e=e.y.redSqr(),r=t.redMul(this.a).redAdd(e),t=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(e)));return 0===r.cmp(t)},n(u,s.BasePoint),f.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},f.prototype.point=function(e,t,r,i){return new u(this,e,t,r,i)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=(r=this.z.redSqr()).redIAdd(r),i=this.curve._mulA(e),e=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),n=i.redAdd(t),r=n.redSub(r),i=i.redSub(t),t=e.redMul(r),o=n.redMul(i),e=e.redMul(i),i=r.redMul(n);return this.curve.point(t,o,i,e)},u.prototype._projDbl=function(){var e,t,r,i,n,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),f=this.y.redSqr();return o=this.curve.twisted?(o=(n=this.curve._mulA(a)).redAdd(f),this.zOne?(e=s.redSub(a).redSub(f).redMul(o.redSub(this.curve.two)),t=o.redMul(n.redSub(f)),o.redSqr().redSub(o).redSub(o)):(r=this.z.redSqr(),i=o.redSub(r).redISub(r),e=s.redSub(a).redISub(f).redMul(i),t=o.redMul(n.redSub(f)),o.redMul(i))):(n=a.redAdd(f),r=this.curve._mulC(this.z).redSqr(),i=n.redSub(r).redSub(r),e=this.curve._mulC(s.redISub(n)).redMul(i),t=this.curve._mulC(n).redMul(a.redISub(f)),n.redMul(i)),this.curve.point(e,t,o)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),e=this.z.redMul(e.z.redAdd(e.z)),n=r.redSub(t),o=e.redSub(i),e=e.redAdd(i),i=r.redAdd(t),r=n.redMul(o),t=e.redMul(i),n=n.redMul(i),i=o.redMul(e);return this.curve.point(r,t,i,n)},u.prototype._projAdd=function(e){var t,r=this.z.redMul(e.z),i=r.redSqr(),n=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(n).redMul(o),a=i.redSub(s),i=i.redAdd(s),s=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(o),e=r.redMul(a).redMul(s),s=this.curve.twisted?(t=r.redMul(i).redMul(o.redSub(this.curve._mulA(n))),a.redMul(i)):(t=r.redMul(i).redMul(o.redSub(n)),this.curve._mulC(a).redMul(i));return this.curve.point(e,t,s)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){var e;return this.zOne||(e=this.z.redInvm(),this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0),this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},{"../utils":82,"./base":69,"bn.js":16,inherits:102}],71:[function(e,t,r){"use strict";r.base=e("./base"),r.short=e("./short"),r.mont=e("./mont"),r.edwards=e("./edwards")},{"./base":69,"./edwards":70,"./mont":72,"./short":73}],72:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("inherits"),o=e("./base"),s=e("../utils");function a(e){o.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,o),(t.exports=a).prototype.validate=function(e){var e=e.normalize().x,t=e.redSqr(),t=t.redMul(e).redAdd(t.redMul(this.a)).redAdd(e);return 0===t.redSqrt().redSqr().cmp(t)},n(f,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new f(this,e,t)},a.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(e,t){return new f(e,t[0],t[1]||e.one)},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),e=e.redMul(t),t=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(e,t)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),e=e.x.redSub(e.z).redMul(r),r=n.redMul(i),n=t.z.redMul(e.redAdd(r).redSqr()),i=t.x.redMul(e.redISub(r).redSqr());return this.curve.point(n,i)},f.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;0<=o;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":82,"./base":69,"bn.js":16,inherits:102}],73:[function(e,t,r){"use strict";var i=e("../utils"),v=e("bn.js"),n=e("inherits"),o=e("./base"),s=i.assert;function a(e){o.call(this,"short",e),this.a=new v(e.a,16).toRed(this.red),this.b=new v(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function f(e,t,r,i){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new v(t,16),this.y=new v(r,16),i&&(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 u(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new v(0)):(this.x=new v(t,16),this.y=new v(r,16),this.z=new v(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}n(a,o),(t.exports=a).prototype._getEndomorphism=function(e){var t,r,i;if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3))return r=(e.beta?new v(e.beta,16):r=(r=this._getEndoRoots(this.p))[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red),e.lambda?t=new v(e.lambda,16):(i=this._getEndoRoots(this.n),0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(r))?t=i[0]:(t=i[1],s(0===this.g.mul(t).x.cmp(this.g.x.redMul(r))))),{beta:r,lambda:t,basis:e.basis?e.basis.map(function(e){return{a:new v(e.a,16),b:new v(e.b,16)}}):this._getEndoBasis(t)}},a.prototype._getEndoRoots=function(e){var e=e===this.p?this.red:v.mont(e),t=new v(2).toRed(e).redInvm(),r=t.redNeg(),e=new v(3).toRed(e).redNeg().redSqrt().redMul(t);return[r.redAdd(e).fromRed(),r.redSub(e).fromRed()]},a.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),a=e,f=this.n.clone(),u=new v(1),c=new v(0),h=new v(0),d=new v(1),l=0;0!==a.cmpn(0);){var p=f.div(a),b=f.sub(p.mul(a)),m=h.sub(p.mul(u)),p=d.sub(p.mul(c));if(!i&&b.cmp(s)<0)t=o.neg(),r=u,i=b.neg(),n=m;else if(i&&2==++l)break;f=a,a=o=b,h=u,u=m,d=c,c=p}var e=b.neg(),y=m,g=i.sqr().add(n.sqr());return 0<=e.sqr().add(y.sqr()).cmp(g)&&(e=t,y=r),i.negative&&(i=i.neg(),n=n.neg()),e.negative&&(e=e.neg(),y=y.neg()),[{a:i,b:n},{a:e,b:y}]},a.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],t=t[1],i=t.b.mul(e).divRound(this.n),n=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),s=n.mul(t.a),i=i.mul(r.b),r=n.mul(t.b);return{k1:e.sub(o).sub(s),k2:i.add(r).neg()}},a.prototype.pointFromX=function(e,t){var r=(e=(e=new v(e,16)).red?e:e.toRed(this.red)).redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");r=i.fromRed().isOdd();return(t&&!r||!t&&r)&&(i=i.redNeg()),this.point(e,i)},a.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,e=e.y,r=this.a.redMul(t),t=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===e.redSqr().redISub(t).cmpn(0)},a.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],f=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),i[2*o]=a,i[2*o+1]=f,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var r=this._wnafMulAdd(1,i,n,2*o,r),u=0;u<2*o;u++)i[u]=null,n[u]=null;return r},n(f,o.BasePoint),a.prototype.point=function(e,t,r){return new f(this,e,t,r)},a.prototype.pointFromJSON=function(e,t){return f.fromJSON(this,e,t)},f.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t,r,i=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);return e&&(t=this.curve,r=function(e){return t.point(e.x.redMul(t.endo.beta),e.y)},(e.beta=i).precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}),i}},f.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},f.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);return e[2]&&(e=e[2],i.precomputed={beta:null,doubles:e.doubles&&{step:e.doubles.step,points:[i].concat(e.doubles.points.map(n))},naf:e.naf&&{wnd:e.naf.wnd,points:[i].concat(e.naf.points.map(n))}}),i;function n(e){return t.point(e[0],e[1],r)}},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y),e=(t=0!==t.cmpn(0)?t.redMul(this.x.redSub(e.x).redInvm()):t).redSqr().redISub(this.x).redISub(e.x),t=t.redMul(this.x.redSub(e)).redISub(this.y);return this.curve.point(e,t)},f.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),e=e.redInvm(),r=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(e),t=r.redSqr().redISub(this.x.redAdd(this.x)),e=r.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,e)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(e){return e=new v(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){t=[this,t],e=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(t,e):this.curve._wnafMulAdd(1,t,e,2)},f.prototype.jmulAdd=function(e,t,r){t=[this,t],e=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(t,e,!0):this.curve._wnafMulAdd(1,t,e,2,!0)},f.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},f.prototype.neg=function(e){if(this.inf)return this;var t,r=this.curve.point(this.x,this.y.redNeg());return e&&this.precomputed&&(e=this.precomputed,t=function(e){return e.neg()},r.precomputed={naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(t)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(t)}}),r},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},n(u,o.BasePoint),a.prototype.jpoint=function(e,t,r){return new u(this,e,t,r)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),t=this.y.redMul(t).redMul(e);return this.curve.point(r,t)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),t=this.y.redMul(t.redMul(e.z)),r=e.y.redMul(r.redMul(this.z)),n=i.redSub(n),r=t.redSub(r);if(0===n.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=n.redSqr(),s=o.redMul(n),i=i.redMul(o),o=r.redSqr().redIAdd(s).redISub(i).redISub(i),r=r.redMul(i.redISub(o)).redISub(t.redMul(s)),i=this.z.redMul(e.z).redMul(n);return this.curve.jpoint(o,r,i)},u.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,e=e.y.redMul(t).redMul(this.z),t=r.redSub(i),i=n.redSub(e);if(0===t.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var e=t.redSqr(),o=e.redMul(t),r=r.redMul(e),e=i.redSqr().redIAdd(o).redISub(r).redISub(r),i=i.redMul(r.redISub(e)).redISub(n.redMul(o)),r=this.z.redMul(t);return this.curve.jpoint(e,i,r)},u.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}var i=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,f=a.redSqr().redSqr(),u=s.redAdd(s);for(r=0;r<e;r++){var c=o.redSqr(),h=u.redSqr(),d=h.redSqr(),c=c.redAdd(c).redIAdd(c).redIAdd(i.redMul(f)),h=o.redMul(h),l=c.redSqr().redISub(h.redAdd(h)),h=h.redISub(l),c=(c=c.redMul(h)).redIAdd(c).redISub(d),h=u.redMul(a);r+1<e&&(f=f.redMul(d)),o=l,a=h,u=c}return this.curve.jpoint(o,u.redMul(n),a)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u.prototype._zeroDbl=function(){var e,t,r,i,n,o=this.zOne?(t=this.x.redSqr(),r=(e=this.y.redSqr()).redSqr(),e=(e=this.x.redAdd(e).redSqr().redISub(t).redISub(r)).redIAdd(e),i=(t=t.redAdd(t).redIAdd(t)).redSqr().redISub(e).redISub(e),r=(r=(r=r.redIAdd(r)).redIAdd(r)).redIAdd(r),e=t.redMul(e.redISub(t=i)).redISub(r),this.y.redAdd(this.y)):(i=this.x.redSqr(),n=(r=this.y.redSqr()).redSqr(),r=(r=this.x.redAdd(r).redSqr().redISub(i).redISub(n)).redIAdd(r),o=(i=i.redAdd(i).redIAdd(i)).redSqr(),n=(n=(n=n.redIAdd(n)).redIAdd(n)).redIAdd(n),t=o.redISub(r).redISub(r),e=i.redMul(r.redISub(t)).redISub(n),(o=this.y.redMul(this.z)).redIAdd(o));return this.curve.jpoint(t,e,o)},u.prototype._threeDbl=function(){var e,t,r,i,n,o,s,a;return this.zOne?(t=this.x.redSqr(),n=(e=this.y.redSqr()).redSqr(),e=(e=this.x.redAdd(e).redSqr().redISub(t).redISub(n)).redIAdd(e),r=i=(t=t.redAdd(t).redIAdd(t).redIAdd(this.curve.a)).redSqr().redISub(e).redISub(e),n=(n=(n=n.redIAdd(n)).redIAdd(n)).redIAdd(n),t=t.redMul(e.redISub(i)).redISub(n),e=this.y.redAdd(this.y)):(i=this.z.redSqr(),n=this.y.redSqr(),s=this.x.redMul(n),o=(o=this.x.redSub(i).redMul(this.x.redAdd(i))).redAdd(o).redIAdd(o),a=(s=(s=s.redIAdd(s)).redIAdd(s)).redAdd(s),r=o.redSqr().redISub(a),e=this.y.redAdd(this.z).redSqr().redISub(n).redISub(i),a=(a=(a=(a=n.redSqr()).redIAdd(a)).redIAdd(a)).redIAdd(a),t=o.redMul(s.redISub(r)).redISub(a)),this.curve.jpoint(r,t,e)},u.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),o=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(n)),e=t.redAdd(t),n=(e=e.redIAdd(e)).redMul(s),t=o.redSqr().redISub(n.redAdd(n)),e=n.redISub(t),n=s.redSqr(),s=(n=(n=(n=n.redIAdd(n)).redIAdd(n)).redIAdd(n),o.redMul(e).redISub(n)),o=r.redAdd(r).redMul(i);return this.curve.jpoint(t,s,o)},u.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),o=n.redSqr(),e=this.x.redAdd(t).redSqr().redISub(e).redISub(i),s=(e=(e=(e=e.redIAdd(e)).redAdd(e).redIAdd(e)).redISub(o)).redSqr(),i=i.redIAdd(i),n=(i=(i=(i=i.redIAdd(i)).redIAdd(i)).redIAdd(i),n.redIAdd(e).redSqr().redISub(o).redISub(s).redISub(i)),o=t.redMul(n),t=(o=(o=o.redIAdd(o)).redIAdd(o),this.x.redMul(s).redISub(o)),o=(t=(t=t.redIAdd(t)).redIAdd(t),this.y.redMul(n.redMul(i.redISub(n)).redISub(e.redMul(s)))),i=(o=(o=(o=o.redIAdd(o)).redIAdd(o)).redIAdd(o),this.z.redAdd(e).redSqr().redISub(r).redISub(s));return this.curve.jpoint(t,o,i)},u.prototype.mul=function(e,t){return e=new v(e,t),this.curve._wnafMul(this,e)},u.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;t=t.redMul(this.z),r=r.redMul(e.z);return 0===this.y.redMul(r).redISub(e.y.redMul(t)).cmpn(0)},u.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),0<=i.cmp(this.curve.p))return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":82,"./base":69,"bn.js":16,inherits:102}],74:[function(e,t,r){"use strict";var i,n=r,r=e("hash.js"),o=e("./curve"),s=e("./utils").assert;function a(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new a(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=a,f("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:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:r.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"]}),f("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:r.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),f("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:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}f("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:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"./curve":71,"./precomputed/secp256k1":81,"./utils":82,"hash.js":88}],75:[function(e,t,r){"use strict";var d=e("bn.js"),l=e("hmac-drbg"),i=e("../utils"),n=e("../curves"),o=e("brorand"),a=i.assert,s=e("./key"),p=e("./signature");function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(a(Object.prototype.hasOwnProperty.call(n,e),"Unknown curve "+e),e=n[e]),e instanceof n.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=f).prototype.keyPair=function(e){return new s(this,e)},f.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){for(var t=new l({hash:this.hash,pers:(e=e||{}).pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0<n.cmp(i)))return n.iaddn(1),this.keyFromPrivate(n)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return 0<r&&(e=e.ushrn(r)),!t&&0<=e.cmp(this.n)?e.sub(this.n):e},f.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i=i||{},t=this.keyFromPrivate(t,r),e=this._truncateToN(new d(e,16));for(var r=this.n.byteLength(),n=t.getPrivate().toArray("be",r),r=e.toArray("be",r),o=new l({hash:this.hash,entropy:n,nonce:r,pers:i.pers,persEnc:i.persEnc||"utf8"}),s=this.n.sub(new d(1)),a=0;;a++){var f=i.k?i.k(a):new d(o.generate(this.n.byteLength())),f=this._truncateToN(f,!0);if(!(f.cmpn(1)<=0||0<=f.cmp(s))){var u=this.g.mul(f);if(!u.isInfinity()){var c=u.getX(),h=c.umod(this.n);if(0!==h.cmpn(0)){f=(f=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e))).umod(this.n);if(0!==f.cmpn(0))return u=(u.getY().isOdd()?1:0)|(0!==c.cmp(h)?2:0),i.canonical&&0<f.cmp(this.nh)&&(f=this.n.sub(f),u^=1),new p({r:h,s:f,recoveryParam:u})}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new d(e,16)),r=this.keyFromPublic(r,i);i=(t=new p(t,"hex")).r,t=t.s;if(i.cmpn(1)<0||0<=i.cmp(this.n))return!1;if(t.cmpn(1)<0||0<=t.cmp(this.n))return!1;var n,t=t.invm(this.n),e=t.mul(e).umod(this.n),t=t.mul(i).umod(this.n);return this.curve._maxwellTrick?!(n=this.g.jmulAdd(e,r.getPublic(),t)).isInfinity()&&n.eqXToP(i):!(n=this.g.mulAdd(e,r.getPublic(),t)).isInfinity()&&0===n.getX().umod(this.n).cmp(i)},f.prototype.recoverPubKey=function(e,t,r,i){a((3&r)===r,"The recovery param is more than two bits"),t=new p(t,i);var i=this.n,e=new d(e),n=t.r,o=t.s,s=1&r,r=r>>1;if(0<=n.cmp(this.curve.p.umod(this.curve.n))&&r)throw new Error("Unable to find sencond key candinate");n=r?this.curve.pointFromX(n.add(this.curve.n),s):this.curve.pointFromX(n,s),r=t.r.invm(i),s=i.sub(e).mul(r).umod(i),t=o.mul(r).umod(i);return this.g.mulAdd(s,n,t)},f.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new p(t,i)).recoveryParam)return t.recoveryParam;for(var n,o=0;o<4;o++){try{n=this.recoverPubKey(e,t,o)}catch(e){continue}if(n.eq(r))return o}throw new Error("Unable to find valid recovery factor")}},{"../curves":74,"../utils":82,"./key":76,"./signature":77,"bn.js":16,brorand:17,"hmac-drbg":100}],76:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../utils").assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=o).fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":82,"bn.js":16}],77:[function(e,t,r){"use strict";var n=e("bn.js"),o=e("../utils"),i=o.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0==i||4<i)return!1;for(var n=0,o=0,s=t.place;o<i;o++,s++)n=((n<<=8)|e[s])>>>0;return!(n<=127)&&(t.place=s,n)}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function c(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=s).prototype._importDER=function(e,t){e=o.toArray(e,t);t=new a;if(48!==e[t.place++])return!1;var r=f(e,t);if(!1===r)return!1;if(r+t.place!==e.length)return!1;if(2!==e[t.place++])return!1;r=f(e,t);if(!1===r)return!1;var i=e.slice(t.place,r+t.place);if(t.place+=r,2!==e[t.place++])return!1;r=f(e,t);if(!1===r)return!1;if(e.length!==r+t.place)return!1;e=e.slice(t.place,r+t.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===e[0]){if(!(128&e[1]))return!1;e=e.slice(1)}return this.r=new n(i),this.s=new n(e),!(this.recoveryParam=null)},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2],t=(c(i,t.length),(i=i.concat(t)).push(2),c(i,r.length),i.concat(r)),i=[48];return c(i,t.length),i=i.concat(t),o.encode(i,e)}},{"../utils":82,"bn.js":16}],78:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../curves"),o=e("../utils"),s=o.assert,a=o.parseBytes,f=e("./key"),u=e("./signature");function c(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=c).prototype.sign=function(e,t){e=a(e);var t=this.keyFromSecret(t),r=this.hashInt(t.messagePrefix(),e),i=this.g.mul(r),n=this.encodePoint(i),e=this.hashInt(n,t.pubBytes(),e).mul(t.priv()),t=r.add(e).umod(this.curve.n);return this.makeSignature({R:i,S:t,Rencoded:n})},c.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var r=this.keyFromPublic(r),e=this.hashInt(t.Rencoded(),r.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(r.pub().mul(e)).eq(i)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(e){return f.fromPublic(this,e)},c.prototype.keyFromSecret=function(e){return f.fromSecret(this,e)},c.prototype.makeSignature=function(e){return e instanceof u?e:new u(this,e)},c.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},c.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),e=0!=(128&e[t]),t=o.intFromLE(r);return this.curve.pointFromY(t,e)},c.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(e){return o.intFromLE(e)},c.prototype.isPoint=function(e){return e instanceof this.pointClass}},{"../curves":74,"../utils":82,"./key":79,"./signature":80,"hash.js":88}],79:[function(e,t,r){"use strict";var i=e("../utils"),n=i.assert,o=i.parseBytes,e=i.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},e(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),e(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),e(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,t=t.slice(0,e.encodingLength);return t[0]&=248,t[r]&=127,t[r]|=64,t}),e(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),e(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),e(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),e)},s.prototype.getPublic=function(e){return i.encode(this.pubBytes(),e)},t.exports=s},{"../utils":82}],80:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../utils"),o=n.assert,e=n.cachedProperty,s=n.parseBytes;function a(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}e(a,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),e(a,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),e(a,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),e(a,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),a.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},a.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=a},{"../utils":82,"bn.js":16}],81:[function(e,t,r){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],82:[function(e,t,r){"use strict";var i=r,n=e("bn.js"),r=e("minimalistic-assert"),e=e("minimalistic-crypto-utils");i.assert=r,i.toArray=e.toArray,i.zero2=e.zero2,i.toHex=e.toHex,i.encode=e.encode,i.getNAF=function(e,t,r){for(var i=new Array(Math.max(e.bitLength(),r)+1),n=(i.fill(0),1<<t+1),o=e.clone(),s=0;s<i.length;s++){var a,f=o.andln(n-1);o.isOdd()?o.isubn(a=(n>>1)-1<f?(n>>1)-f:f):a=0,i[s]=a,o.iushrn(1)}return i},i.getJSF=function(e,t){for(var r,i=[[],[]],n=(e=e.clone(),t=t.clone(),0),o=0;0<e.cmpn(-n)||0<t.cmpn(-o);){var s,a=e.andln(3)+n&3,f=t.andln(3)+o&3;3===f&&(f=-1),s=0==(1&(a=3===a?-1:a))?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==f?a:-a,i[0].push(s),a=0==(1&f)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==a?f:-f,i[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return i},i.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(e){return"string"==typeof e?i.toArray(e,"hex"):e},i.intFromLE=function(e){return new n(e,"hex","le")}},{"bn.js":16,"minimalistic-assert":105,"minimalistic-crypto-utils":106}],83:[function(e,t,r){t.exports={_args:[["elliptic@6.5.4","C:\\Users\\manue\\Documents\\GitHub\\tool-chain"]],_from:"elliptic@6.5.4",_id:"elliptic@6.5.4",_inBundle:!1,_integrity:"sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.5.4",name:"elliptic",escapedName:"elliptic",rawSpec:"6.5.4",saveSpec:null,fetchSpec:"6.5.4"},_requiredBy:["/@ethersproject/signing-key","/browserify-sign","/create-ecdh","/eth-lib","/secp256k1","/web3-eth-accounts/eth-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",_spec:"6.5.4",_where:"C:\\Users\\manue\\Documents\\GitHub\\tool-chain",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},description:"EC cryptography",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.5.4"}},{}],84:[function(e,t,r){"use strict";var i="object"==typeof Reflect?Reflect:null,f=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};var n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(a,f){return new Promise(function(e,t){function r(e){a.removeListener(f,i),t(e)}function i(){"function"==typeof a.removeListener&&a.removeListener("error",r),e([].slice.call(arguments))}var n,o,s;m(a,f,i,{once:!0}),"error"!==f&&(o=r,s={once:!0},"function"==typeof(n=a).on&&m(n,"error",o,s))})},(s.EventEmitter=s).prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function h(e,t,r,i){var n,o;return u(r),void 0===(n=e._events)?(n=e._events=Object.create(null),e._eventsCount=0):(void 0!==n.newListener&&(e.emit("newListener",t,r.listener||r),n=e._events),o=n[t]),void 0===o?(o=n[t]=r,++e._eventsCount):("function"==typeof o?o=n[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),0<(n=c(e))&&o.length>n&&!o.warned&&(o.warned=!0,(i=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",i.emitter=e,i.type=t,i.count=o.length,r=i,console&&console.warn&&console.warn(r))),e}function d(e,t,r){e={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},t=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(e);return t.listener=r,e.wrapFn=t}function l(e,t,r){e=e._events;if(void 0===e)return[];e=e[t];{if(void 0===e)return[];if("function"==typeof e)return r?[e.listener||e]:[e];if(r){for(var i=e,n=new Array(i.length),o=0;o<n.length;++o)n[o]=i[o].listener||i[o];return n}return b(e,e.length)}}function p(e){var t=this._events;if(void 0!==t){t=t[e];if("function"==typeof t)return 1;if(void 0!==t)return t.length}return 0}function b(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function m(r,i,n,o){if("function"==typeof r.on)o.once?r.once(i,n):r.on(i,n);else{if("function"!=typeof r.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r);r.addEventListener(i,function e(t){o.once&&r.removeEventListener(i,e),n(t)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){if((o=0<t.length?t[0]:o)instanceof Error)throw o;i=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw i.context=o,i}var o=n[e];if(void 0===o)return!1;if("function"==typeof o)f(o,this,t);else for(var s=o.length,a=b(o,s),r=0;r<s;++r)f(a[r],this,t);return!0},s.prototype.on=s.prototype.addListener=function(e,t){return h(this,e,t,!1)},s.prototype.prependListener=function(e,t){return h(this,e,t,!0)},s.prototype.once=function(e,t){return u(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,d(this,e,t)),this},s.prototype.off=s.prototype.removeListener=function(e,t){var r,i,n,o,s;if(u(t),void 0!==(i=this._events)&&void 0!==(r=i[e]))if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,o=r.length-1;0<=o;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,n=o;break}if(n<0)return this;if(0===n)r.shift();else{for(var a=r,f=n;f+1<a.length;f++)a[f]=a[f+1];a.pop()}1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,s||t)}return this},s.prototype.removeAllListeners=function(e){var t,r=this._events;if(void 0!==r){if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){for(var i,n=Object.keys(r),o=0;o<n.length;++o)"removeListener"!==(i=n[o])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(o=t.length-1;0<=o;o--)this.removeListener(e,t[o])}return this},s.prototype.listeners=function(e){return l(this,e,!0)},s.prototype.rawListeners=function(e){return l(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return 0<this._eventsCount?n(this._events):[]}},{}],85:[function(e,t,r){var h=e("safe-buffer").Buffer,d=e("md5.js");t.exports=function(e,t,r,i){if(h.isBuffer(e)||(e=h.from(e,"binary")),t&&8!==(t=h.isBuffer(t)?t:h.from(t,"binary")).length)throw new RangeError("salt should be Buffer with 8 byte length");for(var n=r/8,o=h.alloc(n),s=h.alloc(i||0),a=h.alloc(0);0<n||0<i;){var f,u,c=new d,c=(c.update(a),c.update(e),t&&c.update(t),a=c.digest(),0);0<n&&(f=o.length-n,c=Math.min(n,a.length),a.copy(o,f,0,c),n-=c),c<a.length&&0<i&&(f=s.length-i,u=Math.min(i,a.length-c),a.copy(s,f,c,c+u),i-=u)}return a.fill(0),{key:o,iv:s}}},{"md5.js":103,"safe-buffer":143}],86:[function(e,t,r){"use strict";var u=e("safe-buffer").Buffer,i=e("readable-stream").Transform;function n(e){i.call(this),this._block=u.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(n,i),n.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},n.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},n.prototype.update=function(e,t){var r=e,i="Data";if(!u.isBuffer(r)&&"string"!=typeof r)throw new TypeError(i+" must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");u.isBuffer(e)||(e=u.from(e,t));for(var n=this._block,o=0;this._blockOffset+e.length-o>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)n[s++]=e[o++];this._update(),this._blockOffset=0}for(;o<e.length;)n[this._blockOffset++]=e[o++];for(var a=0,f=8*e.length;0<f;++a)this._length[a]+=f,0<(f=this._length[a]/4294967296|0)&&(this._length[a]-=4294967296*f);return this},n.prototype._update=function(){throw new Error("_update is not implemented")},n.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0);for(var r=this._blockOffset=0;r<4;++r)this._length[r]=0;return t},n.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=n},{inherits:102,"readable-stream":141,"safe-buffer":87}],87:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:49,dup:48}],88:[function(e,t,r){r.utils=e("./hash/utils"),r.common=e("./hash/common"),r.sha=e("./hash/sha"),r.ripemd=e("./hash/ripemd"),r.hmac=e("./hash/hmac"),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},{"./hash/common":89,"./hash/hmac":90,"./hash/ripemd":91,"./hash/sha":92,"./hash/utils":99}],89:[function(e,t,r){"use strict";var i=e("./utils"),n=e("minimalistic-assert");function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}(r.BlockHash=o).prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){t=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-t,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-t,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),n(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i}},{"./utils":99,"minimalistic-assert":105}],90:[function(e,t,r){"use strict";var i=e("./utils"),n=e("minimalistic-assert");function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(t,r))}(t.exports=o).prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},{"./utils":99,"minimalistic-assert":105}],91:[function(e,t,r){"use strict";var i=e("./utils"),e=e("./common"),b=i.rotl32,m=i.sum32,y=i.sum32_3,g=i.sum32_4,n=e.BlockHash;function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function v(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}i.inherits(o,n),(r.ripemd160=o).blockSize=512,o.outSize=160,o.hmacStrength=192,o.padLength=64,o.prototype._update=function(e,t){for(var r,i=c=this.h[0],n=p=this.h[1],o=l=this.h[2],s=d=this.h[3],a=h=this.h[4],f=0;f<80;f++)var u=m(b(g(c,v(f,p,l,d),e[_[f]+t],(r=f)<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838),M[f]),h),c=h,h=d,d=b(l,10),l=p,p=u,u=m(b(g(i,v(79-f,n,o,s),e[w[f]+t],(r=f)<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0),S[f]),a),i=a,a=s,s=b(o,10),o=n,n=u;u=y(this.h[1],l,s),this.h[1]=y(this.h[2],d,a),this.h[2]=y(this.h[3],h,i),this.h[3]=y(this.h[4],c,n),this.h[4]=y(this.h[0],p,o),this.h[0]=u},o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var _=[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],w=[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],M=[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],S=[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]},{"./common":89,"./utils":99}],92:[function(e,t,r){"use strict";r.sha1=e("./sha/1"),r.sha224=e("./sha/224"),r.sha256=e("./sha/256"),r.sha384=e("./sha/384"),r.sha512=e("./sha/512")},{"./sha/1":93,"./sha/224":94,"./sha/256":95,"./sha/384":96,"./sha/512":97}],93:[function(e,t,r){"use strict";var i=e("../utils"),n=e("../common"),e=e("./common"),c=i.rotl32,h=i.sum32,d=i.sum32_5,l=e.ft_1,o=n.BlockHash,p=[1518500249,1859775393,2400959708,3395469782];function s(){if(!(this instanceof s))return new s;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(s,o),(t.exports=s).blockSize=512,s.outSize=160,s.hmacStrength=80,s.padLength=64,s.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=c(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);for(var n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],i=0;i<r.length;i++)var u=~~(i/20),u=d(c(n,5),l(u,o,s,a),f,r[i],p[u]),f=a,a=s,s=c(o,30),o=n,n=u;this.h[0]=h(this.h[0],n),this.h[1]=h(this.h[1],o),this.h[2]=h(this.h[2],s),this.h[3]=h(this.h[3],a),this.h[4]=h(this.h[4],f)},s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},{"../common":89,"../utils":99,"./common":98}],94:[function(e,t,r){"use strict";var i=e("../utils"),n=e("./256");function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(o,n),(t.exports=o).blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},{"../utils":99,"./256":95}],95:[function(e,t,r){"use strict";var i=e("../utils"),n=e("../common"),o=e("./common"),p=e("minimalistic-assert"),b=i.sum32,m=i.sum32_4,y=i.sum32_5,g=o.ch32,v=o.maj32,_=o.s0_256,w=o.s1_256,M=o.g0_256,S=o.g1_256,s=n.BlockHash,a=[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];function f(){if(!(this instanceof f))return new f;s.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=a,this.W=new Array(64)}i.inherits(f,s),(t.exports=f).blockSize=512,f.outSize=256,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=m(S(r[i-2]),r[i-7],M(r[i-15]),r[i-16]);var n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],u=this.h[5],c=this.h[6],h=this.h[7];for(p(this.k.length===r.length),i=0;i<r.length;i++)var d=y(h,w(f),g(f,u,c),this.k[i],r[i]),l=b(_(n),v(n,o,s)),h=c,c=u,u=f,f=b(a,d),a=s,s=o,o=n,n=b(d,l);this.h[0]=b(this.h[0],n),this.h[1]=b(this.h[1],o),this.h[2]=b(this.h[2],s),this.h[3]=b(this.h[3],a),this.h[4]=b(this.h[4],f),this.h[5]=b(this.h[5],u),this.h[6]=b(this.h[6],c),this.h[7]=b(this.h[7],h)},f.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},{"../common":89,"../utils":99,"./common":98,"minimalistic-assert":105}],96:[function(e,t,r){"use strict";var i=e("../utils"),n=e("./512");function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(o,n),(t.exports=o).blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},{"../utils":99,"./512":97}],97:[function(e,t,r){"use strict";var i=e("../utils"),n=e("../common"),j=e("minimalistic-assert"),B=i.rotr64_hi,C=i.rotr64_lo,d=i.shr64_hi,l=i.shr64_lo,T=i.sum64,O=i.sum64_hi,L=i.sum64_lo,p=i.sum64_4_hi,b=i.sum64_4_lo,D=i.sum64_5_hi,N=i.sum64_5_lo,o=n.BlockHash,s=[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];function a(){if(!(this instanceof a))return new a;o.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=s,this.W=new Array(160)}i.inherits(a,o),(t.exports=a).blockSize=1024,a.outSize=512,a.hmacStrength=192,a.padLength=128,a.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=function(e,t){var r=B(e,t,19),i=B(t,e,29),e=d(e,t,6),t=r^i^e;t<0&&(t+=4294967296);return t}(r[i-4],r[i-3]),o=function(e,t){var r=C(e,t,19),i=C(t,e,29),e=l(e,t,6),t=r^i^e;t<0&&(t+=4294967296);return t}(r[i-4],r[i-3]),s=r[i-14],a=r[i-13],f=function(e,t){var r=B(e,t,1),i=B(e,t,8),e=d(e,t,7),t=r^i^e;t<0&&(t+=4294967296);return t}(r[i-30],r[i-29]),u=function(e,t){var r=C(e,t,1),i=C(e,t,8),e=l(e,t,7),t=r^i^e;t<0&&(t+=4294967296);return t}(r[i-30],r[i-29]),c=r[i-32],h=r[i-31];r[i]=p(n,o,s,a,f,u,c,h),r[i+1]=b(n,o,s,a,f,u,c,h)}},a.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],n=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],f=this.h[5],u=this.h[6],c=this.h[7],h=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],b=this.h[12],m=this.h[13],y=this.h[14],g=this.h[15];j(this.k.length===r.length);for(var v=0;v<r.length;v+=2)var _=y,w=g,M=function(e,t){var r=B(e,t,14),i=B(e,t,18),t=B(t,e,9),e=r^i^t;e<0&&(e+=4294967296);return e}(h,d),S=function(e,t){var r=C(e,t,14),i=C(e,t,18),t=C(t,e,9),e=r^i^t;e<0&&(e+=4294967296);return e}(h,d),A=function(e,t,r){t=e&t^~e&r;t<0&&(t+=4294967296);return t}(h,l,b),k=function(e,t,r){t=e&t^~e&r;t<0&&(t+=4294967296);return t}(d,p,m),E=this.k[v],x=this.k[v+1],I=r[v],P=r[v+1],R=D(_,w,M,S,A,k,E,x,I,P),A=N(_,w,M,S,A,k,E,x,I,P),_=function(e,t){var r=B(e,t,28),i=B(t,e,2),t=B(t,e,7),e=r^i^t;e<0&&(e+=4294967296);return e}(i,n),w=function(e,t){var r=C(e,t,28),i=C(t,e,2),t=C(t,e,7),e=r^i^t;e<0&&(e+=4294967296);return e}(i,n),M=function(e,t,r){e=e&t^e&r^t&r;e<0&&(e+=4294967296);return e}(i,o,a),S=function(e,t,r){e=e&t^e&r^t&r;e<0&&(e+=4294967296);return e}(n,s,f),k=O(_,w,M,S),E=L(_,w,M,S),y=b,g=m,b=l,m=p,l=h,p=d,h=O(u,c,R,A),d=L(c,c,R,A),u=a,c=f,a=o,f=s,o=i,s=n,i=O(R,A,k,E),n=L(R,A,k,E);T(this.h,0,i,n),T(this.h,2,o,s),T(this.h,4,a,f),T(this.h,6,u,c),T(this.h,8,h,d),T(this.h,10,l,p),T(this.h,12,b,m),T(this.h,14,y,g)},a.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},{"../common":89,"../utils":99,"minimalistic-assert":105}],98:[function(e,t,r){"use strict";var i=e("../utils").rotr32;function n(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}r.ft_1=function(e,t,r,i){return 0===e?n(t,r,i):1===e||3===e?t^r^i:2===e?o(t,r,i):void 0},r.ch32=n,r.maj32=o,r.p32=s,r.s0_256=function(e){return i(e,2)^i(e,13)^i(e,22)},r.s1_256=function(e){return i(e,6)^i(e,11)^i(e,25)},r.g0_256=function(e){return i(e,7)^i(e,18)^e>>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":99}],99:[function(e,t,r){"use strict";var f=e("minimalistic-assert"),e=e("inherits");function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=e,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r,i,n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),s=0;s<e.length;s+=2)n.push(parseInt(e[s]+e[s+1],16))}else for(var o=0,s=0;s<e.length;s++){var a=e.charCodeAt(s);a<128?n[o++]=a:a<2048?(n[o++]=a>>6|192,n[o++]=63&a|128):(i=s,55296!=(64512&(r=e).charCodeAt(i))||i<0||i+1>=r.length||56320!=(64512&r.charCodeAt(i+1))?n[o++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++s)),n[o++]=a>>18|240,n[o++]=a>>12&63|128),n[o++]=a>>6&63|128,n[o++]=63&a|128)}else for(s=0;s<e.length;s++)n[s]=0|e[s];return n},r.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t},r.htonl=o,r.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];r+=s((n="little"===t?o(n):n).toString(16))}return r},r.zero2=i,r.zero8=s,r.join32=function(e,t,r,i){f((r=r-t)%4==0);for(var n=new Array(r/4),o=0,s=t;o<n.length;o++,s+=4){var a="big"===i?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s];n[o]=a>>>0}return n},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];"big"===t?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<<t|e>>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0;e[t]=(o<i?1:0)+r+n>>>0,e[t+1]=o},r.sum64_hi=function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,o,s,a){var f=0;return e+r+n+s+((f+=(e=t+i>>>0)<t?1:0)+((e=e+o>>>0)<o?1:0)+(e+a>>>0<a?1:0))>>>0},r.sum64_4_lo=function(e,t,r,i,n,o,s,a){return t+i+o+a>>>0},r.sum64_5_hi=function(e,t,r,i,n,o,s,a,f,u){var c=0;return e+r+n+s+f+(c+((e=t+i>>>0)<t?1:0)+((e=e+o>>>0)<o?1:0)+((e=e+a>>>0)<a?1:0)+(e+u>>>0<u?1:0))>>>0},r.sum64_5_lo=function(e,t,r,i,n,o,s,a,f,u){return t+i+o+a+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:102,"minimalistic-assert":105}],100:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),e=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,e)}(t.exports=s).prototype._init=function(e,t,r){e=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(e),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=o.toArray(e,t),r=o.toArray(r,i),n(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<e;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);i=n.slice(0,e);return this._update(r),this._reseed++,o.encode(i,t)}},{"hash.js":88,"minimalistic-assert":105,"minimalistic-crypto-utils":106}],101:[function(e,t,r){r.read=function(e,t,r,i,n){var o,s,a=8*n-i-1,f=(1<<a)-1,u=f>>1,c=-7,h=r?n-1:0,d=r?-1:1,n=e[t+h];for(h+=d,o=n&(1<<-c)-1,n>>=-c,c+=a;0<c;o=256*o+e[t+h],h+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;0<c;s=256*s+e[t+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===f)return s?NaN:1/0*(n?-1:1);s+=Math.pow(2,i),o-=u}return(n?-1:1)*s*Math.pow(2,o-i)},r.write=function(e,t,r,i,n,o){var s,a,f=8*o-n-1,u=(1<<f)-1,c=u>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,l=i?1:-1,o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(i=Math.pow(2,-s))<1&&(s--,i*=2),2<=(t+=1<=s+c?h/i:h*Math.pow(2,1-c))*i&&(s++,i/=2),u<=s+c?(a=0,s=u):1<=s+c?(a=(t*i-1)*Math.pow(2,n),s+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,n),s=0));8<=n;e[r+d]=255&a,d+=l,a/=256,n-=8);for(s=s<<n|a,f+=n;0<f;e[r+d]=255&s,d+=l,s/=256,f-=8);e[r+d-l]|=128*o}},{}],102:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){var r;t&&(e.super_=t,(r=function(){}).prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e)}},{}],103:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),o=e("safe-buffer").Buffer,s=new Array(16);function a(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function f(e,t){return e<<t|e>>>32-t}function u(e,t,r,i,n,o,s){return f(e+(t&r|~t&i)+n+o|0,s)+t|0}function c(e,t,r,i,n,o,s){return f(e+(t&i|r&~i)+n+o|0,s)+t|0}function h(e,t,r,i,n,o,s){return f(e+(t^r^i)+n+o|0,s)+t|0}function d(e,t,r,i,n,o,s){return f(e+(r^(t|~i))+n+o|0,s)+t|0}i(a,n),a.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=u(this._a,o=this._b,n=this._c,i=this._d,e[0],3614090360,7),i=u(i,r,o,n,e[1],3905402710,12),n=u(n,i,r,o,e[2],606105819,17),o=u(o,n,i,r,e[3],3250441966,22);r=u(r,o,n,i,e[4],4118548399,7),i=u(i,r,o,n,e[5],1200080426,12),n=u(n,i,r,o,e[6],2821735955,17),o=u(o,n,i,r,e[7],4249261313,22),r=u(r,o,n,i,e[8],1770035416,7),i=u(i,r,o,n,e[9],2336552879,12),n=u(n,i,r,o,e[10],4294925233,17),o=u(o,n,i,r,e[11],2304563134,22),r=u(r,o,n,i,e[12],1804603682,7),i=u(i,r,o,n,e[13],4254626195,12),n=u(n,i,r,o,e[14],2792965006,17),r=c(r,o=u(o,n,i,r,e[15],1236535329,22),n,i,e[1],4129170786,5),i=c(i,r,o,n,e[6],3225465664,9),n=c(n,i,r,o,e[11],643717713,14),o=c(o,n,i,r,e[0],3921069994,20),r=c(r,o,n,i,e[5],3593408605,5),i=c(i,r,o,n,e[10],38016083,9),n=c(n,i,r,o,e[15],3634488961,14),o=c(o,n,i,r,e[4],3889429448,20),r=c(r,o,n,i,e[9],568446438,5),i=c(i,r,o,n,e[14],3275163606,9),n=c(n,i,r,o,e[3],4107603335,14),o=c(o,n,i,r,e[8],1163531501,20),r=c(r,o,n,i,e[13],2850285829,5),i=c(i,r,o,n,e[2],4243563512,9),n=c(n,i,r,o,e[7],1735328473,14),r=h(r,o=c(o,n,i,r,e[12],2368359562,20),n,i,e[5],4294588738,4),i=h(i,r,o,n,e[8],2272392833,11),n=h(n,i,r,o,e[11],1839030562,16),o=h(o,n,i,r,e[14],4259657740,23),r=h(r,o,n,i,e[1],2763975236,4),i=h(i,r,o,n,e[4],1272893353,11),n=h(n,i,r,o,e[7],4139469664,16),o=h(o,n,i,r,e[10],3200236656,23),r=h(r,o,n,i,e[13],681279174,4),i=h(i,r,o,n,e[0],3936430074,11),n=h(n,i,r,o,e[3],3572445317,16),o=h(o,n,i,r,e[6],76029189,23),r=h(r,o,n,i,e[9],3654602809,4),i=h(i,r,o,n,e[12],3873151461,11),n=h(n,i,r,o,e[15],530742520,16),r=d(r,o=h(o,n,i,r,e[2],3299628645,23),n,i,e[0],4096336452,6),i=d(i,r,o,n,e[7],1126891415,10),n=d(n,i,r,o,e[14],2878612391,15),o=d(o,n,i,r,e[5],4237533241,21),r=d(r,o,n,i,e[12],1700485571,6),i=d(i,r,o,n,e[3],2399980690,10),n=d(n,i,r,o,e[10],4293915773,15),o=d(o,n,i,r,e[1],2240044497,21),r=d(r,o,n,i,e[8],1873313359,6),i=d(i,r,o,n,e[15],4264355552,10),n=d(n,i,r,o,e[6],2734768916,15),o=d(o,n,i,r,e[13],1309151649,21),r=d(r,o,n,i,e[4],4149444226,6),i=d(i,r,o,n,e[11],3174756917,10),n=d(n,i,r,o,e[2],718787259,15),o=d(o,n,i,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+o|0,this._c=this._c+n|0,this._d=this._d+i|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,56<this._blockOffset&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},t.exports=a},{"hash-base":86,inherits:102,"safe-buffer":143}],104:[function(e,t,r){var l=e("bn.js"),i=e("brorand");function n(e){this.rand=e||new i.Rand}(t.exports=n).create=function(e){return new n(e)},n.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new l(this.rand.generate(r))}while(0<=i.cmp(e));return i},n.prototype._randrange=function(e,t){t=t.sub(e);return e.add(this._randbelow(t))},n.prototype.test=function(e,t,r){for(var i=e.bitLength(),n=l.mont(e),o=new l(1).toRed(n),s=(t=t||Math.max(1,i/48|0),e.subn(1)),a=0;!s.testn(a);a++);for(var f=e.shrn(a),u=s.toRed(n);0<t;t--){var c=this._randrange(new l(2),s),h=(r&&r(c),c.toRed(n).redPow(f));if(0!==h.cmp(o)&&0!==h.cmp(u)){for(var d=1;d<a;d++){if(0===(h=h.redSqr()).cmp(o))return!1;if(0===h.cmp(u))break}if(d===a)return!1}}return!0},n.prototype.getDivisor=function(e,t){for(var r=e.bitLength(),i=l.mont(e),n=new l(1).toRed(i),o=(t=t||Math.max(1,r/48|0),e.subn(1)),s=0;!o.testn(s);s++);for(var a=e.shrn(s),f=o.toRed(i);0<t;t--){var u=this._randrange(new l(2),o),c=e.gcd(u);if(0!==c.cmpn(1))return c;var h=u.toRed(i).redPow(a);if(0!==h.cmp(n)&&0!==h.cmp(f)){for(var d=1;d<s;d++){if(0===(h=h.redSqr()).cmp(n))return h.fromRed().subn(1).gcd(e);if(0===h.cmp(f))break}if(d===s)return(h=h.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},{"bn.js":16,brorand:17}],105:[function(e,t,r){function i(e,t){if(!e)throw new Error(t||"Assertion failed")}(t.exports=i).equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},{}],106:[function(e,t,r){"use strict";function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e)for(var i=0;i<e.length;i++)r[i]=0|e[i];else if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,n=255&n;o?r.push(o,n):r.push(n)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}},{}],107:[function(e,t,r){t.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"}},{}],108:[function(e,t,r){"use strict";var i=e("asn1.js"),e=(r.certificate=e("./certificate"),i.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())})),e=(r.RSAPrivateKey=e,i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())})),e=(r.RSAPublicKey=e,i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(n),this.key("subjectPublicKey").bitstr())})),n=(r.PublicKey=e,i.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())})),e=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(n),this.key("subjectPrivateKey").octstr())}),e=(r.PrivateKey=e,i.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())})),e=(r.EncryptedPrivateKey=e,i.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())})),e=(r.DSAPrivateKey=e,r.DSAparam=i.define("DSAparam",function(){this.int()}),i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(o),this.key("publicKey").optional().explicit(1).bitstr())})),o=(r.ECPrivateKey=e,i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}));r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":109,"asn1.js":1}],109:[function(e,t,r){"use strict";var e=e("asn1.js"),i=e.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),n=e.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=e.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=e.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),a=e.define("RelativeDistinguishedName",function(){this.setof(n)}),f=e.define("RDNSequence",function(){this.seqof(a)}),u=e.define("Name",function(){this.choice({rdnSequence:this.use(f)})}),c=e.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),h=e.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=e.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(u),this.key("validity").use(c),this.key("subject").use(u),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),e=e.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=e},{"asn1.js":1}],110:[function(e,t,r){var s=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,a=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,f=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,u=e("evp_bytestokey"),c=e("browserify-aes"),h=e("safe-buffer").Buffer;t.exports=function(e,t){var r,i,n,e=e.toString(),o=e.match(s);return n=o?(i="aes"+o[1],n=h.from(o[2],"hex"),r=h.from(o[3].replace(/[\r\n]/g,""),"base64"),t=u(t,n.slice(0,8),parseInt(o[1],10)).key,o=[],i=c.createDecipheriv(i,t,n),o.push(i.update(r)),o.push(i.final()),h.concat(o)):(t=e.match(f),h.from(t[2].replace(/[\r\n]/g,""),"base64")),{tag:e.match(a)[1],data:n}}},{"browserify-aes":21,evp_bytestokey:85,"safe-buffer":143}],111:[function(e,t,r){var l=e("./asn1"),p=e("./aesid.json"),b=e("./fixProc"),m=e("browserify-aes"),y=e("pbkdf2"),g=e("safe-buffer").Buffer;function i(e){"object"!=typeof e||g.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=g.from(e));var t,r,i,n,o,s,a,f,u,c,e=b(e,t),h=e.tag,d=e.data;switch(h){case"CERTIFICATE":i=l.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(r=(i=i||l.PublicKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return l.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=l.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":d=l.EncryptedPrivateKey.decode(d,"der"),o=t,s=(n=d).algorithm.decrypt.kde.kdeparams.salt,a=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),f=p[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,n=n.subjectPrivateKey,c=parseInt(f.split("-")[1],10)/8,o=y.pbkdf2Sync(o,s,a,c,"sha1"),s=m.createDecipheriv(f,o,u),(a=[]).push(s.update(n)),a.push(s.final()),d=g.concat(a);case"PRIVATE KEY":switch(r=(i=l.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return l.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:l.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=l.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return l.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return l.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:l.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=l.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+h)}}(t.exports=i).signature=l.signature},{"./aesid.json":107,"./asn1":108,"./fixProc":110,"browserify-aes":21,pbkdf2:112,"safe-buffer":143}],112:[function(e,t,r){r.pbkdf2=e("./lib/async"),r.pbkdf2Sync=e("./lib/sync")},{"./lib/async":113,"./lib/sync":116}],113:[function(t,r,e){!function(_){!function(){var u,e,c=t("safe-buffer").Buffer,h=t("./precondition"),d=t("./default-encoding"),l=t("./sync"),p=t("./to-buffer"),b=_.crypto&&_.crypto.subtle,m={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},y=[];function g(){return e=e||(_.process&&_.process.nextTick?_.process.nextTick:_.queueMicrotask||_.setImmediate||_.setTimeout)}function v(e,t,r,i,n){return b.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return b.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:n}},e,i<<3)}).then(function(e){return c.from(e)})}r.exports=function(t,r,i,n,o,s){"function"==typeof o&&(s=o,o=void 0);var e,a,f=m[(o=o||"sha1").toLowerCase()];if(f&&"function"==typeof _.Promise){if(h(i,n),t=p(t,d,"Password"),r=p(r,d,"Salt"),"function"!=typeof s)throw new Error("No callback provided to pbkdf2");e=function(e){if(_.process&&!_.process.browser)return Promise.resolve(!1);if(!b||!b.importKey||!b.deriveBits)return Promise.resolve(!1);if(void 0!==y[e])return y[e];var t=v(u=u||c.alloc(8),u,10,128,e).then(function(){return!0}).catch(function(){return!1});return y[e]=t}(f).then(function(e){return e?v(t,r,i,n,f):l(t,r,i,n,o)}),a=s,e.then(function(e){g()(function(){a(null,e)})},function(e){g()(function(){a(e)})})}else g()(function(){var e;try{e=l(t,r,i,n,o)}catch(e){return s(e)}s(null,e)})}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":114,"./precondition":115,"./sync":116,"./to-buffer":117,"safe-buffer":143}],114:[function(e,i,t){!function(t,r){!function(){var e;e=r.process&&r.process.browser||!r.process||!r.process.version||6<=parseInt(t.version.split(".")[0].slice(1),10)?"utf-8":"binary",i.exports=e}.call(this)}.call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:118}],115:[function(e,t,r){var i=Math.pow(2,30)-1;t.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||i<t||t!=t)throw new TypeError("Bad key length")}},{}],116:[function(e,t,r){var u=e("create-hash/md5"),c=e("ripemd160"),h=e("sha.js"),m=e("safe-buffer").Buffer,y=e("./precondition"),g=e("./default-encoding"),v=e("./to-buffer"),d=m.alloc(128),_={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function w(e,t,r){for(var i,n="rmd160"===(i=e)||"ripemd160"===i?function(e){return(new c).update(e).digest()}:"md5"===i?u:function(e){return h(i).update(e).digest()},o="sha512"===e||"sha384"===e?128:64,s=(t.length>o?t=n(t):t.length<o&&(t=m.concat([t,d],o)),m.allocUnsafe(o+_[e])),a=m.allocUnsafe(o+_[e]),f=0;f<o;f++)s[f]=54^t[f],a[f]=92^t[f];r=m.allocUnsafe(o+r+4);s.copy(r,0,0,o),this.ipad1=r,this.ipad2=s,this.opad=a,this.alg=e,this.blocksize=o,this.hash=n,this.size=_[e]}w.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(e,t,r,i,n){y(r,i);for(var o=new w(n=n||"sha1",e=v(e,g,"Password"),(t=v(t,g,"Salt")).length),s=m.allocUnsafe(i),a=m.allocUnsafe(t.length+4),f=(t.copy(a,0,0,t.length),0),u=_[n],c=Math.ceil(i/u),h=1;h<=c;h++){a.writeUInt32BE(h,t.length);for(var d=o.run(a,o.ipad1),l=d,p=1;p<r;p++)for(var l=o.run(l,o.ipad2),b=0;b<u;b++)d[b]^=l[b];d.copy(s,f),f+=u}return s}},{"./default-encoding":114,"./precondition":115,"./to-buffer":117,"create-hash/md5":54,ripemd160:142,"safe-buffer":143,"sha.js":146}],117:[function(e,t,r){var i=e("safe-buffer").Buffer;t.exports=function(e,t,r){if(i.isBuffer(e))return e;if("string"==typeof e)return i.from(e,t);if(ArrayBuffer.isView(e))return i.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},{"safe-buffer":143}],118:[function(e,t,r){var i,n,t=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}try{i="function"==typeof setTimeout?setTimeout:o}catch(e){i=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===o||!i)&&setTimeout)return(i=setTimeout)(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}var f,u=[],c=!1,h=-1;function d(){c&&f&&(c=!1,f.length?u=f.concat(u):h=-1,u.length&&l())}function l(){if(!c){for(var e=a(d),t=(c=!0,u.length);t;){for(f=u,u=[];++h<t;)f&&f[h].run();h=-1,t=u.length}f=null,c=!1,!function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return(n=clearTimeout)(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function b(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||a(l)},p.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=b,t.addListener=b,t.once=b,t.off=b,t.removeListener=b,t.removeAllListeners=b,t.emit=b,t.prependListener=b,t.prependOnceListener=b,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],119:[function(e,t,r){r.publicEncrypt=e("./publicEncrypt"),r.privateDecrypt=e("./privateDecrypt"),r.privateEncrypt=function(e,t){return r.publicEncrypt(e,t,!0)},r.publicDecrypt=function(e,t){return r.privateDecrypt(e,t,!0)}},{"./privateDecrypt":121,"./publicEncrypt":122}],120:[function(e,t,r){var s=e("create-hash"),a=e("safe-buffer").Buffer;t.exports=function(e,t){for(var r,i,n=a.alloc(0),o=0;n.length<t;)r=o++,i=void 0,(i=a.allocUnsafe(4)).writeUInt32BE(r,0),r=i,n=a.concat([n,s("sha1").update(e).update(r).digest()]);return n.slice(0,t)}},{"create-hash":53,"safe-buffer":143}],121:[function(e,t,r){var l=e("parse-asn1"),p=e("./mgf"),b=e("./xor"),m=e("bn.js"),y=e("browserify-rsa"),g=e("create-hash"),v=e("./withPublic"),_=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i=e.padding||(r?1:4),e=l(e),n=e.modulus.byteLength();if(t.length>n||0<=new m(t).cmp(e.modulus))throw new Error("decryption error");var t=r?v(new m(t),e):y(t,e),o=_.alloc(n-t.length);if(t=_.concat([o,t],n),4===i){var o=t,n=(n=e).modulus.byteLength(),e=g("sha1").update(_.alloc(0)).digest(),s=e.length;if(0===o[0]){var a=o.slice(1,s+1),o=o.slice(s+1),a=b(a,p(o,s)),f=b(o,p(a,n-s-1));if(!function(e,t){e=_.from(e),t=_.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n<i;)r+=e[n]^t[n];return r}(e,f.slice(0,s))){for(var u=s;0===f[u];)u++;if(1===f[u++])return f.slice(u)}}throw new Error("decryption error")}if(1===i){for(var c=t,o=r,a=c.slice(0,2),h=2,d=0;0!==c[h++];)if(h>=c.length){d++;break}n=c.slice(2,h-1);if(("0002"!==a.toString("hex")&&!o||"0001"!==a.toString("hex")&&o)&&d++,n.length<8&&d++,d)throw new Error("decryption error");return c.slice(h)}if(3===i)return t;throw new Error("unknown padding")}},{"./mgf":120,"./withPublic":123,"./xor":124,"bn.js":16,"browserify-rsa":39,"create-hash":53,"parse-asn1":111,"safe-buffer":143}],122:[function(e,t,r){var o=e("parse-asn1"),a=e("randombytes"),f=e("create-hash"),u=e("./mgf"),c=e("./xor"),h=e("bn.js"),s=e("./withPublic"),d=e("browserify-rsa"),l=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i,n=e.padding||(r?1:4),e=o(e);if(4===n)i=function(e,t){var e=e.modulus.byteLength(),r=t.length,i=f("sha1").update(l.alloc(0)).digest(),n=i.length,o=2*n;if(e-o-2<r)throw new Error("message too long");var r=l.alloc(e-r-o-2),o=e-n-1,s=a(n),i=c(l.concat([i,r,l.alloc(1,1),t],o),u(s,o)),r=c(s,u(i,n));return new h(l.concat([l.alloc(1),r,i],e))}(e,t);else if(1===n)i=function(e,t,r){var i=t.length,e=e.modulus.byteLength();if(e-11<i)throw new Error("message too long");i=r?l.alloc(e-i-3,255):function(e){var t,r=l.allocUnsafe(e),i=0,n=a(2*e),o=0;for(;i<e;)o===n.length&&(n=a(2*e),o=0),(t=n[o++])&&(r[i++]=t);return r}(e-i-3);return new h(l.concat([l.from([0,r?1:2]),i,l.alloc(1),t],e))}(e,t,r);else{if(3!==n)throw new Error("unknown padding");if(0<=(i=new h(t)).cmp(e.modulus))throw new Error("data too long for modulus")}return(r?d:s)(i,e)}},{"./mgf":120,"./withPublic":123,"./xor":124,"bn.js":16,"browserify-rsa":39,"create-hash":53,"parse-asn1":111,randombytes:125,"safe-buffer":143}],123:[function(e,t,r){var i=e("bn.js"),n=e("safe-buffer").Buffer;t.exports=function(e,t){return n.from(e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed().toArray())}},{"bn.js":16,"safe-buffer":143}],124:[function(e,t,r){t.exports=function(e,t){for(var r=e.length,i=-1;++i<r;)e[i]^=t[i];return e}},{}],125:[function(t,r,e){!function(s,e){!function(){"use strict";var n=t("safe-buffer").Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?r.exports=function(e,t){if(4294967295<e)throw new RangeError("requested too many random bytes");var r=n.allocUnsafe(e);if(0<e)if(65536<e)for(var i=0;i<e;i+=65536)o.getRandomValues(r.slice(i,i+65536));else o.getRandomValues(r);return"function"!=typeof t?r:s.nextTick(function(){t(null,r)})}:r.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}.call(this)}.call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:118,"safe-buffer":143}],126:[function(r,e,l){!function(h,d){!function(){"use strict";function e(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var t=r("safe-buffer"),o=r("randombytes"),n=t.Buffer,i=t.kMaxLength,s=d.crypto||d.msCrypto,a=Math.pow(2,32)-1;function f(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(a<e||e<0)throw new TypeError("offset must be a uint32");if(i<e||t<e)throw new RangeError("offset out of range")}function u(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(a<e||e<0)throw new TypeError("size must be a uint32");if(r<e+t||i<e)throw new RangeError("buffer too small")}function c(r,i,e,n){var t;if(h.browser)return t=r.buffer,t=new Uint8Array(t,i,e),s.getRandomValues(t),n?void h.nextTick(function(){n(null,r)}):r;{if(!n)return o(e).copy(r,i),r;o(e,function(e,t){if(e)return n(e);t.copy(r,i),n(null,r)})}}s&&s.getRandomValues||!h.browser?(l.randomFill=function(e,t,r,i){if(!(n.isBuffer(e)||e instanceof d.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)i=t,t=0,r=e.length;else if("function"==typeof r)i=r,r=e.length-t;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return f(t,e.length),u(r,t,e.length),c(e,t,r,i)},l.randomFillSync=function(e,t,r){void 0===t&&(t=0);if(!(n.isBuffer(e)||e instanceof d.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');f(t,e.length),void 0===r&&(r=e.length-t);return u(r,t,e.length),c(e,t,r)}):(l.randomFill=e,l.randomFillSync=e)}.call(this)}.call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:118,randombytes:125,"safe-buffer":143}],127:[function(e,t,r){"use strict";var i={};function n(e,n,t){var r=function(i){var e,t;function r(e,t,r){return i.call(this,(e=e,t=t,r=r,"string"==typeof n?n:n(e,t,r)))||this}return t=i,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t,r}(t=t||Error);r.prototype.name=t.name,r.prototype.code=e,i[e]=r}function f(e,t){var r;return Array.isArray(e)?(r=e.length,e=e.map(function(e){return String(e)}),2<r?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])):"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,n,o,s,a;return"string"==typeof t&&(s="not ",t.substr(!o||o<0?0:+o,s.length)===s)?(i="must not be",t=t.replace(/^not /,"")):i="must be",o=e,s=" argument",(void 0===a||a>o.length)&&(a=o.length),o=o.substring(a-s.length,a)===s?"The ".concat(e," ").concat(i," ").concat(f(t,"type")):(a=(n="number"!=typeof n?0:n)+(o=".").length>(a=e).length||-1===a.indexOf(o,n)?"argument":"property",'The "'.concat(e,'" ').concat(a," ").concat(i," ").concat(f(t,"type"))),o+=". Received type ".concat(typeof r)},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},{}],128:[function(c,h,e){!function(u){!function(){"use strict";var e=Object.keys||function(e){var t,r=[];for(t in e)r.push(t);return r},t=(h.exports=s,c("./_stream_readable")),r=c("./_stream_writable");c("inherits")(s,t);for(var i=e(r.prototype),n=0;n<i.length;n++){var o=i[n];s.prototype[o]||(s.prototype[o]=r.prototype[o])}function s(e){if(!(this instanceof s))return new s(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||u.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}.call(this)}.call(this,c("_process"))},{"./_stream_readable":130,"./_stream_writable":132,_process:118,inherits:102}],129:[function(e,t,r){"use strict";t.exports=n;var i=e("./_stream_transform");function n(e){if(!(this instanceof n))return new n(e);i.call(this,e)}e("inherits")(n,i),n.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":131,inherits:102}],130:[function(U,q,e){!function(D,N){!function(){"use strict";function p(e,t){return e.listeners(t).length}(q.exports=_).ReadableState=v,U("events").EventEmitter;var i,n=U("./internal/streams/stream"),c=U("buffer").Buffer,h=N.Uint8Array||function(){};var o,e,r,t=U("util"),b=t&&t.debuglog?t.debuglog("stream"):function(){},s=U("./internal/streams/buffer_list"),t=U("./internal/streams/destroy"),a=U("./internal/streams/state").getHighWaterMark,f=U("../errors").codes,d=f.ERR_INVALID_ARG_TYPE,l=f.ERR_STREAM_PUSH_AFTER_EOF,u=f.ERR_METHOD_NOT_IMPLEMENTED,m=f.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,y=(U("inherits")(_,n),t.errorOrDestroy),g=["error","close","destroy","pause","resume"];function v(e,t,r){i=i||U("./_stream_duplex"),e=e||{},"boolean"!=typeof r&&(r=t instanceof i),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=a(this,e,"readableHighWaterMark",r),this.buffer=new s,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o=o||U("string_decoder/").StringDecoder,this.decoder=new o(e.encoding),this.encoding=e.encoding)}function _(e){if(i=i||U("./_stream_duplex"),!(this instanceof _))return new _(e);var t=this instanceof i;this._readableState=new v(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),n.call(this)}function w(e,t,r,i,n){b("readableAddChunk",t);var o,s,a,f,u=e._readableState;if(null===t)u.reading=!1,s=e,a=u,b("onEofChunk"),a.ended||(a.decoder&&(f=a.decoder.end())&&f.length&&(a.buffer.push(f),a.length+=a.objectMode?1:f.length),a.ended=!0,a.sync?k(s):(a.needReadable=!1,a.emittedReadable||(a.emittedReadable=!0,E(s))));else if(o=n?o:function(e,t){var r;!function(e){return c.isBuffer(e)||e instanceof h}(t)&&"string"!=typeof t&&void 0!==t&&!e.objectMode&&(r=new d("chunk",["string","Buffer","Uint8Array"],t));return r}(u,t))y(e,o);else if(u.objectMode||t&&0<t.length)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===c.prototype||(f=t,t=c.from(f)),i)u.endEmitted?y(e,new m):M(e,u,t,!0);else if(u.ended)y(e,new l);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?M(e,u,t,!1):x(e,u)):M(e,u,t,!1)}else i||(u.reading=!1,x(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function M(e,t,r,i){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),x(e,t)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=t.destroy,_.prototype._undestroy=t.undestroy,_.prototype._destroy=function(e,t){t(e)},_.prototype.push=function(e,t){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof e&&((t=t||i.defaultEncoding)!==i.encoding&&(e=c.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},_.prototype.unshift=function(e){return w(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){for(var t=new(o=o||U("string_decoder/").StringDecoder)(e),r=(this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding,this._readableState.buffer.head),i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var S=1073741824;function A(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?(t.flowing&&t.length?t.buffer.head.data:t).length:(e>t.highWaterMark&&(t.highWaterMark=(S<=(r=e)?r=S:(r--,r=(r=(r=(r=(r|=r>>>1)|r>>>2)|r>>>4)|r>>>8)|r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;b("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(b("emitReadable",t.flowing),t.emittedReadable=!0,D.nextTick(E,e))}function E(e){var t=e._readableState;b("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function x(e,t){t.readingMore||(t.readingMore=!0,D.nextTick(I,e,t))}function I(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(b("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function P(e){var t=e._readableState;t.readableListening=0<e.listenerCount("readable"),t.resumeScheduled&&!t.paused?t.flowing=!0:0<e.listenerCount("data")&&e.resume()}function R(e){b("readable nexttick read 0"),e.read(0)}function j(e,t){b("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(b("flow",t.flowing);t.flowing&&null!==e.read(););}function C(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function T(e){var t=e._readableState;b("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,D.nextTick(L,t,e))}function L(e,t){b("endReadableNT",e.endEmitted,e.length),e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy&&(!(e=t._writableState)||e.autoDestroy&&e.finished)&&t.destroy())}function O(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}_.prototype.read=function(e){b("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:0<t.length)||t.ended))return b("read: emitReadable",t.length,t.ended),(0===t.length&&t.ended?T:k)(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&T(this),null;var i=t.needReadable;return b("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&b("length less than watermark",i=!0),t.ended||t.reading?b("reading or ended",i=!1):i&&(b("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=A(r,t))),null===(i=0<e?C(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&T(this)),null!==i&&this.emit("data",i),i},_.prototype._read=function(e){y(this,new u("_read()"))},_.prototype.pipe=function(r,e){var i=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=r;break;case 1:n.pipes=[n.pipes,r];break;default:n.pipes.push(r)}n.pipesCount+=1,b("pipe count=%d opts=%j",n.pipesCount,e);e=(!e||!1!==e.end)&&r!==D.stdout&&r!==D.stderr?s:l;function o(e,t){b("onunpipe"),e===i&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,b("cleanup"),r.removeListener("close",h),r.removeListener("finish",d),r.removeListener("drain",a),r.removeListener("error",c),r.removeListener("unpipe",o),i.removeListener("end",s),i.removeListener("end",l),i.removeListener("data",u),f=!0,!n.awaitDrain||r._writableState&&!r._writableState.needDrain||a())}function s(){b("onend"),r.end()}n.endEmitted?D.nextTick(e):i.once("end",e),r.on("unpipe",o);t=i;var t,a=function(){var e=t._readableState;b("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&p(t,"data")&&(e.flowing=!0,B(t))},f=(r.on("drain",a),!1);function u(e){b("ondata");e=r.write(e);b("dest.write",e),!1===e&&((1===n.pipesCount&&n.pipes===r||1<n.pipesCount&&-1!==O(n.pipes,r))&&!f&&(b("false write response, pause",n.awaitDrain),n.awaitDrain++),i.pause())}function c(e){b("onerror",e),l(),r.removeListener("error",c),0===p(r,"error")&&y(r,e)}function h(){r.removeListener("finish",d),l()}function d(){b("onfinish"),r.removeListener("close",h),l()}function l(){b("unpipe"),i.unpipe(r)}return i.on("data",u),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(r,"error",c),r.once("close",h),r.once("finish",d),r.emit("pipe",i),n.flowing||(b("pipe resume"),i.resume()),r},_.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0!==t.pipesCount){if(1===t.pipesCount)return e&&e!==t.pipes||(e=e||t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(e){var i=O(t.pipes,e);-1!==i&&(t.pipes.splice(i,1),--t.pipesCount,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r))}else{var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<o;s++)n[s].emit("unpipe",this,{hasUnpiped:!1})}}return this},_.prototype.addListener=_.prototype.on=function(e,t){var t=n.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=0<this.listenerCount("readable"),!1!==r.flowing&&this.resume()):"readable"!==e||r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,b("on readable",r.length,r.reading),r.length?k(this):r.reading||D.nextTick(R,this)),t},_.prototype.removeListener=function(e,t){t=n.prototype.removeListener.call(this,e,t);return"readable"===e&&D.nextTick(P,this),t},_.prototype.removeAllListeners=function(e){var t=n.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||D.nextTick(P,this),t},_.prototype.resume=function(){var e,t,r=this._readableState;return r.flowing||(b("resume"),r.flowing=!r.readableListening,e=this,(t=r).resumeScheduled||(t.resumeScheduled=!0,D.nextTick(j,e,t))),r.paused=!1,this},_.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(t){var e,r=this,i=this._readableState,n=!1;for(e in t.on("end",function(){var e;b("wrapped end"),i.decoder&&!i.ended&&(e=i.decoder.end())&&e.length&&r.push(e),r.push(null)}),t.on("data",function(e){b("wrapped data"),i.decoder&&(e=i.decoder.write(e)),i.objectMode&&null==e||(i.objectMode||e&&e.length)&&!r.push(e)&&(n=!0,t.pause())}),t)void 0===this[e]&&"function"==typeof t[e]&&(this[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e));for(var o=0;o<g.length;o++)t.on(g[o],this.emit.bind(this,g[o]));return this._read=function(e){b("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(_.prototype[Symbol.asyncIterator]=function(){return(e=void 0===e?U("./internal/streams/async_iterator"):e)(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),_._fromList=C,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(_.from=function(e,t){return(r=void 0===r?U("./internal/streams/from"):r)(_,e,t)})}.call(this)}.call(this,U("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":127,"./_stream_duplex":128,"./internal/streams/async_iterator":133,"./internal/streams/buffer_list":134,"./internal/streams/destroy":135,"./internal/streams/from":137,"./internal/streams/state":139,"./internal/streams/stream":140,_process:118,buffer:49,events:84,inherits:102,"string_decoder/":154,util:18}],131:[function(e,t,r){"use strict";t.exports=f;var t=e("../errors").codes,i=t.ERR_METHOD_NOT_IMPLEMENTED,n=t.ERR_MULTIPLE_CALLBACK,o=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=t.ERR_TRANSFORM_WITH_LENGTH_0,a=e("./_stream_duplex");function f(e){if(!(this instanceof f))return new f(e);a.call(this,e),this._transformState={afterTransform:function(e,t){var r=this._transformState,i=(r.transforming=!1,r.writecb);if(null===i)return this.emit("error",new n);r.writechunk=null,(r.writecb=null)!=t&&this.push(t),i(e),(r=this._readableState).reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function u(){var r=this;"function"!=typeof this._flush||this._readableState.destroyed?c(this,null,null):this._flush(function(e,t){c(r,e,t)})}function c(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new o;e.push(null)}e("inherits")(f,a),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new i("_transform()"))},f.prototype._write=function(e,t,r){var i=this._transformState;i.writecb=r,i.writechunk=e,i.writeencoding=t,i.transforming||(r=this._readableState,(i.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark))},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){a.prototype._destroy.call(this,e,function(e){t(e)})}},{"../errors":127,"./_stream_duplex":128,inherits:102}],132:[function(R,j,e){!function(I,P){!function(){"use strict";function h(o){var s=this;this.next=null,this.entry=null,this.finish=function(){var e=s,t=o,r=void 0,i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}}(j.exports=w).WritableState=_;var r,e={deprecate:R("util-deprecate")},i=R("./internal/streams/stream"),d=R("buffer").Buffer,l=P.Uint8Array||function(){};var n,t=R("./internal/streams/destroy"),o=R("./internal/streams/state").getHighWaterMark,s=R("../errors").codes,p=s.ERR_INVALID_ARG_TYPE,a=s.ERR_METHOD_NOT_IMPLEMENTED,b=s.ERR_MULTIPLE_CALLBACK,f=s.ERR_STREAM_CANNOT_PIPE,u=s.ERR_STREAM_DESTROYED,m=s.ERR_STREAM_NULL_VALUES,y=s.ERR_STREAM_WRITE_AFTER_END,c=s.ERR_UNKNOWN_ENCODING,g=t.errorOrDestroy;function v(){}function _(e,c,t){r=r||R("./_stream_duplex"),e=e||{},"boolean"!=typeof t&&(t=c instanceof r),this.objectMode=!!e.objectMode,t&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=o(this,e,"writableHighWaterMark",t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;t=(this.destroyed=!1)===e.decodeStrings;this.decodeStrings=!t,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){var t=c,r=t._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new b;var o,s,a,f,u=r;u.writing=!1,u.writecb=null,u.length-=u.writelen,u.writelen=0,e?(u=t,s=i,a=e,f=n,--(o=r).pendingcb,s?(I.nextTick(f,a),I.nextTick(x,u,o),u._writableState.errorEmitted=!0,g(u,a)):(f(a),u._writableState.errorEmitted=!0,g(u,a),x(u,o))):((e=k(r)||t.destroyed)||r.corked||r.bufferProcessing||!r.bufferedRequest||A(t,r),i?I.nextTick(S,t,r,e,n):S(t,r,e,n))},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new h(this)}R("inherits")(w,i),_.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};try{Object.defineProperty(_.prototype,"buffer",{get:e.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}function w(e){var t=this instanceof(r=r||R("./_stream_duplex"));if(!t&&!n.call(w,this))return new w(e);this._writableState=new _(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),i.call(this)}function M(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new u("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function S(e,t,r,i){var n;r||(r=e,0===(n=t).length&&n.needDrain&&(n.needDrain=!1,r.emit("drain"))),t.pendingcb--,i(),x(e,t)}function A(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){for(var i=t.bufferedRequestCount,n=new Array(i),i=t.corkedRequestsFree,o=(i.entry=r,0),s=!0;r;)(n[o]=r).isBuf||(s=!1),r=r.next,o+=1;n.allBuffers=s,M(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new h(t),t.bufferedRequestCount=0}else{for(;r;){var a=r.chunk,f=r.encoding,u=r.callback;if(M(e,t,!1,t.objectMode?1:a.length,a,f,u),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(t,r){t._final(function(e){r.pendingcb--,e&&g(t,e),r.prefinished=!0,t.emit("prefinish"),x(t,r)})}function x(e,t){var r,i,n=k(t);return n&&(r=e,(i=t).prefinished||i.finalCalled||("function"!=typeof r._final||i.destroyed?(i.prefinished=!0,r.emit("prefinish")):(i.pendingcb++,i.finalCalled=!0,I.nextTick(E,r,i))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy&&(!(r=e._readableState)||r.autoDestroy&&r.endEmitted)&&e.destroy())),n}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(n=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(e){return!!n.call(this,e)||this===w&&(e&&e._writableState instanceof _)}})):n=function(e){return e instanceof this},w.prototype.pipe=function(){g(this,new f)},w.prototype.write=function(e,t,r){var i,n,o,s,a,f,u=this._writableState,c=!1,h=!u.objectMode&&(h=e,d.isBuffer(h)||h instanceof l);return h&&!d.isBuffer(e)&&(s=e,e=d.from(s)),"function"==typeof t&&(r=t,t=null),t=h?"buffer":t||u.defaultEncoding,"function"!=typeof r&&(r=v),u.ending?(s=this,a=r,f=new y,g(s,f),I.nextTick(a,f)):!h&&(a=this,f=u,n=r,null===(i=e)?o=new m:"string"==typeof i||f.objectMode||(o=new p("chunk",["string","Buffer"],i)),o&&(g(a,o),!void I.nextTick(n,o)))||(u.pendingcb++,c=function(e,t,r,i,n,o){r||(s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,i,n),i!==s&&(r=!0,n="buffer",i=s));var s=t.objectMode?1:i.length,a=(t.length+=s,t.length<t.highWaterMark);a||(t.needDrain=!0);{var f;t.writing||t.corked?(f=t.lastBufferedRequest,t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1):M(e,t,!1,s,i,n,o)}return a}(this,u,h,e,t,r)),c},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},w.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase()))return this._writableState.defaultEncoding=e,this;throw new c(e)},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(e,t,r){r(new a("_write()"))},w.prototype._writev=null,w.prototype.end=function(e,t,r){var i=this._writableState;if("function"==typeof e?(r=e,t=e=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),!i.ending){e=this,t=i,i=r;t.ending=!0,x(e,t),i&&(t.finished?I.nextTick(i):e.once("finish",i)),t.ended=!0,e.writable=!1}return this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),w.prototype.destroy=t.destroy,w.prototype._undestroy=t.undestroy,w.prototype._destroy=function(e,t){t(e)}}.call(this)}.call(this,R("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":127,"./_stream_duplex":128,"./internal/streams/destroy":135,"./internal/streams/state":139,"./internal/streams/stream":140,_process:118,buffer:49,inherits:102,"util-deprecate":156}],133:[function(i,m,e){!function(b){!function(){"use strict";var e;function r(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}var n=i("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),f=Symbol("ended"),u=Symbol("lastPromise"),c=Symbol("handlePromise"),h=Symbol("stream");function d(e,t){return{value:e,done:t}}function l(e){var t,r=e[o];null!==r&&null!==(t=e[h].read())&&(e[u]=null,e[o]=null,e[s]=null,r(d(t,!1)))}var t=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((r(e={get stream(){return this[h]},next:function(){var r=this,e=this[a];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(d(void 0,!0));if(this[h].destroyed)return new Promise(function(e,t){b.nextTick(function(){r[a]?t(r[a]):e(d(void 0,!0))})});var t,i,n,e=this[u];if(e)t=new Promise((i=e,n=this,function(e,t){i.then(function(){n[f]?e(d(void 0,!0)):n[c](e,t)},t)}));else{e=this[h].read();if(null!==e)return Promise.resolve(d(e,!1));t=new Promise(this[c])}return this[u]=t}},Symbol.asyncIterator,function(){return this}),r(e,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),e),t);m.exports=function(e){var t,i=Object.create(p,(r(t={},h,{value:e,writable:!0}),r(t,o,{value:null,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,f,{value:e._readableState.endEmitted,writable:!0}),r(t,c,{value:function(e,t){var r=i[h].read();r?(i[u]=null,i[o]=null,i[s]=null,e(d(r,!1))):(i[o]=e,i[s]=t)},writable:!0}),t));return i[u]=null,n(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code)return null!==(t=i[s])&&(i[u]=null,i[o]=null,i[s]=null,t(e)),void(i[a]=e);var t=i[o];null!==t&&(i[u]=null,i[o]=null,t(d(void 0,!(i[s]=null)))),i[f]=!0}),e.on("readable",function(e){b.nextTick(l,e)}.bind(null,i)),i}}.call(this)}.call(this,i("_process"))},{"./end-of-stream":136,_process:118}],134:[function(e,t,r){"use strict";function o(t,e){var r,i=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)),i}function n(i){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach(function(e){var t,r;t=i,r=n[e=e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))})}return i}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=e("buffer").Buffer,f=e("util").inspect,u=f&&f.custom||"inspect";t.exports=function(){function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}var t,r,i;return t=e,(r=[{key:"push",value:function(e){e={data:e,next:null};0<this.length?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(e){e={data:e,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){var e;if(0!==this.length)return e=this.head.data,1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,i=a.allocUnsafe(e>>>0),n=this.head,o=0;n;)t=n.data,r=o,a.prototype.copy.call(t,i,r),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,i=t.data;for(e-=i.length;t=t.next;){var n=t.data,o=e>n.length?n.length:e;if(o===n.length?i+=n:i+=n.slice(0,e),0===(e-=o)){o===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t).data=n.slice(o);break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,o=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,o),0===(e-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r).data=n.slice(o);break}++i}return this.length-=i,t}},{key:u,value:function(e,t){return f(this,n({},t,{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),i&&s(t,i),e}()},{buffer:49,util:18}],135:[function(e,t,r){!function(f){!function(){"use strict";function o(e,t){a(e,t),s(e)}function s(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,f.nextTick(a,this,e)):f.nextTick(a,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?f.nextTick(s,r):(r._writableState.errorEmitted=!0,f.nextTick(o,r,e)):f.nextTick(o,r,e):t?(f.nextTick(s,r),t(e)):f.nextTick(s,r)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}}}.call(this)}.call(this,e("_process"))},{_process:118}],136:[function(e,t,r){"use strict";var y=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function g(){}t.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);function n(){t.writable||o()}function o(){b=!(p=!1),l||i.call(t)}function s(){m=!(l=!1),p||i.call(t)}function a(e){i.call(t,e)}function f(){var e;return l&&!m?(t._readableState&&t._readableState.ended||(e=new y),i.call(t,e)):p&&!b?(t._writableState&&t._writableState.ended||(e=new y),i.call(t,e)):void 0}function u(){t.req.on("finish",o)}c=i||g,h=!1,i=function(){if(!h){h=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];c.apply(this,t)}};var c,h,d,l=(r=r||{}).readable||!1!==r.readable&&t.readable,p=r.writable||!1!==r.writable&&t.writable,b=t._writableState&&t._writableState.finished,m=t._readableState&&t._readableState.endEmitted;return(d=t).setHeader&&"function"==typeof d.abort?(t.on("complete",o),t.on("abort",f),t.req?u():t.on("request",u)):p&&!t._writableState&&(t.on("end",n),t.on("close",n)),t.on("end",s),t.on("finish",o),!1!==r.error&&t.on("error",a),t.on("close",f),function(){t.removeListener("complete",o),t.removeListener("abort",f),t.removeListener("request",u),t.req&&t.req.removeListener("finish",o),t.removeListener("end",n),t.removeListener("close",n),t.removeListener("finish",o),t.removeListener("end",s),t.removeListener("error",a),t.removeListener("close",f)}}},{"../../../errors":127}],137:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],138:[function(f,e,t){"use strict";var u;var r=f("../../../errors").codes,a=r.ERR_MISSING_ARGS,c=r.ERR_STREAM_DESTROYED;function h(e){if(e)throw e}function d(r,e,t,i){n=i,o=!1;var n,o,s=!(i=function(){o||(o=!0,n.apply(void 0,arguments))}),a=(r.on("close",function(){s=!0}),(u=void 0===u?f("./end-of-stream"):u)(r,{readable:e,writable:t},function(e){if(e)return i(e);s=!0,i()}),!1);return function(e){var t;if(!s&&!a)return a=!0,(t=r).setHeader&&"function"==typeof t.abort?r.abort():"function"==typeof r.destroy?r.destroy():void i(e||new c("pipe"))}}function l(e){e()}function p(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,i=new Array(e),t=0;t<e;t++)i[t]=arguments[t];var r,n,o=!(r=i).length||"function"!=typeof r[r.length-1]?h:r.pop();if((i=Array.isArray(i[0])?i[0]:i).length<2)throw new a("streams");var s=i.map(function(e,t){var r=t<i.length-1;return d(e,r,0<t,function(e){n=n||e,e&&s.forEach(l),r||(s.forEach(l),o(n))})});return i.reduce(p)}},{"../../../errors":127,"./end-of-stream":136}],139:[function(e,t,r){"use strict";var s=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){o=i,n=r;var n,o=null!=(t=t).highWaterMark?t.highWaterMark:o?t[n]:null;if(null==o)return e.objectMode?16:16384;if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new s(i?r:"highWaterMark",o);return Math.floor(o)}}},{"../../../errors":127}],140:[function(e,t,r){t.exports=e("events").EventEmitter},{events:84}],141:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":128,"./lib/_stream_passthrough.js":129,"./lib/_stream_readable.js":130,"./lib/_stream_transform.js":131,"./lib/_stream_writable.js":132,"./lib/internal/streams/end-of-stream.js":136,"./lib/internal/streams/pipeline.js":138}],142:[function(e,t,r){"use strict";var i=e("buffer").Buffer,n=e("inherits"),o=e("hash-base"),m=new Array(16),y=[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],g=[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],v=[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],_=[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],w=[0,1518500249,1859775393,2400959708,2840853838],M=[1352829926,1548603684,1836072691,2053994217,0];function s(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function S(e,t){return e<<t|e>>>32-t}function A(e,t,r,i,n,o,s,a){return S(e+(t^r^i)+o+s|0,a)+n|0}function k(e,t,r,i,n,o,s,a){return S(e+(t&r|~t&i)+o+s|0,a)+n|0}function E(e,t,r,i,n,o,s,a){return S(e+((t|~r)^i)+o+s|0,a)+n|0}function x(e,t,r,i,n,o,s,a){return S(e+(t&i|r&~i)+o+s|0,a)+n|0}function I(e,t,r,i,n,o,s,a){return S(e+(t^(r|~i))+o+s|0,a)+n|0}n(s,o),s.prototype._update=function(){for(var e=m,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,s=0|this._e,a=0|this._a,f=0|this._b,u=0|this._c,c=0|this._d,h=0|this._e,d=0;d<80;d+=1)var l,p=d<16?(l=A(r,i,n,o,s,e[y[d]],w[0],v[d]),I(a,f,u,c,h,e[g[d]],M[0],_[d])):d<32?(l=k(r,i,n,o,s,e[y[d]],w[1],v[d]),x(a,f,u,c,h,e[g[d]],M[1],_[d])):d<48?(l=E(r,i,n,o,s,e[y[d]],w[2],v[d]),E(a,f,u,c,h,e[g[d]],M[2],_[d])):d<64?(l=x(r,i,n,o,s,e[y[d]],w[3],v[d]),k(a,f,u,c,h,e[g[d]],M[3],_[d])):(l=I(r,i,n,o,s,e[y[d]],w[4],v[d]),A(a,f,u,c,h,e[g[d]],M[4],_[d])),r=s,s=o,o=S(n,10),n=i,i=l,a=h,h=c,c=S(u,10),u=f,f=p;var b=this._b+n+c|0;this._b=this._c+o+h|0,this._c=this._d+s+a|0,this._d=this._e+r+f|0,this._e=this._a+i+u|0,this._a=b},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56<this._blockOffset&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=i.alloc?i.alloc(20):new i(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},t.exports=s},{buffer:49,"hash-base":86,inherits:102}],143:[function(e,t,r){var i=e("buffer"),n=i.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,r),r.Buffer=s),o(n,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=n(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:49}],144:[function(s,a,e){!function(o){!function(){"use strict";var e,t=s("buffer"),i=t.Buffer,r={};for(e in t)t.hasOwnProperty(e)&&"SlowBuffer"!==e&&"Buffer"!==e&&(r[e]=t[e]);var n=r.Buffer={};for(e in i)i.hasOwnProperty(e)&&"allocUnsafe"!==e&&"allocUnsafeSlow"!==e&&(n[e]=i[e]);if(r.Buffer.prototype=i.prototype,n.from&&n.from!==Uint8Array.from||(n.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return i(e,t,r)}),n.alloc||(n.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||2*(1<<30)<=e)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=i(e);return t&&0!==t.length?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e}),!r.kStringMaxLength)try{r.kStringMaxLength=o.binding("buffer").kStringMaxLength}catch(e){}r.constants||(r.constants={MAX_LENGTH:r.kMaxLength},r.kStringMaxLength&&(r.constants.MAX_STRING_LENGTH=r.kStringMaxLength)),a.exports=r}.call(this)}.call(this,s("_process"))},{_process:118,buffer:49}],145:[function(e,t,r){var c=e("safe-buffer").Buffer;function i(e,t){this._block=c.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(e=c.from(e,t=t||"utf8"));for(var r=this._block,i=this._blockSize,n=e.length,o=this._len,s=0;s<n;){for(var a=o%i,f=Math.min(n-s,i-a),u=0;u<f;u++)r[a+u]=e[s+u];s+=f,(o+=f)%i==0&&this._update(r)}return this._len+=n,this},i.prototype.digest=function(e){var t=this._len%this._blockSize,t=(this._block[t]=128,this._block.fill(0,1+t),t>=this._finalSize&&(this._update(this._block),this._block.fill(0)),8*this._len),t=(t<=4294967295?this._block.writeUInt32BE(t,this._blockSize-4):(this._block.writeUInt32BE((t-(t=(4294967295&t)>>>0))/4294967296,this._blockSize-8),this._block.writeUInt32BE(t,this._blockSize-4)),this._update(this._block),this._hash());return e?t.toString(e):t},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":143}],146:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(t)return new t;throw new Error(e+" is not supported (we accept pull requests)")}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":147,"./sha1":148,"./sha224":149,"./sha256":150,"./sha384":151,"./sha512":152}],147:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,p=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,n.call(this,64,56)}i(a,n),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(e){for(var t=this._w,r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,s=0|this._e,a=0;a<16;++a)t[a]=e.readInt32BE(4*a);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var f,u,c,h=0;h<80;++h)var d=~~(h/20),l=0|(r<<5|r>>>27)+(f=i,u=n,c=o,0===(l=d)?f&u|~f&c:2===l?f&u|f&c|u&c:f^u^c)+s+t[h]+p[d],s=o,o=n,n=i<<30|i>>>2,i=r,r=l;this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},a.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=a},{"./hash":145,inherits:102,"safe-buffer":143}],148:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,n.call(this,64,56)}i(a,n),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=(t=r[f-3]^r[f-8]^r[f-14]^r[f-16])<<1|t>>>31;for(var u,c,h,d=0;d<80;++d)var l=~~(d/20),p=0|(i<<5|i>>>27)+(u=n,c=o,h=s,0===(p=l)?u&c|~u&h:2===p?u&c|u&h|c&h:u^c^h)+a+r[d]+b[l],a=s,s=o,o=n<<30|n>>>2,n=i,i=p;this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},a.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=a},{"./hash":145,inherits:102,"safe-buffer":143}],149:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),o=e("./hash"),s=e("safe-buffer").Buffer,a=new Array(64);function f(){this.init(),this._w=a,o.call(this,64,56)}i(f,n),f.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},f.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=f},{"./hash":145,"./sha256":150,inherits:102,"safe-buffer":143}],150:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,b=[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],s=new Array(64);function a(){this.init(),this._w=s,n.call(this,64,56)}i(a,n),a.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},a.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,f=0|this._f,u=0|this._g,c=0|this._h,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<64;++h)r[h]=0|(((t=r[h-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[h-7]+(((t=r[h-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+r[h-16];for(var d=0;d<64;++d)var l=c+((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(u^a&(f^u))+b[d]+r[d]|0,p=0|((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&n|o&(i|n)),c=u,u=f,f=a,a=s+l|0,s=o,o=n,n=i,i=l+p|0;this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=f+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},a.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=a},{"./hash":145,inherits:102,"safe-buffer":143}],151:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),o=e("./hash"),s=e("safe-buffer").Buffer,a=new Array(160);function f(){this.init(),this._w=a,o.call(this,128,112)}i(f,n),f.prototype.init=function(){return 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,this},f.prototype._hash=function(){var i=s.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=f},{"./hash":145,"./sha512":152,inherits:102,"safe-buffer":143}],152:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,q=[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],s=new Array(160);function a(){this.init(),this._w=s,n.call(this,128,112)}function z(e,t,r){return r^e&(t^r)}function H(e,t,r){return e&t|r&(e|t)}function K(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function F(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function V(e,t){return e>>>0<t>>>0?1:0}i(a,n),a.prototype.init=function(){return 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,this},a.prototype._update=function(e){for(var t=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,f=0|this._gh,u=0|this._hh,c=0|this._al,h=0|this._bl,d=0|this._cl,l=0|this._dl,p=0|this._el,b=0|this._fl,m=0|this._gl,y=0|this._hl,g=0;g<32;g+=2)t[g]=e.readInt32BE(4*g),t[g+1]=e.readInt32BE(4*g+4);for(;g<160;g+=2){var v=t[g-30],_=t[g-30+1],w=(v>>>1|_<<31)^(v>>>8|_<<24)^v>>>7,M=(_>>>1|v<<31)^(_>>>8|v<<24)^(_>>>7|v<<25),v=t[g-4],S=((_=t[g-4+1])>>>19|v<<13)^(v>>>29|_<<3)^(_>>>6|v<<26),A=t[g-14],k=t[g-14+1],L=t[g-32],E=t[g-32+1],x=M+k|0,I=w+A+V(x,M)|0;I=(I=I+((v>>>19|_<<13)^(_>>>29|v<<3)^v>>>6)+V(x=x+S|0,S)|0)+L+V(x=x+E|0,E)|0,t[g]=I,t[g+1]=x}for(var P=0;P<160;P+=2){I=t[P],x=t[P+1];var D=H(r,i,n),N=H(c,h,d),U=K(r,c),R=K(c,r),j=F(s,p),B=F(p,s),C=q[P+1],T=z(s,a,f),O=z(p,b,m),B=y+B|0,T=(j=(((u+j+V(B,y)|0)+T+V(B=B+O|0,O)|0)+q[P]+V(B=B+C|0,C)|0)+I+V(B=B+x|0,x)|0,R+N|0),O=U+D+V(T,R)|0,u=f,y=m,f=a,m=b,a=s,b=p,s=o+j+V(p=l+B|0,l)|0,o=n,l=d,n=i,d=h,i=r,h=c,r=j+O+V(c=B+T|0,B)|0}this._al=this._al+c|0,this._bl=this._bl+h|0,this._cl=this._cl+d|0,this._dl=this._dl+l|0,this._el=this._el+p|0,this._fl=this._fl+b|0,this._gl=this._gl+m|0,this._hl=this._hl+y|0,this._ah=this._ah+r+V(this._al,c)|0,this._bh=this._bh+i+V(this._bl,h)|0,this._ch=this._ch+n+V(this._cl,d)|0,this._dh=this._dh+o+V(this._dl,l)|0,this._eh=this._eh+s+V(this._el,p)|0,this._fh=this._fh+a+V(this._fl,b)|0,this._gh=this._gh+f+V(this._gl,m)|0,this._hh=this._hh+u+V(this._hl,y)|0},a.prototype._hash=function(){var i=o.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=a},{"./hash":145,inherits:102,"safe-buffer":143}],153:[function(e,t,r){t.exports=i;var c=e("events").EventEmitter;function i(){c.call(this)}e("inherits")(i,c),i.Readable=e("readable-stream/lib/_stream_readable.js"),i.Writable=e("readable-stream/lib/_stream_writable.js"),i.Duplex=e("readable-stream/lib/_stream_duplex.js"),i.Transform=e("readable-stream/lib/_stream_transform.js"),i.PassThrough=e("readable-stream/lib/_stream_passthrough.js"),i.finished=e("readable-stream/lib/internal/streams/end-of-stream.js"),i.pipeline=e("readable-stream/lib/internal/streams/pipeline.js"),(i.Stream=i).prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",n),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",a));var o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function f(e){if(u(),0===c.listenerCount(this,"error"))throw e}function u(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("error",f),t.on("error",f),r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t}},{events:84,inherits:102,"readable-stream/lib/_stream_duplex.js":128,"readable-stream/lib/_stream_passthrough.js":129,"readable-stream/lib/_stream_readable.js":130,"readable-stream/lib/_stream_transform.js":131,"readable-stream/lib/_stream_writable.js":132,"readable-stream/lib/internal/streams/end-of-stream.js":136,"readable-stream/lib/internal/streams/pipeline.js":138}],154:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.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}};function o(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"==typeof t||i.isEncoding!==n&&n(e))return t||e;throw new Error("Unknown encoding: "+e)}function s(e){var t;switch(this.encoding=o(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=f,t=4;break;case"base64":this.text=h,this.end=d,t=3;break;default:return this.write=l,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function f(e){var t,r=this.lastTotal-this.lastNeed,i=(t=this,128!=(192&(i=e)[0])?(t.lastNeed=0,"�"):1<t.lastNeed&&1<i.length?128!=(192&i[1])?(t.lastNeed=1,"�"):2<t.lastNeed&&2<i.length&&128!=(192&i[2])?(t.lastNeed=2,"�"):void 0:void 0);return void 0!==i?i:this.lastNeed<=e.length?(e.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,r,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1);t=e.toString("utf16le",t);if(t){var r=t.charCodeAt(t.length-1);if(55296<=r&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}function c(e){var t,e=e&&e.length?this.write(e):"";return this.lastNeed?(t=this.lastTotal-this.lastNeed,e+this.lastChar.toString("utf16le",0,t)):e}function h(e,t){var r=(e.length-t)%3;return 0==r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function d(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}(r.StringDecoder=s).prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=function(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+"�":e},s.prototype.text=function(e,t){var r=function(e,t,r){var i=t.length-1;if(!(i<r)){var n=a(t[i]);if(0<=n)return 0<n&&(e.lastNeed=n-1),n;if(!(--i<r||-2===n)){if(0<=(n=a(t[i])))return 0<n&&(e.lastNeed=n-2),n;if(!(--i<r||-2===n)&&0<=(n=a(t[i])))return 0<n&&(2===n?n=0:e.lastNeed=n-3),n}}return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;r=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":155}],155:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:49,dup:48}],156:[function(e,r,t){!function(t){!function(){function i(e){try{if(!t.localStorage)return}catch(e){return}e=t.localStorage[e];return null!=e&&"true"===String(e).toLowerCase()}r.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],157:[function(e,t,r){"use strict";var s=this&&this.__assign||function(){return(s=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},f=(Object.defineProperty(r,"__esModule",{value:!0}),e(".."));function i(e){var t=this;this._clientToSend={},this._isClientConnected={},this._clientIsServer={},this._tooldb=e,setTimeout(function(){t.tooldb.options.server&&t.getMeAsPeer().then(function(e){t.tooldb.serverPeers.push(e)})},100)}Object.defineProperty(i.prototype,"clientToSend",{get:function(){return this._clientToSend},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isClientConnected",{get:function(){return this._isClientConnected},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"tooldb",{get:function(){return this._tooldb},enumerable:!1,configurable:!0}),i.prototype.getMeAsPeer=function(){var t=this,r=(new Date).getTime();return(0,f.getPeerSignature)(this.tooldb.peerAccount,this.tooldb.options.topic,r,this.tooldb.options.host,this.tooldb.options.port).then(function(e){return{topic:t.tooldb.options.topic,timestamp:r,host:t.tooldb.options.host,port:t.tooldb.options.port,address:t.tooldb.peerAccount.getAddress()||"",sig:e}})},i.prototype.isConnected=function(e){return!!this._isClientConnected[e]&&this._isClientConnected[e]()},i.prototype.isServer=function(e){return this._clientIsServer[e]||!1},i.prototype.craftPingMessage=function(){var t=this;return this.getMeAsPeer().then(function(e){return JSON.stringify({type:"ping",clientId:t.getClientAddress(),to:[t.getClientAddress()],isServer:t.tooldb.options.server,id:(0,f.textRandom)(10),peer:e})})},i.prototype.executeSendToClient=function(e,t){this._clientToSend[e]&&this._clientToSend[e](t)},i.prototype.getClientAddress=function(){return(this.tooldb.peerAccount.getAddress()||"").slice(-20)},i.prototype.onClientDisconnect=function(e){delete this._clientToSend[e],delete this._clientIsServer[e]},i.prototype.onClientMessage=function(t,e,r){e&&!this.tooldb.processedOutHashes[e]&&(this.tooldb.processedOutHashes[e]=[]);try{var i,n=JSON.parse(t);"ping"===n.type||"pong"===n.type?(r(i=n.clientId),this.tooldb.onPeerConnect(i),this._clientIsServer[i]=n.isServer,this.tooldb.processedOutHashes[i]=[],this.tooldb.clientOnMessage(n,i)):e&&this.tooldb.clientOnMessage(n,e)}catch(e){this.tooldb.logger("Got message ERR",t),this.tooldb.logger(e)}},i.prototype.sendToAll=function(t,r){var i=this,n=(void 0===r&&(r=!1),(0,f.uniq)(a(a([],t.to,!0),[this.getClientAddress()],!1))),o=JSON.stringify(s(s({},t),{to:n}));Object.keys(this.clientToSend).filter(function(e){return!n.includes(e)}).filter(function(e){return i.isConnected(e)}).forEach(function(e){(r&&i.isServer(e)||!r)&&(i.tooldb.logger(n,"Sent out to:",e),"put"===t.type||"crdtPut"===t.type?i.tooldb.processedOutHashes[e].includes(t.data.h)||(i.executeSendToClient(e,o),i.tooldb.processedOutHashes[e].push(t.data.h)):i.executeSendToClient(e,o))})},i.prototype.sendToClientId=function(e,t){var r=(0,f.uniq)(a(a([],t.to,!0),[this.getClientAddress()],!1)),r=JSON.stringify(s(s({},t),{to:r}));"put"===t.type||"crdtPut"===t.type?e&&!this.tooldb.processedOutHashes[e].includes(t.data.h)&&(this.executeSendToClient(e,r),this.tooldb.processedOutHashes[e].push(t.data.h)):this.executeSendToClient(e,r)},r.default=i},{"..":164}],158:[function(e,t,r){"use strict";function i(e,t){this._tooldb=e,t&&(this._forceStorageName=t)}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(i.prototype,"tooldb",{get:function(){return this._tooldb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"storageName",{get:function(){return this._forceStorageName||this._tooldb.options.storageName},enumerable:!1,configurable:!0}),i.prototype.put=function(e,t){return Promise.resolve()},i.prototype.get=function(e){return Promise.resolve("")},i.prototype.query=function(e){return Promise.resolve([])},r.default=i},{}],159:[function(e,t,r){"use strict";function i(e){this._tooldb=e}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(i.prototype,"tooldb",{get:function(){return this._tooldb},enumerable:!1,configurable:!0}),i.prototype.anonUser=function(){},i.prototype.setUser=function(e,t){},i.prototype.signData=function(e){return Promise.resolve("")},i.prototype.verifySignature=function(e){return Promise.resolve(!1)},i.prototype.getAccountFromPrivate=function(e){return Promise.resolve(void 0)},i.prototype.encryptAccount=function(e){return Promise.resolve(void 0)},i.prototype.decryptAccount=function(e,t){return Promise.resolve(void 0)},i.prototype.getAddress=function(){return""},i.prototype.getUsername=function(){return""},r.default=i},{}],160:[function(e,t,r){"use strict";function i(){this.type=""}Object.defineProperty(r,"__esModule",{value:!0}),r.BaseCrdt=r.CRDT_COUNTER=r.CRDT_LIST=r.CRDT_MAP=void 0,r.CRDT_MAP="MAP",r.CRDT_LIST="LIST",r.CRDT_COUNTER="COUNTER",i.prototype.mergeChanges=function(e){},i.prototype.getChanges=function(){return[]},Object.defineProperty(i.prototype,"value",{get:function(){return""},enumerable:!1,configurable:!0}),r.BaseCrdt=i},{}],161:[function(e,t,r){"use strict";var i,n,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=(Object.defineProperty(r,"__esModule",{value:!0}),r.CounterCrdt=void 0,e("..")),e=(n=s.BaseCrdt,o(a,n),a.prototype.changesSort=function(e,t){return e.i>t.i?1:e.i<t.i?-1:0},a.prototype.calculate=function(){var t=0;Object.values(this._changes).length!==this._lastUpdateSize&&(this._changes.sort(this.changesSort).forEach(function(e){"ADD"===e.t?t+=e.v:"SUB"===e.t&&(t-=e.v)}),this._value=t)},Object.defineProperty(a.prototype,"value",{get:function(){return this.calculate(),this._value},enumerable:!1,configurable:!0}),a.prototype.mergeChanges=function(e){var r=this;e.forEach(function(t){0===r._changes.filter(function(e){return e.i===t.i&&e.a===t.a&&e.t===t.t}).length&&r._changes.push(t)}),this.calculate()},a.prototype.getChanges=function(){return this._changes},a.prototype.ADD=function(e){var t=this,r=this._changes.filter(function(e){return e.a===t._author});this._changes.push({t:"ADD",v:e,a:this._author,i:r.length}),this.calculate()},a.prototype.SUB=function(e){var t=this,r=this._changes.filter(function(e){return e.a===t._author});this._changes.push({t:"SUB",v:e,a:this._author,i:r.length}),this.calculate()},a);function a(e,t){var r=n.call(this)||this;return r.type=s.CRDT_LIST,r._changes=[],r._author="",r._value=0,r._lastUpdateSize=0,r._author=e,t&&r.mergeChanges(t),r.calculate(),r}r.CounterCrdt=e},{"..":164}],162:[function(e,t,r){"use strict";var i,n,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=(Object.defineProperty(r,"__esModule",{value:!0}),r.ListCrdt=void 0,e("..")),e=(n=s.BaseCrdt,o(a,n),a.prototype.changesSort=function(e,t){return e.i>t.i?1:e.i<t.i?-1:0},a.prototype.calculate=function(){var i=[];Object.values(this._changes).length!==this._lastUpdateSize&&(this._changes.sort(this.changesSort).forEach(function(t){var e,r;"INS"===t.t?(r=0,t.p?r=i.findIndex(function(e){return e.index===t.p})+1:t.n&&(r=i.findIndex(function(e){return e.index===t.n})),e={value:t.v,index:t.i,tomb:!1,prev:t.p,next:t.n},i.splice(r,0,e)):"DEL"===t.t&&(r=i.findIndex(function(e){return e.index===t.v}),i[r].tomb=!0)}),this._lastUpdateSize=Object.values(i).length,this._tempValues=i,this._value=i.filter(function(e){return!e.tomb}).map(function(e){return e.value}))},Object.defineProperty(a.prototype,"value",{get:function(){return this.calculate(),this._value},enumerable:!1,configurable:!0}),a.prototype.mergeChanges=function(e){var r=this;e.forEach(function(t){0===r._changes.filter(function(e){return e.i===t.i&&e.t===t.t&&e.v===t.v}).length&&r._changes.push(t)}),this.calculate()},a.prototype.getChanges=function(){return this._changes},a.prototype.INS=function(e,t){var r,i=this,n=this._tempValues.filter(function(e){return!e.tomb}),o=void 0,s=void 0,t=(0!==n.length&&(r=n[t].index,n=this._tempValues.findIndex(function(e){return e.index===r}),o=this._tempValues[n-1],s=this._tempValues[n]),this._changes.filter(function(e){return e.i.startsWith(i._author)}));this._changes.push({t:"INS",p:null==o?void 0:o.index,n:null==s?void 0:s.index,v:e,i:this._author+"-"+"".concat(t.length).padStart(8,"0")}),this.calculate()},a.prototype.PUSH=function(e){var t=this,r=this._tempValues.filter(function(e){return!e.tomb}),i=null==(r=r[r.length-1])?void 0:r.index,r=this._tempValues.findIndex(function(e){return e.index===i}),r=this._tempValues[r],n=this._changes.filter(function(e){return e.i.startsWith(t._author)});this._changes.push({t:"INS",p:null==r?void 0:r.index,n:void 0,v:e,i:this._author+"-"+"".concat(n.length).padStart(8,"0")}),this.calculate()},a.prototype.DEL=function(e){var t=this,r=this._tempValues.filter(function(e){return!e.tomb})[e].index,e=this._tempValues.findIndex(function(e){return e.index===r}),e=this._tempValues[e],i=this._changes.filter(function(e){return e.i.startsWith(t._author)});this._changes.push({t:"DEL",v:e.index,i:this._author+"-"+"".concat(i.length).padStart(8,"0")}),this.calculate()},a);function a(e,t){var r=n.call(this)||this;return r.type=s.CRDT_LIST,r._changes=[],r._author="",r._value=[],r._tempValues=[],r._lastUpdateSize=0,r._author=e,t&&r.mergeChanges(t),r.calculate(),r}r.ListCrdt=e},{"..":164}],163:[function(e,t,r){"use strict";var i,n,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=(Object.defineProperty(r,"__esModule",{value:!0}),r.MapCrdt=void 0,e("..")),e=(n=s.BaseCrdt,o(a,n),a.prototype.changesSort=function(e,t){return e.i<t.i?-1:e.i>t.i?1:"SET"===e.t&&"DEL"===t.t?-1:"DEL"===e.t&&"SET"===t.t?1:e.a<t.a?-1:e.a>t.a?1:0},a.prototype.calculate=function(){var t=this,r={};Object.values(this._changes).length!==this._lastUpdateSize&&(this._changes.sort(this.changesSort).forEach(function(e){"SET"===e.t?r[e.k]=e.v:"DEL"===e.t&&delete r[e.k],t._keyIndex[e.k]=e.i}),this._lastUpdateSize=Object.values(r).length,this._value=r)},Object.defineProperty(a.prototype,"value",{get:function(){return this.calculate(),this._value},enumerable:!1,configurable:!0}),a.prototype.mergeChanges=function(e){var r=this;e.forEach(function(t){0===r._changes.filter(function(e){return e.i===t.i&&e.a===t.a&&e.t===t.t}).length&&r._changes.push(t)}),this.calculate()},a.prototype.getChanges=function(){return this._changes},a.prototype.SET=function(e,t){this._keyIndex[e]=(this._keyIndex[e]||0)+1,this._changes.push({t:"SET",k:e,a:this._author,v:t,i:this._keyIndex[e]})},a.prototype.DEL=function(e){this._keyIndex[e]=(this._keyIndex[e]||0)+1,this._changes.push({t:"DEL",k:e,a:this._author,i:this._keyIndex[e]})},a);function a(e,t){var r=n.call(this)||this;return r.type=s.CRDT_MAP,r._changes=[],r._author="",r._value={},r._keyIndex={},r._lastUpdateSize=0,r._author=e,t&&r.mergeChanges(t),r.calculate(),r}r.MapCrdt=e},{"..":164}],164:[function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&("get"in n?t.__esModule:!n.writable&&!n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){e[i=void 0===i?r:i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=(Object.defineProperty(r,"__esModule",{value:!0}),r.ToolDb=r.handlePut=r.handleGet=r.handlePong=r.handlePing=r.handleQuery=r.handleCrdtPut=r.handleCrdtGet=r.handleFunction=r.handleSubscribe=r.ToolDbUserAdapter=r.ToolDbStorageAdapter=r.ToolDbNetworkAdapter=r.hexToUint8=r.hexToString=r.hexToArrayBuffer=r.arrayBufferToHex=r.arrayBufferToString=r.stringToArrayBuffer=r.catchReturn=r.textRandom=r.verifyPeer=r.getPeerSignature=r.verifyMessage=r.randomAnimal=r.uniq=r.sha256=r.sha1=r.proofOfWork=void 0,e("./utils/proofOfWork")),a=(Object.defineProperty(r,"proofOfWork",{enumerable:!0,get:function(){return o(s).default}}),e("./utils/sha1")),f=(Object.defineProperty(r,"sha1",{enumerable:!0,get:function(){return o(a).default}}),e("./utils/sha256")),u=(Object.defineProperty(r,"sha256",{enumerable:!0,get:function(){return o(f).default}}),e("./utils/uniq")),c=(Object.defineProperty(r,"uniq",{enumerable:!0,get:function(){return o(u).default}}),e("./utils/randomAnimal")),h=(Object.defineProperty(r,"randomAnimal",{enumerable:!0,get:function(){return o(c).default}}),e("./utils/verifyMessage")),d=(Object.defineProperty(r,"verifyMessage",{enumerable:!0,get:function(){return o(h).default}}),e("./utils/getPeerSignature")),l=(Object.defineProperty(r,"getPeerSignature",{enumerable:!0,get:function(){return o(d).default}}),e("./utils/verifyPeer")),p=(Object.defineProperty(r,"verifyPeer",{enumerable:!0,get:function(){return o(l).default}}),e("./utils/textRandom")),b=(Object.defineProperty(r,"textRandom",{enumerable:!0,get:function(){return o(p).default}}),e("./utils/catchReturn")),m=(Object.defineProperty(r,"catchReturn",{enumerable:!0,get:function(){return o(b).default}}),e("./utils/encoding/stringToArrayBuffer")),y=(Object.defineProperty(r,"stringToArrayBuffer",{enumerable:!0,get:function(){return o(m).default}}),e("./utils/encoding/arrayBufferToString")),g=(Object.defineProperty(r,"arrayBufferToString",{enumerable:!0,get:function(){return o(y).default}}),e("./utils/encoding/arrayBufferToHex")),v=(Object.defineProperty(r,"arrayBufferToHex",{enumerable:!0,get:function(){return o(g).default}}),e("./utils/encoding/hexToArrayBuffer")),_=(Object.defineProperty(r,"hexToArrayBuffer",{enumerable:!0,get:function(){return o(v).default}}),e("./utils/encoding/hexToString")),w=(Object.defineProperty(r,"hexToString",{enumerable:!0,get:function(){return o(_).default}}),e("./utils/encoding/hexToUint8")),M=(Object.defineProperty(r,"hexToUint8",{enumerable:!0,get:function(){return o(w).default}}),e("./adapters-base/networkAdapter")),S=(Object.defineProperty(r,"ToolDbNetworkAdapter",{enumerable:!0,get:function(){return o(M).default}}),e("./adapters-base/storageAdapter")),A=(Object.defineProperty(r,"ToolDbStorageAdapter",{enumerable:!0,get:function(){return o(S).default}}),e("./adapters-base/userAdapter")),k=(Object.defineProperty(r,"ToolDbUserAdapter",{enumerable:!0,get:function(){return o(A).default}}),n(e("./types/tooldb"),r),n(e("./types/message"),r),n(e("./crdt/baseCrdt"),r),n(e("./crdt/counterCrdt"),r),n(e("./crdt/listCrdt"),r),n(e("./crdt/mapCrdt"),r),e("./messageHandlers/handleSubscribe")),E=(Object.defineProperty(r,"handleSubscribe",{enumerable:!0,get:function(){return o(k).default}}),e("./messageHandlers/handleFunction")),x=(Object.defineProperty(r,"handleFunction",{enumerable:!0,get:function(){return o(E).default}}),e("./messageHandlers/handleCrdtGet")),I=(Object.defineProperty(r,"handleCrdtGet",{enumerable:!0,get:function(){return o(x).default}}),e("./messageHandlers/handleCrdtPut")),P=(Object.defineProperty(r,"handleCrdtPut",{enumerable:!0,get:function(){return o(I).default}}),e("./messageHandlers/handleQuery")),R=(Object.defineProperty(r,"handleQuery",{enumerable:!0,get:function(){return o(P).default}}),e("./messageHandlers/handlePing")),j=(Object.defineProperty(r,"handlePing",{enumerable:!0,get:function(){return o(R).default}}),e("./messageHandlers/handlePong")),B=(Object.defineProperty(r,"handlePong",{enumerable:!0,get:function(){return o(j).default}}),e("./messageHandlers/handleGet")),C=(Object.defineProperty(r,"handleGet",{enumerable:!0,get:function(){return o(B).default}}),e("./messageHandlers/handlePut")),T=(Object.defineProperty(r,"handlePut",{enumerable:!0,get:function(){return o(C).default}}),e("./tooldb"));Object.defineProperty(r,"ToolDb",{enumerable:!0,get:function(){return o(T).default}})},{"./adapters-base/networkAdapter":157,"./adapters-base/storageAdapter":158,"./adapters-base/userAdapter":159,"./crdt/baseCrdt":160,"./crdt/counterCrdt":161,"./crdt/listCrdt":162,"./crdt/mapCrdt":163,"./messageHandlers/handleCrdtGet":166,"./messageHandlers/handleCrdtPut":167,"./messageHandlers/handleFunction":168,"./messageHandlers/handleGet":169,"./messageHandlers/handlePing":170,"./messageHandlers/handlePong":171,"./messageHandlers/handlePut":172,"./messageHandlers/handleQuery":173,"./messageHandlers/handleSubscribe":174,"./tooldb":188,"./types/message":189,"./types/tooldb":190,"./utils/catchReturn":191,"./utils/encoding/arrayBufferToHex":192,"./utils/encoding/arrayBufferToString":193,"./utils/encoding/hexToArrayBuffer":194,"./utils/encoding/hexToString":195,"./utils/encoding/hexToUint8":196,"./utils/encoding/stringToArrayBuffer":197,"./utils/getPeerSignature":198,"./utils/proofOfWork":199,"./utils/randomAnimal":200,"./utils/sha1":201,"./utils/sha256":202,"./utils/textRandom":203,"./utils/uniq":204,"./utils/verifyMessage":205,"./utils/verifyPeer":206}],165:[function(e,t,r){"use strict";var f=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},u=(Object.defineProperty(r,"__esModule",{value:!0}),e("."));r.default=function(e,t,r,i,n,o){var s,a;this.options.debug&&(s=(a="undefined"==typeof window)?this.options.storageName:"%c"+this.options.storageName,a=a?"":"background: #"+(0,u.sha1)(this.options.storageName).slice(-6)+"; padding: 2px; color: black",console.log.apply(console,f([s,a],[e,t,r,i,n,n,o].slice(0,arguments.length),!1)))}},{".":164}],166:[function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},s=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(r,i){var n=this;this.store.get(r.key).then(function(e){try{var t={type:"crdtPut",data:JSON.parse(e),to:[],id:r.id};n.network.sendToClientId(i,t)}catch(e){}}).catch(function(e){var t=o(o({},r),{to:s(s([],r.to,!0),[i],!1)});n.logger("Local key not found, relay",JSON.stringify(t)),n.network.sendToAll(t,!1)})}},{}],167:[function(e,t,r){"use strict";var u=this&&this.__assign||function(){return(u=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},c=(Object.defineProperty(r,"__esModule",{value:!0}),e("..")),o=n(e("../toolDbVerificationWrapper"));r.default=function(a,t){var f=this;o.default.call(this,a.data).then(function(e){var s;e===c.VerifyResult.Verified?(s=u(u({},a),{to:i(i([],a.to,!0),[t],!1)}),f.emit("crdtput",s),f.emit("data",s.data),f.emit("verified",s),f.network.sendToAll(s,!0),f.store.get(s.data.k).then(function(t){try{var e,r=JSON.parse(t),i=s,n=void 0,o=(r.c===c.CRDT_MAP&&(n=new c.MapCrdt(f.userAccount.getAddress()||"",r.v)),r.c===c.CRDT_LIST&&(n=new c.ListCrdt(f.userAccount.getAddress()||"",r.v)),r.c===c.CRDT_COUNTER&&(n=new c.CounterCrdt(f.userAccount.getAddress()||"",r.v)),[]);n&&(n.mergeChanges(s.data.v),o=n.getChanges()),(i=u({},s)).data.v=o,r.t<s.data.t?(e=i.data.k,f.triggerKeyListener(e,i.data),f.store.put(i.data.k,JSON.stringify(i.data)).catch(function(e){})):(e=a.data.k,f.triggerKeyListener(e,r))}catch(e){f.logger("Couldnt parse crdt data",t,e)}}).catch(function(e){var t=s.data.k;f.triggerKeyListener(t,s.data),f.store.put(s.data.k,JSON.stringify(s.data)).catch(function(e){})})):f.logger("unverified message: ",e,a)})}},{"..":164,"../toolDbVerificationWrapper":187}],168:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,r){var i=this;if(this.functions[t.function])try{this.functions[t.function](t.args).then(function(e){e={return:e,type:"functionReturn",id:t.id,code:"OK",to:[]};i.network.sendToClientId(r,e)}).catch(function(e){e={return:JSON.stringify(e),type:"functionReturn",id:t.id,code:"ERR",to:[]};i.network.sendToClientId(r,e)})}catch(e){var n={return:e.toString(),type:"functionReturn",id:t.id,code:"ERR",to:[]};this.network.sendToClientId(r,n)}else{n={return:"Function not found",type:"functionReturn",id:t.id,code:"NOT_FOUND",to:[]};this.network.sendToClientId(r,n)}}},{}],169:[function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},s=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(r,i){var n=this;this.store.get(r.key).then(function(e){try{var t={type:"put",data:JSON.parse(e),to:[],id:r.id};n.network.sendToClientId(i,t)}catch(e){}}).catch(function(e){var t=o(o({},r),{to:s(s([],r.to,!0),[i],!1)});n.logger("Local key not found, relay",JSON.stringify(t)),n.network.sendToAll(t,!1)})}},{}],170:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("..");r.default=function(t,r){var i=this;this.isConnected||(this.isConnected=!0,this.onConnect()),(0,n.verifyPeer)(this,t.peer).then(function(e){e&&t.peer.topic===i.options.topic?(0===i.serverPeers.filter(function(e){return e.address===t.peer.address}).length&&t.isServer&&i.serverPeers.push(t.peer),i.network.sendToClientId(r,{type:"pong",isServer:i.options.server,clientId:i.network.getClientAddress(),to:[],servers:i.serverPeers,id:t.id}),i.onPeerConnect(i.peerAccount.getAddress()||"")):i.logger("Blocked a remote peer from joining; ",e,t)})}},{"..":164}],171:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e("..");r.default=function(e,t){var r=this;this.isConnected||(this.isConnected=!0,this.onConnect()),e.servers.forEach(function(t){(0,i.verifyPeer)(r,t).then(function(e){e&&t.topic===r.options.topic&&0===r.serverPeers.filter(function(e){return e.address===t.address}).length&&t.host&&t.port&&r.serverPeers.push(t)})}),this.onPeerConnect(this.peerAccount.getAddress()||"")}},{"..":164}],172:[function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},s=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},a=(Object.defineProperty(r,"__esModule",{value:!0}),e("..")),f=i(e("../toolDbVerificationWrapper"));r.default=function(i,t){var n=this;f.default.call(this,i.data).then(function(e){var r;e===a.VerifyResult.Verified?(n.emit("put",i),n.emit("data",i.data),n.emit("verified",i),r=o(o({},i),{to:s(s([],i.to,!0),[t],!1)}),n.network.sendToAll(r,!0),n.store.get(r.data.k).then(function(e){var t,e=JSON.parse(e);e.t<r.data.t?(t=r.data.k,n.triggerKeyListener(t,r.data),n.store.put(r.data.k,JSON.stringify(r.data)).catch(function(e){})):(t=r.data.k,n.triggerKeyListener(t,e))}).catch(function(e){var t=i.data.k;n.triggerKeyListener(t,i.data),n.store.put(i.data.k,JSON.stringify(i.data)).catch(function(e){})})):n.logger("unverified message: ",e,i)})}},{"..":164,"../toolDbVerificationWrapper":187}],173:[function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,r){var e,i=this;this.store.query(t.key).then(function(e){i.network.sendToClientId(r,{type:"queryAck",id:t.id,to:[],keys:e})}).catch(function(e){}),this.options.server&&(e=n(n({},t),{to:o(o([],t.to,!0),[r],!1)}),this.network.sendToAll(e,!0))}},{}],174:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(r,i){var n=this,e=i+"-"+r.key;this.subscriptions.includes(e)||(this.subscriptions.push(e),this.addKeyListener(r.key,function(e){i&&(e={data:e,id:r.id,type:"put",to:[]},n.network.sendToClientId(i,e))})),this.store.get(r.key).then(function(e){try{var t={data:JSON.parse(e),id:r.id,type:"put",to:[]};n.network.sendToClientId(i,t)}catch(e){}}).catch(function(e){})}},{}],175:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){this.userAccount.anonUser()}},{}],176:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){var r;if(this.processedIds[e.type]||(this.processedIds[e.type]=[]),!this.processedIds[e.type].includes(e.id))if(this.emit("message",e,t),this.processedIds[e.type].push(e.id),this.logger("Got message ".concat(e.type," from ").concat(t)),this.logger(e),e.id&&(r=e.id,this._idListeners[r]&&(this._idListeners[r](e),this.removeIdListener(r))),void 0===e||void 0===e.type)this.logger("Message is invalid!",e,typeof e);else switch(e.type){case"ping":this.handlePing(e,t);break;case"pong":this.handlePong(e,t);break;case"subscribe":this.handleSubscribe(e,t);break;case"get":this.handleGet(e,t);break;case"put":this.handlePut(e,t);break;case"crdtPut":this.handleCrdtPut(e,t);break;case"crdtGet":this.handleCrdtGet(e,t);break;case"query":this.handleQuery(e,t);break;case"function":this.handleFunction(e,t)}}},{}],177:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var h=e(".");r.default=function(e,s,a,f,u){var c=this;return void 0===a&&(a=!1),void 0===f&&(f=1e3),new Promise(function(r,t){var i,n,o;a&&void 0===c.userAccount.getAddress()?t(new Error("You are not authorized yet!")):(i=a?":".concat(c.userAccount.getAddress(),".").concat(e):e,c.logger("CRDT GET",i),n=(0,h.textRandom)(10),o=setTimeout(function(){c.store.get(i).then(function(e){try{var t=JSON.parse(e);s.mergeChanges(t.v),c.emit("data",t),r(t)}catch(e){r(null)}}).catch(function(e){return t(null)})},f),c.addIdListener(n,function(e){c.logger("GET RECV",i),clearTimeout(o),"crdtPut"===e.type&&(s.mergeChanges(e.data.v),r(e))}),c.store.get(i).then(function(e){try{var t=JSON.parse(e);clearTimeout(o),c.removeIdListener(n),s.mergeChanges(t.v),c.emit("data",t),r(t)}catch(e){}}).catch(function(){}),c.network.sendToAll({type:"crdtGet",to:u||[],key:i,id:n}))})}},{".":164}],178:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var h=e(".");r.default=function(s,a,f,u){var c=this;return void 0===f&&(f=!1),new Promise(function(i,e){var n,o,t;s.includes(".")?e(new Error("Key cannot include dots!; ".concat(s))):c.userAccount.getAddress()?(n=(new Date).getTime(),o=a.getChanges(),t=JSON.stringify(o),t="".concat(t).concat(c.userAccount.getAddress()).concat(n),(0,h.proofOfWork)(t,c.options.pow).then(function(e){var t=e.hash,r=e.nonce;c.userAccount.signData(t).then(function(e){e&&c.userAccount.getAddress()&&(e={k:f?":".concat(c.userAccount.getAddress(),".").concat(s):s,a:c.userAccount.getAddress()||"",n:r,t:n,h:t,s:e,v:o,c:a.type},c.logger("PUT CRDT",s,e),e={type:"crdtPut",id:(0,h.textRandom)(10),to:u||[],data:e},c.network.sendToAll(e),i(e))})}).catch(e)):e(new Error("You need to log in before you can PUT."))})}},{".":164}],179:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var f=e(".");r.default=function(n,o,s){var a=this;return void 0===s&&(s=1e4),new Promise(function(t,e){a.logger("FUNCTION > "+n);var r=(0,f.textRandom)(10),i=setTimeout(function(){t({return:"Timed out",code:"ERR"})},s);a.addIdListener(r,function(e){a.logger("FUNCTION RECV > "+n,e),clearTimeout(i),"functionReturn"===e.type&&t({return:e.return,code:e.code})}),a.network.sendToAll({type:"function",to:[],function:n,args:o,id:r})})}},{".":164}],180:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var c=e(".");r.default=function(r,s,a,f){var u=this;return void 0===s&&(s=!1),void 0===a&&(a=1e3),new Promise(function(i,e){var t,n,o;s&&void 0===u.userAccount.getAddress()?e(new Error("You are not authorized yet!")):(t=s?":".concat(u.userAccount.getAddress(),".").concat(r):r,u.logger("GET",t),n=(0,c.textRandom)(10),o=setTimeout(function(){u.store.get(t).then(function(e){try{var t=JSON.parse(e);u.emit("data",t),i(t.v)}catch(e){i(null)}}).catch(function(e){i(null)})},a),u.addIdListener(n,function(e){u.logger("GET RECV",t),clearTimeout(o),"put"===e.type&&i(e.data.v)}),u.store.get(t).then(function(e){try{var t=JSON.parse(e),r=t.v;clearTimeout(o),u.removeIdListener(n),u.emit("data",t),i(r)}catch(e){}}).catch(function(e){}),u.network.sendToAll({type:"get",to:f||[],key:t,id:n}))})}},{".":164}],181:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e(".");r.default=function(e,t){var r=this;return this.userAccount?this.userAccount.getAccountFromPrivate(e).then(function(e){return r.userAccount.setUser(e,t||(0,i.randomAnimal)()),e}):Promise.resolve(void 0)}},{".":164}],182:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var d=e(".");r.default=function(a,f,u,c){var h=this;return void 0===u&&(u=!1),new Promise(function(o,e){var s,t;a.includes(".")?e(new Error("Key cannot include dots!; ".concat(a))):h.userAccount&&h.userAccount.getAddress()?(s=(new Date).getTime(),t="".concat(JSON.stringify(f)).concat(h.userAccount.getAddress()).concat(s),(0,d.proofOfWork)(t,h.options.pow).then(function(e){var i=e.hash,n=e.nonce;h.userAccount.signData(i).then(function(e){var t,r;e&&h.userAccount.getAddress()&&(e={k:t=u?":".concat(h.userAccount.getAddress(),".").concat(a):a,a:h.userAccount.getAddress()||"",n:n,t:s,h:i,s:e,v:f,c:null},h.logger("PUT",a,e),r={type:"put",id:(0,d.textRandom)(10),to:c||[],data:e},h.network.sendToAll(r),h.store.put(t,JSON.stringify(e)).catch(function(e){}).finally(function(){o(r)}))})}).catch(e)):e(new Error("You need to log in before you can PUT."))})}},{".":164}],183:[function(e,t,r){"use strict";var d=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||((i=i||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},l=(Object.defineProperty(r,"__esModule",{value:!0}),e("."));r.default=function(s,a,f,u){var c=this,h=(void 0===a&&(a=!1),void 0===f&&(f=1e3),this.userAccount);return new Promise(function(e,t){var r,i,n,o;a&&void 0===h.getAddress()?t(new Error("You are not authorized yet!")):(r=a?":".concat(h.getAddress(),".").concat(s):s,c.logger("QUERY",r),t=(0,l.textRandom)(10),i=[],c.store.query(r).then(function(e){i=d(d([],i,!0),e,!0),n=setTimeout(o,f)}).catch(function(e){}),o=function(){e((0,l.uniq)(i))},c.addIdListener(t,function(e){c.logger("QUERY RECV",r),"queryAck"===e.type&&(i=d(d([],i,!0),e.keys,!0),n&&clearTimeout(n),n=setTimeout(o,f))}),c.network.sendToAll({type:"query",to:u||[],key:r,id:t}))})}},{".":164}],184:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s=e(".");r.default=function(n,e,t){var o=this;return new Promise(function(r,i){o.getData("==".concat(n),!1,5e3,t).then(function(t){if(t)try{o.userAccount.decryptAccount(t,(0,s.sha256)(e)).then(function(e){o.userAccount.setUser(e,n||"Anonymous ".concat((0,s.randomAnimal)())),r(t)})}catch(e){i(e)}else i("Could not find user")})})}},{".":164}],185:[function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,s,a,f){return new(a=a||Promise)(function(r,t){function i(e){try{o(f.next(e))}catch(e){t(e)}}function n(e){try{o(f.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(i,n)}o((f=f.apply(e,s||[])).next())})},n=this&&this.__generator||function(i,n){var o,s,a,f={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;f;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return f.label++,{value:t[1],done:!1};case 5:f.label++,s=t[1],t=[0];continue;case 7:t=f.ops.pop(),f.trys.pop();continue;default:if(!(a=0<(a=f.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){f=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){f.label=t[1];break}if(6===t[0]&&f.label<a[1]){f.label=a[1],a=t;break}if(a&&f.label<a[2]){f.label=a[2],f.ops.push(t);break}a[2]&&f.ops.pop(),f.trys.pop();continue}t=n.call(i,f)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},h=(Object.defineProperty(r,"__esModule",{value:!0}),e("."));r.default=function(t,r,c){return i(this,void 0,void 0,function(){var f,u=this;return n(this,function(e){return f="==".concat(t),[2,new Promise(function(a,t){u.getData(f,!1,3e3,c).then(function(e){var s;null===e?(s=new u.options.userAdapter(u)).encryptAccount((0,h.sha256)(r)).then(function(n){var o=(new Date).getTime(),e="".concat(JSON.stringify(n)).concat(s.getAddress()).concat(o);(0,h.proofOfWork)(e,0).then(function(e){var r=e.hash,i=e.nonce;s.signData(r).then(function(e){var e={k:f,a:s.getAddress()||"",n:i,t:o,h:r,s:e,v:n,c:null},t=(u.logger("SIGNUP PUT",f,e),{type:"put",id:(0,h.textRandom)(10),to:c||[],data:e});u.network.sendToAll(t),u.store.put(f,JSON.stringify(e)).catch(function(e){}).finally(function(){a(t)})})}).catch(t)}):t(new Error("User already exists!"))}).catch(function(){t(new Error("Could not fetch user"))})})]})})}},{".":164}],186:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e(".");r.default=function(i,n,o){var s=this;return void 0===n&&(n=!1),new Promise(function(e,t){var r;n&&void 0===s.userAccount.getAddress()?t(new Error("You are not authorized yet!")):(r=n?":".concat(s.userAccount.getAddress(),".").concat(i):i,s.logger("SUBSCRIBE",r),t=(0,a.textRandom)(10),s.network.sendToAll({type:"subscribe",key:r,to:o||[],id:t}),s.store.get(r).then(function(e){try{var t=JSON.parse(e);s.triggerKeyListener(r,t)}catch(e){}}).catch(function(e){}).finally(function(){e()}))})}},{".":164}],187:[function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,s,a,f){return new(a=a||Promise)(function(r,t){function i(e){try{o(f.next(e))}catch(e){t(e)}}function n(e){try{o(f.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(i,n)}o((f=f.apply(e,s||[])).next())})},s=this&&this.__generator||function(i,n){var o,s,a,f={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;f;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return f.label++,{value:t[1],done:!1};case 5:f.label++,s=t[1],t=[0];continue;case 7:t=f.ops.pop(),f.trys.pop();continue;default:if(!(a=0<(a=f.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){f=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){f.label=t[1];break}if(6===t[0]&&f.label<a[1]){f.label=a[1],a=t;break}if(a&&f.label<a[2]){f.label=a[2],f.ops.push(t);break}a[2]&&f.ops.pop(),f.trys.pop();continue}t=n.call(i,f)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},a=(Object.defineProperty(r,"__esModule",{value:!0}),e("."));r.default=function(o){var e=this;return new Promise(function(n){e.verifyMessage(o,e.options.pow).then(function(t){return i(e,void 0,void 0,function(){var r,i=this;return s(this,function(e){return t?(r=!0,this._customVerificator.forEach(function(e){var t;e&&o.k&&o.k.startsWith(e.key)&&(r=!1,t=void 0,i.store.get(o.k).then(function(e){try{t=JSON.parse(e)}catch(e){}}).catch(function(e){}).finally(function(){e.fn(o,t).then(function(e){n(e?a.VerifyResult.Verified:a.VerifyResult.CustomVerificationFailed)}).catch(function(e){n(a.VerifyResult.CustomVerificationFailed)})}))}),r&&n(t)):n(a.VerifyResult.InvalidVerification),[2]})})})})}},{".":164}],188:[function(e,t,r){"use strict";var i,n,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__assign||function(){return(s=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},f=(Object.defineProperty(r,"__esModule",{value:!0}),a(e("events"))),u=e("."),c=a(e("./toolDbGet")),h=a(e("./toolDbPut")),d=a(e("./toolDbSignIn")),l=a(e("./toolDbSignUp")),p=a(e("./toolDbCrdtGet")),b=a(e("./toolDbCrdtPut")),m=a(e("./toolDbFunction")),y=a(e("./toolDbAnonSignIn")),g=a(e("./toolDbClientOnMessage")),v=a(e("./toolDbVerificationWrapper")),_=a(e("./toolDbQueryKeys")),w=a(e("./toolDbKeysSignIn")),M=a(e("./toolDbSubscribe")),S=a(e("./messageHandlers/handleGet")),A=a(e("./messageHandlers/handlePut")),k=a(e("./messageHandlers/handlePing")),E=a(e("./messageHandlers/handlePong")),x=a(e("./messageHandlers/handleQuery")),I=a(e("./messageHandlers/handleFunction")),P=a(e("./messageHandlers/handleCrdtGet")),R=a(e("./messageHandlers/handleCrdtPut")),j=a(e("./messageHandlers/handleSubscribe")),B=a(e("./logger")),a=(n=f.default,o(C,n),Object.defineProperty(C.prototype,"subscriptions",{get:function(){return this._subscriptions},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"processedIds",{get:function(){return this._processedIds},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"processedOutHashes",{get:function(){return this._processedOutHashes},enumerable:!1,configurable:!0}),C.prototype.getUserNamespacedKey=function(e){var t;return":"+((null==(t=this.userAccount)?void 0:t.getAddress())||"")+"."+e},Object.defineProperty(C.prototype,"functions",{get:function(){return this._functions},enumerable:!1,configurable:!0}),C.prototype.addServerFunction=function(e,t){this._functions[e]=t},Object.defineProperty(C.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"network",{get:function(){return this._network},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"serverPeers",{get:function(){return this._serverPeers},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"store",{get:function(){return this._store},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"userAccount",{get:function(){return this._userAccount},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"peerAccount",{get:function(){return this._peerAccount},enumerable:!1,configurable:!0}),C);function C(e){void 0===e&&(e={});var i=n.call(this)||this,t=(i._serverPeers=[],i.logger=B.default,i.clientOnMessage=g.default,i.verifyMessage=u.verifyMessage,i._subscriptions=[],i._processedIds={},i._processedOutHashes={},i.subscribeData=M.default,i.isConnected=!1,i.onDisconnect=function(){},i.onConnect=function(){},i.onPeerDisconnect=function(e){},i.onPeerConnect=function(e){},i.getData=c.default,i.putData=h.default,i.putCrdt=b.default,i.getCrdt=p.default,i.queryKeys=_.default,i.doFunction=m.default,i.signIn=d.default,i.anonSignIn=y.default,i.keysSignIn=w.default,i.signUp=l.default,i.verify=v.default,i.handlePing=k.default,i.handlePong=E.default,i.handleCrdtGet=P.default,i.handleCrdtPut=R.default,i.handleGet=S.default,i.handlePut=A.default,i.handleQuery=x.default,i.handleSubscribe=j.default,i.handleFunction=I.default,i._idListeners={},i.addIdListener=function(e,t){i._idListeners[e]=t},i.removeIdListener=function(e){delete i._idListeners[e]},i._functions={},i._keyListeners=[],i.addKeyListener=function(e,t){return i.logger("Add key listener: ".concat(e)),i._keyListeners.push({key:e,timeout:null,fn:t}),i._keyListeners.length-1},i.removeKeyListener=function(e){var t;null!=(t=i._keyListeners[e])&&t.timeout&&clearTimeout((null==(t=i._keyListeners[e])?void 0:t.timeout)||void 0),i._keyListeners[e]=null},i.triggerKeyListener=function(t,r){i._keyListeners.forEach(function(e){(null==e?void 0:e.key)===t&&(i.logger("Trigger key listener: ".concat(t)),e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(function(){return e.fn(r)},i.options.triggerDebouce))})},i._customVerificator=[],i.addCustomVerification=function(e,t){return i._customVerificator.push({key:e,fn:t}),i._customVerificator.length},i.removeCustomVerification=function(e){i._customVerificator[e]=null},i._options={peers:[],maxRetries:5,triggerDebouce:100,wait:2e3,pow:0,server:!1,host:"127.0.0.1",port:8080,debug:!1,httpServer:void 0,networkAdapter:u.ToolDbNetworkAdapter,storageAdapter:u.ToolDbStorageAdapter,userAdapter:u.ToolDbUserAdapter,storageName:"tooldb",topic:"tool-db-default",serverName:void 0,ssl:!1,modules:{}},i._options=s(s({},i.options),e),i._store=new i.options.storageAdapter(i),i._peerAccount=new i.options.userAdapter(i),i._userAccount=new i.options.userAdapter(i),i._network=new i.options.networkAdapter(i),"%default-peer%"),r=new i.options.storageAdapter(i,"_____peer_"+i.options.storageName);return r.get(t).then(function(e){i.peerAccount.decryptAccount(JSON.parse(e),t).then(function(e){i.peerAccount.setUser(e,(0,u.randomAnimal)())}).finally(function(){i.emit("init",i.userAccount.getAddress())})}).catch(function(e){i.peerAccount.encryptAccount(t).then(function(e){r.put(t,JSON.stringify(e)).catch(function(){}).finally(function(){i.emit("init",i.userAccount.getAddress())})})}),i}r.default=a},{".":164,"./logger":165,"./messageHandlers/handleCrdtGet":166,"./messageHandlers/handleCrdtPut":167,"./messageHandlers/handleFunction":168,"./messageHandlers/handleGet":169,"./messageHandlers/handlePing":170,"./messageHandlers/handlePong":171,"./messageHandlers/handlePut":172,"./messageHandlers/handleQuery":173,"./messageHandlers/handleSubscribe":174,"./toolDbAnonSignIn":175,"./toolDbClientOnMessage":176,"./toolDbCrdtGet":177,"./toolDbCrdtPut":178,"./toolDbFunction":179,"./toolDbGet":180,"./toolDbKeysSignIn":181,"./toolDbPut":182,"./toolDbQueryKeys":183,"./toolDbSignIn":184,"./toolDbSignUp":185,"./toolDbSubscribe":186,"./toolDbVerificationWrapper":187,events:84}],189:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.VerifyResult=void 0,(r=r.VerifyResult||(r.VerifyResult={})).CustomVerificationFailed="CustomVerificationFailed",r.InvalidData="InvalidData",r.InvalidVerification="InvalidVerification",r.CantOverwrite="CantOverwrite",r.InvalidTimestamp="InvalidTimestamp",r.AddressMismatch="AddressMismatch",r.NoProofOfWork="NoProofOfWork",r.InvalidHashNonce="InvalidHashNonce",r.InvalidSignature="InvalidSignature",r.Verified="Verified"},{}],190:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},{}],191:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){}},{}],192:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){for(var t,r=new DataView(e),i="",n=0,o=r.byteLength;n<o;n+=1)i+=t=(t=r.getUint8(n).toString(16)).length<2?"0"+t:t;return i.toLowerCase()}},{}],193:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){for(var t=new Uint8Array(e),r="",i=0;i<t.byteLength;i+=1)r+=String.fromCodePoint(t[i]);return r}},{}],194:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return(e=e.toUpperCase().match(/[\dA-F]{2}/gi))?(e=e.map(function(e){return parseInt(e,16)}),new Uint8Array(e).buffer):new Uint8Array}},{}],195:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){for(var t=e.toString(),r="",i=0;i<t.length;i+=2)r+=String.fromCharCode(parseInt(t.substr(i,2),16));return r}},{}],196:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e("../..");r.default=function(e){return new Uint8Array((0,i.hexToArrayBuffer)(e))}},{"../..":164}],197:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),i=0,n=e.length;i<n;i+=1)r[i]=e.charCodeAt(i);return t}},{}],198:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=e("..");r.default=function(e,t,r,i,n){return t=(0,o.sha256)("".concat(t,"-").concat(r,"-").concat(i,":").concat(n)),e.signData(t)}},{"..":164}],199:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=e("..");r.default=function(i,n){return new Promise(function(e){for(var t=0,r=(0,o.sha256)("".concat(i).concat(t));r.substring(0,n)!==Array(n+1).join("0");)t+=1,r=(0,o.sha256)("".concat(i).concat(t));e({nonce:t,hash:r})})}},{"..":164}],200:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=["Fast","Slow","Cute","Evil","Anxious","Cursed","Average","Zombie","Smart","Small","Tall","Amazing","Splendid","Fat","Invisible","Regular","Domestic","Unique","Soft","Lazy","Angry","Relaxed","Huge","Shy","Playful","Creepy","Ancient","Beautiful"],n=["Snake","Monkey","Platypus","Fox","Lynx","Pug","Chicken","Slug","Snail","Pig","Cow","Sheep","Horse","Squirrel","Turtle","Unicorn","Dragon","Dolphin","Cat","Chow Chow","Elephant","Meerkat","Polar Bear","Bear","Rabbit","Koala","Parrot","Raven","Frog","Rat","Mouse","Bee","Tiger","Lion","Giraffe","Ant","Spider","Zebra"];r.default=function(){return"".concat(i[Math.floor(Math.random()*i.length)]," ").concat(n[Math.floor(Math.random()*n.length)])}},{}],201:[function(e,t,r){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=(Object.defineProperty(r,"__esModule",{value:!0}),i(e("crypto")));r.default=function(e){var t=n.default.createHash("sha1");return t.update(e),t.digest("hex")}},{crypto:57}],202:[function(e,t,r){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=(Object.defineProperty(r,"__esModule",{value:!0}),i(e("crypto")));r.default=function(e){var t=n.default.createHash("sha256");return t.update(e),t.digest("hex")}},{crypto:57}],203:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){for(var r=e=void 0===e?24:e,i="",n=t||"0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz";0<r;)i+=n.charAt(Math.floor(Math.random()*n.length)),--r;return i}},{}],204:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return Array.from(new Set(e))}},{}],205:[function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,s,a,f){return new(a=a||Promise)(function(r,t){function i(e){try{o(f.next(e))}catch(e){t(e)}}function n(e){try{o(f.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(i,n)}o((f=f.apply(e,s||[])).next())})},a=this&&this.__generator||function(i,n){var o,s,a,f={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;f;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return f.label++,{value:t[1],done:!1};case 5:f.label++,s=t[1],t=[0];continue;case 7:t=f.ops.pop(),f.trys.pop();continue;default:if(!(a=0<(a=f.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){f=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){f.label=t[1];break}if(6===t[0]&&f.label<a[1]){f.label=a[1],a=t;break}if(a&&f.label<a[2]){f.label=a[2],f.ops.push(t);break}a[2]&&f.ops.pop(),f.trys.pop();continue}t=n.call(i,f)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},f=(Object.defineProperty(r,"__esModule",{value:!0}),e(".."));r.default=function(o,s){return void 0===s&&(s=0),i(this,void 0,void 0,function(){var t,r,i,n;return a(this,function(e){switch(e.label){case 0:return(t=JSON.stringify(o.v),void 0===o.t||void 0===o.k||void 0===o.h||void 0===o.a||void 0===o.s||void 0===o.c)?[2,f.VerifyResult.InvalidData]:o.t>(new Date).getTime()+3e4?[2,f.VerifyResult.InvalidTimestamp]:(r=!1,":"==o.k.slice(0,1)&&(r=o.k.split(".")[0].slice(1)),"=="!=o.k.slice(0,2)?[3,2]:(i=o.k,[4,this.store.get(i).then(function(e){try{return JSON.parse(e)}catch(e){return null}}).catch(function(){return null})]));case 1:if((i=e.sent())&&i.a!==o.a)return[2,f.VerifyResult.CantOverwrite];e.label=2;case 2:if(r&&r!==o.a)return[2,f.VerifyResult.AddressMismatch];if(0<s){if(o.h.slice(0,s)!==new Array(s).fill("0").join(""))return[2,f.VerifyResult.NoProofOfWork];if((0,f.sha256)("".concat(t).concat(o.a).concat(o.t).concat(o.n))!==o.h)return[2,f.VerifyResult.InvalidHashNonce]}return this.userAccount?[4,this.userAccount.verifySignature(o)]:[3,4];case 3:return n=e.sent(),[3,5];case 4:n=!1,e.label=5;case 5:return[2,n?f.VerifyResult.Verified:f.VerifyResult.InvalidSignature]}})})}},{"..":164}],206:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e("..");r.default=function(e,t){var r=(0,i.sha256)("".concat(t.topic,"-").concat(t.timestamp,"-").concat(t.host,":").concat(t.port));return e.verifyMessage({h:r,a:t.address,s:t.sig})}},{"..":164}]},{},[164])(164)});
|