UNPKG

@oraichain/default

Version:
2 lines 722 kB
/*! For license information please see default.umd.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Default=t():e.Default=t()}(self,(()=>(()=>{var e={1111:(e,t)=>{var r;function n(e,t){navigator.onLine||e("offline"),e("error",t)}function i(e,t,r){navigator.serviceWorker.register(e,r).then((function(e){t("registered",e),e.waiting?t("updated",e):e.onupdatefound=function(){t("updatefound",e);var r=e.installing;r.onstatechange=function(){"installed"===r.state&&(navigator.serviceWorker.controller?t("updated",e):t("cached",e))}}})).catch((function(e){return n(t,e)}))}"undefined"!=typeof window&&(r="undefined"==typeof document||"interactive"!==document.readyState&&"complete"!==document.readyState?"undefined"!=typeof Promise?new Promise((function(e){return window.addEventListener("load",e)})):{then:function(e){return window.addEventListener("load",e)}}:Promise.resolve()),t.z=function(e,t){void 0===t&&(t={});var o=t.registrationOptions;void 0===o&&(o={}),delete t.registrationOptions;var a=function(e){for(var r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];t&&t[e]&&t[e].apply(t,r)};"serviceWorker"in navigator&&r.then((function(){Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))?(function(e,t,r){fetch(e).then((function(n){404===n.status?(t("error",new Error("Service worker not found at "+e)),unregister()):-1===n.headers.get("content-type").indexOf("javascript")?(t("error",new Error("Expected "+e+" to have javascript content-type, but received "+n.headers.get("content-type"))),unregister()):i(e,t,r)})).catch((function(e){return n(t,e)}))}(e,a,o),navigator.serviceWorker.ready.then((function(e){a("ready",e)}))):(i(e,a,o),navigator.serviceWorker.ready.then((function(e){a("ready",e)})))}))}},6270:(e,t,r)=>{"use strict";var n=r(8834).Buffer;const i=new(0,r(7554).ec)("secp256k1"),o=r.g.crypto||r.g.msCrypto||{},a=o.subtle||o.webkitSubtle,s=r(5634),c=n.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),f=n.alloc(32,0);function u(e,t){if(!e)throw new Error(t||"Assertion failed")}function h(e){return t=e,!(!n.isBuffer(t)||32!==t.length)&&e.compare(f)>0&&e.compare(c)<0;var t}function d(e){return async function(t,r,i){if(a){const o={name:"AES-CBC"},s=await a.importKey("raw",r,o,!1,[e]),c={name:"AES-CBC",iv:t},f=await a[e](c,s,i);return n.from(new Uint8Array(f))}if("encrypt"===e){const e=s.createCipheriv("aes-256-cbc",r,t);let o=e.update(i),a=e.final();return n.concat([o,a])}if("decrypt"===e){const e=s.createDecipheriv("aes-256-cbc",r,t);let o=e.update(i),a=e.final();return n.concat([o,a])}}}d("encrypt"),d("decrypt");t.rc=function(e){return u(32===e.length,"Bad private key"),u(h(e),"Bad private key"),n.from(i.keyFromPrivate(e).getPublic("arr"))};t.Xx=async function(e,t){return u(32===e.length,"Bad private key"),u(h(e),"Bad private key"),u(t.length>0,"Message should not be empty"),u(t.length<=32,"Message is too long"),n.from(i.sign(t,e,{canonical:!0}).toDER())}},1249:(e,t,r)=>{"use strict";var n=r(8834).Buffer,i=new(0,r(7554).ec)("secp256k1"),o=r.g.crypto||r.g.msCrypto||{},a=o.subtle||o.webkitSubtle,s=r(5634);const c=n.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),f=n.alloc(32,0);function u(e,t){if(!e)throw new Error(t||"Assertion failed")}function h(e){return t=e,!(!n.isBuffer(t)||32!==t.length)&&e.compare(f)>0&&e.compare(c)<0;var t}function d(e){var t=new Uint8Array(e);return void 0===o.getRandomValues?n.from(s.randomBytes(e)):(o.getRandomValues(t),n.from(t))}function l(e){return new Promise((function(t){var r=s.createHash("sha512").update(e).digest();t(new Uint8Array(r))}))}function p(e){return function(t,r,i){return new Promise((function(o){if(a)return a.importKey("raw",r,{name:"AES-CBC"},!1,[e]).then((function(r){var n={name:"AES-CBC",iv:t};return a[e](n,r,i)})).then((function(e){o(n.from(new Uint8Array(e)))}));if("encrypt"===e){var c=s.createCipheriv("aes-256-cbc",r,t);let e=c.update(i),a=c.final();o(n.concat([e,a]))}else if("decrypt"===e){var f=s.createDecipheriv("aes-256-cbc",r,t);let e=f.update(i),a=f.final();o(n.concat([e,a]))}}))}}var y=p("encrypt"),b=p("decrypt");t.oq=function(){for(var e=d(32);!h(e);)e=d(32);return e};var g=t.rc=function(e){return u(32===e.length,"Bad private key"),u(h(e),"Bad private key"),n.from(i.keyFromPrivate(e).getPublic("arr"))},m=function(e,t){return new Promise((function(r){u(n.isBuffer(e),"Bad private key"),u(n.isBuffer(t),"Bad public key"),u(32===e.length,"Bad private key"),u(h(e),"Bad private key"),u(65===t.length||33===t.length,"Bad public key"),65===t.length&&u(4===t[0],"Bad public key"),33===t.length&&u(2===t[0]||3===t[0],"Bad public key");var o=i.keyFromPrivate(e),a=i.keyFromPublic(t),s=o.derive(a.getPublic());r(n.from(s.toArray()))}))};t.HI=function(e,t,r){var i,o,a,c;return r=r||{},new Promise((function(t){for(var n=r.ephemPrivateKey||d(32);!h(n);)n=r.ephemPrivateKey||d(32);o=g(n),t(m(n,e))})).then((function(e){return l(e)})).then((function(e){i=r.iv||d(16);var n=e.slice(0,32);return c=e.slice(32),y(i,n,t)})).then((function(e){a=e;var t=n.concat([i,o,a]);return function(e,t){return new Promise((function(r){var i=s.createHmac("sha256",n.from(e));i.update(t),r(i.digest())}))}(c,t)})).then((function(e){return{iv:i,ephemPublicKey:o,ciphertext:a,mac:e}}))},t.pe=function(e,t){var r;return m(e,t.ephemPublicKey).then((function(e){return l(e)})).then((function(e){r=e.slice(0,32);var i,o,a,c=e.slice(32),f=n.concat([t.iv,t.ephemPublicKey,t.ciphertext]);return i=c,o=f,a=t.mac,new Promise((function(e){var t=s.createHmac("sha256",n.from(i));t.update(o),e(function(e,t){if(e.length!==t.length)return!1;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(t.digest(),a))}))})).then((function(e){return u(e,"Bad MAC"),b(t.iv,r,t.ciphertext)})).then((function(e){return n.from(new Uint8Array(e))}))}},8500:(e,t,r)=>{"use strict";var n=r(8834).Buffer;const i=new(0,r(7554).ec)("secp256k1"),o=r.g.crypto||r.g.msCrypto||{},a=o.subtle||o.webkitSubtle,s=r(5634),c=n.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),f=n.alloc(32,0);function u(e,t){if(!e)throw new Error(t||"Assertion failed")}function h(e){return t=e,!(!n.isBuffer(t)||32!==t.length)&&e.compare(f)>0&&e.compare(c)<0;var t}function d(e){const t=new Uint8Array(e);return void 0===o.getRandomValues?n.from(s.randomBytes(e)):(o.getRandomValues(t),n.from(t))}async function l(e){if(a){const t=await a.digest("SHA-512",e);return new Uint8Array(t)}const t=s.createHash("sha512").update(e).digest();return new Uint8Array(t)}function p(e){return async function(t,r,i){if(a){const o={name:"AES-CBC"},s=await a.importKey("raw",r,o,!1,[e]),c={name:"AES-CBC",iv:t},f=await a[e](c,s,i);return n.from(new Uint8Array(f))}if("encrypt"===e){const e=s.createCipheriv("aes-256-cbc",r,t);let o=e.update(i),a=e.final();return n.concat([o,a])}if("decrypt"===e){const e=s.createDecipheriv("aes-256-cbc",r,t);let o=e.update(i),a=e.final();return n.concat([o,a])}}}const y=p("encrypt"),b=p("decrypt");async function g(e,t){if(a){const r={name:"HMAC",hash:{name:"SHA-256"}},i=await a.importKey("raw",new Uint8Array(e),r,!1,["sign","verify"]),o=await a.sign("HMAC",i,t);return n.from(new Uint8Array(o))}const r=s.createHmac("sha256",n.from(e));return r.update(t),r.digest()}const m=t.rc=function(e){return u(32===e.length,"Bad private key"),u(h(e),"Bad private key"),n.from(i.keyFromPrivate(e).getPublic("arr"))},v=async function(e,t){u(n.isBuffer(e),"Bad private key"),u(n.isBuffer(t),"Bad public key"),u(32===e.length,"Bad private key"),u(h(e),"Bad private key"),u(65===t.length||33===t.length,"Bad public key"),65===t.length&&u(4===t[0],"Bad public key"),33===t.length&&u(2===t[0]||3===t[0],"Bad public key");const r=i.keyFromPrivate(e),o=i.keyFromPublic(t),a=r.derive(o.getPublic());return n.from(a.toArray())},w=async function(e,t){u(n.isBuffer(e),"Bad private key"),u(n.isBuffer(t),"Bad public key"),u(32===e.length,"Bad private key"),u(h(e),"Bad private key"),u(65===t.length||33===t.length,"Bad public key"),65===t.length&&u(4===t[0],"Bad public key"),33===t.length&&u(2===t[0]||3===t[0],"Bad public key");const r=i.keyFromPrivate(e),o=i.keyFromPublic(t),a=r.derive(o.getPublic());return n.from(a.toString(16,64),"hex")};t.HI=async function(e,t,r){let i,o,a,s,c=(r=r||{}).ephemPrivateKey||d(32);for(;!h(c);)c=r.ephemPrivateKey||d(32);o=m(c);const f=await v(c,e),u=await l(f);i=r.iv||d(16);const p=u.slice(0,32);s=u.slice(32),a=await y(i,p,t);const b=n.concat([i,o,a]);return{iv:i,ephemPublicKey:o,ciphertext:a,mac:await g(s,b)}};const _=async function(e,t){let r,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=i?w:v,a=await o(e,t.ephemPublicKey),s=await l(a);r=s.slice(0,32);const c=s.slice(32),f=n.concat([t.iv,t.ephemPublicKey,t.ciphertext]),u=await async function(e,t,r){return function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(await g(e,t),r)}(c,f,t.mac);if(!u&&!1===i)return _(e,t,!0);if(!u&&!0===i)throw new Error("bad MAC after trying padded");const h=await b(t.iv,r,t.ciphertext);return n.from(new Uint8Array(h))};t.pe=_},2812:(e,t,r)=>{"use strict";const n=t;n.bignum=r(2197),n.define=r(5192).define,n.base=r(4798),n.constants=r(6906),n.decoders=r(8211),n.encoders=r(9116)},5192:(e,t,r)=>{"use strict";const n=r(9116),i=r(8211),o=r(1285);function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(e){const t=this.name;function r(e){this._initNamed(e,t)}return o(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},7362:(e,t,r)=>{"use strict";const n=r(1285),i=r(126).b,o=r(7654).Buffer;function a(e,t){i.call(this,t),o.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function s(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return s.isEncoderBuffer(e)||(e=new s(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}}n(a,i),t.C=a,a.isDecoderBuffer=function(e){return e instanceof a||"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},a.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},a.prototype.restore=function(e){const t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new a(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.R=s,s.isEncoderBuffer=function(e){return e instanceof s||"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},s.prototype.join=function(e,t){return e||(e=o.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(e,t),t+=r.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):o.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},4798:(e,t,r)=>{"use strict";const n=t;n.Reporter=r(126).b,n.DecoderBuffer=r(7362).C,n.EncoderBuffer=r(7362).R,n.Node=r(847)},847:(e,t,r)=>{"use strict";const n=r(126).b,i=r(7362).R,o=r(7362).C,a=r(9561),s=["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"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function f(e,t,r){const n={};this._baseState=n,n.name=r,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=f;const u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];f.prototype.clone=function(){const e=this._baseState,t={};u.forEach((function(r){t[r]=e[r]}));const r=new this.constructor(t.parent);return r._baseState=t,r},f.prototype._wrap=function(){const e=this._baseState;c.forEach((function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},f.prototype._init=function(e){const t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),a.equal(t.children.length,1,"Root node can have only one child")},f.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&&(a(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.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})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){f.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),s.forEach((function(e){f.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(r),this}})),f.prototype.use=function(e){a(e);const t=this._baseState;return a(null===t.use),t.use=e,this},f.prototype.optional=function(){return this._baseState.optional=!0,this},f.prototype.def=function(e){const t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},f.prototype.explicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},f.prototype.implicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},f.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},f.prototype.key=function(e){const t=this._baseState;return a(null===t.key),t.key=e,this},f.prototype.any=function(){return this._baseState.any=!0,this},f.prototype.choice=function(e){const t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},f.prototype.contains=function(e){const t=this._baseState;return a(null===t.use),t.contains=e,this},f.prototype._decode=function(e,t){const r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));let n,i=r.default,a=!0,s=null;if(null!==r.key&&(s=e.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(a=this._peekTag(e,n,r.any),e.isError(a))return a}else{const n=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(n)}}if(r.obj&&a&&(n=e.enterObject()),a){if(null!==r.explicit){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===r.use&&null===r.choice){let t;r.any&&(t=e.save());const n=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(n))return n;r.any?i=e.raw(t):e=n}if(t&&t.track&&null!==r.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(e,t)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new o(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(n,t)}}return r.obj&&a&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==a?null!==s&&e.exitKey(s):e.leaveKey(s,r.key,i),i},f.prototype._decodeGeneric=function(e,t,r){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.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,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},f.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),a(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},f.prototype._decodeChoice=function(e,t){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(o){const a=e.save(),s=r.choice[o];try{const r=s._decode(e,t);if(e.isError(r))return!1;n={type:o,value:r},i=!0}catch(t){return e.restore(a),!1}return!0}),this),i?n:e.error("Choice not matched")},f.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},f.prototype._encode=function(e,t,r){const n=this._baseState;if(null!==n.default&&n.default===e)return;const i=this._encodeValue(e,t,r);return void 0===i||this._skipDefault(i,t,r)?void 0:i},f.prototype._encodeValue=function(e,t,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new n);let o=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}let a=null,s=!1;if(i.any)o=this._createEncoderBuffer(e);else if(i.choice)o=this._encodeChoice(e,t);else if(i.contains)a=this._getUse(i.contains,r)._encode(e,t),s=!0;else if(i.children)a=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const n=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const i=r._encode(e[r._baseState.key],t,e);return t.leaveKey(n),i}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(r){const n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)}),r))}else null!==i.use?o=this._getUse(i.use,r)._encode(e,t):(a=this._encodePrimitive(i.tag,e),s=!0);if(!i.any&&null===i.choice){const e=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===e?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(e,s,r,a))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},f.prototype._encodeChoice=function(e,t){const r=this._baseState,n=r.choice[e.type];return n||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},f.prototype._encodePrimitive=function(e,t){const 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)},f.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},f.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},126:(e,t,r)=>{"use strict";const n=r(1285);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.b=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){let t;const r=this._reporterState,n=e instanceof o;if(t=n?e:new o(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(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}},4131:(e,t)=>{"use strict";function r(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=r(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=r(t.tag)},6906:(e,t,r)=>{"use strict";const n=t;n._reverse=function(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r})),t},n.der=r(4131)},1066:(e,t,r)=>{"use strict";const n=r(1285),i=r(2197),o=r(7362).C,a=r(847),s=r(4131);function c(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new f,this.tree._init(e.body)}function f(e){a.call(this,"der",e)}function u(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const n=s.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;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function h(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=c,c.prototype.decode=function(e,t){return o.isDecoderBuffer(e)||(e=new o(e,t)),this.tree._decode(e,t)},n(f,a),f.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;const n=e.save(),i=u(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(n),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||r)},f.prototype._decodeTag=function(e,t,r){const n=u(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;let i=h(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');const o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(i=e.offset-o.offset,e.restore(o),e.skip(i,'Failed to match body of: "'+t+'"'))},f.prototype._skipUntilEnd=function(e,t){for(;;){const r=u(e,t);if(e.isError(r))return r;const n=h(e,r.primitive,t);if(e.isError(n))return n;let i;if(i=r.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(i))return i;if("end"===r.tagStr)break}},f.prototype._decodeList=function(e,t,r,n){const i=[];for(;!e.isEmpty();){const t=this._peekTag(e,"end");if(e.isError(t))return t;const o=r.decode(e,"der",n);if(e.isError(o)&&t)break;i.push(o)}return i},f.prototype._decodeStr=function(e,t){if("bitstr"===t){const t=e.readUInt8();return e.isError(t)?t:{unused:t,data:e.raw()}}if("bmpstr"===t){const t=e.raw();if(t.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let r="";for(let e=0;e<t.length/2;e++)r+=String.fromCharCode(t.readUInt16BE(2*e));return r}if("numstr"===t){const t=e.raw().toString("ascii");return this._isNumstr(t)?t:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){const t=e.raw().toString("ascii");return this._isPrintstr(t)?t:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},f.prototype._decodeObjid=function(e,t,r){let n;const i=[];let o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=127&a,0==(128&a)&&(i.push(o),o=0);128&a&&i.push(o);const s=i[0]/40|0,c=i[0]%40;if(n=r?i:[s,c].concat(i.slice(1)),t){let e=t[n.join(" ")];void 0===e&&(e=t[n.join(".")]),void 0!==e&&(n=e)}return n},f.prototype._decodeTime=function(e,t){const r=e.raw().toString();let n,i,o,a,s,c;if("gentime"===t)n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),a=0|r.slice(8,10),s=0|r.slice(10,12),c=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),a=0|r.slice(6,8),s=0|r.slice(8,10),c=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,a,s,c,0)},f.prototype._decodeNull=function(){return null},f.prototype._decodeBool=function(e){const t=e.readUInt8();return e.isError(t)?t:0!==t},f.prototype._decodeInt=function(e,t){const r=e.raw();let n=new i(r);return t&&(n=t[n.toString(10)]||n),n},f.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},8211:(e,t,r)=>{"use strict";const n=t;n.der=r(1066),n.pem=r(3956)},3956:(e,t,r)=>{"use strict";const n=r(1285),i=r(7654).Buffer,o=r(1066);function a(e){o.call(this,e),this.enc="pem"}n(a,o),e.exports=a,a.prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/;let s=-1,c=-1;for(let e=0;e<r.length;e++){const t=r[e].match(a);if(null!==t&&t[2]===n){if(-1!==s){if("END"!==t[1])break;c=e;break}if("BEGIN"!==t[1])break;s=e}}if(-1===s||-1===c)throw new Error("PEM section not found for: "+n);const f=r.slice(s+1,c).join("");f.replace(/[^a-z0-9+/=]+/gi,"");const u=i.from(f,"base64");return o.prototype.decode.call(this,u,t)}},5758:(e,t,r)=>{"use strict";const n=r(1285),i=r(7654).Buffer,o=r(847),a=r(4131);function s(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){o.call(this,"der",e)}function f(e){return e<10?"0"+e:e}e.exports=s,s.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(c,o),c.prototype._encodeComposite=function(e,t,r,n){const o=function(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,i)}(e,t,r,this.reporter);if(n.length<128){const e=i.alloc(2);return e[0]=o,e[1]=n.length,this._createEncoderBuffer([e,n])}let s=1;for(let e=n.length;e>=256;e>>=8)s++;const c=i.alloc(2+s);c[0]=o,c[1]=128|s;for(let e=1+s,t=n.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,n])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=i.alloc(2*e.length);for(let r=0;r<e.length;r++)t.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(t)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):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(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},c.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let t=0;t<e.length;t++)e[t]|=0}else if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t<e.length;t++){let r=e[t];for(n++;r>=128;r>>=7)n++}const o=i.alloc(n);let a=o.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(o[a--]=127&r;(r>>=7)>0;)o[a--]=128|127&r}return this._createEncoderBuffer(o)},c.prototype._encodeTime=function(e,t){let r;const n=new Date(e);return"gentime"===t?r=[f(n.getUTCFullYear()),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[f(n.getUTCFullYear()%100),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=i.from(t)}if(i.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=i.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const n=new Array(r);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,r){const n=this._baseState;let i;if(null===n.default)return!1;const o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==n.defaultBuffer[i])return!1;return!0}},9116:(e,t,r)=>{"use strict";const n=t;n.der=r(5758),n.pem=r(9245)},9245:(e,t,r)=>{"use strict";const n=r(1285),i=r(5758);function o(e){i.call(this,e),this.enc="pem"}n(o,i),e.exports=o,o.prototype.encode=function(e,t){const r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"];for(let e=0;e<r.length;e+=64)n.push(r.slice(e,e+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},1696:(e,t,r)=>{"use strict";var n=r(4406);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o,a,s=r(7515).codes,c=s.ERR_AMBIGUOUS_ARGUMENT,f=s.ERR_INVALID_ARG_TYPE,u=s.ERR_INVALID_ARG_VALUE,h=s.ERR_INVALID_RETURN_VALUE,d=s.ERR_MISSING_ARGS,l=r(4082),p=r(3335).inspect,y=r(3335).types,b=y.isPromise,g=y.isRegExp,m=Object.assign?Object.assign:r(4956).assign,v=Object.is?Object.is:r(4679);function w(){var e=r(6796);o=e.isDeepEqual,a=e.isDeepStrictEqual}new Map;var _=!1,S=e.exports=x,E={};function k(e){if(e.message instanceof Error)throw e.message;throw new l(e)}function A(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new l({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function x(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];A.apply(void 0,[x,t.length].concat(t))}S.fail=function e(t,r,i,o,a){var s,c=arguments.length;if(0===c?s="Failed":1===c?(i=t,t=void 0):(!1===_&&(_=!0,(n.emitWarning?n.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===c&&(o="!=")),i instanceof Error)throw i;var f={actual:t,expected:r,operator:void 0===o?"fail":o,stackStartFn:a||e};void 0!==i&&(f.message=i);var u=new l(f);throw s&&(u.message=s,u.generatedMessage=!0),u},S.AssertionError=l,S.ok=x,S.equal=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t!=r&&k({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},S.notEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t==r&&k({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},S.deepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&w(),o(t,r)||k({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},S.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&w(),o(t,r)&&k({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},S.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&w(),a(t,r)||k({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},S.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&w(),a(t,r)&&k({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},S.strictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");v(t,r)||k({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},S.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");v(t,r)&&k({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var M=function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&g(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])}))};function O(e,t,r,n){if("function"!=typeof t){if(g(t))return t.test(e);if(2===arguments.length)throw new f("expected",["Function","RegExp"],t);if("object"!==i(e)||null===e){var s=new l({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw s.operator=n.name,s}var c=Object.keys(t);if(t instanceof Error)c.push("name","message");else if(0===c.length)throw new u("error",t,"may not be an empty object");return void 0===o&&w(),c.forEach((function(i){"string"==typeof e[i]&&g(t[i])&&t[i].test(e[i])||function(e,t,r,n,i,o){if(!(r in e)||!a(e[r],t[r])){if(!n){var s=new M(e,i),c=new M(t,i,e),f=new l({actual:s,expected:c,operator:"deepStrictEqual",stackStartFn:o});throw f.actual=e,f.expected=t,f.operator=o.name,f}k({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}(e,t,i,r,c,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function P(e){if("function"!=typeof e)throw new f("fn","Function",e);try{e()}catch(e){return e}return E}function B(e){return b(e)||null!==e&&"object"===i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function I(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!B(t=e()))throw new h("instance of Promise","promiseFn",t)}else{if(!B(e))throw new f("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return E})).catch((function(e){return e}))}))}function T(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new f("error",["Object","Error","Function","RegExp"],r);if("object"===i(t)&&null!==t){if(t.message===r)throw new c("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new c("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new f("error",["Object","Error","Function","RegExp"],r);if(t===E){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var a="rejects"===e.name?"rejection":"exception";k({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(o),stackStartFn:e})}if(r&&!O(t,r,n,e))throw t}function j(e,t,r,n){if(t!==E){if("string"==typeof r&&(n=r,r=void 0),!r||O(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";k({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function R(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];A.apply(void 0,[R,t.length].concat(t))}S.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];T.apply(void 0,[e,P(t)].concat(n))},S.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return I(t).then((function(t){return T.apply(void 0,[e,t].concat(n))}))},S.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];j.apply(void 0,[e,P(t)].concat(n))},S.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return I(t).then((function(t){return j.apply(void 0,[e,t].concat(n))}))},S.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===i(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=p(t);var n=new l({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),o=t.stack;if("string"==typeof o){var a=o.split("\n");a.shift();for(var s=n.stack.split("\n"),c=0;c<a.length;c++){var f=s.indexOf(a[c]);if(-1!==f){s=s.slice(0,f);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},S.strict=m(R,S,{equal:S.strictEqual,deepEqual:S.deepStrictEqual,notEqual:S.notStrictEqual,notDeepEqual:S.notDeepStrictEqual}),S.strict.strict=S.strict},4082:(e,t,r)=>{"use strict";var n=r(4406);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){var t="function"==typeof Map?new Map:void 0;return c=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return f(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)},c(e)}function f(e,t,r){return f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&u(i,r.prototype),i},f.apply(null,arguments)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}var l=r(3335).inspect,p=r(7515).codes.ERR_INVALID_ARG_TYPE;function y(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var b="",g="",m="",v="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function S(e){return l(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var E=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==d(e)||null===e)throw new p("options","Object",e);var i=e.message,o=e.operator,c=e.stackStartFn,f=e.actual,u=e.expected,l=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=a(this,h(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(b="",g="",v="",m=""):(b="",g="",v="",m="")),"object"===d(f)&&null!==f&&"object"===d(u)&&null!==u&&"stack"in f&&f instanceof Error&&"stack"in u&&u instanceof Error&&(f=_(f),u=_(u)),"deepStrictEqual"===o||"strictEqual"===o)r=a(this,h(t).call(this,function(e,t,r){var i="",o="",a=0,s="",c=!1,f=S(e),u=f.split("\n"),h=S(t).split("\n"),l=0,p="";if("strictEqual"===r&&"object"===d(e)&&"object"===d(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===h.length&&u[0]!==h[0]){var _=u[0].length+h[0].length;if(_<=10){if(!("object"===d(e)&&null!==e||"object"===d(t)&&null!==t||0===e&&0===t))return"".concat(w[r],"\n\n")+"".concat(u[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&_<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][l]===h[0][l];)l++;l>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",l),"^"),l=0)}}for(var E=u[u.length-1],k=h[h.length-1];E===k&&(l++<2?s="\n ".concat(E).concat(s):i=E,u.pop(),h.pop(),0!==u.length&&0!==h.length);)E=u[u.length-1],k=h[h.length-1];var A=Math.max(u.length,h.length);if(0===A){var x=f.split("\n");if(x.length>30)for(x[26]="".concat(b,"...").concat(v);x.length>27;)x.pop();return"".concat(w.notIdentical,"\n\n").concat(x.join("\n"),"\n")}l>3&&(s="\n".concat(b,"...").concat(v).concat(s),c=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var M=0,O=w[r]+"\n".concat(g,"+ actual").concat(v," ").concat(m,"- expected").concat(v),P=" ".concat(b,"...").concat(v," Lines skipped");for(l=0;l<A;l++){var B=l-a;if(u.length<l+1)B>1&&l>2&&(B>4?(o+="\n".concat(b,"...").concat(v),c=!0):B>3&&(o+="\n ".concat(h[l-2]),M++),o+="\n ".concat(h[l-1]),M++),a=l,i+="\n".concat(m,"-").concat(v," ").concat(h[l]),M++;else if(h.length<l+1)B>1&&l>2&&(B>4?(o+="\n".concat(b,"...").concat(v),c=!0):B>3&&(o+="\n ".concat(u[l-2]),M++),o+="\n ".concat(u[l-1]),M++),a=l,o+="\n".concat(g,"+").concat(v," ").concat(u[l]),M++;else{var I=h[l],T=u[l],j=T!==I&&(!y(T,",")||T.slice(0,-1)!==I);j&&y(I,",")&&I.slice(0,-1)===T&&(j=!1,T+=","),j?(B>1&&l>2&&(B>4?(o+="\n".concat(b,"...").concat(v),c=!0):B>3&&(o+="\n ".concat(u[l-2]),M++),o+="\n ".concat(u[l-1]),M++),a=l,o+="\n".concat(g,"+").concat(v," ").concat(T),i+="\n".concat(m,"-").concat(v," ").concat(I),M+=2):(o+=i,i="",1!==B&&0!==l||(o+="\n ".concat(T),M++))}if(M>20&&l<A-2)return"".concat(O).concat(P,"\n").concat(o,"\n").concat(b,"...").concat(v).concat(i,"\n")+"".concat(b,"...").concat(v)}return"".concat(O).concat(c?P:"","\n").concat(o).concat(i).concat(s).concat(p)}(f,u,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var E=w[o],k=S(f).split("\n");if("notStrictEqual"===o&&"object"===d(f)&&null!==f&&(E=w.notStrictEqualObject),k.length>30)for(k[26]="".concat(b,"...").concat(v);k.length>27;)k.pop();r=1===k.length?a(this,h(t).call(this,"".concat(E," ").concat(k[0]))):a(this,h(t).call(this,"".concat(E,"\n\n").concat(k.join("\n"),"\n")))}else{var A=S(f),x="",M=w[o];"notDeepEqual"===o||"notEqual"===o?(A="".concat(w[o],"\n\n").concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(x="".concat(S(u)),A.length>512&&(A="".concat(A.slice(0,509),"...")),x.length>512&&(x="".concat(x.slice(0,509),"...")),"deepEqual"===o||"equal"===o?A="".concat(M,"\n\n").concat(A,"\n\nshould equal\n\n"):x=" ".concat(o," ").concat(x)),r=a(this,h(t).call(this,"".concat(A).concat(x)))}return Error.stackTraceLimit=l,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=f,r.expected=u,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(s(r),c),r.stack,r.name="AssertionError",a(r)}var r,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),r=t,c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:l.custom,value:function(e,t){return l(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],c&&o(r.prototype,c),t}(c(Error));e.exports=E},7515:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var a,s,c={};function f(e,t,r){r||(r=Error);var a=function(r){function a(r,o,s){var c;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),c=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i(a).call(this,function(e,r,