ipfs-api
Version:
A client library for the IPFS HTTP API
1 lines • 1.34 MB
JavaScript
var IpfsApi=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}({"./node_modules/asn1.js/lib/asn1.js":function(e,t,r){"use strict";const n=t;n.bignum=r("./node_modules/bn.js/lib/bn.js"),n.define=r("./node_modules/asn1.js/lib/asn1/api.js").define,n.base=r("./node_modules/asn1.js/lib/asn1/base/index.js"),n.constants=r("./node_modules/asn1.js/lib/asn1/constants/index.js"),n.decoders=r("./node_modules/asn1.js/lib/asn1/decoders/index.js"),n.encoders=r("./node_modules/asn1.js/lib/asn1/encoders/index.js")},"./node_modules/asn1.js/lib/asn1/api.js":function(e,t,r){"use strict";const n=r("./node_modules/asn1.js/lib/asn1.js"),i=r("./node_modules/inherits/inherits_browser.js"),s=t;function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}s.define=function e(t,r){return new o(t,r)},o.prototype._createNamed=function e(t){let n;try{n=r("./node_modules/vm-browserify/index.js").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){n=function(e){this._initNamed(e)}}return i(n,t),n.prototype._initNamed=function e(r){t.call(this,r)},new n(this)},o.prototype._getDecoder=function e(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(n.decoders[t])),this.decoders[t]},o.prototype.decode=function e(t,r,n){return this._getDecoder(r).decode(t,n)},o.prototype._getEncoder=function e(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n.encoders[t])),this.encoders[t]},o.prototype.encode=function e(t,r,n){return this._getEncoder(r).encode(t,n)}},"./node_modules/asn1.js/lib/asn1/base/buffer.js":function(e,t,r){"use strict";const n=r("./node_modules/inherits/inherits_browser.js"),i=r("./node_modules/asn1.js/lib/asn1/base/index.js").Reporter,s=r("./node_modules/buffer/index.js").Buffer;function o(e,t){i.call(this,t),s.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 e instanceof a||(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=s.byteLength(e);else{if(!s.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(o,i),t.DecoderBuffer=o,o.prototype.save=function e(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},o.prototype.restore=function e(t){const r=new o(this.base);return r.offset=t.offset,r.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),r},o.prototype.isEmpty=function e(){return this.offset===this.length},o.prototype.readUInt8=function e(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},o.prototype.skip=function e(t,r){if(!(this.offset+t<=this.length))return this.error(r||"DecoderBuffer overrun");const n=new o(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+t,this.offset+=t,n},o.prototype.raw=function e(t){return this.base.slice(t?t.offset:this.offset,this.length)},t.EncoderBuffer=a,a.prototype.join=function e(t,r){return t||(t=new s(this.length)),r||(r=0),0===this.length?t:(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):s.isBuffer(this.value)&&this.value.copy(t,r),r+=this.length),t)}},"./node_modules/asn1.js/lib/asn1/base/index.js":function(e,t,r){"use strict";const n=t;n.Reporter=r("./node_modules/asn1.js/lib/asn1/base/reporter.js").Reporter,n.DecoderBuffer=r("./node_modules/asn1.js/lib/asn1/base/buffer.js").DecoderBuffer,n.EncoderBuffer=r("./node_modules/asn1.js/lib/asn1/base/buffer.js").EncoderBuffer,n.Node=r("./node_modules/asn1.js/lib/asn1/base/node.js")},"./node_modules/asn1.js/lib/asn1/base/node.js":function(e,t,r){"use strict";const n=r("./node_modules/asn1.js/lib/asn1/base/index.js").Reporter,i=r("./node_modules/asn1.js/lib/asn1/base/index.js").EncoderBuffer,s=r("./node_modules/asn1.js/lib/asn1/base/index.js").DecoderBuffer,o=r("./node_modules/minimalistic-assert/index.js"),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a),l=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function c(e,t){const r={};this._baseState=r,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}e.exports=c;const d=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function e(){const t=this._baseState,r={};d.forEach(function(e){r[e]=t[e]});const n=new this.constructor(r.parent);return n._baseState=r,n},c.prototype._wrap=function e(){const t=this._baseState;u.forEach(function(e){this[e]=function r(){const n=new this.constructor(this);return t.children.push(n),n[e].apply(n,arguments)}},this)},c.prototype._init=function e(t){const r=this._baseState;o(null===r.parent),t.call(this),r.children=r.children.filter(function(e){return e._baseState.parent===this},this),o.equal(r.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function e(t){const r=this._baseState,n=t.filter(function(e){return e instanceof this.constructor},this);t=t.filter(function(e){return!(e instanceof this.constructor)},this),0!==n.length&&(o(null===r.children),r.children=n,n.forEach(function(e){e._baseState.parent=this},this)),0!==t.length&&(o(null===r.args),r.args=t,r.reverseArgs=t.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0);const n=e[r];t[n]=r}),t}))},l.forEach(function(e){c.prototype[e]=function t(){const r=this._baseState;throw new Error(e+" not implemented for encoding: "+r.enc)}}),a.forEach(function(e){c.prototype[e]=function t(){const r=this._baseState,n=Array.prototype.slice.call(arguments);return o(null===r.tag),r.tag=e,this._useArgs(n),this}}),c.prototype.use=function e(t){o(t);const r=this._baseState;return o(null===r.use),r.use=t,this},c.prototype.optional=function e(){const t=this._baseState;return t.optional=!0,this},c.prototype.def=function e(t){const r=this._baseState;return o(null===r.default),r.default=t,r.optional=!0,this},c.prototype.explicit=function e(t){const r=this._baseState;return o(null===r.explicit&&null===r.implicit),r.explicit=t,this},c.prototype.implicit=function e(t){const r=this._baseState;return o(null===r.explicit&&null===r.implicit),r.implicit=t,this},c.prototype.obj=function e(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return t.obj=!0,0!==r.length&&this._useArgs(r),this},c.prototype.key=function e(t){const r=this._baseState;return o(null===r.key),r.key=t,this},c.prototype.any=function e(){const t=this._baseState;return t.any=!0,this},c.prototype.choice=function e(t){const r=this._baseState;return o(null===r.choice),r.choice=t,this._useArgs(Object.keys(t).map(function(e){return t[e]})),this},c.prototype.contains=function e(t){const r=this._baseState;return o(null===r.use),r.contains=t,this},c.prototype._decode=function e(t,r){const n=this._baseState;if(null===n.parent)return t.wrapResult(n.children[0]._decode(t,r));let i=n.default,o=!0,a=null,u;if(null!==n.key&&(a=t.enterKey(n.key)),n.optional){let e=null;if(null!==n.explicit?e=n.explicit:null!==n.implicit?e=n.implicit:null!==n.tag&&(e=n.tag),null!==e||n.any){if(o=this._peekTag(t,e,n.any),t.isError(o))return o}else{const e=t.save();try{null===n.choice?this._decodeGeneric(n.tag,t,r):this._decodeChoice(t,r),o=!0}catch(e){o=!1}t.restore(e)}}if(n.obj&&o&&(u=t.enterObject()),o){if(null!==n.explicit){const e=this._decodeTag(t,n.explicit);if(t.isError(e))return e;t=e}const e=t.offset;if(null===n.use&&null===n.choice){let e;n.any&&(e=t.save());const r=this._decodeTag(t,null!==n.implicit?n.implicit:n.tag,n.any);if(t.isError(r))return r;n.any?i=t.raw(e):t=r}if(r&&r.track&&null!==n.tag&&r.track(t.path(),e,t.length,"tagged"),r&&r.track&&null!==n.tag&&r.track(t.path(),t.offset,t.length,"content"),n.any||(i=null===n.choice?this._decodeGeneric(n.tag,t,r):this._decodeChoice(t,r)),t.isError(i))return i;if(n.any||null!==n.choice||null===n.children||n.children.forEach(function e(n){n._decode(t,r)}),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){const e=new s(i);i=this._getUse(n.contains,t._reporterState.obj)._decode(e,r)}}return n.obj&&o&&(i=t.leaveObject(u)),null===n.key||null===i&&!0!==o?null!==a&&t.exitKey(a):t.leaveKey(a,n.key,i),i},c.prototype._decodeGeneric=function e(t,r,n){const i=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(r,t,i.args[0],n):/str$/.test(t)?this._decodeStr(r,t,n):"objid"===t&&i.args?this._decodeObjid(r,i.args[0],i.args[1],n):"objid"===t?this._decodeObjid(r,null,null,n):"gentime"===t||"utctime"===t?this._decodeTime(r,t,n):"null_"===t?this._decodeNull(r,n):"bool"===t?this._decodeBool(r,n):"objDesc"===t?this._decodeStr(r,t,n):"int"===t||"enum"===t?this._decodeInt(r,i.args&&i.args[0],n):null!==i.use?this._getUse(i.use,r._reporterState.obj)._decode(r,n):r.error("unknown tag: "+t)},c.prototype._getUse=function e(t,r){const n=this._baseState;return n.useDecoder=this._use(t,r),o(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},c.prototype._decodeChoice=function e(t,r){const n=this._baseState;let i=null,s=!1;return Object.keys(n.choice).some(function(e){const o=t.save(),a=n.choice[e];try{const n=a._decode(t,r);if(t.isError(n))return!1;i={type:e,value:n},s=!0}catch(e){return t.restore(o),!1}return!0},this),s?i:t.error("Choice not matched")},c.prototype._createEncoderBuffer=function e(t){return new i(t,this.reporter)},c.prototype._encode=function e(t,r,n){const i=this._baseState;if(null!==i.default&&i.default===t)return;const s=this._encodeValue(t,r,n);return void 0===s||this._skipDefault(s,r,n)?void 0:s},c.prototype._encodeValue=function e(t,r,i){const s=this._baseState;if(null===s.parent)return s.children[0]._encode(t,r||new n);let o=null;if(this.reporter=r,s.optional&&void 0===t){if(null===s.default)return;t=s.default}let a=null,u=!1;if(s.any)o=this._createEncoderBuffer(t);else if(s.choice)o=this._encodeChoice(t,r);else if(s.contains)a=this._getUse(s.contains,i)._encode(t,r),u=!0;else if(s.children)a=s.children.map(function(e){if("null_"===e._baseState.tag)return e._encode(null,r,t);if(null===e._baseState.key)return r.error("Child should have a key");const n=r.enterKey(e._baseState.key);if("object"!=typeof t)return r.error("Child expected, but input is not object");const i=e._encode(t[e._baseState.key],r,t);return r.leaveKey(n),i},this).filter(function(e){return e}),a=this._createEncoderBuffer(a);else if("seqof"===s.tag||"setof"===s.tag){if(!s.args||1!==s.args.length)return r.error("Too many args for : "+s.tag);if(!Array.isArray(t))return r.error("seqof/setof, but data is not Array");const e=this.clone();e._baseState.implicit=null,a=this._createEncoderBuffer(t.map(function(e){const n=this._baseState;return this._getUse(n.args[0],t)._encode(e,r)},e))}else null!==s.use?o=this._getUse(s.use,i)._encode(t,r):(a=this._encodePrimitive(s.tag,t),u=!0);if(!s.any&&null===s.choice){const e=null!==s.implicit?s.implicit:s.tag,t=null===s.implicit?"universal":"context";null===e?null===s.use&&r.error("Tag could be omitted only for .use()"):null===s.use&&(o=this._encodeComposite(e,u,t,a))}return null!==s.explicit&&(o=this._encodeComposite(s.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function e(t,r){const n=this._baseState,i=n.choice[t.type];return i||o(!1,t.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(t.value,r)},c.prototype._encodePrimitive=function e(t,r){const n=this._baseState;if(/str$/.test(t))return this._encodeStr(r,t);if("objid"===t&&n.args)return this._encodeObjid(r,n.reverseArgs[0],n.args[1]);if("objid"===t)return this._encodeObjid(r,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(r,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(r,n.args&&n.reverseArgs[0]);if("bool"===t)return this._encodeBool(r);if("objDesc"===t)return this._encodeStr(r,t);throw new Error("Unsupported tag: "+t)},c.prototype._isNumstr=function e(t){return/^[0-9 ]*$/.test(t)},c.prototype._isPrintstr=function e(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},"./node_modules/asn1.js/lib/asn1/base/reporter.js":function(e,t,r){"use strict";const n=r("./node_modules/inherits/inherits_browser.js");function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function s(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function e(t){return t instanceof s},i.prototype.save=function e(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function e(t){const r=this._reporterState;r.obj=t.obj,r.path=r.path.slice(0,t.pathLen)},i.prototype.enterKey=function e(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function e(t){const r=this._reporterState;r.path=r.path.slice(0,t-1)},i.prototype.leaveKey=function e(t,r,n){const i=this._reporterState;this.exitKey(t),null!==i.obj&&(i.obj[r]=n)},i.prototype.path=function e(){return this._reporterState.path.join("/")},i.prototype.enterObject=function e(){const t=this._reporterState,r=t.obj;return t.obj={},r},i.prototype.leaveObject=function e(t){const r=this._reporterState,n=r.obj;return r.obj=t,n},i.prototype.error=function e(t){let r;const n=this._reporterState,i=t instanceof s;if(r=i?t:new s(n.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),t.message||t,t.stack),!n.options.partial)throw r;return i||n.errors.push(r),r},i.prototype.wrapResult=function e(t){const r=this._reporterState;return r.options.partial?{result:this.isError(t)?null:t,errors:r.errors}:t},n(s,Error),s.prototype.rethrow=function e(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,s),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},"./node_modules/asn1.js/lib/asn1/constants/der.js":function(e,t,r){"use strict";const n=r("./node_modules/asn1.js/lib/asn1/constants/index.js");t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=n._reverse(t.tagClass),t.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"},t.tagByName=n._reverse(t.tag)},"./node_modules/asn1.js/lib/asn1/constants/index.js":function(e,t,r){"use strict";const n=t;n._reverse=function e(t){const r={};return Object.keys(t).forEach(function(e){(0|e)==e&&(e|=0);const n=t[e];r[n]=e}),r},n.der=r("./node_modules/asn1.js/lib/asn1/constants/der.js")},"./node_modules/asn1.js/lib/asn1/decoders/der.js":function(e,t,r){"use strict";const n=r("./node_modules/inherits/inherits_browser.js"),i=r("./node_modules/asn1.js/lib/asn1.js"),s=i.base,o=i.bignum,a=i.constants.der;function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){s.Node.call(this,"der",e)}function c(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const n=a.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;const s=a.tag[r];return{cls:n,primitive:i,tag:r,tagStr:s}}function d(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(let t=0;t<i;t++){n<<=8;const t=e.readUInt8(r);if(e.isError(t))return t;n|=t}return n}e.exports=u,u.prototype.decode=function e(t,r){return t instanceof s.DecoderBuffer||(t=new s.DecoderBuffer(t,r)),this.tree._decode(t,r)},n(l,s.Node),l.prototype._peekTag=function e(t,r,n){if(t.isEmpty())return!1;const i=t.save(),s=c(t,'Failed to peek tag: "'+r+'"');return t.isError(s)?s:(t.restore(i),s.tag===r||s.tagStr===r||s.tagStr+"of"===r||n)},l.prototype._decodeTag=function e(t,r,n){const i=c(t,'Failed to decode tag of "'+r+'"');if(t.isError(i))return i;let s=d(t,i.primitive,'Failed to get length of "'+r+'"');if(t.isError(s))return s;if(!n&&i.tag!==r&&i.tagStr!==r&&i.tagStr+"of"!==r)return t.error('Failed to match tag: "'+r+'"');if(i.primitive||null!==s)return t.skip(s,'Failed to match body of: "'+r+'"');const o=t.save(),a=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(a)?a:(s=t.offset-o.offset,t.restore(o),t.skip(s,'Failed to match body of: "'+r+'"'))},l.prototype._skipUntilEnd=function e(t,r){for(;;){const e=c(t,r);if(t.isError(e))return e;const n=d(t,e.primitive,r);if(t.isError(n))return n;let i;if(i=e.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,r),t.isError(i))return i;if("end"===e.tagStr)break}},l.prototype._decodeList=function e(t,r,n,i){const s=[];for(;!t.isEmpty();){const e=this._peekTag(t,"end");if(t.isError(e))return e;const r=n.decode(t,"der",i);if(t.isError(r)&&e)break;s.push(r)}return s},l.prototype._decodeStr=function e(t,r){if("bitstr"===r){const e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if("bmpstr"===r){const e=t.raw();if(e.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");let r="";for(let t=0;t<e.length/2;t++)r+=String.fromCharCode(e.readUInt16BE(2*t));return r}if("numstr"===r){const e=t.raw().toString("ascii");return this._isNumstr(e)?e:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===r)return t.raw();if("objDesc"===r)return t.raw();if("printstr"===r){const e=t.raw().toString("ascii");return this._isPrintstr(e)?e:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(r)?t.raw().toString():t.error("Decoding of string type: "+r+" unsupported")},l.prototype._decodeObjid=function e(t,r,n){let i;const s=[];let o=0,a=0;for(;!t.isEmpty();)o<<=7,o|=127&(a=t.readUInt8()),0==(128&a)&&(s.push(o),o=0);128&a&&s.push(o);const u=s[0]/40|0,l=s[0]%40;if(i=n?s:[u,l].concat(s.slice(1)),r){let e=r[i.join(" ")];void 0===e&&(e=r[i.join(".")]),void 0!==e&&(i=e)}return i},l.prototype._decodeTime=function e(t,r){const n=t.raw().toString();let i,s,o,a,u,l;if("gentime"===r)i=0|n.slice(0,4),s=0|n.slice(4,6),o=0|n.slice(6,8),a=0|n.slice(8,10),u=0|n.slice(10,12),l=0|n.slice(12,14);else{if("utctime"!==r)return t.error("Decoding "+r+" time is not supported yet");i=0|n.slice(0,2),s=0|n.slice(2,4),o=0|n.slice(4,6),a=0|n.slice(6,8),u=0|n.slice(8,10),l=0|n.slice(10,12),i=i<70?2e3+i:1900+i}return Date.UTC(i,s-1,o,a,u,l,0)},l.prototype._decodeNull=function e(){return null},l.prototype._decodeBool=function e(t){const r=t.readUInt8();return t.isError(r)?r:0!==r},l.prototype._decodeInt=function e(t,r){const n=t.raw();let i=new o(n);return r&&(i=r[i.toString(10)]||i),i},l.prototype._use=function e(t,r){return"function"==typeof t&&(t=t(r)),t._getDecoder("der").tree}},"./node_modules/asn1.js/lib/asn1/decoders/index.js":function(e,t,r){"use strict";const n=t;n.der=r("./node_modules/asn1.js/lib/asn1/decoders/der.js"),n.pem=r("./node_modules/asn1.js/lib/asn1/decoders/pem.js")},"./node_modules/asn1.js/lib/asn1/decoders/pem.js":function(e,t,r){"use strict";const n=r("./node_modules/inherits/inherits_browser.js"),i=r("./node_modules/buffer/index.js").Buffer,s=r("./node_modules/asn1.js/lib/asn1/decoders/der.js");function o(e){s.call(this,e),this.enc="pem"}n(o,s),e.exports=o,o.prototype.decode=function e(t,r){const n=t.toString().split(/[\r\n]+/g),o=r.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/;let u=-1,l=-1;for(let e=0;e<n.length;e++){const t=n[e].match(a);if(null!==t&&t[2]===o){if(-1!==u){if("END"!==t[1])break;l=e;break}if("BEGIN"!==t[1])break;u=e}}if(-1===u||-1===l)throw new Error("PEM section not found for: "+o);const c=n.slice(u+1,l).join("");c.replace(/[^a-z0-9+/=]+/gi,"");const d=new i(c,"base64");return s.prototype.decode.call(this,d,r)}},"./node_modules/asn1.js/lib/asn1/encoders/der.js":function(e,t,r){"use strict";const n=r("./node_modules/inherits/inherits_browser.js"),i=r("./node_modules/buffer/index.js").Buffer,s=r("./node_modules/asn1.js/lib/asn1.js"),o=s.base,a=s.constants.der;function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){o.Node.call(this,"der",e)}function c(e){return e<10?"0"+e:e}function d(e,t,r,n){let i;if("seqof"===e?e="seq":"setof"===e&&(e="set"),a.tagByName.hasOwnProperty(e))i=a.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}return i>=31?n.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=a.tagClassByName[r||"universal"]<<6)}e.exports=u,u.prototype.encode=function e(t,r){return this.tree._encode(t,r).join()},n(l,o.Node),l.prototype._encodeComposite=function e(t,r,n,s){const o=d(t,r,n,this.reporter);if(s.length<128){const e=new i(2);return e[0]=o,e[1]=s.length,this._createEncoderBuffer([e,s])}let a=1;for(let e=s.length;e>=256;e>>=8)a++;const u=new i(2+a);u[0]=o,u[1]=128|a;for(let e=1+a,t=s.length;t>0;e--,t>>=8)u[e]=255&t;return this._createEncoderBuffer([u,s])},l.prototype._encodeStr=function e(t,r){if("bitstr"===r)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===r){const e=new i(2*t.length);for(let r=0;r<t.length;r++)e.writeUInt16BE(t.charCodeAt(r),2*r);return this._createEncoderBuffer(e)}return"numstr"===r?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===r?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(r)?this._createEncoderBuffer(t):"objDesc"===r?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+r+" unsupported")},l.prototype._encodeObjid=function e(t,r,n){if("string"==typeof t){if(!r)return this.reporter.error("string objid given, but no values map found");if(!r.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=r[t].split(/[\s.]+/g);for(let e=0;e<t.length;e++)t[e]|=0}else if(Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!n){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let s=0;for(let e=0;e<t.length;e++){let r=t[e];for(s++;r>=128;r>>=7)s++}const o=new i(s);let a=o.length-1;for(let e=t.length-1;e>=0;e--){let r=t[e];for(o[a--]=127&r;(r>>=7)>0;)o[a--]=128|127&r}return this._createEncoderBuffer(o)},l.prototype._encodeTime=function e(t,r){let n;const i=new Date(t);return"gentime"===r?n=[c(i.getUTCFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===r?n=[c(i.getUTCFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+r+" time is not supported yet"),this._encodeStr(n,"octstr")},l.prototype._encodeNull=function e(){return this._createEncoderBuffer("")},l.prototype._encodeInt=function e(t,r){if("string"==typeof t){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=r[t]}if("number"!=typeof t&&!i.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=new i(e)}if(i.isBuffer(t)){let e=t.length;0===t.length&&e++;const r=new i(e);return t.copy(r),0===t.length&&(r[0]=0),this._createEncoderBuffer(r)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let n=1;for(let e=t;e>=256;e>>=8)n++;const s=new Array(n);for(let e=s.length-1;e>=0;e--)s[e]=255&t,t>>=8;return 128&s[0]&&s.unshift(0),this._createEncoderBuffer(new i(s))},l.prototype._encodeBool=function e(t){return this._createEncoderBuffer(t?255:0)},l.prototype._use=function e(t,r){return"function"==typeof t&&(t=t(r)),t._getEncoder("der").tree},l.prototype._skipDefault=function e(t,r,n){const i=this._baseState;let s;if(null===i.default)return!1;const o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,r,n).join()),o.length!==i.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==i.defaultBuffer[s])return!1;return!0}},"./node_modules/asn1.js/lib/asn1/encoders/index.js":function(e,t,r){"use strict";const n=t;n.der=r("./node_modules/asn1.js/lib/asn1/encoders/der.js"),n.pem=r("./node_modules/asn1.js/lib/asn1/encoders/pem.js")},"./node_modules/asn1.js/lib/asn1/encoders/pem.js":function(e,t,r){"use strict";const n=r("./node_modules/inherits/inherits_browser.js"),i=r("./node_modules/asn1.js/lib/asn1/encoders/der.js");function s(e){i.call(this,e),this.enc="pem"}n(s,i),e.exports=s,s.prototype.encode=function e(t,r){const n=i.prototype.encode.call(this,t),s=n.toString("base64"),o=["-----BEGIN "+r.label+"-----"];for(let e=0;e<s.length;e+=64)o.push(s.slice(e,e+64));return o.push("-----END "+r.label+"-----"),o.join("\n")}},"./node_modules/assert/assert.js":function(e,t,r){"use strict";(function(t){function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function i(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var s=r("./node_modules/util/util.js"),o=Object.prototype.hasOwnProperty,a=Array.prototype.slice,u="foo"===function e(){}.name;function l(e){return Object.prototype.toString.call(e)}function c(e){return!i(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var d=e.exports=b,f=/\s*function\s+([^\(\s]*)\s*/;function h(e){if(s.isFunction(e)){if(u)return e.name;var t,r=e.toString().match(f);return r&&r[1]}}function p(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function m(e){if(u||!s.isFunction(e))return s.inspect(e);var t=h(e),r;return"[Function"+(t?": "+t:"")+"]"}function y(e){return p(m(e.actual),128)+" "+e.operator+" "+p(m(e.expected),128)}function g(e,t,r,n,i){throw new d.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function b(e,t){e||g(e,!0,t,"==",d.ok)}function _(e,t,r,o){if(e===t)return!0;if(i(e)&&i(t))return 0===n(e,t);if(s.isDate(e)&&s.isDate(t))return e.getTime()===t.getTime();if(s.isRegExp(e)&&s.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(c(e)&&c(t)&&l(e)===l(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;var a=(o=o||{actual:[],expected:[]}).actual.indexOf(e);return-1!==a&&a===o.expected.indexOf(t)||(o.actual.push(e),o.expected.push(t),w(e,t,r,o))}return r?e===t:e==t}function v(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t,r,n){if(null===e||void 0===e||null===t||void 0===t)return!1;if(s.isPrimitive(e)||s.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=v(e),o=v(t);if(i&&!o||!i&&o)return!1;if(i)return _(e=a.call(e),t=a.call(t),r);var u=x(e),l=x(t),c,d;if(u.length!==l.length)return!1;for(u.sort(),l.sort(),d=u.length-1;d>=0;d--)if(u[d]!==l[d])return!1;for(d=u.length-1;d>=0;d--)if(!_(e[c=u[d]],t[c],r,n))return!1;return!0}function S(e,t,r){_(e,t,!0)&&g(e,t,r,"notDeepStrictEqual",S)}function E(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function j(e){var t;try{e()}catch(e){t=e}return t}function k(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=j(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&g(i,r,"Missing expected exception"+n);var o="string"==typeof n,a=!e&&s.isError(i),u=!e&&i&&!r;if((a&&o&&E(i,r)||u)&&g(i,r,"Got unwanted exception"+n),e&&i&&r&&!E(i,r)||!e&&i)throw i}d.AssertionError=function e(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=y(this),this.generatedMessage=!0);var r=t.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,s=h(r),o=i.indexOf("\n"+s);if(o>=0){var a=i.indexOf("\n",o+1);i=i.substring(a+1)}this.stack=i}}},s.inherits(d.AssertionError,Error),d.fail=g,d.ok=b,d.equal=function e(t,r,n){t!=r&&g(t,r,n,"==",d.equal)},d.notEqual=function e(t,r,n){t==r&&g(t,r,n,"!=",d.notEqual)},d.deepEqual=function e(t,r,n){_(t,r,!1)||g(t,r,n,"deepEqual",d.deepEqual)},d.deepStrictEqual=function e(t,r,n){_(t,r,!0)||g(t,r,n,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function e(t,r,n){_(t,r,!1)&&g(t,r,n,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=S,d.strictEqual=function e(t,r,n){t!==r&&g(t,r,n,"===",d.strictEqual)},d.notStrictEqual=function e(t,r,n){t===r&&g(t,r,n,"!==",d.notStrictEqual)},d.throws=function(e,t,r){k(!0,e,t,r)},d.doesNotThrow=function(e,t,r){k(!1,e,t,r)},d.ifError=function(e){if(e)throw e};var x=Object.keys||function(e){var t=[];for(var r in e)o.call(e,r)&&t.push(r);return t}}).call(this,r("./node_modules/webpack/buildin/global.js"))},"./node_modules/async/asyncify.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n,i=l(r("./node_modules/lodash/isObject.js")),s,o=l(r("./node_modules/async/internal/initialParams.js")),a,u=l(r("./node_modules/async/internal/setImmediate.js"));function l(e){return e&&e.__esModule?e:{default:e}}function c(e){return(0,o.default)(function(t,r){var n;try{n=e.apply(this,t)}catch(e){return r(e)}(0,i.default)(n)&&"function"==typeof n.then?n.then(function(e){d(r,null,e)},function(e){d(r,e.message?e:new Error(e))}):r(null,n)})}function d(e,t,r){try{e(t,r)}catch(e){(0,u.default)(f,e)}}function f(e){throw e}e.exports=t.default},"./node_modules/async/eachLimit.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n,i=l(r("./node_modules/async/internal/eachOfLimit.js")),s,o=l(r("./node_modules/async/internal/withoutIndex.js")),a,u=l(r("./node_modules/async/internal/wrapAsync.js"));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t,r,n){(0,i.default)(t)(e,(0,o.default)((0,u.default)(r)),n)}e.exports=t.default},"./node_modules/async/eachSeries.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=a(r("./node_modules/async/eachLimit.js")),s,o=a(r("./node_modules/async/internal/doLimit.js"));function a(e){return e&&e.__esModule?e:{default:e}}t.default=(0,o.default)(i.default,1),e.exports=t.default},"./node_modules/async/internal/breakLoop.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},"./node_modules/async/internal/doLimit.js":function(e,t,r){"use strict";function n(e,t){return function(r,n,i){return e(r,t,n,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},"./node_modules/async/internal/eachOfLimit.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var n,i=h(r("./node_modules/lodash/noop.js")),s,o=h(r("./node_modules/async/internal/once.js")),a,u=h(r("./node_modules/async/internal/iterator.js")),l,c=h(r("./node_modules/async/internal/onlyOnce.js")),d,f=h(r("./node_modules/async/internal/breakLoop.js"));function h(e){return e&&e.__esModule?e:{default:e}}function p(e){return function(t,r,n){if(n=(0,o.default)(n||i.default),e<=0||!t)return n(null);var s=(0,u.default)(t),a=!1,l=0,d=!1;function h(e,t){if(l-=1,e)a=!0,n(e);else{if(t===f.default||a&&l<=0)return a=!0,n(null);d||p()}}function p(){for(d=!0;l<e&&!a;){var t=s();if(null===t)return a=!0,void(l<=0&&n(null));l+=1,r(t.value,t.key,(0,c.default)(h))}d=!1}p()}}e.exports=t.default},"./node_modules/async/internal/getIterator.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return n&&e[n]&&e[n]()};var n="function"==typeof Symbol&&Symbol.iterator;e.exports=t.default},"./node_modules/async/internal/initialParams.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){var t=(0,i.default)(arguments),r=t.pop();e.call(this,t,r)}};var n,i=s(r("./node_modules/async/internal/slice.js"));function s(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},"./node_modules/async/internal/iterator.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=h;var n,i=l(r("./node_modules/lodash/isArrayLike.js")),s,o=l(r("./node_modules/async/internal/getIterator.js")),a,u=l(r("./node_modules/lodash/keys.js"));function l(e){return e&&e.__esModule?e:{default:e}}function c(e){var t=-1,r=e.length;return function n(){return++t<r?{value:e[t],key:t}:null}}function d(e){var t=-1;return function r(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}function f(e){var t=(0,u.default)(e),r=-1,n=t.length;return function i(){var s=t[++r];return r<n?{value:e[s],key:s}:null}}function h(e){if((0,i.default)(e))return c(e);var t=(0,o.default)(e);return t?d(t):f(e)}e.exports=t.default},"./node_modules/async/internal/once.js":function(e,t,r){"use strict";function n(e){return function(){if(null!==e){var t=e;e=null,t.apply(this,arguments)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},"./node_modules/async/internal/onlyOnce.js":function(e,t,r){"use strict";function n(e){return function(){if(null===e)throw new Error("Callback was already called.");var t=e;e=null,t.apply(this,arguments)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},"./node_modules/async/internal/setImmediate.js":function(e,t,r){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0}),t.hasNextTick=t.hasSetImmediate=void 0,t.fallback=c,t.wrap=d;var i,s=o(r("./node_modules/async/internal/slice.js"));function o(e){return e&&e.__esModule?e:{default:e}}var a=t.hasSetImmediate="function"==typeof e&&e,u=t.hasNextTick="object"==typeof n&&"function"==typeof n.nextTick,l;function c(e){setTimeout(e,0)}function d(e){return function(t){var r=(0,s.default)(arguments,1);e(function(){t.apply(null,r)})}}l=a?e:u?n.nextTick:c,t.default=d(l)}).call(this,r("./node_modules/timers-browserify/main.js").setImmediate,r("./node_modules/process/browser.js"))},"./node_modules/async/internal/slice.js":function(e,t,r){"use strict";function n(e,t){t|=0;for(var r=Math.max(e.length-t,0),n=Array(r),i=0;i<r;i++)n[i]=e[t+i];return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},"./node_modules/async/internal/withoutIndex.js":function(e,t,r){"use strict";function n(e){return function(t,r,n){return e(t,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},"./node_modules/async/internal/wrapAsync.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=void 0;var n,i=s(r("./node_modules/async/asyncify.js"));function s(e){return e&&e.__esModule?e:{default:e}}var o="function"==typeof Symbol;function a(e){return o&&"AsyncFunction"===e[Symbol.toStringTag]}function u(e){return a(e)?(0,i.default)(e):e}t.default=u,t.isAsync=a},"./node_modules/async/setImmediate.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=s(r("./node_modules/async/internal/setImmediate.js"));function s(e){return e&&e.__esModule?e:{default:e}}t.default=i.default,e.exports=t.default},"./node_modules/async/waterfall.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t=(0,u.default)(t||o.default),!(0,i.default)(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function n(t){var n=(0,p.default)(e[r++]);t.push((0,f.default)(s)),n.apply(null,t)}function s(i){if(i||r===e.length)return t.apply(null,arguments);n((0,c.default)(arguments,1))}n([])};var n,i=m(r("./node_modules/lodash/isArray.js")),s,o=m(r("./node_modules/lodash/noop.js")),a,u=m(r("./node_modules/async/internal/once.js")),l,c=m(r("./node_modules/async/internal/slice.js")),d,f=m(r("./node_modules/async/internal/onlyOnce.js")),h,p=m(r("./node_modules/async/internal/wrapAsync.js"));function m(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},"./node_modules/async/whilst.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var n,i=d(r("./node_modules/lodash/noop.js")),s,o=d(r("./node_modules/async/internal/slice.js")),a,u=d(r("./node_modules/async/internal/onlyOnce.js")),l,c=d(r("./node_modules/async/internal/wrapAsync.js"));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t,r){r=(0,u.default)(r||i.default);var n=(0,c.default)(t);if(!e())return r(null);var s=function(t){if(t)return r(t);if(e())return n(s);var i=(0,o.default)(arguments,1);r.apply(null,[null].concat(i))};n(s)}e.exports=t.default},"./node_modules/base-x/index.js":function(e,t,r){const n=r("./node_modules/safe-buffer/index.js").Buffer;e.exports=function e(t){if(t.length>=255)throw new TypeError("Alphabet too long");const r=new Uint8Array(256);r.fill(255);for(let e=0;e<t.length;e++){const n=t.charAt(e),i=n.charCodeAt(0);if(255!==r[i])throw new TypeError(n+" is ambiguous");r[i]=e}const i=t.length,s=t.charAt(0),o=Math.log(i)/Math.log(256),a=Math.log(256)/Math.log(i);function u(e){if(!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";let r=0,o=0,u=0;const l=e.length;for(;u!==l&&0===e[u];)u++,r++;const c=(l-u)*a+1>>>0,d=new Uint8Array(c);for(;u!==l;){let t=e[u],r=0;for(let e=c-1;(0!==t||r<o)&&-1!==e;e--,r++)t+=256*d[e]>>>0,d[e]=t%i>>>0,t=t/i>>>0;if(0!==t)throw new Error("Non-zero carry");o=r,u++}let f=c-o;for(;f!==c&&0===d[f];)f++;let h=s.repeat(r);for(;f<c;++f)h+=t.charAt(d[f]);return h}function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);let t=0;if(" "===e[t])return;let a=0,u=0;for(;e[t]===s;)a++,t++;const l=(e.length-t)*o+1>>>0,c=new Uint8Array(l);for(;e[t];){let n=r[e.charCodeAt(t)];if(255===n)return;let s=0;for(let e=l-1;(0!==n||s<u)&&-1!==e;e--,s++)n+=i*c[e]>>>0,c[e]=n%256>>>0,n=n/256>>>0;if(0!==n)throw new Error("Non-zero carry");u=s,t++}if(" "===e[t])return;let d=l-u;for(;d!==l&&0===c[d];)d++;const f=n.allocUnsafe(a+(l-d));f.fill(0,0,a);let h=a;for(;d!==l;)f[h++]=c[d++];return f}function c(e){const t=l(e);if(t)return t;throw new Error("Non-base"+i+" character")}return{encode:u,decodeUnsafe:l,decode:c}}},"./node_modules/base64-js/index.js":function(e,t,r){"use strict";t.byteLength=c,t.toByteArray=f,t.fromByteArray=m;for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=o.length;a<u;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("="),n;return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n}function d(e,t,r){return 3*(t+r)/4-r}function f(e){for(var t,r=l(e),n=r[0],o=r[1],a=new s(d(e,n,o)),u=0,c=o>0?n-4:n,f=0;f<c;f+=4)t=i[e.charCodeAt(f)]<<18|i[e.charCodeAt(f+1)]<<12|i[e.charCodeAt(f+2)]<<6|i[e.charCodeAt(f+3)],a[u++]=t>>16&255,a[u++]=t>>8&255,a[u++]=255&t;return 2===o&&(t=i[e.charCodeAt(f)]<<2|i[e.charCodeAt(f+1)]>>4,a[u++]=255&t),1===o&&(t=i[e.charCodeAt(f)]<<10|i[e.charCodeAt(f+1)]<<4|i[e.charCodeAt(f+2)]>>2,a[u++]=t>>8&255,a[u++]=255&t),a}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function p(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(h(n));return i.join("")}function m(e){for(var t,r=e.length,i=r%3,s=[],o=16383,a=0,u=r-i;a<u;a+=16383)s.push(p(e,a,a+16383>u?u:a+16383));return 1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},"./node_modules/big.js/big.js":function(e,t,r){var n;!function(i){"use strict";var s,o=20,a=1,u=1e6,l=1e6,c=-7,d=21,f="[big.js] ",h=f+"Invalid ",p=h+"decimal places",m=h+"rounding mode",y=f+"Division by zero",g={},b=void 0,_=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function v(){function e(t){var r=this;if(!(r instanceof e))return t===b?v():new e(t);t instanceof e?(r.s=t.s,r.e=t.e,r.c=t.c.slice()):w(r,t),r.constructor=e}return e.prototype=g,e.DP=o,e.RM=a,e.NE=c,e.PE=d,e.version="5.2.2",e}function w(e,t){var r,n,i;if(0===t&&1/t<0)t="-0";else if(!_.test(t+=""))throw Error(h+"number");for(e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),i=t.length,n=0;n<i&&"0"==t.charAt(n);)++n;if(n==i)e.c=[e.e=0];else{for(;i>0&&"0"==t.charAt(--i););for(e.e=r-n-1,e.c=[],r=0;n<=i;)e.c[r++]=+t.charAt(n++)}return e}function S(e,t,r,n){var i=e.c,s=e.e+t+1;if(s<i.length){if(1===r)n=i[s]>=5;else if(2===r)n=i[s]>5||5==i[s]&&(n||s<0||i[s+1]!==b||1&i[s-1]);else if(3===r)n=n||!!i[0];else if(n=!1,0!==r)throw Error(m);if(s<1)i.length=1,n?(e.e=-t,i[0]=1):i[0]=e.e=0;else{if(i.length=s--,n)for(;++i[s]>9;)i[s]=0,s--||(++e.e,i.unshift(1));for(s=i.length;!i[--s];)i.pop()}}else if(r<0||r>3||r!==~~r)throw Error(m);return e}function E(e,t,r,n){var i,s,o=e.constructor,a=!e.c[0];if(r!==b){if(r!==~~r||r<(3==t)||r>u)throw Error(3==t?h+"precision":p);for(r=n-(e=new o(e)).e,e.c.length>++n&&S(e,r,o.RM),2==t&&(n=e.e+r+1);e.c.length<n;)e.c.push(0)}if(i=e.e,r=(s=e.c.join("")).length,2!=t&&(1==t||3==t&&n<=i||i<=o.NE||i>=o.PE))s=s.charAt(0)+(r>1?"."+s.slice(1):"")+(i<0?"e":"e+")+i;else if(i<0){for(;++i;)s="0"+s;s="0."+s}else if(i>0)if(++i>r)for(i-=r;i--;)s+="0";else i<r&&(s=s.slice(0,i)+"."+s.slice(i));else r>1&&(s=s.charAt(0)+"."+s.slice(1));return e.s<0&&(!a||4==t)?"-"+s:s}g.abs=function(){var e=new this.constructor(this);return e.s=1,e},g.cmp=function(e){var t,r=this,n=r.c,i=(e=new r.constructor(e)).c,s=r.s,o=e.s,a=r.e,u=e.e;if(!n[0]||!i[0])return n[0]?s:i[0]?-o:0;if(s!=o)return s;if(t=s<0,a!=u)return a>u^t?1:-1;for(o=(a=n.length)<(u=i.length)?a:u,s=-1;++s<o;)if(n[s]!=i[s])return n[s]>i[s]^t?1:-1;return a==u?0:a>u^t?1:-1},g.div=function(e){var t=this,r=t.constructor,n=t.c,i=(e=new r(e)).c,s=t.s==e.s?1:-1,o=r.DP;if(o!==~~o||o<0||o>u)throw Error(p);if(!i[0])throw Error(y);if(!n[0])return new r(0*s);var a,l,c,d,f,h=i.slice(),m=a=i.length,g=n.length,_=n.slice(0,a),v=_.length,w=e,E=w.c=[],j=0,k=o+(w.e=t.e-e.e)+1;for(w.s=s,s=k<0?0:k,h.unshift(0);v++<a;)_.push(0);do{for(c=0;c<10;c++){if(a!=(v=_.length))d=a>v?1:-1;else for(f=-1,d=0;++f<a;)if(i[f]!=_[f]){d=i[f]>_[f]?1:-1;break}if(!(d<0))break;for(l=v==a?i:h;v;){if(_[--v]<l[v]){for(f=v;f&&!_[--f];)_[f]=9;--_[f],_[v]+=10}_[v]-=l[v]}for(;!_[0];)_.shift()}E[j++]=d?c:++c,_[0]&&d?_[v]=n[m]||0:_=[n[m]]}while((m++<g||_[0]!==b)&&s--);return E[0]||1==j||(E.shift(),w.e--),j>k&&S(w,o,r.RM,_[0]!==b),w},g.eq=function(e){return!this.cmp(e)},g.gt=function(e){return this.cmp(e)>0},g.gte=function(e){return this.cmp(e)>-1},g.lt=function(e){return this.cmp(e)<0},g.lte=function(e){return this.cmp(e)<1},g.minus=g.sub=function(e){var t,r,n,i,s=this,o=s.constructor,a=s.s,u=(e=new o(e)).s;if(a!=u)return e.s=-u,s.plus(e);var l=s.c.slice(),c=s.e,d=e.c,f=e.e;if(!l[0]||!d[0])return d[0]?(e.s=-u,e):new o(l[0]?s:0);if(a=c-f){for((i=a<0)?(a=-a,n=l):(f=c,n=d),n.reverse(),u=a;u--;)n.push(0);n.reverse()}else for(r=((i=l.length<d.length)?l:d).length,a=u=0;u<r;u++)if(l[u]!=d[u]){i=l[u]<d[u];break}if(i&&(n=l,l=d,d=n,e.s=-e.s),(u=(r=d.length)-(t=l.length))>0)for(;u--;)l[t++]=0;for(u=t;r>a;){if(l[--r]<d[r]){for(t=r;t&&!l[--t];)l[t]=9;--l[t],l[r]+=10}l[r]-=d[r]}for(;0===l[--u];)l.pop();for(;0===l[0];)l.shift(),--f;return l[0]||(e.s=1,l=[f=0]),e.c=l,e.e=f,e},g.mod=function(e){var t,r=this,n=r.constructor,i=r.s,s=(e=new n(e)).s;if(!e.c[0])throw Error(y);return r.s=e.s=1,t=1==e.cmp(r),r.s=i,e.s=s,t?new n(r):(i=n.DP,s=n.RM,n.DP=n.RM=0,r=r.div(e),n.DP=i,n.RM=s,this.minus(r.times(e)))},g.plus=g.add=function(e){var t,r=this,n=r.constructor,i=r.s,s=(e=new n(e)).s;if(i!=s)return e.s=-s,r.minus(e);var o=r.e,a=r.c,u=e.e,l=e.c;if(!a[0]||!l[0])return l[0]?e:new n(a[0]?r:0*i);if(a=a.slice(),i=o-u){for(i>0?(u=o,t=l):(i=-i,t=a),t.reverse();i--;)t.push(0);t.reverse()}for(a.length-l.length<0&&(t=l,l=a,a=t),i=l.length,s=0;i;a[i]%=10)s=(a[--i]=a[i]+l[i]+s)/10|0;for(s&&(a.unshift(s),++u),i=a.length;0===a[--i];)a.pop();return e.c=a,e.e=u,e},g.pow=function(e){var t=this,r=new t.constructor(1),n=r,i=e<0;if(e!==~~e||e<-1e6||e>1e6)throw Error(h+"exponent");for(i&&(e=-e);1&e&&(n=n.times(t)),e>>=1;)t=t.times(t);return i?r.div(n):n},g.round=function(e,t){var r=this.constructor;if(e===b)e=0;else if(e!==~~e||e<-u||e>u)throw Error(p);return S(new r(this),e,t===b?r.RM:t)},g.sqrt=function(){var e,t,r,n=this,i=n.constructor,s=n.s,o=n.e,a=new i(.5);if(!n.c[0])return new i(n);if(s<0)throw Error(f+"No square root");0===(s=Math.sqrt(n+""))||s===1/0?((t=n.c.join("")).length+o&1||(t+="0"),s=Math.sqrt(t),o=((o+1)/2|0)-(o<0||1&o),e=new i((s==1/0?"1e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+o)):e=new i(s),o=e.e+(i.DP+=4);do{r=e,e=a.times(r.plus(n.div(r)))}while(r.c.slice(0,o).join("")!==e.c.slice(0,o).join(""));return S(e,i.DP-=4,i.RM)},g.times=g.mul=function(e){var t,r=this,n=r.constructor,i=r.c,s=(e=new n(e)).c,o=i.length,a=s.length,u=r.e,l=e.e;if(e.s=r.s==e.s?1:-1,!i[0]||!s[0])return new n(0*e.s);for(e.e=u+l,o<a&&(t=i,i=s,s=t,l=o,o=a,a=l),t=new Array(l=o+a);l--;)t[l]=0;for(u=a;u--;){for(a=0,l=o+u;l>u;)a=t[l]+s[u]*i[l-u-1]+a,t[l--]=a%10,a=a/10|0;t[l]=(t[l]+a)%10}for(a?++e.e:t.shift(),u=t.length;!t[--u];)t.pop();return e.c=t,e},g.toExponential=function(e){return E(this,1,e,e)},g.toFixed=function(e){return E(this,2,e,this.e+e)},g.toPrecision=function(e){return E(this,3,e,e-1)},g.toString=function(){return E(this)},g.valueOf=g.toJSON=function(){return E(this,4)},(s=v()).default=s.Big=s,void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}(this)},"./node_modules/bignumber.js/bignumber.js":function(e,t,r){var n;!function(i){"use strict";var s,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,u=Math.floor,l="[BigNumber Error] ",c=l+"Number primitive has more than 15 significant digits: ",d=1e14,f=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,y=1e9;function g(e){var t,r,n,i=H.prototype={constructor:H,toString:null,valueOf:null},s=new H(1),x=20,A=4,C=-7,T=21,I=-1e7,B=1e7,M=!1,R=1,N=0,L={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0},O="0123456789abcdefghijklmnopqrstuvwxyz",P,D,U,K,F,q,V;function H(e,t){var i,s,a,l,d,p,m,y,g=this;if(!(g instanceof H))return new H(e,t);if(null==t){if(e instanceof H)return g.s=e.s,g.e=e.e,void(g.c=(e=e.c)?e.slice():e);if((p="number"==typeof e)&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,d=e;d>=10;d/=10,l++);return g.e=l,void(g.c=[e])}y=e+""}else{if(!o.test(y=e+""))return n(g,y,p);g.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(l=y.indexOf("."))>-1&&(y=y.replace(".","")),(d=y.search(/e/i))>0?(l<0&&(l=d),l+=+y.slice(d+1),y=y.substring(0,d)):l<0&&(l=y.length)}else{if(w(t,2,O.length,"Base"),y=e+"",10==t)return Y(g=new H(e instanceof H?e:y),x+g.e+